1"use strict";(self.webpackChunkFinalytics=self.webpackChunkFinalytics||[]).push([["default-src_app_trading_core_trading_module_ts","src_app_trading_core_alerts_alertLog_component_ts"],{7915:(je,ke,x)=>{x.d(ke,{Kk:()=>nt,e4:()=>ut});var a=x(2741),T=x(6274);const G=["dialogPopup"],n=["hueSlider"],l=["alphaSlider"];function g(ae,Pe){if(1&ae&&a.\u0275\u0275element(0,"div"),2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275classMapInterpolate1("arrow arrow-",E.cpUsePosition,""),a.\u0275\u0275styleProp("top",E.arrowTop,"px")}}function b(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",26),a.\u0275\u0275listener("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onColorChange(Y)})("dragStart",function(){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onDragStart("saturation-lightness")})("dragEnd",function(){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onDragEnd("saturation-lightness")}),a.\u0275\u0275element(1,"div",13),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275styleProp("background-color",E.hueSliderColor),a.\u0275\u0275property("rgX",1)("rgY",1),a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("top",null==E.slider?null:E.slider.v,"px")("left",null==E.slider?null:E.slider.s,"px")}}function p(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"button",27),a.\u0275\u0275listener("click",function(Y){a.\u0275\u0275restoreView(E);const ie=a.\u0275\u0275nextContext();return ie.onAddPresetColor(Y,ie.selectedColor)}),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275classMap(E.cpAddColorButtonClass),a.\u0275\u0275property("disabled",E.cpPresetColors&&E.cpPresetColors.length>=E.cpMaxPresetColorsLength),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1(" ",E.cpAddColorButtonText," ")}}function h(ae,Pe){1&ae&&a.\u0275\u0275element(0,"div",28)}function o(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",34),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAlphaInput(Y)}),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275property("rg",1)("value",null==E.cmykText?null:E.cmykText.a)}}function u(ae,Pe){1&ae&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275text(1,"A"),a.\u0275\u0275elementEnd())}function m(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",29),a.\u0275\u0275elementStart(1,"div",30),a.\u0275\u0275elementStart(2,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onCyanInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(3,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onMagentaInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onYellowInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(5,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onBlackInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(6,o,1,2,"input",32),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(7,"div",30),a.\u0275\u0275elementStart(8,"div"),a.\u0275\u0275text(9,"C"),a.\u0275\u0275elementEnd(),a.\u
10275\u0275elementStart(10,"div"),a.\u0275\u0275text(11,"M"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(12,"div"),a.\u0275\u0275text(13,"Y"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(14,"div"),a.\u0275\u0275text(15,"K"),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(16,u,2,0,"div",33),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275styleProp("display",3!==E.format?"none":"block"),a.\u0275\u0275advance(2),a.\u0275\u0275property("rg",100)("value",null==E.cmykText?null:E.cmykText.c),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",100)("value",null==E.cmykText?null:E.cmykText.m),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",100)("value",null==E.cmykText?null:E.cmykText.y),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",100)("value",null==E.cmykText?null:E.cmykText.k),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel),a.\u0275\u0275advance(10),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel)}}function e(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",34),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAlphaInput(Y)}),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275property("rg",1)("value",null==E.hslaText?null:E.hslaText.a)}}function f(ae,Pe){1&ae&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275text(1,"A"),a.\u0275\u0275elementEnd())}function i(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",35),a.\u0275\u0275elementStart(1,"div",30),a.\u0275\u0275elementStart(2,"input",36),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onHueInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(3,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onSaturationInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onLightnessInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(5,e,1,2,"input",32),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(6,"div",30),a.\u0275\u0275elementStart(7,"div"),a.\u0275\u0275text(8,"H"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"div"),a.\u0275\u0275text(10,"S"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(11,"div"),a.\u0275\u0275text(12,"L"),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(13,f,2,0,"div",33),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275styleProp("display",2!==E.format?"none":"block"),a.\u0275\u0275advance(2),a.\u0275\u0275property("rg",360)("value",null==E.hslaText?null:E.hslaText.h),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",100)("value",null==E.hslaText?null:E.hslaText.s),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",100)("value",null==E.hslaText?null:E.hslaText.l),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel),a.\u0275\u0275advance(8),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel)}}function P(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",34),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u
10275\u0275nextContext(2).onAlphaInput(Y)}),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275property("rg",1)("value",null==E.rgbaText?null:E.rgbaText.a)}}function _(ae,Pe){1&ae&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275text(1,"A"),a.\u0275\u0275elementEnd())}function k(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",37),a.\u0275\u0275elementStart(1,"div",30),a.\u0275\u0275elementStart(2,"input",38),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onRedInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(3,"input",38),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onGreenInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"input",38),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onBlueInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(5,P,1,2,"input",32),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(6,"div",30),a.\u0275\u0275elementStart(7,"div"),a.\u0275\u0275text(8,"R"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"div"),a.\u0275\u0275text(10,"G"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(11,"div"),a.\u0275\u0275text(12,"B"),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(13,_,2,0,"div",33),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275styleProp("display",1!==E.format?"none":"block"),a.\u0275\u0275advance(2),a.\u0275\u0275property("rg",255)("value",null==E.rgbaText?null:E.rgbaText.r),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",255)("value",null==E.rgbaText?null:E.rgbaText.g),a.\u0275\u0275advance(1),a.\u0275\u0275property("rg",255)("value",null==E.rgbaText?null:E.rgbaText.b),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel),a.\u0275\u0275advance(8),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel)}}function W(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",34),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAlphaInput(Y)}),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275property("rg",1)("value",E.hexAlpha)}}function N(ae,Pe){1&ae&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275text(1,"A"),a.\u0275\u0275elementEnd())}function Q(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",39),a.\u0275\u0275elementStart(1,"div",30),a.\u0275\u0275elementStart(2,"input",40),a.\u0275\u0275listener("blur",function(){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onHexInput(null)})("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onHexInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(3,W,1,2,"input",32),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"div",30),a.\u0275\u0275elementStart(5,"div"),a.\u0275\u0275text(6,"Hex"),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(7,N,2,0,"div",33),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275styleProp("display",0!==E.format?"none":"block"),a.\u0275\u0275classProp("hex-alpha","forced"===E.cpAlphaChannel),a.\u0275\u0275advance(2),a.\u0275\u0275property("value",E.hexText),a.\u0275\u0275advance(1),a.\u
10275\u0275property("ngIf","forced"===E.cpAlphaChannel),a.\u0275\u0275advance(4),a.\u0275\u0275property("ngIf","forced"===E.cpAlphaChannel)}}function H(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",34),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAlphaInput(Y)}),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275property("rg",1)("value",null==E.hslaText?null:E.hslaText.a)}}function V(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",41),a.\u0275\u0275elementStart(1,"div",30),a.\u0275\u0275elementStart(2,"input",31),a.\u0275\u0275listener("keyup.enter",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onAcceptColor(Y)})("newValue",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onValueInput(Y)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(3,H,1,2,"input",32),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"div",30),a.\u0275\u0275elementStart(5,"div"),a.\u0275\u0275text(6,"V"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(7,"div"),a.\u0275\u0275text(8,"A"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275advance(2),a.\u0275\u0275property("rg",100)("value",null==E.hslaText?null:E.hslaText.l),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf","disabled"!==E.cpAlphaChannel)}}function w(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",42),a.\u0275\u0275elementStart(1,"span",43),a.\u0275\u0275listener("click",function(){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onFormatToggle(-1)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(2,"span",43),a.\u0275\u0275listener("click",function(){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext().onFormatToggle(1)}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}}function Z(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"span",50),a.\u0275\u0275listener("click",function(Y){a.\u0275\u0275restoreView(E);const ie=a.\u0275\u0275nextContext().$implicit;return a.\u0275\u0275nextContext(3).onRemovePresetColor(Y,ie)}),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(4);a.\u0275\u0275classMap(E.cpRemoveColorButtonClass)}}function F(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div",48),a.\u0275\u0275listener("click",function(){const ie=a.\u0275\u0275restoreView(E).$implicit;return a.\u0275\u0275nextContext(3).setColorFromString(ie)}),a.\u0275\u0275template(1,Z,1,3,"span",49),a.\u0275\u0275elementEnd()}if(2&ae){const E=Pe.$implicit,R=a.\u0275\u0275nextContext(3);a.\u0275\u0275styleProp("background-color",E),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",R.cpAddColorButton)}}function re(ae,Pe){if(1&ae&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275template(1,F,2,3,"div",47),a.\u0275\u0275elementEnd()),2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275classMap(E.cpPresetColorsClass),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",E.cpPresetColors)}}function X(ae,Pe){if(1&ae&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275classMap(E.cpPresetEmptyMessageClass),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(E.cpPresetEmptyMessage)}}function ne(ae,Pe){if(1&ae&&(a.\u0275\u0275elementStart(0,"div",44),a.\u0275\u0275element(1,"hr"),a.\u0275\u0275elementStart(2,"div",45),a.\u0275\u0275text(3),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(4,re,2,4,"div",46),a.\u0275\u0275template(5,X,2,4,"div",46),a.\u0275\u0275elementEnd()),2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(E.cpPresetLabel),a.\u0275\u0275advance(1),a.\u
10275\u0275property("ngIf",null==E.cpPresetColors?null:E.cpPresetColors.length),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!(null!=E.cpPresetColors&&E.cpPresetColors.length)&&E.cpAddColorButton)}}function he(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"button",53),a.\u0275\u0275listener("click",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onCancelColor(Y)}),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275classMap(E.cpCancelButtonClass),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(E.cpCancelButtonText)}}function fe(ae,Pe){if(1&ae){const E=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"button",53),a.\u0275\u0275listener("click",function(Y){return a.\u0275\u0275restoreView(E),a.\u0275\u0275nextContext(2).onAcceptColor(Y)}),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()}if(2&ae){const E=a.\u0275\u0275nextContext(2);a.\u0275\u0275classMap(E.cpOKButtonClass),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(E.cpOKButtonText)}}function Te(ae,Pe){if(1&ae&&(a.\u0275\u0275elementStart(0,"div",51),a.\u0275\u0275template(1,he,2,4,"button",52),a.\u0275\u0275template(2,fe,2,4,"button",52),a.\u0275\u0275elementEnd()),2&ae){const E=a.\u0275\u0275nextContext();a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",E.cpCancelButton),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",E.cpOKButton)}}var Ce=(()=>{return(ae=Ce||(Ce={}))[ae.HEX=0]="HEX",ae[ae.RGBA=1]="RGBA",ae[ae.HSLA=2]="HSLA",ae[ae.CMYK=3]="CMYK",Ce;var ae})();class be{constructor(Pe,E,R,Y){this.r=Pe,this.g=E,this.b=R,this.a=Y}}class Me{constructor(Pe,E,R,Y){this.h=Pe,this.s=E,this.v=R,this.a=Y}}class ue{constructor(Pe,E,R,Y){this.h=Pe,this.s=E,this.l=R,this.a=Y}}class Re{constructor(Pe,E,R,Y,ie=1){this.c=Pe,this.m=E,this.y=R,this.k=Y,this.a=ie}}let Ee=(()=>{class ae{constructor(){this.newValue=new a.EventEmitter}inputChange(E){const R=E.target.value;if(void 0===this.rg)this.newValue.emit(R);else{const Y=parseFloat(R);this.newValue.emit({v:Y,rg:this.rg})}}}return ae.\u0275fac=function(E){return new(E||ae)},ae.\u0275dir=a.\u0275\u0275defineDirective({type:ae,selectors:[["","text",""]],hostBindings:function(E,R){1&E&&a.\u0275\u0275listener("input",function(ie){return R.inputChange(ie)})},inputs:{rg:"rg",text:"text"},outputs:{newValue:"newValue"}}),ae})(),Ue=(()=>{class ae{constructor(E){this.elRef=E,this.dragEnd=new a.EventEmitter,this.dragStart=new a.EventEmitter,this.newValue=new a.EventEmitter,this.listenerMove=R=>this.move(R),this.listenerStop=()=>this.stop()}mouseDown(E){this.start(E)}touchStart(E){this.start(E)}move(E){E.preventDefault(),this.setCursor(E)}start(E){this.setCursor(E),E.stopPropagation(),document.addEventListener("mouseup",this.listenerStop),document.addEventListener("touchend",this.listenerStop),document.addEventListener("mousemove",this.listenerMove),document.addEventListener("touchmove",this.listenerMove),this.dragStart.emit()}stop(){document.removeEventListener("mouseup",this.listenerStop),document.removeEventListener("touchend",this.listenerStop),document.removeEventListener("mousemove",this.listenerMove),document.removeEventListener("touchmove",this.listenerMove),this.dragEnd.emit()}getX(E){const R=this.elRef.nativeElement.getBoundingClientRect();return(void 0!==E.pageX?E.pageX:E.touches[0].pageX)-R.left-window.pageXOffset}getY(E){const R=this.elRef.nativeElement.getBoundingClientRect();return(void 0!==E.pageY?E.pageY:E.touches[0].pageY)-R.top-window.pageYOffset}setCursor(E){const R=this.elRef.nativeElement.offsetWidth,Y=this.elRef.nativeElement.offsetHeight,ie=Math.max(0,Math.min(this.getX(E),R)),ge=Math.max(0,Math.min(this.getY(E),Y));void 0!==this.rgX&&void 0!==this.rgY?this.newValue.emit({s:ie/R,v:1-ge/Y,rgX:this.rgX,rgY:this.rgY}):void 0===this.rgX&&void 0!==this.rgY?this.newValue.emit({v:ge/Y,rgY:this.rgY}):void 0!==this.rgX&&void 0===this.rgY&&this.newValue.emit({v:ie/R,rgX:this.rgX})}}return ae.\u0275fac=function(E){return new(E||ae)(a.\u0275\u0275directiveInject(a.ElementRef))},ae.\u0275dir=a.\u0275\u0275defineDirective({type:ae,selectors:[["","slider",""]],hostBindings:function(E,R){1&E&&a.\u0275\u0275listener("mousedown",function(ie){return R.mouseDown(ie)})("touchstart",function(ie){return R.touchStart(ie)})},inputs:{rgX:"rgX",rgY:"rgY",slider:"slider"},outputs:{dragEnd:"dragEnd",dragStart:"dragStart",newValue:"newValue"}}),ae})();class Ze{constructor(Pe,E,R,Y){this.h=Pe,this.s=E,this.v=R,this.a=Y}}class Tt{constructor(Pe,E,R,Y){this.h=Pe,this.s=E,this.v=R,this.a=Y}}let ot=(()=>{class ae{constructor(){this.active=null}setActive(E){this.active&&this.active!==E&&"inline"!==this.active.cpDialogDisplay&&this.active.closeDialog(),this.active=E}hsva2hsla(E){const R=E.h,Y=E.s,ie=E.v,ge=E.a;if(0===ie)return new ue(R,0,0,ge);if(0===Y&&1===ie)return new ue(R,1,1,ge);{const xe=ie*(2-Y)/2;return new ue(R,ie*Y/(1-Math.abs(2*xe-1)),xe,ge)}}hsla2hsva(E){const R=Math.min(E.h,1),Y=Math.min(E.s,1),ie=Math.min(E.l,1),ge=Math.min(E.a,1);if(0===ie)return new Me(R,0,0,ge);{const xe=ie+Y*(1-Math.abs(2*ie-1))/2;
1return new Me(R,2*(xe-ie)/xe,xe,ge)}}hsvaToRgba(E){let R,Y,ie;const ge=E.h,xe=E.s,oe=E.v,me=E.a,L=Math.floor(6*ge),te=6*ge-L,J=oe*(1-xe),De=oe*(1-te*xe),Ke=oe*(1-(1-te)*xe);switch(L%6){case 0:R=oe,Y=Ke,ie=J;break;case 1:R=De,Y=oe,ie=J;break;case 2:R=J,Y=oe,ie=Ke;break;case 3:R=J,Y=De,ie=oe;break;case 4:R=Ke,Y=J,ie=oe;break;case 5:R=oe,Y=J,ie=De;break;default:R=0,Y=0,ie=0}return new be(R,Y,ie,me)}cmykToRgb(E){return new be((1-E.c)*(1-E.k),(1-E.m)*(1-E.k),(1-E.y)*(1-E.k),E.a)}rgbaToCmyk(E){const R=1-Math.max(E.r,E.g,E.b);return 1===R?new Re(0,0,0,1,E.a):new Re((1-E.r-R)/(1-R),(1-E.g-R)/(1-R),(1-E.b-R)/(1-R),R,E.a)}rgbaToHsva(E){let R,Y;const ie=Math.min(E.r,1),ge=Math.min(E.g,1),xe=Math.min(E.b,1),oe=Math.min(E.a,1),me=Math.max(ie,ge,xe),L=Math.min(ie,ge,xe),te=me,J=me-L;if(Y=0===me?0:J/me,me===L)R=0;else{switch(me){case ie:R=(ge-xe)/J+(ge<xe?6:0);break;case ge:R=(xe-ie)/J+2;break;case xe:R=(ie-ge)/J+4;break;default:R=0}R/=6}return new Me(R,Y,te,oe)}rgbaToHex(E,R){let Y="#"+(1<<24|E.r<<16|E.g<<8|E.b).toString(16).substr(1);return R&&(Y+=(256|Math.round(255*E.a)).toString(16).substr(1)),Y}normalizeCMYK(E){return new Re(E.c/100,E.m/100,E.y/100,E.k/100,E.a)}denormalizeCMYK(E){return new Re(Math.floor(100*E.c),Math.floor(100*E.m),Math.floor(100*E.y),Math.floor(100*E.k),E.a)}denormalizeRGBA(E){return new be(Math.round(255*E.r),Math.round(255*E.g),Math.round(255*E.b),E.a)}stringToHsva(E="",R=!1){let Y=null;E=(E||"").toLowerCase();const ie=[{re:/(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(ge){return new be(parseInt(ge[2],10)/255,parseInt(ge[3],10)/255,parseInt(ge[4],10)/255,isNaN(parseFloat(ge[5]))?1:parseFloat(ge[5]))}},{re:/(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(ge){return new ue(parseInt(ge[2],10)/360,parseInt(ge[3],10)/100,parseInt(ge[4],10)/100,isNaN(parseFloat(ge[5]))?1:parseFloat(ge[5]))}}];ie.push(R?{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})?$/,parse:function(ge){return new be(parseInt(ge[1],16)/255,parseInt(ge[2],16)/255,parseInt(ge[3],16)/255,parseInt(ge[4]||"FF",16)/255)}}:{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,parse:function(ge){return new be(parseInt(ge[1],16)/255,parseInt(ge[2],16)/255,parseInt(ge[3],16)/255,1)}}),ie.push({re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,parse:function(ge){return new be(parseInt(ge[1]+ge[1],16)/255,parseInt(ge[2]+ge[2],16)/255,parseInt(ge[3]+ge[3],16)/255,1)}});for(const ge in ie)if(ie.hasOwnProperty(ge)){const xe=ie[ge],oe=xe.re.exec(E),me=oe&&xe.parse(oe);if(me)return me instanceof be?Y=this.rgbaToHsva(me):me instanceof ue&&(Y=this.hsla2hsva(me)),Y}return Y}outputFormat(E,R,Y){switch("auto"===R&&(R=E.a<1?"rgba":"hex"),R){case"hsla":const ie=this.hsva2hsla(E),ge=new ue(Math.round(360*ie.h),Math.round(100*ie.s),Math.round(100*ie.l),Math.round(100*ie.a)/100);return E.a<1||"always"===Y?"hsla("+ge.h+","+ge.s+"%,"+ge.l+"%,"+ge.a+")":"hsl("+ge.h+","+ge.s+"%,"+ge.l+"%)";case"rgba":const xe=this.denormalizeRGBA(this.hsvaToRgba(E));return E.a<1||"always"===Y?"rgba("+xe.r+","+xe.g+","+xe.b+","+Math.round(100*xe.a)/100+")":"rgb("+xe.r+","+xe.g+","+xe.b+")";default:const oe="always"===Y||"forced"===Y;return this.rgbaToHex(this.denormalizeRGBA(this.hsvaToRgba(E)),oe)}}}return ae.\u0275fac=function(E){return new(E||ae)},ae.\u0275prov=a.\u0275\u0275defineInjectable({token:ae,factory:ae.\u0275fac}),ae})(),ht=(()=>{class ae{constructor(E,R,Y){this.elRef=E,this.cdRef=R,this.service=Y,this.isIE10=!1,this.dialogArrowSize=10,this.dialogArrowOffset=15,this.dialogInputFields=[Ce.HEX,Ce.RGBA,Ce.HSLA,Ce.CMYK],this.useRootViewContainer=!1}handleEsc(E){this.show&&"popup"===this.cpDialogDisplay&&this.onCancelColor(E)}handleEnter(E){this.show&&"popup"===this.cpDialogDisplay&&this.onAcceptColor(E)}ngOnInit(){this.slider=new Ze(0,0,0,0),this.sliderDimMax=new Tt(this.hueSlider.nativeElement.offsetWidth||140,this.cpWidth,130,this.alphaSlider.nativeElement.offsetWidth||140),this.format=this.cpCmykEnabled?Ce.CMYK:"rgba"===this.cpOutputFormat?Ce.RGBA:"hsla"===this.cpOutputFormat?Ce.HSLA:Ce.HEX,this.listenerMouseDown=Y=>{this.onMouseDown(Y)},this.listenerResize=()=>{this.onResize()},this.openDialog(this.initialColor,!1)}ngOnDestroy(){this.closeDialog()}ngAfterViewInit(){230===this.cpWidth&&"inline"!==this.cpDialogDisplay||(this.sliderDimMax=new Tt(this.hueSlider.nativeElement.offsetWidth||140,this.cpWidth,130,this.alphaSlider.nativeElement.offsetWidth||140),this.updateColorPicker(!1),this.cdRef.detectChanges())}openDialog(E,R=!0){this.service.setActive(this),this.width||(this.cpWidth=this.directiveElementRef.nativeElement.offsetWidth),this.height||(this.height=320),this.setInitialColor(E),this.setColorFromString(E,R),this.openColorPicker()}closeDialog(){this.closeColorPicker()}
1setupDialog(E,R,Y,ie,ge,xe,oe,me,L,te,J,De,Ke,Xe,et,ct,tt,Ct,vt,ze,Rt,Ft,Nt,wt,Bt,Gt,Ut,Wt,Ht,Qt,Yt,Xt,Kt,ee,ve,y){this.setInitialColor(Y),this.setColorMode(me),this.isIE10=10===function(){let ae="";"undefined"!=typeof navigator&&(ae=navigator.userAgent.toLowerCase());const Pe=ae.indexOf("msie ");return Pe>0&&parseInt(ae.substring(Pe+5,ae.indexOf(".",Pe)),10)}(),this.directiveInstance=E,this.directiveElementRef=R,this.cpDisableInput=De,this.cpCmykEnabled=L,this.cpAlphaChannel=te,this.cpOutputFormat=J,this.cpDialogDisplay=xe,this.cpIgnoredElements=Ke,this.cpSaveClickOutside=Xe,this.cpCloseClickOutside=et,this.useRootViewContainer=ct,this.width=this.cpWidth=parseInt(ie,10),this.height=this.cpHeight=parseInt(ge,10),this.cpPosition=tt,this.cpPositionOffset=parseInt(Ct,10),this.cpOKButton=Gt,this.cpOKButtonText=Wt,this.cpOKButtonClass=Ut,this.cpCancelButton=Ht,this.cpCancelButtonText=Yt,this.cpCancelButtonClass=Qt,this.fallbackColor=oe||"#fff",this.setPresetConfig(ze,Rt),this.cpPresetColorsClass=Ft,this.cpMaxPresetColorsLength=Nt,this.cpPresetEmptyMessage=wt,this.cpPresetEmptyMessageClass=Bt,this.cpAddColorButton=Xt,this.cpAddColorButtonText=ee,this.cpAddColorButtonClass=Kt,this.cpRemoveColorButtonClass=ve,this.cpTriggerElement=y,vt||(this.dialogArrowOffset=0),"inline"===xe&&(this.dialogArrowSize=0,this.dialogArrowOffset=0),"hex"===J&&"always"!==te&&"forced"!==te&&(this.cpAlphaChannel="disabled")}setColorMode(E){switch(E.toString().toUpperCase()){case"1":case"C":case"COLOR":this.cpColorMode=1;break;case"2":case"G":case"GRAYSCALE":this.cpColorMode=2;break;case"3":case"P":case"PRESETS":this.cpColorMode=3;break;default:this.cpColorMode=1}}setInitialColor(E){this.initialColor=E}setPresetConfig(E,R){this.cpPresetLabel=E,this.cpPresetColors=R}setColorFromString(E,R=!0,Y=!0){let ie;"always"===this.cpAlphaChannel||"forced"===this.cpAlphaChannel?(ie=this.service.stringToHsva(E,!0),!ie&&!this.hsva&&(ie=this.service.stringToHsva(E,!1))):ie=this.service.stringToHsva(E,!1),!ie&&!this.hsva&&(ie=this.service.stringToHsva(this.fallbackColor,!1)),ie&&(this.hsva=ie,this.sliderH=this.hsva.h,"hex"===this.cpOutputFormat&&"disabled"===this.cpAlphaChannel&&(this.hsva.a=1),this.updateColorPicker(R,Y))}onResize(){"fixed"===this.position?this.setDialogPosition():"inline"!==this.cpDialogDisplay&&this.closeColorPicker()}onDragEnd(E){this.directiveInstance.sliderDragEnd({slider:E,color:this.outputColor})}onDragStart(E){this.directiveInstance.sliderDragStart({slider:E,color:this.outputColor})}onMouseDown(E){this.show&&!this.isIE10&&"popup"===this.cpDialogDisplay&&E.target!==this.directiveElementRef.nativeElement&&!this.isDescendant(this.elRef.nativeElement,E.target)&&!this.isDescendant(this.directiveElementRef.nativeElement,E.target)&&0===this.cpIgnoredElements.filter(R=>R===E.target).length&&(this.cpSaveClickOutside?this.directiveInstance.colorSelected(this.outputColor):(this.hsva=null,this.setColorFromString(this.initialColor,!1),this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor),this.directiveInstance.colorCanceled()),this.cpCloseClickOutside&&this.closeColorPicker())}onAcceptColor(E){E.stopPropagation(),this.outputColor&&this.directiveInstance.colorSelected(this.outputColor),"popup"===this.cpDialogDisplay&&this.closeColorPicker()}onCancelColor(E){this.hsva=null,E.stopPropagation(),this.directiveInstance.colorCanceled(),this.setColorFromString(this.initialColor,!0),"popup"===this.cpDialogDisplay&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor,!0),this.closeColorPicker())}onFormatToggle(E){const R=this.dialogInputFields.length-(this.cpCmykEnabled?0:1),Y=((this.dialogInputFields.indexOf(this.format)+E)%R+R)%R;this.format=this.dialogInputFields[Y]}onColorChange(E){this.hsva.s=E.s/E.rgX,this.hsva.v=E.v/E.rgY,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"lightness",value:this.hsva.v,color:this.outputColor}),this.directiveInstance.sliderChanged({slider:"saturation",value:this.hsva.s,color:this.outputColor})}onHueChange(E){this.hsva.h=E.v/E.rgX,this.sliderH=this.hsva.h,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"hue",value:this.hsva.h,color:this.outputColor})}onValueChange(E){this.hsva.v=E.v/E.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"value",value:this.hsva.v,color:this.outputColor})}onAlphaChange(E){this.hsva.a=E.v/E.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"alpha",value:this.hsva.a,color:this.outputColor})}onHexInput(E){if(null===E)this.updateColorPicker();else{E&&"#"!==E[0]&&(E="#"+E);let R=/^#([a-f0-9]{3}|[a-f0-9]{6})$/gi;"always"===this.cpAlphaChannel&&(R=/^#([a-f0-9]{3}|[a-f0-9]{6}|[a-f0-9]{8})$/gi);const Y=R.test(E);Y&&(E.length<5&&(E="#"+E.substring(1).split("").map(ie=>ie+ie).join("")),"forced"===this.cpAlphaChannel&&(E+=Math.round(255*this.hsva.a).toString(16)),this.setColorFromString(E,!0,!1)),this.directiveInstance.inputChanged({input:"hex",valid:Y,value:E,color:this.outputColor})}}onRedInput(E){const R=this.service.hsvaToRgba(this.hsva),Y=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;Y&&(R.r=E.v/E.rg,this.hsva=this.service.rgbaToHsva(R),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"red",valid:Y,value:R.r,color:this.outputColor})}onBlueInput(E){const R=this.service.hsvaToRgba(this.hsva),Y=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;Y&&(R.b=E.v/E.rg,this.hsva=this.service.rgbaToHsva(R),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"blue",valid:Y,value:R.b,color:this.outputColor})}onGreenInput(E){const R=this.service.hsvaToRgba(this.hsva),Y=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;Y&&(R.g=E.v/E.rg,this.hsva=this.service.rgbaToHsva(R),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"green",valid:Y,value:R.g,color:this.outputColor})}onHueInput(E){const R=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;R&&(this.hsva.h=E.v/E.rg,this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"hue",valid:R,value:this.hsva.h,color:this.outputColor})}onValueInput(E){const R=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;R&&(this.hsva.v=E.v/E.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"value",valid:R,value:this.hsva.v,color:this.outputColor})}onAlphaInput(E){const R=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;R&&(this.hsva.a=E.v/E.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"alpha",valid:R,value:this.hsva.a,color:this.outputColor})}onLightnessInput(E){const R=this.service.hsva2hsla(this.hsva),Y=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;Y&&(R.l=E.v/E.rg,this.hsva=this.service.hsla2hsva(R),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"lightness",valid:Y,value:R.l,color:this.outputColor})}onSaturationInput(E){const R=this.service.hsva2hsla(this.hsva),Y=!isNaN(E.v)&&E.v>=0&&E.v<=E.rg;Y&&(R.s=E.v/E.rg,this.hsva=this.service.hsla2hsva(R),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"saturation",valid:Y,value:R.s,color:this.outputColor})}onCyanInput(E){!isNaN(E.v)&&E.v>=0&&E.v<=E.rg&&(this.cmyk.c=E.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"cyan",valid:!0,value:this.cmyk.c,color:this.outputColor})}onMagentaInput(E){!isNaN(E.v)&&E.v>=0&&E.v<=E.rg&&(this.cmyk.m=E.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"magenta",valid:!0,value:this.cmyk.m,color:this.outputColor})}onYellowInput(E){!isNaN(E.v)&&E.v>=0&&E.v<=E.rg&&(this.cmyk.y=E.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"yellow",valid:!0,value:this.cmyk.y,color:this.outputColor})}onBlackInput(E){!isNaN(E.v)&&E.v>=0&&E.v<=E.rg&&(this.cmyk.k=E.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"black",valid:!0,value:this.cmyk.k,color:this.outputColor})}
1onAddPresetColor(E,R){E.stopPropagation(),this.cpPresetColors.filter(Y=>Y===R).length||(this.cpPresetColors=this.cpPresetColors.concat(R),this.directiveInstance.presetColorsChanged(this.cpPresetColors))}onRemovePresetColor(E,R){E.stopPropagation(),this.cpPresetColors=this.cpPresetColors.filter(Y=>Y!==R),this.directiveInstance.presetColorsChanged(this.cpPresetColors)}openColorPicker(){this.show||(this.show=!0,this.hidden=!0,setTimeout(()=>{this.hidden=!1,this.setDialogPosition(),this.cdRef.detectChanges()},0),this.directiveInstance.stateChanged(!0),this.isIE10||(document.addEventListener("mousedown",this.listenerMouseDown),document.addEventListener("touchstart",this.listenerMouseDown)),window.addEventListener("resize",this.listenerResize))}closeColorPicker(){this.show&&(this.show=!1,this.directiveInstance.stateChanged(!1),this.isIE10||(document.removeEventListener("mousedown",this.listenerMouseDown),document.removeEventListener("touchstart",this.listenerMouseDown)),window.removeEventListener("resize",this.listenerResize),this.cdRef.destroyed||this.cdRef.detectChanges())}updateColorPicker(E=!0,R=!0,Y=!1){if(this.sliderDimMax){let ie,ge,xe;2===this.cpColorMode&&(this.hsva.s=0);const oe=this.outputColor;if(ge=this.service.hsva2hsla(this.hsva),this.cpCmykEnabled?(Y?(xe=this.service.cmykToRgb(this.service.normalizeCMYK(this.cmyk)),this.hsva=this.service.rgbaToHsva(xe)):(xe=this.service.hsvaToRgba(this.hsva),this.cmyk=this.service.denormalizeCMYK(this.service.rgbaToCmyk(xe))),xe=this.service.denormalizeRGBA(xe),this.sliderH=this.hsva.h):xe=this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva)),ie=this.service.denormalizeRGBA(this.service.hsvaToRgba(new Me(this.sliderH||this.hsva.h,1,1,1))),R&&(this.hslaText=new ue(Math.round(360*ge.h),Math.round(100*ge.s),Math.round(100*ge.l),Math.round(100*ge.a)/100),this.rgbaText=new be(xe.r,xe.g,xe.b,Math.round(100*xe.a)/100),this.cpCmykEnabled&&(this.cmykText=new Re(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k,Math.round(100*this.cmyk.a)/100)),this.hexText=this.service.rgbaToHex(xe,"always"===this.cpAlphaChannel),this.hexAlpha=this.rgbaText.a),"auto"===this.cpOutputFormat&&this.format!==Ce.RGBA&&this.format!==Ce.CMYK&&this.hsva.a<1&&(this.format=this.hsva.a<1?Ce.RGBA:Ce.HEX),this.hueSliderColor="rgb("+ie.r+","+ie.g+","+ie.b+")",this.alphaSliderColor="rgb("+xe.r+","+xe.g+","+xe.b+")",this.outputColor=this.service.outputFormat(this.hsva,this.cpOutputFormat,this.cpAlphaChannel),this.selectedColor=this.service.outputFormat(this.hsva,"rgba",null),this.format!==Ce.CMYK)this.cmykColor="";else if("always"===this.cpAlphaChannel||"enabled"===this.cpAlphaChannel||"forced"===this.cpAlphaChannel){const me=Math.round(100*this.cmyk.a)/100;this.cmykColor=`cmyka(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k},${me})`}else this.cmykColor=`cmyk(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k})`;this.slider=new Ze((this.sliderH||this.hsva.h)*this.sliderDimMax.h-8,this.hsva.s*this.sliderDimMax.s-8,(1-this.hsva.v)*this.sliderDimMax.v-8,this.hsva.a*this.sliderDimMax.a-8),E&&oe!==this.outputColor&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.outputColor))}}setDialogPosition(){if("inline"===this.cpDialogDisplay)this.position="relative";else{let Y,E="static",R="",ie=null,ge=null,xe=this.directiveElementRef.nativeElement.parentNode;const oe=this.dialogElement.nativeElement.offsetHeight;for(;null!==xe&&"HTML"!==xe.tagName;){if(Y=window.getComputedStyle(xe),E=Y.getPropertyValue("position"),R=Y.getPropertyValue("transform"),"static"!==E&&null===ie&&(ie=xe),R&&"none"!==R&&null===ge&&(ge=xe),"fixed"===E){ie=ge;break}xe=xe.parentNode}const me=this.createDialogBox(this.directiveElementRef.nativeElement,"fixed"!==E);if(this.useRootViewContainer||"fixed"===E&&(!ie||ie instanceof HTMLUnknownElement))this.top=me.top,this.left=me.left;else{null===ie&&(ie=xe);const te=this.createDialogBox(ie,"fixed"!==E);this.top=me.top-te.top,this.left=me.left-te.left}"fixed"===E&&(this.position="fixed");let L=this.cpPosition;"auto"===this.cpPosition&&(L=function(ae,Pe){let E="right",R="bottom";const{height:Y,width:ie}=ae,{top:ge,left:xe}=Pe,oe=ge+Pe.height,me=xe+Pe.width,L=ge-Y<0,te=oe+Y>(window.innerHeight||document.documentElement.clientHeight),J=xe-ie<0,De=me+ie>(window.innerWidth||document.documentElement.clientWidth);return te&&(R="top"),L&&(R="bottom"),J&&(E="right"),De&&(E="left"),L&&te&&J&&De?["left","right","top","bottom"].reduce((et,ct)=>ae[et]>ae[ct]?et:ct):J&&De?L?"bottom":te||ge>oe?"top":"bottom":L&&te?J?"right":De||xe>me?"left":"right":`${R}-${E}`}(this.dialogElement.nativeElement.getBoundingClientRect(),this.cpTriggerElement.nativeElement.getBoundingClientRect())),"top"===L?(this.arrowTop=oe-1,this.top-=oe+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*me.width-this.dialogArrowOffset):"bottom"===L?(this.top+=me.height+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*me.width-this.dialogArrowOffset):"top-left"===L||"left-top"===L?(this.top-=oe-me.height+me.height*this.cpPositionOffset/100,this.left-=this.cpWidth+this.dialogArrowSize-2-this.dialogArrowOffset):"top-right"===L||"right-top"===L?(this.top-=oe-me.height+me.height*this.cpPositionOffset/100,this.left+=me.width+this.dialogArrowSize-2-this.dialogArrowOffset):"left"===L||"bottom-left"===L||"left-bottom"===L?(this.top+=me.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left-=this.cpWidth+this.dialogArrowSize-2):(this.top+=me.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left+=me.width+this.dialogArrowSize-2),this.cpUsePosition=L}}isDescendant(E,R){let Y=R.parentNode;for(;null!==Y;){if(Y===E)return!0;Y=Y.parentNode}return!1}createDialogBox(E,R){return{top:E.getBoundingClientRect().top+(R?window.pageYOffset:0),left:E.getBoundingClientRect().left+(R?window.pageXOffset:0),width:E.offsetWidth,height:E.offsetHeight}}}return ae.\u0275fac=function(E){return new(E||ae)(a.\u0275\u0275directiveInject(a.ElementRef),a.\u0275\u0275directiveInject(a.ChangeDetectorRef),a.\u0275\u0275directiveInject(ot))},ae.\u0275cmp=a.\u0275\u0275defineComponent({type:ae,selectors:[["color-picker"]],viewQuery:function(E,R){if(1&E&&(a.\u0275\u0275viewQuery(G,7),a.\u0275\u0275viewQuery(n,7),a.\u
10275\u0275viewQuery(l,7)),2&E){let Y;a.\u0275\u0275queryRefresh(Y=a.\u0275\u0275loadQuery())&&(R.dialogElement=Y.first),a.\u0275\u0275queryRefresh(Y=a.\u0275\u0275loadQuery())&&(R.hueSlider=Y.first),a.\u0275\u0275queryRefresh(Y=a.\u0275\u0275loadQuery())&&(R.alphaSlider=Y.first)}},hostBindings:function(E,R){1&E&&a.\u0275\u0275listener("keyup.esc",function(ie){return R.handleEsc(ie)},!1,a.\u0275\u0275resolveDocument)("keyup.enter",function(ie){return R.handleEnter(ie)},!1,a.\u0275\u0275resolveDocument)},decls:28,vars:47,consts:[[1,"color-picker",3,"click"],["dialogPopup",""],[3,"class","top",4,"ngIf"],["class","saturation-lightness",3,"slider","rgX","rgY","background-color","newValue","dragStart","dragEnd",4,"ngIf"],[1,"hue-alpha","box"],[1,"left"],[1,"selected-color-background"],[1,"selected-color"],["type","button",3,"class","disabled","click",4,"ngIf"],[1,"right"],["style","height: 16px;",4,"ngIf"],[1,"hue",3,"slider","rgX","newValue","dragStart","dragEnd"],["hueSlider",""],[1,"cursor"],[1,"value",3,"slider","rgX","newValue","dragStart","dragEnd"],["valueSlider",""],[1,"alpha",3,"slider","rgX","newValue","dragStart","dragEnd"],["alphaSlider",""],["class","cmyk-text",3,"display",4,"ngIf"],["class","hsla-text",3,"display",4,"ngIf"],["class","rgba-text",3,"display",4,"ngIf"],["class","hex-text",3,"hex-alpha","display",4,"ngIf"],["class","value-text",4,"ngIf"],["class","type-policy",4,"ngIf"],["class","preset-area",4,"ngIf"],["class","button-area",4,"ngIf"],[1,"saturation-lightness",3,"slider","rgX","rgY","newValue","dragStart","dragEnd"],["type","button",3,"disabled","click"],[2,"height","16px"],[1,"cmyk-text"],[1,"box"],["type","number","pattern","[0-9]*","min","0","max","100",3,"text","rg","value","keyup.enter","newValue"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"text","rg","value","keyup.enter","newValue",4,"ngIf"],[4,"ngIf"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"text","rg","value","keyup.enter","newValue"],[1,"hsla-text"],["type","number","pattern","[0-9]*","min","0","max","360",3,"text","rg","value","keyup.enter","newValue"],[1,"rgba-text"],["type","number","pattern","[0-9]*","min","0","max","255",3,"text","rg","value","keyup.enter","newValue"],[1,"hex-text"],[3,"text","value","blur","keyup.enter","newValue"],[1,"value-text"],[1,"type-policy"],[1,"type-policy-arrow",3,"click"],[1,"preset-area"],[1,"preset-label"],[3,"class",4,"ngIf"],["class","preset-color",3,"backgroundColor","click",4,"ngFor","ngForOf"],[1,"preset-color",3,"click"],[3,"class","click",4,"ngIf"],[3,"click"],[1,"button-area"],["type","button",3,"class","click",4,"ngIf"],["type","button",3,"click"]],template:function(E,R){1&E&&(a.\u0275\u0275elementStart(0,"div",0,1),a.\u0275\u0275listener("click",function(ie){return ie.stopPropagation()}),a.\u0275\u0275template(2,g,1,5,"div",2),a.\u0275\u0275template(3,b,2,8,"div",3),a.\u0275\u0275elementStart(4,"div",4),a.\u0275\u0275elementStart(5,"div",5),a.\u0275\u0275element(6,"div",6),a.\u0275\u0275element(7,"div",7),a.\u0275\u0275template(8,p,2,5,"button",8),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"div",9),a.\u0275\u0275template(10,h,1,0,"div",10),a.\u0275\u0275elementStart(11,"div",11,12),a.\u0275\u0275listener("newValue",function(ie){return R.onHueChange(ie)})("dragStart",function(){return R.onDragStart("hue")})("dragEnd",function(){return R.onDragEnd("hue")}),a.\u0275\u0275element(13,"div",13),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(14,"div",14,15),a.\u0275\u0275listener("newValue",function(ie){return R.onValueChange(ie)})("dragStart",function(){return R.onDragStart("value")})("dragEnd",function(){return R.onDragEnd("value")}),a.\u0275\u0275element(16,"div",13),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(17,"div",16,17),a.\u0275\u0275listener("newValue",function(ie){return R.onAlphaChange(ie)})("dragStart",function(){return R.onDragStart("alpha")})("dragEnd",function(){return R.onDragEnd("alpha")}),a.\u0275\u0275element(19,"div",13),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u
10275\u0275elementEnd(),a.\u0275\u0275template(20,m,17,12,"div",18),a.\u0275\u0275template(21,i,14,10,"div",19),a.\u0275\u0275template(22,k,14,10,"div",20),a.\u0275\u0275template(23,Q,8,7,"div",21),a.\u0275\u0275template(24,V,9,3,"div",22),a.\u0275\u0275template(25,w,3,0,"div",23),a.\u0275\u0275template(26,ne,6,3,"div",24),a.\u0275\u0275template(27,Te,3,2,"div",25),a.\u0275\u0275elementEnd()),2&E&&(a.\u0275\u0275styleProp("display",R.show?"block":"none")("visibility",R.hidden?"hidden":"visible")("top",R.top,"px")("left",R.left,"px")("position",R.position)("height",R.cpHeight,"px")("width",R.cpWidth,"px"),a.\u0275\u0275classProp("open",R.show),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf","popup"==R.cpDialogDisplay),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",1===(R.cpColorMode||1)),a.\u0275\u0275advance(4),a.\u0275\u0275styleProp("background-color",R.selectedColor),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",R.cpAddColorButton),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf","disabled"===R.cpAlphaChannel),a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("display",1===(R.cpColorMode||1)?"block":"none"),a.\u0275\u0275property("rgX",1),a.\u0275\u0275advance(2),a.\u0275\u0275styleProp("left",null==R.slider?null:R.slider.h,"px"),a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("display",2===(R.cpColorMode||1)?"block":"none"),a.\u0275\u0275property("rgX",1),a.\u0275\u0275advance(2),a.\u0275\u0275styleProp("right",null==R.slider?null:R.slider.v,"px"),a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("display","disabled"===R.cpAlphaChannel?"none":"block")("background-color",R.alphaSliderColor),a.\u0275\u0275property("rgX",1),a.\u0275\u0275advance(2),a.\u0275\u0275styleProp("left",null==R.slider?null:R.slider.a,"px"),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!R.cpDisableInput&&1===(R.cpColorMode||1)),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!R.cpDisableInput&&1===(R.cpColorMode||1)),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!R.cpDisableInput&&1===(R.cpColorMode||1)),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!R.cpDisableInput&&1===(R.cpColorMode||1)),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!R.cpDisableInput&&2===(R.cpColorMode||1)),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!R.cpDisableInput&&1===(R.cpColorMode||1)),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",(null==R.cpPresetColors?null:R.cpPresetColors.length)||R.cpAddColorButton),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",R.cpOKButton||R.cpCancelButton))},directives:[T.O5,Ue,Ee,T.sg],styles:['.color-picker{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;background-color:#fff;border:1px solid #777;cursor:default;height:auto;position:absolute;user-select:none;width:230px;z-index:1000}.color-picker *{box-sizing:border-box;font-size:11px;margin:0}.color-picker input{color:#000;font-size:13px;height:26px;min-width:0;text-align:center;width:0}.color-picker input:-moz-submit-invalid,.color-picker input:-moz-ui-invalid,.color-picker input:invalid{box-shadow:none}.color-picker input::-webkit-inner-spin-button,.color-picker input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.color-picker .arrow{border-style:solid;height:0;position:absolute;width:0;z-index:999999}.color-picker .arrow.arrow-top{border-color:#777 transparent transparent;border-width:10px 5px;left:8px}.color-picker .arrow.arrow-bottom{border-color:transparent transparent #777;border-width:10px 5px;left:8px;top:-20px}.color-picker .arrow.arrow-left-top,.color-picker .arrow.arrow-top-left{border-color:transparent transparent transparent #777;border-width:5px 10px;bottom:8px;right:-21px}.color-picker .arrow.arrow-right-top,.color-picker .arrow.arrow-top-right{border-color:transparent #777 transparent transparent;border-width:5px 10px;bottom:8px;left:-20px}.color-picker .arrow.arrow-bottom-left,.color-picker .arrow.arrow-left,.color-picker .arrow.arrow-left-bottom{border-color:transparent transparent transparent #777;border-width:5px 10px;right:-21px;top:8px}
1.color-picker .arrow.arrow-bottom-right,.color-picker .arrow.arrow-right,.color-picker .arrow.arrow-right-bottom{border-color:transparent #777 transparent transparent;border-width:5px 10px;left:-20px;top:8px}.color-picker .cursor{border:2px solid #222;border-radius:50%;cursor:default;height:16px;position:relative;width:16px}.color-picker .box{display:flex;padding:4px 8px}.color-picker .left{padding:16px 8px;position:relative}.color-picker .right{flex:1 1 auto;padding:12px 8px}.color-picker .button-area{padding:0 16px 16px;text-align:right}.color-picker .button-area button{margin-left:8px}.color-picker .preset-area{padding:4px 15px}.color-picker .preset-area .preset-label{color:#555;font-size:11px;overflow:hidden;padding:4px;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%}.color-picker .preset-area .preset-color{border:1px solid #a9a9a9;border-radius:25%;cursor:pointer;display:inline-block;height:18px;margin:4px 6px 8px;position:relative;width:18px}.color-picker .preset-area .preset-empty-message{font-style:italic;margin-bottom:8px;margin-top:4px;min-height:18px;text-align:center}.color-picker .hex-text{font-size:11px;padding:4px 8px;width:100%}.color-picker .hex-text .box{padding:0 24px 8px 8px}.color-picker .hex-text .box div{clear:left;color:#555;flex:1 1 auto;float:left;text-align:center}.color-picker .hex-text .box input{border:1px solid #a9a9a9;flex:1 1 auto;padding:1px}.color-picker .hex-alpha .box div:first-child,.color-picker .hex-alpha .box input:first-child{flex-grow:3;margin-right:8px}.color-picker .cmyk-text,.color-picker .hsla-text,.color-picker .rgba-text,.color-picker .value-text{font-size:11px;padding:4px 8px;width:100%}.color-picker .cmyk-text .box,.color-picker .hsla-text .box,.color-picker .rgba-text .box{padding:0 24px 8px 8px}.color-picker .value-text .box{padding:0 8px 8px}.color-picker .cmyk-text .box div,.color-picker .hsla-text .box div,.color-picker .rgba-text .box div,.color-picker .value-text .box div{color:#555;flex:1 1 auto;margin-right:8px;text-align:center}.color-picker .cmyk-text .box div:last-child,.color-picker .hsla-text .box div:last-child,.color-picker .rgba-text .box div:last-child,.color-picker .value-text .box div:last-child{margin-right:0}.color-picker .cmyk-text .box input,.color-picker .hsla-text .box input,.color-picker .rgba-text .box input,.color-picker .value-text .box input{border:1px solid #a9a9a9;flex:1;float:left;margin:0 8px 0 0;padding:1px}.color-picker .cmyk-text .box input:last-child,.color-picker .hsla-text .box input:last-child,.color-picker .rgba-text .box input:last-child,.color-picker .value-text .box input:last-child{margin-right:0}.color-picker .hue-alpha{align-items:center;margin-bottom:3px}.color-picker .hue{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwkUFWbCCAAAAFxJREFUaN7t0kEKg0AQAME2x83/n2qu5qCgD1iDhCoYdpnbQC9bbY1qVO/jvc6k3ad91s7/7F1/csgPrujuQ17BDYSFsBAWwgJhISyEBcJCWAgLhIWwEBYIi2f7Ar/1TCgFH2X9AAAAAElFTkSuQmCC");direction:ltr}.color-picker .hue,.color-picker .value{background-size:100% 100%;border:none;cursor:pointer;height:16px;margin-bottom:16px;width:100%}.color-picker .value{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAACTklEQVR42u3SYUcrABhA4U2SkmRJMmWSJklKJiWZZpKUJJskKUmaTFImKZOUzMySpGRmliRNJilJSpKSJEtmSpIpmWmSdO736/6D+x7OP3gUCoWCv1cqlSQlJZGcnExKSgqpqamkpaWRnp5ORkYGmZmZqFQqsrKyyM7OJicnh9zcXNRqNXl5eeTn56PRaCgoKKCwsJCioiK0Wi3FxcWUlJRQWlpKWVkZ5eXlVFRUUFlZiU6no6qqiurqampqaqitraWurg69Xk99fT0GgwGj0UhDQwONjY00NTXR3NxMS0sLra2ttLW10d7ejslkwmw209HRQWdnJ11dXXR3d9PT00Nvby99fX309/czMDDA4OAgFouFoaEhrFYrw8PDjIyMMDo6ytjYGDabjfHxcSYmJpicnGRqagq73c709DQzMzPMzs4yNzfH/Pw8DocDp9OJy+XC7XazsLDA4uIiS0tLLC8vs7KywurqKmtra3g8HrxeLz6fD7/fz/r6OhsbG2xubrK1tcX29jaBQICdnR2CwSC7u7vs7e2xv7/PwcEBh4eHHB0dcXx8zMnJCaenp5ydnXF+fs7FxQWXl5dcXV1xfX3Nzc0Nt7e33N3dEQqFuL+/5+HhgXA4TCQS4fHxkaenJ56fn3l5eeH19ZVoNMrb2xvv7+98fHwQi8WIx+N8fn6SSCT4+vri+/ubn58ffn9/+VcKgSWwBJbAElgCS2AJLIElsASWwBJYAktgCSyBJbAElsASWAJLYAksgSWwBJbAElgCS2AJLIElsP4/WH8AmJ5Z6jHS4h8AAAAASUVORK5CYII=");direction:rtl}.color-picker .alpha{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAA
1CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwYQlZMa3gAAAWVJREFUaN7tmEGO6jAQRCsOArHgBpyAJYGjcGocxAm4A2IHpmoWE0eBH+ezmFlNvU06shJ3W6VEelWMUQAIIF9f6qZpimsA1LYtS2uF51/u27YVAFZVRUkEoGHdPV/sIcbIEIIkUdI/9Xa7neyv61+SWFUVAVCSct00TWn2fv6u3+Ecfd3tXzy/0+nEUu+SPjo/kqzrmiQpScN6v98XewfA8/lMkiLJ2WxGSUopcT6fM6U0NX9/frfbjev1WtfrlZfLhYfDQQHG/AIOlnGwjINlHCxjHCzjYJm/TJWdCwquJXseFFzGwDNNeiKMOJTO8xQdDQaeB29+K9efeLaBo9J7vdvtJj1RjFFjfiv7qv95tjx/7leSQgh93e1ffMeIp6O+YQjho/N791t1XVOSSI7N//K+4/GoxWLBx+PB5/Op5XLJ+/3OlJJWqxU3m83ovv5iGf8KjYNlHCxjHCzjYBkHy5gf5gusvQU7U37jTAAAAABJRU5ErkJggg==");background-size:100% 100%;border:none;cursor:pointer;direction:ltr;height:16px;width:100%}.color-picker .type-policy{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACewAAAnsB01CO3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIASURBVEiJ7ZY9axRRFIafsxMStrLQJpAgpBFhi+C9w1YSo00I6RZ/g9vZpBf/QOr4GyRgkSKNSrAadsZqQGwCkuAWyRZJsySwvhZ7N/vhzrgbLH3Ld8597jlzz50zJokyxXH8DqDVar0qi6v8BbItqSGpEcfxdlmsFWXkvX8AfAVWg3UKPEnT9GKujMzsAFgZsVaCN1VTQd77XUnrgE1kv+6935268WRpzrnHZvYRWC7YvC3pRZZl3wozqtVqiyH9IgjAspkd1Gq1xUJQtVrdB9ZKIAOthdg/Qc65LUk7wNIMoCVJO865rYFhkqjX6/d7vV4GPJwBMqofURS5JEk6FYBer/eeYb/Mo9WwFnPOvQbeAvfuAAK4BN4sAJtAG/gJIElmNuiJyba3EGNmZiPeZuEVmVell/Y/6N+CzDn3AXhEOOo7Hv/3BeAz8IzQkMPnJbuPx1wC+yYJ7/0nYIP5S/0FHKdp+rwCEEXRS/rf5Hl1Gtb2M0iSpCOpCZzPATmX1EySpHMLAsiy7MjMDoHrGSDXZnaYZdnRwBh7J91utwmczAA6CbG3GgPleX4jqUH/a1CktqRGnuc3hSCAMB32gKspkCtgb3KCQMmkjeP4WNJThrNNZval1WptTIsv7JtQ4tmIdRa8qSoEpWl6YWZNoAN0zKxZNPehpLSBZv2t+Q0CJ9lLnARQLAAAAABJRU5ErkJggg==");background-position:50%;background-repeat:no-repeat;background-size:8px 16px;height:24px;position:absolute;right:12px;top:218px;width:16px}.color-picker .type-policy .type-policy-arrow{display:block;height:50%;width:100%}.color-picker .selected-color{border:1px solid #a9a9a9;border-radius:50%;height:40px;left:8px;position:absolute;top:16px;width:40px}.color-picker .selected-color-background{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAh0lEQVRYR+2W0QlAMQgD60zdfwOdqa8TmI/wQMr5K0I5bZLIzLOa2nt37VVVbd+dDx5obgCC3KBLwJ2ff4PnVidkf+ucIhw80HQaCLo3DMH3CRK3iFsmAWVl6hPNDwt8EvNE5q+YuEXcMgkonVM6SdyCoEvAnZ8v1Hjx817MilmxSUB5rdLJDycZgUAZUch/AAAAAElFTkSuQmCC");border-radius:50%;height:40px;width:40px}.color-picker .saturation-lightness{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACCCAYAAABSD7T3AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwksPWR6lgAAIABJREFUeNrtnVuT47gRrAHN+P//Or/61Y5wONZ7mZ1u3XAeLMjJZGZVgdKsfc5xR3S0RIIUW+CHzCpc2McYo7XGv3ex7UiZd57rjyzzv+v+33X/R/+3r/f7vR386Y+TvKNcf/wdhTLPcv9qU2wZd74uth0t1821jkIZLPcsI/6nWa4XvutquU0Z85mnx80S/ZzgpnLnOtHNt7/ofx1TKXcSNzN/7qbMQ3ju7rNQmMYYd/4s2j9aa+P+gGaMcZrb1M/tdrvf7/d2v99P9/t93O/3cbvdxu12G9frdVwul3E+n8c///nP+2+//Xb66aefxl//+tfx5z//2YK5Al2rgvf4UsbpdGrB52bAvArXpuzjmiqAVSGz5eDmGYXzhbAZmCrnmzddpUU+8Y1dAOYeXCtDUwVwV7YCGH6uAmyMcZ9l5vkUaBPGMUZ7/J5w/792/fvv9Xq93263dr/fTxPECeME8nK5jM/Pz/HTTz/dv337dvrll1/GP/7xj/G3v/1t/OUvfwkVswongjdOp9PzH3U3D3zmWGnZVXn4jCqs7wC2BKP4/8tAzkZsoWx6XrqeHZymvp4ABCBJhTQwKfDT8gzrZCIqi5AhiACjBfEB2rP8/X63MM7f6/V6v9/v7Xa7bYC83W7jcrlsVHIq5ffv30+//fbb+OWXX8ZPP/00/v73v4+ff/75JSvbeu+bL2WMMaFbAlpBNM85QX+ct6qoSqkPAwuQlBVKqGNFSUOAA3Bmu7gC5hNOd15nSwvAOUW7C4giUCV8Sgn5L9hNFIqTsp0GxI0ysioyjAjkY/tGJVEpz+fz+OWXX+7fv38//f777+Pbt2/j119/HT///PP49ddfx8fHRwrmTjV779EXu2px2xhjwtdJZQcAWQIPLPISsMJaSwiD8gzIKrwSyATE5j5nAbR5c1dBUwBlsEWW0h6LqiYsqFPAQxCyRZ3wOSARxmlXMX5k64pQfvv27f75+dk+Pj5OHx8f4/v37+Pbt2/jt99+G9++fRsfHx/jcrmUFLO31gYDWblxRIs/TqfT7ousxJsAxXA2Gc7TA9XdgfdoHbFsj76X2+1WArgI1ageGwA3qupqoHsmcbI6Fu93quggFa9d7LeDtgKfAFHBJ+NEByIkcJ5KervdTmhhGcgJJSZ5vn//fj+fz+18Pp8+Pz/H5+fnmGD+/vvv4/v37+Pj42N8fn6O2+1Ws7JjjP6wraMI5E4RZ8x2vV5TSwkquotV7/d7Tz6HFWsD/qNcdw0CQ3q/321c686TwDVIdbuy73zNldhSHb8I2klZznm+InBS4U6n0302aBFsLhHDAKJVJVglfI9jhvu53W53sLANYNxAiDA6MCeUHx8f9+v12i6XS7tcLqcZW57P5yeY8/fz83Ocz+fnsSmYUyknWEG85WBst9stzSLyMdfr9Qi08iY15UZ0LlDGLhR3o5zK2j7OPUTD0E+nU3tk7Xb/16NFbhloAMuY1zjLUOO3BKeIDe+Z8s3/J4gFo4TM5jPmuRg28foUKKVSwo16TgA5npywcWLHgYl/Pz8/73/605/ab7/91m63W7tcLie0sZj4mao5gTyfz88E0f1+j8EcYzwTPEG2cqjyfHNF0M8fuqEiaOVnRzZZQNh5fwQyHg/HDGfJo89Q1zb/quu5XC6773I2XKfTqd/v9+d3wuqWva/YTdUdEV3fhIv/Viyps6YE3x3r43K5bJQS66zaxVGFsvd+//j4aF+/fm3fv39vt9utff36tf3+++/tdrudvn37ZuNLBaaCMgUzC+rZRiFowxUuJI8YMqcC
1p9Opq5vagaYU6lGJA1XQqejchw6Cj0Gw5nYBrGw01A2O206n04BGouNNyTfp/FwElhUey6nXrIKw7QQWddxuN2ldL5fL839gSPF8ahu/JvBO48CPSuqMf8Vp9/P53L58+dLu93s7n8/tfr8/39/v9/b5+TkhPJ3P56mQ436/j+/fv+/iSgbzer0+AZx/5+88bv6OMda6S5z6kd21fYC9dxv7cIJJ2d9AOS30fPMzyHiTM8B4DF6XUlYHp4KQW3W+1t77MNB1vGHxWq7Xa7vf78+y5/N5A+H1et29xuP5dbYtyaRu4AksbPq6936fjRzXRxBbPr/b+b18+fKljTHaBBBfn8/n0/1+H1++fBnn8zm0sB8fH5u4cr5GuBhMVk0EEn9RsctgVhM+ixlJtMA23R8B6yysAstBOgFXIKKCMIgToMqNEu2fYMH7ztc732dQKkCj1ytAZtY0Kx8pIr8GGJ+AT3V+2Hirhl++fBmXy2Wz73w+b17P8p+fn8/tUwGVleVkTyUb68DkfayWY4zxNRihU4EpLJPZVrK+u7J4/mgfKqeLW9X2REWlItL1diynbDDb3+jXgYjQqn0rrxWc+NkILP7F7xIbMvx7vV53x40xnlbWJF12ZSag/N0pW6t+ZzmOMzHjajKwDfond78zYTdfq18up97zr2q8v3IioBprRtBl0EZ9og5WBRGOdOHjIjXF7UotFbgOWnXzIJyzYvjG5IYgsmMOxHkz8OsMSrVNWeq5T8DaOcbEv1Od5rbs9aO7YvMet63EkF++fMExq+MRl4/L5bLZN/+ez+fnZ6KazuMqXSQVO5spJXflHAIzes/xJseckRJiDMog9d6VfRrqXMr6KpVV27jRwJacGovOAM1zMdQMnwK1AubK63kdCChvI1C7g0z9nf/D+Xze2Vj8H7Gx4P9duQlsYCrqyN8XqG3Hm/10Oj3jw/n+crlstuM+jPmmxT2dTuPz83Pzt2pn1XsEHX/bnPaVqVmh0xwOt0o6XLLAHePUU203wHfcrspCwmV3TryB5s0Mseeg97x/BwzCjBlbB+pRAPla0BVQuT6V6QHdBlj3d0KG147b+DqxQeUymDO43W4dQar+TIjwmAd0z8/h65vf0/yLv3Pb5XLpru/ydDo9s7ET0I+Pj6dKK9VUEIeKWQWPAOrJ8LKd4vE+t91Y3e7UFlWatg2VwJnb+HPmtvm/sfK59/OaWF3x/eP1UPHvA5DDYDpYXfb0drv1V2DkBkxtw/tEWVVlXWdC9pFYs5/jfh9dS/16vW7s6lTG+TfqsxSJHxkXXq/Xdr1eu4LsfD6P3vsT3N77DkL+zPm5jSdKL4zR3AxQd6rHkLkYlSowsrq7znzu6wSwdsMJOXmA5fBcjxtgMGBYHlr5zokhtsMCTgXLQOW4XC6dEyEMprL8mAQzXRgduix2yZzorxkYsDn3hB1VeMLGsXsVtgl2pW8S3svk0vw7R4hNaHvv4cACl5HFzwIH0Kc6zu4XjDPR/jpAVxWzO1Xk2DDb3vTcxeGU1iWZHkmIDWziWKvirCJ4Dravs6IJ/GG6cTqWdXDy+fArQDVVkLqkVjAoZIITdmmIqXwqa95N3+MGYoZQdRVNO53Y1xRkhO16vY7eu507Ca9lJnbGpxOemQhSw/AQsmmp5zU9BiU8G6wvX76M6/U6Pj4+do0Bz4CpgiknTUeDqwlKBmg3u4OVjrZ1A+rAcgaejWq6eJCvCYFDONSwOgHX4EQRw8lxbzDOdEK6gZ3Hk1b+8g2o1JFtKXyv/fEdTXuWjWXdAZiBp6ADeDrCFiim7B6ZFneeI7Gvm/PMkUDX67W7xI8b0D7/v8dA9qfN5oaCf74WZjH0mf1cmfY1Y0JUFmVrTWu8uzkNcLtEj7u5FXBTkfC6GOA5q8YMxO8KVvF6sAVGdcrUbsKODcQKkLMOMdmlxum642YrPm26AlhZW1YB1R+rrGswE8TaYAWeUMxdf+WjwSvZ2Ef3ytOyfn5+PpVPAaqOn43MtNBqvmjjxbjM4lZjZY4gqNMI5ktaW/sYKNwS+9lFQzGihmMCKPa7+Z0V6Eb0GRmobtpX8JljWu5FMLN5ja6hG9kwQgZqf5+1NH5UxzkFReCdWhJ8XdlGUkxO7HRlYRm4mVO43W7ter12TPJEw/rmEN3L5SKHIWZg9mz+pUoKOYq5bJTJdX2gme1UcxMZQFaEQIlHct32M+Y1BzGkGuzfiyAN9z+ugplZ1symCrDCYYkGxDTpI9RzBy0rHyeDUC1nWaeUaD9n4xkNyYMBDZtzZ3B++fJlY21XFDOcARJlabOyiS3uCpLI9jrZjCDkaVvcCCjwognKShWdzXZWlZMvVTgD8LpqlCLrqgbcB+qYwrgKYpT0ccCqbKyCValkEabn/FynogCrPKfqf51xJ7sGB2ZXcZmxoSOztjx300DZi7a0/2AIR0UlBag9SuDw6KcAzlaB7vHZvWpjK90dyrq6bKyDUZQbR0B05biLQkHIcSUmgIK+SwuqgHCnoio2RQU1yj+BnBy9pphVKLGyC7ZzFK1pxWK+E8IhVCWLN/uLtnUU4ayoYLoaANz8FdtaSvY4pV0BEW2ls61czqllBKpTyKgMAhrZ1cdc1RROtPmvWNkdcKZ7ZKxaWjiPLJMpp7OZKxA+rqG/oJLjxf0pnJlqLoDZo3gyU0mKGys2taKecj/d1C+rJSplBqlTyAqgR+D8KjKlmRL2gtUcAdCtsL+ijCNT1oqqqkH2OHEbG5sDFnUg5Aa+yLou2VU1ptj1S2ZQqv1ORZN9IWzRfgaRBxKoBE8UWyqlJFtrIc0AxNjSjed99CTY/XDfSzCz5M0IZoVEsWnPFNTsl8ooVC1TzbGgqFZNDSgVwKK+1sGDMKqxZCWGVMDysiEr1jVSQJUYwj5iHOlThdHt44SQg9CN+nl8D90NMIgAdgr46JqRiR9I8vRdFvbr17m/yxUMKjNLMiVUADwu2CWGhhi+F55TWM9M9cogzms1dnM4uOF/LAEYWdcqnM7yFmyq3IfwmOROd7Y1iFWtOjoY8To41mTV5IysgFFuRzsbWFGbNIIJCDv1dOo4lZG7jWBwRFtVTKuWyeCByJKOan8oZ3ep9XddNl0tDuaywLz9cXPYeDAA0SpkBO9sbVcTOVWldPv4uyzEkzxHtjvonHoSkFEWNoo1d8DhcQputd2ppNon4BzoAiJ1hBFQg0dVtdbGHHDQWushmNEQukLM2QO1G2Y8bgTXqFhcBJj7EjPgcPts8US8qPpPB/dXznOh5Z438tzH5ec6QgrOKrRRfKmysBmUDB+PhYabMlVPER+GCSITTzr7am2tArH3bgcEzPJm+cr5jJ4NnHNFDVrFXcI5Le9k5Jnw+bedbV+FfRzZIHaOOaOsLY0/7UGs58DjrGwKMIMFIGzOEW1/jGsdAtCN6hEAI4hBe9YXeRROBSVPAVPAqvIM5bx5hVKWAMP6zBRy3iescridVdFBinBxXDnG2GRY2XbCvp1lhvGtO9Bxu5h908XQu42lnSArMFdizMim8uwRCxPGnnOS8lwpnbOiDqTAjsrRN/PcoAScCbaACqVM40ylnjjTBs+bwWlAG23/UKbdkiwKWIQPGzWaczpoSlxPEj822cNWkpS7FyzsDrqpfgpG3jahw2vgbaSQAxuLWZYt7JzyNe8JoZpNAcvDFOdw0wqYT9AK1rZz/DdbSlLPp0ryIxgQJlK9AZlEq7IOXpohg9PIhrCng88JsOxiV4ZWAYfg4sikx/8ky2Z9l862uqwrfscIH8+ugTmVGyiddeVYUgEMn4GZzg14EwIsh9sx2cKKiWXReuOE5gzGOQgdlRKVVdlevqb279Xq0Qnsts2VDaBO0coezsruWtHApu6sKG4IBhN0aGU2kLrMKGRTN3HmbCDwKV14zvkMEDG4QfZVspVlaNU2mhc5TEZ3N1h/zqTheuLpW05ZWTGVjb3dbnNmxKZBnN8JqidaVLKAOyARNLS+MB54Z2+VaqoMLKroVBlngefnTPAcoHNWCSvlfA8CI0HEmBNBnBlXyMrzU7A7WVm94PPqQ2gmqKx+WDGsnvilmcSOBJqOK1nYyAIzuAyesq3UdSK3KfWcYKD95HmfYOU3qser2CtYEUA+FpfqdNvgPBZUBhDrGONRVlQsh8rLcaUCykHG0OOUwTlLBrsh5soEMGezi1E4HRVt1icp5wZEFXdibCkG8Y8vX75sbO4E0iom9z+hjSiOfy3DhpXItpVhE+UGQdvoWjtChmrGHf4YAzKgBNnGtuJxFCeGdhUAfQLLK8kBYAP6gvFJZajMG3Xkycy8KuC0q4Eyymwtwdxdv2M0mIBtK0LKnf640j00Auq4gUkdWGlhs22qJc6dZCsL19oxnlTJG4SYVRIGpD8TPFBuM6OElbS1pldid4mGAyN6ZIupb
1C5bXJN9fdpbThSxLUaI8IG1XIYBxW3Tjs6KQosKcxfxcQmdnwRGM10GnFcCy2XYunLMyAkdgk4mePiczsLygthcBut6goOqS7YVFXADLjaosB6s6ofcZWAZSIRYqSUkizYwttYab3vUOQ9w2HRxIIg8WwRVeE68xi4UtL3zRphxplzwuZrcqYCq1I3jPI5dnJIygEohMbPqVJSzrwzxBJTs5zN+ReUSgxikPQVF3JVBeNQxbHENrEMNvEdFZVV9lH9+ORGEsNZQpyTNc4C3AG7XF4ngzq+DrO2zbuaaOXgdaFcdkEotoSFBVX2qJ0C8OWZeG4KGlpghA0XfTOPCqV2qqwQ26QWfF2PMLhI2w1lVAa2aPsYd0za25MQRwgcZN6uQDCi+ZxiD4XEM2kZxOT41FnZnaRlcpZouzlRqqdbQVWopQoSB58RV50lBNrHi/AwXS5LrwDVlpY3Fc3ByiYGc52Trist6kOXdwInAQtJpp5QchyaquYOV7Su+fxVMaV3dc0RE2S6mUY0gLt2pMcYqrKIQ9w2l1gpQUMtQYcmmbt5DTNxdhnUCjQqtbK9SUSzvrC0mmhhE1e2FS2+oxypy/ZASutkmtjx3vcBC24PX65nbqkBCRhfjS9kIYPnee8cMagVOhI/3T1fAmdtAWZsCswTJCkQVNa0qWKSKPOpHAUhD9DrbVcyoYkwqhvh17vYAayXLQyKGYdxlUDFp494rBXRjYgO17DDYetNIUj/ezp6S0lnlpEwsWmJMkOwsKXeZKEAjIHn0EQJISaRBcO6UMINz7p/bEjjnw4ft+xmDvksxX4G2rIris7qaeKwAFMP2Oi7n4criuZwtpSUwpfLxSnORSrIqusc5ZFaXysqRWjiZ2DyAWEIL35tVSoQElFACjOeGGSE7AHEQgdo/LSvCOgGBvkxsmDbvlS3Fp5vhaB2TAGqRKrKKMrhLVpaGzEVjZ0OQxDhaCTA+QyRR1d15aQzrJntL3RibsipjG6jlgL4yqbS0sNYg1e84vhbBVrElK64CUcWYXDfKxhpIuxiVJZUxsbMy/uRBKTNRQ4kQ3LdRYLS0rJjRPlTPqY6gdJsEDc+aQXAn+HgsNUCbRuF0Oj0zwnA7bWDkbhO5Ens00qeQhS1laBMl5M/cAaxsLF8rKyql+Tf7ELLEGu/ixiimdCvo0TjfpjKwaggen4eh5v7LokLKbLuyvHhcZG8dhGrEDx7Hg93ZppJF7qBqO3iVveXEDQNInzeoe8Yq6ePaZBZ2JviM3W2UAGotekRCAGq4EkF1X3DOnR11yRsBL1tRa0PVcZiNFXZ2c34FskvomInQQ6lzpJoZbJxk43NwKJFBquJSsrByHydxKOnTxQASBmS3j+JMnsHSla3Ec6K9VWoJVn9zfjwOM7hqYAAqJQwE2a3nA48J2QGegRkpZNivSY+ys3EkKd4oJIwsvIHl3cWgLt5k4NH6OmtLWdpurOkwEMupYc7eMtDRhOcI2ui5JhVIzXzLyto/GAPuZoyo8wkoduVgJglCt7OhGbgID4Mq4si+63zUS1FuFFXFlqyaj2emHlLMcBqYu0FMuR28BbB7lOxRMSiCQXFhCKuwkhZ+pYDiGSgbsKKV8MiSRsuHSIWM9rklRiIlZZuqXjsQK8ooYJMgq3JKWVkhHbhsVxFUzthOWPkYijcbx54IKsSdT+uLr3crGKyoYgFiGR9iBk4kfloUX+JIlQRQqabmpgnhqtpQpb6RVQ1WH5DnrS4hEoGZqaerQ2dhFbz8XePxShmDbo70eISjoorO2vK8SJXI4SUmEU4zWKDzUDtWTYw7xXlbSTEj4FRg7zKnKoGRALv0Gs9Tgc1BpCywGZRQAtqVz2xrBcAMzEpfZwFSa2G5W0QBFjSMapWAEFa3HcGN7CxDzECyIkJ97qwrqWNTWVo876PPsjPkj2wvgroM5lLZKMETKVql/CvnWVFiFa/SzJUQwkoZsr67Y6vlSRV3/2tmNTOY3vnaxYwMuoPKqdzR1w7IqHymlPxaAThfU7Ko2ZXYj4AYJHL+kNdKwRQYESTRa5fsUZ/rVC1TMTyWVyYoqNtuzaHsMyv2tvoarxdfqwYgU1axFo/cnql1FGsqK+uAROV8BX4GU8WcZTATi2q7Qcyi0O0V+GhWBMNRUkn8H1SsWVE5By3Gi0ECqUeJoBfAtDa4amkdXG37AGP5Ggeb84p7UazpoKRzdFzeQ8HkoHGxprKy/Hpm5t12p47J6xTYDEz7uINEXSuxYXvFskYAc+ySxH9sf5ftKzU6IbwVBcUGg5e5FMCEXSErZR0wGayV19woM9guPjTqJdVTqR4uE4nJnLldWVkECCZLd2VLF+xtamex7IpiriSDUpvrpn9lrwGMCHyppMH+ps6LILsuFGUj1XEOXiqbqSHPUKnClpWV68kqtURVNDY4TNaocykoYeTU5ngGEQa/S1DnnE4AeXMcKjHPAmFVjCBENaeyLVNHfr3px8xUstJ94hIpfH4HKE/eDaArK6lSyVVFbdt1gxTIVk3pppVlFXi4pEhVBTObquohU85MLXn1iahvUkHJjSCMc01tLFveVVBx0DodM6jftCu7DOtIzYxrc0qp1JGP2ayYFz2Gb6HvMrO8cnGtV6Gjm3uImSfD2GpWK6uowbZGMxFKQCo1pOMtcMXFpRst+hXGoAomF3sSTBGgTglbBKWwsQ3tZqaYSp0Z1CimRDWFcCJUPYJ00BI5FkKYNoifuQxmN88SWVXWLMaUqqqgC0BmQJR6sk3u9NCf6jYLXxAfqsYEgVLAhRY2AtgtflZNFmFyhxdrLkAdWlk4D88M2ixHyepIdhMHrG/iR1ZGtq0MGpbDbRPYOXeSY1M6Ny4ZstvGSktK+XbFPATj2D371saPEsAMXhXrsZ0km/XStkhhMyBfsa6uXFZe2VCe+YMr1+GKgwrQyNYq1VRrB+EizAow6NsdNKcyVEkYeM73ys6q4kAHp6BiFklTkIrVC5oYV7uzwOGCz4UJ0Stq2lWMJy4wtb+RetL6tZFicnJmBw5UjCvXXMZVJX2MQkbf+XN5EWd78Vz8/JEsMZTBiKNzsm1inLRUQ74H4NidaqI68j5sAFgxcRveC7ieLJXfQYxjZZ2CsiWFewZXJmBIlZ1tdtrX4hSuateKso/RZOtOKW2nmq1oTzeK6dRWAWu2NRVb4hq0SXm1GvtugHrbr5IXqmSktg5CuDE2MSlPwsY5kNE2Wp3AqiZbWVLAxiBF+2iBZbuNj6MB6rsMLC7FyasaYDyo7KkoPyEtw3pEMXfPvxAJi2jAQQgjrz0rLIZSWZlIoNhwd5xK4AR9mYNjWAaLrnuImJeBVN9zBORObVvbr+mTTfFSEJLSRnHo7hEJoIi8MFqjxmvgmF5URZz4zLFgZZ8Ctu2X7ggVccKm9gVxIsOHqxXgNMKnFWZYnf1dBnOhayXq17QwFlWW09eNKyVJFmXqaONGA5aCegMbJ3UUkGY1ic3nKWgjq8qfVYGQG1gRt6rs62a6HiqqUOqdesK5NmX4nGofJoiE1d0dF9lVVkvT1/kEEaaCoYOwFpcVcoLM+
17669PxC9rWqktH0sWUYld0VCpuBZ/stVRcGgy9WX2+U1Qthi9SzAqSxzZsy+OiFzBYnySGV6Gku44rD8BCOZBV3BvD5+AKRHNwMEsB6EzHnJpkTAeiUlEGkcECeB6GDZTp5YEJTlvdrknxYjTllMkfNtXwDjM7uVjK5JXUUn43rrqpK2jytaxHW0M5G8DC8rtHMYs7KSgduVQMGTYFqFvVS6rkD3sDJ46afdYFwoq11AOKCBLhvwoUgc8IGANycR6knZrdJPdsuxnyjfd3FovTlRMdEdtOl5CMV5EHsXQBis7TOwvIDZaGj2Vnpbh7cpK63VwYEMLwqbjzyl699sawFFkF1yqjUU31HfC6sW1ZFVFuXVXVgz9keEaw0ys1lWfm+azQAQSWA+hKYVfsZjPncAcUB9oIayy/UZXRNckDGji77GsWbvBo6tPrWPqOyVkBUq+INeqpzNdYs/u0ifh5qmpqIW+33JVSUcwY70KL4U9lYdU6ljtSls7lmfi9g3YzeQfVkaGFaV3ODCnaD2N8wsEDFklE3RzM3ZghdYkWHsszq70FIecnKkVkt8ezMzRq9bkGuKojRLBVSod3Y1yPqKgYW7JRQTPVyy5xIYLjOgxgT52RKJUY1dOrIiRd4futQx/A5AcSmEjz0vFWrkLzvbWAu9HOWbGgxFk1VNTpnBKk6TgwisI/HcxYXP1uAWO72ULFlBTq+aSu2VTUs6hrxM2CF+hEor1VIA9ZmFUaab1lSSgZsVs4sxzHlVLoJHr9H4DhONTkI1XC0/wiY2NoWAG5RlnHFnq6oLccpQddMuJ/O17JVA5OHLi0BqCztq7Y1++ucCd98qLI8MIHBV/cKjxQTme3hFBS3MyCqnDsuym2o80HjvFFTtrURmNaGJsmVahImjTsUXKtQZTAVs7Mvv8/+fzUrZAXcLJ6M4koe6XP0b6SmWWNDzyUpQ8bl+LtWx4tuqZ36cRYV3yuVxPNwvIiqiQCSmu7srgTzR6nkyhpCarXwFy1vGd5iP2cY06lFr5Njhhg1Y6+NB28ftbK83s8rf7kLJbKwDFPbLg25a0AdZJEiqr5phixKMDlRUtcssq1hriLqGoH+zeNgVm9OemjsETV8JdF0NHnkIFxWY1OB4Yrp7rtWJ7NgAAAPXklEQVQ3oNs5nplyVf8u2FoLu1JrHveaZWQjqAkshtFa2gzsSG3Zpkbvg3HafF9slPPlldjFlK80Gysm8Mr4MPhneNWENPGjAIpmilTPATdTRTXlCBYHYAQuPwA36xIpWtGN4q3Y2MhiGsUpuSSnlEJRD8PorC7CFYVw+F51qThgabxsTxWzCGY0ZSsb3lfqAy0OPNjNy8xiQQKsHYFQ2HBZVvVbBuq3m1oWKajqaonsM6uZUr6CjXWNZ0l5E3h3jURma6kP3MJIiy1Lm+kahQq41N2iZja5sjtlLYNZHZrH6qUGm4vMbDp6Rw2CFmvuyFkrBcCyMtFqBaECmsHoK9BZ2LA/lJcRqSaDqnaWbrZdGaz3DLgIvBln4woGztbyJGqslwxkhhHrTjTYFXCtOoKS8uLdofVdAbOylGU6nlYpXWZts4nXBq6WxJitMNokHUJnbnJplQm+aGpY2a5GMV2QD1hRubBPFKdumf5OHkLHz0F9luE5kjBjRa0nFE5CUGqHw32MmjZ6xkgINVnSnZ1VZStK2qKlRaLlQgK7uTq7JFXJwM+3SOEKyhZNI+tJ0I5qMYy9k2qJD7dVWdqKXa0CKNR0Ccjg+B2IYu2fcBZJZkMFgM11r0X92wilghFGgzVnexlqB7xL9mS29SiYUVY2nXOZjNBRsyDsQPRWW5hrZ4XcdC4HVWRbjgJr4sFofK5SzjQ7rhI1UebdPdEbj6sqIvTZQZ5va08rABsAW0UxeWytAk7A2KJ9ZpxzCioB24XFtYAeXYxr6anSqhLgppEqWbGwLunTgrV+IjWlL29ljaAl4EQMGsErp4apeZiquwRXLXAqOCeru32mmydc6oWTSWpFAGdzeTB8RTHVMEtlM90CbbQCYhPjq3egYr1FGdYIQjiuDGZ5zZ/AzobKGOyLxti6c4Rwtv2anyWlLICnlLhxJRXt6A5ebDBWFNONbxWZ2d02mnu4S9YECpeppV1zSWRBWxHYzVIv1CXSouwqqX3jBBBDZdYQbpTQW4ZQlS8r5kH4suSRmg2++3JN10x1PaAmEkmtYlEdeGpJEM6kOuCqCR22oSujj5IV2HdT0zj5prLKTjXFAPjdQlyq7xIBxAQP5yMczG4VxAKw0n6ilZ2QBce2pLulkuxxqnoIzFfgqyqjil9S1VNwBrFmeyeops8yOjZUybZdfS8CuaTIJumzs5tODaNtLpFDQ/PcJGweLhmeL1nB0KqiUDScsiUVD89Di3HtrKtSULw3RLiygZD+7sF8JTObgYsrGvDNUFRGl1iy0Ll1YkUc2aJYMog920I8qW6YDCg1Mqk0JHJFKXkbgbRreI+qpYNOZHrVcDUba7pjsphSJNtK6upgRNAVoOS0mugBeN4bIZgHhuPZ/s1ENaX6KsVr+YNrh1Nb7ipR0PE5zbNRegCbrHRUw6Yf07dLBJl1f8KB9as2V1nNqAsl62LBBhehwalerkHmB1JFIEZKSEusdl5JQj1nJlHXSCF342gJ9CYGrXelknJIXqVP8sD+qtplCR3XH2qfKq0ygMp+KnVkKxNlZ8m2YkIlVMiCnXUwl7qznBKSvQz3m3Pt6oQbXO5b5FixCh/fHxUQW/AEcK6zCNqKQnL9sywqmKuwvqSYzT/aPVNNpVyhvRW21aqciCsjdWvBwILUvh5VyCzbWoC1pJjJ680CWsl+udKB6T5RwG1mlohnlpbg47iz5U9ha0FGtmRLFYBtO99y97Ap0z+ZDTAog6kSLZsMHg/IFkkgp6CpvU2U0cYVSdnmkjwBdOmXbxTWNWzuIbipMioVxEckZEoahSOiy2M3K0jcC1LhVDwaqG0ZvkcWqCnrG4GIxykrqlbWdw6LQyBaZR8HmLRIhQWsHswD42ZXVLNkf9l+FlW0HVQ2lwFsC/Z1FdzlQR0KaPfo+Fdfu+/dwVRICu1CGR7AEIiAhc+AZUF0kOBaPxmUqg4i64vQnU4nFDYJ9Nz+1fVXveH9qmr+kPILx8oKcRV/BFbxbE0JMT0kSD4w6L/lNY8ocsqagVdU3A3MjxhxcGuqzsPH4irpaow1q6OyrVjvp9Npc59E91LldboYVzJWdimWfAW2SNEKcDaX2FmBLLA/uKxlmhh613Is1URQApbKfttwxL02q6Onx5pQxSbPojAg+v5hAnN6LHVRDXIsvKtRjiS0qJUyZTAXVbAK82ElFJWaQdVoqUC1Unt7BVaTQudM6SuqexjQJN4+0icaxv/utbKv83ETbT8H8gjcOKxOJmbUa6OOVXht3dFY6rHv9XoNzFLceEA1o8+pKm0LAHPHZ2rYKjFq0hfZFixsqHJgD3eD5n+U0kb1mFjXkn2lvMSSOsNE/CdIAKF0Sytq6urOHUN5gwg4GZosgbmggM5ucra2qrS2Ig1cbiBBcxYzgzUDNLCvL8GbZXNp6ORy3LmS+Kk83zRIAK6A1ioKa2I9NapIuiUFdfC9766PFZUtqUr6KbWk+zZU1a/ZrIXEztrjTOfz7hwKziCeXIaraHtbZIMz+2pGgazCmw4qWAFvEdhodYp0Xq0pV7G1YWYWbO4qhGq42+Z8BYtrLWvluNPpZAeaFFS1vubPgbgxsqcpnAaszBovKaFoDQ8BGtjfUOl4NAG2nmQV04feJgumvX2fsrQEWZghL0JnVdYkn3DOZIeRN86RqPWCmsvGVqEMRnwxQAxwS8EMYo3IzmY2+BCcLp4MKiuyuhImamlbZFcNoNl7tp+RHd18ZjQIRKyXdFRhN98/hyKqwXWNo7O1wiaXoHN108REZZWEq6grnIfjzeg8jdRf1XEL4kkXa5bBjKxoKaljBjeHlVxQ4GaycpW4lDOAKtnTxHAtOfzOtZwHAM7sqVXkV6yu6kap1nHkXKqWF/4XHqjenNKqBjpR3l1ch3Ejg1+EsgdQhsdG0B4FM9sWAVWpuAyiwTPleZxt9VyZVS2qXfReWqTAilpr9ApoWTj
1xymit7NwV4JTriZyOA9B0k7HFfULourmKYHVnRQvqGL5HMHdqFcR2qWpmcK6eTwx2dipWrviDilr+fKWq3OWRWdHKwA4eu8wjchbeRzFilqjjZN3ufCpfkJ0/scVpnYk6L0PI77lxdWCZ87WiWm7B/AGquQSnujGKsB8CJmiJq8q1pKIVWyqOiTK66r18BN8r74/AE71fdC3yPS2MxdOpnE1tlVxD9JmVOoggN+r4PjAXVFPa3Eg5jVJGFVUGNolH20GVrUB7BOySWq6WqYQdWR92pcFMYMwckbSgCKCqD67DiiWu1g8MQC9ByfcFqW1L+jL714qNCuznoSxt0da2gtWN1G8F0BK0NN0nuimelUF9dIdAfjO44UT3CjQLoUeLHJFTO3gmpRuIIOvwBQCbqNeo3qtZ9iF6xVK13GRlo4zqimq+CGdTiR1uRY8oqgE02hZBa79kZXPMquxRHKla2saZWN4mRqZUj0vLCKhkjKnqOQHNuSZVJoKvAqS1wpEquvWDC1B2ypwrCPsRMEPVTODMLJMDv6qeKXwi2JYV5Sq4qKyvgGsHCLiuj2jR59V8gMqSJ2FJZRXEHVRHj3sFPrct6OpqlW1GpatQdt0GvwfM6n63InsGVFhJGaBqgqqIV6IsXllZgySPq4R3bnt3wi5cv+cN2yqQLW1T95KYVsWWtKk4cB9W53WQQflQYR6Wl4HaJZjvVE0D5yvq+RKgZCs5qdBEP5sD94cAvQLlSgNaSMAtHx88BuNQ41zdFsX30zKbcs0MLD/ihkpQzl0wiTqKLTfbKmCmyYICnK0IbaieC4CG9iSyLQ7cIMGQwau6TKoq60Apl3WN40LZpca1CKKK9VQyyIEn8w0F8F6CL2h8o3ixGwC7s7EWzCOqmcApYxYD4jsAzVS0sl2t98pA7vrKophCVSonbYpgH6mvSn24pTBV4sdtV3BtMq5k82y+IADvUJ0uAlkCVTxIaPm+UNu/qkV4F1TzHXCGrXIAqItBKypqK99VtAOVs64O4ObX7pHLVCpYHcRmwvLR7TvYAKBBN58LGVzDuFz+hQbWgncQyCZAk+VbsPSouf93261iZgmfCpwRbAvqmSqriU2PwhjaoOyYqtIegVXViTsmyta6bGySpY3gyRrpIyAeaWDDxtpsXwKyalMDKNP7YBXMqEskUsi2uC8FNAPxAKTVfT1o6VzM0E0jF+1rWcUuHvdyg7vgoFplX8HpvHpMCOMRUPHzZkInsqlFKNX/EIO52E0SxSzOwob2VmRLW5D1XIU0rbgM1AzWgyC7fe8G7xUAK/taEBat7luqtyP7EmsaJQOj5F+mrnZfCuYCfBUAWwShyd6pMY/vAHG1UqOYpbI/gy5T0CMKm+UO3gFuC85dgfDVeguPDfITrIBLsLrcgdh3CFgFZjaKJ4Iv3F8ANEqvuxR1tVKOgLoCa1jxboBAkj6v7j/icFbA7f4rfRnQDLRViG13i0vqBQrYVqBbADZT0ZpiHoSzvQpopKIFS3sE1HfBWlHXd0H7LnArqvougMtljHBgZnh3Eoz/BKjLML4Z2Aq0+hEJr9jaVUBbvNzCIUiroC7AWmmFw4o5AK3MtB5VypZMSFgs05JyGVwlwBqsEGAAa2ZU1CjUexXGsE4rKriilBvFzOKKo3AuAroE6QFQU3u8YpNXwS5k+1TZt5UrwouN4KiUEw+k3ZWDp1RXHNRqXb21Ts39945yZSg3VnZFNQ9CF3XeZyr5DgBXKiwCMa2MxeTDYXgP1Fsf9QNKZc0k81RJk3r6EQ3rCmBVyLL75EjZ1pIVDHoFtiOAHoB0BdTVylqBsKKKS+AeBXJVLY+CXASuGvO/Auq7GuEjDfGKg1oKa1z/dmmi9I9SUGNhl0AtfulHAawoYrnSkmNXAVuGEhrEVXvUF+A5Ct2PqNOjDetyna4CmeUolmeXLN4Aq7C5Sj10Q7yjgl+t6CNxSRHmI5X+CpwreYB3Qfdqna4q21KdBuc4GoZsn49ZOOiVinwHqK9WzjvgeweEh2AU5+vtxZ9Cd9Wqkh49V18E5oj6vVyn0RStAyGIO5edXRKd5B0VGVXq2yr3xYp+5Ut+C4QJ4P1N339pQMjRejj4vb/Dcr6rQc3O/0rjmtZpeYCBiCHfCemRbNhbK/pNUPc3wfKy5f2D7OlL3/uPhve/oU4T0F8f+VNM2vyoiv0jK+KHQfdHq+0bncz4oz73/+Y6LbKw1o/5B7eOf1Rl/0du9B9tn/9bvrf/j+v0h6ttn2tp/r/4819y4/zv5391uvzzfwDifz6phT1MPgAAAABJRU5ErkJggg==");background-size:100% 100%;border:none;cursor:pointer;direction:ltr;height:130px;touch-action:manipulation;width:100%}.color-picker .cp-add-color-button-class{background:transparent;border:0;cursor:pointer;display:inline;margin:3px -3px;padding:0;position:absolute}.color-picker .cp-add-color-button-class:hover{text-decoration:underline}.color-picker .cp-add-color-button-class:disabled{color:#999;cursor:not-allowed}.color-picker .cp-add-color-button-class:disabled:hover{text-decoration:none}.color-picker .cp-remove-color-button-class{background:#fff;border-radius:50%;box-shadow:1px 1px 5px #333;cursor:pointer;display:block;height:10px;position:absolute;right:-5px;text-align:center;top:-5px;width:10px}.color-picker .cp-remove-color-button-class:before{bottom:3.5px;content:"x";display:inline-block;font-size:10px;position:relative}'],encapsulation:2}),ae})(),nt=(()=>{class ae{constructor(E,R,Y,ie,ge,xe){this.injector=E,this.cfr=R,this.appRef=Y,this.vcRef=ie,this.elRef=ge,this._service=xe,this.dialogCreated=!1,this.ignoreChanges=!1,this.viewAttachedToAppRef=!1,this.cpWidth="230px",this.cpHeight="auto",this.cpToggle=!1,this.cpDisabled=!1,this.cpIgnoredElements=[],this.cpFallbackColor="",this.cpColorMode="color",this.cpCmykEnabled=!1,this.cpOutputFormat="auto",this.cpAlphaChannel="enabled",this.cpDisableInput=!1,this.cpDialogDisplay="popup",this.cpSaveClickOutside=!0,this.cpCloseClickOutside=!0,this.cpUseRootViewContainer=!1,this.cpPosition="auto",this.cpPositionOffset="0%",this.cpPositionRelativeToArrow=!1,this.cpOKButton=!1,this.cpOKButtonText="OK",this.cpOKButtonClass="cp-ok-button-class",this.cpCancelButton=!1,this.cpCancelButtonText="Cancel",this.cpCancelButtonClass="cp-cancel-button-class",this.cpPresetLabel="Preset colors",this.cpPresetColorsClass="cp-preset-colors-class",this.cpMaxPresetColorsLength=6,this.cpPresetEmptyMessage="No colors added",this.cpPresetEmptyMessageClass="preset-empty-message",this.cpAddColorButton=!1,this.cpAddColorButtonText="Add color",this.cpAddColorButtonClass="cp-add-color-button-class",this.cpRemoveColorButtonClass="cp-remove-color-button-class",this.cpInputChange=new a.EventEmitter(!0),this.cpToggleChange=new a.EventEmitter(!0),this.cpSliderChange=new a.EventEmitter(!0),this.cpSliderDragEnd=new a.EventEmitter(!0),this.cpSliderDragStart=new a.EventEmitter(!0),this.colorPickerOpen=new a.EventEmitter(!0),this.colorPickerClose=new a.EventEmitter(!0),this.colorPickerCancel=ne
1w a.EventEmitter(!0),this.colorPickerSelect=new a.EventEmitter(!0),this.colorPickerChange=new a.EventEmitter(!1),this.cpCmykColorChange=new a.EventEmitter(!0),this.cpPresetColorsChange=new a.EventEmitter(!0)}handleClick(){this.inputFocus()}handleFocus(){this.inputFocus()}handleInput(E){this.inputChange(E)}ngOnDestroy(){null!=this.cmpRef&&(this.viewAttachedToAppRef&&this.appRef.detachView(this.cmpRef.hostView),this.cmpRef.destroy(),this.cmpRef=null,this.dialog=null)}ngOnChanges(E){E.cpToggle&&!this.cpDisabled&&(E.cpToggle.currentValue?this.openDialog():E.cpToggle.currentValue||this.closeDialog()),E.colorPicker&&(this.dialog&&!this.ignoreChanges&&("inline"===this.cpDialogDisplay&&this.dialog.setInitialColor(E.colorPicker.currentValue),this.dialog.setColorFromString(E.colorPicker.currentValue,!1),this.cpUseRootViewContainer&&"inline"!==this.cpDialogDisplay&&this.cmpRef.changeDetectorRef.detectChanges()),this.ignoreChanges=!1),(E.cpPresetLabel||E.cpPresetColors)&&this.dialog&&this.dialog.setPresetConfig(this.cpPresetLabel,this.cpPresetColors)}openDialog(){if(this.dialogCreated)this.dialog&&this.dialog.openDialog(this.colorPicker);else{let E=this.vcRef;if(this.dialogCreated=!0,this.viewAttachedToAppRef=!1,this.cpUseRootViewContainer&&"inline"!==this.cpDialogDisplay){const ie=this.injector.get(this.appRef.componentTypes[0],a.Injector.NULL);ie!==a.Injector.NULL?(E=ie.vcRef||ie.viewContainerRef||this.vcRef,E===this.vcRef&&console.warn("You are using cpUseRootViewContainer, but the root component is not exposing viewContainerRef!Please expose it by adding 'public vcRef: ViewContainerRef' to the constructor.")):this.viewAttachedToAppRef=!0}const R=this.cfr.resolveComponentFactory(ht);if(this.viewAttachedToAppRef)this.cmpRef=R.create(this.injector),this.appRef.attachView(this.cmpRef.hostView),document.body.appendChild(this.cmpRef.hostView.rootNodes[0]);else{const Y=a.ReflectiveInjector.fromResolvedProviders([],E.parentInjector);this.cmpRef=E.createComponent(R,0,Y,[])}this.cmpRef.instance.setupDialog(this,this.elRef,this.colorPicker,this.cpWidth,this.cpHeight,this.cpDialogDisplay,this.cpFallbackColor,this.cpColorMode,this.cpCmykEnabled,this.cpAlphaChannel,this.cpOutputFormat,this.cpDisableInput,this.cpIgnoredElements,this.cpSaveClickOutside,this.cpCloseClickOutside,this.cpUseRootViewContainer,this.cpPosition,this.cpPositionOffset,this.cpPositionRelativeToArrow,this.cpPresetLabel,this.cpPresetColors,this.cpPresetColorsClass,this.cpMaxPresetColorsLength,this.cpPresetEmptyMessage,this.cpPresetEmptyMessageClass,this.cpOKButton,this.cpOKButtonClass,this.cpOKButtonText,this.cpCancelButton,this.cpCancelButtonClass,this.cpCancelButtonText,this.cpAddColorButton,this.cpAddColorButtonClass,this.cpAddColorButtonText,this.cpRemoveColorButtonClass,this.elRef),this.dialog=this.cmpRef.instance,this.vcRef!==E&&this.cmpRef.changeDetectorRef.detectChanges()}}closeDialog(){this.dialog&&"popup"===this.cpDialogDisplay&&this.dialog.closeDialog()}cmykChanged(E){this.cpCmykColorChange.emit(E)}stateChanged(E){this.cpToggleChange.emit(E),E?this.colorPickerOpen.emit(this.colorPicker):this.colorPickerClose.emit(this.colorPicker)}colorChanged(E,R=!0){this.ignoreChanges=R,this.colorPickerChange.emit(E)}colorSelected(E){this.colorPickerSelect.emit(E)}colorCanceled(){this.colorPickerCancel.emit()}inputFocus(){const E=this.elRef.nativeElement,R=this.cpIgnoredElements.filter(Y=>Y===E);!this.cpDisabled&&!R.length&&("undefined"!=typeof document&&E===document.activeElement?this.openDialog():this.dialog&&this.dialog.show?this.closeDialog():this.openDialog())}inputChange(E){this.dialog?this.dialog.setColorFromString(E.target.value,!0):(this.colorPicker=E.target.value,this.colorPickerChange.emit(this.colorPicker))}inputChanged(E){this.cpInputChange.emit(E)}sliderChanged(E){this.cpSliderChange.emit(E)}sliderDragEnd(E){this.cpSliderDragEnd.emit(E)}sliderDragStart(E){this.cpSliderDragStart.emit(E)}presetColorsChanged(E){this.cpPresetColorsChange.emit(E)}}return ae.\u0275fac=function(E){return new(E||ae)(a.\u0275\u0275directiveInject(a.Injector),a.\u0275\u0275directiveInject(a.ComponentFactoryResolver),a.\u0275\u0275directiveInject(a.ApplicationRef),a.\u0275\u0275directiveInject(a.ViewContainerRef),a.\u0275\u0275directiveInject(a.ElementRef),a.\u0275\u0275directiveInject(ot))},ae.\u0275dir=a.\u0275\u0275defineDirective({type:ae,selectors:[["","colorPicker",""]],hostBindings:function(E,R){1&E&&a.\u0275\u0275listener("click",function(){return R.handleClick()})("focus",function(){return R.handleFocus()})("input",function(ie){return R.handleInput(ie)})},inputs:{cpWidth:"cpWidth",cpHeight:"cpHeight",cpToggle:"cpToggle",cpDisabled:"cpDisabled",cpIgnoredElements:"cpIgnoredElements",cpFallbackColor:"cpFallbackColor",cpColorMode:"cpColorMode",cpCmykEnabled:"cpCmykEnabled",cpOutputFormat:"cpOutputFormat",cpAlphaChannel:"cpAlphaChannel",cpDisableInput:"cpDisableInput",cpDialogDisplay:"cpDialogDisplay",cpSaveClickOutside:"cpSaveClickOutside",cpCloseClickOutside:"cpCloseClickOutside",cpUseRootViewContainer:"cpUseRootViewContainer",cpPosition:"cpPosition",cpPositionOffset:"cpPositionOffset",cpPositionRelativeToArrow:"cpPositionRelativeToArrow",cpOKButton:"cpOKButton",cpOKButtonText:"cpOKButtonText",cpOKButtonClass:"cpOKButtonClass",cpCancelButton:"cpCancelButton",cpCancelButtonText:"cpCancelButtonText",cpCancelButtonClass:"cpCancelButtonClass",cpPresetLabel:"cpPresetLabel",cpPresetColorsClass:"cpPresetColorsClass",cpMaxPresetColorsLength:"cpMaxPresetColorsLength",cpPresetEmptyMessage:"cpPresetEmptyMessage",cpPresetEmptyMessageClass:"cpPresetEmptyMessageClass",cpAddColorButton:"cpAddColorButton",cpAddColorButtonText:"cpAddColorButtonText",cpAddColorButtonClass:"cpAddColorButtonClass",cpRemoveColorButtonClass:"cpRemoveColorButtonClass",colorPicker:"colorPicker",cpPresetColors:"cpPresetColors"},outputs:{cpInputChange:"cpInputChange",cpToggleChange:"cpToggleChange",cpSliderChange:"cpSliderChange",cpSliderDragEnd:"cpSliderDragEnd",cpSliderDragStart:"cpSliderDragStart",colorPickerOpen:"colorPickerOpen",colorPickerClose:"colorPickerClose",colorPickerCancel:"colorPickerCancel",colorPickerSelect:"colorPickerSelect",colorPickerChange:"colorPickerChange",cpCmykColorChange:"cpCmykColorChange",cpPresetColorsChange:"cpPresetColorsChange"}
1,exportAs:["ngxColorPicker"],features:[a.\u0275\u0275NgOnChangesFeature]}),ae})(),ut=(()=>{class ae{}return ae.\u0275fac=function(E){return new(E||ae)},ae.\u0275mod=a.\u0275\u0275defineNgModule({type:ae}),ae.\u0275inj=a.\u0275\u0275defineInjector({providers:[ot],imports:[[T.ez]]}),ae})()},3449:(je,ke,x)=>{x.d(ke,{h:()=>T});var a=x(7074);class T{constructor(){}static GetExchangeName(n){let l="";try{switch(n){case a.x.C_V_EXCHANGE_BSE_ID:l=a.x.C_S_EXCHANGE_BSE_ID;break;default:l=""}}catch(g){}return l}static GetOrderType(n){let l="";try{switch(n){case a.x.C_V_MF_ORDER_STATUS_PENDING:l=a.x.C_S_MF_ORDER_STATUS_PENDING;break;case a.x.C_V_MF_ORDER_STATUS_INPROCESS:l=a.x.C_S_MF_ORDER_STATUS_INPROCESS;break;case a.x.C_V_MF_ORDER_STATUS_EXECUTED:l=a.x.C_S_MF_ORDER_STATUS_EXECUTED;break;case a.x.C_V_MF_ORDER_STATUS_REJECTED:l=a.x.C_S_MF_ORDER_STATUS_REJECTED;break;case a.x.C_V_MF_ORDER_STATUS_CANCELLED:l=a.x.C_S_MF_ORDER_STATUS_CANCELLED;break;case a.x.C_V_MF_ORDER_STATUS_STOPPED:l=a.x.C_S_MF_ORDER_STATUS_STOPPED;break;case a.x.C_V_MF_ORDER_STATUS_RUNNING:l=a.x.C_S_MF_ORDER_STATUS_RUNNING;break;case a.x.C_V_MF_ORDER_STATUS_COMPLETED:l=a.x.C_S_MF_ORDER_STATUS_COMPLETED;break;case a.x.C_V_MF_ORDER_STATUS_GATEWAYREJECTED:l=a.x.C_S_MF_ORDER_STATUS_GATEWAYREJECTED;break;case a.x.C_V_MF_ORDER_STATUS_PAYMENTAWAITED:l=a.x.C_S_MF_ORDER_STATUS_PAYMENTAWAITED;break;case a.x.C_V_MF_ORDER_STATUS_XMITTED:l=a.x.C_S_MF_ORDER_STATUS_XMITTED;break;default:l=""}}catch(g){}return l}static GetTransactionType(n){let l="";try{switch(n){case a.x.C_S_MF_TRANSACTION_TYPE_PURCHASE:l=a.x.C_S_MF_TRANSACTION_NAME_PURCHASE;break;case a.x.C_S_MF_TRANSACTION_TYPE_REDEEM:l=a.x.C_S_MF_TRANSACTION_NAME_REDEEM;break;case a.x.C_S_MF_TRANSACTION_TYPE_SIP:l=a.x.C_S_MF_TRANSACTION_NAME_SIP;break;case a.x.C_S_MF_TRANSACTION_TYPE_SWP:l=a.x.C_S_MF_TRANSACTION_NAME_SWP;break;case a.x.C_S_MF_TRANSACTION_TYPE_STP:l=a.x.C_S_MF_TRANSACTION_NAME_STP;break;case a.x.C_S_MF_TRANSACTION_TYPE_SWITCH:l=a.x.C_S_MF_TRANSACTION_NAME_SWITCH;break;default:l=n}}catch(g){}return l}static GetHoldingType(n){let l="";try{switch(n){case a.x.C_S_MF_TRANSMODE_DEMAT_VALUE:l=a.x.C_S_MF_TRANSMODE_DEMAT_TEXT;break;default:l=""}}catch(g){}return l}static getFrequencyName(n){var l="";try{switch(n){case a.x.C_V_MF_FREQUENCY_DAILY:l=a.x.C_S_MF_FREQUENCY_NAME_DAILY;break;case a.x.C_V_MF_FREQUENCY_WEEKLY:l=a.x.C_S_MF_FREQUENCY_NAME_WEEKLY;break;case a.x.C_V_MF_FREQUENCY_MONTHLY:l=a.x.C_S_MF_FREQUENCY_NAME_MONTHLY;break;case a.x.C_V_MF_FREQUENCY_QUERTERLY:l=a.x.C_S_MF_FREQUENCY_NAME_QUERTERLY;break;case a.x.C_V_MF_FREQUENCY_SEMIANNUALLY:l=a.x.C_S_MF_FREQUENCY_NAME_SEMIANNUALLY;break;case a.x.C_V_MF_FREQUENCY_YEARLY:l=a.x.C_S_MF_FREQUENCY_NAME_YEARLY}}catch(g){}return l}static ErrorMessages(n){let l="";try{if(null!=n&&null!=n&&n.length>0)for(var g=0;g<n.length;g++)l=l+n[g]+"\n";else l=""}catch(b){l=""}return l}}},7074:(je,ke,x)=>{x.d(ke,{x:()=>a});let a=(()=>{class T{}return T.C_V_EXCHANGE_BSE_ID=3,T.C_S_EXCHANGE_BSE_ID="BSE",T.C_V_MF_ORDER_STATUS_PENDING=1,T.C_V_MF_ORDER_STATUS_INPROCESS=2,T.C_V_MF_ORDER_STATUS_EXECUTED=3,T.C_V_MF_ORDER_STATUS_REJECTED=4,T.C_V_MF_ORDER_STATUS_CANCELLED=5,T.C_V_MF_ORDER_STATUS_STOPPED=6,T.C_V_MF_ORDER_STATUS_RUNNING=7,T.C_V_MF_ORDER_STATUS_COMPLETED=8,T.C_V_MF_ORDER_STATUS_GATEWAYREJECTED=9,T.C_V_MF_ORDER_STATUS_PAYMENTAWAITED=10,T.C_V_MF_ORDER_STATUS_XMITTED=11,T.C_S_MF_ORDER_STATUS_PENDING="Pending",T.C_S_MF_ORDER_STATUS_INPROCESS="In-Process",T.C_S_MF_ORDER_STATUS_EXECUTED="Executed",T.C_S_MF_ORDER_STATUS_REJECTED="Rejected",T.C_S_MF_ORDER_STATUS_CANCELLED="Cancelled",T.C_S_MF_ORDER_STATUS_STOPPED="Stopped",T.C_S_MF_ORDER_STATUS_RUNNING="Running",T.C_S_MF_ORDER_STATUS_COMPLETED="Completed",T.C_S_MF_ORDER_STATUS_GATEWAYREJECTED="Gateway Rejected",T.C_S_MF_ORDER_STATUS_PAYMENTAWAITED="Payment Awaited",T.C_S_MF_ORDER_STATUS_XMITTED="Xmitted",T.C_S_MF_TRANSACTION_TYPE_PURCHASE="P",T.C_S_MF_TRANSACTION_TYPE_REDEEM="R",T.C_S_MF_TRANSACTION_TYPE_SIP="SIP",T.C_S_MF_TRANSACTION_TYPE_SWP="SWP",T.C_S_MF_TRANSACTION_TYPE_STP="STP",T.C_S_MF_TRANSACTION_TYPE_SWITCH="SWITCH",T.C_S_MF_TRANSACTION_NAME_PURCHASE="Purchase",T.C_S_MF_TRANSACTION_NAME_REDEEM="Redeem",T.C_S_MF_TRANSACTION_NAME_SIP="SIP",T.C_S_MF_TRANSACTION_NAME_SWP="SWP",T.C_S_MF_TRANSACTION_NAME_STP="STP",T.C_S_MF_TRANSACTION_NAME_SWITCH="Switch",T.C_S_MF_TRANSMODE_DEMAT_VALUE="D",T.C_S_MF_TRANSMODE_PHYSICAL_VALUE="P",T.C_S_MF_TRANSMODE_BOTH_VALUE="DP",T.C_S_MF_TRANSMODE_DEMAT_TEXT="Demat",T.C_S_MF_TRANSMODE_PHYSICAL_TEXT="Physical",T.C_S_MF_FREQUENCY_NAME_DAILY="Daily",T.C_S_MF_FREQUENCY_NAME_WEEKLY="Weekly",T.C_S_MF_FREQUENCY_NAME_MONTHLY="Monthly",T.C_S_MF_FREQUENCY_NAME_QUERTERLY="Quarterly",T.C_S_MF_FREQUENCY_NAME_SEMIANNUALLY="Semi-Annually",T.C_S_MF_FREQUENCY_NAME_YEARLY="Yearly",T.C_V_MF_FREQUENCY_DAILY="D",T.C_V_MF_FREQUENCY_WEEKLY="W",T.C_V_MF_FREQUENCY_MONTHLY="M",T.C_V_MF_FREQUENCY_QUERTERLY="Q",T.C_V_MF_FREQUENCY_SEMIANNUALLY="H",T.C_V_MF_FREQUENCY_YEARLY="Y",T.C_S_MENU_MF_ORDERBOOK="302",T.C_S_MENU_MF_OE="301",T.C_S_OE_FROM_OB="OB",T.C_S_OE_FROM_LOOKUP="LOOKUP",T.C_S_OE_FROM_SCHEMEINFO="SCRIPINFO",T.C_S_OE_FROM_SCHEMELINK="SL",T.C_V_PAGESOURCE_OE="OE",T.C_V_PAGESOURCE_NFO="NFO",T.C_V_PAGESOURCE_UNITHOLDING="UH",T.C_V_PAGESOURCE_MARKETWATCH="MW",T.C_V_PAGESOURCE_SCHEMEINFO="SI",T.C_S_MF_ORDERBOOK_TODAY="TO",T.C_S_MF_ORDERBOOK_HISTORIC="HO",T.C_S_MF_SIP_ORDERBOOK_TODAY="TSO",T.C_S_MF_SIP_ORDERBOOK_HISTORIC="HSO",T.C_V_ORDERBOOK_REFRESH_TIME=3e3,T.C_S_OE_TRANSACTION_TYPE="MOD",T.C_S_OE_TRANSACTIONTYPE_NEW_TEXT="NEW",T.C_S_ORDERBOOK_ALL_AMC="0",T.C_S_ORDERBOOK_ALL_TRANSACTION="A",T.C_V_ORDERBOOK_ALL_ORDER=0,T.C_V_ORDERBOOK_NOOFRECORD_PE
1R_PAGE=9999,T.C_S_MF_REDEMPTIONTYPE_AMOUNT_TEXT="Amount",T.C_S_MF_REDEMPTIONTYPE_UNITS_TEXT="Units",T.C_S_MF_REDEMPTIONTYPE_ALLUNIT_TEXT="All Units",T.C_S_MF_TOPPERFORMER_SORTORDER="desc",T.C_S_MF_TOPPERFORMER_SORTCOLUMN="1Y",T.C_S_MF_TOPPERFORMER_PLAN_TYPE="I",T.C_S_MF_TOPPERFORMER_INVESTMENT_TYPE="GR",T.C_S_MF_TOPPERFORMER_COUNT=5,T.C_S_MF_TOPPERFORMER_COUNT_DETAILS=100,T.C_V_MF_SCHEMEPORTFOLIO_SECTOR=1,T.C_V_MF_SCHEMEPORTFOLIO_COMPANY=2,T.C_V_MF_SCHEMEPORTFOLIO_MARKETCAP=3,T.C_V_MF_SCHEMELINK_PS_HOLDING="UH",T.C_V_MF_SCHEMELINK_PS_TOP_PERF="TOPPERF",T.C_V_MF_SCHEMELINK_PS_OTHERS="OTH",T.C_V_MF_SCHEMELINK_PS_NFO="NFO",T.C_V_MF_SCHEMECODE_SYSTEM="S",T.C_V_MF_SCHEMECODE_EXCHANGE="E",T.C_V_E_MANDATE_MAX_AMOUNT=1e5,T.C_V_I_X_MANDATE_MAX_AMOUNT=1e7,T.C_V_MF_SI_SECTOR_CHART_COUNT=5,T})()},1739:(je,ke,x)=>{x.d(ke,{w:()=>G});var a=x(2741),T=x(8906);let G=(()=>{class n{constructor(g){this.elementRef=g,this.toggleClick=!0,this.activateOnFocus=!1,this.onOpen=new a.EventEmitter,this.onClose=new a.EventEmitter,this.openOnHover=!1,this.closeOnOutsideClick=!0}open(){this.elementRef.nativeElement.classList.add("open"),this.onOpen.emit(void 0)}close(){this.elementRef.nativeElement.classList.remove("open"),this.onClose.emit(void 0)}isOpened(){return this.elementRef.nativeElement.classList.contains("open")}isInClosableZone(g){return!!this.notClosableZone&&this.notClosableZone.contains(g)}onmouseleave(g){this.openOnHover&&this.close()}onclick(g){this.openOnHover&&"A"==document.activeElement.tagName&&this.close()}}return n.\u0275fac=function(g){return new(g||n)(a.\u0275\u0275directiveInject(a.ElementRef))},n.\u0275dir=a.\u0275\u0275defineDirective({type:n,selectors:[["","dropdown",""]],contentQueries:function(g,b,p){if(1&g&&a.\u0275\u0275contentQuery(p,T.i,5),2&g){let h;a.\u0275\u0275queryRefresh(h=a.\u0275\u0275loadQuery())&&(b.notClosableZone=h.first)}},hostBindings:function(g,b){1&g&&a.\u0275\u0275listener("mouseleave",function(h){return b.onmouseleave(h)})("click",function(h){return b.onclick(h)})},inputs:{toggleClick:["dropdownToggle","toggleClick"],activateOnFocus:["dropdownFocusActivate","activateOnFocus"],openOnHover:"openOnHover",closeOnOutsideClick:"closeOnOutsideClick"},outputs:{onOpen:"onOpen",onClose:"onClose"},exportAs:["dropdown"]}),n})()},8906:(je,ke,x)=>{x.d(ke,{i:()=>T});var a=x(2741);let T=(()=>{class G{constructor(l){this.elementRef=l}contains(l){return!1!==this.dropdownNotClosabledZone&&this.elementRef.nativeElement.contains(l)}}return G.\u0275fac=function(l){return new(l||G)(a.\u0275\u0275directiveInject(a.ElementRef))},G.\u0275dir=a.\u0275\u0275defineDirective({type:G,selectors:[["","dropdown-not-closable-zone",""]],inputs:{dropdownNotClosabledZone:["dropdown-not-closable-zone","dropdownNotClosabledZone"]}}),G})()},9873:(je,ke,x)=>{x.d(ke,{X:()=>G});var a=x(2741),T=x(1739);let G=(()=>{class n{constructor(g,b){this.dropdown=g,this.elementRef=b,this.openedByFocus=!1;const p=this;this.closeDropdownOnOutsideClick=function(o){p.closeIfInClosableZone(o)}}toggle(){this.dropdown.isOpened()?this.close():this.open()}open(){this.dropdown.isOpened()||(this.dropdown.open(),document.addEventListener("click",this.closeDropdownOnOutsideClick,!0))}close(){!this.dropdown.isOpened()||(this.dropdown.close(),document.removeEventListener("click",this.closeDropdownOnOutsideClick,!0))}openDropdown(){this.dropdown.activateOnFocus&&this.openedByFocus?this.openedByFocus=!1:this.dropdown.isOpened()&&this.dropdown.toggleClick?this.close():this.open()}OnMouseOver(){var g=this.elementRef.nativeElement.parentNode.children;if(void 0!==g[1]&&g[1].childElementCount>=4&&(g[1].style.width="850px"),this.dropdown.openOnHover){if(this.dropdown.activateOnFocus&&this.openedByFocus)return void(this.openedByFocus=!1);this.dropdown.isOpened()&&this.dropdown.toggleClick?this.close():this.open()}}OnMouseLeave(g){this.dropdown.openOnHover&&g.relatedTarget&&!this.dropdown.isInClosableZone(g.relatedTarget)&&g.relatedTarget!==this.elementRef.nativeElement&&(this.dropdown.close(),document.removeEventListener("click",this.closeDropdownOnOutsideClick,!0))}dropdownKeydown(g){40===g.keyCode&&this.openDropdown()}onFocus(){!this.dropdown.activateOnFocus||(this.openedByFocus=!0,this.dropdown.open(),document.addEventListener("click",this.closeDropdownOnOutsideClick,!0))}onBlur(g){!this.dropdown.activateOnFocus||g.relatedTarget&&!this.dropdown.isInClosableZone(g.relatedTarget)&&g.relatedTarget!==this.elementRef.nativeElement&&(this.dropdown.close(),document.removeEventListener("click",this.closeDropdownOnOutsideClick,!0))}ngOnDestroy(){document.removeEventListener("click",this.closeDropdownOnOutsideClick,!0)}closeIfInClosableZone(g){this.dropdown.closeOnOutsideClick&&!this.dropdown.isInClosableZone(g.target)&&g.target!==this.elementRef.nativeElement&&!this.elementRef.nativeElement.contains(g.target)&&("MAT-OPTION"!=document.activeElement.nodeName&&this.dropdown.close(),"MAT-OPTION"!=document.activeElement.nodeName&&document.removeEventListener("click",this.closeDropdownOnOutsideClick,!0))}}return n.\u0275fac=function(g){return new(g||n)(a.\u0275\u0275directiveInject(T.w,1),a.\u0275\u0275directiveInject(a.ElementRef))},n.\u0275dir=a.\u0275\u0275defineDirective({type:n,selectors:[["","dropdown-open",""]],hostBindings:function(g,b){1&g&&a.\u0275\u0275listener("click",function(){return b.openDropdown()})("mouseover",function(){return b.OnMouseOver()})("mouseleave",function(h){return b.OnMouseLeave(h)})("keydown",function(h){return b.dropdownKeydown(h)})("focus",function(){return b.onFocus()})("blur",function(h){return b.onBlur(h)})},exportAs:["dropdownOpen"]}),n})()},3213:(je,ke,x)=>{x.d(ke,{A:()=>n});var a=x(2741),T=x(3324),G=x(6274);let n=(()=>{class l{constructor(){this.min=0}ngOnInit(){this.minValue=this.min,this.maxValue=this.max,this.value=this.datavalue,this.change()}ngOnChanges(b){this.minValue=0,this.maxValue=0,this.value=0,(b.min||b.max||b.datavalue)&&(this.minValue=this.min,this.maxValue=this.max,this.value=this.datavalue,this.change())}change(){this.slidethumb="";var b=Number(this.min),p=Number(this.max),h=Number(this.value);if(0!=b&&0!=p){var o=(p-b)/3;h<=o+b?this.slidethumb="red":o+b<h&&h<=2*o+b?this.slidethumb="grey":2*o+b<=p&&(this.slidethumb="green")}else this.value=0}onRangeChange(){this.change()}}return l.\u0275fac=function(b){return new(b||l)},l.\u0275cmp=a.\u0275\u0275defineComponent({type:l,selectors:[["rangeSlider"]],inputs:{min:"min",max:"max",datavalue:"datavalue"}
1,features:[a.\u0275\u0275NgOnChangesFeature],decls:13,vars:7,consts:[[1,"rangeslide"],[1,"rangeslidechart"],[3,"change"],["type","range",1,"range1","red",3,"min","max","ngModel","disabled","ngClass","ngModelChange"],[1,"rangeslideprice"],[1,"rpl"],[1,"rpr"]],template:function(b,p){1&b&&(a.\u0275\u0275elementStart(0,"div",0),a.\u0275\u0275elementStart(1,"div",1),a.\u0275\u0275elementStart(2,"div",2),a.\u0275\u0275listener("change",function(){return p.onRangeChange()}),a.\u0275\u0275elementStart(3,"div"),a.\u0275\u0275elementStart(4,"input",3),a.\u0275\u0275listener("ngModelChange",function(o){return p.value=o}),a.\u0275\u0275elementEnd(),a.\u0275\u0275text(5,"\xa0 "),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(6,"div",4),a.\u0275\u0275elementStart(7,"div",5),a.\u0275\u0275elementStart(8,"span"),a.\u0275\u0275text(9),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(10,"div",6),a.\u0275\u0275elementStart(11,"span"),a.\u0275\u0275text(12),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()),2&b&&(a.\u0275\u0275advance(4),a.\u0275\u0275property("min",p.minValue)("max",p.maxValue)("ngModel",p.value)("disabled",!0)("ngClass",p.slidethumb),a.\u0275\u0275advance(5),a.\u0275\u0275textInterpolate(p.min),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(p.max))},directives:[T.eT,T.Fj,T.JJ,T.On,G.mk],encapsulation:2}),l})()},3627:(je,ke,x)=>{x.d(ke,{e:()=>T});var a=x(1705),T=T||{};T.extendFTChartLib=function(G,n){var b,p,l=n.split("."),g=G;for("FTChartLib"==l[0]&&(l=l.slice(1)),b=l.length,p=0;p<b;p++)void 0===g[l[p]]&&(g[l[p]]={}),g=g[l[p]];return g},T.GraphTypes=Object.freeze({Line:1,Area:2,Bar:3,Volume:4,Candle:5}),T.GraphStyles=Object.freeze({Line:1,Dot:2,Dash:3,DotDash:4,Bar:5,Ellipse:6,Candle:7,OpenClose:8,Histogram:9}),T.FillStyles=Object.freeze({Solid:1,Gradient:2,Image:3,Pattern:4}),T.DataSources=Object.freeze({Open:1,High:2,Low:3,Close:4,Volume:5}),T.ChartViewTypes=Object.freeze({Basic:1,Advanced:2}),T.GraphPanelTypes=Object.freeze({Price:0,Volume:1,Indicator:2}),T.GraphPanelHeightRatio=Object.freeze({Price:3,Volume:1.5,Indicator:1}),T.ChartAxisTypes=Object.freeze({Main:0,Volume:1,OtherAxis:2}),Array.prototype.max=function(){return Math.max.apply(Math,this)},Array.prototype.min=function(){return Math.min.apply(Math,this)},Date.prototype.getWeek=function(){var G=new Date(this.getFullYear(),0,1);return Math.ceil(((this-G)/864e5+G.getDay()+1)/7)},Date.prototype.dateDiff=function(G,n,l){return G=G.toLowerCase(),Math.floor((l-n)/{w:6048e5,d:864e5,h:36e5,n:6e4,s:1e3}[G])},Number.prototype.toFixedDown=function(G){var n=new RegExp("(\\d+\\.\\d{"+G+"})(\\d)"),l=this.toString().match(n);return l?parseFloat(l[1]):this.valueOf()},T.FTGraphStyles=function(G,n,l,g){var b=this;b.strokeStyle=null!=G&&null!=G?G:T.GraphStyles.Line,b.strokeColor=n,b.strokeSize=1,b.fillStyle=null!=l&&null!=l?l:T.FillStyles.Solid,b.fillColor=g,b.fillePattern=null},T.FTGraphParams=function(G,n,l,g,b,p,h,o){var u=this;u.chart=G,u.graphType=null!=n&&null!=n?n:T.GraphTypes.Line,u.graphPanel=l,u.title=null!=g&&null!=g?g:"",u.graphStyle=new T.FTGraphStyles(b,p,h,o)},T.GaphPanel=function(G,n,l,g,b){var p=this;p.GPanelId=G,p.GPanelType=null!=n&&null!=n?n:T.GraphPanelTypes.Price,p.GPIndex=b,p.Name=g,p.PanelHeightRatio=T.GraphPanelTypes.Price==p.GPanelType?T.GraphPanelHeightRatio.Price:T.GraphPanelTypes.Volume==p.GPanelType?T.GraphPanelHeightRatio.Volume:T.GraphPanelHeightRatio.Indicator,p.Axis=l,p.VolumePostfixLetter="",p.VolumeDivisor=1,p.Graphs=[],p.GPanelRect={Top:0,Bottom:0,Height:100,Width:100},p.addGraph=function(h){p.Graphs.indexOf(h)<0&&p.Graphs.push(h)},p.removeGraph=function(h){var o=p.Graphs.indexOf(h);o>=0&&p.Graphs.splice(o,1)},p.updateGraph=function(h,o){var u=p.Graphs.indexOf(h);u>=0&&(p.Graphs[u]=o)},p.setDataRange=function(h,o){var u=0,m=0;u=m=p.Graphs[0].graphData[h];for(var f=0;f<p.Graphs.length;f++)if(T.GraphTypes.Candle==p.Graphs[f].graphType){var i=p.Graphs[f].Graph.data,P=i.high.slice(h,o+1),_=i.low.slice(h,o+1),k=P.max(),W=_.min();u=null==u||u<k?k:u,m=null==m||m>W?W:m}else if(null!=p.Graphs[f].graphData){var N=p.Graphs[f].graphData.slice(h,o+1);k=(N=N.filter(function(w){return null!=w})).max(),W=N.min(),u=null==u||u<k?k:u,m=null==m||m>W?W:m}var Q=.1*(m<u-m?m:u-m);switch(p.GPanelType){case T.GraphPanelTypes.Price:m=Math.floor(m-Math.abs(Q)),u=Math.ceil(u+Math.abs(Q));break;case T.GraphPanelTypes.Volume:Q=Q<0?0:Q,m=0,(u=Math.ceil(u+Math.abs(Q)))-m>4e3?(p.VolumePostfixLetter=" K",p.VolumeDivisor=1e3):(p.VolumePostfixLetter="",p.VolumeDivisor=1);break;default:m=Math.floor(m-Math.abs(Q)),u=Math.ceil(u+Math.abs(Q))}p.Axis.setMinMax(m,u)},p.VolumeAxisLabelFormatter=function(h,o){var u=o;return p.VolumeDivisor>1&&0!=h&&(u=h/p.VolumeDivisor+p.VolumePostfixLetter),u},T.GraphPanelTypes.Volume==p.GPanelType&&(p.Axis.labels.ongetlabel=p.VolumeAxisLabelFormatter)},T.FTGraph=function(G,n,l,g,b){var p=this;p.id=g,p.graphType=l,p.graphPanel=n,p.Graph=G,p.graphData=null,p.isPriceGraph=!1,p.canSelected=!1,p.isSelected=!1,null!=p.Graph&&null!=p.Graph&&(p.Graph.title=b,p.Graph.vertAxis=p.graphPanel.Axis),p.loadData=function(h,o){p.graphData=h,p.Graph.data.values=h},p.updateGraphPanel=function(h){p.graphPanel=h,p.Graph.vertAxis=p.graphPanel.Axis},p.setOHCLForCandle=function(h){p.Graph.data.open=h.Open,p.Graph.data.high=h.High,p.Graph.data.low=h.Low,p.Graph.data.close=h.Close},p.addBottomLabels=function(h){p.Graph.data.x=h},p.addBeforeDrawHandler=function(h){p.Graph.onbeforedraw=h},p.markGraphCanSelected=function(h){p.canSelected=h,p.Graph.onclick=h?p.onClick:null},p.onClick=function(h,o,u,m){p.canSelected&&(p.isSelected=!p.isSelected)}},T.FTLine=function(G,n,l,g,b){var p=this;T.FTGraph.call(p,new Tee.Line,n,T.GraphTypes.Line,0,G),p.Graph.format.stroke.fill=null!=b&&null!=b?b:"#00FF00",p.loadData(l,g),p.updateGraphStyle=function(h,o,u){T.chartHelper.currentTheme.applyThemeToLineGraph(h,o,u)}},T.FTLine.prototype=new T.FTGraph,T.FTBar=function(G,n,l,g,b){var p=this;T.FTGraph.call(p,new Tee.Bar,n,T.GraphTypes.BarSolid,0,G),null!=b&&null!=b&&(p.Graph.format.fill=b,p.Graph.format.stroke.fill=b),p.loadData(l,g)},T.FTBar.prototype=new T.FTGraph,T.FTArea=function(G,n,l,g,b){var p=this;
1T.FTGraph.call(p,new Tee.Area,n,T.GraphTypes.Area,0,G),null!=b&&null!=b&&(p.Graph.color=b),p.loadData(l,g)},T.FTArea.prototype=new T.FTGraph,T.FTVolume=function(G,n,l,g,b){var p=this;T.FTGraph.call(p,new Tee.Volume,n,T.GraphTypes.Volume,0,G),null!=b&&null!=b&&(p.Graph.color=b,p.Graph.format.stroke.fill=b),p.loadData(l,g),p.updateGraphStyle=function(h,o,u){T.chartHelper.currentTheme.applyThemeToVolumeGraph(h,o,u,T.FillStyles.Solid)}},T.FTVolume.prototype=new T.FTGraph,T.FTCandle=function(G,n,l,g,b){var p=this;T.FTGraph.call(p,new Tee.Candle,n,T.GraphTypes.Candle,0,G),null!=b&&null!=b&&(p.Graph.color=b),p.loadData(l,g),p.setOHCLForCandle(g)},T.FTCandle.prototype=new T.FTGraph,T.FTCursorTool=function(G,n,l,g,b){var p=this;p.cursor=new Tee.CursorTool(G),p.cursor.direction=null!=n&&null!=n?n:"vertical",p.cursor.vertAxis=l,p.cursor.render="full",T.chartHelper.currentTheme.applyThemeToCursorTool(p.cursor,b),G.tools.add(p.cursor),p.setVisiblity=function(h){p.cursor.active=h},p.setDirection=function(h){p.cursor.direction=null!=h&&null!=h?h:"vertical"},p.onChangeHandler=function(h){}},T.FTChartScroller=function(G){var n=this;n.scrollerCanvas=document.createElement("canvas"),n.scrollerCanvas.width=600,n.scrollerCanvas.height=50,n.scrollerChart=new Tee.Chart,n.chartScroller=new Tee.Scroller(n.scrollerCanvas,n.scrollerChart),n.chartScroller.scroller.margin=2,T.chartHelper.currentTheme.applyTheme(n.scrollerChart),T.chartHelper.currentTheme.removeAxisTicksLabelofChart(n.scrollerChart),T.chartHelper.currentTheme.applyThemeToChartScroller(n.chartScroller),n.addGraph=function(l,g){var b=new Tee.Area;b.data.values=l,T.chartHelper.currentTheme.applyThemeToAreaGraph(b),n.scrollerChart.addSeries(b)},n.drawChart=function(){},n.resize=function(l,g,b){n.chartScroller.canvas.width=l,n.chartScroller.canvas.height=30,n.chartScroller.bounds.width=l-4,n.chartScroller.bounds.height=30,n.chartScroller.setBounds(0,0,l-4,30),n.chartScroller.draw()},n.chartScroller.onChanging=function(l,g,b){if(null!=n.onChangingCallback){var p=Math.floor(g);n.onChangingCallback(n,p<0?0:p,Math.ceil(b))}},n.setDataRange=function(l,g,b){null!=l&&null!=l&&l!=n&&(n.scrollerChart.axes.bottom.setMinMax(g,b),n.chartScroller.draw())}},T.FTBlackTheme=function(){var G=this;G.paletteName="FTILDark",G.colorList=["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)","rgb(255,127,0)","rgb(202,178,214)","rgb(106,61,154)","rgb(255,255,153)","rgb(177,89,40)"],G.featureColor=a.US.FT_CHART.FEATURE,G.defaultStrokeColor="rgba(39,79,105,0.8)",G.backBlendColor="rgba(132,132,132,1)",G.baseFontStyle="16px Segoe UI",G.applyTheme=function(n){if(n.paletteName=G.paletteName,n.palette.colors=G.colorList,n.title.transparent=!0,n.title.visible=!1,n.title.format.shadow.visible=!1,n.title.format.font.style=G.baseFontStyle,n.title.format.font.style="bold "+G.baseFontStyle,n.title.format.font.fill=G.featureColor,n.title.format.font.shadow.visible=!1,n.footer.transparent=!0,n.footer.visible=!1,n.panel.format.shadow.visible=!1,n.panel.format.stroke.fill="",n.panel.format.round.x=0,n.panel.format.round.y=0,n.panel.format.gradient.colors=a.US.FT_CHART.PANEL_GRADIENT,n.panel.format.gradient.visible=!0,n.panel.margins.top=n.panel.margins.bottom=2,n.panel.margins.right=n.panel.margins.left=2,n.panel.format.shadow.visible=!1,n.walls.visible=!1,n.legend.visible=!1,n.legend.hover.enabled=!1,n.legend.format.shadow.visible=!1,n.axes.left.grid.visible=!1,n.axes.bottom.grid.visible=!1,n.axes.items.length>0)for(var l=0;l<n.axes.items.length;l++)G.applyThemeToAxis(n.axes.items[l]);n.zoom.format.fill="rgba(0,189,251,0.25)",n.zoom.format.stroke.fill="rgba(0,189,251,0.75)",n.zoom.format.stroke.size=1},G.applyThemeToAxis=function(n){n.format.stroke.fill=G.featureColor,n.labels.format.font.setSize(10),n.labels.format.font.fill=G.featureColor,n.title.format.font.fill=G.featureColor,n.title.format.font.setSize(12),n.format.stroke.size=.75,n.format.shadow.visible=!1,n.grid.visible=!0,n.grid.format.stroke.fill="rgba(232, 232, 232, 0.35)",n.grid.format.stroke.size=.25,n.gridcentered=!0,n.grid.format.stroke.dash=[3,1],n.ticks.stroke.fill=G.featureColor},G.applyThemeToLineGraph=function(n,l,g){if(n.format.shadow.visible=!1,n.format.gradient.visible=!1,n.format.stroke.size=1,null!=l&&null!=l&&(n.format.stroke.fill=l),null!=g&&null!=g)switch(g){case T.GraphStyles.Dot:n.format.stroke.dash=[2,2];break;case T.GraphStyles.Dash:n.format.stroke.dash=[4,4];break;case T.GraphStyles.DotDash:n.format.stroke.dash=[4,4,2,2];break;case T.GraphStyles.Line:default:n.format.stroke.dash=null}},G.applyThemeToAreaGraph=function(n,l,g,b){if(n.format.shadow.visible=!1,n.format.gradient.visible=!1,n.format.stroke.size=1,null!=l&&null!=l&&(n.format.stroke.fill=l),null!=g&&null!=g)switch(g){case T.GraphStyles.Dot:break;case T.GraphStyles.Dash:n.format.stroke.dash=[2,2];break;case T.GraphStyles.DotDash:n.format.stroke.dash=[4,4,2,2];break;case T.GraphStyles.Line:default:n.format.stroke.size=1}else n.format.stroke.size=1;if(n.format.stroke.fill="rgba(255, 205, 34, 0.6)",null!=b&&null!=b)switch(b){case T.GraphStyles.Gradient:case T.GraphStyles.Image:case T.GraphStyles.Pattern:break;case T.GraphStyles.Solid:default:n.format.fill="rgba(255, 205, 34, 0.35)"}else n.format.fill="rgba(255, 205, 34, 0.35)"},G.applyThemeToCandleGraph=function(n,l,g,b){if(n.format.shadow.visible=!1,n.format.gradient.visible=!1,n.format.stroke.size=1,n.higher.shadow.visible=!1,n.lower.shadow.visible=!1,n.hover.enabled=!1,null!=l&&null!=l&&(n.color=l),null!=g&&null!=g)switch(g){case T.GraphStyles.Bar:n.style="bar";break;case T.GraphStyles.OpenClose:n.style="openclose";break;case T.GraphStyles.Candle:default:n.style="candle"}n.higher.stroke.fill=n.higher.fill,n.higher.gradient.colors=["green","green","green"],n.lower.stroke.fill=n.lower.fill,n.lower.gradient.colors=["red","red"],n.pointer.width=4},G.applyThemeToVolumeGraph=function(n,l,g,b){if(n.format.shadow.visible=!1,n.format.gradient.visible=!1,n.format.stroke.size=0,n.barSize=100,n.marks.visible=!1,n.format.round.x=0,n.format.round.y=0,n.hover.enabled=!1,n.color=l=null!=l&&null!=l?l:"rgba(112, 157, 158, 0.7)",null!=g&&null!=g)switch(g){case T.GraphStyles.Dot:break;case T.GraphStyles.Dash:n.format.stroke.dash=[2,2];break;case T.GraphStyles.DotDash:break;case T.GraphStyles.Line:default:n.format.stroke.size=1}if(n.format.stroke.fill=l,null!=b&&null!=b)switch(b){case T.FillStyles.Gradient:case T.FillStyles.Image:case T.FillStyles.Pattern:break;case T.FillStyles.Solid:default:n.format.fill=l}},G.applyThemeToCursorTool=function(n,l){n.format.stroke.size=.75,n.format.stroke.fill=null!=l&&null!=l?l:"orange"},G.applyThemeToChartScroller=function(n){var l=n;l.scroller.back.round.x=0,l.scroller.back.round.y=0,l.scroller.back.gradient.visible=!1,l.scroller.back.fill=a.US.FT_CHART.SCROLLER_BACK,l.scroller.back.stroke.size=.5,l.scroller.thumb.round.x=0,l.scroller.thumb.round.y=0,l.scroller.thumb.gradient.visible=!1,l.scroller.thumb.fill="rgba(37,23,232, 0.75)",l.scroller.thumb.stroke.size=1,l.scroller.thumb.stroke.fill="rgb(255,255,255)",l.scroller.grip.roun
1d.x=0,l.scroller.grip.round.y=0,l.scroller.gripSize=2.5,l.scroller.grip.fill="rgb(72,72,72)",l.scroller.grip.stroke.size=1,l.scroller.grip.stroke.fill="rgb(172,172,172)"},G.applyThemeToGraph=function(n,l){},G.removeAxisTicksLabelofChart=function(n){var l=!1;n.axes.left.ticks.visible=l,n.axes.top.ticks.visible=l,n.axes.right.ticks.visible=l,n.axes.bottom.ticks.visible=l,n.axes.left.minorTicks.visible=l,n.axes.top.minorTicks.visible=l,n.axes.right.minorTicks.visible=l,n.axes.bottom.minorTicks.visible=l,n.axes.left.innerTicks.visible=l,n.axes.top.innerTicks.visible=l,n.axes.right.innerTicks.visible=l,n.axes.bottom.innerTicks.visible=l,n.axes.left.labels.visible=l,n.axes.top.labels.visible=l,n.axes.right.labels.visible=l,n.axes.bottom.labels.visible=l}},T.FTChart=function(G,n){var l=this;l.ChartViewType=G,l.GraphPanels=[],l.Graphs=[],l.Chart=new Tee.Chart,l.chartCanvas=l.Chart.canvas,l.canvas=l.Chart.canvas,l.Chart.title.text=n,l.isChartHasValidScrip=!1,l.scripName="SYMBOL",l.GraphPanels.push(new T.GaphPanel(0,T.GraphPanelTypes.Price,T.chartHelper.getDefaultMainAxis(l.Chart),"PriceGraphPanel",0)),l.pointerGuideCallback=null,l.Chart.zoom.enabled=!1,l.Chart.zoom.mouseButton=0,l.Chart.zoom.direction="horizontal",l.Chart.scroll.enabled=!1,l.chartScroller=null,l.chartCursor=new T.FTCursorTool(l.Chart),l.ToolTip=new Tee.ToolTip(l.Chart),l.ToolTip.autoHide=!1,l.ToolTip.render="dom",l.ToolTip.domStyle="white-space:nowrap;",l.ToolTip.active=!1,l.ToolTip.animated=0,l.Chart.tools.add(l.ToolTip),l.ToolTip.ongettext=function(g,b,p,h){var o=$("#tool-tip-div",l.viewContext)[0],u="";return null!=o&&null!=o&&(u=o.innerHTML),u},l.setChartCursor=function(g){if(0==g)l.chartCursor.setVisiblity(!1);else switch(l.chartCursor.setVisiblity(!0),g){case 2:l.chartCursor.setDirection("horizontal");break;case 3:l.chartCursor.setDirection("both");break;case 1:default:l.chartCursor.setDirection("vertical")}},l.addChartGuider=function(){l.Chart.mousemove=l.handleMouseMoveOnChart},l.getXPosIndexOnChart=function(g){var b=l.Chart.axes.bottom.fromPos(Math.abs(g.x));return Math.floor(b)},l.handleMouseMoveOnChart=function(g){if(g.x>=l.Chart.chartRect.x&&g.x<=l.Chart.chartRect.x+l.Chart.chartRect.width&&g.y>=l.Chart.chartRect.y&&g.y<=l.Chart.chartRect.y+l.Chart.chartRect.height&&null!=l.pointerGuideCallback&&null!=l.pointerGuideCallback){var m=l.Chart.axes.bottom.fromPos(g.x),e=Math.floor(m);l.pointerGuideCallback(g.x,g.y,e,"mousemove")}},l.drawChart=function(){try{l.Chart.draw(),null!=l.chartScroller&&null!=l.chartScroller&&l.chartScroller.drawChart()}catch(g){console.log(g)}},l.getGraphPanel=function(g,b){var p=null,h=l.GraphPanels.filter(function(m){return m.GPanelId==g});if(h.length>0)h=h[0];else{b=null==b?T.GraphPanelTypes.Indicator:b,p=T.chartHelper.getAxis(l.Chart);for(var o=0,u=0;u<l.GraphPanels.length;u++)o<l.GraphPanels[u].GPanelId&&(o=l.GraphPanels[u].GPanelId);o++,h=new T.GaphPanel(o,b,p,"Panel-"+o,o),l.GraphPanels.length>2&&b==T.GraphPanelTypes.Indicator&&(h.Axis.labels.decimals=l.GraphPanels[0].Axis.labels.decimals,h.Axis.labels.fixedDecimals=l.GraphPanels[0].Axis.labels.fixedDecimals),l.GraphPanels.push(h),l.adjustVerticaleAxisLength()}return h},l.adjustVerticaleAxisLength=function(){if(T.ChartViewTypes.Advanced==l.ChartViewType){var g=0;l.GraphPanels.length>=1&&(g+=T.GraphPanelHeightRatio.Price),l.GraphPanels.length>=2&&(g+=T.GraphPanelHeightRatio.Volume),l.GraphPanels.length>2&&(g+=l.GraphPanels.length-2),l.GraphPanels.sort(function(o,u){return parseInt(o.GPIndex)-parseInt(u.GPIndex)});for(var b=100/g,p=0,h=0;h<l.GraphPanels.length;h++){switch(l.GraphPanels[h].GPanelRect.Top=p,l.GraphPanels[h].GPanelType){case T.GraphPanelTypes.Price:l.GraphPanels[h].GPanelRect.Bottom=p+(100-b*(g-T.GraphPanelHeightRatio.Price));break;case T.GraphPanelTypes.Volume:l.GraphPanels[h].GPanelRect.Bottom=p+b*T.GraphPanelHeightRatio.Volume;break;case T.GraphPanelTypes.Indicator:default:l.GraphPanels[h].GPanelRect.Bottom=p+b}l.GraphPanels[h].Axis.start=l.GraphPanels[h].GPanelRect.Top,l.GraphPanels[h].Axis.end=l.GraphPanels[h].GPanelRect.Bottom,p=l.GraphPanels[h].GPanelRect.Bottom}}},l.addScrollerGraph=function(g,b){l.chartScroller.addGraph(g,b)},l.addGraph=function(g){l.Graphs.push(g),g.graphPanel.addGraph(g),l.Chart.addSeries(g.Graph)},l.getPriceGraph=function(){var g=l.Graphs.filter(function(b){return b.isPriceGraph});return g.length>0?g[0]:null},l.chagePriceGraphType=function(g,b,p,h,o){var u=l.getPriceGraph(),m=l.Graphs.indexOf(u);if(g!=u.graphType){var f=l.GraphPanels.filter(function(k,W){return-1!=k.Graphs.indexOf(u)}
1)[0],i=f.Graphs.indexOf(u),P=new T.FTGraphParams(l,g,f,u.Graph.title,b,null,p,null);(_=T.chartHelper.getGraph(l,P,h,o)).isPriceGraph=!0,l.Graphs[m]=_,f.Graphs[i]=_,l.Chart.removeSeries(u.Graph),l.Chart.addSeries(_.Graph),l.addAxisSeparators(_)}else{var _=u.Graph;T.GraphTypes.Candle==u.graphType&&T.chartHelper.currentTheme.applyThemeToCandleGraph(_,null,b,p)}l.Chart.draw()},l.setXAxisLableFormat=function(g){(null==g||null==g)&&(g="dd-mmm-yyyy"),l.Chart.axes.bottom.labels.dateFormat=g},l.removeGraph=function(g){l.Chart.removeSeries(g.Graph);var b=g.graphPanel;b.removeGraph(g),l.removeGraphPanel(b);var p=l.Graphs.indexOf(g);p>=0&&l.Graphs.splice(p,1)},l.removeGraphPanel=function(g){if(0==g.Graphs.length){var b=l.Chart.axes.items.indexOf(g.Axis);b>=0&&l.Chart.axes.items.splice(b,1);var p=l.GraphPanels.indexOf(g);p>=0&&l.GraphPanels.splice(p,1),l.adjustVerticaleAxisLength()}},l.adjustGraphPanelsHeight=function(g,b){for(var p=0;p<l.GraphPanels.length;p++)l.GraphPanels[p].setDataRange(g,b)},l.setDataRange=function(g,b,p){l.Chart.axes.bottom.setMinMax(b,p+30/(l.Chart.chartRect.width/(p-b))),l.adjustGraphPanelsHeight(b,p),null!=l.chartScroller&&null!=l.chartScroller&&l.chartScroller.setDataRange(g,b,p)},l.addChartScroller=function(){l.chartScroller=new T.FTChartScroller(l.Chart)},l.loadChartCanvasintoDiv=function(g,b){g.innerHTML="",b.innerHTML="",g.appendChild(l.Chart.canvas),null!=b&&null!=b&&b.appendChild(l.chartScroller.scrollerCanvas)},l.resize=function(g,b,p,h){var o=l.Chart.canvas;o.getContext&&(o.width=b,o.height=g,l.Chart.bounds.height=g,l.Chart.bounds.width=b),null!=l.chartScroller&&l.chartScroller.resize(b,p,h),l.drawChart()},l.onDraw=function(){for(var g=l.Chart.chartRect.width/20,b=new Tee.Format(l.Chart),p=0;p<l.Graphs.length;p++){var h=l.Graphs[p];if(h.isSelected){b.fill="#EEE";for(var o=1;o<=10;o++){var u=l.Chart.chartRect.x+(2*o-1)*g,m=h.Graph.vertAxis,e=l.Chart.axes.bottom.fromPos(u),f=m.calc(l.interpolateLineSeries(h.Graph,e));b.ellipse(u,f,6,6)}}}},l.interpolateLineSeries=function(g,b){var u,p=g.data.values,h=p.length,o=[];if(g.data.x)o=g.data.x;else for(let f=0;f<h;f++)o[f]=f;for(u=0;
1u<h&&!(o[u]>b);u++);u<1?u=1:u>=h&&(u=h-1);var m=o[u]-o[u-1];return 0!=m?(p[u]-p[u-1])*(b-o[u-1])/m+p[u-1]:0},l.addAxisSeparators=function(g){g.Graph.onbeforedraw=function(){var b=l.Chart.ctx;if(this.count()>0){for(var h=0;h<l.GraphPanels.length-1;h++){var o=l.Chart.chartRect.x,u=l.Chart.chartRect.getRight();b.moveTo(o,l.GraphPanels[h].Axis.endPos),b.lineTo(u,l.GraphPanels[h].Axis.endPos)}var m=b.strokeStyle,e=b.lineWidth;b.strokeStyle="rgba(124, 90, 0, 0.9)",b.lineWidth=1,b.stroke(),b.strokeStyle=m,b.lineWidth=e}else{var f=l.Chart.canvas,i="";T.ChartViewTypes.Advanced==l.ChartViewType&&(i=l.isChartHasValidScrip?a.xB.dMsgMaster.NNSL708:"Please select a valid scrip");var P=b.measureText(i).width,_=b.fillStyle;b.fillStyle=a.US.FT_CHART.CHART_CTX_FILL,b.fillText(i,f.width/2-P/2,f.height/2-5),b.fillStyle=_}}}},T.ChartHelper=function(){var G=this;G.defaultMainAxis=2,G.chartThemes=[new T.FTBlackTheme],G.currentTheme=G.chartThemes[0],G.getChart=function(b,p,h){var o=new T.FTChart(b,p,h);return G.currentTheme.applyTheme(o.Chart),o},G.getDefaultMainAxis=function(b){var p=null;switch(G.defaultMainAxis){case 0:p=b.axes.left;break;case 1:p=b.axes.top;break;case 2:p=b.axes.right;break;case 3:p=b.axes.bottom}return p},G.getAxis=function(b){let p=b.axes.add(!1,!0);return G.currentTheme.applyThemeToAxis(p),p},G.getGraph=function(b,p,h,o){var u=null;switch(p.graphType){case T.GraphTypes.Line:u=new T.FTLine(p.title,p.graphPanel,h,o),G.currentTheme.applyThemeToLineGraph(u.Graph,p.graphStyle.strokeColor,p.graphStyle.strokeStyle);break;case T.GraphTypes.Area:u=new T.FTArea(p.title,p.graphPanel,h,o),G.currentTheme.applyThemeToAreaGraph(u.Graph,p.graphStyle.strokeColor,p.graphStyle.strokeStyle,p.graphStyle.fillStyle);break;case T.GraphTypes.Bar:u=new T.FTBar(p.title,p.graphPanel,h,o);break;case T.GraphTypes.Volume:u=new T.FTVolume(p.title,p.graphPanel,h,o,p.graphStyle.strokeColor),G.currentTheme.applyThemeToVolumeGraph(u.Graph,p.graphStyle.strokeColor,p.graphStyle.strokeStyle,p.graphStyle.fillStyle);break;case T.GraphTypes.Candle:u=new T.FTCandle(p.title,p.graphPanel,h,o),G.currentTheme.applyThemeToCandleGraph(u.Graph,null,p.graphStyle.strokeStyle,p.graphStyle.fillStyle)}return u}},T.chartHelper=new T.ChartHelper},2774:(je,ke,x)=>{x.d(ke,{N:()=>l});var a=x(1705),T=x(3627),G=G||{};G.extendFTTALib=function(p,h){var m,e,o=h.split("."),u=p;for("FTTALib"==o[0]&&(o=o.slice(1)),m=o.length,e=0;e<m;e++)void 0===u[o[e]]&&(u[o[e]]={}),u=u[o[e]];return u},G.IndicatorSource=Object.freeze({Open:1,High:2,Low:3,Close:4,Volum:5}),G.MovingAverageTypes=Object.freeze({None:0,Simple:1,Exponantial:2}),G.GraphPanel=Object.freeze({OverLay:0,Below:1,Above:2}),G.GraphType=Object.freeze({Line:0,Area:1,VerticaleBar:2,HorizontalBar:3}),G.GraphStyle=Object.freeze({Solid:0,Dotted:1,Dash:2});var n=n||{};n.extendTACore=function(p,h){var m,e,o=h.split("."),u=p;for("TACore"==o[0]&&(o=o.slice(1)),m=o.length,e=0;e<m;e++)void 0===u[o[e]]&&(u[o[e]]={}),u=u[o[e]];return u},n.IndicatorTypes=Object.freeze({SimpleMovingAverage:1,ExponentialMovingAverage:2,RelativeStrengthIndex:3,MACD:4,PriceROC:5,Stochastics:6,BollingerBands:7,ParabolicSAR:8,WeightedClose:9,TrueRange:10,ADX:11,TRIX:12,ATR:13,SuperTrend:14,TrueStrengthIndex:34,WilliamsR:16,MoneyFlowIndex:17,StandardDeviations:18}),n.IndicatorSources=Object.freeze({Open:1,High:2,Low:3,Close:4,Volume:5}),G.TALib=n,n.fixedDownToFourDecimal=function(p){if(null!=p){p=(p=p.toString()).slice(0,p.indexOf(".")+5);var h=Number(p)}return h},n.CommonMethods=new function(){var p=this;p.getMovingAverageObj=function(h,o){var u=null;switch(h=null!=h&&null!=h?h:1){case 0:u=new n.StdDevMovingAverage(o,1);break;case 1:u=new n.SimpleMovingAverage(o,1);break;case 2:u=new n.ExponentialMovingAverage(o,1);break;default:u=new n.SimpleMovingAverage(o,1)}return u},p.getDataSourceArray=function(h,o){var u=null;if(null!=h)if(null!=h.id&&null!=h.id)if(h.id<=5)switch(h.id){case n.IndicatorSources.Open:u=o.Open;break;case n.IndicatorSources.High:u=o.High;break;case n.IndicatorSources.Low:u=o.Low;break;case n.IndicatorSources.Close:u=o.Close;break;case n.IndicatorSources.Volume:u=o.Volume;break;default:u=o.Close}else u=h.parent;else u=o.Close;else u=o.Close;return u},p.IndicatorPeriodValidation=function(h,o,u,m){var e=!0,f="";switch(h.id){case n.IndicatorTypes.SimpleMovingAverage:var i=parseInt(h.periods[0].value);p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Simple Moving Average");break;case n.IndicatorTypes.ExponentialMovingAverage:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Exponential Moving Average");break;case n.IndicatorTypes.RelativeStrengthIndex:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Relative Strength Index");break;case n.IndicatorTypes.MACD:var _=parseInt(h.periods[2].value)+Math.max(parseInt(h.periods[0].value),parseInt(h.periods[1].value));p.datasrc=p.getDataSourceArray(o,m),_>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator MACD");break;case n.IndicatorTypes.PriceROC:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Price Rate of Change");break;case n.IndicatorTypes.Stochastics:_=parseInt(h.periods[0].value)+Math.max(parseInt(h.periods[1].value),parseInt(h.periods[2].value)),p.datasrc=p.getDataSourceArray(o,m),_>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Stochastic Oscillator");break;case n.IndicatorTypes.BollingerBands:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator BollingerBands");break;case n.IndicatorTypes.ADX:i=parseInt(h.periods[0].value)+Math.max(parseInt(h.periods[0].value),parseInt(h.periods[1].value),parseInt(h.periods[2].value)),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator ADX");break;case n.IndicatorTypes.TRIX:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator TRIX");break;case n.IndicatorTypes.ATR:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator ATR");break;case n.IndicatorTypes.SuperTrend:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator SuperTrend");break;case n.IndicatorTypes.TrueStrengthIndex:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator True Strength Index");break;case n.IndicatorTypes.WilliamsR:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Williams R %");break;case n.IndicatorTypes.MoneyFlowIndex:i=parseInt(h.periods[0].value),p.datasrc=p.getDataSourceArray(o,m),i>p.datasrc.length&&(e=!1,f="Invalid Period for Indicator Money Flow Index")}return{Result:e,Message:f}}},n.SimpleMovingAverage=function(p,h){var o=this;o.name="SMA",o.callsource=null==h||null==h?0:1,o.Period=null!=p&&null!=p?p:8,o.Price
1s=[],o.dataSum=0,o.reset=function(){o.Prices.splice(0,o.Prices.length),o.dataSum=0},o.addIntraDayTick=function(u){return[o.nextPoint(u)]},o.nextPoint=function(u){var m=null;return null!=u&&(o.Prices.push(u),o.dataSum+=u,o.Prices.length>=o.Period&&(m=o.dataSum/o.Period,o.dataSum-=o.Prices[0],o.Prices.shift())),null!=m&&0==o.callsource?m.toFixedDown(4):m},o.calcIndicator=function(u){var m=[];if(null!=u&&null!=u)for(var e=0;e<u.length;e++)m.push(o.nextPoint(u[e]));return[m]},o.updatePeriods=function(u){if(null!=u&&null!=u&&u.length>0){var m=parseInt(u[0].value);o.Period=NaN!=m?m:8}}},n.ExponentialMovingAverage=function(p,h){var o=this;o.name="EMA",o.callsource=null==h||null==h?0:1,o.Period=null!=p&&null!=p?p:8,o.Multiplier=2/(o.Period+1),o.SMA=new n.SimpleMovingAverage(o.Period,1),o.prevEMA=null,o.reset=function(){o.SMA.reset(),o.prevEMA=null},o.addIntraDayTick=function(u){return[o.nextPoint(u)]},o.nextPoint=function(u){var m=null;return null!=u&&(m=null==o.prevEMA?o.SMA.nextPoint(u):u*o.Multiplier+o.prevEMA*(1-o.Multiplier)),o.prevEMA=m,n.fixedDownToFourDecimal(m)},o.calcIndicator=function(u){var m=[];if(null!=u&&null!=u)for(var e=0;e<u.length;e++)m.push(o.nextPoint(u[e]));return[m]},o.updatePeriods=function(u){if(null!=u&&null!=u&&u.length>0){var m=parseInt(u[0].value);o.Period=NaN!=m?m:8,o.Multiplier=2/(o.Period+1),o.SMA.updatePeriods(u)}}},n.StdDevMovingAverage=function(p){var h=this;h.name="SDMA",h.Period=null!=p&&null!=p?p:10,h.coffi1=2/(h.Period+1),h.coffi2=1-h.coffi1,h.SMA=new n.SimpleMovingAverage(h.Period,1),h.prevSDMA=null,h.reset=function(){h.SMA.reset(),h.prevSDMA=null},h.addIntraDayTick=function(o){return[h.nextPoint(o)]},h.nextPoint=function(o){var u=null;return null!=o&&(u=null==h.prevSDMA?h.SMA.nextPoint(o):h.prevSDMA*h.coffi2+o*h.coffi1),u=n.fixedDownToFourDecimal(u),h.prevSDMA=u,u},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=0;m<o.length;m++)u.push(h.nextPoint(o[m]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseInt(o[0].value);h.Period=NaN!=u?u:8,h.SMA.updatePeriods([o[0]])}}},n.RelativeStrengthIndex=function(p){var h=this;h.name="RSI",h.Period=null!=p&&null!=p?p:14,h.GainLosses=[],h.prevClose=null,h.GainSum=0,h.LossSum=0,h.reset=function(){h.GainLosses.splice(0,h.GainLosses.length),h.prevClose=null,h.GainSum=0,h.LossSum=0},h.addIntraDayTick=function(o){return[h.nextPoint(o)]},h.nextPoint=function(o){var u=null;if(null!=h.prevClose){var m=o-h.prevClose;if(h.GainLosses.push(m),m>=0?h.GainSum+=m:h.LossSum+=Math.abs(m),h.GainLosses.length==h.Period){var e=h.GainSum/h.Period,f=h.LossSum/h.Period;u=f>0?100-100/(1+e/f):100,h.GainSum=e*(h.Period-1),h.LossSum=f*(h.Period-1),h.GainLosses.shift()}}return h.prevClose=o,n.fixedDownToFourDecimal(u)},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=0;m<o.length;m++)u.push(h.nextPoint(o[m]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseInt(o[0].value);h.Period=NaN!=u?u:8}}},n.BollingerBand=function(p,h,o){var u=this;u.name="B-Band",u.Period1=null!=p&&null!=p?p:20,u.Period2=null!=h&&null!=h?h:2,u.MAType=null!=o&&null!=o?o:0,u.mAvarage=n.CommonMethods.getMovingAverageObj(u.MAType,u.Period1),u.stdDev=new n.StandardDeviation(u.Period1,u.MAType),u.reset=function(){u.stdDev.reset(),u.mAvarage.reset()},u.addIntraDayTick=function(m){var e=u.nextPoint(m);return[e.BBMedian,e.BBUp,e.BBDown]},u.nextPoint=function(m){var f=u.mAvarage.nextPoint(m),i=null,P=null,_=u.stdDev.nextPoint(m);if(null!=f){var k=_*u.Period2;i=f+k,P=f-k}return{BBMedian:f=n.fixedDownToFourDecimal(f),BBUp:i=n.fixedDownToFourDecimal(i),BBDown:P=n.fixedDownToFourDecimal(P)}},u.calcIndicator=function(m){var P=[[],[],[]];if(null!=m&&null!=m)for(var _=0;_<m.length;_++){var k=u.nextPoint(m[_]);P[0].push(k.BBMedian),P[1].push(k.BBUp),P[2].push(k.BBDown)}return P},u.updatePeriods=function(m){if(null!=m&&null!=m&&m.length>0){var e=parseInt(m[0].value);u.Period1=NaN!=e?e:20;var f=parseFloat(m[1].value);u.Period2=NaN!=f?f:2,u.mAvarage.updatePeriods([m[0]]),u.stdDev.updatePeriods([m[0]])}},u.updateMAType=function(m){null!=m&&null!=m&&(u.MAType=m,u.mAvarage=n.CommonMethods.getMovingAverageObj(u.MAType,u.Period1),u.stdDev.updateMAType(u.MAType))}},n.ParabolicSAR=function(p,h){var o=this;o.name="P-SAR",o.minAF=null!=p&&null!=p?p:.02,o.maxAF=null!=h&&null!=h?h:.2,o.PrevNetPosition=null,o.NetPosition=null,o.NextDatSAR=null,o.CurrSAR=null,o.EPMin=null,o.EPMax=null,o.EP=null,o.NetpositionArray=[],o.firstcount=0,o.EPMaxArray=[],o.EPMinArray=[],o.PreviousEPMax=null,o.CurrentEPMax=null,o.PreviousEPMin=null,o.CurrentEPMin=null,o.reset=function(){o.PrevNetPosition=null,o.NetPosition=null,o.NextDatSAR=null,o.CurrSAR=null,o.EPMin=null,o.EPMax=null,o.EP=null,o.NetpositionArray=[],o.firstcount=0,o.EPMaxArray=[],o.EPMinArray=[],o.PreviousEPMax=null,o.CurrentEPMax=null,o.PreviousEPMin=null,o.CurrentEPMin=null},o.addIntraDayTick=function(u){var m=o.nextPoint(u.High,u.Low);return[parseFloat(m)]},o.nextPoint=function(u,m){return null==o.NetPosition&&1!=o.firstcount?(o.AF=o.minAF,o.EPMax=o.maxAF,o.NetPosition=null,o.EPMin=m,o.EPMax=u,o.firstcount=1,o.NetpositionArray.push(o.NetPosition),o.EPMaxArray.push(o.EPMax)):null==o.CurrSAR?(o.CurrSAR=m,o.EP=m,o.NextDatSAR=100*((o.EP-o.CurrSAR)*o.AF+o.CurrSAR)/100,o.NetPosition=1,o.NetpositionArray.push(o.NetPosition)):(o.PrevNetPosition=o.NetpositionArray[o.NetpositionArray.length-1],o.PrevtoPrevNetPosition="",o.PrevtoPrevNetPosition=o.NetpositionArray.length>2?o.NetpositionArray[o.NetpositionArray.length-2]:null,o.NetPosition=o.NextDatSAR>m&&1==o.PrevNetPosition?0:o.NextDatSAR<u&&0==o.PrevtoPrevNetPosition&&null!=o.PrevtoPrevNetPosition?1:o.PrevNetPosition,o.NetpositionArray.push(o.NetPosition),o.CurrSAR=1==o.NetPosition&&0==o.PrevNetPosition?o.EPMin:1==o.PrevNetPosition&&0==o.NetPosition?o.EPMax:100*((o.EP-o.CurrSAR)*o.AF+o.CurrSAR)/100,o.PrevNetPosition!=o.NetPosition||o.EPMax<u?(o.EPMax=u,o.EPMaxArray.push(o.EPMax)):(o.EPMax=o.EPMax,o.EPMaxArray.push(o.EPMax)),o.PrevNetPosition!=o.NetPosition||o.EPMin>m?(o.EPMin=m,o.EPMinArray.push(o.EPMin)):(o.EPMin=o.EPMin,o.EPMinArray.push(o.EPMin)),o.EP=0==o.NetPosition?o.EPMin:o.EPMax,o.PrevNetPosition!=o.NetPosition?o.AF=o.minAF:(o.CurrentEPMax=o.EPMaxArray[o.EPMaxArray.length-1],o.PreviousEPMax=o.EPMaxArray[o.EPMaxArray.length-2],o.CurrentEPMin=o.EPMinArray[o.EPMinArray.length-1],o.PreviousEPMin=o.EPMinArray[o.EPMinArray.length-2],o.AF=o.PreviousEPMax!=o.CurrentEPMax&&1==o.PrevNetPosition&&o.AF+o.minAF<=o.maxAF||o.PreviousEPMin!=o.
1CurrentEPMin&&0==o.PrevNetPosition&&o.AF+o.minAF<=o.maxAF?o.AF+o.minAF:o.AF),o.NextDatSAR=100*((o.EP-o.CurrSAR)*o.AF+o.CurrSAR)/100),o.OutPut=null!=o.NextDatSAR?n.fixedDownToFourDecimal(o.NextDatSAR):null,o.OutPut},o.calcIndicator=function(u){var m=[];if(null!=u&&null!=u)for(var e=u.High.length,f=0;f<e;f++)m.push(o.nextPoint(u.High[f],u.Low[f]));return[m]},o.updatePeriods=function(u){if(null!=u&&null!=u&&u.length>0){var m=parseFloat(u[0].value);o.minAF=NaN!=m?m:.02;var e=parseFloat(u[1].value);o.maxAF=NaN!=e?e:.2}}},n.PriceROC=function(p){var h=this;h.name="P-ROC",h.Period=null!=p&&null!=p?p:8,h.Prices=[],h.reset=function(){h.Prices.splice(0,h.Prices.length)},h.addIntraDayTick=function(o){return[h.nextPoint(o)]},h.nextPoint=function(o){var u=null;return null!=o&&(h.Prices.push(o),h.Prices.length==h.Period+1&&(u=(o-h.Prices[0])/h.Prices[0]*100,h.Prices.shift())),n.fixedDownToFourDecimal(u)},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=0;m<o.length;m++)u.push(h.nextPoint(o[m]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseInt(o[0].value);h.Period=NaN!=u?u:8}}},n.WeigthedClose=function(){var p=this;p.name="WClose",p.reset=function(){},p.addIntraDayTick=function(h,o,u,m,e){return[p.nextPoint(o,u,m)]},p.nextPoint=function(h,o,u){var m=(h+o+2*u)/4;return n.fixedDownToFourDecimal(m)},p.calcIndicator=function(h){var o=[];if(null!=h&&null!=h)for(var u=0;u<h.Close.length;u++)o.push(p.nextPoint(h.High[u],h.Low[u],h.Close[u]));return[o]}},n.TrueRange=function(){var p=this;p.name="TRange",p.prevClose=null,p.reset=function(){p.prevClose=null},p.addIntraDayTick=function(h,o,u,m,e){return[p.nextPoint(o,u,m)]},p.nextPoint=function(h,o,u){var m=null;if(null!=p.prevClose){var e=h-o,f=Math.abs(h-p.prevClose),i=Math.abs(o-p.prevClose);m=Math.max(e,f,i)}return p.prevClose=u,n.fixedDownToFourDecimal(m)},p.calcIndicator=function(h){var o=[];if(null!=h&&null!=h)for(var u=0;u<h.Close.length;u++)o.push(p.nextPoint(h.High[u],h.Low[u],h.Close[u]));return[o]}},n.AverageTrueRange=function(p){var h=this;h.name="ATRange",h.Period=null!=p&&null!=p?p:14,h.TR=new n.TrueRange,h.SMA=new n.SimpleMovingAverage(p,1),h.preATR=null,h.reset=function(){h.TR.reset(),h.SMA.reset(),h.preATR=null},h.addIntraDayTick=function(o,u,m,e,f){return[h.nextPoint(u,m,e)]},h.nextPoint=function(o,u,m){var e=null,f=h.TR.nextPoint(o,u,m);return e=null==h.preATR?h.SMA.nextPoint(f):(h.preATR*(h.Period-1)+f)/h.Period,e=n.fixedDownToFourDecimal(e),h.preATR=e,e},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=0;m<o.Close.length;m++)u.push(h.nextPoint(o.High[m],o.Low[m],o.Close[m]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseInt(o[0].value);h.Period=NaN!=u?u:8,h.SMA.updatePeriods([o[0]])}}},n.MACD=function(p,h,o,u){var m=this;m.name="MACD",m.Period1=null!=p&&null!=p?p:26,m.Period2=null!=h&&null!=h?h:13,m.Period3=null!=o&&null!=o?o:9,m.MAType=null!=u&&null!=u?u:0,m.EMA1=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period1),m.EMA2=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period2),m.EMA3=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period3),m.reset=function(){m.EMA1.reset(),m.EMA2.reset(),m.EMA3.reset()},m.addIntraDayTick=function(e){var f=m.nextPoint(e);return[f.MACD,f.MACDSignal,f.Histogram]},m.nextPoint=function(e){var f=m.EMA1.nextPoint(e),i=m.EMA2.nextPoint(e),P=null!=f&&null!=i?i-f:null,_=m.EMA3.nextPoint(P),k=null!=P&&null!=_?P-_:null;return{MACD:P=n.fixedDownToFourDecimal(P),MACDSignal:_=n.fixedDownToFourDecimal(_),Histogram:k=n.fixedDownToFourDecimal(k)}},m.calcIndicator=function(e){var _=[[],[],[]];if(null!=e&&null!=e)for(var k=0;k<e.length;k++){var W=m.nextPoint(e[k]);_[0].push(W.MACD),_[1].push(W.MACDSignal),_[2].push(W.Histogram)}return _},m.updatePeriods=function(e){if(null!=e&&null!=e&&e.length>0){var f=parseInt(e[0].value);m.Period1=NaN!=f?f:26;var i=parseInt(e[1].value);m.Period2=NaN!=i?i:13;var P=parseInt(e[2].value);m.Period3=NaN!=P?P:9,m.EMA1.updatePeriods([e[0]]),m.EMA2.updatePeriods([e[1]]),m.EMA3.updatePeriods([e[2]])}},m.updateMAType=function(e){null!=e&&null!=e&&(m.MAType=e,m.EMA1=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period1),m.
1EMA2=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period2),m.EMA3=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period3))}},n.ADX=function(p,h,o){var u=this;u.name="ADX",u.Period1=null!=p&&null!=p?p:8,u.Period2=null!=h&&null!=h?h:8,u.Period3=null!=o&&null!=o?o:8,u.maxPeriod=Math.max(u.Period1,u.Period2,u.Period3),u.objTR=new n.TrueRange,u.smaADX=new n.SimpleMovingAverage(u.Period1,1),u.TRs=[],u.DMPs=[],u.DMNs=[],u.preHigh=null,u.preLow=null,u.preClose=null,u.TR=0,u.DMP=0,u.DMN=0,u.preTR=null,u.preDMP=null,u.preDMN=null,u.preADX=null,u.trCounter=0,u.reset=function(){u.objTR.reset(),u.smaADX.reset(),u.TRs.splice(0,u.TRs.length),u.DMPs.splice(0,u.DMPs.length),u.DMNs.splice(0,u.DMNs.length),u.preHigh=null,u.preLow=null,u.preClose=null,u.TR=0,u.DMP=0,u.DMN=0,u.preTR=null,u.preDMP=null,u.preDMN=null,u.preADX=null,u.trCounter=0},u.addIntraDayTick=function(m,e,f,i,P){var _=u.nextPoint(e,f,i);return[_.ADX,_.DIP,_.DIN]},u.nextPoint=function(m,e,f){var i=null,P=null,_=null,k=u.objTR.nextPoint(m,e,f);if(null!=k){u.trCounter++;var W=m-u.preHigh>0&&m-u.preHigh>u.preLow-e?m-u.preHigh:0,N=u.preLow-e>0&&u.preLow-e>
1m-u.preHigh?u.preLow-e:0,Q=W>N?W:0,H=N>W?N:0;if(u.trCounter<u.Period1?u.TR+=k:u.trCounter==u.Period1?(u.TR+=k,u.TR=u.TR/u.Period1):u.trCounter>u.Period1&&(u.TR=(u.preTR*(u.Period1-1)+k)/u.Period1),u.trCounter<u.Period2?u.DMP+=Q:u.trCounter==u.Period2?(u.DMP+=Q,u.DMP=u.DMP/u.Period2):u.trCounter>u.Period2&&(u.DMP=u.preDMP+(Q-u.preDMP)/u.Period2,u.trCounter>=u.Period1&&(P=100*u.DMP/u.TR)),u.trCounter<u.Period3?u.DMN+=H:u.trCounter==u.Period3?(u.DMN+=H,u.DMN=u.DMN/u.Period3):u.trCounter>u.Period3&&(u.DMN=u.preDMN+(H-u.preDMN)/u.Period3,u.trCounter>=u.Period1&&(_=100*u.DMN/u.TR)),u.trCounter>=u.maxPeriod&&null!=P&&null!=_){var Z=100*Math.abs(_-P)/(P+_);i=null==u.preADX?u.smaADX.nextPoint(Z):(u.preADX*(u.Period1-1)+Z)/u.Period1,u.preADX=i}u.preTR=u.TR,u.preDMP=u.DMP,u.preDMN=u.DMN}return u.preHigh=m,u.preLow=e,u.preClose=f,{ADX:i=n.fixedDownToFourDecimal(i),DIP:P=n.fixedDownToFourDecimal(P),DIN:_=n.fixedDownToFourDecimal(_)}},u.calcIndicator=function(m){var P=[[],[],[]];if(null!=m&&null!=m)for(var _=0;_<m.Close.length;_++){var k=u.nextPoint(m.High[_],m.Low[_],m.Close[_]);P[0].push(k.ADX),P[1].push(k.DIP),P[2].push(k.DIN)}return P},u.updatePeriods=function(m){if(null!=m&&null!=m&&m.length>0){var e=parseInt(m[0].value);u.Period1=NaN!=e?e:8;var f=parseInt(m[1].value);u.Period2=NaN!=f?f:8;var i=parseInt(m[2].value);u.Period3=NaN!=i?i:8,u.maxPeriod=Math.max(u.Period1,u.Period2,u.Period3),u.smaADX.updatePeriods([m[0]])}}},n.Trix=function(p){var h=this;h.name="Trix",h.Period=null!=p&&null!=p?p:8,h.EMA1=new n.ExponentialMovingAverage(h.Period,1),h.EMA2=new n.ExponentialMovingAverage(h.Period,1),h.EMA3=new n.ExponentialMovingAverage(h.Period,1),h.preEMA3=null,h.reset=function(){h.EMA1.reset(),h.EMA2.reset(),h.EMA3.reset(),h.preEMA3=null},h.addIntraDayTick=function(o){return[h.nextPoint(o)]},h.nextPoint=function(o){var u=null,m=h.EMA1.nextPoint(o),e=h.EMA2.nextPoint(m),f=h.EMA3.nextPoint(e);if(null!=h.preEMA3){var i=(f-h.preEMA3)/h.preEMA3*100;u=i>=0?Math.floor(1e4*i)/1e4:Math.ceil(1e4*i)/1e4}return h.preEMA3=f,n.fixedDownToFourDecimal(u)},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=0;m<o.length;m++)u.push(h.nextPoint(o[m]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseInt(o[0].value);h.Period=NaN!=u?u:8,h.EMA1.updatePeriods([o[0]]),h.EMA2.updatePeriods([o[0]]),h.EMA3.updatePeriods([o[0]])}}},n.SuperTrend=function(p,h){var o=this;o.name="STrend",o.Period=null!=p&&null!=p?p:14,o.Multipliers=null!=h&&null!=h?h:1.5,o.ATR=new n.AverageTrueRange(o.Period),o.Trend=1,o.lowStop=0,o.highStop=0,o.reset=function(){o.ATR.reset(),o.Trend=1,o.lowStop=0,o.highStop=0},o.addIntraDayTick=function(u,m,e,f,i){return[o.nextPoint(m,e,f)]},o.nextPoint=function(u,m,e){var f=null,i=o.ATR.nextPoint(u,m,e);if(null!=i){var P=i*o.Multipliers,_=(u+m)/2;o.Trend=1==o.Trend?e<o.lowStop?0:1:e>o.highStop?1:0,1==o.Trend?(o.lowStop=null==o.lowStop?_-P:Math.max(o.lowStop,_-P),o.highStop=null):(o.highStop=null==o.highStop?_+P:Math.min(o.highStop,_+P),o.lowStop=null),f=Math.floor(1e4*Math.max(o.lowStop,o.highStop))/1e4}return n.fixedDownToFourDecimal(f)},o.calcIndicator=function(u){var m=[];if(null!=u&&null!=u)for(var e=0;e<u.Close.length;e++)m.push(o.nextPoint(u.High[e],u.Low[e],u.Close[e]));return[m]},o.updatePeriods=function(u){if(null!=u&&null!=u&&u.length>0){var m=parseInt(u[0].value);o.Period=NaN!=m?m:14;var e=parseFloat(u[1].value);o.Multipliers=NaN!=e?e:1.5,o.ATR.updatePeriods([u[0]])}}},n.StandardDeviation=function(p,h){var o=this;o.name="StdDev",o.Period=null!=p&&null!=p?p:14,o.MAType=null!=h&&null!=h?h:0,o.Prices=[],o.dataSum=0,o.sqrDataSum=0,o.mAvarage=n.CommonMethods.getMovingAverageObj(o.MAType,o.Period),o.reset=function(){o.Prices.splice(0,o.Prices.length),o.dataSum=0,o.sqrDataSum=0,o.mAvarage.reset()},o.addIntraDayTick=function(u){return[o.nextPoint(u)]},o.nextPoint=function(u){var m=null;o.Prices.push(u),o.dataSum+=u,o.sqrDataSum+=u*u;var e=o.mAvarage.nextPoint(u);return o.Prices.length>=o.Period&&(m=Math.sqrt((o.sqrDataSum+o.Period*(e*e)-2*e*o.dataSum)/o.Period),o.dataSum-=o.Prices[0],o.sqrDataSum-=o.Prices[0]*o.Prices[0],o.Prices.shift()),n.fixedDownToFourDecimal(m)},o.calcIndicator=function(u){var m=[];
1if(null!=u&&null!=u)for(var e=0;e<u.length;e++)m.push(o.nextPoint(u[e]));return[m]},o.updatePeriods=function(u){if(null!=u&&null!=u&&u.length>0){var m=parseInt(u[0].value);o.Period=NaN!=m?m:14,o.mAvarage.updatePeriods([u[0]])}},o.updateMAType=function(u){null!=u&&null!=u&&(o.MAType=u,o.mAvarage=n.CommonMethods.getMovingAverageObj(o.MAType,o.Period))}},n.StochasticOscillator=function(p,h,o,u){var m=this;m.name="StcOscill",m.Period1=null!=p&&null!=p?p:5,m.Period2=null!=h&&null!=h?h:3,m.Period3=null!=o&&null!=o?o:3,m.MAType=null!=u&&null!=u?u:0,m.avgA=n.CommonMethods.getMovingAverageObj(m.MAType.id,m.Period2),m.avgB=n.CommonMethods.getMovingAverageObj(m.MAType.id,m.Period2),m.mAvarage=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period3),m.HighValues=[],m.LowValues=[],m.reset=function(){m.avgA.reset(),m.avgB.reset(),m.mAvarage.reset(),m.HighValues.splice(0,m.HighValues.length),m.LowValues.splice(0,m.LowValues.length)},m.getHighestLowest=function(e,f){var i=null,P=null,_={High:i,Low:P};if(m.HighValues.push(e),m.LowValues.push(f),m.HighValues.length>=m.Period1){i=m.HighValues[0],P=m.LowValues[0];for(var k=1;k<m.Period1;k++)i=m.HighValues[k]>i?m.HighValues[k]:i,P=m.LowValues[k]<P?m.LowValues[k]:P;_={High:i,Low:P},m.HighValues.shift(),m.LowValues.shift()}return _},m.addIntraDayTick=function(e,f,i,P,_){var k=m.nextPoint(f,i,P);return[k.DPerc,k.KPerc]},m.nextPoint=function(e,f,i){var _=null,k=null,W=m.getHighestLowest(e,f);if(null!=W.High){var Q=W.High-W.Low,H=m.avgA.nextPoint(i-W.Low),V=m.avgB.nextPoint(Q);null!=H&&null!=V&&(k=m.mAvarage.nextPoint(_=H/V*100))}return{DPerc:k=n.fixedDownToFourDecimal(k),KPerc:_=n.fixedDownToFourDecimal(_)}},m.calcIndicator=function(e){var P=[[],[]];if(null!=e&&null!=e)for(var _=0;_<e.Close.length;_++){var k=m.nextPoint(e.High[_],e.Low[_],e.Close[_]);P[0].push(k.KPerc),P[1].push(k.DPerc)}return P},m.updatePeriods=function(e){if(null!=e&&null!=e&&e.length>0){var f=parseInt(e[0].value);m.Period1=NaN!=f?f:5;var i=parseInt(e[1].value);m.Period2=NaN!=i?i:3;var P=parseInt(e[2].value);m.Period3=NaN!=P?P:3,m.avgA.updatePeriods([e[1]]),m.avgB.updatePeriods([e[1]]),m.mAvarage.updatePeriods([e[2]])}},m.updateMAType=function(e){null!=e&&null!=e&&(m.MAType=e,m.avgA=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period2),m.avgB=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period2),m.mAvarage=n.CommonMethods.getMovingAverageObj(m.MAType,m.Period3))},m.TestingFunctionStock=function(){alert("Graph Stock FtChart called")}},n.TrueStrengthIndex=function(p,h){var o=this;o.Period=null!=p&&null!=p?p:25,o.smoothingPeriod=null!=h&&null!=h?h:13,o.PeriodValueOne=2/(o.Period+1),o.PeriodValueTwo=1-o.PeriodValueOne,o.smoothingPeriodValueOne=2/(o.smoothingPeriod+1),o.smoothingPeriodValueTwo=1-o.smoothingPeriodValueOne,o.name="TSI",o.momentum=o.firstEMA=o.EMA_of_First_EMA=o.EMA_of_First_EMA_Average=o.secondEMA=o.EMA_of_Second_EMA=o.EMA_of_Second_EMA_Average=o.ABS_of_Momentum=o.TSI=o.PreviousCloseValue=o.momentumAverage=o.absmomentumAverage=null,o.firstEMAflag=o.EMA_of_First_EMAflag=o.secondEMAflag=o.EMA_of_Second_EMAflag=!1,o.firstEMAArray=[],o.secondEMAArray=[],o.closeArray=[],o.momentumArray=[],o.absmomentumArray=[],o.firstCount=0,o.counter=0,o.reset=function(){o.momentum=o.firstEMA=o.EMA_of_First_EMA=o.EMA_of_First_EMA_Average=o.secondEMA=o.EMA_of_Second_EMA=o.EMA_of_Second_EMA_Average=o.ABS_of_Momentum=o.TSI=o.PreviousCloseValue=o.momentumAverage=o.absmomentumAverage=null,o.firstEMAflag=o.EMA_of_First_EMAflag=o.secondEMAflag=o.EMA_of_Second_EMAflag=!1,o.firstEMAArray=[],o.secondEMAArray=[],o.closeArray=[],o.momentumArray=[],o.absmomentumArray=[],o.firstCount=0,o.counter=0},o.nextPoint=function(u){if(o.counter++,null==o.momentum&&0==o.firstCount)o.closeArray.push(u),o.firstCount=1;else if(o.closeArray.push(u),o.PreviousCloseValue=o.closeArray[o.closeArray.length-2],o.momentum=parseFloat((u-o.PreviousCloseValue).toFixed(2)),o.momentumArray.push(o.momentum),o.ABS_of_Momentum=Math.abs(o.momentum),o.absmomentumArray.push(o.ABS_of_Momentum),o.counter>o.Period){if(0==o.firstEMAflag&&0==o.secondEMAflag){for(var e=0;e<o.momentumArray.length;e++)o.momentumAverage+=o.momentumArray[e],o.firstEMAflag=!0;for(o.firstEMA=o.momentumAverage/o.Period,o.firstEMA=parseFloat(o.firstEMA.toFixed(4)),o.firstEMAArray.push(o.firstEMA),e=0;e<o.absmomentumArray.length;e++)o.absmomentumAverage+=o.absmomentumArray[e],o.secondEMAflag=!0;o.secondEMA=o.absmomentumAverage/o.Period,o.secondEMA=parseFloat(o.secondEMA.toFixed(4)),o.secondEMAArray.push(o.secondEMA)}
1else o.firstEMA=(parseFloat(o.firstEMA)*o.PeriodValueTwo+o.momentum*o.PeriodValueOne).toFixed(4),o.secondEMA=(parseFloat(o.secondEMA)*o.PeriodValueTwo+o.ABS_of_Momentum*o.PeriodValueOne).toFixed(4),o.firstEMA=parseFloat(o.firstEMA),o.secondEMA=parseFloat(o.secondEMA),o.firstEMAArray.push(o.firstEMA),o.secondEMAArray.push(o.secondEMA);if(o.counter>=o.Period+o.smoothingPeriod)if(0==o.EMA_of_First_EMAflag&&0==o.EMA_of_Second_EMAflag){for(e=0;e<o.firstEMAArray.length;e++)o.EMA_of_First_EMA_Average+=o.firstEMAArray[e],o.EMA_of_First_EMAflag=!0;for(o.EMA_of_First_EMA=o.EMA_of_First_EMA_Average/o.smoothingPeriod,e=0;e<o.secondEMAArray.length;e++)o.EMA_of_Second_EMA_Average+=o.secondEMAArray[e],o.EMA_of_Second_EMAflag=!0;o.EMA_of_Second_EMA=o.EMA_of_Second_EMA_Average/o.smoothingPeriod}else o.EMA_of_First_EMA=(parseFloat(o.EMA_of_First_EMA)*o.smoothingPeriodValueTwo+o.firstEMA*o.smoothingPeriodValueOne).toFixed(4),o.EMA_of_Second_EMA=(parseFloat(o.EMA_of_Second_EMA)*o.smoothingPeriodValueTwo+o.secondEMA*o.smoothingPeriodValueOne).toFixed(4),o.EMA_of_First_EMA=parseFloat(o.EMA_of_First_EMA),o.EMA_of_Second_EMA=parseFloat(o.EMA_of_Second_EMA);else o.EMA_of_First_EMA=null,o.EMA_of_Second_EMA=null;o.TSI=(o.EMA_of_First_EMA/o.EMA_of_Second_EMA*100).toFixed(4),o.TSI="NaN"!=o.TSI?parseFloat(o.TSI):null}else o.firstEMA=null,o.EMA_of_First_EMA=null,o.secondEMA=null,o.EMA_of_Second_EMA=null,o.TSI=null;return o.TSI},o.calcIndicator=function(u){var m=[];if(null!=u&&null!=u)for(var e=u.High.length,f=0;f<e;f++)m.push(o.nextPoint(u.Close[f]));return[m]},o.updatePeriods=function(u){if(null!=u&&null!=u&&u.length>0){var m=parseFloat(u[0].value);o.Period=NaN!=m?m:25;var e=parseFloat(u[1].value);o.smoothingPeriod=NaN!=e?e:13,o.PeriodValueOne=2/(o.Period+1),o.PeriodValueTwo=1-o.PeriodValueOne,o.smoothingPeriodValueOne=2/(o.smoothingPeriod+1),o.smoothingPeriodValueTwo=1-o.smoothingPeriodValueOne}}},n.WilliamsR=function(p){var h=this;h.Period=null!=p&&null!=p?p:10,h.name="WilliamsR",h.high=[],h.low=[],h.counter=0,h.maximumHigh=h.currentClose=h.minimumLow=h.WilliamRCalculated=null,h.firstCounter=0,h.reset=function(){h.high=[],h.low=[],h.counter=0,h.maximumHigh=h.currentClose=h.minimumLow=h.WilliamRCalculated=null,h.firstCounter=0},h.nextPoint=function(o,u,m){return h.counter++,h.high.push(o),h.low.push(u),h.counter>=h.Period&&0==h.firstCounter?(h.maximumHigh=Math.max.apply(Math,h.high),h.currentClose=m,h.minimumLow=Math.min.apply(Math,h.low),h.WilliamRCalculated=(0-(h.maximumHigh-h.currentClose)/(h.maximumHigh-h.minimumLow)*100).toFixed(4),h.firstCounter=1):1==h.firstCounter&&(h.high.shift(),h.low.shift(),h.maximumHigh=Math.max.apply(Math,h.high),h.currentClose=m,h.minimumLow=Math.min.apply(Math,h.low),h.WilliamRCalculated=(0-(h.maximumHigh-h.currentClose)/(h.maximumHigh-h.minimumLow)*100).toFixed(4)),h.WilliamRCalculated=parseFloat(h.WilliamRCalculated),h.WilliamRCalculated="NaN"==h.WilliamRCalculated.toString()?null:parseFloat(h.WilliamRCalculated),h.WilliamRCalculated},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=o.High.length,e=0;e<m;e++)u.push(h.nextPoint(o.High[e],o.Low[e],o.Close[e]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseFloat(o[0].value);h.Period=NaN!=u?u:10}}},n.MoneyFlowIndex=function(p){var h=this;h.Period=null!=p&&null!=p?p:10,h.name="MoneyFlowIndex",h.typicalPrice=h.volumeCalculated=h.positive=h.negative=h.positiveSum=h.negativeSum=h.moneyRatio=h.MFI=h.typicalPricePrevious=null,h.positiveArray=[],h.negativeArray=[],h.typicalPriceArray=[],h.counter=0,h.positiveSumFirstCount=h.negativeSumFirstCount=!1,h.reset=function(){h.typicalPrice=h.volumeCalculated=h.positive=h.negative=h.positiveSum=h.negativeSum=h.moneyRatio=h.MFI=h.typicalPricePrevious=null,h.positiveArray=[],h.negativeArray=[],h.typicalPriceArray=[],h.counter=0,h.positiveSumFirstCount=h.negativeSumFirstCount=!1},h.nextPoint=function(o,u,m,e){if(h.counter++,h.typicalPrice=(o+u+m)/3,h.typicalPrice=h.typicalPrice.toString(),h.typicalPrice=h.typicalPrice.slice(0,h.typicalPrice.indexOf(".")+5),h.typicalPrice=Number(h.typicalPrice),h.typicalPriceArray.push(h.typicalPrice),h.volumeCalculated=e*h.typicalPrice,h.typicalPriceArray.length>1&&(h.typicalPricePrevious=h.typicalPriceArray[h.typicalPriceArray.length-2],h.positive=h.typicalPrice>h.typicalPricePrevious?h.volumeCalculated:0,h.positiveArray.push(h.positive),h.negative=h.typicalPricePrevious>h.typicalPrice?h.volumeCalculated:0,h.negativeArray.push(h.negative),h.counter>
1h.Period)){if(0==h.positiveSumFirstCount&&0==h.negativeSumFirstCount){h.positiveSum=h.negativeSum=0;for(var f=0;f<h.positiveArray.length;f++)h.positiveSum+=h.positiveArray[f];for(f=0;f<h.negativeArray.length;f++)h.negativeSum+=h.negativeArray[f];h.positiveSumFirstCount=!0,h.negativeSumFirstCount=!0}else{for(h.positiveSum=h.negativeSum=0,h.positiveArray.shift(),h.negativeArray.shift(),f=0;f<h.positiveArray.length;f++)h.positiveSum+=h.positiveArray[f];for(f=0;f<h.negativeArray.length;f++)h.negativeSum+=h.negativeArray[f]}h.negativeSum>0?(h.moneyRatio=h.positiveSum/h.negativeSum,h.moneyRatio=h.moneyRatio.toString(),h.moneyRatio=h.moneyRatio.slice(0,h.moneyRatio.indexOf(".")+5),h.moneyRatio=Number(h.moneyRatio)):h.moneyRatio=0,h.MFI=(100-100/(1+h.moneyRatio)).toString(),h.MFI=h.MFI.slice(0,h.MFI.indexOf(".")+6),h.MFI=Number(h.MFI)}return h.MFI=parseFloat(h.MFI),"NaN"==h.MFI.toString()?h.MFI=null:(h.MFI=parseFloat(h.MFI),h.MFI=h.MFI.toString(),h.MFI=h.MFI.slice(0,h.MFI.indexOf(".")+5),h.MFI=Number(h.MFI)),h.MFI},h.calcIndicator=function(o){var u=[];if(null!=o&&null!=o)for(var m=o.High.length,e=0;e<m;e++)u.push(h.nextPoint(o.High[e],o.Low[e],o.Close[e],o.Volume[e]));return[u]},h.updatePeriods=function(o){if(null!=o&&null!=o&&o.length>0){var u=parseFloat(o[0].value);h.Period=NaN!=u?u:8}}};var l=l||{};l.extendHTMLChart=function(p,h){var m,e,o=h.split("."),u=p;for("HTMLChart"==o[0]&&(o=o.slice(1)),m=o.length,e=0;e<m;e++)void 0===u[o[e]]&&(u[o[e]]={}),u=u[o[e]];return u},l.ViewTypes=Object.freeze({Basic:1,Advance:2}),l.PanelTypes=Object.freeze({Basic:1,Advance:2}),l.ChartDataTypes=Object.freeze({Intraday:1,Historical:2,Continuous:3}),l.DefaultDataPeriods=Object.freeze({Intraday:5,Historical:1,Continuous:1}),l.DataPeriodTypes=Object.freeze({Daily:1,Weekly:2,Monthly:3,Quarterly:4,Yearly:5}),l.PointerGuideViewTypes=Object.freeze({None:0,Normal:1,Collapsed:2,Ditached:3}),l.dataTickTypes=Object.freeze({DBTick:0,LiveTick:1}),l.ScripInfo=function(p,h,o,u,m,e){var f=this;f.Token=h,f.MarketSegment=o,f.ScripCode=u,f.Description=m,f.IsIndex=p,f.decimalPoint=null!=e&&null!=e?e:2,f.copyData=function(i){f.Token=i.Token,f.MarketSegment=i.MarketSegment,f.ScripCode=i.ScripCode,f.Description=i.Description,f.IsIndex=i.IsIndex,f.decimalPoint=i.decimalPoint},f.clearData=function(){f.Token="",f.MarketSegment="",f.ScripCode="",f.Description="",f.IsIndex="",f.decimalPoint=2}},l.ScripData=function(p,h){var o=this;o.Open=[],o.High=[],o.Low=[],o.Close=[],o.Volume=[],o.TickTime=[],o.lastUpdateTickTime=null,o.lastTickIndex=-1,o.chartDataType=l.ChartDataTypes.Historical,o.dataPeriod=l.ChartDataTypes.Intraday==o.chartDataType?l.defaultIntraDayPeriod:1,o.DBTickHandler=null,o.LiveTickHandler=null,o.isNewTick=!0,o.lastTickData={O:0,H:0,L:0,C:0,V:0},o.sTime=o.eTime=0,o.preVolume=0,o.dayTotalVolume=0,o.currDate=Date.now(),o.currVol=0,o.setDataTypePeriod=function(u,m){o.chartDataType=null!=u&&null!=u?u:l.ChartDataTypes.Intraday,o.dataPeriod=null!=m&&null!=m?m:l.ChartDataTypes.Intraday==o.chartDataType?l.defaultIntraDayPeriod:1,o.DBTickHandler=l.ChartDataTypes.Intraday==o.chartDataType?o.addIntraDayTick:o.addHistoricTick,o.LiveTickHandler=l.ChartDataTypes.Intraday==o.chartDataType?o.addIntraDayTick:o.addHistoricLiveTick,o.isTickAdded=!1,o.isNewTick=!0},o.copyData=function(u){o.Open.splice(0),o.Open.push.apply(o.Open,u.Open),o.High.splice(0),o.High.push.apply(o.High,u.High),o.Low.splice(0),o.Low.push.apply(o.Low,u.Low),o.Close.splice(0),o.Close.push.apply(o.Close,u.Close),o.Volume.splice(0),o.Volume.push.apply(o.Volume,u.Volume),o.TickTime.splice(0),o.TickTime.push.apply(o.TickTime,u.TickTime),o.lastTickIndex=o.Close.length-1},o.clearData=function(){o.Open.splice(0),o.High.splice(0),o.Low.splice(0),o.Close.splice(0),o.Volume.splice(0),o.TickTime.splice(0),o.isTickAdded=!1,o.lastTickIndex=-1,o.preVolume=0,o.lastTickData={O:0,H:0,L:0,C:0,V:0,T:0},o.isNewTick=!0},o.getDataSource=function(u){var m=o.Close;switch(u){case T.e.DataSources.Open:m=o.Open;break;case T.e.DataSources.High:m=o.High;break;case T.e.DataSources.Low:m=o.Low;break;case T.e.DataSources.Volume:m=o.Volume;break;case T.e.DataSources.Close:default:m=o.Close}return m},o.getValidDate=function(u,m,e){var f=!1,i=new Date(u),P=i.getFullYear(),_=new Date(m);if(f=P==_.getFullYear())switch(e){case l.DataPeriodTypes.Weekly:f=i.getWeek()==_.getWeek();break;case l.DataPeriodTypes.Monthly:f=i.getMonth()==_.getMonth();break;case l.DataPeriodTypes.Quarterly:f=Math.ceil((i.getMonth()+1)/3)==Math.ceil((_.getMonth()+1)/3)}return f},o.addNextDBTick=function(u,m,e,f,i,P){return o.DBTickHandler(l.dataTickTypes.DBTick,u,m,e,f,i,P)},o.addNextLiveTick=function(u,m,e){return o.LiveTickHandler(l.dataTickTypes.LiveTick,u,m,e)},o.addIntraDayTick=function(u,m,e,f){var i=!1;if(l.dataTickTypes.DBTick==u)if(o.currVol=e,-1==o.lastTickIndex)o.dayTotalVolume=e;else if(0==(P=Date.dateDiffInDays(o.lastUpdateTickTime,m)))o.dayTotalVolume+=e;else{if(!(P>0))return i;o.dayTotalVolume=e}else if(-1==o.lastTickIndex)o.dayTotalVolume=e,o.currVol=e;else{var P;
1if(0==(P=Date.dateDiffInDays(o.lastUpdateTickTime,m))){if(!(e>o.dayTotalVolume))return i;o.currVol=e-o.dayTotalVolume,o.dayTotalVolume+=o.currVol}else{if(!(P>0))return i;o.dayTotalVolume=e,o.currVol=e}}if(0==o.dataPeriod)o.Open.push(f),o.High.push(f),o.Low.push(f),o.Close.push(f),o.Volume.push(o.currVol),o.TickTime.push(m),o.lastUpdateTickTime=m,o.lastTickIndex++;else if(-1==o.lastTickIndex){var _=new Date(m.getFullYear(),m.getMonth(),m.getDate(),m.getHours(),m.getMinutes(),m.getSeconds()),k=new Date(_.getFullYear(),_.getMonth(),_.getDate()),N=(W=Math.floor((_-k)/1e3))%o.dataPeriod;o.sTime=new Date(_.getFullYear(),_.getMonth(),_.getDate(),_.getHours(),_.getMinutes(),_.getSeconds()),o.sTime.setSeconds(o.sTime.getSeconds()-N),o.eTime=new Date(o.sTime.getFullYear(),o.sTime.getMonth(),o.sTime.getDate(),o.sTime.getHours(),o.sTime.getMinutes(),o.sTime.getSeconds()),o.eTime.setSeconds(o.eTime.getSeconds()+o.dataPeriod),o.lastTickIndex++,o.lastTickData.O=o.lastTickData.H=o.lastTickData.L=o.lastTickData.C=f,o.lastTickData.V=o.currVol,o.lastUpdateTickTime=m,o.Open.push(o.lastTickData.O),o.High.push(o.lastTickData.H),o.Low.push(o.lastTickData.L),o.Close.push(o.lastTickData.C),o.Volume.push(o.lastTickData.V),o.TickTime.push(o.eTime)}else if(m>o.sTime&&m<=o.eTime)o.lastTickData.H=f>o.lastTickData.H?f:o.lastTickData.H,o.lastTickData.L=f<o.lastTickData.L?f:o.lastTickData.L,o.lastTickData.C=f,o.lastTickData.V+=o.currVol,o.High[o.lastTickIndex]=o.lastTickData.H,o.Low[o.lastTickIndex]=o.lastTickData.L,o.Close[o.lastTickIndex]=o.lastTickData.C,o.Volume[o.lastTickIndex]=o.lastTickData.V,o.TickTime[o.lastTickIndex]=o.eTime;else if(m>o.eTime){o.lastTickData.O=o.lastTickData.H=o.lastTickData.L=o.lastTickData.C=f,o.lastTickData.V=o.currVol,o.lastUpdateTickTime=m;var W=Math.floor((m-o.eTime)/1e3);N=Math.ceil(W/o.dataPeriod)*o.dataPeriod,o.sTime.setSeconds(o.sTime.getSeconds()+N),o.eTime=new Date(o.sTime.getFullYear(),o.sTime.getMonth(),o.sTime.getDate(),o.sTime.getHours(),o.sTime.getMinutes(),o.sTime.getSeconds()),o.eTime.setSeconds(o.eTime.getSeconds()+o.dataPeriod),o.Open.push(o.lastTickData.O),o.High.push(o.lastTickData.H),o.Low.push(o.lastTickData.L),o.Close.push(o.lastTickData.C),o.Volume.push(o.lastTickData.V),o.TickTime.push(o.eTime),i=!0,o.lastTickIndex++}return i},o.addHistoricTick=function(u,m,e,f,i,P,_){o.Open.push(f),o.High.push(i),o.Low.push(P),o.Close.push(_),o.Volume.push(e),o.TickTime.push(m)},o.addHistoricLiveTick=function(u,m,e,f){var P;o.isNewTick?(l.DataPeriodTypes.Daily==o.dataPeriod?(o.Open.push(f),o.High.push(f),o.Low.push(f),o.Close.push(f),o.Volume.push(e),o.TickTime.push(m),o.isNewTick=!1):o.getValidDate(o.TickTime[P=o.TickTime.length-1],m,o.dataPeriod)?(o.High[P]=f>o.High[P]?f:o.High[P],o.Low[P]=f<o.Low[P]?f:o.Low[P],o.Close[P]=f,o.Volume[P]=o.Volume[P]+(e-o.preVolume),o.TickTime[P]=o.lastUpdateTickTime):(o.Open.push(f),o.High.push(f),o.Low.push(f),o.Close.push(f),o.Volume.push(e),o.TickTime.push(m),o.isNewTick=!1),o.lastUpdateTickTime=m,o.preVolume=e):(o.High[P=o.TickTime.length-1]=f>o.High[P]?f:o.High[P],o.Low[P]=f<o.Low[P]?f:o.Low[P],o.Close[P]=f,o.Volume[P]=o.Volume[P]+(e-o.preVolume),o.TickTime[P]=o.lastUpdateTickTime,o.lastUpdateTickTime=m,o.preVolume=e);return!1},o.setDataTypePeriod(p,h)},l.PointerGuide=function(){var p=this;p.scripDescription="",p.token="",p.MarketSegment="",p.Index="",p.graphValue="",p.xPointer="",p.yPointer="",p.Open="",p.High="",p.Low="",p.Close="",p.OtherChartPoints=[],p.updateValues=function(h,o,u,m,e,f,i,P,_,k,W,N,Q){p.scripDescription=m,p.token=u,p.MarketSegment=o,p.Index=h;var H=null!=f&&null!=f?f.toFixed(e):f;p.graphValue=isNaN(H)?"":H,p.xPointer=null!=i&&null!=i?i:"";var w=null!=P&&null!=P?P.toFixed(e):P;if(p.yPointer=isNaN(w)?"":w,p.Open=null!=_&&null!=_?_.toFixed(e):_,p.High=null!=k&&null!=k?k.toFixed(e):k,p.Low=null!=W&&null!=W?W.toFixed(e):W,p.Close=null!=N&&null!=N?N.toFixed(e):N,p.OtherChartPoints.splice(0,p.OtherChartPoints.length),null!=Q&&null!=Q)for(var Z=0;Z<Q.length;Z++)p.OtherChartPoints.push(Q[Z])},p.clearData=function(h){h&&p.scripDescription(""),p.graphValue(""),p.xPointer(""),p.yPointer(""),p.Open(""),p.High(""),p.Low(""),p.Close(""),p.OtherChartPoints.removeAll()},p.getYPriceValue=function(){var h=0,o=p.OtherChartPoints.filter(function(u){return"Y (Price)"==u.name});return o.length>0&&(h=o[0].data),h}},l.defaultPriceGraphForBasic=T.e.GraphTypes.Line,l.DateFormatHistoricalChart="dd-mmm-yyyy",l.DateFormatIntraDayChart="dd-mmm-yyyy HH:MM:ss",l.XAxisDateFormatHistoricalChart="dd-mmm HH:MM:ss",l.XAxisDateFormatIntraDayChart="dd-mmm HH:MM:ss",l.MaxIndicatorPanelsDesktop=10,l.MaxIndicatorPanelsTablet=4,l.MaxIndicatorPanelsMobile=2,l.MaxIndicatorsDesktop=25,l.MaxIndicatorsTablet=10,l.MaxIndicatorsMobile=5,l.MaxIntraDayPeriod=86400,l.defaultIntraDayPeriod=300,l.ChartPanel=function(p,h,o,u,m,e,f,i,P){var _=this;
1_.context=p,_.viewType=h,_.chartPanelType=o,_.priceGraphType=u,_.priceGraphStyle=null,_.id=m,_.title=e,_.isPanelHasValidScrip=null!=f,_.isLoadingScripData=!1;let k=["Intraday","Historical","Continuous"];_.chartText="",_.chartText=k[i-1]!=k[0]?k[i-1]+" "+["Daily","Weekly","Monthly","Quarterly","Yearly"][P-1]+" graph":k[i-1]+" graph",_.isCurrentSelectedPanel=!1,_.scripInfo=null==f?new l.ScripInfo(0,0,"",""):f,_.ODINScripobject=null,_.scripData=new l.ScripData(i,P),_.chartDataType=i=null!=i&&null!=i?i:l.ChartDataTypes.Intraday,_.dataPeriod=P=null!=P&&null!=P?P:1,_.startIndex=0,_.endIndex=0,_.minimumZoom=5,_.zoomRecs=0,_.isChartZoomed=!1,_.customZoomEnabled=!1,_.XAxisLableFormat="dd-mmm-yyyy",_.isCustomZoomOn=!1,_.FTChart=null,_.isBusy=!1,_.isBusyBasicChart=!1,_.hasData=!1,_.dirtyIndicators=[],_.canShowToolTip=!1,_.ChartCursor=1,_.setPanelHasValidScrip=function(N){_.isPanelHasValidScrip=N,null!=_.FTChart&&(_.FTChart.isChartHasValidScrip=_.isPanelHasValidScrip)},_.customZoomEnabled=function(N){null!=_.FTChart&&(_.FTChart.Chart.zoom.enabled=_.customZoomEnabled)},_.canShowToolTip=function(N){},_.setdataPeriod=function(N){_.scripData.setDataTypePeriod(_.chartDataType,N)},_.setchartDataType=function(N){return _.chartDataType=N,_.makeRequest=function(){_.isBusy=!0,_.isBusyBasicChart=!0;var Q=l.DefaultDataPeriods.Intraday;switch(N){case l.ChartDataTypes.Intraday:Q=l.DefaultDataPeriods.Intraday;break;case l.ChartDataTypes.Historical:Q=l.DefaultDataPeriods.Historical;break;case l.ChartDataTypes.Continuous:Q=l.DefaultDataPeriods.Continuous}_.dataPeriod=Q,_.setLableFormatofXAxis(),_.isBusy=!0,_.isBusyBasicChart=!0},N},_.canShowIndicatorPanel=function(){return _.isPanelHasValidScrip},_.getIndicatorPanelCount=function(){return _.FTChart.GraphPanels.length},_.getIndicatorCount=function(){return _.indicatorList.length},_.setLableFormatofXAxis=function(){if(l.ChartDataTypes.Intraday==_.chartDataType){if(_.XAxisLableFormat="dd-mmm HH:MM:ss",_.scripData.TickTime.length>_.startIndex){var N=_.scripData.TickTime[_.startIndex],Q=_.scripData.TickTime[_.endIndex];if(null!=N&&null!=Q&&null!=N&&null!=Q){var H=Q.dateDiff("n",N,Q);_.XAxisLableFormat=H>5?"dd-mmm HH:MM:ss":"dd-mmm MM:ss"}}}else switch(_.dataPeriod){case 3:case 4:case 5:_.XAxisLableFormat="mmm-yyyy";break;case 1:case 2:default:_.XAxisLableFormat="dd-mmm-yyyy"}},_.changeChartPeriod=function(N,Q,H,V){_.isBusy=!0,_.isBusyBasicChart=!0,_.dataPeriod=N,_.clearScripData(),_.scripData.setDataTypePeriod(_.chartDataType,_.dataPeriod),_.setLableFormatofXAxis(),_.isBusy=!0,_.isBusyBasicChart=!0;let w=["Intraday","Historical","Continuous"];_.chartText="",_.chartText=w[Q-1]!=w[0]?w[Q-1]+" "+["Daily","Weekly","Monthly","Quarterly","Yearly"][N-1]+" graph":w[Q-1]+" graph "+H+" minutes "+V+" seconds"},_.Initialize=function(N,Q,H){_.FTChart=T.e.chartHelper.getChart(_.chartPanelType,e),_.FTChart.Chart.ondraw=_.FTChart.onDraw,_.FTChart.addChartGuider(),_.FTChart.viewContext=_.context,_.FTChart.Chart.axes.bottom.labels.ongetlabel=_.xAxisLabelFormatter,_.FTChart.Chart.panel.margins.left=5;var V=null;if(l.PanelTypes.Basic==_.chartPanelType){_.priceGraphType=null!=Q&&null!=Q?Q:T.e.GraphTypes.Line,_.priceGraphStyle=null!=H&&null!=H?H:T.e.GraphStyles.Line,_.FTChart.addChartScroller();var w=_.scripData.getDataSource(N);V=_.addGraph(0,T.e.GraphPanelTypes.Price,_.priceGraphType,T.e.GraphStyles.Line,T.e.FillStyles.Solid,w,_.scripData,"#00FF00",null,"PriceGraph"),_.FTChart.addScrollerGraph(w,_.scripData),_.FTChart.addAxisSeparators(V),_.FTChart.Chart.onzoom=_.OnChartZoom,_.FTChart.Chart.zoom.onreset=_.OnChartZoomReset,_.canShowToolTip(!1)}else _.priceGraphType=null!=Q&&null!=Q?Q:T.e.GraphTypes.Candle,_.priceGraphStyle=null!=H&&null!=H?H:T.e.GraphStyles.Candle,_.FTChart.addChartScroller(),w=_.scripData.getDataSource(N),V=_.addGraph(0,T.e.GraphPanelTypes.Price,_.priceGraphType,T.e.GraphStyles.Candle,T.e.FillStyles.Solid,w,_.scripData,"#00FF00",null,"PriceGraph"),_.addGraph(1,T.e.GraphPanelTypes.Volume,T.e.GraphTypes.Volume,T.e.GraphStyles.Bar,T.e.FillStyles.Solid,_.scripData.getDataSource(T.e.DataSources.Volume),_.scripData,"#00FFFF",null,"VolumeGraph"),_.FTChart.addScrollerGraph(w,_.scripData),_.FTChart.addAxisSeparators(V),_.FTChart.Chart.onzoom=_.OnChartZoom,_.FTChart.Chart.zoom.onreset=_.OnChartZoomReset,_.canShowToolTip(!0);_.FTChart.GraphPanels[0].Axis.labels.decimals=_.scripInfo.decimalPoint,_.FTChart.GraphPanels[0].Axis.labels.fixedDecimals=!0,_.setLableFormatofXAxis(),V.isPriceGraph=!0,_.FTChart.pointerGuideCallback=_.pointerGuideCallbackMethod},_.pointerGuideCallbackMethod=function(N,Q,H,V){var w=_.scripInfo;if(null!=N&&null!=Q&&_.FTChart.isChartHasValidScrip){for(var Z=[],F=0,X=null==_.scripData.TickTime[H=H>=_.scripData.Close.length?_.scripData.Close.length-1:H]||null==_.scripData.TickTime[H]?"":_.scripData.TickTime[H].format(_.chartDataType==l.ChartDataTypes.Intraday?l.DateFormatIntraDayChart:l.DateFormatHistoricalChart),ne=0,he=0;he<_.FTChart.GraphPanels.length;he++){for(var fe=_.FTChart.GraphPanels[he],Te=0;Te<fe.Graphs.length;Te++){var Ce=fe.Graphs[Te].Graph;if(!fe.Graphs[Te].isPriceGraph){var be=Ce.data.values[H];"VolumeGraph"!=Ce.title&&(be=null!=be?be.toFixed(w.decimalPoint):""),Z.push({name:Ce.title.replace("Graph",""),data:be,color:Ce.format.stroke.fill})}}if(0==he&&Z.push({name:"X (DATETIME)",data:X}),Q>=fe.Axis.startPos&&Q<=fe.Axis.endPos){var Me=fe.Graphs.filter(function(K){return K.isPriceGraph});Ce=(Me=Me.length>0?Me[0]:fe.Graphs[0]).Graph,ne=fe.Axis.fromPos(Q),ne="VolumeGraph"==Ce.title?Math.round(ne):Number(ne.toFixed(w.decimalPoint)),F=Ce.data.values[H],Z.push({name:"Y ("+Ce.title.replace("Graph","")+")",data:null!=ne&&null!=ne&&isNaN(ne)?"":ne})}}_.pointerGuideUpdater(w.IsIndex,w.MarketSegment,w.Token,w.Description,w.decimalPoint,F,X,ne,_.scripData.Open[H],_.scripData.High[H],_.scripData.Low[H],_.scripData.Close[H],Z)}else _.pointerGuideUpdater(w.Description,w.decimalPoint);_.canShowToolTip()&&(1==V?_.FTChart.ToolTip.active=!0:_.FTChart.ToolTip.active&&(_.FTChart.ToolTip.hide(),_.FTChart.ToolTip.active=!1))},_.clearScripInfo=function(){_.scripInfo.clearData(),_.setPanelHasValidScrip(!1)},_.clearScripData=function(){if(_.scripData.clearData(),null!=_.indicatorList&&null!=_.indicatorList)for(var N=0;N<_.indicatorList.length;N++)_.indicatorList[N].clearData();_.isChartZoomed=!1,_.startIndex=_.endIndex=0,_.setDataRange(_,_.startIndex,_.endIndex),_.FTChart.setChartCursor(0),_.drawChart()},_.resetChartPanel=function(){_.deleteIndicators(),_.clearScripData(),_.clearScripInfo(),_.scrip
1Info=new l.ScripInfo(0,0,"",""),_.drawChart()},_.updateODINScripObj=function(N){_.ODINScripobject=N;var Q=_.GetPriceFormatter(N.DecimalLocator.toString(),N.ScripDet.MapMktSegId),H=new l.ScripInfo(N.IsIndex,N.ScripDet.Token,N.ScripDet.MapMktSegId,N.Symbol,N.MWSecurityDesc,Q);if(null!=H){_.setPanelHasValidScrip(!0),_.scripInfo=H,_.FTChart.scripName=N.MWSecurityDesc;for(var V=0;V<_.FTChart.GraphPanels.length;V++){var w=_.FTChart.GraphPanels[V];w.GPanelType!=T.e.GraphPanelTypes.Volume&&(w.Axis.labels.decimals=Q)}}else _.setPanelHasValidScrip(!1)},_.GetPriceFormatter=function(N,Q){try{return Q==a.gT.C_V_MAPPED_MSX_DERIVATIVES||Q==a.gT.C_V_MAPPED_MSX_SPOT||Q==a.gT.C_V_MSX_DERIVATIVES||Q==a.gT.C_V_MSX_SPOT||Q==a.gT.C_V_NSX_DERIVATIVES||Q==a.gT.C_V_NSX_SPOT||Q==a.gT.C_V_MAPPED_NSX_DERIVATIVES||Q==a.gT.C_V_MAPPED_NSX_SPOT||Q==a.gT.C_V_BSECDX_DERIVATIVES||Q==a.gT.C_V_BSECDX_SPOT||Q==a.gT.C_V_MAPPED_BSECDX_DERIVATIVES||Q==a.gT.C_V_MAPPED_BSECDX_SPOT||Q==a.gT.C_V_MAPPED_MCX_DERIVATIVES?(Q==a.gT.C_V_MAPPED_MCX_DERIVATIVES&&"0"==N.trim()&&(N="100"),"0"==N.trim()&&(N="10000"),"100"===N?2:"10000"===N||N===a.gT.C_V_NSECDS_DECLOC?4:2):Q==a.gT.C_V_MAPPED_BFX_DERIVATIVES||Q==a.gT.C_V_MAPPED_BFX_SPOT?"1000"===N?3:2:"10000"!==N||Q!=a.gT.C_V_MAPPED_NSECOMM_DERIVATIVES&&Q!=a.gT.C_V_MAPPED_NSECOMM_SPOT?Q==a.gT.C_V_MAPPED_MSX_CASH||Q==a.gT.C_V_MAPPED_MSX_FAO?_.GetPriceFormatterFromDecimalLocator(parseInt(N,10)):null!==N&&""!==N&&"0"!==N?_.GetNoOfZeros(N):2:2}catch(H){}},_.GetNoOfZeros=function(N){N=parseFloat(N);for(var Q=0,H=0;0==H;)H=N%10,N/=10,Q++;return Q-1},_.getDataSource=function(N){var Q=null;if(null!=N&&null!=N)if(N<=5)Q={id:N,parent:null};else{var H=N.toString(),V=parseInt(H.substring(H.length-3,H.length)),w=H.substring(0,H.length-3),Z=_.indicatorList.filter(function(F){return F.indiID==w});Z.length>0&&Z[0].IndicatorData.length>=V&&(Q={id:N,parent:Z[0].IndicatorData[V-1].data})}return Q},_.updateFullScripData=function(N){if(_.FTChart.setChartCursor(_.ChartCursor),null!=_.indicatorList&&null!=_.indicatorList){for(var Q=[],H=0;H<_.indicatorList.length;H++)try{var V;1==(V=n.CommonMethods.IndicatorPeriodValidation(_.indicatorList[H].indicatorParams,_.getDataSource(_.indicatorList[H].indicatorParams.dataSources[0]),_.indicatorList[H].indicatorParams.dataSources[0],_.scripData)).Result?_.indicatorList[H].reloadScripData():(alert(V.Message),Q.push(_.indicatorList[H]))}catch(w){}Q.length>0&&_.deleteIndicators(Q)}_.FTChart.pointerGuideCallback(null,null,0,0),_.startIndex=0,1==_.chartDataType&&(_.startIndex=_.scripData.Close.length/5,_.endIndex=_.scripData.Close.length/5*4),1!=_.chartDataType&&(_.startIndex=_.scripData.Close.length-200,_.endIndex=_.scripData.Close.length-10),_.setDataRange(_,_.startIndex,_.endIndex),null!=_.FTChart.chartScroller&&null!=_.FTChart.chartScroller&&(_.FTChart.chartScroller.onChangingCallback=_.ChartScrollerActionHandler)},_.addIntraDayTick=function(N,Q,H){var V=!1;if(1!=_.isLoadingScripData){if(l.ChartDataTypes.Intraday==_.chartDataType){_.FTChart.setChartCursor(_.ChartCursor);var w=_.scripData.Close.length;if(V=0==w,_.scripData.addNextLiveTick(N,H,Q)&&null!=_.indicatorList&&null!=_.indicatorList){w=_.scripData.Close.length;for(var F=0;F<_.indicatorList.length;F++)_.indicatorList[F].addIntraDayTick(w-1)}V&&(_.FTChart.pointerGuideCallback(null,null,0,0),_.startIndex=0),0==_.isChartZoomed?_.zoomReset():(_.FTChart.adjustGraphPanelsHeight(_.startIndex,_.endIndex),_.FTChart.drawChart())}return V}},_.drawChart=function(){null!=_.FTChart&&null!=_.FTChart&&_.FTChart.drawChart()},_.addGraph=function(N,Q,H,V,w,Z,F,re,X,ne){var he=_.FTChart.getGraphPanel(N,Q,""),fe=new T.e.FTGraphParams(_.FTChart,H,he,ne,V,re,w,X),Te=T.e.chartHelper.getGraph(_.FTChart,fe,Z,F);return _.FTChart.addGraph(Te),Te},_.removeGraph=function(N){_.FTChart.removeGraph(N)},_.deleteIndicators=function(N){if(null!=N&&null!=N)for(var Q=0;Q<N.length;Q++){for(var H=N[Q],V=0;V<H.Graphs.length;V++)_.removeGraph(H.Graphs[V]);if((w=_.indicatorList.indexOf(H))>-1){var Z=_.indicatorList.splice(w,1);for(Q=0;Q<_.indicatorListforView.length;Q++)_.indicatorListforView[Q].obj.indiID==Z[0].indiID&&_.indicatorListforView.splice(Q,1)}-1==w&&_.indicatorListforView.splice(0,_.indicatorListforView.length);for(var ne=0;ne<H.parentIndicators.length;ne++){var w,he=_.indicatorList.filter(function(fe){return fe.sequenceNo==H.obj.parentIndicators[ne]});he.length>0&&(w=he[0].childIndicators.indexOf(H.sequenceNo))>-1&&he[0].childIndicators.splice(w,1)}_.dirtyIndicators.push.apply(_.dirtyIndicators,H.childIndicators)}else if(_.indicatorList.length>0){for(Q=0;Q<_.indicatorList.length;Q++)for(H=_.indicatorList[Q],V=0;V<H.Graphs.length;V++)_.removeGraph(H.Graphs[V]);_.indicatorList.splice(0,_.indicatorList.length),_.indicatorListforView.splice(0,_.indicatorListforView.length)}_.updatePanelInfo(),_.setDataRange(_,_.startIndex,_.endIndex)},_.updatePanelInfo=function(){_.FTChart.GraphPanels.sort(function(V,w){return parseInt(V.GPIndex)-parseInt(w.GPIndex)});for(var N=2;N<_.FTChart.GraphPanels.length;N++){var Q=_.FTChart.GraphPanels[N].GPanelId;if(null!=_.indicatorList&&null!=_.indicatorList)for(var H=0;H<_.indicatorList.length;H++)_.indicatorList[H].indicatorParams.panel==Q&&(_.indicatorList[H].indicatorParams.panel=N);_.FTChart.GraphPanels[N].GPIndex=N,_.FTChart.GraphPanels[N].GPanelId=N,_.FTChart.GraphPanels[N].Name="Panel-"+N}},_.chagePriceGraphType=function(N,Q,H){null!=_.FTChart&&null!=_.FTChart&&(_.priceGraphType=N,_.priceGraphStyle=Q,_.FTChart.chagePriceGraphType(N,Q,H,_.scripData.Close,_.scripData),_.setCandleWidth(_.startIndex,_.endIndex),_.setDataRange(_,_.startIndex,_.endIndex))},_.setCandleWidth=function(N,Q){if(T.e.GraphTypes.Candle==_.priceGraphType&&Q-N>0){var V=Math.floor(_.FTChart.Chart.chartRect.width/(1.5*(Q-N)));V=(V=V<1?1:V)>32?32:V;var w=_.FTChart.getPriceGraph();null!=w&&(w.Graph.pointer.width=V)}},_.setDataRange=function(N,Q,H){if(null!=_.FTChart){var V=_.FTChart.Chart.axes.bottom.minimum!=Q||_.FTChart.Chart.axes.bottom.maximum!=H;_.FTChart.setDataRange(N,Q,H),V&&_.setCandleWidth(Q,H),_.zoomRecs=_.endIndex-_.startIndex>10?Math.ceil(.05*(_.endIndex-_.startIndex)):10,_.drawChart()}},_.setChartCursor=function(N){null!=_.FTChart&&(_.ChartCursor=N,_.FTChart.setChartCursor(N),_.FTChart.drawChart())},_.ChartScrollerActionHandler=function(N,Q,H){_.startIndex=Q,_.endIndex=H,_.isChartZoomed=!0,_.setDataRange(N,_.startIndex,_.endIndex)},_.zoomIn=function(){_.endIndex-_.startIndex-_.zoomRecs>_.zoomRecs&&(_.startIndex+=_.zoomRecs,_.isChartZoomed=!0),_.setDataRange(_,_.startIndex,_.endIndex)},_.zoomOut=function(){_.startIndex-_.zoomRecs>-1?_.startIndex-=_.zoomRecs:(_.startIndex=0,_.isChartZoomed=!1),_.setDataRange(_,_.startIndex,_.endIndex)},_.zoomReset=function(){_.startIndex=0,1!=_.chartDataType&&(_.startIndex=_.scripData.Close.length-20),_.endIndex=_.scripData.Close.length,_.setDataRange(_,_.startIndex,_.endIndex),_.isChartZoomed=!1,_.FTChart.Chart.zoom.enabled=!1},_.zoomCustom=function(){_.customZoomEnabled(!0)},_.OnChartZoom=function(){_.customZoomEnabled(!1),_.isChartZoomed=!0,_.startIndex=Math.round(_.FTChart.Chart.axes.bottom.minimum),_.endIndex=Math.round(_.FTChart.Chart.axes.bottom.maximum),_.endIndex-_.startIndex<_.minimumZoom&&(_.endIndex=_.startIndex+_.minimumZoom,_.endIndex=_.endIndex>_.scripData.Close.length-1?_.scripData.Close.length-1:_.endIndex),_.setDataRange(_,_.startIndex,_.endIndex)},_.setTouchZoom=function(N,Q){_.startIndex=N<=0?1:N,_.endIndex=Q>_.scripData.Close.length-1?_.scripData.Close.length-1:Q,_.setDataRange(_,_.startIndex,_.endIndex)},_.OnChartZoomReset=function(){_.customZoomEnabled(!1),_.zoomReset()},_.xAxisLabelFormatter=function(N,Q){var H=parseInt(N);return null!=_.scripData.TickTime[H]&&null!=_.scripData.TickTime[H]?_.scripData.TickTime[H].format(_.XAxisLableFormat):""},_.getExportFileName=function(N){var Q=new Date;return String.Format("{0}{1}.{2}",_.scripInfo.ScripCode,Q.toString("ddMMyyyy"),N),String.Format("{0}{1}.{2}",_.scripInfo.ScripCode,Q.toString("ddMMyyyy"),N).replace(/\s+/g," ").trim()},_.getChartDataAsCSVText=function(N,Q){var H=new a.HT;if(_.isPanelHasValidScrip){var V;H.appendLine(Q+"\n"),_.indicatorList.length>0&&((V=[]).push(",,,,,"),_.indicatorList.forEach(function(X){V.push(String.Format(",{0}{1}",X.getIndicatorName(),Array(X.indicatorParams.styles.length).join(",")))}),H.appendLine(V.join(","))),(V=[]).push("DATE,OPEN,HIGH,LOW,CLOSE,VOLUME"),_.indicatorList.forEach(function(re){V.push(re.getHeaderData())}),H.appendLine(V.join(","));for(var w=0;w<_.scripData.Close.length;w++){var Z=[],F=[_.scripData.TickTime[w].format(l.DateFormatIntraDayChart),_.scripData.Open[w],_.scripData.High[w],_.scripData.Low[w],_.scripData.Close[w],_.scripData.
1Volume[w]].join(",").toString();Z.push(F),_.indicatorList.forEach(function(re){Z.push(re.getRowData(w))}),H.appendLine(Z.join(","))}}else H.Append("NO SCRIP SELECTED");return H.toString()}},l.BasicPanel=function(p,h,o,u,m){var e=this;l.ChartPanel.call(e,p,h,l.PanelTypes.Basic,l.defaultPriceGraphForBasic,o,u,m,l.ChartDataTypes.Intraday,l.defaultIntraDayPeriod),e.setChartCursor(0),e.adjustChartPanelView=function(f){if(null!=e.context&&null!=e.context){var i,P;null!=f&&(P=f.width,i=f.height);var _=$("#basicChartPanel",e.context)[0];_.style.width=P+"px",_.style.height=i-30+"px";var k=$("#basicChartScroller",e.context)[0];k.style.width=P+"px",k.style.height="34px",e.FTChart.loadChartCanvasintoDiv(_,k),e.FTChart.resize(i-30,P,50,30),e.setCandleWidth(e.startIndex,e.endIndex),e.drawChart()}}},l.BasicPanel.prototype=new l.ChartPanel,l.AdvancedPanel=function(p,h,o,u,m){var e=this;l.ChartPanel.call(e,p,h,l.PanelTypes.Advance,l.defaultPriceGraphForBasic,o,u,m,l.ChartDataTypes.Historical,l.DataPeriodTypes.Daily),e.indicatorList=[],e.indicatorListforView=[],e.adjustChartPanelView=function(f,i){if(null!=e.context&&null!=e.context){var P=e.context.clientHeight-4,_=e.context.clientWidth-8,N=($("#chartCaption-tr",e.context),$("#chartCanvas-div",e.context)[0]);N.style.width=_+"px",N.style.height=P-27-30+"px";var Q=$("#chartScroller-div",e.context)[0];Q.style.width=_+"px",Q.style.height="30px",e.FTChart.loadChartCanvasintoDiv(N,Q),e.FTChart.resize(P-27-30,_,50,30),e.setCandleWidth(e.startIndex,e.endIndex),e.drawChart()}},e.addIndicator=function(f,i,P,_){for(var k=null,W=0,N=0;N<e.indicatorList.length;N++){var Q=e.indicatorList[N];W=Q.sequenceNo>W?Q.sequenceNo:W}var H=1,V=e.indicatorList.filter(function(Ce){return Ce.indicatorParams.id==i.id});if(V.length>0){for(N=0;N<V.length;N++)H=V[N].serialNo>H?V[N].serialNo:H;H++}var w=n.CommonMethods.IndicatorPeriodValidation(i,P,_,e.scripData);if(1!=w.Result)return w.Message;if(k=new l.Indicator(i,e.scripData,W+1,H,P,_),null!=P&&null!=P.parentId&&null!=P.parentId){var Z=e.indicatorList.filter(function(Ce){return Ce.sequenceNo==P.parentId});k.parentIndicators.push(P.parentId),null!=Z[0]&&null!=Z[0]&&Z[0].childIndicators.push(k.sequenceNo)}e.indicatorList.push(k),e.indicatorListforView.push({id:k.indicatorParams.id,obj:k});var F=null;for(N=0;N<k.IndicatorData.length;N++)F=e.addGraph(null==F?i.panel:F.graphPanel.GPanelId,T.e.GraphPanelTypes.Indicator,T.e.GraphTypes.Line,i.styles[N].style,T.e.FillStyles.Solid,k.IndicatorData[N].data,e.scripData,i.styles[N].color,null,i.styles[N].name+(H>1?" "+H:"")),k.Graphs.push(F),99==k.indicatorParams.panel&&(k.indicatorParams.panel=F.graphPanel.GPanelId);return null!=f&&1==f.hasHLines&&k.addHLineDrawHandler(),e.setDataRange(e,e.startIndex,e.endIndex),k},e.errmessage="",e.UpdateIndicator=function(f,i,P,_,k){let W;var N=n.CommonMethods.IndicatorPeriodValidation(P,_,k,e.scripData);if(1==N.Result){if(f.hasSource&&(W|=i.updateDataSources([_,k])),f.hasMAType&&(W|=i.updateMAType(P.matype)),f.hasPeriods&&(W|=i.updatePeriods(P.periods)),i.indicatorParams.panel!=P.panel){for(var Q=e.FTChart.getGraphPanel(i.indicatorParams.panel,null),H=e.FTChart.getGraphPanel(P.panel,null),V=0;V<i.Graphs.length;V++)Q.removeGraph(w=i.Graphs[V]),w.updateGraphPanel(H),H.addGraph(w);i.indicatorParams.panel=H.GPanelId,e.FTChart.removeGraphPanel(Q)}if(f.hasHLines&&(i.indicatorParams.hLines=P.hLines),f.hasStyle){var Z=!1;for(V=0;V<P.styles.length;V++){var F=i.indicatorParams.styles[V],re=P.styles[V];if(F.style!=re.style||F.color!=re.color)if(F.style!=T.e.GraphStyles.Histogram&&re.style==T.e.GraphStyles.Histogram||F.style==T.e.GraphStyles.Histogram&&re.style!=T.e.GraphStyles.Histogram){i.indicatorParams.styles[V].style=parseInt(re.style),i.indicatorParams.styles[V].color=re.color;var X=i.Graphs[V].graphData;e.removeGraph(i.Graphs[V]),i.Graphs[V]=null;var ne=T.e.GraphTypes.Line,fe=parseInt(re.style);re.style==T.e.GraphStyles.Histogram&&(ne=T.e.GraphTypes.Volume,fe=T.e.FillStyles.Solid);var Ce=e.addGraph(i.indicatorParams.panel,T.e.GraphPanelTypes.Indicator,ne,P.styles[V].style,fe,X,e.scripData,re.color,null,Te=P.styles[
1V].name+(i.serialNo>1?" "+i.serialNo:""));i.Graphs[V]=Ce,Z=!0}else{var w;i.indicatorParams.styles[V].style=parseInt(re.style),i.indicatorParams.styles[V].color=re.color,(w=i.Graphs[V]).updateGraphStyle(w.Graph,P.styles[V].color,P.styles[V].style)}}if(Z){var be=i.Graphs[0].graphPanel,Me=be.Graphs.slice();for(be.Graphs=[],V=0;V<P.styles.length;V++){var Te=P.styles[V].name+(i.serialNo>1?" "+i.serialNo:""),ue=Me.filter(function(de){return de.Graph.title==Te});ue.length>0&&be.Graphs.push(ue[0])}}}W&&(i.clearData(),i.reloadScripData()),e.updatePanelInfo(),e.setDataRange(e,e.startIndex,e.endIndex)}else alert(N.Message)},e.getIndicatorParams=function(){var f=[];return e.indicatorList.forEach(function(i){f.push(i.indicatorParams)}),f}},l.AdvancedPanel.prototype=new l.ChartPanel,l.ChartView=function(p,h,o,u){var m=this;function e(i){for(var P=null,_=0;_<m.chartPanels.length;_++)if(null!=m.chartPanels[_]&&null!=m.chartPanels[_]&&i==m.chartPanels[_].id){P=m.chartPanels[_];break}return P}m.viewType=p,m.divId=h,m.LicenseType=u,m.Device="D",m.hammer=null,m.periodNew={},m.errorMessage="",m.context=o,m.maxChartPanels=l.PanelTypes.Advance==p?4:1,m.currentViewModeIndex=0,m.currentSelectedPanel=null,m.pointerGuide=new l.PointerGuide,m.chartPanels=[],m.showSaveIndicatorDiv=!0,m.showIndicatorDialog=!1,m.SelectedChartDataType=1,m.historicalDataPeriod=[{id:1,name:"Daily"}],m.historicalDataPeriod.push({id:2,name:"Weekly"}),m.historicalDataPeriod.push({id:3,name:"Monthly"}),m.historicalDataPeriod.push({id:4,name:"Quarterly"}),m.historicalDataPeriod.push({id:5,name:"Yearly"}),m.SelectedIntraDayDataPeriodMinutes=5,m.SelectedIntraDayDataPeriodSeconds=0,m.SelectedIntraDayDataPeriod=l.defaultIntraDayPeriod,m.SelectedHistoricDataPeriod=1,m.isSaveIndiTemplate=!1,m.IndicatorTemplateList=[],m.IndicatorTemplateName="",m.SelectedIndicatorTemplate=null,m.viewOptionPanelMap=[{ViewModeIndex:0,TotalPanels:1,Rows:1,Columns:1,panelList:[0]}],m.viewOptionPanelMap.push({ViewModeIndex:1,TotalPanels:2,Rows:2,Columns:1,panelList:[0,1]}),m.viewOptionPanelMap.push({ViewModeIndex:2,TotalPanels:2,Rows:1,Columns:2,panelList:[0,1]}),m.viewOptionPanelMap.push({ViewModeIndex:3,TotalPanels:4,Rows:2,Columns:2,panelList:[0,1,2,3]}),m.maxIndicatorPanels=l.MaxIndicatorPanelsDesktop,m.maxIndicatorsCount=l.MaxIndicatorsDesktop,m.indicatorTemplateDialog=null,m.SelectedCursorOption="",m.SelectedCursorOptionfunction=function(){let i=Number(m.SelectedCursorOption.CurValue);m.currentSelectedPanel.setChartCursor(i)},m.setSelectedIntraDayDataPeriod=function(i){m.SelectedIntraDayDataPeriod=i,m.SelectedIntraDayDataPeriodMinutes=parseInt(i)/60,m.SelectedIntraDayDataPeriodSeconds=parseInt(i)%60},m.getSelectedPeriod=function(){return 1==m.SelectedChartDataType?m.SelectedIntraDayDataPeriod:m.SelectedHistoricDataPeriod},m.changeChartType=function(i){m.SelectedChartDataType=i;var P=m.currentSelectedPanel;null!=P&&(null==P.ODINScripobject||null==P.ODINScripobject||(m.clearScripData(P.id),P.setchartDataType(m.SelectedChartDataType),m.setSelectedIntraDayDataPeriod(l.defaultIntraDayPeriod),m.SelectedHistoricDataPeriod=1,m.changeChartPeriod(i,m.SelectedChartDataType,m.SelectedIntraDayDataPeriodMinutes,m.SelectedIntraDayDataPeriodSeconds)))},m.toggelPointGuide=function(){l.PointerGuideViewTypes.Normal==m.advChartGuideViewStyle()?m.advChartGuideViewStyle(l.PointerGuideViewTypes.Collapsed):m.advChartGuideViewStyle(l.PointerGuideViewTypes.Normal)},m.showPointGuide=function(){m.advChartGuideViewStyle(l.PointerGuideViewTypes.Normal)},m.closePointGuide=function(){m.advChartGuideViewStyle(l.PointerGuideViewTypes.None)},m.pointerGuideView=l.PointerGuideViewTypes.Normal,m.getPanelforView=function(i,P){return m.chartPanels[m.viewOptionPanelMap[i].panelList[P]]},m.changePanelView=function(i){m.currentViewModeIndex=i;for(var _=m.viewOptionPanelMap[i],k=m.currentSelectedPanel,W=k.id,N=0,Q=0;Q<m.chartPanels.length&&N<_.TotalPanels;Q++)1==(k=m.chartPanels[(W+Q)%m.chartPanels.length]).isPanelHasValidScrip&&(_.panelList[N]=k.id,N++);if(N<_.TotalPanels)for(Q=0;Q<m.chartPanels.length&&N<_.TotalPanels;Q++)0==(k=m.chartPanels[Q]).isPanelHasValidScrip&&(_.panelList[N]=k.id,N++);m.SelectedViewOption=i+1},m.drawChart=function(){if(null!=m.chartPanels&&null!=m.chartPanels)for(var i=0;i<m.chartPanels.length;i++)m.chartPanels[i].drawChart()},m.clearScripInfo=function(i){var P=e(i);null!=P&&P.clearScripInfo()},m.clearScripData=function(i){var P=e(i);null!=P&&P.clearScripData()},m.resetChartPanel=function(i){var P=e(i);null!=P&&P.resetChartPanel()},m.updateFullScripData=function(i,P){var _=e(i);null!=_&&(_.updateFullScripData(P),m.adjustadvChartContainer(),_.drawChart())},m.addIntraDayTick=function(i,P,_,k,W){for(var N=0;N<m.chartPanels.length;N++){var Q=m.chartPanels[N];
1if(null!=Q&&null!=Q){var H=Q.scripInfo;if(i==H.MarketSegment&&parseInt(P)==parseInt(H.Token))try{Q.addIntraDayTick(_,k,W)}catch(Z){}}}},m.Initialize=function(i,P,_,k,W){try{m.Device=W,"D"==W?(m.maxIndicatorPanels=l.MaxIndicatorPanelsDesktop,m.maxIndicatorsCount=l.MaxIndicatorsDesktop):"T"==W?(m.maxIndicatorPanels=l.MaxIndicatorPanelsTablet,m.maxIndicatorsCount=l.MaxIndicatorsTablet):"M"==W&&(m.maxIndicatorPanels=l.MaxIndicatorPanelsMobile,m.maxIndicatorsCount=l.MaxIndicatorsMobile);var N=m.readCookie(a.xB.User.UserId+"_IndicatorTemplates");if(null!=N){var Q=JSON.parse(N);null!=Q&&Q.forEach(function(re){m.IndicatorTemplateList.push(re)})}if(m.SelectedChartDataType=_,m.addChartPanels(i,l.PanelTypes.Basic==m.viewType?T.e.GraphTypes.Line:T.e.GraphTypes.Candle,_,k),l.PanelTypes.Basic==m.viewType&&m.setChartCursor(0),null!=m.priceGraphTypeOptions){for(var H=m.priceGraphTypeOptions.filter(function(re){return m.LicenseType!=(m.LicenseType&re.licenseType)}),V=0;V<H.length;V++){var w=m.priceGraphTypeOptions.indexOf(H[V]);m.priceGraphTypeOptions.splice(w,1)}if(l.PanelTypes.Basic==m.viewType){var Z=m.priceGraphTypeOptions.filter(function(re){return re.GraphId==T.e.GraphTypes.Line})[0];m.SelectedPriceGraphType=Z}else{var F=m.priceGraphTypeOptions.filter(function(re){return re.GraphId==T.e.GraphTypes.Candle})[0];m.SelectedPriceGraphType=F}}null!=m.SelectedChartSyncType&&m.SelectedChartSyncType(m.chartSyncOptions[0]),m.adjustadvChartContainer(),m.drawChart()}catch(re){}},m.addTouchHandlers=function(){if("D"!=m.Device){var i=$("#_basicchartContainer",m.context)[0];i.addEventListener("touchstart",function(P){m.touchEventHandler(i,P)},!1),i.addEventListener("touchmove",function(P){m.touchEventHandler(i,P)},!1),i.addEventListener("touchend",function(P){m.touchEventHandler(i,P)},!1),m.setChartCursor(1)}},m.mousePos={x:0,y:0},m.startPos=[{x:0,y:0},{x:0,y:0}],m.lastPos=[{x:0,y:0},{x:0,y:0}],m.chartPointIdx=[0,0],m.pxPerTick=0,m.touchDistance=0,m.getTouchPos=function(i,P,_){var k=i.getBoundingClientRect();return{x:P.touches[_].clientX-k.left,y:P.touches[_].clientY-k.top}},m.getDiatance=function(i,P){return Math.abs(Math.abs(i.x)-Math.abs(P.x))},m.touchEventHandler=function(i,P){switch(P.preventDefault(),P.type){case"touchstart":var k=m.getTouchPos(i,P,0);if(Math.round(k.x),Math.round(k.y),1==P.touches.length){k=m.getTouchPos(i,P,0);var W=new MouseEvent(1==P.touches.length?"mousemove":"mousedown",{clientX:k.x,clientY:k.y});i.dispatchEvent(W),m.startPos[0]=k,m.lastPos[0]=k}break;case"touchmove":1==P.touches.length&&(k=m.getTouchPos(i,P,0),W=new MouseEvent("mousemove",{clientX:k.x,clientY:k.y}),i.dispatchEvent(W),m.lastPos[0]=k);break;case"touchend":m.startPos=[{x:0,y:0},{x:0,y:0}],m.lastPos=[{x:0,y:0},{x:0,y:0}],m.chartPointIdx=[0,0],m.pxPerTick=0,m.touchDistance=0}},m.setChartCursor=function(i){var P=m.currentSelectedPanel;null!=P&&null!=P&&P.setChartCursor(i)},m.setCurrentSelectedPanel=function(i){if(m.currentSelectedPanel=i,i.isCurrentSelectedPanel=!0,m.SelectedChartDataType=i.chartDataType,m.setSelectedIntraDayDataPeriod(l.defaultIntraDayPeriod),m.SelectedHistoricDataPeriod=1,m.SelectedHistoricDataPeriod="Daily",l.ChartDataTypes.Intraday==i.chartDataType?(m.setSelectedIntraDayDataPeriod(i.dataPeriod),m.SelectedHistoricDataPeriod=1,m.SelectedHistoricDataPeriod="Daily"):(m.setSelectedIntraDayDataPeriod(l.defaultIntraDayPeriod),m.SelectedHistoricDataPeriod=i.dataPeriod),null!=m.priceGraphTypeOptions&&null!=m.priceGraphTypeOptions){var P=m.priceGraphTypeOptions.filter(function(_){return _.GraphType==i.priceGraphType&&_.GraphStyle==i.priceGraphStyle});m.SelectedPriceGraphType=P.length>0?P[0]:m.priceGraphTypeOptions[0]}m.SelectedCursorOptionfunction(i.ChartCursor)},m.addChartPanels=function(i,P,_,k){for(var W=0;W<m.maxChartPanels;W++){var N=null;(N=l.PanelTypes.Basic==m.viewType?new l.BasicPanel(m.context,m.viewType,W,"title-"+W,null):new l.AdvancedPanel(m.context,m.viewType,W,"title-"+W,null)).pointerGuideUpdater=m.pointerGuide.updateValues,N.Initialize(i,P),m.chartPanels.push(N)}m.chartPanels[0].setchartDataType(_),null!=k&&m.chartPanels[0].updateODINScripObj(k),m.setCurrentSelectedPanel(m.chartPanels[0]),l.PanelTypes.Basic!=m.viewType&&l.ChartDataTypes.Intraday==_&&(m.chartPanels[0].scripData.setDataTypePeriod(_),m.setSelectedIntraDayDataPeriod(l.defaultIntraDayPeriod),m.SelectedIntraDayDataPeriodMinutes="5",m.SelectedIntraDayDataPeriodSeconds="0")},m.clearData=function(i){null!=m.pointerGuide&&m.pointerGuide.clearData(i)},m.zoomIn=function(){null!=m.currentSelectedPanel&&m.currentSelectedPanel.zoomIn()},m.zoomOut=function(){null!=m.currentSelectedPanel&&m.currentSelectedPanel.zoomOut()},m.zoomReset=function(){null!=m.currentSelectedPanel&&m.currentSelectedPanel.zoomReset()},m.zoomCustom=function(){null!=m.currentSelectedPanel&&m.currentSelectedPanel.zoomCustom()}
1,m.changeChartPeriod=function(){if(null!=m.currentSelectedPanel){var i=m.currentSelectedPanel;i.changeChartPeriod(parseInt(1==i.chartDataType?m.SelectedIntraDayDataPeriod:m.SelectedHistoricDataPeriod.id),i.chartDataType,Math.round(m.SelectedIntraDayDataPeriodMinutes),m.SelectedIntraDayDataPeriodSeconds)}},m.panelClicked=function(i,P){var _=m.viewOptionPanelMap[i],k=m.currentSelectedPanel;null!=k&&(k.isCurrentSelectedPanel=!1),m.setCurrentSelectedPanel(m.chartPanels[_.panelList[P]])},m.ToggleIndicatorSettings=function(i,P){m.showIndicatorDialog=!0,m.setIndicatordialogstate(!1,i,1,P)},m.closeIndicatorSettings=function(i){var P=i;return $("#IndicatorSettings",m.context).slideUp(),m.showIndicatorDialog=!1,m.setIndicatordialogstate(P=null!=P&&null!=P&&P,!1,0,void 0),m.errMessage},m.errMessage="",m.setIndicatordialogstate=function(i,P,_,k){var W=m.currentSelectedPanel,N=m.IndiViewModal.SelectedIndicatorParams;if(1==_?(m.IndiViewModal.isIndicatorAdded=i,m.IndiViewModal.isIndicatorEdited=i):0==m.IndiViewModal.isEditing?m.IndiViewModal.isIndicatorAdded=i:m.IndiViewModal.isIndicatorEdited=i,0==_){if(1==m.IndiViewModal.isIndicatorAdded)if(W.getIndicatorCount()<m.maxIndicatorsCount)if(-1==N.panel&&W.getIndicatorPanelCount()>=m.maxIndicatorPanels)alert(String.Format("Maximum {0} graph panels (including price and volume) can be added.",m.maxIndicatorPanels));else{N.id=m.IndiViewModal.SelectedIndicator.id;var Q=W.addIndicator(m.IndiViewModal.SelectedIndicator,N.getJSObj(),m.IndiViewModal.SelectedDataSource1,m.IndiViewModal.SelectedDataSource2,m.test);null!=Q&&("string"!=typeof Q?(m.errMessage="",Q.updateIndicatorId(Q.indiID)):m.errMessage=Q)}else alert(String.Format("Maximum {0} indicators can be added.",m.maxIndicatorsCount));else if(1==m.IndiViewModal.isIndicatorEdited){var H=m.IndiViewModal.AllIndicatorList.filter(function(F){return N.id==F.id})[0],V=m.SelectedIndicator;1==m.IndiViewModal.isDDirtyIndicator&&(V=W.indicatorList.filter(function(F){return F.sequenceNo==W.dirtyIndicators[0]})[0]),W.UpdateIndicator(H,V,N.getJSObj(),m.IndiViewModal.SelectedDataSource1,m.IndiViewModal.SelectedDataSource2)}if(1==m.IndiViewModal.isDDirtyIndicator){var w=W.dirtyIndicators.splice(0,1);w.length>0&&(0==m.IndiViewModal.isIndicatorEdited?(V=W.indicatorList.filter(function(re){return re.sequenceNo==w}),m.deleteIndicators(V)):W.dirtyIndicators.length>0&&m.ToggleIndicatorSettings(!0,!0))}}else if(m.IndiViewModal.isEditing=P,m.showIndicatorDialog)if(m.IndiViewModal.isDelOnCancel=!1,m.IndiViewModal.isDDirtyIndicator=!1,0==m.IndiViewModal.isEditing)m.IndiViewModal.SelectedIndicator=m.IndiViewModal.IndicatorList.filter(function(F){return 1==F.id})[0],m.IndiViewModal.SelectedDataSource1=m.IndiViewModal.DataSourceList1.filter(function(F){return 4==F.id})[0],m.IndiViewModal.fn_SelectedIndicator(m.IndiViewModal.SelectedIndicator),m.IndiViewModal.updatePanelList(W.FTChart.GraphPanels),m.IndiViewModal.updateDatasource1(W.indicatorList),m.IndiViewModal.isDelOnCancel=!1,m.IndiViewModal.isDDirtyIndicator=!1;else if(1==m.IndiViewModal.isEditing){V=m.SelectedIndicator,null!=k&&null!=k&&1==k&&(V=W.indicatorList.filter(function(re){return re.sequenceNo==W.dirtyIndicators[0]})[0],m.IndiViewModal.isDelOnCancel=!0,m.IndiViewModal.isDDirtyIndicator=!0);var Z=V.indicatorParams;m.IndiViewModal.updatePanelList(W.FTChart.GraphPanels),m.IndiViewModal.updateDatasource1(W.indicatorList.filter(function(re){return re.sequenceNo<V.sequenceNo})),m.IndiViewModal.SelectedIndicator=m.IndiViewModal.IndicatorList.filter(function(re){return re.id==V.indicatorParams.id})[0],m.IndiViewModal.fn_SelectedIndicator(m.IndiViewModal.SelectedIndicator),m.IndiViewModal.SelectedIndicatorParams.loadParams(Z),m.IndiViewModal.loadDataSources(),null!=Z.indicatorParams&&(m.IndiViewModal.SelectedIndicatorParams.matype=Z.indicatorParams.matype)}},m.confirmDeleteIndicators=function(){m.checkForDependancies()},m.checkForDependancies=function(){if(null!=m.currentSelectedPanel){var P=null;if(null!=m.SelectedIndicator&&(P=[m.SelectedIndicator]),null!=P&&null!=P){var _=P[0];null!=_.childIndicators&&_.childIndicators.length>0||m.deleteIndicators(P)}else m.deleteIndicators(P)}},m.deleteIndicators=function(i){var P=m.currentSelectedPanel;P.deleteIndicators(i),P.dirtyIndicators.length>0&&m.ToggleIndicatorSettings(!0,!0),P.drawChart()},m.EditIndicator=function(){if(null!=m.currentSelectedPanel){var i=m.currentSelectedPanel,P=null;null!=m.SelectedIndicator&&(P=[m.SelectedIndicator]),m.IndiViewModal.isEditing(!0),i.editIndicators(P),i.drawChart()}},m.saveChartAsImage=function(i){if(null!=m.currentSelectedPanel){var P=m.currentSelectedPanel,_=P.FTChart.Chart.canvas;if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([_.msToBlob()],{t
1ype:"image/png;"}),P.getExportFileName("png"));else{var k=_.toDataURL("image/png",1);k=(k=k.replace(/^data:image\/[^;]*/,"data:application/octet-stream")).replace(/^data:application\/octet-stream/,"data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=CanvasDemo.png");var W=$(i,m.context)[0];W.download=P.getExportFileName("png"),W.href=k,W.click()}}},m.saveChartAsCSV=function(i,P){if(null!=m.currentSelectedPanel){var _=m.currentSelectedPanel,k=_.getChartDataAsCSVText(_,P);if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([k],{type:"text/csv;charset=utf-8;"}),_.getExportFileName("csv"));else{var W="data:text/csv;charset=utf-8,"+encodeURI(k),N=$(i,m.context)[0];N.download=_.getExportFileName("csv"),N.href=W,N.click()}}},m.createCookie=function(i,P,_){if(_){var k=new Date;k.setTime(k.getTime()+24*_*60*60*1e3);var W="; expires="+k.toUTCString()}else W="; expires=Thu, 31 Dec 2050 12:00:00 UTC";document.cookie=i+"="+P+W+"; path=/"},m.readCookie=function(i){for(var P=i+"=",_=document.cookie.split(";"),k=0;k<_.length;k++){for(var W=_[k];" "==W.charAt(0);)W=W.substring(1,W.length);if(0===W.indexOf(P))return W.substring(P.length,W.length)}return null},m.showManageIndicatorDialog=function(i){if(m.isSaveIndiTemplate=i,m.IndicatorTemplateName="",m.SelectedIndicatorTemplate=null,1==i){if(0==m.currentSelectedPanel.indicatorList.length)return void alert("Minimum one Indicator require")}else 0==i&&0==m.IndicatorTemplateList.length&&(m.errorMessage="Minimum one Template require");$("#SaveIndicatorTemplate",m.context).slideToggle()},m.saveIndicatorTemplate=function(){m.errorMessage="";var i=m.IndicatorTemplateName;if(0!=i.trim().length){var P=m.IndicatorTemplateList.filter(k=>k.Name.toUpperCase()==i.toUpperCase())[0];if(null==P||null==P){var _=m.currentSelectedPanel;m.IndicatorTemplateList.push({Name:i.toUpperCase(),IndicatorList:_.getIndicatorParams()}),m.saveIndicatorTemplateList()}else m.errorMessage="Template name already exists"}else m.errorMessage="Template name can not be blank"},m.CancelIndicatorTemplate=function(){$("#SaveIndicatorTemplate").slideUp()},m.overrightIndicatorTemplate=function(i){i.IndicatorList=m.currentSelectedPanel.getIndicatorParams(),m.saveIndicatorTemplateList(),m.indicatorTemplateDialog.dialog("close")},m.saveIndicatorTemplateList=function(){var i=JSON.stringify(m.IndicatorTemplateList);m.createCookie(a.xB.User.UserId+"_IndicatorTemplates",i)},m.deleteIndicatorTemplate=function(){m.confirmDelIndicatorTemplate()},m.confirmDelIndicatorTemplate=function(){for(var i=m.SelectedIndicatorTemplate.name,P=0;P<m.IndicatorTemplateList.length;P++)if(m.IndicatorTemplateList[P].name===i){m.IndicatorTemplateList.splice(P,1);break}m.saveIndicatorTemplateList()},m.loadIndicatorTemplate=function(i){var P=m.SelectedIndicatorTemplate.IndicatorList,_=m.currentSelectedPanel;_.deleteIndicators(null);for(var k=0;k<P.length;k++){let w=P[k];var Q,W=null,N=null;w.dataSources.length>=1&&(Q=m.IndiViewModal.DataSourceList1.filter(function(Z){return Z.id==w.dataSources[0]})).length>0&&(W=Q[0]),w.dataSources.length>=2&&(Q=m.IndiViewModal.DataSourceList1.filter(function(F){return F.id==w.dataSources[1]})).length>0&&(N=Q[0]);var H=m.IndiViewModal.IndicatorList.filter(function(Z){return Z.id==w.id}),V=_.addIndicator(H.length>0?H[0]:null,w,W,N);null!=V&&V.updateIndicatorId(w.indiID),m.IndiViewModal.updateDatasource1(_.indicatorList)}_.setDataRange(_,_.startIndex,_.endIndex)}},l.BasicView=function(p,h,o,u){var m=this;l.ChartView.call(m,l.ViewTypes.Basic,p,h,o),m.priceGraphTypeOptions=[{GraphId:T.e.GraphTypes.Line,GraphName:"Line",GraphType:T.e.GraphTypes.Line,GraphStyle:T.e.GraphStyles.Line,FillStyle:T.e.FillStyles.Solid,licenseType:3},{GraphId:T.e.GraphTypes.Candle,GraphName:"Candlestick",GraphType:T.e.GraphTypes.Candle,GraphStyle:T.e.GraphStyles.Candle,FillStyle:T.e.FillStyles.Solid,licenseType:3},{GraphId:T.e.GraphTypes.Area,GraphName:"Mountain",GraphType:T.e.GraphTypes.Area,GraphStyle:T.e.GraphStyles.Line,FillStyle:T.e.FillStyles.Solid,licenseType:2}],m.adjustadvChartContainer=function(){m.context=h,$("#_basicchartContainer",m.context);var P=$("#basicChart",m.context)[0],_=m.chartPanels[0];
1null!=_&&null!=_&&(_.context=P,_.adjustChartPanelView(u))},m.SelectedPriceGraphType="",m.changePriceGraph=function(){var e=m.SelectedPriceGraphType;m.currentSelectedPanel.chagePriceGraphType(e.GraphType,e.GraphStyle,e.FillStyle)}},l.BasicView.prototype=new l.ChartView,l.AdvancedView=function(p,h,o){var u=this;l.ChartView.call(u,l.ViewTypes.Advance,p,h,o),u.showControlPanels=!0,u.chartCursorViewOptions=[{CurName:"Vertical",CurValue:1},{CurName:"Horizontal",CurValue:2},{CurName:"Both",CurValue:3},{CurName:"None",CurValue:0}],u.priceGraphTypeOptions=[{GraphId:T.e.GraphTypes.Bar,GraphName:"Standard Bar Chart",GraphType:T.e.GraphTypes.Candle,GraphStyle:T.e.GraphStyles.Bar,FillStyle:T.e.FillStyles.Solid,licenseType:3},{GraphId:T.e.GraphTypes.Candle,GraphName:"Candlestick",GraphType:T.e.GraphTypes.Candle,GraphStyle:T.e.GraphStyles.Candle,FillStyle:T.e.FillStyles.Solid,licenseType:3},{GraphId:T.e.GraphTypes.Line,GraphName:"Line",GraphType:T.e.GraphTypes.Line,GraphStyle:T.e.GraphStyles.Line,FillStyle:T.e.FillStyles.Solid,licenseType:3},{GraphId:T.e.GraphTypes.Area,GraphName:"Mountain",GraphType:T.e.GraphTypes.Area,GraphStyle:T.e.GraphStyles.Line,FillStyle:T.e.FillStyles.Solid,licenseType:2}],u.chartSyncOptions=[{Name:"None",Value:0},{Name:"Scrip",Value:1},{Name:"Period",Value:2}],u.SelectedChartSyncType=null,u.SelectedIndicator=null,u.SelectedPriceGraphType="",u.SelectedViewOption=1,u.advChartGuideViewStyle=l.PointerGuideViewTypes.Normal,u.advChartGuideViewStyle=function(m){u.adjustadvChartContainer()},u.IndiViewModal=new l.IndicatorViewModal(o),u.changePriceGraph=function(m){u.SelectedPriceGraphType=m;var e=u.SelectedPriceGraphType;u.currentSelectedPanel.chagePriceGraphType(e.GraphType,e.GraphStyle,e.FillStyle)},u.adjustadvChartContainer=function(){var m=u.context.clientHeight,e=u.context.clientWidth,f=2*(1==u.showControlPanels?35:0),P=$("#advChartPanelsContainer",u.context)[0],_=m-(f+2
10);P.style.height=_+"px",P.style.width=e-176-24+"px";var N=$("#advChartGiude",u.context)[0];N.style.width="176px",N.style.height=_+"px";for(var Q=u.viewOptionPanelMap[u.currentViewModeIndex],H=0;H<Q.TotalPanels;H++){var w=$("#"+(Q.ViewModeIndex+1)+"-advChartPanel"+(H+1)+"-div",u.context)[0];if(null!=w&&null!=w){var Z=u.viewOptionPanelMap.filter(function(re){return u.currentViewModeIndex==re.ViewModeIndex}),F=u.chartPanels[(Z=Z[0]).panelList[H]];null!=F&&null!=F&&(F.context=w,F.adjustChartPanelView())}}}},l.AdvancedView.prototype=new l.ChartView,l.IndicatorPeriod=function(p){var h=this;h.hasInvalidValue=!1,h.validationMessage="",h.precision=p.precision,h.minval=p.minval,h.maxval=p.maxval,h.name=p.name,h.value=0==p.precision?parseInt(p.value):parseFloat(p.value)},l.IndicatorStyle=function(p){var h=this;h.name=p.name,h.style=p.style,h.color=p.color,h.enabled=p.enabled},l.DataSource=function(p){var h=this;h.name=p.name,h.id=p.id,h.parent=p.parent,h.parentId=p.parentId},l.IndicatorParams=function(p){var h=this;h.id=0,h.indiID=null,h.title="",h.dataSources=[],h.periods=[{name:"Period",value:8}],h.matype=null,h.panel=0,h.hLines=[],h.styles=[],h.inputErrorMsg="No Error...",h.hasInvalidInputs=!1,h.checkInvalidIputs=function(){h.hasInvalidInputs=!1;let o=[];for(let _=0;_<h.periods.length;_++){let k={};k=h.periods[_];var u=k.name;if(k.hasInvalidValue=!1,""!==k.value||(k.hasInvalidValue=!0,u="Value Cannot Be Blank"),!1===isNaN(k.value)){var m=0==k.precision?parseInt(k.value):parseFloat(k.value);(m<k.minval||m>k.maxval)&&(k.hasInvalidValue=!0,u=k.name+": value range is ["+k.minval+"-"+k.maxval+"].")}else k.hasInvalidValue=!0,u=k.name+" field can not be blank or zero.";if(n.IndicatorTypes.MACD==h.id&&0==k.hasInvalidValue){var e=parseInt(h.periods[0].value);parseInt(h.periods[1].value)>=e?(k.hasInvalidValue=!0,u="Short Cycle cannot be greater than or equal to Long Cycle"):k.hasInvalidValue=!1}k.validationMessage=u,o.push({hasInvalidInputs:k.hasInvalidValue,inputErrorMsg:k.validationMessage})}var i=[];if(o.length>0){for(var P=0;P<o.length;P++)1==o[P].hasInvalidInputs?(h.hasInvalidInputs=!0,i.push(o[P].inputErrorMsg)):h.hasInvalidInputs=!1;let _="";_=(i=i.filter(function(k,W,N){return N.indexOf(k)===W})).concat(" "),h.inputErrorMsg=_.toString().replace(/,/g," ")}},h.reset=function(){h.id=0,h.title="",h.dataSources.removeAll(),h.periods.splice(0,h.periods.length),h.matype=null,h.panel=0,h.hLines.removeAll(),h.styles.removeAll(),h.inputErrorMsg="No Error...",h.hasInvalidInputs=!1},h.loadParams_NotInUse=function(o){if(null!=o&&null!=o){if(h.id=o.id,h.title=null==o.title||"undefined"==o.title||null==o.title||""==o.title?o.defaultParams.title:o.title,h.dataSources.splice(0,h.dataSources.length),null==o.dataSources||"undefined"==o.dataSources||null==o.dataSources||""==o.dataSources)for(var u=0;u<o.defaultParams.dataSources.length;u++)h.dataSources.push(o.defaultParams.dataSources[u]);else for(u=0;u<o.dataSources.length;u++)h.dataSources.push(o.dataSources[u]);if(h.periods.splice(0,h.periods.length),null==o.dataSources||"undefined"==o.dataSources||null==o.dataSources||""==o.dataSources)for(u=0;u<o.defaultParams.periods.length;u++)h.periods.push(new l.IndicatorPeriod(o.defaultParams.periods[u]));else for(u=0;u<o.periods.length;u++)h.periods.push(new l.IndicatorPeriod(o.periods[u]));if(h.matype=o.matype,h.panel=o.panel,h.hLines.splice(0,h.hLines.length),null==o.hLines||"undefined"==o.hLines||null==o.hLines||""==o.hLines)for(u=0;u<o.hLines;u++)h.hLines.push(parseFloat(o.hLines[u]));else for(u=0;u<o.hLines;u++)h.hLines.push(parseFloat(o.hLines[u]));if(h.styles.splice(0,h.styles.length),null==o.styles||"undefined"==o.styles||null==o.styles||""==o.styles)for(u=0;u<o.styles;u++)h.styles.push(new l.IndicatorStyle(o.styles[u]));else for(u=0;u<o.styles;u++)h.styles.push(new l.IndicatorStyle(o.styles[u]));h.inputErrorMsg="No Error...",h.hasInvalidInputs=!1}},h.loadParamsEdit=function(o){if(null!=o&&null!=o){if(h.id=o.indicatorParams.id,h.title=null==o.title||"undefined"==o.title||null==o.title||""==o.title?o.indicatorParams.title:o.title,h.dataSources.splice(0,h.dataSources.length),null==o.dataSources||"undefined"==o.dataSources||null==o.dataSources||""==o.dataSources)for(var u=0;u<o.indicatorParams.dataSources.length;u++)h.dataSources.push(o.indicatorParams.dataSources[u]);else for(u=0;
1u<o.dataSources.length;u++)h.dataSources.push(o.dataSources[u]);if(h.periods.splice(0,h.periods.length),null==o.dataSources||"undefined"==o.dataSources||null==o.dataSources||""==o.dataSources)for(u=0;u<o.indicatorParams.periods.length;u++)h.periods.push(new l.IndicatorPeriod(o.indicatorParams.periods[u]));else for(u=0;u<o.periods.length;u++)h.periods.push(new l.IndicatorPeriod(o.periods[u]));if(h.matype=o.matype,h.panel=o.panel,h.hLines.splice(0,h.hLines.length),null==o.hLines||"undefined"==o.hLines||null==o.hLines||""==o.hLines)for(u=0;u<o.hLines;u++)h.hLines.push(parseFloat(o.hLines[u]));else for(u=0;u<o.hLines;u++)h.hLines.push(parseFloat(o.hLines[u]));if(h.styles.splice(0,h.styles.length),null==o.indicatorParams.styles||"undefined"==o.indicatorParams.styles||null==o.indicatorParams.styles||""==o.indicatorParams.styles)for(u=0;u<o.indicatorParams.styles.length;u++)h.styles.push(new l.IndicatorStyle(o.indicatorParams.styles[u]));else for(u=0;u<o.indicatorParams.styles.length;u++)h.styles.push(new l.IndicatorStyle(o.indicatorParams.styles[u]));h.inputErrorMsg="No Error...",h.hasInvalidInputs=!1}},h.loadParams=function(o){if(null!=o&&null!=o){h.id=o.id,h.title=o.title,h.dataSources.splice(0,h.dataSources.length);for(var u=0;u<o.dataSources.length;u++)h.dataSources.push(o.dataSources[u]);for(h.periods.splice(0,h.periods.length),u=0;u<o.periods.length;u++)h.periods.push(new l.IndicatorPeriod(o.periods[u]));for(h.matype=o.matype,h.panel=o.panel,h.hLines.splice(0,h.hLines.length),u=0;u<o.hLines.length;u++)h.hLines.push(parseFloat(o.hLines[u]));for(h.styles.splice(0,h.styles.length),u=0;u<o.styles.length;u++)h.styles.push(new l.IndicatorStyle(o.styles[u]));h.inputErrorMsg="No Error...",h.hasInvalidInputs=!1}},h.removeHLinePoint=function(o){var u=h.hLines.indexOf(o);h.hLines.splice(u,1)},h.addHLinePoint=function(o){h.hLines.length<5?(h.hLines.push(o),h.hLines.sort(function(u,m){return parseFloat(u)==parseFloat(m)?0:parseFloat(u)<parseFloat(m)?-1:1})):alert("More than 5 horizontal lines are not allowed.")},h.getJSONStr=function(){return JSON.parse(h)},h.getJSObj=function(){return h},h.loadParams(p)},l.Indicator=function(p,h,o,u,m,e){var f=this;f.indiID=(100+o).toString(),f.sequenceNo=o,f.serialNo=u,f.indicatorParams=p,f.scripData=h,f.datasrc=null,f.datasrc2=null,f.IndicatorObj=null,f.IndicatorData=[],f.Graphs=[],f.parentIndicators=[],f.childIndicators=[],f.DisplayName="",f.updateIndicatorId=function(i){f.indiID=i,f.indicatorParams.indiID=i},f.setDisplayName=function(){var i="";null!=f.IndicatorObj&&null!=f.IndicatorObj&&(i=String.Format("{0}{1}",f.IndicatorObj.name,f.serialNo>1?"-"+f.serialNo:"")),f.DisplayName=i},f.getDataSourceArray=function(i){var P=null;if(null!=i)if(i.id<=5)switch(i.id){case n.IndicatorSources.Open:P=f.scripData.Open;break;case n.IndicatorSources.High:P=f.scripData.High;break;case n.IndicatorSources.Low:P=f.scripData.Low;break;case n.IndicatorSources.Close:P=f.scripData.Close;break;case n.IndicatorSources.Volume:P=f.scripData.Volume;break;default:P=f.scripData.Close}else P=i.parent;else P=f.scripData.Close;return P},f.updateDataSources=function(i){var P=!1;switch(f.indicatorParams.id){case n.IndicatorTypes.SimpleMovingAverage:case n.IndicatorTypes.ExponentialMovingAverage:case n.IndicatorTypes.RelativeStrengthIndex:case n.IndicatorTypes.MACD:case n.IndicatorTypes.PriceROC:f.indicatorParams.dataSources[0]!=i[0].id&&(f.datasrc=f.getDataSourceArray(i[0]),P=!0,f.indicatorParams.dataSources[0]=i[0].id);break;case n.IndicatorTypes.Stochastics:break;case n.IndicatorTypes.BollingerBands:f.indicatorParams.dataSources[0]!=i[0].id&&(f.datasrc=f.getDataSourceArray(i[0]),P=!0,f.indicatorParams.dataSources[0]=i[0].id);break;case n.IndicatorTypes.ParabolicSAR:case n.IndicatorTypes.WeightedClose:case n.IndicatorTypes.TrueRange:case n.IndicatorTypes.ADX:break;case n.IndicatorTypes.TRIX:f.indicatorParams.dataSources[0]!=i[0].id&&(f.datasrc=f.getDataSourceArray(i[0]),P=!0,f.indicatorParams.dataSources[0]=i[0].id)}return P},f.updateMAType=function(i){var P=!1;switch(f.indicatorParams.id){case n.IndicatorTypes.Stochastics:case n.IndicatorTypes.MACD:case n.IndicatorTypes.BollingerBands:case n.IndicatorTypes.StandardDeviations:f.indicatorParams.matype!=i&&(P=!0,f.indicatorParams.matype=i,f.IndicatorObj.updateMAType(i))}return P},f.getIndicatorObj=function(){null!=m&&m.id>100&&(f.indicatorParams.dataSources[0]=m.id);var i=f.indicatorParams.periods,P=f.indicatorParams.styles,_=f.indicatorParams.matype;switch(p.id){case n.IndicatorTypes.SimpleMovingAverage:f.IndicatorObj=new n.SimpleMovingAverage(parseInt(i[0].value)),f.datasrc=f.getDataSourceArray(m);var k=f.IndicatorObj.calcIndicator(f.datasrc);f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.ExponentialMovingAverage:f.IndicatorObj=new n.ExponentialMovingAverage(parseInt(i[0].value)),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.RelativeStrengthIndex:f.IndicatorObj=new n.RelativeStrengthIndex(parseInt(i[0].value)),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.MACD:f.IndicatorObj=new n.MACD(parseInt(i[0].value),parseInt(i[1].value),parseInt(i[2].value),_),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc);for(var W=0;W<P.length;W++)f.IndicatorData.push({name:P[W].name,color:P[W].color,data:k[W]});break;case n.IndicatorTypes.PriceROC:f.IndicatorObj=new n.PriceROC(parseInt(i[0].value)),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.Stochastics:for(f.IndicatorObj=new n.StochasticOscillator(parseInt(i[0].value),parseInt(i[1].value),parseInt(i[2].value),_),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[W].name,color:P[W].color,data:k[W]});break;case n.IndicatorTypes.BollingerBands:for(f.IndicatorObj=new n.BollingerBand(parseInt(i[0].value),parseFloat(i[1].value),_),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[W].name,color:P[W].color,data:k[W]});break;case n.IndicatorTypes.ParabolicSAR:for(f.IndicatorObj=new n.ParabolicSAR(parseFloat(i[0].value),parseFloat(i[1].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.WeightedClose:f.IndicatorObj=new n.WeigthedClose,f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.TrueRange:f.IndicatorObj=new n.TrueRange,f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.ADX:for(f.IndicatorObj=new n.ADX(parseInt(i[0].value),parseInt(i[1].value),parseInt(i[2].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[W].name,color:P[W].color,data:k[W]});break;case n.IndicatorTypes.TRIX:f.IndicatorObj=new n.Trix(parseInt(i[0].value)),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.ATR:f.IndicatorObj=new n.AverageTrueRange(parseInt(i[0].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.SuperTrend:f.IndicatorObj=new n.SuperTrend(parseInt(i[0].value),parseFloat(i[1].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.StandardDeviations:f.IndicatorObj=new n.StandardDeviation(parseInt(i[0].value)),f.datasrc=f.getDataSourceArray(m),k=f.IndicatorObj.calcIndicator(f.datasrc),f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.TrueStrengthIndex:for(f.IndicatorObj=new n.TrueStrengthIndex(parseInt(i[0].value),parseInt(i[1].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.WilliamsR:for(f.IndicatorObj=new n.WilliamsR(parseInt(i[0].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]});break;case n.IndicatorTypes.MoneyFlowIndex:for(f.IndicatorObj=new n.MoneyFlowIndex(parseInt(i[0].value)),f.datasrc=f.scripData,k=f.IndicatorObj.calcIndicator(f.datasrc),W=0;W<P.length;W++)f.IndicatorData.push({name:P[0].name,color:P[0].color,data:k[0]})}f.setDisplayName()},f.clearData=function(){f.IndicatorObj.reset(null,!1);for(var i=0;i<f.IndicatorData.length;i++){var P=f.IndicatorData[i];P.data.splice(0,P.data.length)}},f.addIntraDayTick=function(i){var P;if(null!=(P=f.scripData!=f.datasrc?f.IndicatorObj.addIntraDayTick(f.datasrc[i]):f.IndicatorObj.addIntraDayTick(f.scripData.Open[i],f.scripData.High[i],f.scripData.Low[i],f.scripData.Close[i],f.scripData.
1Volume[i])))for(var _=0;_<P.length;_++)f.IndicatorData[_].data.push(P[_])},f.reloadScripData=function(){for(var i=f.IndicatorObj.calcIndicator(f.datasrc),P=0;P<f.IndicatorData.length;P++)try{f.IndicatorData[P].data.splice(0),f.IndicatorData[P].data.push.apply(f.IndicatorData[P].data,i[P])}catch(_){}},f.addHLineDrawHandler=function(){f.Graphs[0].Graph.onbeforedraw=f.drawHorizontalLines},f.drawHorizontalLines=function(){var i=f.Graphs[0].Graph,P=i.chart.ctx,_=P.strokeStyle,k=P.lineWidth;P.strokeStyle="rgba(255,255,255,1)",P.lineWidth=.25;for(var N=0;N<f.indicatorParams.hLines.length;N++){var Q=i.chart.chartRect.x,H=i.chart.chartRect.getRight(),V=i.vertAxis.calc(f.indicatorParams.hLines[N]);V>=i.vertAxis.startPos&&V<=i.vertAxis.endPos&&(P.moveTo(Q,V),P.lineTo(H,V))}P.stroke(),P.strokeStyle=_,P.lineWidth=k},f.getIndicatorName=function(){var i=[];f.indicatorParams.periods.forEach(function(_){i.push(_.value)});var P=String.Format("({0})",i.join(" "));return String.Format("{0} {1}",f.DisplayName,i.length>0?P:"")},f.getHeaderData=function(){var i=[];return i.push(""),f.Graphs.forEach(function(P){i.push(P.Graph.title)}),i.join(",")},f.getRowData=function(i){var P=[];return P.push(""),f.IndicatorData.forEach(function(_){P.push(null!=_.data[i]?_.data[i]:"NULL")}),P.join(",")},f.updatePeriods=function(i){let P;if(null!=f.indicatorParams.periods&&null!=f.indicatorParams.periods){for(var _=0;_<f.indicatorParams.periods.length;_++)P|=Number(f.indicatorParams.periods[_].value!=i[_].value);P&&(f.indicatorParams.periods=i,f.IndicatorObj.updatePeriods(i))}return P},f.getIndicatorObj()},l.IndicatorViewModal=function(p){var h=this;h.AllIndicatorList=[],h.AllMATypeList=[],h.IndicatorList=[],h.DataSourceList1=[],h.DataSourceList2=[],h.MATypeList=[],h.PanelList=[],h.hLinesErrorMessage="",h.isHlineError=!1,h.AllLineStyleList=[],h.LineStyleList=[],h.hLinePoint="",h.isEditing=!1,h.isDelOnCancel=!1,h.isDDirt
1yIndicator=!1,h.SelectedDataSource1={},h.SelectedDataSource2="",h.fn_SelectedIndicator=function(o){h.SelectedIndicatorParams=new l.IndicatorParams;var u=o.defaultParams.getJSObj();if(h.SelectedIndicatorParams.loadParams(u),h.SelectedIndicatorParams.matype=h.MATypeList.filter(function(f){return 1==f.id})[0],u.dataSources.length>0){var m=h.DataSourceList1.filter(function(f){return null!=f&&f.id==o.defaultParams.dataSources[0]});h.SelectedDataSource1=m[0];var e=h.DataSourceList2.filter(function(f){return null!=f&&f.id==o.defaultParams.dataSources[0]});h.SelectedDataSource2=e}h.hLinePoint="",h.LineStyleList=h.AllLineStyleList.filter(function(f){return 9!=f.id||o.hasHistogram})},h.isIndicatorAdded=!1,h.isIndicatorEdited=!1,h.resetDialogHeight=function(){var o=$("#advChartIndicatorDialog-div");if(null!=o&&null!=o){o=o[0];var u=$("#IndicatorSettings")[0];null!=u&&null!=u&&(u.style.height=o.clientHeight+16+"px")}},h.SelectedIndicatorParams=new l.IndicatorParams,h.AllIndicatorList.push({id:n.IndicatorTypes.SimpleMovingAverage,name:"Simple Moving Average",hasSource:!0,hasPeriods:!0,hasMAType:!1,hasHLines:!1,hasStyle:!0,hasHistogram:!1,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 1, "title": "Simple Moving Average", "dataSources": [4], "periods": [{"name": "Period", "value": 8, "precision": 0, "minval": 1, "maxval": 9999}], "matype": null, "panel": 0, "hLines": [], "styles": [{"name": "SMA", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.ExponentialMovingAverage,name:"Exponential Moving Average",hasSource:!0,hasPeriods:!0,hasMAType:!1,hasHLines:!1,hasStyle:!0,hasHistogram:!1,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 2, "title": "Exponential Moving Average", "dataSources": [4], "periods": [{"name": "Period", "value": 8, "precision": 0, "minval": 1, "maxval": 9999}], "matype": null, "panel": 0, "hLines": [], "styles": [{"name": "EMA", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.RelativeStrengthIndex,name:"Relative Strength Index",hasSource:!0,hasPeriods:!0,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 3, "title": "Relative Strength Index", "dataSources": [4], "periods": [{"name": "Period", "value": 14, "precision": 0, "minval": 1, "maxval": 9999}], "matype": null, "panel": 99, "hLines": [30.00, 70.00], "styles": [{"name": "RSI", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.MACD,name:"MACD",hasSource:!1,hasPeriods:!0,hasMAType:!0,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 4, "title": "MACD", "dataSources": [0], "periods": [{"name": "Long Cycle", "value": 26, "precision": 0, "minval": 1, "maxval": 9999}, {"name": "Short Cycle", "value": 13, "precision": 0, "minval": 1, "maxval": 9999}, {"name": "Signal Period", "value": 9, "precision": 0, "minval": 1, "maxval": 9999}], "matype": 1, "panel": 99, "hLines": [0.00], "styles": [{"name": "MACD", "style": 1, "color": "#00FF00", "enabled": true}, {"name": "MACD SIG", "style": 2, "color": "#FF0000", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.PriceROC,name:"Price Rate of Change",hasSource:!0,hasPeriods:!0,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 5, "title": "Price Rate of Change", "dataSources": [4], "periods": [{"name": "Period", "value": 10, "precision": 0, "minval": 1, "maxval": 9999}], "matype": null, "panel": 99, "hLines": [0.00], "styles": [{"name": "P-ROC", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.Stochastics,name:"Stochastic Oscillator",hasSource:!1,hasPeriods:!0,hasMAType:!0,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 6, "title": "Stochastics", "dataSources": [0], "periods": [{"name": "% K Period", "value": 5, "precision": 0, "minval": 1, "maxval": 9999}, {"name": "% K Slowing", "value": 3, "precision": 2, "minval": 1, "maxval": 9999}, {"name": "% D Period", "value": 3, "precision": 0, "minval": 1, "maxval": 9999}], "matype": 1, "panel": 99, "hLines": [20.00, 80.00], "styles": [{"name": "%D", "style": 1, "color": "#00FF00", "enabled": true}, {"name": "%K", "style": 1, "color": "#FF0000", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.BollingerBands,name:"Bollinger Bands",hasSource:!0,hasPeriods:!0,hasMAType:!0,hasHLines:!1,hasStyle:!0,hasHistogram:!1,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 7, "title": "Bollinger Band", "dataSources": [4], "periods": [{"name": "Period", "value": 20, "precision": 0, "minval": 1, "maxval": 9999}, {"name": "Std. Deviation", "value": "2.00", "precision": 2, "minval": 1, "maxval": 10}], "matype": 1, "panel": 0, "hLines": [], "styles": [{"name": "BBM", "style": 1, "color": "#FFFFFF", "enabled": true}, {"name": "BB-Up", "style": 1, "color": "#00FF00", "enabled": true}, {"name": "BB-Dn", "style": 1, "color": "#FF0000", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.ParabolicSAR,name:"Parabolic SAR",hasSource:!1,hasPeriods:!0,hasMAType:!1,hasHLines:!1,hasStyle:!0,hasHistogram:!1,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 8, "title": "Parabolic SAR", "dataSources": [0], "periods": [{"name": "Min AF", "value": 0.02, "precision": 2, "minval": 0, "maxval": 9999}, {"name": "Max AF", "value": 0.2, "precision": 1, "minval": 0, "maxval": 9999}], "matype": null, "panel": 0, "hLines": [], "styles": [{"name": "P-SAR", "style": 1, "color": "#00FF00", "enabled": false}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.WeightedClose,name:"Weighted Close",hasSource:!1,hasPeriods:!1,hasMAType:!1,hasHLines:!1,hasStyle:!0,hasHistogram:!1,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 9, "title": "Weigthed Close", "dataSources": [0], "periods": [], "matype": null, "panel": 0, "hLines": [], "styles": [{"name": "W Close", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.TrueRange,name:"True Range",hasSource:!1,hasPeriods:!1,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 10, "title": "True Range", "dataSources": [0], "periods": [], "matype": null, "panel": 99, "hLines": [], "styles": [{"name": "True R", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.ADX,name:"Directional Movement System",hasSource:!1,hasPeriods:!0,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:2,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 11, "title": "ADX", "dataSources": [0], "periods": [{"name": "Period ", "value": 8, "precision": 0, "minval": 1, "maxval": 99}, {"name": "DI- Period ", "value": 8, "precision": 0, "minval": 1, "maxval": 99}, {"name": "DI+ Period ", "value": 8, "precision": 0, "minval": 1, "maxval": 99}], "matype": null, "panel": 99, "hLines": [], "styles": [{"name": "ADX", "style": 1, "color": "#FFFFFF", "enabled": true}, {"name": "DI+", "style": 1, "color": "#00FF00", "enabled": true}, {"name": "DI-", "style": 1, "color": "#FF0000", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.TRIX,name:"Trix",hasSource:!0,hasPeriods:!0,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasHistogram:!1,hasVolume:!1,licenseType:2,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 12, "title": "TRIX", "dataSources": [4], "periods": [{"name": "Period", "value": 8, "precision": 0, "minval": 2, "maxval": 9999}], "matype": null, "panel": 99, "hLines": [0.00], "styles": [{"name": "TRIX", "style": 1, "color": "#00FF00", "enabled": false}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.ATR,name:"ATR",hasSource:!1,hasPeriods:!0,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasHistogram:!0,hasVolume:!1,licenseType:2,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 13, "title": "ATR", "dataSources": [0], "periods": [{"name": "Period", "value": 14, "precision": 0, "minval": 1, "maxval": 9999}], "matype": null, "panel": 99, "hLines": [], "styles": [{"name": "ATR", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.SuperTrend,name:"Super Trend",hasSource:!1,hasPeriods:!0,hasMAType:!1,hasHLines:!1,hasStyle:!0,hasVolume:!1,licenseType:2,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 14, "title": "Super Trend", "dataSources": [0], "periods": [{"name": "Period", "value": 14, "precision": 0, "minval": 2, "maxval": 9999}, {"name": "Multipliers", "value": "1.50", "precision": 2, "minval": 1, "maxval": 99}], "matype": null, "panel": 0, "hLines": [], "styles": [{"name": "Super Trend", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.MoneyFlowIndex,name:"Money Flow Index",hasSource:!1,hasPeriods:!0,hasMAType:!1,hasHLines:!0,hasStyle:!0,hasVolume:!0,licenseType:2,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 17, "title": "Money Flow Index", "dataSources": [0], "periods": [{"name": "Period", "value": 8, "precision": 0, "minval": 0, "maxval": 9999}], "matype": null, "panel": 99, "hLines": [20.00,80.00], "styles": [{"name": "MFI", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.AllIndicatorList.push({id:n.IndicatorTypes.StandardDeviations,name:"Standard Deviations",hasSource:!0,hasPeriods:!0,hasMAType:!0,hasHLines:!1,hasStyle:!0,hasVolume:!1,licenseType:3,defaultParams:new l.IndicatorParams(JSON.parse('{"id": 18, "title": "Standard Deviations", "dataSources": [4], "periods": [{"name": "Period", "value": "10.00", "precision": 2, "minval": 2, "maxval": 99}], "matype": 1, "panel": 99, "hLines": [], "styles": [{"name": "STD DEV", "style": 1, "color": "#00FF00", "enabled": true}]}'))}),h.DataSourceList1.push({id:1,name:"Open",parent:null}),h.DataSourceList1.push({id:2,name:"High",parent:null}),h.DataSourceList1.push({id:3,name:"Low",parent:null}),h.DataSourceList1.push({id:4,name:"Close",parent:null}),h.DataSourceList1.push({id:5,name:"Volume",parent:null}),h.AllMATypeList.push({id:1,name:"Simple"}),h.AllMATypeList.push({id:2,name:"Exponential"}),h.MATypeList.push({id:1,name:"Simple"}),h.MATypeList.push({id:2,name:"Exponential"}),h.PanelList.push({id:0,name:"0"}),h.PanelList.push({id:1,name:"1"}),h.PanelList.push({id:99,name:"New"}),h.AllLineStyleList.push({id:1,name:"Solid"}),h.AllLineStyleList.push({id:2,name:"Dot"}),h.AllLineStyleList.push({id:3,name:"Dash"}),h.AllLineStyleList.push({id:4,name:"DashDot"}),h.AllLineStyleList.push({id:9,name:"Histogram"}),h.AllIndicatorList.sort(function(o,u){return o.name==u.name?0:o.name<u.name?-1:1}),h.IndicatorList=h.AllIndicatorList.filter(function(o){return p==(p&o.licenseType)}),h.reset=function(o,u){h.isEditing(u),h.SelectedIndicator=null==o||null==o?h.IndicatorList[0]:o,h.hLinePoint(0),h.isIndicatorAdded(!1)},h.updatePanelList=function(o){h.PanelList.splice(0,h.PanelList.length);for(var u=0;u<o.length;u++)h.PanelList.push({id:o[u].GPanelId,name:o[u].GPanelId});h.PanelList.push({id:99,name:"New"})},h.updateDatasource1=function(o,u){if(h.DataSourceList1.filter(function(N){return N.id>5}),o.length>0)for(var e=0;e<o.length;e++)for(var f=o[e],i=0;i<f.Graphs.length;i++){var P=f.Graphs[i],_=f.indiID,k=(i+1).toString(),W=parseInt(_+Array(4-k.length).join("0")+k);h.DataSourceList1.push({id:W,name:P.Graph.title,parent:P.graphData,parentId:f.sequenceNo})}},h.loadDataSources=function(){h.SelectedIndicatorParams.dataSources.length>=1&&(h.SelectedDataSource1=h.DataSourceList1.filter(function(o){return o.id==h.SelectedIndicatorParams.dataSources[0]})[0]),h.SelectedIndicatorParams.dataSources.length>=2&&(h.SelectedDataSource2=h.DataSourceList1.filter(function(o){return o.id==h.SelectedIndicatorParams.dataSources[1]})[0])},h.loadColorPicker=function(o,u,m){$("#"+u+"-clpicker").spectrum({preferredFormat:"hex",color:m.color(),theme:"sp-dark"})},h.addHLinePoint=function(o){""!=o.trim()?(o=parseFloat(o.trim()),h.isHlineError=!1,o>
1=-1e8&&o<=1e8?-1==h.SelectedIndicatorParams.hLines.indexOf(o)?(h.SelectedIndicatorParams.addHLinePoint(o),h.isHlineError=!1,h.hLinePoint=""):(h.hLinesErrorMessage="Line is already exist...",h.isHlineError=!0):(h.hLinesErrorMessage="Line value can be in range of [-100000000 to 100000000] only",h.isHlineError=!0,h.hLinePoint="")):(h.hLinesErrorMessage="Empty value is not allowed...",h.isHlineError=!0)},h.removeHLinePoint=function(o){h.SelectedIndicatorParams.removeHLinePoint(o)}},Date.dateDiffInDays=function(p,h){var o=Date.UTC(p.getFullYear(),p.getMonth(),p.getDate()),u=Date.UTC(h.getFullYear(),h.getMonth(),h.getDate());return Math.floor((u-o)/864e5)},String.Format=function(p,h){return String._toFormattedString(!1,arguments)},String._toFormattedString=function(h,o){for(var u="",m=o[0],e=0;;){var f=m.indexOf("{",e),i=m.indexOf("}",e);if(f<0&&i<0){u+=m.slice(e);break}if(i>0&&(i<f||f<0))u+=m.slice(e,i+1),e=i+2;else if(u+=m.slice(e,f),"{"!==m.charAt(e=f+1)){var P=m.substring(e,i),_=P.indexOf(":"),k=parseInt(_<0?P:P.substring(0,_),10)+1,W=_<0?"":P.substring(_+1),N=o[k];null==N&&(N=""),u+=N.toFormattedString?N.toFormattedString(W):h&&N.localeFormat?N.localeFormat(W):N.format?N.format(W):N.toString(),e=i+1}else u+="{",e++}return u},String.prototype.Format=function(){var p=new Array;p.push(this);for(var h=0;h<arguments.length;h++)p.push(arguments[h]);return String._toFormattedString(!1,p)}},372:(je,ke,x)=>{x.d(ke,{m:()=>Kt});var a=x(1705),T=x(2774),G=x(3627),n=x(8407),l=x(2741),g=x(823),b=x(3045),p=x(3324),h=x(6274),o=x(9018),u=x(7617),m=x(688),e=x(6228),f=x(7915),i=x(328);function P(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"mat-option",24),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275property("value",y),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.name)}}function _(ee,ve){1&ee&&l.\u0275\u0275element(0,"div")}function k(ee,ve){if(1&ee&&l.\u0275\u0275element(0,"span",26),2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275property("matTooltip",y.inputErrorMsg+y.chartView.errMessage)}}function W(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",11),l.\u0275\u0275elementStart(1,"label"),l.\u0275\u0275text(2),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(3,"mat-form-field"),l.\u0275\u0275elementStart(4,"input",25),l.\u0275\u0275listener("ngModelChange",function(se){return l.\u0275\u0275restoreView(y).$implicit.value=se})("blur",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().checkInvalidIputs()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(5,k,1,1,"span",17),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit,B=l.\u0275\u0275nextContext();l.\u0275\u0275advance(2),l.\u0275\u0275textInterpolate(y.name),l.\u0275\u0275advance(2),l.\u0275\u0275propertyInterpolate("placeholder",y.name),l.\u0275\u0275property("ngModel",y.value),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",B.hasInvalidInputs)}}function N(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"mat-option",24),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275property("value",y),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.name)}}function Q(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"mat-option",24),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275property("value",y.id),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.name)}}function H(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"mat-option",24),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275property("value",y.id),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",y.name," ")}}function V(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",27),l.\u0275\u0275elementStart(1,"div",11),l.\u0275\u0275element(2,"label",28),l.\u0275\u0275elementStart(3,"mat-form-field"),l.\u0275\u0275elementStart(4,"mat-select",29),l.\u0275\u0275listener("ngModelChange",function(se){return l.\u0275\u0275restoreView(y).$implicit.style=se}),l.\u0275\u0275template(5,H,2,2,"mat-option",5),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(6,"span"),l.\u0275\u0275elementStart(7,"input",30),l.\u0275\u0275listener("colorPickerChange",function(se){return l.\u0275\u0275restoreView(y).$implicit.color=se}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit,B=l.\u0275\u0275nextContext();l.\u0275\u0275advance(2),l.\u0275\u0275property("innerHTML",y.name,l.\u0275\u0275sanitizeHtml),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngModel",y.style),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.LineStyleList),l.\u0275\u0275advance(2),l.\u0275\u0275styleProp("background",y.color),l.\u0275\u0275property("colorPicker",y.color)}}function w(ee,ve){if(1&ee&&l.\u0275\u0275element(0,"span",26),2&ee){const y=l.\u0275\u0275nextContext();l.\u0275\u0275property("matTooltip",y.chartView.IndiViewModal.hLinesErrorMessage)}}function Z(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"li"),l.\u0275\u0275element(1,"span",28),l.\u0275\u0275elementStart(2,"input",31),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext().chartView.IndiViewModal.removeHLinePoint(_e)}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit;l.\u0275\u0275advance(1),l.\u0275\u0275property("innerHTML",y,l.\u0275\u0275sanitizeHtml)}}let F=(()=>{class ee{constructor(){this.color="#2889e9",this.context="",this.closeDialog=new l.EventEmitter,this.hasInvalidInputs=!1,this.inputErrorMsg="",this.edited=!1}ngOnInit(){try{null!=this.context.params&&(this.context.params.addIndicator?(this.selectedIndicator=this.context.params.selectedIndicator,this.chartView=this.context.params.chartView,this.chartView.IndiViewModal.isEditing=!1,this.chartView.IndiViewModal.fn_SelectedIndicator(this.context.params.selectedIndicator)):(this.selectedIndicator=this.context.params.selectedIndicator,this.chartView=this.context.params.chartView,this.chartView.SelectedIndicator=this.selectedIndicator,this.chartView.ToggleIndicatorSettings(!0,!1)))}catch(y){}}closeIndicatorSettings(y){this.hasInvalidInputs||(this.chartView.closeIndicatorSettings(y),this.closeDialog.emit({chartView:this.chartView}))}checkInvalidIputs(){this.chartView.IndiViewModal.SelectedIndicatorParams.checkInvalidIputs(),this.hasInvalidInputs=this.chartView.IndiViewModal.SelectedIndicatorParams.hasInvalidInputs,this.inputErrorMsg=this.chartView.IndiViewModal.SelectedIndicatorParams.inputErrorMsg}test(y){}changeIndicatordatasource(){this.chartView.IndiViewModal.SelectedIndicatorParams.dataSources[0]=this.chartView.IndiViewModal.SelectedDataSource1.id}}return ee.\u0275fac=function(y){return new(y||ee)},ee.\u0275cmp=l.\u0275\u0275defineComponent({type:ee,selectors:[["indicator"]],inputs:{context:"context"},outputs:{closeDialog:"closeDialog"},decls:54,vars:28,consts:[["id","advChartIndicatorDialog-div",1,"indicator-wrap"],[1,"indicator"],[1,"indicator-left"],[1,"input-bu-block-wrap",3,"hidden"],["disableOptionCentering","true","placeholder","Data Sources",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"hidden"],[4,"ngFor","ngForOf"],["class","input-bu-block-wrap",4,"ngFor","ngForOf"],["ng-show","chartView.IndiViewModal.SelectedIndicator.hasMAType",1,"input-bu-block-wrap"],["disableOptionCentering","true",3,"ngModel","ngModelChange"],[1,"input-bu-block-wrap"],["disableOptionCentering","true","placeholder","Panel",3,"ngModel","ngModelChange"],[1,"gr-style-sec",3,"hidden"],[1,"gp-title"],["class","gr-style-wrap",4,"ngFor","ngForOf"],["matInput","","type","text",3,"ngModel","ngModelChange"],["class","btn-erroricon",3,"matTooltip",4,"ngIf"],["mat-raised-button","","type","button","value","Add",1,"btn","btn-black","btn-addscript",3,"disabled","click"],[1,"ind-h-lines"],[1,"clear"],[1,"button-box","marginBtm5"],["mat-raised-button","","value","Cancel",1,"btn","btn-black","marginR-10",3,"disabled","click"],["mat-raised-button","","value","Cancel",1,"btn","btn-black",3,"click"],[3,"value"],["matInput","","type","text",3,"placeholder","ngModel","ngModelChange","blur"],[1,"btn-erroricon",3,"matTooltip"],[1,"gr-style-wrap"],[3,"innerHTML"],["disableOptionCentering","true","placeholder","Line Style",3,"ngModel","ngModelChange"],[2,"width","40px",3,"colorPicker","colorPickerChange"],["type","button","title","Delete",1,"ind-h-close",3,"click"]],template:function(y,B){1&y&&(l.\u0275\u0275elementStart(0,"div",0),l.\u0275\u0275elementStart(1,"div",1),l.\u0275\u0275elementStart(2,"div",2),l.\u0275\u0275elementStart(3,"ul"),l.\u0275\u0275elementStart(4,"li",3),l.\u0275\u0275elementStart(5,"label"),l.\u0275\u0275text(6,"Data Sources"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(7,"mat-form-field"),l.\u0275\u0275elementStart(8,"mat-select",4),l.\u0275\u0275listener("ngModelChange",function(_e){return B.chartView.IndiViewModal.SelectedDataSource1=_e})("selectionChange",function(){return B.changeIndicatordatasource()}),l.\u0275\u0275template(9,P,2,2,"mat-option",5),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(10,"li",6),l.\u0275\u0275template(11,_,1,0,"div",7),l.\u0275\u0275elementStart(12,"div"),l.\u0275\u0275template(13,W,6,4,"div",8),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(14,"li",6),l.\u0275\u0275elementStart(15,"div",9),l.\u0275\u0275elementStart(16,"label"),l.\u0275\u0275text(17,"MA Type"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(18,"mat-form-field"),l.\u0275\u0275elementStart(19,"mat-select",10),l.\u0275\u0275listener("ngModelChange",function(_e){return B.chartView.IndiViewModal.SelectedIndicatorParams.matype=_e}),l.\u0275\u0275template(20,N,2,2,"mat-option",5),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(21,"li",11),l.\u0275\u0275elementStart(22,"label"),l.\u0275\u0275text(23,"Panel"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(24,"mat-form-field"),l.\u0275\u0275elementStart(25,"mat-select",12),l.\u0275\u0275listener("ngModelChange",function(_e){return B.chartView.IndiViewModal.SelectedIndicatorParams.panel=_e}),l.\u0275\u0275template(26,Q,2,2,"mat-option",5),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(27,"li",13),l.\u0275\u0275elementStart(28,"label",14),l.\u0275\u0275text(29,"Graph Styles"),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(30,V,8,6,"div",15),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(31,"li",3),l.\u0275\u0275elementStart(32,"label"),l.\u0275\u0275text(33,"Horizontal Lines"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(34,"mat-form-field"),l.\u0275\u0275elementStart(35,"input",16),l.\u0275\u0275listener("ngModelChange",function(_e){return B.chartView.IndiViewModal.hLinePoint=_e}),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(36,w,1,1,"span",17),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(37,"button",18),l.\u0275\u0275listener("click",function(){return B.chartView.IndiViewModal.addHLinePoint(B.chartView.IndiViewModal.hLinePoint)}),l.\u0275\u0275text(38),l.\u0275\u0275pipe(39,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(40,"div",19),l.\u0275\u0275elementStart(41,"ul"),l.\u0275\u0275template(42,Z,3,1,"li",7),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275element(43,"div",20),l.\u0275\u0275elementStart(44,"div",21),l.\u0275\u0275elementStart(45,"ul"),l.\u0275\u0275elementStart(46,"li"),l.\u0275\u0275elementStart(47,"button",22),l.\u0275\u0275listener("click",function(){return B.closeIndicatorSettings(!0)}),l.\u0275\u0275text(48),l.\u0275\u0275pipe(49,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(50,"li"),l.\u0275\u0275elementStart(51,"button",23),l.\u0275\u0275listener("click",function(){return B.closeIndicatorSettings(!1)}),l.\u0275\u0275text(52),l.\u0275\u0275pipe(53,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()),2&y&&(l.\u0275\u0275advance(4),l.\u0275\u0275property("hidden",!B.chartView.IndiViewModal.SelectedIndicator.hasSource),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngModel",B.chartView.IndiViewModal.SelectedDataSource1),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.DataSourceList1),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",!B.chartView.IndiViewModal.SelectedIndicator.hasPeriods),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.SelectedIndicatorParams.periods),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.SelectedIndicatorParams.periods),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",!B.chartView.IndiViewModal.SelectedIndicator.hasMAType),l.\u0275\u0275advance(5),l.\u0275\u0275property("ngModel",B.chartView.IndiViewModal.SelectedIndicatorParams.matype),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.MATypeList),l.\u0275\u0275advance(5),l.\u0275\u0275property("ngModel",B.chartView.IndiViewModal.SelectedIndicatorParams.panel),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.PanelList),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",!B.chartView.IndiViewModal.SelectedIndicator.hasStyle),l.\u0275\u0275advance(3),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.SelectedIndicatorParams.styles),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",!B.chartView.IndiViewModal.SelectedIndicator.hasHLines),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngModel",B.chartView.IndiViewModal.hLinePoint),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",B.chartView.IndiViewModal.isHlineError),l.\u0275\u0275advance(1),l.\u0275\u0275property("disabled",B.hasInvalidInputs),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(39,22,"Add")," "),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngForOf",B.chartView.IndiViewModal.SelectedIndicatorParams.hLines),l.\u0275\u0275advance(5),l.\u0275\u0275property("disabled",B.hasInvalidInputs),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",B.chartView.IndiViewModal.isEditing?"Edit":l.\u0275\u0275pipeBind1(49,24,"Add")," "),l.\u0275\u0275advance(4),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(53,26,"Cancel")," "))},directives:[g.KE,b.gD,p.JJ,p.On,h.sg,o.Nt,p.Fj,h.O5,u.lW,m.ey,e.gM,f.Kk],pipes:[i.B],encapsulation:2}),ee})();var re=x(3940);let X=(()=>{class ee{constructor(y){this.el=y}onKeyDown(y){let B=y;
1if(this.OnlyNumber){if(-1!==[46,8,9,27,13].indexOf(B.keyCode)||65==B.keyCode&&!0===B.ctrlKey||67==B.keyCode&&!0===B.ctrlKey||88==B.keyCode&&!0===B.ctrlKey||B.keyCode>=35&&B.keyCode<=39)return;(B.shiftKey||B.keyCode<48||B.keyCode>57)&&(B.keyCode<96||B.keyCode>105)&&B.preventDefault()}}}return ee.\u0275fac=function(y){return new(y||ee)(l.\u0275\u0275directiveInject(l.ElementRef))},ee.\u0275dir=l.\u0275\u0275defineDirective({type:ee,selectors:[["","OnlyNumber",""]],hostBindings:function(y,B){1&y&&l.\u0275\u0275listener("keydown",function(_e){return B.onKeyDown(_e)})},inputs:{OnlyNumber:"OnlyNumber"}}),ee})();function ne(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"mat-option",12),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275property("value",y),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.name)}}function he(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"div",13),l.\u0275\u0275elementStart(1,"span"),l.\u0275\u0275text(2),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()),2&ee){const y=l.\u0275\u0275nextContext();l.\u0275\u0275advance(2),l.\u0275\u0275textInterpolate(y.inputErrorMsg)}}let fe=(()=>{class ee{constructor(){this.ODPList=[],this.context="",this.closeDialog=new l.EventEmitter,this.isBusyTeeChart=!1,this.selectedChartTime="1",this.intradayPeriod={id:6,name:"Intraday"},this.hasInvalidInputs=!1,this.inputErrorMsg=""}ngOnInit(){try{this.bindDataPeriod(),null==this.chartPeriod&&(this.chartPeriod=this.chartView.historicalDataPeriod[0])}catch(y){}}bindDataPeriod(){null!=this.context.params&&(this.chartView=this.context.params.chartView,this.currChartDataType=this.context.params.currChartDataType,Number(a.gT.C_S_CHART_TYPE_INTRADAY)==parseInt(this.currChartDataType)?(this.selectedChartTime="1",this.addIntradayChartPeriod(this.chartView.historicalDataPeriod),this.chartPeriod=this.chartView.historicalDataPeriod[5],this.SelectedIntraDayDataPeriodMinutes=parseInt(this.chartView.SelectedIntraDayDataPeriodMinutes),this.SelectedIntraDayDataPeriodSeconds=parseInt(this.chartView.SelectedIntraDayDataPeriodSeconds)):(Number(a.gT.C_S_CHART_TYPE_HISTORIC_CD)===parseInt(this.currChartDataType)?this.selectedChartTime="3":(this.selectedChartTime="1",this.addIntradayChartPeriod(this.chartView.historicalDataPeriod)),this.chartPeriod=this.chartView.historicalDataPeriod.filter(y=>y.id==this.chartView.SelectedHistoricDataPeriod.id)[0],this.SelectedIntraDayDataPeriodMinutes=parseInt(this.chartView.SelectedIntraDayDataPeriodMinutes),this.SelectedIntraDayDataPeriodSeconds=parseInt(this.chartView.SelectedIntraDayDataPeriodSeconds)))}addIntradayChartPeriod(y){this.chartView.historicalDataPeriod.some(B=>B.id==this.intradayPeriod.id)||this.chartView.historicalDataPeriod.push(this.intradayPeriod)}changeChartPeriod(){this.inputErrorMsg="",this.hasInvalidInputs=!1,6==this.chartPeriod.id&&(this.selectedChartTime="1")}changeChartTime(){if(this.chartPeriod==this.chartView.historicalDataPeriod[5]){let y=parseInt(this.SelectedIntraDayDataPeriodMinutes),B=parseInt(this.SelectedIntraDayDataPeriodSeconds);if(isNaN(y)||isNaN(B))return this.hasInvalidInputs=!0,void(this.inputErrorMsg="Please insert valid minutes and seconds");if(B<0||B>59)return this.hasInvalidInputs=!0,this.inputErrorMsg="Seconds should be less than 60.",void(this.chartView.SelectedIntraDayDataPeriodSeconds="0");if(this.hasInvalidInputs=!1,60*y+B>T.N.MaxIntraDayPeriod)return this.hasInvalidInputs=!0,void(this.inputErrorMsg="Max period is 1440 minutes.")}if(this.hasInvalidInputs=!1,!this.hasInvalidInputs){let y=0;"1"==this.selectedChartTime?6==this.chartPeriod.id?(y=Number(a.gT.C_S_CHART_TYPE_INTRADAY),this.closeDialog.emit({charttype:y,chartView:this.chartView,SelectedIntraDayDataPeriodMinutes:this.SelectedIntraDayDataPeriodMinutes,SelectedIntraDayDataPeriodSeconds:this.SelectedIntraDayDataPeriodSeconds,ct:this.SelectedIntraDayDataPeriodMinutes+" min "+this.SelectedIntraDayDataPeriodSeconds+" Sec Intraday "})):(y=Number(a.gT.C_S_CHART_TYPE_HISTORIC),this.closeDialog.emit({charttype:y,chartView:this.chartView,chartPeriod:this.chartPer
1iod,ct:this.chartPeriod.name+" Historic "})):(y=Number(a.gT.C_S_CHART_TYPE_HISTORIC_CD),this.closeDialog.emit({charttype:y,chartView:this.chartView,chartPeriod:this.chartPeriod,ct:this.chartPeriod.name+" Historic "}))}}onChartChange(y){if("1"==y)this.addIntradayChartPeriod(this.chartView.historicalDataPeriod);else{var B=this.chartView.historicalDataPeriod.filter(_e=>6==_e.id)[0],se=this.chartView.historicalDataPeriod.indexOf(B);se>-1&&this.chartView.historicalDataPeriod.splice(se,1)}this.chartPeriod=this.chartView.historicalDataPeriod[0]}}return ee.\u0275fac=function(y){return new(y||ee)},ee.\u0275cmp=l.\u0275\u0275defineComponent({type:ee,selectors:[["charttime"]],inputs:{context:"context"},outputs:{closeDialog:"closeDialog"},decls:34,vars:10,consts:[[1,"charttime"],[3,"ngModel","ngModelChange"],["value","1"],["value","3"],[2,"width","84px"],["disableOptionCentering","true","tabindex","13","title","Data Period","Save","","as","","Image","",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"hidden"],["matInput","","id","advChartPeriodMinutes","OnlyNumber","true","type","text","title","Minute(s)","maxlength","4",3,"ngModel","ngModelChange"],["matInput","","id","advChartPeriodSeconds","OnlyNumber","true","type","text","title","Second(s)","maxlength","2",3,"ngModel","ngModelChange"],["mat-raised-button","","type","button","tabindex","14","title","Add","value","OK",1,"btn","btn-black","btn-addscript",3,"click"],["style","text-align: center; padding-top: 10px; color: #a94442;",4,"ngIf"],[3,"value"],[2,"text-align","center","padding-top","10px","color","#a94442"]],template:function(y,B){1&y&&(l.\u0275\u0275elementStart(0,"div",0),l.\u0275\u0275elementStart(1,"ul"),l.\u0275\u0275elementStart(2,"li"),l.\u0275\u0275elementStart(3,"div"),l.\u0275\u0275elementStart(4,"label"),l.\u0275\u0275text(5,"Data Period: \xa0"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(6,"mat-radio-group",1),l.\u0275\u0275listener("ngModelChange",function(_e){return B.selectedChartTime=_e})("ngModelChange",function(_e){return B.onChartChange(_e)}),l.\u0275\u0275elementStart(7,"mat-radio-button",2),l.\u0275\u0275text(8,"Regular"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(9,"mat-radio-button",3),l.\u0275\u0275text(10,"Continuous"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(11,"li"),l.\u0275\u0275elementStart(12,"div"),l.\u0275\u0275elementStart(13,"label"),l.\u0275\u0275text(14,"Period :"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(15,"mat-form-field",4),l.\u0275\u0275elementStart(16,"mat-select",5),l.\u0275\u0275listener("ngModelChange",function(_e){return B.chartPeriod=_e})("selectionChange",function(){return B.changeChartPeriod()}),l.\u0275\u0275template(17,ne,2,2,"mat-option",6),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(18,"li"),l.\u0275\u0275elementStart(19,"div",7),l.\u0275\u0275elementStart(20,"label"),l.\u0275\u0275text(21,"Min :"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(22,"mat-form-field"),l.\u0275\u0275elementStart(23,"input",8),l.\u0275\u0275listener("ngModelChange",function(_e){return B.SelectedIntraDayDataPeriodMinutes=_e}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(24,"label"),l.\u0275\u0275text(25,"Sec :"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(26,"mat-form-field"),l.\u0275\u0275elementStart(27,"input",9),l.\u0275\u0275listener("ngModelChange",function(_e){return B.SelectedIntraDayDataPeriodSeconds=_e}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(28,"li"),l.\u0275\u0275elementStart(29,"button",10),l.\u0275\u0275listener("click",function(){return B.changeChartTime()}),l.\u0275\u0275text(30),l.\u0275\u0275pipe(31,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(32,"li"),l.\u0275\u0275template(33,he,3,1,"div",11),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()),2&y&&(l.\u0275\u0275advance(6),l.\u0275\u0275property("ngModel",B.selectedChartTime),l.\u0275\u0275advance(10),l.\u0275\u0275property("ngModel",B.chartPer
1iod),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",B.chartView.historicalDataPeriod),l.\u0275\u0275advance(2),l.\u0275\u0275property("hidden",!(6==B.chartPeriod.id&&"1"==B.selectedChartTime)),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngModel",B.SelectedIntraDayDataPeriodMinutes),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngModel",B.SelectedIntraDayDataPeriodSeconds),l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(31,8,"OK")," "),l.\u0275\u0275advance(3),l.\u0275\u0275property("ngIf",B.hasInvalidInputs))},directives:[re.VQ,p.JJ,p.On,re.U0,g.KE,b.gD,h.sg,o.Nt,p.Fj,X,p.nD,u.lW,h.O5,m.ey],pipes:[i.B],encapsulation:2}),ee})();var Te=x(7789);let Ce=(()=>{class ee{constructor(y){this.dialogsService=y,this.context="",this.closeDialog=new l.EventEmitter}ngOnInit(){try{null!=this.context.params&&(this.chartView=this.context.params.chartView,this.chartView.IndicatorTemplateName="")}catch(y){}}addChartTemplate(){this.chartView.saveIndicatorTemplate(),""===this.chartView.errorMessage&&(this.dialogsService.alert("Template added","","Ok"),this.closeDialog.emit({chartView:this.chartView}))}closeChartTemplate(){this.chartView.CancelIndicatorTemplate(),this.closeDialog.emit({chartView:this.chartView})}}return ee.\u0275fac=function(y){return new(y||ee)(l.\u0275\u0275directiveInject(Te.H))},ee.\u0275cmp=l.\u0275\u0275defineComponent({type:ee,selectors:[["charttemplate"]],inputs:{context:"context"},outputs:{closeDialog:"closeDialog"},decls:15,vars:2,consts:[[1,"addTem"],[1,"marginBtm10"],["type","text","id","iTemplateNametxt","maxlength","20",1,"input",3,"ngModel","ngModelChange"],[1,"clear"],[1,"button-box"],["type","button","title","Save","value","Save",1,"input-btn",3,"click"],["type","button","title","Cancel","value","Cancel",1,"input-btn",3,"click"]],template:function(y,B){1&y&&(l.\u0275\u0275elementStart(0,"div",0),l.\u0275\u0275elementStart(1,"ul"),l.\u0275\u0275elementStart(2,"li",1),l.\u0275\u0275elementStart(3,"input",2),l.\u0275\u0275listener("ngModelChange",function(_e){return B.chartView.IndicatorTemplateName=_e}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(4,"li",1),l.\u0275\u0275elementStart(5,"span"),l.\u0275\u0275text(6),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(7,"li"),l.\u0275\u0275element(8,"div",3),l.\u0275\u0275elementStart(9,"div",4),l.\u0275\u0275elementStart(10,"ul"),l.\u0275\u0275elementStart(11,"li"),l.\u0275\u0275elementStart(12,"input",5),l.\u0275\u0275listener("click",function(){return B.addChartTemplate()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(13,"li"),l.\u0275\u0275elementStart(14,"input",6),l.\u0275\u0275listener("click",function(){return B.closeChartTemplate()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()),2&y&&(l.\u0275\u0275advance(3),l.\u0275\u0275property("ngModel",B.chartView.IndicatorTemplateName),l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate(B.chartView.errorMessage))},directives:[p.Fj,p.nD,p.JJ,p.On],encapsulation:2}),ee})();var be=x(8497),Me=x(3910),ue=x(9162),Re=x(3220),K=x(6345),de=x(2150),Ee=x(8369),Ue=x(6382),Ze=x(5117);function Tt(ee,ve){1&ee&&(l.\u0275\u0275elementStart(0,"div"),l.\u0275\u0275element(1,"nn-progressbar",23),l.\u0275\u0275elementEnd()),2&ee&&(l.\u0275\u0275advance(1),l.\u0275\u0275property("type","ProgressBarWdgt"))}function ot(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"li"),l.\u0275\u0275elementStart(1,"label",24),l.\u0275\u0275element(2,"span",25),l.\u0275\u0275elementEnd(),l.\u0275\u0275element(3,"span",25),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275advance(2),l.\u0275\u0275property("innerHTML",y.name,l.\u0275\u0275sanitizeHtml),l.\u0275\u0275advance(1),l.\u0275\u0275property("innerHTML",y.data,l.\u0275\u0275sanitizeHtml)}}function ht(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"a",26),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().chartpanel.resetChartPanel()}),l.\u0275\u0275text(1,"X"),l.\u0275\u0275elementEnd()}}let nt=(()=>{class ee{constructor(y,B,se){this.dialogsService=y,this.menuManager=B,this.logService=se,this.showProgressBar=!1,this.cp="Daily Historic graph",this.adOtherChartPoints=[]}ngOnInit(){}ngOnChanges(y){null!=y.scripInfo&&!y.scripInfo.firstChange&&(this.scripInfo=y.scripInfo.currentValue),null!=y.scrip&&!y.scrip.firstChange&&(this.scrip=y.scrip.currentValue)}addtoWatchList(){var y={mktSegId:this.scrip.ScripDet.MktSegId,token:this.scrip.ScripDet.Token};1==this.scrip.IsIndex?this.dialogsService.alert("This scrip cannot be added into watchlist"):this.dialogsService.openComponent("Add To Watchlist",Ue.e,y,"500px","300px").afterClosed().subscribe(se=>{se.status&&this.dialogsService.alert("Scrip added to market watch profile"," ")})}populateOEfromAdvCht(y){if(this.adOtherChartPoints=this.chartView.pointerGuide.OtherChartPoints,"BUY"==y)var B=a.gT.C_S_ORDER_BUY_TEXT;else"SELL"==y&&(B=a.gT.C_S_ORDER_SELL_TEXT);var _e=this.chartView.pointerGuide.getYPriceValue(),Ae=this.scrip,Ye=parseInt(Ae.PriceTick),Le=parseFloat(_e)*parseInt(Ae.DecimalLocator),$e=parseFloat(_e)*parseInt(Ae.DecimalLocator)%Ye;let we;Le-=$e,$e>Ye/2&&(Le+=Ye),_e=Le/parseInt(Ae.DecimalLocator),we=new be.Q(Ae),we.OrderSide=B,we.SellPrice=this.adOtherChartPoints[1].data,we.BuyPrice=this.adOtherChartPoints[1].data,we.Price=this.adOtherChartPoints[1].data,we.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),we.BuyQty="",we.SellQty="",we.LTP="",we.ClosePrice=Ae.ClosePrice,1==Ae.IsIndex?this.dialogsService.alert("Order Entry is Not Allowed For This Scrip"):this.menuManager.invokeMenu(a.gT.C_S_MENU_OE_SPOT,{sourceId:a.gT.C_S_MENU_TRADING_MKTWATCH,data:we})}}return ee.\u0275fac=function(y){return new(y||ee)(l.\u0275\u0275directiveInject(Te.H),l.\u0275\u0275directiveInject(a._V),l.\u0275\u0275directiveInject(a.mQ))},ee.\u0275cmp=l.\u0275\u0275defineComponent({type:ee,selectors:[["advancePanel"]],inputs:{scrip:"scrip",scrip
1Info:"scripInfo",selected:"selected",chartpanel:"chartpanel",dChartType:"dChartType",chartPoints:"chartPoints",isSingleChart:"isSingleChart",chartView:"chartView"},features:[l.\u0275\u0275NgOnChangesFeature],decls:42,vars:9,consts:[[4,"ngIf"],["cellspacing","0","cellpadding","0",3,"hidden","ngClass"],["id","advanceChartPanel-div",1,"wh100"],["cellspacing","0","cellpadding","0",1,"wh100"],["id","chartCaption-tr"],["chartCaption",""],[1,"chart-head"],[4,"ngFor","ngForOf"],["id","chartCaption-div"],[1,"graph-title"],[3,"hidden"],[1,"chart-close"],["title","Remove Scrip","value","[X]",3,"click",4,"ngIf"],[1,"chart-bs",3,"hidden"],["value","BUY",1,"Market_up_Collapse_Menu","btn","btn-primary",3,"click"],["value","SELL",1,"Market_down_Collapse_Menu","btn","btn-primary",3,"click"],[1,"sep"],[1,"SF_addtowatchlist",3,"click"],[1,"ch-canvas-wrap"],["id","chartCanvas-div"],["chartCanvas",""],["id","chartScroller-div"],["chartScroller",""],["mode","indeterminate",3,"type"],["ng-style","{color: x['color']}"],[3,"innerHTML"],["title","Remove Scrip","value","[X]",3,"click"]],template:function(y,B){1&y&&(l.\u0275\u0275template(0,Tt,2,1,"div",0),l.\u0275\u0275elementStart(1,"table",1),l.\u0275\u0275elementStart(2,"tbody"),l.\u0275\u0275elementStart(3,"tr"),l.\u0275\u0275elementStart(4,"td"),l.\u0275\u0275elementStart(5,"div",2),l.\u0275\u0275elementStart(6,"table",3),l.\u0275\u0275elementStart(7,"thead"),l.\u0275\u0275elementStart(8,"tr",4,5),l.\u0275\u0275elementStart(10,"td",6),l.\u0275\u0275elementStart(11,"ul"),l.\u0275\u0275template(12,ot,4,2,"li",7),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(13,"div",8),l.\u0275\u0275elementStart(14,"div",9),l.\u0275\u0275text(15),l.\u0275\u0275elementStart(16,"label",10),l.\u0275\u0275text(17),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(18,"div",11),l.\u0275\u0275template(19,ht,2,0,"a",12),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(20,"div",13),l.\u0275\u0275elementStart(21,"ul"),l.\u0275\u0275elementStart(22,"li"),l.\u0275\u0275elementStart(23,"button",14),l.\u0275\u0275listener("click",function(){return B.populateOEfromAdvCht("BUY")}),l.\u0275\u0275text(24,"BUY"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(25,"li"),l.\u0275\u0275elementStart(26,"button",15),l.\u0275\u0275listener("click",function(){return B.populateOEfromAdvCht("SELL")}),l.\u0275\u0275text(27,"SELL"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(28,"li",16),l.\u0275\u0275text(29,"|"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(30,"li"),l.\u0275\u0275elementStart(31,"span",17),l.\u0275\u0275listener("click",function(){return B.addtoWatchList()}),l.\u0275\u0275text(32,"Add to Watchlist"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(33,"tbody"),l.\u0275\u0275elementStart(34,"tr"),l.\u0275\u0275elementStart(35,"td",18),l.\u0275\u0275element(36,"div",19,20),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(38,"tr"),l.\u0275\u0275elementStart(39,"td"),l.\u0275\u0275element(40,"div",21,22),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()),2&y&&(l.\u0275\u0275property("ngIf",B.chartpanel.isBusy),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",B.chartpanel.isBusy)("ngClass",1==B.selected?"advSlctdChrtPanel":"advChrtPanel"),l.\u0275\u0275advance(11),l.\u0275\u0275property("ngForOf",B.chartPoints),l.\u0275\u0275advance(3),l.\u0275\u0275textInterpolate1("",B.scripInfo.Description," "),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",""==B.scripInfo.Description),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(B.chartpanel.chartText),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",!B.isSingleChart),l.\u0275\u0275advance(1),l.\u0275\u0275property("hidden",null==B.scripInfo.Description))}
1,directives:[h.O5,h.mk,h.sg,Ze.R],encapsulation:2}),ee})();var ut=x(9852);const ae=["dvAdvancedChart"],Pe=["advChartGiude"],E=["IndicatorSettings"],R=["saveChartImage"],Y=["saveChartAsCSV"],ie=["chartIQFrame"],ge=function(ee){return{"selected-chartType":ee}};function xe(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"button",20),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).chartView.changePriceGraph(_e)}),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit,B=l.\u0275\u0275nextContext(2);l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction1(2,ge,B.chartView.SelectedPriceGraphType.GraphId==y.GraphId)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",y.GraphName," ")}}function oe(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",61),l.\u0275\u0275elementStart(1,"button",37),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).editIndicator(_e.obj)}),l.\u0275\u0275text(2),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(3,"span",62),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).deleteIndicator(_e.obj)}),l.\u0275\u0275text(4,"X"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit;l.\u0275\u0275advance(2),l.\u0275\u0275textInterpolate(y.obj.DisplayName)}}function me(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"button",63),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).deleteIndicator()}),l.\u0275\u0275text(1,"Delete All"),l.\u0275\u0275elementEnd()}}function L(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"button",37),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).changeIndicator(_e)}),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit;l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",y.name," ")}}function te(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"button",64),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).changeCrossMarker(_e)}),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit,B=l.\u0275\u0275nextContext(2);l.\u0275\u0275property("value",y)("ngClass",l.\u0275\u0275pureFunction1(3,ge,B.chartView.SelectedCursorOption==y)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",y.CurName," ")}}function J(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"button",64),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).changeSyncOption(_e)}),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit,B=l.\u0275\u0275nextContext(2);l.\u0275\u0275property("value",y)("ngClass",l.\u0275\u0275pureFunction1(3,ge,B.chartView.SelectedChartSyncType==y)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",y.Name," ")}}function De(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",61),l.\u0275\u0275elementStart(1,"button",20),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).loadIndicatorTemplate(_e)}),l.\u0275\u0275text(2),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(3,"span",62),l.\u0275\u0275listener("click",function(){const _e=l.\u0275\u0275restoreView(y).$implicit;return l.\u0275\u0275nextContext(2).deleteIndicatorTemplate(_e)}),l.\u0275\u0275text(4,"X"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=ve.$implicit,B=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(1),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction1(2,ge,B.chartView.SelectedIndicatorTemplate==y)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.Name)}}function Ke(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",65),l.\u0275\u0275elementStart(1,"div",66),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(0,0)}),l.\u0275\u0275element(2,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!0)("chartpanel",y.chartView.getPanelforView(0,0))("selected",y.chartView.getPanelforView(0,0).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(0,0).scripInfo)("scrip",y.chartView.getPanelforView(0,0).ODINScripobject)("chartView",y.chartView)}}function Xe(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",68),l.\u0275\u0275elementStart(1,"div",69),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(1,0)}),l.\u0275\u0275element(2,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(3,"div",70),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(1,1)}),l.\u0275\u0275element(4,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(1,0))("selected",y.chartView.getPanelforView(1,0).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(1,0).scripInfo)("scrip",y.chartView.getPanelforView(1,0).ODINScripobject)("chartView",y.chartView),l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(1,1))("selected",y.chartView.getPanelforView(1,1).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(1,1).scripInfo)("scrip",y.chartView.getPanelforView(1,1).ODINScripobject)("chartView",y.chartView)}}function et(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",71),l.\u0275\u0275elementStart(1,"div",72),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(2,0)}),l.\u0275\u0275element(2,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(3,"div",73),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(2,1)}),l.\u0275\u0275element(4,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(2,0))("selected",y.chartView.getPanelforView(2,0).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(2,0).scripInfo)("scrip",y.chartView.getPanelforView(2,0).ODINScripobject)("chartView",y.chartView),l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(2,1))("selected",y.chartView.getPanelforView(2,1).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(2,1).scripInfo)("scrip",y.chartView.getPanelforView(2,1).ODINScripobject)("chartView",y.chartView)}}function ct(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div",74),l.\u0275\u0275elementStart(1,"div",75),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(3,0)}),l.\u0275\u0275element(2,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(3,"div",76),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(3,1)}),l.\u0275\u0275element(4,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(5,"div",77),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(3,2)}),l.\u0275\u0275element(6,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(7,"div",78),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext(2).chartPanelClicked(3,3)}),l.\u0275\u0275element(8,"advancePanel",67),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(3,0))("selected",y.chartView.getPanelforView(3,0).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(3,0).scripInfo)("scrip",y.chartView.getPanelforView(3,0).ODINScripobject)("chartView",y.chartView),l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(3,1))("selected",y.chartView.getPanelforView(3,1).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(3,1).scripInfo)("scrip",y.chartView.getPanelforView(3,1).ODINScripobject)("chartView",y.chartView),l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(3,2))("selected",y.chartView.getPanelforView(3,2).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(3,2).scripInfo)("scrip",y.chartView.getPanelforView(3,2).ODINScripobject)("chartView",y.chartView),l.\u0275\u0275advance(2),l.\u0275\u0275property("isSingleChart",!1)("chartpanel",y.chartView.getPanelforView(3,3))("selected",y.chartView.getPanelforView(3,3).isCurrentSelectedPanel)("scripInfo",y.chartView.getPanelforView(3,3).scripInfo)("scrip",y.chartView.getPanelforView(3,3).ODINScripobject)("chartView",y.chartView)}}function tt(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"label"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.chartView.pointerGuide.scripDescription)}}function Ct(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"label"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.chartView.pointerGuide.scripDescription)}}function vt(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"label"),l.\u0275\u0275text(1),l.\u0275\u0275elementEnd()),2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate(y.chartView.pointerGuide.scripDescription)}}function ze(ee,ve){if(1&ee&&l.\u0275\u0275element(0,"scripLink",79),2&ee){const y=l.\u0275\u0275nextContext(2);l.\u0275\u0275property("pageSource","T")("mktSegId",y.chartView.pointerGuide.MarketSegment)("token",y.chartView.pointerGuide.token)("symbol",y.chartView.pointerGuide.scripDescription)("scripDesc",y.chartView.pointerGuide.scripDescription)}}function Rt(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"tbody"),l.\u0275\u0275elementStart(1,"tr",80),l.\u0275\u0275elementStart(2,"td",52),l.\u0275\u0275element(3,"span",81),l.\u0275\u0275elementEnd(),l.\u0275\u0275element(4,"td",82),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()),2&ee){const y=ve.$implicit;l.\u0275\u0275advance(3),l.\u0275\u0275property("innerHTML",y.name,l.\u0275\u0275sanitizeHtml),l.\u0275\u0275advance(1),l.\u0275\u0275property("innerHTML",y.data,l.\u0275\u0275sanitizeHtml)}}const Ft=function(ee,ve){return{"single-view":ee,"selected-chartType":ve}}
1,Nt=function(ee,ve){return{"two-hori":ee,"selected-chartType":ve}},wt=function(ee,ve){return{"two-verti":ee,"selected-chartType":ve}},Bt=function(ee,ve){return{"four-view":ee,"selected-chartType":ve}};function Gt(ee,ve){if(1&ee){const y=l.\u0275\u0275getCurrentView();l.\u0275\u0275elementStart(0,"div"),l.\u0275\u0275elementStart(1,"div",5),l.\u0275\u0275elementStart(2,"div",6),l.\u0275\u0275elementStart(3,"ol"),l.\u0275\u0275elementStart(4,"li",7),l.\u0275\u0275elementStart(5,"universalLookup",8),l.\u0275\u0275listener("addScripCallBack",function(se){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().addScripCallBack(se)}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(6,"li",9),l.\u0275\u0275elementStart(7,"ul"),l.\u0275\u0275elementStart(8,"li",10),l.\u0275\u0275elementStart(9,"button",11),l.\u0275\u0275text(10,"Type"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(11,"mat-menu",9,12),l.\u0275\u0275template(13,xe,2,4,"button",13),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(14,"li",10),l.\u0275\u0275elementStart(15,"button",14),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().changeChartTime()}),l.\u0275\u0275text(16,"Time"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(17,"li",10),l.\u0275\u0275elementStart(18,"button",11),l.\u0275\u0275text(19,"Studies"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(20,"mat-menu",9,15),l.\u0275\u0275template(22,oe,5,1,"ng-template",16),l.\u0275\u0275template(23,me,2,0,"button",17),l.\u0275\u0275template(24,L,2,1,"button",18),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(25,"li",10),l.\u0275\u0275elementStart(26,"button",11),l.\u0275\u0275text(27,"Views"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(28,"mat-menu",9,19),l.\u0275\u0275elementStart(30,"button",20),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().changePanelView(0)}),l.\u0275\u0275text(31),l.\u0275\u0275pipe(32,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(33,"button",20),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().changePanelView(1)}),l.\u0275\u0275text(34),l.\u0275\u0275pipe(35,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(36,"button",20),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().changePanelView(2)}),l.\u0275\u0275text(37),l.\u0275\u0275pipe(38,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(39,"button",20),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().changePanelView(3)}),l.\u0275\u0275text(40),l.\u0275\u0275pipe(41,"translate"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(42,"li",10),l.\u0275\u0275elementStart(43,"button",11),l.\u0275\u0275text(44,"Cross Marker"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(45,"mat-menu",9,21),l.\u0275\u0275template(47,te,2,5,"button",22),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(48,"li",10),l.\u0275\u0275elementStart(49,"button",11),l.\u0275\u0275text(50,"Sync"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(51,"mat-menu",null,23),l.\u0275\u0275template(53,J,2,5,"button",22),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(54,"li",24),l.\u0275\u0275elementStart(55,"ul"),l.\u0275\u0275elementStart(56,"li"),l.\u0275\u0275elementStart(57,"a",25),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().chartView.zoomCustom()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(58,"li"),l.\u0275\u0275elementStart(59,"a",26),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().chartView.zoomIn()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(60,"li"),l.\u0275\u0275elementStart(61,"a",27),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().chartView.zoomOut()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(62,"li"),l.\u0275\u0275elementStart(63,"a",28),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().chartView.zoomReset()}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(64,"li"),l.\u0275\u0275element(65,"a",29,30),l.\u0275\u0275elementStart(67,"a",31),l.\u0275\u0275listener("click",function(){l.\u0275\u0275restoreView(y);const se=l.\u0275\u0275reference(66);return l.\u0275\u0275nextContext().chartView.saveChartAsImage(se)}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(68,"li"),l.\u0275\u0275element(69,"a",32,33),l.\u0275\u0275elementStart(71,"a",34),l.\u0275\u0275listener("click",function(){l.\u0275\u0275restoreView(y);const se=l.\u0275\u0275reference(70),_e=l.\u0275\u0275nextContext();return _e.chartView.saveChartAsCSV(se,_e.chartView.pointerGuide.scripDescription)}),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(72,"div",35),l.\u0275\u0275elementStart(73,"div",9),l.\u0275\u0275elementStart(74,"ul"),l.\u0275\u0275elementStart(75,"li",10),l.\u0275\u0275elementStart(76,"button",11),l.\u0275\u0275text(77,"Chart Template"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(78,"mat-menu",9,36),l.\u0275\u0275elementStart(80,"button",37),l.\u0275\u0275listener("click",function(){return l.\u0275\u0275restoreView(y),l.\u0275\u0275nextContext().addChartTemplate()}),l.\u0275\u0275text(81,"Add New"),l.\u0275\u0275elementEnd(),l.\u0275\u0275template(82,De,5,4,"ng-template",16),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(83,"div",38),l.\u0275\u0275elementStart(84,"div",39),l.\u0275\u0275elementStart(85,"div",40,41),l.\u0275\u0275template(87,Ke,3,6,"div",42),l.\u0275\u0275template(88,Xe,5,12,"div",43),l.\u0275\u0275template(89,et,5,12,"div",44),l.\u0275\u0275template(90,ct,9,24,"div",45),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(91,"div",46),l.\u0275\u0275elementStart(92,"div",47,48),l.\u0275\u0275elementStart(94,"div"),l.\u0275\u0275elementStart(95,"table",49),l.\u0275\u0275elementStart(96,"tbody"),l.\u0275\u0275elementStart(97,"tr"),l.\u0275\u0275elementStart(98,"td",50),l.\u0275\u0275template(99,tt,2,1,"label",2),l.\u0275\u0275template(100,Ct,2,1,"label",2),l.\u0275\u0275template(101,vt,2,1,"label",2),l.\u0275\u0275template(102,ze,1,5,"scripLink",51),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(103,"div"),l.\u0275\u0275elementStart(104,"table",49),l.\u0275\u0275elementStart(10
15,"tbody"),l.\u0275\u0275elementStart(106,"tr"),l.\u0275\u0275elementStart(107,"td",52),l.\u0275\u0275elementStart(108,"span"),l.\u0275\u0275text(109,"Open"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(110,"td",53),l.\u0275\u0275elementStart(111,"span"),l.\u0275\u0275text(112),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(113,"tr",54),l.\u0275\u0275elementStart(114,"td",52),l.\u0275\u0275elementStart(115,"span"),l.\u0275\u0275text(116,"High"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(117,"td",53),l.\u0275\u0275elementStart(118,"span"),l.\u0275\u0275text(119),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(120,"tr",55),l.\u0275\u0275elementStart(121,"td",52),l.\u0275\u0275elementStart(122,"span"),l.\u0275\u0275text(123,"Low"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(124,"td",53),l.\u0275\u0275elementStart(125,"span"),l.\u0275\u0275text(126),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(127,"tr",56),l.\u0275\u0275elementStart(128,"td",52),l.\u0275\u0275elementStart(129,"span"),l.\u0275\u0275text(130,"Close"),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(131,"td",53),l.\u0275\u0275elementStart(132,"span"),l.\u0275\u0275text(133),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(134,"table",57),l.\u0275\u0275template(135,Rt,5,2,"tbody",58),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementStart(136,"div",59),l.\u0275\u0275element(137,"div",60),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd(),l.\u0275\u0275elementEnd()}if(2&ee){const y=l.\u0275\u0275reference(12),B=l.\u0275\u0275reference(21),se=l.\u0275\u0275reference(29),_e=l.\u0275\u0275reference(46),Ae=l.\u0275\u0275reference(52),Ye=l.\u0275\u0275reference(79),Le=l.\u0275\u0275nextContext();l.\u0275\u0275advance(9),l.\u0275\u0275property("matMenuTriggerFor",y),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngForOf",Le.chartView.priceGraphTypeOptions),l.\u0275\u0275advance(5),l.\u0275\u0275property("matMenuTriggerFor",B),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngForOf",Le.chartView.currentSelectedPanel.indicatorListforView),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",Le.chartView.currentSelectedPanel.indicatorListforView.length>0),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngForOf",Le.chartView.IndiViewModal.IndicatorList),l.\u0275\u0275advance(2),l.\u0275\u0275property("matMenuTriggerFor",se),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction2(48,Ft,1!=Le.chartView.SelectedViewOption,1==Le.chartView.SelectedViewOption)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(32,40,"Single Chart")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction2(51,Nt,2!=Le.chartView.SelectedViewOption,2==Le.chartView.SelectedViewOption)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(35,42,"Two Charts Horizontal")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction2(54,wt,3!=Le.chartView.SelectedViewOption,3==Le.chartView.SelectedViewOption)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(38,44,"Two Charts Vertical")," "),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngClass",l.\u0275\u0275pureFunction2(57,Bt,4!=Le.chartView.SelectedViewOption,4==Le.chartView.SelectedViewOption)),l.\u0275\u0275advance(1),l.\u0275\u0275textInterpolate1(" ",l.\u0275\u0275pipeBind1(41,46,"Four Charts")," "),l.\u0275\u0275advance(3),l.\u0275\u0275property("matMenuTriggerFor",_e),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngForOf",Le.chartView.chartCursorViewOptions),l.\u0275\u0275advance(2),l.\u0275\u0275property("matMenuTriggerFor",Ae),l.\u0275\u0275advance(4),l.\u0275\u0275property("ngForOf",Le.chartView.chartSyncOptions),l.\u0275\u0275advance(4),l.\u0275\u0275property("matTooltip","Zoom Icon"),l.\u0275\u0275advance(2),l.\u0275\u0275property("matTooltip","Zoom In"),l.\u0275\u0275advance(2),l.\u0275\u0275property("matTooltip","Zoom Out"),l.\u0275\u0275advance(2),l.\u0275\u0275property("matTooltip","Actual Fit"),l.\u0275\u0275advance(4),l.\u0275\u0275property("matTooltip","Save\xa0as\xa0Image"),l.\u0275\u0275advance(4),l.\u0275\u0275property("matTooltip","Export to Excel"),l.\u0275\u0275advance(5),l.\u0275\u0275property("matMenuTriggerFor",Ye),l.\u0275\u0275advance(6),l.\u0275\u0275property("ngForOf",Le.chartView.IndicatorTemplateList),l.\u0275\u0275advance(5),l.\u0275\u0275property("ngIf",1==Le.chartView.SelectedViewOption),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",2==Le.chartView.SelectedViewOption),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",3==Le.chartView.SelectedViewOption),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",4==Le.chartView.SelectedViewOption),l.\u0275\u0275advance(9),l.\u0275\u0275property("ngIf",1==Le.chartView.pointerGuide.Index&&1!=Le.isPopup),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",1==Le.chartView.pointerGuide.Index&&1==Le.isPopup),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",1!=Le.chartView.pointerGuide.Index&&1==Le.isPopup),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",1!=Le.chartView.pointerGuide.Index&&1!=Le.isPopup),l.\u0275\u0275advance(10),l.\u0275\u0275textInterpolate(Le.chartView.pointerGuide.Open),l.\u0275\u0275advance(7),l.\u0275\u0275textInterpolate(Le.chartView.pointerGuide.High),l.\u0275\u0275advance(7),l.\u0275\u0275textInterpolate(Le.chartView.pointerGuide.Low),l.\u0275\u0275advance(7),l.\u0275\u0275textInterpolate(Le.chartView.pointerGuide.Close),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngForOf",Le.chartView.pointerGuide.OtherChartPoints)}}function Ut(ee,ve){if(1&ee&&l.\u0275\u0275element(0,"iframe",83,84),2&ee){const y=l.\u0275\u0275nextContext();l.\u0275\u0275property("src",y.chartIQURL,l.\u0275\u0275sanitizeResourceUrl)}}function Wt(ee,ve){1&ee&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1,"Error retrieving chart data. Please contact administrator"),l.\u0275\u0275elementEnd())}function Ht(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"div",85),l.\u0275\u0275template(1,Wt,2,0,"span",2),l.\u0275\u0275elementEnd()),2&ee){const y=l.\u0275\u0275nextContext();l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",y.showChartIQNotAvailableError)}}function Qt(ee,ve){if(1&ee&&l.\u0275\u0275element(0,"iframe",83),2&ee){const y=l.\u0275\u0275nextContext();l.\u0275\u0275property("src",y.tradingViewURL,l.\u0275\u0275sanitizeResourceUrl)}}function Yt(ee,ve){1&ee&&(l.\u0275\u0275elementStart(0,"span"),l.\u0275\u0275text(1,"Error retrieving chart data. Please contact administrator"),l.\u0275\u0275elementEnd())}function Xt(ee,ve){if(1&ee&&(l.\u0275\u0275elementStart(0,"div",85),l.\u0275\u0275template(1,Yt,2,0,"span",2),l.\u0275\u0275elementEnd()),2&ee){const y=l.\u0275\u0275nextContext();l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",y.showChartIQNotAvailableError)}}let Kt=(()=>{class ee{constructor(y,B,se,_e,Ae,Ye,Le,$e,we,rt,Ot){this.httpService=y,this.actRoute=B,this.menuManager=se,this.sanitizer=_e,this.logService=Ae,this.router=Ye,this.pubsubService=Le,this.zone=$e,this.dialogsService=we,this.tradingSharedService=rt,this.eleRef=Ot,this.color="#2889e9",this.arrayColors={},this.selectedColor="color",this.state="",this.isAdChartNavFrmMW=!1,this.isTEEChart=!1,this.isChartIQ=!1,this.showIframe=!1,this.showChartIQNotAvailableError=!1,this.isTradingView=!1,this.adOtherChartPoints=[],this.isPopup=!1,this.divheight="100%",this.indexScrip=!1,this.adjustadvChart=!1,this.ContainerId="",this.UIContainerId="",this.context="",this.IsLookUpScrip=!1,this.isBusyTeeChart=!1,this.ArrSubTokens=[],this.showControlPanel=!0,this.ArrTouchlineData=[],this.LastUpdateTime=null,this.isAdvanceChartVisible=!0,this.symbolLookupdata={exchng:"",InstrumentName:"",Token:"",symbol
1:"",expirydate:"",strikeprice:"",optiontype:"",series:""},this.cCahrtDays=a.xB.dConfigMaster.CONTINUOUS_CHART_YEARS,this.ContinuousChartYears=null!=this.cCahrtDays&&null!=this.cCahrtDays?parseInt(this.cCahrtDays):0,this.DisplayScripName="",this.DateValue="",this.TickValue="",this.EnableZoom=!1,this.isBackVisible=!1,this.ReportName="",this.ForceWebBasicChart=!1,this.IsLookUpAvailable=!0,this.SelectedChartSyncType=null,this.SelectedSyncOption=0,this.currODPanel=null,this.currScrip=null,this.currChartDataType=2,this.currPeriod=1,this.currODPanelStatus=-1,this.ODPList=[],this.LicenseType=n.X.IsAdvancedChartAllowed()?2:1,this.IntraHistoricDays=n.X.IsAdvancedChartAllowed()?a.gT.DEFAULT_ADVANCEDINTRADAY_DAYS_NOS:a.gT.DEFAULT_BASICINTRADAY_DAYS_NOS,this.HistoricDataCount=n.X.IsAdvancedChartAllowed()?a.gT.DEFAULT_ADVANCEDHISTORIC_RECORDS_NOS:a.gT.DEFAULT_BASICHISTORIC_RECORDS_NOS,this.LoadPanelDataCompleted=function(){null!=this.currODPanel&&$(this.currODPanel.context).attr("tabindex",this.currODPanel.context.id).focus(),this.currODPanel=null,this.currODPanelStatus=-1},this.closeIndicatorSettings=function(St){this.displayPopup("hidden");var at=ee.count++;this.chartView.closeIndicatorSettings(St),at%2==0&&document.getElementById("pp"),document.getElementById("pp").style.opacity="1"},this.saveChartAsImage=function(){this.chartView.saveChartAsImage(this.saveChartImage.nativeElement)},ee.count=0,this.chartMode=a.vV.getChartVendor(),this.chartMode==a.gT.CHART_VENDOR_TEECHART&&(this.isTEEChart=!0),this.chartMode==a.gT.CHART_VENDOR_CHARTIQ&&(this.isChartIQ=!0),this.chartMode==a.gT.CHART_VENDOR_TRADINGVIEW&&(this.isTradingView=!0)}onKeyDown(y){if(this.eleRef.nativeElement.contains(y.target)){var B=y.which?y.which:y.keyCode;(112===B||107===B||113===B||109===B)&&(112==B||107==B?this.populateOEfromAdvCht("BUY"):(113==B||109==B)&&this.populateOEfromAdvCht("SELL"),y.preventDefault(),y.stopImmediatePropagation())}}populateOEfromAdvCht(y){if(this.adOtherChartPoints=this.chartView.pointerGuide.OtherChartPoints,"BUY"==y)var B=a.gT.C_S_ORDER_BUY_TEXT;else"SELL"==y&&(B=a.gT.C_S_ORDER_SELL_TEXT);var se=this.chartView.currentSelectedPanel,Ae=this.chartView.pointerGuide.getYPriceValue(),Ye=se.ODINScripobject,Le=parseInt(Ye.PriceTick),$e=parseFloat(Ae)*parseInt(Ye.DecimalLocator),we=parseFloat(Ae)*parseInt(Ye.DecimalLocator)%Le;let rt;$e-=we,we>Le/2&&($e+=Le),Ae=$e/parseInt(Ye.DecimalLocator),rt=new be.Q(Ye),rt.OrderSide=B,rt.SellPrice=this.adOtherChartPoints[1].data,rt.BuyPrice=this.adOtherChartPoints[1].data,rt.Price=this.adOtherChartPoints[1].data,rt.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),rt.BuyQty="",rt.SellQty="",rt.LTP="",rt.ClosePrice=Ye.ClosePrice,1==Ye.IsIndex?this.dialogsService.alert("Order Entry is Not Allowed For This Scrip"):this.menuManager.invokeMenu(a.gT.C_S_MENU_OE_SPOT,{sourceId:a.gT.C_S_MENU_TRADING_MKTWATCH,data:rt})}ngOnInit(){G.e.chartHelper=new G.e.ChartHelper;try{var y={MktSegId:1,Token:"26000"};if(null!=this.context.params){this.scripObj=this.context.params;let B=window.screen.height-35*window.screen.height/100+"px";this.divheight=B,this.isPopup=!0}this.isTEEChart&&this.SubScribeMessages(),null==this.scripObj?this.actRoute.params.subscribe(B=>{null!=B.mSegId&&(y.MktSegId=B.mSegId),null!=B.tokenNo&&(y.Token=B.tokenNo),this.tradingSharedService.getScripDetails(Number(y.MktSegId),Number(y.Token),!1,"","").subscribe(se=>{this.scrip=se,this.Initialize(!1,"","","")})}):(this.isPopup=!0,this.scrip=this.scripObj,this.Initialize(!1,"","","")),null!=this.scripObj&&(y.MktSegId=this.scripObj.ScripDet.MktSegId,y.Token=this.scripObj.ScripDet.Token),this.adjustadvChart=!0}catch(B){this.logService.WriteLog("Exception: "+B.message,"ngOnInit","advancedchart.component.ts","")}}ngAfterViewChecked(){this.adjustadvChart&&this.isTEEChart&&(this.chartView.adjustadvChartContainer(),this.adjustadvChart=!1)}fn_ParseValue(y){return null==y?"NA":y}fn_cloneScripObj(y){let B={};return B.ScripDet.MktSegId(y.ScripDet.MktSegId()),B.ScripDet.Token=y.ScripDet.Token,B.Symbol=y.Symbol,B.Series=y.Series,B.InstrumentName=y.InstrumentName,B.ExchangeName=y.ExchangeName,B.ExpiryDate=y.ExpiryDate,B.OptionType=y.OptionType,B.StrikePrice=y.StrikePrice,B.MWSecurityDesc=n.X.FormatScripDescF
1orMW(y),B.MarketLot=y.MarketLot,B.PriceTick=y.PriceTick,B.DecimalLocator=y.DecimalLocator,B.ISIN=y.ISIN,B.SPOS=y.SPOS,B.POS=y.POS,B.Spread=y.Spread,B.FIILimit=y.FIILimit,B.NRILimit=y.NRILimit,B.MWSecurityDescShort=n.X.FormatScripDescForMW(y),B}PopulateJSChart(y){var B=this.scrip,se=B.InstrumentName,_e=this.currPeriod;(null==y||null==y)&&(y=2);var Ae=y,Ye=0,$e="";if(3==Ae)if(null!=se)if(se.startsWith("FUT")){$e=-1==B.nExpiryMonth?"":"C"+B.nExpiryMonth;let We=new Date("01/01/1980"),It=Date.now();var we=((It-We)/1e3).toFixed(0),rt=new Date(It);Ye=we-((It-rt.setFullYear(rt.getFullYear()-this.ContinuousChartYears))/1e3).toFixed(0)}else Ae=2;else Ae=2;try{let We;if(null!=this.scrip&&null!=this.scrip&&(We=this.scrip),new a.HT,null!=We)var at={UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:We.ScripDet.MapMktSegId,ScripTkn:We.ScripDet.Token,Symbol:We.Symbol,Series:We.Series,InstNm:We.InstrumentName,ExpDt:this.fn_ParseValue(We.ExpiryDate),ISIN:We.ISIN,MktLot:We.MarketLot,OptType:this.fn_ParseValue(We.OptionType),PrcTick:We.PriceTick,DecLocator:We.DecimalLocator,StrkPrc:this.fn_ParseValue(We.StrikePrice),PosType:We.SPOS,IsSpreadScrip:We.Spread,FIILimit:We.FIILimit,NRILimit:We.NRILimit,MWScripDesc:We.MWSecurityDesc,Lut:Ye,IntraHistFlag:0,IntradayDays:this.IntraHistoricDays,ChartDataType:Ae,ChartType:_e-1,ChartRecords:this.HistoricDataCount,ChartContinuous:$e};this.getChartData(at)}catch(We){this.logService.WriteLog("Exception: "+We.message,"PopulateJSChart","advancedchart.component.ts",""),this.currODPanelStatus=-2}}getChartData(y){this.tradingSharedService.createAndSendMultiTouchLineRequest(this.scrip.ScripDet.MktSegId,this.scrip.ScripDet.Token,1),this.httpService.postToGetChart(a.xB.tradingAPIUrl,"GetChartData",y).subscribe(se=>{new Uint8Array(se),this.fn_PopulateJSChartResponce(se)})}fn_PopulateJSChartResponce(y){this.processServiceResponce(y)}processServiceResponce(y){try{this.isBusyTeeChart=!0;var se,_e,Ae,Le,$e,we,rt,B="",St=this.currODPanel,at=this.scrip;let st=St.scripData;var We,It,kt;if(5==a.gT.COMPRESSION_LEVEL&&(B=a.vV.UnCompressData(y)),null==B&&this.chartView.setChartCursor(0),n.X.GetPriceFormatter(at.DecimalLocator.toString(),at.ScripDet.MapMktSegId,at._InstrumentName),null!=B&&B.length>0)if(St.hasData=!0,a.xB.dConfigMaster.HistoricChartWithIntradayTick==a.gT.C_S_ON&&(It=B.split("IntradayTick"),B=It[0],kt=It[1]),this.currChartDataType.toString()==a.gT.C_S_CHART_TYPE_INTRADAY){for(var bt=B.replaceAll("\r\n","$").split("$"),Mt=0;Mt<bt.length;Mt++)if((We=bt[Mt].split("|")).length>=3){Ae=a.vV.ConvertToDateObj(parseInt(We[0]));var ai=parseFloat(We[1])/parseInt(at.DecimalLocator);st.addNextDBTick(Ae,parseInt(We[2]),ai)}this.chartView.updateFullScripData(St.id,st)}else{for(bt=(B=this.DecryptChartData(B)).replaceAll("\r\n","$").split("$"),Mt=0;Mt<bt.length;Mt++)se=bt[Mt].split("="),Ae=a.vV.ConvertToDateObj(parseInt(se[0])),0==isNaN(Ae)&&se.length>=2&&(_e=se[1].split(","),$e=(Le=parseFloat(_e[0]))+parseFloat(_e[1]),rt=(we=Le-parseFloat(_e[2]))+parseFloat(_e[3]),st.Open.push(Le/parseInt(at.DecimalLocator)),st.High.push($e/parseInt(at.DecimalLocator)),st.Low.push(we/parseInt(at.DecimalLocator)),st.Close.push(rt/parseInt(at.DecimalLocator)),st.Volume.push(parseFloat(_e[4])),st.TickTime.push(Ae));!(0,Me.isNullOrUndefined)(kt)&&""!=kt&&(We=kt.replaceAll("\r\n","").split("|")).length>=3&&(Ae=n.X.ConvertToDateObj(parseInt(We[0])),st.Open.push(parseFloat(We[1])/parseInt(at.DecimalLocator)),st.High.push(parseFloat(We[2])/parseInt(at.DecimalLocator)),st.Low.push(parseFloat(We[3])/parseInt(at.DecimalLocator)),st.Close.push(parseFloat(We[4])/parseInt(at.DecimalLocator)),st.Volume.push(parseFloat(We[5])),st.TickTime.push(Ae))}this.chartView.updateFullScripData(St.id,st),st.isNewTick=!0,this.currODPanelStatus=0,St.isBusy=!1,St.isLoadingScripData=!1,this.isBusyTeeChart=!1}catch(st){this.currODPanelStatus=-3,this.loadNextODPanel(),null!=this.currODPanel&&null!=this.currODPanel&&(this.currODPanel.isBusy=!1)}}DecryptChartData(y){return(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=(y=y.replaceAllChar(")",",0,0,0,0,")).replaceAllChar("(",",0,0,0,")).replaceAllChar("!",",0,0,")).replaceAllChar("|",",0,")).replaceAllChar(":","0,")).replaceAllChar("{",",+")).replaceAllChar("}",",-")).replaceAllChar("%","5,")).replaceAllChar("~","10")).replaceAllChar("@","20")).replaceAllChar("#","30")).replaceAllChar("$","40")).replaceAllChar("^","50")).replaceAllChar("&","60")).replaceAllChar("*","70")).replaceAllChar("<","80")).replaceAllChar(">","90")).replaceAllChar("a","0")).replaceAllChar("b","1")).replaceAllChar("b","1")).replaceAllChar("b","1")).replaceAllChar("c","2")).replaceAllChar("d","3")).replaceAllChar("e","4")).replaceAllChar("f","5")).replaceAllChar("g","6")).replaceAllChar("h","7")).replaceAllChar("i","8")).replaceAllChar("j","9")).replaceAllChar(";","00")}SetSLChartMWObject(y){this.SLChartMWObject=y}loadNextODPanel(){if(null!=this.currODPanel&&(this.currODPanel.isLoadingScripData=!1,this.currODPanel.isBusy=!1),this.ODPList.length>0){this.currODPanel=this.ODPList.splice(0,1)[0],this.currODPanel.isLoadingScripData=!0,this.currODPanel.isBusy=!0,this.currODPanel.hasData=!1,this.currODPanel.clearScripData(),this.scrip=this.currODPanel.ODINScripobject,this.currChartDataType=this.currODPanel.chartDataType;let y=this.currChartDataType;this.currChartDataType=null!=y?y:this.chartView.SelectedChartDataType,this.currPeriod=this.currODPanel.dataPeriod,this.currODPanelStatus=1,this.PopulateJSChart(this.currChartDataType)}else this.LoadPanelDataCompleted()}Initialize(y,B,se,_e){if(this.isChartIQ){var Ae=n.X.getChartIQURL("adv",this.scrip.ScripDet.MktSegId,this.scrip.ScripDet.Token,a.xB.dConfigMaster.APP_CHART_API_KEY);Ae?(this.showIframe=!0,this.chartIQURL=this.sanitizer.bypassSecurityTrustResourceUrl(Ae)):(this.showIframe=!1,this.showChartIQNotAvailableError=!0)}else{if(this.isTradingView){var Ye=n.X.getChartURL("adv",this.scrip.ScripDet.MktSegId,this.scrip.ScripDet.Token,a.xB.dConfigMaster.APP_CHART_API_KEY);Ye?(this.showIframe=!0,this.tradingViewURL=this.sanitizer.bypassSecurityTrustResourceUrl(Ye)):(this.showIframe=!1,this.showChartIQNotAvailableError=!0)}var Le="";1==y&&(Le=this.scrip.ScripDet.Token,this.scrip.ScripDet.MktSegId.toString()),this.isBusyTeeChart=!0;try{var St=a.gT.C_S_CHART_TYPE_HISTORIC;1==this.LicenseType&&(St=a.gT.C_S_CHART_TYPE_INTRADAY),this.currChartDataType=Number(St),this.chartView=new T.N.AdvancedView("227",this.dvAdvancedCh
1art.nativeElement,this.LicenseType),this.chartView.Initialize(G.e.DataSources.Close,G.e.GraphTypes.Line,parseInt(St),this.scrip,"D"),this.ArrSubTokens.push(Le);var at=this.chartView.currentSelectedPanel;at.isPanelHasValidScrip?(this.ODPList.push(this.chartView.currentSelectedPanel),this.startLoadPanelData(),1==this.LicenseType&&this.changeChartPeriod()):this.chartView.updateFullScripData(at.id,null),this.isBusyTeeChart=!1,this.chartView.SelectedCursorOption=this.chartView.chartCursorViewOptions[0],this.chartView.SelectedCursorOptionfunction()}catch(We){this.logService.WriteLog("Exception: "+We.message,"Intialize()","tr_selfadvancedChart.js","")}}}startLoadPanelData(){this.currODPanel=null,this.currODPanelStatus=-1,this.loadNextODPanel()}addScripCallBack(y){if(this.scrip=y,this.scripObj=y,y&&this.chartMode==a.gT.CHART_VENDOR_TEECHART){var B=this.chartView.currentSelectedPanel;if(B.isBusy=!0,B.updateODINScripObj(y),this.ODPList.splice(0),this.ODPList.push(B),1==this.SelectedSyncOption)for(var se=0;se<this.chartView.chartPanels.length;se++){let Ae=this.chartView.chartPanels[se];Ae.isPanelHasValidScrip&&Ae.id!=B.id&&(Ae.updateODINScripObj(y),this.ODPList.push(Ae))}this.startLoadPanelData()}else if(y&&this.chartMode==a.gT.CHART_VENDOR_CHARTIQ){var _e=n.X.getChartIQURL("adv",this.scrip.ScripDet.MktSegId,this.scrip.ScripDet.Token,a.xB.dConfigMaster.APP_CHART_API_KEY);_e?this.chartIQURL=this.sanitizer.bypassSecurityTrustResourceUrl(_e):this.showIframe=!1}}changeChartType(y){this.isBusyTeeChart=!0,this.currChartDataType=y,this.chartView.changeChartType(y),this.isBusyTeeChart=!1}changeChartPeriod(){if(1==this.chartView.SelectedChartDataType){var y,B;if(isNaN(this.chartView.SelectedIntraDayDataPeriodMinutes)||isNaN(this.chartView.SelectedIntraDayDataPeriodSeconds))return alert("Invalid period."),void this.chartView.setSelectedIntraDayDataPeriod(300);if(y=parseInt(this.chartView.SelectedIntraDayDataPeriodMinutes),(B=parseInt(this.chartView.SelectedIntraDayDataPeriodSeconds))<0||B>59)return void(this.chartView.SelectedIntraDayDataPeriodSeconds="0");var se=60*y+B;if(se>T.N.MaxIntraDayPeriod)return this.chartView.setSelectedIntraDayDataPeriod(T.N.defaultIntraDayPeriod),this.chartView.SelectedIntraDayDataPeriodMinutes="5",void(this.chartView.SelectedIntraDayDataPeriodSeconds="0");this.chartView.setSelectedIntraDayDataPeriod(se)}var _e=this.chartView.currentSelectedPanel;if(this.chartView.changeChartPeriod(),_e.isPanelHasValidScrip=!0,_e.isPanelHasValidScrip){if(this.ODPList.splice(0),this.ODPList.push(_e),2==this.SelectedSyncOption){var Ae=_e.chartDataType;let Le=_e.dataPeriod;for(var Ye=0;Ye<this.chartView.chartPanels.length;Ye++){let $e=this.chartView.chartPanels[Ye];$e.isPanelHasValidScrip&&$e.id!=_e.id&&($e.changeChartPeriod(Le),$e.setchartDataType(Ae),this.ODPList.push($e))}}this.startLoadPanelData()}}displayPopup(y){this.state="",this.state="shown"}ToggleIndicatorSettings(y,B,se){this.chartView.SelectedIndicator=se,this.displayPopup("shown"),this.chartView.ToggleIndicatorSettings(y,B)}SubScribeMessages(){this.ArrSubTokens=[];var y=this.pubsubService.subscribe("MTLRES",(B,se)=>{this.ReceiveMWResponse(se)});this.ArrSubTokens.push(y)}strTrim(y){return y.toString().split(" ").join("")}ReceiveMWResponse(y){try{if(null!=y){var B=new Date(n.X.getDateTimePart(y.LTT)),se=parseFloat(y.LTP);this.chartView.addIntraDayTick(y.Scrip.MapMktSegId,y.Scrip.Token,B,se,y.Volume)}}catch(_e){}}changePanelView(y){this.chartView.changePanelView(y),this.adjustadvChart=!0,this.chartPanelClicked(y,0)}setsaveChartAsCSV(){this.chartView.saveChartAsCSV(this.saveChartAsCSV.nativeElement,this.scrip)}chartPanelClicked(y,B){this.chartView.panelClicked(y,B)}filterValue(y){}onChangeColor(y,B){y.color=B}changeIndicator(y){this.chartView.IndiViewModal.SelectedIndicator=y,this.dialogsService.openComponent("Add "+y.name,F,{selectedIndicator:this.chartView.IndiViewModal.SelectedIndicator,chartView:this.chartView,addIndicator:!0},"400","700").afterClosed().subscribe(se=>{this.onCloseIndicator(se)})}editIndicator(y){this.chartView.IndiViewModal.SelectedIndicator=y,this.dialogsService.openComponent("Edit "+y.DisplayName,F,{chartView:this.chartView,selectedIndicator:y,addIndicator:!1},"400","700").afterClosed().subscribe(se=>{this.onCloseIndicator(se)})}onCloseIndicator(y){null!=y&&null!=y.chartView&&null!=y.chartView&&(this.chartView=y.chartView)}changeCrossMarker(y){this.chartView.SelectedCursorOption=y,this.chartView.SelectedCursorOptionfunction()}deleteIndicator(y){this.chartView.SelectedIndicator=y,this.dialogsService.confirm("Are you sure you want to delete?","Ok","Cancel").subscribe(se=>{se&&this.chartView.confirmDeleteIndicators()})}changeChartTime(){this.dialogsService.openComponent("Chart Time",fe,{currChartDataType:this.chartView.SelectedChartDataType,chartView:this.chartView},"400","700").afterClosed().subscribe(B=>{this.onCloseChartTime(B)})}onCloseChartTime(y){if(null!=y){this.dChartType=y.ct;let B=y.charttype;this.chartView=y.chartView,this.changeChartType(B),null!=y.chartPer
1iod&&null!=y.chartPeriod&&(this.chartView.SelectedHistoricDataPeriod=y.chartPeriod),Number(B)==Number(a.gT.C_S_CHART_TYPE_INTRADAY)?(this.chartView.SelectedIntraDayDataPeriodMinutes=y.SelectedIntraDayDataPeriodMinutes,this.chartView.SelectedIntraDayDataPeriodSeconds=y.SelectedIntraDayDataPeriodSeconds):this.chartView.SelectedHistoricDataPeriod=y.chartPeriod,this.changeChartPeriod()}}addChartTemplate(){0!=this.chartView.currentSelectedPanel.indicatorList.length?this.dialogsService.openComponent("Add Template",Ce,{chartView:this.chartView},"400","700").afterClosed().subscribe(se=>{this.onCloseChartTemplate(se)}):this.dialogsService.alert("Minimum one Indicator require"," "," ")}onCloseChartTemplate(y){this.chartView=y.chartView}loadIndicatorTemplate(y){this.chartView.SelectedIndicatorTemplate=y,this.chartView.loadIndicatorTemplate()}changeSyncOption(y){this.chartView.SelectedChartSyncType=y,this.setSyncOption()}setSyncOption(){this.SelectedSyncOption=this.chartView.SelectedChartSyncType.Value;var y=this.chartView.currentSelectedPanel;if(this.ODPList.splice(0),y.isPanelHasValidScrip&&0!=this.SelectedSyncOption){if(1==this.SelectedSyncOption)for(var B=y.ODINScripobject,se=0;se<this.chartView.chartPanels.length;se++){let Ye=this.chartView.chartPanels[se];Ye.isPanelHasValidScrip&&Ye.id!=y.id&&(Ye.updateODINScripObj(B),this.ODPList.push(Ye))}else if(2==this.SelectedSyncOption){var _e=y.chartDataType,Ae=y.dataPeriod;for(se=0;se<this.chartView.chartPanels.length;se++){let Le=this.chartView.chartPanels[se];Le.isPanelHasValidScrip&&Le.id!=y.id&&(Le.setchartDataType(_e),Le.changeChartPeriod(Ae),this.ODPList.push(Le))}}this.startLoadPanelData()}}deleteIndicatorTemplate(y){this.chartView.SelectedIndicatorTemplate=y,this.dialogsService.confirm("Are you sure you want to delete template","Ok","Cancel").subscribe(se=>{se&&this.chartView.deleteIndicatorTemplate()})}ChartIQCommunication(y){if("chartiq"==y.data.messageCode){var B=y.data.quote;if("B"==y.data.status)var se=a.gT.C_S_ORDER_BUY_TEXT;else"S"==y.data.status&&(se=a.gT.C_S_ORDER_SELL_TEXT);if(B){var _e=B.Close,Ae=JSON.parse(y.data.scripObj),Ye=parseInt(Ae.PriceTick),Le=parseFloat(_e)*parseInt(Ae.DecimalLocator),$e=parseFloat(_e)*parseInt(Ae.DecimalLocator)%Ye;Le-=$e,$e>Ye/2&&(Le+=Ye),_e=Le/parseInt(Ae.DecimalLocator),(we=new be.Q(Ae)).OrderSide=se,we.SellPrice=_e,we.BuyPrice=_e,we.Price=_e,we.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),we.BuyQty="",we.SellQty="",we.LTP="",we.ClosePrice=Ae.ClosePrice}else{var we;Ae=JSON.parse(y.data.scripObj),Ye=parseInt(Ae.PriceTick),(we=new be.Q(Ae)).OrderSide=se,we.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),we.BuyQty="",we.SellQty="",we.LTP="",we.ClosePrice=Ae.ClosePrice,we.MarketSegID=n.X.GetMarketSegmentID(Ae.MktSegId)}1==Ae.IsIndex?this.dialogsService.alert("Order Entry is Not Allowed For This Scrip"):this.menuManager.invokeMenu(a.gT.C_S_MENU_OE_SPOT,{sourceId:a.gT.C_S_MENU_TRADING_MKTWATCH,data:we})}"chartiq_msg"==y.data.messageCode&&this.dialogsService.alert(y.data.msg),"chartiq_loaded"==y.data.messageCode&&this.chartIQFrame.nativeElement.contentWindow.postMessage({messageCode:"chartiq_resize"},"*")}}return ee.count=0,ee.\u0275fac=function(y){return new(y||ee)(l.\u0275\u0275directiveInject(a.OE),l.\u0275\u0275directiveInject(ue.gz),l.\u0275\u0275directiveInject(a._V),l.\u0275\u0275directiveInject(Re.H7),l.\u0275\u0275directiveInject(a.mQ),l.\u0275\u0275directiveInject(ue.F0),l.\u0275\u0275directiveInject(a.hC),l.\u0275\u0275directiveInject(l.NgZone),l.\u0275\u0275directiveInject(Te.H),l.\u0275\u0275directiveInject(K.F),l.\u0275\u0275directiveInject(l.ElementRef))},ee.\u0275cmp=l.\u0275\u0275defineComponent({type:ee,selectors:[["advanceChart"]],viewQuery:function(y,B){if(1&y&&(l.\u0275\u0275viewQuery(ae,7),l.\u0275\u0275viewQuery(Pe,7),l.\u0275\u0275viewQuery(E,5),l.\u0275\u0275viewQuery(R,7),l.\u0275\u0275viewQuery(Y,7),l.\u0275\u0275viewQuery(ie,5)),2&y){let se;l.\u0275\u0275queryRefresh(se=l.\u0275\u0275loadQuery())&&(B.dvAdvancedChart=se.first),l.\u0275\u0275queryRefresh(se=l.\u0275\u0275loadQuery())&&(B.advChartGiude=se.first),l.\u0275\u0275queryRefresh(se=l.\u0275\u0275loadQuery())&&(B.IndicatorSettings=se.first),l.\u0275\u0275queryRefresh(se=l.\u0275\u0275loadQuery())&&(B.saveChartImage=se.first),l.\u0275\u0275queryRefresh(se=l.\u0275\u0275loadQuery())&&(B.saveChartAsCSV=se.first),l.\u0275\u0275queryRefresh(se=l.\u0275\u0275loadQuery())&&(B.chartIQFrame=se.first)}},hostBindings:function(y,B){1&y&&l.\u0275\u0275listener("keydown",function(_e){return B.onKeyDown(_e)},!1,l.\u0275\u0275resolveDocument)("message",function(_e){return B.ChartIQCommunication(_e)},!1,l.\u0275\u0275resolveWindow)},inputs:{scripObj:"scripObj",context:"context"}
vendor: 1,774 bytes, line 1
1,decls:7,vars:7,consts:[["id","dvAdvancedChart",1,"AdvancedChart"],["dvAdvancedChart",""],[4,"ngIf"],["style","height: 99%;width: 100%;margin: 0 auto;margin-left: 6px;","frameborder","0",3,"src",4,"ngIf"],["style","position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);",4,"ngIf"],[1,"adv-header"],[1,"adv-left-header"],[1,"univer-wrap"],["headerVisibile","false",3,"addScripCallBack"],[1,"adv-menu-wrap"],[1,"chart-menu-btn"],["mat-button","",3,"matMenuTriggerFor"],["chartType","matMenu"],["mat-menu-item","",3,"ngClass","click",4,"ngFor","ngForOf"],["mat-button","",3,"click"],["studies","matMenu"],["ngFor","",3,"ngForOf"],["mat-menu-item","","class","chart-del-btn",3,"click",4,"ngIf"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["views","matMenu"],["mat-menu-item","",3,"ngClass","click"],["markers","matMenu"],["mat-menu-item","",3,"value","ngClass","click",4,"ngFor","ngForOf"],["Sync","matMenu"],[1,"chart-button-wrap"],[1,"zoom-custom","txt-white",3,"matTooltip","click"],[1,"zoom-in","txt-white",3,"matTooltip","click"],[1,"zoom-out","txt-white",3,"matTooltip","click"],[1,"zoom-reset","txt-white",3,"matTooltip","click"],["id","saveChartImage","download","CanvasDemo.png"],["saveChartImage",""],[1,"image",2,"color","white",3,"matTooltip","click"],["id","saveChartAsCSV","download","ChartData.csv",2,"display","none"],["saveChartAsCSV",""],[1,"excel",2,"color","white",3,"matTooltip","click"],[1,"adv-right-header"],["charttemplate","matMenu"],["mat-menu-item","",3,"click"],[1,"chart-wrap"],[1,"chart-graph"],["id","advChartPanelsContainer",1,"advchart-container"],["advChartPanelsContainer",""],["id","1-advancedChartPanel-table","class","wh100",4,"ngIf"],["id","2-advancedChartPanel-table","class","wh100",4,"ngIf"],["id","3-advancedCh
1artPanel-table","class","wh100",4,"ngIf"],["id","4-advancedChartPanel-table","class","wh100",4,"ngIf"],[1,"chart-data"],["id","advChartGiude",1,"advChartGuide"],["advChartGiude",""],["border","0","cellpadding","0","cellspacing","0"],["colspan","2",1,"graphName"],[3,"pageSource","mktSegId","token","symbol","scripDesc",4,"ngIf"],[1,"advChartGuideCaption"],[1,"advChartGuideValue"],[1,"advChartGuideHigh"],[1,"advChartGuideLow"],[1,"advChartGuideClose"],["border","0","cellpadding","0","cellspacing","0",1,"advChartGuideData"],[4,"ngFor","ngForOf"],["data-bind","if: ($root.chartView.advChartGuideViewStyle() == HTMLChart.PointerGuideViewTypes.Collapsed)"],[2,"height","100%"],[2,"position","relative"],[1,"chart-close-btn",3,"click"],["mat-menu-item","",1,"chart-del-btn",3,"click"],["mat-menu-item","",3,"value","ngClass","click"],["id","1-advancedChartPanel-table",1,"wh100"],["tabindex","1-advChartPanel1-div","id","1-advChartPanel1-div",1,"divChart","single-view-size",3,"click"],[3,"isSingleChart","chartpanel","selected","scripInfo","scrip","chartView"],["id","2-advancedChartPanel-table",1,"wh100"],["tabindex","2-advChartPanel1-div","id","2-advChartPanel1-div",1,"divChart","two-view-h-size",3,"click"],["tabindex","2-advChartPanel2-div","id","2-advChartPanel2-div",1,"divChart","two-view-h-size",3,"click"],["id","3-advancedCh
1artPanel-table",1,"wh100"],["tabindex","3-advChartPanel1-div","id","3-advChartPanel1-div",1,"divChart","two-view-v-size",3,"click"],["tabindex","3-advChartPanel2-div","id","3-advChartPanel2-div",1,"divChart","two-view-v-size",3,"click"],["id","4-advancedChartPanel-table",1,"wh100"],["tabindex","4-advChartPanel1-div","id","4-advChartPanel1-div",1,"divChart","four-view-size",3,"click"],["tabindex","4-advChartPanel2-div","id","4-advChartPanel2-div",1,"divChart","four-view-size",3,"click"],["tabindex","4-advChartPanel3-div","id","4-advChartPanel3-div",1,"divChart","four-view-size",3,"click"],["tabindex","4-advChartPanel4-div","id","4-advChartPanel4-div",1,"divChart","four-view-size",3,"click"],[3,"pageSource","mktSegId","token","symbol","scripDesc"],["ng-style","{color: x['color']}"],[3,"innerHTML"],[1,"advChartGuideValue",3,"innerHTML"],["frameborder","0",2,"height","99%","width","100%","margin","0 auto","margin-left","6px",3,"src"],["chartIQFrame",""],[2,"position","absolute","top","50%","left","50%","transform","translate(-50%,-50%)"]],template:function(y,B){1&y&&(l.\u0275\u0275elementStart(0,"div",0,1),l.\u0275\u0275template(2,Gt,138,60,"div",2),l.\u0275\u0275template(3,Ut,2,1,"iframe",3),l.\u0275\u0275template(4,Ht,2,1,"div",4),l.\u0275\u0275template(5,Qt,1,1,"iframe",3),l.\u0275\u0275template(6,Xt,2,1,"div",4),l.\u0275\u0275elementEnd()),2&y&&(l.\u0275\u0275styleProp("height",B.divheight),l.\u0275\u0275advance(2),l.\u0275\u0275property("ngIf",B.isTEEChart),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",B.isChartIQ&&B.showIframe),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",B.isChartIQ&&!B.showIframe),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",B.isTradingView&&B.showIframe),l.\u0275\u0275advance(1),l.\u0275\u0275property("ngIf",B.isTradingView&&!B.showIframe))},directives:[h.O5,de.e,u.lW,Ee.p6,Ee.VK,h.sg,Ee.OP,h.mk,e.gM,nt,ut.a],pipes:[i.B],encapsulation:2}),ee})()},5741:(je,ke,x)=>{x.d(ke,{I:()=>Me});var a=x(1705),T=x(3627),G=x(2774),n=x(372),l=x(8407),g=x(3910),p=x(2741),h=x(3220),o=x(7789),u=x(9162),m=x(6345),e=x(6274),f=x(823),i=x(3045),P=x(3324),_=x(688),k=x(5117);function W(ue,Re){if(1&ue&&(p.\u0275\u0275elementStart(0,"mat-option",27),p.\u0275\u0275text(1),p.\u0275\u0275elementEnd()),2&ue){const K=Re.$implicit;p.\u0275\u0275property("value",K),p.\u0275\u0275advance(1),p.\u0275\u0275textInterpolate1("",K.GraphName," ")}}function N(ue,Re){if(1&ue){const K=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"mat-select",25),p.\u0275\u0275listener("selectionChange",function(){return p.\u
10275\u0275restoreView(K),p.\u0275\u0275nextContext(3).chartView.changePriceGraph()})("ngModelChange",function(Ee){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(3).chartView.SelectedPriceGraphType=Ee}),p.\u0275\u0275template(1,W,2,2,"mat-option",26),p.\u0275\u0275elementEnd()}if(2&ue){const K=p.\u0275\u0275nextContext(3);p.\u0275\u0275property("ngModel",K.chartView.SelectedPriceGraphType),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngForOf",K.chartView.priceGraphTypeOptions)}}function Q(ue,Re){if(1&ue){const K=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"button",28),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(3).AdvanceChart()}),p.\u0275\u0275text(1,"Advanced Chart"),p.\u0275\u0275elementEnd()}}function H(ue,Re){if(1&ue){const K=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"div",11),p.\u0275\u0275elementStart(1,"div",12),p.\u0275\u0275elementStart(2,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(1)}),p.\u0275\u0275text(3,"1D"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(4,"a",13),p.\u0275\u0275listener("click",function(){return p.\u
10275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(5)}),p.\u0275\u0275text(5,"5D"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(6,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(30)}),p.\u0275\u0275text(7,"1M"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(8,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(260)}),p.\u0275\u0275text(9,"1Y"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(10,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(520)}),p.\u0275\u0275text(11,"2Y"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(12,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(1300)}),p.\u0275\u0275text(13,"5Y"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(14,"a",13),p.\u0275\u0275listener("click",function(){return p.\u
10275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(0)}),p.\u0275\u0275text(15,"MAX"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(16,"mat-form-field"),p.\u0275\u0275template(17,N,2,2,"mat-select",14),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(18,"div",15),p.\u0275\u0275template(19,Q,2,0,"button",16),p.\u0275\u0275elementStart(20,"div",17),p.\u0275\u0275elementStart(21,"ul"),p.\u0275\u0275elementStart(22,"li"),p.\u0275\u0275elementStart(23,"label",18),p.\u0275\u0275text(24,"Max:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(25,"li"),p.\u0275\u0275element(26,"span",19),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(27,"li"),p.\u0275\u0275elementStart(28,"span",20),p.\u0275\u0275text(29,"|"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(30,"li"),p.\u0275\u0275elementStart(31,"label",21),p.\u0275\u0275text(32,"X:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(33,"li"),p.\u0275\u0275element(34,"span",22),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(35,"li"),p.\u0275\u0275elementStart(36,"span",20),p.\u0275\u0275text(37,"|"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(38,"li"),p.\u0275\u0275elementStart(39,"label",23),p.\u0275\u0275text(40,"Y:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(41,"li"),p.\u0275\u0275element(42,"span",24),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd()}if(2&ue){const K=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.oneDCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.fiveDCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.oneMonCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.oneYearCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.twoYearCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.fiveYearCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.maxCss),p.\u0275\u0275advance(3),p.\u0275\u0275property("ngIf",K.advChartBtn),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngIf",K.advChartBtn),p.\u0275\u0275advance(7),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.graphValue,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(8),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.xPointer,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(8),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.yPointer,p.\u0275\u0275sanitizeHtml)}}function V(ue,Re){if(1&ue){const K=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"button",28),p.\u0275\u0275listener("click",function(){return p.\u
10275\u0275restoreView(K),p.\u0275\u0275nextContext(3).AdvanceChart()}),p.\u0275\u0275text(1,"Advanced"),p.\u0275\u0275elementEnd()}}function w(ue,Re){if(1&ue){const K=p.\u0275\u0275getCurrentView();p.\u0275\u0275elementStart(0,"div",29),p.\u0275\u0275elementStart(1,"div",12),p.\u0275\u0275elementStart(2,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(1)}),p.\u0275\u0275text(3,"1D"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(4,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(5)}),p.\u0275\u0275text(5,"5D"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(6,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(30)}),p.\u0275\u0275text(7,"1M"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(8,"a",13),p.\u0275\u0275listener("click",function(){return p.\u
10275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(260)}),p.\u0275\u0275text(9,"1Y"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(10,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(520)}),p.\u0275\u0275text(11,"2Y"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(12,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(1300)}),p.\u0275\u0275text(13,"5Y"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(14,"a",13),p.\u0275\u0275listener("click",function(){return p.\u0275\u0275restoreView(K),p.\u0275\u0275nextContext(2).setDataforHistoricOption(0)}),p.\u0275\u0275text(15,"MAX"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275template(16,V,2,0,"button",16),p.\u0275\u0275elementStart(17,"div",17),p.\u0275\u0275elementStart(18,"ul"),p.\u0275\u0275elementStart(19,"li"),p.\u0275\u0275elementStart(20,"label",18),p.\u0275\u0275text(21,"Max:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(22,"li"),p.\u0275\u0275element(23,"span",19),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(24,"li"),p.\u0275\u0275elementStart(25,"span",20),p.\u0275\u0275text(26,"|"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(27,"li"),p.\u0275\u0275elementStart(28,"label",21),p.\u0275\u0275text(29,"X:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(30,"li"),p.\u0275\u0275element(31,"span",22),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(32,"li"),p.\u0275\u0275elementStart(33,"span",20),p.\u0275\u0275text(34,"|"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(35,"li"),p.\u0275\u0275elementStart(36,"label",23),p.\u0275\u0275text(37,"Y:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(38,"li"),p.\u0275\u0275element(39,"span",24),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd()}if(2&ue){const K=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.oneDCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.fiveDCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.oneMonCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.oneYearCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.twoYearCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.fiveYearCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngClass",K.maxCss),p.\u0275\u0275advance(2),p.\u0275\u0275property("ngIf",K.advChartBtn),p.\u0275\u0275advance(7),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.graphValue,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(8),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.xPointer,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(8),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.yPointer,p.\u0275\u0275sanitizeHtml)}}function Z(ue,Re){1&ue&&(p.\u0275\u0275elementStart(0,"div"),p.\u0275\u0275element(1,"nn-progressbar",48),p.\u0275\u0275elementEnd()),2&ue&&(p.\u0275\u0275advance(1),p.\u0275\u0275property("type","ProgressBarWdgt"))}function F(ue,Re){if(1&ue&&(p.\u0275\u0275elementStart(0,"div",30,31),p.\u0275\u0275elementStart(2,"div",32,33),p.\u0275\u0275elementStart(4,"div",34,35),p.\u0275\u0275element(6,"div",36,35),p.\u0275\u0275element(8,"div",37,38),p.\u0275\u0275elementEnd(),p.\u0275\u0275template(10,Z,2,1,"div",2),p.\u0275\u0275elementStart(11,"div",39,40),p.\u0275\u0275elementStart(13,"table",41),p.\u0275\u0275elementStart(14,"tbody"),p.\u0275\u0275elementStart(15,"tr"),p.\u0275\u0275elementStart(16,"td",42),p.\u0275\u0275elementStart(17,"span"),p.\u0275\u0275text(18,"Open:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275element(19,"td",43),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(20,"tr",44),p.\u0275\u0275elementStart(21,"td",42),p.\u0275\u0275elementStart(22,"span"),p.\u0275\u0275text(23,"High:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275element(24,"td",45),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(25,"tr",46),p.\u0275\u0275elementStart(26,"td",42),p.\u0275\u0275elementStart(27,"span"),p.\u0275\u0275text(28,"Low:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275element(29,"td",45),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementStart(30,"tr",47),p.\u0275\u0275elementStart(31,"td",42),p.\u0275\u0275elementStart(32,"span"),p.\u0275\u0275text(33,"Close:"),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275element(34,"td",45),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd()),2&ue){const K=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(10),p.\u0275\u0275property("ngIf",K.showProgressBar),p.\u0275\u0275advance(9),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.Open,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(5),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.High,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(5),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.Low,p.\u0275\u0275sanitizeHtml),p.\u0275\u0275advance(5),p.\u0275\u0275property("innerHTML",K.chartView.pointerGuide.Close,p.\u0275\u0275sanitizeHtml)}}function re(ue,Re){if(1&ue&&(p.\u0275\u0275elementStart(0,"div",49),p.\u0275\u0275elementStart(1,"span"),p.\u0275\u0275text(2),p.\u0275\u0275elementEnd(),p.\u0275\u0275elementEnd()),2&ue){const K=p.\u0275\u0275nextContext(2);p.\u0275\u0275advance(2),p.\u0275\u0275textInterpolate(K.noDataFoundMsg)}}function X(ue,Re){if(1&ue&&(p.\u0275\u0275elementStart(0,"div"),p.\u0275\u0275elementStart(1,"div",5,6),p.\u0275\u0275template(3,H,43,12,"div",7),p.\u0275\u0275template(4,w,40,11,"div",8),p.\u0275\u0275elementEnd(),p.\u0275\u0275template(5,F,35,5,"div",9),p.\u0275\u0275template(6,re,3,1,"div",10),p.\u0275\u0275elementEnd()),2&ue){const K=p.\u0275\u0275nextContext();
1p.\u0275\u0275advance(3),p.\u0275\u0275property("ngIf",K.advChartBtn),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",!K.advChartBtn),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",!K.noData),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",K.noData)}}function ne(ue,Re){if(1&ue&&p.\u0275\u0275element(0,"iframe",50),2&ue){const K=p.\u0275\u0275nextContext();p.\u0275\u0275property("src",K.chartIQURL,p.\u0275\u0275sanitizeResourceUrl)}}function he(ue,Re){1&ue&&(p.\u0275\u0275elementStart(0,"span"),p.\u0275\u0275text(1,"Error retrieving chart data. Please contact administrator"),p.\u0275\u0275elementEnd())}function fe(ue,Re){if(1&ue&&(p.\u0275\u0275elementStart(0,"div",51),p.\u0275\u0275template(1,he,2,0,"span",2),p.\u0275\u0275elementEnd()),2&ue){const K=p.\u0275\u0275nextContext();p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",K.showChartIQNotAvailableError)}}function Te(ue,Re){if(1&ue&&p.\u0275\u0275element(0,"iframe",50),2&ue){const K=p.\u0275\u0275nextContext();p.\u0275\u0275property("src",K.chartIQURL,p.\u0275\u0275sanitizeResourceUrl)}}function Ce(ue,Re){1&ue&&(p.\u0275\u0275elementStart(0,"span"),p.\u0275\u0275text(1,"Error retrieving chart data. Please contact administrator"),p.\u0275\u0275elementEnd())}function be(ue,Re){if(1&ue&&(p.\u0275\u0275elementStart(0,"div",51),p.\u0275\u0275template(1,Ce,2,0,"span",2),p.\u0275\u0275elementEnd()),2&ue){const K=p.\u0275\u0275nextContext();p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",K.showChartIQNotAvailableError)}}let Me=(()=>{class ue{constructor(K,de,Ee,Ue,Ze,Tt,ot,ht){this.elementRef=K,this.httpService=de,this.logService=Ee,this.sanitizer=Ue,this.pubsubService=Ze,this.dialogService=Tt,this.router=ot,this.tradingSharedService=ht,this.IsMWScripInSync=!0,this.ContainerId="",this.UIContainerId="",this.IsLookUpScrip=!1,this.SLChartControl=null,this.context="",this.ArrSubTokens=[],this.ArrTouchlineData=[],this.LastUpdateTime=null,this.isAdvanceChartVisible=!0,this.DisplayScripName="",this.isBackVisible=!1,this.IsWebBasicChart=!1,this.ForceWebBasicChart=!1,this.IsLookUpAvailable=!0,this.xAxisTextFormat="HH:MM",this.isScripChanging=!1,this.chartView=null,this.IsHTML=!0,this.advChartBtn=!0,this.isB5HdrVisible=!0,this.oneDCss=a.gT.BTN_SELECTED_CLASS,this.noData=!1,this.noDataFoundMsg="",this.isTEEChart=!1,this.isChartIQ=!1,this.showIframe=!1,this.showChartIQNotAvailableError=!1,this.isTradingView=!1,this.showProgressBar=!1,this.ChangeScrip=function(nt){if(!this.isScripChanging&&null!=nt){var ut=this.chartView.currentSelectedPanel;this.isScripChanging=!0,ut.isBusy=!0,this.DisplayScripName=l.X.FormatScripDescForMW(nt),ut.updateODINScripObj(nt),this.chartView.clearScripData(0),this.PopulateJSChart(nt,ut.chartDataType,ut.dataPeriod)}},this.LicenseType=l.X.IsAdvancedChartAllowed?2:1,this.IntraHistoricDays=a.gT.DEFAULT_BASICINTRADAY_DAYS_NOS,this.HistoricDataCount=0,a.xB.applicationType==a.xB.MOBILE&&(this.isBackVisible=!0),this.chartMode=a.vV.getChartVendor(),this.chartMode==a.gT.CHART_VENDOR_TEECHART&&(this.isTEEChart=!0),this.chartMode==a.gT.CHART_VENDOR_CHARTIQ&&(this.isChartIQ=!0),this.chartMode==a.gT.CHART_VENDOR_TRADINGVIEW&&(this.isTradingView=!0)}ngOnInit(){T.e.chartHelper=new T.e.ChartHelper;try{this.noDataFoundMsg=a.xB.dMsgMaster.NNSL708,this.oneDCss=a.gT.BTN_SELECTED_CLASS,this.fiveDCss="",this.oneMonCss="",this.oneYearCss="",this.twoYearCss="",this.fiveYearCss="",this.maxCss="",this.Initialize([this.Scrip,1])}catch(K){this.logService.WriteLog("Exception: "+K.message,"ngOnInit()","basicchart.component.ts","")}}ngOnChanges(K){this.oneDCss=a.gT.BTN_SELECTED_CLASS,this.fiveDCss="",this.oneMonCss="",this.oneYearCss="",this.twoYearCss="",this.fiveYearCss="",this.maxCss="",K.Scrip&&(K.Scrip.previousValue&&this.chartMode==a.gT.CHART_VENDOR_TEECHART&&this.tradingSharedService.createAndSendMultiTouchLineRequest(K.Scrip.previousValue.ScripDet.MktSegId,K.Scrip.previousValue.ScripDet.Token,2),this.Initialize([this.Scrip,1]))}AdvanceChart(){this.dialogService.openComponent("Advanced Chart",n.m,this.Scrip,"1150px","800px")}SubScribeMessages(){try{var K=this.pubsubService.subscribe("MTLRES",(de,Ee)=>{this.ReceiveMWResponse(Ee)});this.ArrSubTokens.push(K)}catch(de){this.logService.WriteLog("Exception: "+de.message,"SubScribeMessages()","basicchart.component.ts","")}}setDataforHistoricOption(K){try{this.oneDCss="",this.fiveDCss="",this.oneMonCss="",this.oneYearCss="",this.twoYearCss="",this.fiveYearCss="",this.maxCss="","1"==K?this.oneDCss=a.gT.BTN_SELECTED_CLASS:"5"==K?this.fiveDCss=a.gT.BTN_SELECTED_CLASS:"30"==K?this.oneMonCss=a.gT.BTN_SELECTED_CLASS:"260"==K?this.oneYearCss=a.gT.BTN_SELECTED_CLASS:"520"==K?this.twoYearCss=a.gT.BTN_SELECTED_CLASS:"1300"==K?this.fiveYearCss=a.gT.BTN_SELECTED_CLASS:"0"==K?this.maxCss=a.gT.BTN_SELECTED_CLASS:this.oneDCss=a.gT.BTN_SELECTED_CLASS,this.HistoricDataCount=K,this.onChartTypeChange(K);var de=this.chartView.currentSelectedPanel,Ee=[];
1Ee.push(de.ODINScripobject),Ee.push(de.chartDataType),this.PopulateChart(Ee)}catch(Ue){this.logService.WriteLog("Exception: "+Ue.message,"setDataforHistoricOption()","basicchart.component.ts","")}}Initialize(K){try{var de=null,Ee=a.gT.C_S_CHART_TYPE_INTRADAY;null!=K&&null!=K&&K.length>=2&&null!=K[1]&&null!=K[1]&&(de=K[0],Ee=K[1]),this.isTEEChart&&this.initChart_TeeChart(de,Ee),this.isChartIQ&&this.initChart_ChartIQ(de),this.isTradingView&&this.initChart_TradingView(de)}catch(Ue){this.logService.WriteLog("Exception: "+Ue.message,"Initialize()","basicchart.component.ts","")}}initChart_TeeChart(K,de){var Ee={width:0,height:0};Ee.width=Number(this.width),Ee.height=Number(this.height);var Ue={width:0,height:0};Ue.width=Number(1200),Ue.height=Number(190),null!=Ee.width&&Ee.height?(this.chartView=new G.N.BasicView("227",this.elementRef.nativeElement,this.LicenseType,Ee),this.advChartBtn=!1):this.chartView=new G.N.BasicView("227",this.elementRef.nativeElement,this.LicenseType,Ue),this.chartView.Initialize(T.e.DataSources.Close,T.e.GraphTypes.Area,parseInt(de),K,a.xB.applicationType),this.SubScribeMessages(),this.LastUpdateTime=new Date,this.ChartCompressLevel=a.xB.dConfigMaster.CHART_COMPRESS_LEVEL,a.xB.applicationType==a.xB.TABLET&&(this.IsLookUpAvailable=!1,this.IsMWScripInSync=!1),this.switchChart(K),this.chartView.setChartCursor(0)}initChart_ChartIQ(K){var de=l.X.getChartIQURL("basic",K.ScripDet.MktSegId,K.ScripDet.Token,"0HVTVTkNzEg7Dwjd80T0bXbO8t8FThd");de?(this.chartIQURL=this.sanitizer.bypassSecurityTrustResourceUrl(de),this.showIframe=!0):(this.showIframe=!1,this.showChartIQNotAvailableError=!0)}initChart_TradingView(K){var de=l.X.getChartURL("basic",K.ScripDet.MktSegId,K.ScripDet.Token,"0HVTVTkNzEg7Dwjd80T0bXbO8t8FThd");de?(this.chartIQURL=this.sanitizer.bypassSecurityTrustResourceUrl(de),this.showIframe=!0):(this.showIframe=!1,this.showChartIQNotAvailableError=!0)}onChartStyleChange(K){try{this.chartView.SelectedPriceGraphType=K,this.chartView.changePriceGraph()}catch(de){this.logService.WriteLog("Exception: "+de.message,"onChartStyleChange()","basicchart.component.ts","")}}onChartTypeChange(K){try{var de;de=1==K?parseInt(a.gT.C_S_CHART_TYPE_INTRADAY):parseInt(a.gT.C_S_CHART_TYPE_HISTORIC);var Ee=this.chartView.currentSelectedPanel;null!=Ee&&null!=Ee&&(null==Ee.ODINScripobject||null==Ee.ODINScripobject?alert("Please select a valid scrip."):de!=Ee.chartDataType&&(this.chartView.changeChartType(de),this.chartView.changeChartPeriod(1),this.ChangeScrip(Ee.ODINScripobject)))}catch(Ue){this.logService.WriteLog("Exception: "+Ue.message,"onChartTypeChange()","basicchart.component.ts","")}}HandleMWSynchResponse(K){try{if(this.IsMWScripInSync){var de=this.chartView.currentSelectedPanel;(null==de.ODINScripobject||null==de.ODINScripobject)&&de.updateODINScripObj(K.ScripDetail),de.ODINScripobject.Scripobject!=K.ScripDetail&&this.ChangeScrip(K.ScripDetail)}}catch(Ee){this.logService.WriteLog("Exception: "+Ee.message,"HandleMWSynchResponse()","basicchart.component.ts","")}}ReceiveMWResponse(K){try{var de=this.chartView.currentSelectedPanel;null!=K&&null!=de.ODINScripobject&&de.ODINScripobject.ScripDet.MktSegId==K.Scrip.MktSegId&&de.ODINScripobject.ScripDet.Token==K.Scrip.Token&&a.xB.applicationType==a.xB.DESKTOP&&(this.isScripChanging||this.fn_PushDataToJSChart(K))}catch(Ee){this.logService.WriteLog("Exception: "+Ee.message,"ReceiveMWResponse()","basicchart.component.ts","")}}switchChart(K){this.ForceWebBasicChart=!0,this.ChangeScrip(K)}fn_PushDataToJSChart(K){if(this.chartView.currentSelectedPanel.chartDataType==a.gT.C_S_CHART_TYPE_INTRADAY&&null!=K){var Ee=new Date(l.X.getDateTimePart(K.LTT)),Ue=parseFloat(K.LTP);this.chartView.addIntraDayTick(K.Scrip.MapMktSegId,K.Scrip.Token,Ee,Ue,K.Volume),this.chartView.drawChart()}}OpenAdvanceChart(){var K=this.chartView.currentSelectedPanel,de=[];de.push(K.ODINScripobject),de.push(K.chartDataType)}PopulateChart(K){this.ChangeScrip(K[0])}PopulateJSChart(K,de,Ee){try{var Ue={UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:K.ScripDet.MapMktSegId,ScripTkn:K.ScripDet.Token,Symbol:K.Symbol,Lut:0,IntraHistFlag:0,IntradayDays:this.IntraHistoricDays,ChartDataType:de,ChartType:0,ChartRecords:this.HistoricDataCount,ChartContinuous:""};this.showProgressBar=!0,this.noData=!1,this.tradingSharedService.createAndSendMultiTouchLineRequest
1(K.ScripDet.MktSegId,K.ScripDet.Token,1),this.httpService.postToGetChart(a.xB.tradingAPIUrl,"GetChartData",Ue).subscribe(Ze=>{this.fn_PopulateJSChartResponce(Ze)})}catch(Ze){this.isScripChanging=!1,this.logService.WriteLog("Exception: "+Ze.message,"PopulateJSChart()","basicchart.component.ts","")}}processServiceResponce(K){try{var Ee,Ue,Ze,ot,ht,nt,ut,R,Y,ie,de="",ae=this.chartView.currentSelectedPanel,Pe=ae.ODINScripobject,E=ae.scripData;if(K.byteLength>0?(this.showProgressBar=!1,this.noData=!1,this.ChartCompressLevel==a.gT.COMPRESSION_LEVEL&&(de=l.X.UnCompressData(K))):(this.noData=!0,this.showProgressBar=!1),l.X.GetPriceFormatter(Pe.DecimalLocator.toString(),Pe.ScripDet.MapMktSegId,a.gT.C_S_INSTRUMENT_INDEX_TEXT),null!=de&&de.length>0)if(a.xB.dConfigMaster.HistoricChartWithIntradayTick==a.gT.C_S_ON&&(Y=de.split("IntradayTick"),de=Y[0],ie=Y[1]),ae.chartDataType==a.gT.C_S_CHART_TYPE_INTRADAY){for(var ge=de.replaceAll("\r\n","$").split("$"),xe=0;xe<ge.length;xe++)if((R=ge[xe].split("|")).length>=3){(Ze=l.X.ConvertToDateObj(parseInt(R[0]))).getTime();var oe=parseFloat(R[1])/parseInt(Pe.DecimalLocator);E.addNextDBTick(Ze,parseInt(R[2]),oe)}this.chartView.updateFullScripData(0,E)}else{for(ge=(de=l.X.DecryptChartData(de)).replaceAll("\r\n","$").split("$"),xe=0;xe<ge.length;xe++)Ee=ge[xe].split("="),Ze=l.X.ConvertToDateObj(parseInt(Ee[0])),Ee.length>=2&&(Ue=Ee[1].split(","),ht=(ot=parseFloat(Ue[0]))+parseFloat(Ue[1]),ut=(nt=ot-parseFloat(Ue[2]))+parseFloat(Ue[3]),Ze.getTime(),E.Open.push(ot/parseInt(Pe.DecimalLocator)),E.High.push(ht/parseInt(Pe.DecimalLocator)),E.Low.push(nt/parseInt(Pe.DecimalLocator)),E.Close.push(ut/parseInt(Pe.DecimalLocator)),E.Volume.push(parseFloat(Ue[4])),E.TickTime.push(Ze));!(0,g.isNullOrUndefined)(ie)&&""!=ie&&(R=ie.replaceAll("\r\n","").split("|")).length>=3&&(Ze=l.X.ConvertToDateObj(parseInt(R[0])),E.Open.push(parseFloat(R[1])/parseInt(Pe.DecimalLocator)),E.High.push(parseFloat(R[2])/parseInt(Pe.DecimalLocator)),E.Low.push(parseFloat(R[3])/parseInt(Pe.DecimalLocator)),E.Close.push(parseFloat(R[4])/parseInt(Pe.DecimalLocator)),E.Volume.push(parseFloat(R[5])),E.TickTime.push(Ze)),this.chartView.updateFullScripData(0,E)}this.isScripChanging=!1,ae.isBusy=!1}catch(me){this.isScripChanging=!1,this.logService.WriteLog("Exception: "+me.message,"processServiceResponce()","basicchart.component.ts","")}}fn_PopulateJSChartResponce(K){this.processServiceResponce(K)}fn_ParseValue(K){return null==K?"NA":K}resizeContainerEventHandler(){this.chartView.adjustadvChartContainer()}addTouchHandlers(){this.chartView.addTouchHandlers()}onclick(){}ngOnDestroy(){try{for(var K=0;K<this.ArrSubTokens.length;K++)this.pubsubService.unsubscribe(this.ArrSubTokens[K]);this.ArrSubTokens=[],this.chartMode==a.gT.CHART_VENDOR_TEECHART&&this.tradingSharedService.createAndSendMultiTouchLineRequest(this.Scrip.ScripDet.MktSegId,this.Scrip.ScripDet.Token,2)}catch(de){this.logService.WriteLog("Exception: "+de.message,"ngOnDestroy()","basicchart.component.ts","")}}}return ue.\u0275fac=function(K){return new(K||ue)(p.\u0275\u0275directiveInject(p.ElementRef),p.\u0275\u0275directiveInject(a.OE),p.\u0275\u0275directiveInject(a.mQ),p.\u0275\u0275directiveInject(h.H7),p.\u0275\u0275directiveInject(a.hC),p.\u0275\u0275directiveInject(o.H),p.\u0275\u0275directiveInject(u.F0),p.\u0275\u0275directiveInject(m.F))},ue.\u0275cmp=p.\u0275\u0275defineComponent({type:ue,selectors:[["basic-chart"]],inputs:{Scrip:"Scrip",isB5HdrVisible:"isB5HdrVisible",width:"width",height:"height"},features:[p.\u0275\u0275NgOnChangesFeature],decls:7,vars:5,consts:[["id","dvBasicChart",1,"BasicChart"],["dvBasicChart",""],[4,"ngIf"],["style","height: 100%;width:100%","frameborder","0",3,"src",4,"ngIf"],["style","position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);",4,"ngIf"],["id","chartda tawindow"],["chartdatawindow",""],["class","BasicChart_controls",4,"ngIf"],["class","BasicChart_controls_Grid",4,"ngIf"],["id","chart_in","class","chart_in",4,"ngIf"],["class","no_records",4,"ngIf"],[1,"BasicChart_controls"],[1,"basicchartctrlPanel"],["href","javascript:void(0);",3,"ngClass","click"],["disableOptionCentering","true",3,"ngModel","selectionChange","ngModelChange",4,"ngIf"],[1,"adv-btn-section"],["class","AdvancedCh
1art_btn",3,"click",4,"ngIf"],[1,"ChartPlotting"],["id","Span1",1,"fs12"],["id","Span2",1,"fs12",3,"innerHTML"],[1,"fs12","chartDataSeparator"],["id","Span3",1,"fs12"],["id","Span4",3,"innerHTML"],["id","Span5",1,"fs12"],["id","Span6",3,"innerHTML"],["disableOptionCentering","true",3,"ngModel","selectionChange","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"AdvancedChart_btn",3,"click"],[1,"BasicChart_controls_Grid"],["id","chart_in",1,"chart_in"],["chart_in",""],["id","_basicchartContainer"],["_basicchartContainer",""],["id","basicChart"],["basicChart",""],["id","basicChartPanel",1,"align_center"],["id","basicChartScroller",1,"align_center","margT25"],["chartScroller",""],["id","tooltipdiv",2,"display","none"],["tooltipdiv",""],["border","0","cellpadding","0","cellspacing","0"],[1,"advChartGuideCaption"],[3,"innerHTML"],[1,"advChartGuideHigh"],[1,"advChartGuideValue",3,"innerHTML"],[1,"advChartGuideLow"],[1,"advChartGuideClose"],[3,"type"],[1,"no_records"],["frameborder","0",2,"height","100%","width","100%",3,"src"],[2,"position","absolute","top","50%","left","50%","transform","translate(-50%,-50%)"]],template:function(K,de){1&K&&(p.\u0275\u0275elementStart(0,"div",0,1),p.\u0275\u0275template(2,X,7,4,"div",2),p.\u0275\u0275template(3,ne,1,1,"iframe",3),p.\u0275\u0275template(4,fe,2,1,"div",4),p.\u0275\u0275template(5,Te,1,1,"iframe",3),p.\u0275\u0275template(6,be,2,1,"div",4),p.\u0275\u0275elementEnd()),2&K&&(p.\u0275\u0275advance(2),p.\u0275\u0275property("ngIf",de.isTEEChart),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",de.isChartIQ&&de.showIframe),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",de.isChartIQ&&!de.showIframe),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",de.isTradingView&&de.showIframe),p.\u0275\u0275advance(1),p.\u0275\u0275property("ngIf",de.isTradingView&&!de.showIframe))},directives:[e.O5,e.mk,f.KE,i.gD,P.JJ,P.On,e.sg,_.ey,k.R],encapsulation:2}),ue})()},5569:(je,ke,x)=>{x.r(ke),x.d(ke,{ChartModule:()=>h});var a=x(9162),T=x(372),G=x(2741);let n=(()=>{class o{}return o.\u0275fac=function(m){return new(m||o)},o.\u0275mod=G.\u0275\u0275defineNgModule({type:o}),o.\u0275inj=G.\u0275\u0275defineInjector({imports:[[a.Bz.forChild([{path:"AdvanceChart",component:T.m},{path:"advChart/:mSegId/:tokenNo",component:T.m}])],a.Bz]}),o})();var l=x(7915),g=x(4511),b=x(5349),p=x(1545);let h=(()=>{class o{}return o.\u0275fac=function(m){return new(m||o)},o.\u0275mod=G.\u0275\u0275defineNgModule({type:o}),o.\u0275inj=G.\u0275\u0275defineInjector({providers:[],imports:[[n,b.m,l.e4,g.S,p.l]]}),o})()},1186:(je,ke,x)=>{x.d(ke,{R:()=>e});var a=x(1705),T=x(2741),G=x(2232),n=x(3094),l=x(6274),g=x(7324),b=x(5117);const p=["reportGrid"];function h(f,i){if(1&f){const P=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementStart(0,"button",13),T.\u0275\u0275listener("click",function(){return T.\u0275\u0275restoreView(P),T.\u0275\u0275nextContext().onFilterCA()}),T.\u0275\u0275elementEnd()}}function o(f,i){if(1&f){const P=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementStart(0,"button",14),T.\u0275\u0275listener("click",function(){return T.\u0275\u0275restoreView(P),T.\u0275\u0275nextContext().exportCSVCompletedAlerts()}),T.\u0275\u0275elementEnd()}}function u(f,i){if(1&f&&(T.\u0275\u0275elementStart(0,"div"),T.\u0275\u0275element(1,"reportgrid",15,16),T.\u0275\u0275elementEnd()),2&f){const P=T.\u0275\u0275nextContext();T.\u0275\u0275advance(1),T.\u0275\u0275property("showFilter",P.showFilter)("showSort",!0)("showPaging",!0)("pageSize",10)("fhTopHeight","38px")("columns",P.columns)("rows",P.rows)("isFixedHeader",!1)}}function m(f,i){1&f&&(T.\u0275\u0275elementStart(0,"div"),T.\u0275\u0275element(1,"nn-progressbar",17),T.\u0275\u0275elementEnd()),2&f&&(T.\u0275\u0275advance(1),T.\u0275\u0275property("type","PS"))}let e=(()=>{class f{constructor(P,_,k){this.httpService=P,this.logService=_,this.notificationService=k,this.isRowsForCompletedAlerts=!1,this.showFilter=!1,this.showProgressBar=!1}ngOnInit(){try{this.getAlertsLogData(),this.notificationSub=this.notificationService.notifications$.subscribe(P=>{this.displayMessage(P)})}catch(P){this.logService.WriteLog("Exception: "+P.message,"ngOnInit","alertLog.component.ts","")}}getAlertsLogData(){try{this.showProgressBar=!0,this.isRowsForCompletedAlerts=!1,this.httpService.postData(a.xB.tradingAPIUrl,"GetAlertsLog",{UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(_=>{this.getAlertsLogCompleted(_)})}catch(_){this.logService.WriteLog("Exception: "+_.message,"getAlertsLogData","alertLog.component.ts","")}}getAlertsLogCompleted(P){try{this.rows=[],this.showProgressBar=!1;var _=P.ResponseObject;if(this.initHeaders(""),_.objJSONRows.length>0){for(var k=0;k<_.objJSONRows.length;k++)this.rows.push({ScripDescription:_.objJSONRows[k].ScripDesc,AlertCondition:_.objJSONRows[k].AlertCondition,TriggeredTime:_.objJSONRows[k].TriggeredTime,SetTime:_.objJSONRows[k].SetTime,Remarks:_.objJSONRows[k].Remarks});this.isRowsForCompletedAlerts=!0}else this.isRowsForCompletedAlerts=!1}catch(W){this.logService.WriteLog("Exception: "+W.message,"getAlertsLogCompleted","alertLog.component.ts","")}}initHeaders(P){this.columns=[],this.columns.push({value:"ScripDescription",name:"Scrip Description",cType:"S"}),this.columns.push({value:"AlertCondition",name:"Alert Condition",cType:"S"}),this.columns.push({value:"TriggeredTime",name:"Triggered Time",cType:"S"}),this.columns.push({value:"SetTime",name:"Set Time",cType:"S"}),this.columns.push({value:"Remarks",name:"Remarks",cType:"S"})}refreshCompleted(){this.getAlertsLogData()}onFilterCA(){this.showFilter=!this.showFilter}exportCSVCompletedAlerts(){this.reportGrid.exportCSV("AlertsLog")}displayMessage(P){"ALERT"==P.msg.Type&&this.refreshCompleted()}}return f.\u0275fac=function(P){return new(P||f)(T.\u0275\u0275directiveInject(a.OE),T.\u0275\u0275directiveInject(a.mQ),T.\u0275\u0275directiveInject(G.gq))},f.\u0275cmp=T.\u0275\u0275defineComponent({type:f,selectors:[["alert-log"]],viewQuery:function(P,_){if(1&P&&T.\u0275\u0275viewQuery(p,5),2&P){let k;T.\u0275\u0275queryRefresh(k=T.\u0275\u0275loadQuery())&&(_.reportGrid=k.first)}},decls:24,vars:4,consts:[["id","CompletedAlerts",1,"alertlog"],["nn-dynamic-height",""],[1,"filterPanel"],[1,"zone1"],[1,"userbox"],[1,"zone2"],[1,"databox"],[1,"zone3"],[1,"iconbox"],["title","Refresh",1,"Global_Filter","btn-ref",3,"click"],["class","icon-bdr Global_Filter filtericon","title","Filter",3,"click",4,"ngIf"],["class","icon-bdr Global_Filter btn-export","title","Export",3,"click",4,"ngIf"],[4,"ngIf"],["title","Filter",1,"icon-bdr","Global_Filter","filtericon",3,"click"],["title","Export",1,"icon-bdr","Global_Filter","btn-export",3,"click"],[3,"showFilter","showSort","showPaging","pageSize","fhTopHeight","columns","rows","isFixedHeader"],["reportGrid",""],[3,"type"]],template:function(P,_){1&P&&(T.\u0275\u0275elementStart(0,"div",0),T.\u0275\u0275elementStart(1,"div",1),T.\u0275\u0275elementStart(2,"div",2),T.\u0275\u0275elementStart(3,"div",3),T.\u0275\u0275elementStart(4,"div",4),T.\u0275\u0275elementStart(5,"ul"),T.\u0275\u0275elementStart(6,"li"),T.\u0275\u0275text(7,"\xa0"),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(8,"div",5),T.\u0275\u0275elementStart(9,"div",6),T.\u0275\u0275elementStart(10,"ul"),T.\u0275\u0275elementStart(11,"li"),T.\u0275\u0275text(12,"\xa0"),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(13,"div",7),T.\u0275\u0275elementStart(14,"div",8),T.\u0275\u0275elementStart(15,"ul"),T.\u0275\u0275elementStart(16,"li"),T.\u0275\u0275elementStart(17,"button",9),T.\u0275\u0275listener("click",function(){return _.refreshCompleted()}),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(18,"li"),T.\u0275\u0275template(19,h,1,0,"button",10),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(20,"li"),T.\u0275\u0275template(21,o,1,0,"button",11),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275template(22,u,3,8,"div",12),T.\u0275\u0275template(23,m,2,1,"div",12),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd()),2&P&&(T.\u0275\u0275advance(19),T.\u0275\u0275property("ngIf",_.isRowsForCompletedAlerts),T.\u0275\u0275advance(2),T.\u0275\u0275property("ngIf",_.isRowsForCompletedAlerts),T.\u0275\u0275advance(1),T.\u0275\u0275property("ngIf",!_.showProgressBar),T.\u0275\u0275advance(1),T.\u0275\u0275property("ngIf",_.showProgressBar))},directives:[n.N,l.O5,g.i,b.R],encapsulation:2}),f})()},109:(je,ke,x)=>{x.d(ke,{V:()=>N});var a=x(2741),T=x(1705),G=x(2232),n=x(6345),l=x(3324),g=x(6274),b=x(823),p=x(3045),h=x(688),o=x(9018),u=x(328);function m(Q,H){if(1&Q&&(a.\u0275\u0275elementStart(0,"option",13),a.\u0275\u0275text(1),a.\u
10275\u0275elementEnd()),2&Q){const V=H.$implicit;a.\u0275\u0275property("value",V.ColumnId),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(V.ColumnName)}}function e(Q,H){if(1&Q&&(a.\u0275\u0275elementStart(0,"option",13),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&Q){const V=H.$implicit;a.\u0275\u0275property("value",V.ColumnId),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(V.ColumnName)}}function f(Q,H){1&Q&&(a.\u0275\u0275elementStart(0,"div",14),a.\u0275\u0275elementStart(1,"p"),a.\u0275\u0275text(2,"Columns marked with ** in the above Assigned Columns List are default Columns. These Columns cannot be moved from the List"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd())}function i(Q,H){if(1&Q&&(a.\u0275\u0275elementStart(0,"mat-option",13),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&Q){const V=H.$implicit,w=a.\u0275\u0275nextContext(2);a.\u0275\u0275property("value",w.SelectedTemplate),a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1(" ",V," ")}}function P(Q,H){if(1&Q){const V=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"li"),a.\u0275\u0275elementStart(1,"mat-form-field"),a.\u0275\u0275elementStart(2,"mat-select",15),a.\u0275\u0275listener("ngModelChange",function(Z){return a.\u0275\u0275restoreView(V),a.\u0275\u0275nextContext().SelectedTemplate=Z})("selectionChange",function(){a.\u0275\u0275restoreView(V);const Z=a.\u0275\u0275nextContext();return Z.OnSelTemplateChg(Z.SelectedTemplate,Z)}),a.\u0275\u0275template(3,i,2,2,"mat-option",4),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&Q){const V=a.\u0275\u0275nextContext();a.\u0275\u0275advance(2),a.\u0275\u0275property("ngModel",V.SelectedTemplate),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",V.ArrTemplates)}}function _(Q,H){if(1&Q){const V=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"li"),a.\u0275\u0275elementStart(1,"mat-form-field"),a.\u0275\u0275elementStart(2,"input",16),a.\u0275\u0275listener("ngModelChange",function(Z){return a.\u0275\u0275restoreView(V),a.\u0275\u0275nextContext().TemplateName=Z}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&Q){const V=a.\u0275\u0275nextContext();a.\u0275\u0275advance(2),a.\u0275\u0275property("ngModel",V.TemplateName)}}function k(Q,H){if(1&Q){const V=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"button",6),a.\u0275\u0275listener("click",function(){return a.\u0275\u0275restoreView(V),a.\u0275\u0275nextContext().AddTemplate()}),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementEnd()}2&Q&&(a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1("",a.\u0275\u0275pipeBind1(2,1,"Add")," "))}function W(Q,H){if(1&Q){const V=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"button",6),a.\u0275\u0275listener("click",function(){return a.\u0275\u0275restoreView(V),a.\u0275\u0275nextContext().DeleteTemplate()}),a.\u0275\u0275text(1),a.\u0275\u0275pipe(2,"translate"),a.\u0275\u0275elementEnd()}2&Q&&(a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(2,1,"Delete")))}let N=(()=>{class Q{constructor(V,w,Z,F,re){this.ValidationService=V,this.httpService=w,this.logService=Z,this.dialogService=F,this.tradingSharedService=re,this.CTC=this,this.CTVM=this,this.ContainerId="",this.ReportId="",this.MenuId="",this.TemplateName="",this.ProfileName="",this.isTemplateNameVisible=!1,this.isTemplateListVisible=!1,this.isNameOnFocus=!1,this.Template="",this.arrResponse="",this.CheckSession=!0,this.arrColumns=[],this.SelColumns=this.arrColumns,this.arrSelectedColumns=[],this.SelSelectedColumns=this.arrSelectedColumns,this.arrUnAssColumns=[],this.SelUnAssColumns=this.arrUnAssColumns,this.ArrTemplates=[],this.SelectedTemplate="",this.ArrParams=[],this.isAddVisible=!1,this.arrDefaultAssigned=[],this.closeDialog=new a.EventEmitter,this.Columns=function(X,ne){this.ColumnName=X,this.ColumnId=ne},this.GetController=function(X){if(this.ControllerList.containsKey(X))return this.ControllerList.items[X];if(!(this.ControllerList.keys().length>0))return null;for(var ne=0,he=this.ControllerList.keys().length;ne<he;ne++)if(this.ControllerList.keys()[ne].StartsWith(X))return this.ControllerList.items[this.ControllerList.keys()[ne]]}}ngOnInit(){this.menuId=this.context.params.menuId,200!=this.menuId&&(this.displayNote=this.context.params.menuId);var Z=(this.context.params.menuId+"|"+this.context.params.reptId+"||"+this.context.params.selectedProfile).split("|")[1];this.ReptId=Z,this.TemplateName=3==Z?T.gT.C_S_MW_SINGLE_COLTEMPLATE_NAME:"",this.init(Z)}init(V){this.ReportId=V,this.SelectedTemplate=this.TemplateName,this.getColumnTemplateDetails()}Up(){var V=this.SelSelectedColumns;if(null!=V&&null!=V){var w=this.hashSelected[V];if(0==w)this.dialogService.alert("Can not move up further");else{this.hashSelected=new T.aM;for(var Z=[],F=0;F<this.arrSelectedColumns.length;F++)if(F<w-1)Z.push(this.arrSelectedColumns[F]),this.hashSelected.add(this.arrSelectedColumns[F].ColumnId,F);else{if(F==w-1)continue;F==w?(Z.push(this.arrSelectedColumns[w]),this.hashSelected.add(this.arrSelectedColumns[w].ColumnId,w-1),Z.push(this.arrSelectedColumns[w-1]),this.hashSelected.add(this.arrSelectedColumns[w-1].ColumnId,w)):(Z.push(this.arrSelectedColumns[F]),this.hashSelected.add(this.arrSelectedColumns[F].ColumnId,F))}this.arrSelectedColumns=Z}}
1else this.dialogService.alert("Kindly select a column to move")}Down(){var V=this.SelSelectedColumns;if(null!=V&&null!=V){var w=this.hashSelected[V];if(w==this.arrSelectedColumns.length-1)this.dialogService.alert("Can not move down further");else{this.hashSelected=new T.aM;for(var Z=[],F=0;F<this.arrSelectedColumns.length;F++)if(F<w)Z.push(this.arrSelectedColumns[F]),this.hashSelected.add(this.arrSelectedColumns[F].ColumnId,F);else{if(F==w)continue;F==w+1?(Z.push(this.arrSelectedColumns[w+1]),this.hashSelected.add(this.arrSelectedColumns[w+1].ColumnId,w),Z.push(this.arrSelectedColumns[w]),this.hashSelected.add(this.arrSelectedColumns[w].ColumnId,w+1)):(Z.push(this.arrSelectedColumns[F]),this.hashSelected.add(this.arrSelectedColumns[F].ColumnId,F))}this.arrSelectedColumns=Z}}else this.dialogService.alert("Kindly select a column to move")}Unselect(){var V=this.SelSelectedColumns;if(null!=V&&null!=V)for(var w=0;w<V.length;w++){var Z=this.arrSelectedColumns[this.hashSelected[V[w]]];Z.ColumnName.startsWith("**")||(this.arrUnAssColumns.push(Z),this.hashUnSelected.add(Z.ColumnId,this.arrUnAssColumns.length-1),this.arrSelectedColumns.splice(this.arrSelectedColumns.indexOf(Z),1)),this.hashSelected=new T.aM;for(var F=0;F<this.arrSelectedColumns.length;F++)this.hashSelected.add(this.arrSelectedColumns[F].ColumnId,F)}else this.dialogService.alert("Kindly select a column to move");this.SelSelectedColumns=void 0}Select(){var V=this.SelUnAssColumns;if(null!=V&&null!=V)for(var w=0;w<V.length;w++){var Z=this.arrUnAssColumns[this.hashUnSelected[V[w]]];this.arrSelectedColumns.push(Z),this.hashSelected.add(Z.ColumnId,this.arrSelectedColumns.length-1),this.arrUnAssColumns.splice(this.arrUnAssColumns.indexOf(Z),1),this.hashUnSelected=new T.aM;for(var F=0;F<this.arrUnAssColumns.length;F++)this.hashUnSelected.add(this.arrUnAssColumns[F].ColumnId,F)}else this.dialogService.alert("Kindly select a column to move");this.SelUnAssColumns=void 0}getColumnTemplateDetails(){this.tradingSharedService.FetchColumnTemplateDetails({UserID:T.xB.User.UserId,GroupID:T.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:this.ReportId,TmpltNm:this.SelectedTemplate,ProfNm:this.ProfileName,RestToDefault:this.CheckSession,ResetUser:"Y"},this.ReportId==T.gT.C_V_COLUMNTEMPLATE_STOCKVIEW||this.ReportId==T.gT.C_V_COLUMNTEMPLATE_NETPOSITION||this.ReportId==T.gT.C_V_COLUMNTEMPLATE_ORDERBOOK||this.ReportId==T.gT.C_V_COLUMNTEMPLATE_TRADEBOOK).then(re=>{this.getTemplateProfileDetails(re)})}getColumnTemplateProfileDetails(){this.tradingSharedService.FetchColumnTemplateDetails({UserID:T.xB.User.UserId,GroupID:T.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:this.ReportId,TmpltNm:this.SelectedTemplate,ProfNm:this.ProfileName,ResetUser:"Y"}).then(w=>{this.getTemplateProfileDetails(w)})}getTemplateList(){this.httpService.postData(T.xB.tradingAPIUrl,"GetTemplateList",{UserID:T.xB.User.UserId,GroupID:T.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(w=>{this.GetTemplateList(w)})}OnSelTemplateChg(V,w){try{1==this.isAddVisible&&(this.SelectedTemplate=V,this.getColumnTemplateProfileDetails())}catch(Z){this.logService.WriteLog("Exception: "+Z.message,"SelExchange.subscribe()","tr_OrderEntry.js","")}}GetTemplateList(V){if(V.ResponseStatus){""==V.ResponseObject?(this.isAddVisible=!1,this.isTemplateNameVisible=!0,this.isNameOnFocus=!0,this.isTemplateListVisible=!1):(this.isTemplateNameVisible=!1,this.isTemplateListVisible=!0,this.isAddVisible=!0);for(var w=[],Z=V.ResponseObject.Table,F=0;F<Z.length;F++)w.push(Z[F].nTemplateName);this.ArrTemplates=w,w.length>0&&(this.SelectedTemplate=w[0]),this.getColumnTemplateDetails()}}findValue(V){try{return V.split(T.gT.C_S_NAMEVALUE_DELIMITER)[1]}catch(Z){this.dialogService.alert("Exception column view: "+Z.message),this.ValidationService.addError("Profile","LoadProfileList")}}getTemplateProfileDetails(V){this.fn_ParseResponse(V,!1)}getTemplateDetails(V){this.fn_ParseResponse(V,!0)}fn_ParseResponse(V,w){if(this.arrColumns=[],this.arrSelectedColumns=[],this.arrUnAssColumns=[],this.arrDefaultAssigned=[],V.ResponseStatus&&(this.hashSelected=new T.aM,this.hashUnSelected=new T.aM,null!=V.ResponseObject)){for(var Z=V.ResponseObject,re=Z.AssignedColumns.split(T.gT.C_S_FIELD_DELIMITER),ne=Z.AssignedColumnNames.split(T.gT.C_S_FIELD_DELIMITER),Te=Z.CompleteColumnList,Ce=0;Ce<Te.length;Ce++)Te[Ce].cIsDefault==T.gT.C_V_TEMPLATE_CISDEFAULTValue&&this.arrDefaultAssigned.push(Te[Ce]);var be=0;for(Ce=0;Ce<re.length;Ce++)if(!((Me=new this.Columns(ne[Ce],re[Ce])).ColumnId==T.gT.C_V_TAG_SORID.toString()&&T.xB.dConfigMaster.CONST_SOR_ALLOWED==T.gT.C_S_OFF||"News"==Me.ColumnName||"Calls"==Me.ColumnName||Me.ColumnId==T.gT.C_V_TAG_ORDERFROM.toString()&&T.xB.dConfigMaster.CONST_SOR_ALLOWED==T.gT.C_S_OFF||Me.ColumnId==T.gT.C_S_TAG_REFRESH.toString()||"Remove"==Me.ColumnId||"Action"==Me.ColumnId||"TrendIndicator"==Me.ColumnId)){if(Me.ColumnId==T.gT.C_V_TAG_ALERTREMARK.toString()){if(T.xB.dConfigMaster.CONST_ALERT_ALLOWED!=T.gT.C_S_ON)continue;if(!T.vV.IsAllowedClientFacility(T.gT.C_S_FACILITY_ALERT))continue}for(let Ue=0;Ue<this.arrDefaultAssigned.length;Ue++)Me.ColumnId==this.arrDefaultAssigned[Ue].sColumnId&&(Me.ColumnName="**"+Me.ColumnName);this.arrSelectedColumns.push(Me),this.hashSelected.add(Me.ColumnId,be),be++}var ue=0,Re=Z.CompleteColumnList;for(Ce=0;Ce<Re.length;Ce++){var Me,K=Re[Ce];if(!((Me=new this.Columns(K.sColumnName,K.sColumnId)).ColumnId==T.gT.C_V_TAG_SORID.toString()&&T.xB.dConfigMaster.CONST_SOR_ALLOWED==T.gT.C_S_OFF||Me.ColumnId==T.gT.C_V_TAG_ORDERFROM.toString()&&T.xB.dConfigMaster.CONST_SOR_ALLOWED==T.gT.C_S_OFF||Me.ColumnId==T.gT.C_S_TAG_REFRESH.toString()||"Remove"==Me.ColumnId||"Action"==Me.ColumnId||"TrendIndicator"==Me.ColumnId||"News"==Me.ColumnName||"Calls"==Me.ColumnName)){if(Me.ColumnId==T.gT.C_V_TAG_ALERTREMARK.toString()){if(T.xB.dConfigMaster.CONST_ALERT_ALLOWED!=T.gT.C_S_ON)continue;if(!T.vV.IsAllowedClientFacility(T.gT.C_S_FACILITY_ALERT))continue}this.arrColumns.push(Me),this.hashSelected.containsKey(Me.ColumnId)||(this.arrUnAssColumns.push(Me),this.hashUnSelected.add(Me.ColumnId,ue++))}}var de=Z.TemplateName;this.Template=de,this.TemplateName=this.Template,this.SelectedTemplate=de}}AddTemplate(){this.isAddVisible=!1,this.TemplateName="",this.isTemplateNameVisible=!0,this.isTemplateListVisible=!1,this.isNameOnFocus=!0,this.TemplateName="",this.ProfileName="",this.getColumnTemplateDetails()}DeleteTemplate(){this.dialogService.confirm("Do you want to delete this template?","Yes","No").subscribe(V=>{V?this.fn_YesDeleteTemplate():this.fn_NoNeedDelete()})}fn_YesDeleteTemplate(){new T.HT;var w="";this.isTemplateListVisible&&(w=this.SelectedTemplate),""!=w||3!=this.ReportId?this.httpService.postData(T.xB.tradingAPIUrl,"DeleteColumnTemplateDetails",{UserID:T.xB.User.
1UserId,GroupID:T.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltNm:w}).subscribe(F=>{this.DeleteColumnTemplateDetails(F)}):this.dialogService.alert("Please select the Template")}DeleteColumnTemplateDetails(V){V.ResponseStatus?(this.dialogService.alert("Template Deleted sucessfully"),this.closeDialog.emit(!0)):this.dialogService.alert("Error while saving the details")}fn_NoNeedDelete(){}Cancel(){this.TemplateName="",this.isTemplateNameVisible=!1,this.isNameOnFocus=!1,this.isTemplateListVisible=!0}SaveDetails(){new T.HT;var w="",X="";if(X=this.isTemplateListVisible?this.SelectedTemplate:this.TemplateName.toString().toUpperCase(),0==this.isAddVisible)for(var ne=0;ne<this.ArrTemplates.length;ne++)if(X==this.ArrTemplates[ne])return void this.dialogService.alert(T.xB.dMsgMaster.NNSL188);if(3==this.ReptId&&(X=T.gT.C_S_MW_SINGLE_COLTEMPLATE_NAME),0!=this.arrSelectedColumns.length){for(var he=0;he<this.arrSelectedColumns.length;he++)w+=this.arrSelectedColumns[he].ColumnId+"$";w=w.substring(0,w.length-1),this.httpService.postData(T.xB.tradingAPIUrl,"SaveColumnTemplateDetails",{UserID:T.xB.User.UserId,GroupID:T.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:this.ReportId,TmpltNm:X,ProfNm:this.ProfileName,AssgndColIds:w,TmpltSortColId:""}).subscribe(Te=>{this.SaveTemplateDetails(Te)})}else this.dialogService.alert(T.xB.dMsgMaster.NNSL187)}SaveTemplateDetails(V){V.ResponseStatus?(this.closeDialog.emit(!0),this.dialogService.alert("Details saved sucessfully"),this.RefreshReport=this.arrSelectedColumns):this.dialogService.alert("Error while saving the details")}RefreshReport(){this.GetController(this.MenuId).RefreshAfterSaveTemplate(this.ReportId)}ResetToDefault(){this.tradingSharedService.FetchColumnTemplateDetails({UserID:T.xB.User.UserId,GroupID:T.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:this.ReportId,TmpltNm:this.SelectedTemplate,ProfNm:this.ProfileName,RestToDefault:!1,ResetUser:"N"}).then(Z=>{this.getTemplateProfileDetails(Z)})}}return Q.\u0275fac=function(V){return new(V||Q)(a.\u0275\u0275directiveInject(T.RJ),a.\u0275\u0275directiveInject(T.OE),a.\u0275\u0275directiveInject(T.mQ),a.\u0275\u0275directiveInject(G.Hr),a.\u0275\u0275directiveInject(n.F))},Q.\u0275cmp=a.\u0275\u0275defineComponent({type:Q,selectors:[["column-view"]],inputs:{context:"context"},outputs:{closeDialog:"closeDialog"},decls:45,vars:18,consts:[[1,"columnview-wrap"],[1,"columnview-table-wrap"],[1,"table-col"],["multiple","multiple",1,"columnview-selectionbox",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"table-col","table-btn"],[1,"mat-raised-button",3,"click"],[1,"clear"],["class","columnview-note",4,"ngIf"],[1,"columnview-bottom","padd-top12"],[1,"button-box"],[4,"ngIf"],["class","mat-raised-button",3,"click",4,"ngIf"],[3,"value"],[1,"columnview-note"],["disableOptionCentering","true","tabindex","1",3,"ngModel","ngModelChange","selectionChange"],["matInput","","type","text","id","AddNewTemplate","placeholder","Add new template","maxlength","10","name","TemplateName",3,"ngModel","ngModelChange"]],template:function(V,w){1&V&&(a.\u0275\u0275elementStart(0,"div",0),a.\u0275\u0275elementStart(1,"div",1),a.\u0275\u0275elementStart(2,"div",2),a.\u0275\u0275elementStart(3,"h3"),a.\u0275\u0275text(4,"All Columns"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(5,"select",3),a.\u0275\u0275listener("ngModelChange",function(F){return w.SelUnAssColumns=F}),a.\u0275\u0275template(6,m,2,2,"option",4),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(7,"div",5),a.\u0275\u0275elementStart(8,"button",6),a.\u0275\u0275listener("click",function(){return w.Select()}),a.\u0275\u0275text(9),a.\u0275\u0275pipe(10,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275element(11,"br"),a.\u0275\u0275elementStart(12,"button",6),a.\u0275\u0275listener("click",function(){return w.Unselect()}),a.\u0275\u0275text(13),a.\u0275\u0275pipe(14,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275element(15,"br"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(16,"div",2),a.\u0275\u0275elementStart(17,"h3"),a.\u0275\u0275text(18,"Selected Columns"),a.\u0275\u0275elementEnd(),a.\u
10275\u0275elementStart(19,"select",3),a.\u0275\u0275listener("ngModelChange",function(F){return w.SelSelectedColumns=F}),a.\u0275\u0275template(20,e,2,2,"option",4),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(21,"div",5),a.\u0275\u0275elementStart(22,"button",6),a.\u0275\u0275listener("click",function(){return w.Up()}),a.\u0275\u0275text(23,"Up"),a.\u0275\u0275elementEnd(),a.\u0275\u0275element(24,"br"),a.\u0275\u0275elementStart(25,"button",6),a.\u0275\u0275listener("click",function(){return w.Down()}),a.\u0275\u0275text(26,"Down"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275element(27,"div",7),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(28,f,3,0,"div",8),a.\u0275\u0275elementStart(29,"div",9),a.\u0275\u0275elementStart(30,"div",10),a.\u0275\u0275elementStart(31,"ul"),a.\u0275\u0275template(32,P,4,2,"li",11),a.\u0275\u0275template(33,_,3,1,"li",11),a.\u0275\u0275elementStart(34,"li"),a.\u0275\u0275template(35,k,3,3,"button",12),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(36,"li"),a.\u0275\u0275elementStart(37,"button",6),a.\u0275\u0275listener("click",function(){return w.SaveDetails()}),a.\u0275\u0275text(38),a.\u0275\u0275pipe(39,"translate"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(40,"li"),a.\u0275\u0275elementStart(41,"button",6),a.\u0275\u0275listener("click",function(){return w.ResetToDefault()}),a.\u0275\u0275text(42,"Reset To Default"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(43,"li"),a.\u0275\u0275template(44,W,3,3,"button",12),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()),2&V&&(a.\u0275\u0275advance(5),a.\u0275\u0275property("ngModel",w.SelUnAssColumns),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",w.arrUnAssColumns),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(10,12,"Select")),a.\u0275\u0275advance(4),a.\u0275\u0275textInterpolate(a.\u0275\u0275pipeBind1(14,14,"UnSelect")),a.\u0275\u0275advance(6),a.\u0275\u0275property("ngModel",w.SelSelectedColumns),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",w.arrSelectedColumns),a.\u0275\u0275advance(8),a.\u0275\u0275property("ngIf",w.displayNote),a.\u0275\u0275advance(4),a.\u0275\u0275property("ngIf",w.isTemplateListVisible),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",w.isTemplateNameVisible),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf",w.isAddVisible),a.\u0275\u0275advance(3),a.\u0275\u0275textInterpolate1("",a.\u0275\u0275pipeBind1(39,16,"Save")," "),a.\u0275\u0275advance(6),a.\u0275\u0275property("ngIf",w.isAddVisible))},directives:[l.K7,l.JJ,l.On,g.sg,g.O5,l.YN,l.Kr,b.KE,p.gD,h.ey,o.Nt,l.Fj,l.nD],pipes:[u.B],encapsulation:2}),Q})()},9877:(je,ke,x)=>{x.d(ke,{D:()=>G});var a=x(1705),T=x(2741);let G=(()=>{class l{constructor(b,p){this.pubsubService=b,this.logService=p}initComm(){a.xB.Worker=new n(this.pubsubService,this.logService),a.xB.Worker.InitFTWorker("scripts/communicator.js?"+a.xB.cacheBrustNo,a.xB)}}return l.\u0275fac=function(b){return new(b||l)(T.\u0275\u0275inject(a.hC),T.\u0275\u0275inject(a.mQ))},l.\u0275prov=T.\u0275\u0275defineInjectable({token:l,factory:l.\u0275fac}),l})();class n{constructor(g,b){this.pubsubService=g,this.logService=b,this.IsInit=!1,this.WebComWorker=null,this.bcommunicatorloaded=!1,this.requestArr=[]}fn_FTSocketCom(g,b){try{"undefined"!=typeof Worker?(a.xB.IsWebSocketSupported=!0,this.fn_SocketCall(g,b)):(a.xB.IsWebSocketSupported="WebSocket"in window,this.fn_CallFlashPollyfill(g)),this.fn_DoRequestRegister(),this.fn_SendResponseToUiThread(null,null)}catch(p){this.logService.WriteLog("Exception: "+p.message,"fn_FTSocketCom()","tr_FTComWebWorker.js","")}}fn_SocketCall(g,b){try{"WebSocket"in window?(a.xB.IsWebSocketSupported=!0,this.WebComWorker=new Worker(g),this.WebComWorker.onmessage=this.fn_onmessage.bind(this)):this.fn_CallFlashPollyfill(g)}catch(p){this.logService.WriteLog("Exception: "+p.message,"fn_SocketCall()","tr_FTComWebWorker.js","")}}fn_CallFlashPollyfill(g){try{this.WebComWorker=this.fn_FTWorker(g);var b=this.getTempGlobalObject();fn_InitializeFTWorker(b)}catch(p){this.logService.WriteLog("Exception: "+p.message,"fn_CallFlashPollyfill()","tr_FTComWebWorker.js","")}}getTempGlobalObject(){return{dConfigMaster:a.xB.dConfigMaster,dMsgMaster:a.xB.dMsgMaster,User:a.xB.User,applicationType:a.xB.applicationType,DESKTOP:a.xB.DESKTOP,TABLET:a.xB.TABLET,MOBILE:a.xB.MOBILE,isFlashON:a.xB.isFlashON,URL_NETNETWCF:a.xB.netNetAPIUrl,URL_TRADINGWCF:a.xB.tradingAPIUrl,SecurePort:a.xB.SecurePort,LogErrorOnConsole:a.xB.LogErrorOnConsole,LogErrorOnServer:a.xB.LogErrorOnServer}}fn_onmessage(g){if("OnInit"==g.data.Id){var b=this.getTempGlobalObject();this.WebComWorker.postMessage({Global:JSON.stringify(b)}),this.bcommunicatorloaded=!0;for(var p=0;p<this.requestArr.length;p++)this.WebComWorker.postMessage({Request:this.requestArr[p].Request,HandlerName:this.requestArr[p].HandlerName});this.requestArr=[]}else this.fn_SendResponseToUiThread(g.data.Id,g.data.Message)}fn_FTWorker(g){try{return this.fn_InternalFTWorker(g)}catch(p){this.logService.WriteLog("Exception: "+p.message,"fn_FTWorker()","tr_FTComWebWorker.js","")}}fn_InternalFTWorker(g){}fn_DoRequestRegister(){try{this.pubsubService.subscribe("OEREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandleOrderEntryRequest"})}),this.pubsubService.subscribe("OLREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandleOnlineRequest"})}),this.pubsubService.subscribe("MTLREQ",(g,b)=>{this.bcommunicatorloaded?this.WebComWorker.postMessage({Request:b,HandlerName:"HandleTouchLineRequest"}):this.requestArr.push({Request:b,HandlerName:"HandleTouchLineRequest"})}),this.pubsubService.subscribe("B5REQ",(g,b)=>{this.bcommunicatorloaded?this.WebComWorker.postMessage({Request:b,HandlerName:"HandleBestFiveRequest"}):this.requestArr.push({Request:b,HandlerName:"HandleBestFiveRequest"})}),this.pubsubService.subscribe("INDEXINFOREQ",(g,b)=>{this.bcommunicatorloaded?this.WebComWorker.postMessage({Request:b,HandlerName:"HandleMoreIndicesInfoRequest"}):this.requestArr.push({Request:b,HandlerName:"HandleMoreIndicesInfoRequest"})}),this.pubsubService.subscribe("TGLREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandleTopGainerRequest"})}),this.pubsubService.subscribe("MASREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandleMostActiveRequest"})}),this.pubsubService.subscribe("POSCONVREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandlePositionConversionRequest"})}),this.pubsubService.subscribe("MR",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"ManualRefresh"})}),this.pubsubService.subscribe("MKTSTATUSREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"ManualMarketStatusRequest"})}),this.pubsubService.subscribe("SOCKETDISCONNECT",g=>{this.WebComWorker.postMessage({HandlerName:"HandleSocketDisconnect"})}),this.pubsubService.subscribe("INDEXDETAILSREQ",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandleIndexDetailsRequest"})}),this.pubsubService.subscribe("STARTSTOPBROADCAST",(g,b)=>
1{this.WebComWorker.postMessage({Request:b,HandlerName:"StartStopBroadcast"})}),this.pubsubService.subscribe("APPSUSPEND",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandlePauseBroadcastRequest"})}),this.pubsubService.subscribe("APPRESUME",(g,b)=>{this.WebComWorker.postMessage({Request:b,HandlerName:"HandleResumeBroadcastRequest"})}),this.pubsubService.subscribe("MLOEREQ",(g,b)=>{this.bcommunicatorloaded?this.WebComWorker.postMessage({Request:b,HandlerName:"HandleMLOrderEntryRequest"}):this.requestArr.push({Request:b,HandlerName:"HandleMLOrderEntryRequest"})})}catch(g){this.logService.WriteLog("Exception: "+g.message,"fn_DoRequestRegister()","tr_FTComWebWorker.js","")}}fn_SendResponseToUiThread(g,b){try{switch(g){case"MTLRES":this.pubsubService.publish(g,b);break;case"OLRES":a.xB.OnlineMessageStore.push(b),this.pubsubService.publish(g,b);break;case"B5RES":case"INDEXINFORES":case"TGLRES":case"MASRES":this.pubsubService.publish(g,b);break;case"MKTSTATUSRES":a.xB.InitialMktStatusResp=b,this.pubsubService.publish(g,b);break;case"AIRES":case"NEWSRES":case"INDEXDETAILSRES":case"TERRES":this.pubsubService.publish(g,b);break;case"AutoRefreshMode":this.pubsubService.publish(g,b);case"DEFAULTRES":this.pubsubService.publish(g,b)}}catch(p){this.logService.WriteLog("Exception: "+p.message,"fn_SendResponseToUiThread()","tr_FTComWebWorker.js","")}}
1InitFTWorker(g,b){try{this.fn_FTSocketCom(g,b)}catch(p){this.logService.WriteLog("Exception: "+p.message,"InitFTWorker()","tr_FTComWebWorker.js","")}}}},2533:(je,ke,x)=>{x.d(ke,{h:()=>o});var a=x(1705),T=x(2741),G=x(4471),n=x(2232),l=x(6228),g=x(6274),b=x(328);function p(u,m){if(1&u&&(T.\u0275\u0275elementStart(0,"li"),T.\u0275\u0275text(1),T.\u0275\u0275pipe(2,"translate"),T.\u0275\u0275element(3,"br"),T.\u0275\u0275elementStart(4,"span"),T.\u0275\u0275text(5),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd()),2&u){const e=T.\u0275\u0275nextContext();T.\u0275\u0275advance(1),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(2,2,"Net Available")),T.\u0275\u0275advance(4),T.\u0275\u0275textInterpolate(e.NetAvailFunds)}}function h(u,m){if(1&u&&(T.\u0275\u0275elementStart(0,"li"),T.\u0275\u0275text(1),T.\u0275\u0275pipe(2,"translate"),T.\u0275\u0275element(3,"br"),T.\u0275\u0275elementStart(4,"span"),T.\u0275\u0275text(5),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd()),2&u){const e=T.\u0275\u0275nextContext();T.\u0275\u0275advance(1),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(2,2,"Net Available with P/L")),T.\u0275\u0275advance(4),T.\u0275\u0275textInterpolate(e.NetAvailFunds)}}let o=(()=>{class u{constructor(e,f,i,P,_,k){this.logService=e,this.httpService=f,this.tradingService=i,this.ref=P,this.pubsubService=_,this.notificationService=k,this.dcPeriodicities=[],this.dcSeqPeriodicities=[],this.dcTempPeriodicities=[],this.SelPeriodicity="",this.TotalAvailFunds="",this.TotalUtilFunds="",this.NetAvailFunds="",this.bShowDropDown=!0,this.NetAvailableWithPL=!1}ngOnInit(){try{a.xB.dConfigMaster["Net_Available_with_P/L"]==a.gT.C_S_ON&&(this.NetAvailableWithPL=!0),this.tradingService.fillPeriodicities().subscribe(e=>{this.getPeriodicitiesCompleted(e)}),this.notificationSub=this.notificationService.notifications$.subscribe(e=>{"TRADE"==e.messageType&&this.getFundsSummary(""!=this.SelPeriodicity?this.SelPeriodicity.Periodicity:this.dcPeriodicities[0].Periodicity)}),this.pubsubService.subscribe("FundviewRefresh",(e,f)=>{this.SelPeriodicity=f,this.getFundsSummary(this.SelPeriodicity.Periodicity)})}catch(e){this.logService.WriteLog("Exception: "+e.message,"ngOnInit()","fundsSummary.component.ts","")}}getPeriodicitiesCompleted(e){try{if(null!=e&&null!=e.ResponseObject){var f=e.ResponseObject.Table1;a.xB.dConfigMaster.FINALYTICS_FUNDSVIEW_SHOWDROPDOWN==a.gT.C_S_ON?(this.SelPeriodicity=f[0],this.getFundsSummary(this.SelPeriodicity.Periodicity)):f.length>0&&(f.length>3&&f.splice(0-(f.length-3),f.length-3),this.dcPeriodicities=f,this.getFundsSummary(this.dcPeriodicities[0].Periodicity))}}catch(i){this.logService.WriteLog("Exception: "+i.message,"getPeriodicitiesCompleted()","fundsSummary.component.ts","")}}onSelPeriodicity(e){try{this.getFundsSummary(e.key)}catch(f){this.logService.WriteLog("Exception: "+f.message,"onSelPeriodicity()","fundsSummary.component.ts","")}}getFundsSummary(e){try{this.httpService.postData(a.xB.tradingAPIUrl,"GetFundsSummary",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",IntPeriodicities:e}).subscribe(i=>{this.getFundsSummaryCompleted(i)})}catch(i){this.logService.WriteLog("Exception: "+i.message,"getFundsSummary()","fundsSummary.component.ts","")}}getFundsSummaryCompleted(e){try{if(null!=e&&!0===e.ResponseStatus&&""!=e.ResponseObject){var i=e.ResponseObject;this.TotalAvailFunds=i.TF,this.TotalUtilFunds=Math.abs(i.TU),this.NetAvailFunds=i.TA,this.ref.markForCheck()}}catch(P){this.logService.WriteLog("Exception: "+P.message,"getFundsSummaryCompleted()","fundsSummary.component.ts","")}}refresh(){this.TotalAvailFunds="",this.TotalUtilFunds="",this.NetAvailFunds="",this.getFundsSummary(""!=this.SelPeriodicity?this.SelPeriodicity.Periodicity:this.dcPeriodicities[0].Periodicity)}}return u.\u0275fac=function(e){return new(e||u)(T.\u0275\u0275directiveInject(a.mQ),T.\u0275\u0275directiveInject(a.OE),T.\u0275\u0275directiveInject(G.D),T.\u0275\u0275directiveInject(T.ChangeDetectorRef),T.\u0275\u0275directiveInject(a.hC),T.\u0275\u0275directiveInject(n.gq))},u.\u0275cmp=T.\u0275\u0275defineComponent({type:u,selectors:[["funds-summary"]],decls:17,vars:11,consts:[[1,"Funds_Summary"],[1,"icon-bdr","Global_Filter","btn-ref","mr-10","float-right",3,"matTooltip","click"],[4,"ngIf"]],template:function(e,f){1&e&&(T.\u0275\u0275elementStart(0,"div",0),T.\u0275\u0275elementStart(1,"button",1),T.\u0275\u0275listener("click",function(){return f.refresh()}),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(2,"ul"),T.\u0275\u0275elementStart(3,"li"),T.\u0275\u0275text(4),T.\u0275\u0275pipe(5,"translate"),T.\u0275\u0275element(6,"br"),T.\u0275\u0275elementStart(7,"span"),T.\u0275\u0275text(8),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementStart(9,"li"),T.\u0275\u0275text(10),T.\u0275\u0275pipe(11,"translate"),T.\u0275\u0275element(12,"br"),T.\u0275\u0275elementStart(13,"span"),T.\u0275\u0275text(14),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275template(15,p,6,4,"li",2),T.\u0275\u0275template(16,h,6,4,"li",2),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd()),2&e&&(T.\u0275\u0275advance(1),T.\u0275\u0275property("matTooltip","Refresh"),T.\u0275\u0275advance(3),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(5,7,"Total Deposit")),T.\u0275\u0275advance(4),T.\u0275\u0275textInterpolate(f.TotalAvailFunds),T.\u0275\u0275advance(2),T.\u0275\u0275textInterpolate(T.\u0275\u0275pipeBind1(11,9,"Utilized Margin")),T.\u0275\u0275advance(4),T.\u0275\u0275textInterpolate(f.TotalUtilFunds),T.\u0275\u0275advance(1),T.\u0275\u0275property("ngIf",!f.NetAvailableWithPL),T.\u0275\u0275advance(1),T.\u0275\u0275property("ngIf",f.NetAvailableWithPL))},directives:[l.gM,g.O5],pipes:[b.B],encapsulation:2,changeDetection:0}),u})()},3511:(je,ke,x)=>{x.d(ke,{N:()=>p});var a=x(1705),T=x(8407),G=x(5607),n=x(2741),l=x(6274),g=x(3493);function b(h,o){if(1&h&&(n.\u0275\u0275elementStart(0,"div",2),n.\u0275\u0275element(1,"best-of-five",3),n.\u0275\u0275elementEnd()),2&h){const u=o.$implicit,m=n.\u0275\u0275nextContext();n.\u0275\u0275advance(1),n.\u0275\u0275property("Scrip",u)("PageSource",m.IpPageSource)("isB5DataVisible",m.isB5DataDisplay)("isB5HdrVisible",!1)("isExchNameVisible",m.isENVisible)("isBuySellLinkVisible",m.isBSLinkVisible)("isLookUp",!1)("orderEntry",m.orderEntry)}}let p=(()=>{class h{constructor(u,m){this.logService=u,this.httpService=m,this.isB5DataVisible=!0,this.listOfScrips=[],this.isENVisible=!0,this.isBSLinkVisible=!0,this.isB5DataDisplay=!0,this.title="combinedDepth"}ngOnInit(){try{this.PageSource==a.gT.C_V_ORDERENTRY_PAGE?(this.IpPageSource=this.PageSource,this.isENVisible=this.isExchNameVisible,this.isBSLinkVisible=this.isBuySellLinkVisible,this.isB5DataDisplay=this.isB5DataVisible,this.oderEntryClass=!0):(this.isENVisible=this.isExchNameVisible,this.isBSLinkVisible=this.isBuySellLinkVisible,this.oderEntryClass=!1),void 0!==this.Scrip&&null!=this.Scrip&&(this.listOfScrips.push(this.Scrip),this.populateCombinedDepthScripDetails(this.Scrip))}catch(u){this.logService.WriteLog("Exception: "+u.message,"ngOnInit()","combinedDepth.component.ts","")}}populateCombinedDepthScripDetails(u){0!=u.ScripDet.Token&&this.httpService.postData(a.xB.tradingAPIUrl,"GetCombinedDepth",{UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ScripTkn:u.ScripDet.Token,MrgnPlsBitIndx:u.ScripDet.MktSegId,MapMktSegId:u.InstrumentName}).subscribe(e=>{this.getCombinedDepthScripDetails(e)})}getCombinedDepthScripDetails(u){var e,m=u.ResponseObject,i=a.xB.ExchManager.AllowedSegments;if(null!=m)for(var P=m.length,_=0;_<P&&(e=this.parseScrip(m[_]),!(i.ContainsKey=e.ScripDet.MapMktSegId)||(i[e.ScripDet.MapMktSegId]==a.gT.C_S_ON&&this.listOfScrips.push(e),this.PageSource!=a.gT.C_V_ORDERENTRY_PAGE||2!=this.listOfScrips.length));_+=2);}parseScrip(u){for(var e,m=u.split(a.gT.C_S_FIELD_DELIMITER),f=new G.u,i=0,P=m.length;i<P;i++)if(""!=m[i])switch(e=m[i].split(a.gT.C_S_NAMEVALUE_DELIMITER),parseInt(e[0])){case parseInt(a.gT.C_S_TAG_SYMBOL):f.Symbol=e[1];break;case parseInt(a.gT.C_S_TAG_SERIES):f.Series=e[1];break;case a.gT.C_V_TAG_SCRIPDESC:f.SecurityDesc=e[1];break;case parseInt(a.gT.C_S_TAG_INSTRUMENTID):f.InstrumentName=e[1];break;case parseInt(a.gT.C_S_TAG_EXPIRYDATE):f.ExpiryDate=e[1];break;case parseInt(a.gT.C_S_TAG_STRIKEPRICE):f.StrikePrice=0==e[1]?"NA":e[1];break;case parseInt(a.gT.C_S_TAG_OPTIONTYPE):f.OptionType=e[1];break;case parseInt(a.gT.C_S_TAG_MARKETLOT):f.MarketLot=e[1];break;case parseInt(a.gT.C_S_TAG_PRICETICK):f.PriceTick=e[1];break;case parseInt(a.gT.C_S_EXCHNAME):f.ExchangeName=e[1];break;case parseInt(a.gT.C_S_TAG_DECIMALLOCATOR):case parseInt(a.gT.C_S_TAG_DECIMALLOCATOR):f.DecimalLocator=e[1];break;case parseInt(a.gT.C_S_TAG_MKTSEGID):f.ScripDet.MktSegId=parseInt(e[1],10);break;case parseInt(a.gT.C_S_TAG_SCRIPTOKEN):f.ScripDet.Token=e[1]}return f.MWSecurityDesc=T.X.FormatScripDescForMW(f),f.ScripDet.MapMktSegId=T.X.GetMappedMarketSegmentId(f.ScripDet.MktSegId),f}
1ngOnChanges(u){void 0!==u.Scrip&&null!=u.Scrip&&!u.Scrip.firstChange&&(this.listOfScrips=[],this.listOfScrips.push(u.Scrip.currentValue),this.populateCombinedDepthScripDetails(u.Scrip.currentValue))}}return h.\u0275fac=function(u){return new(u||h)(n.\u0275\u0275directiveInject(a.mQ),n.\u0275\u0275directiveInject(a.OE))},h.\u0275cmp=n.\u0275\u0275defineComponent({type:h,selectors:[["combined-Depth"]],inputs:{Scrip:"Scrip",PageSource:"PageSource",isExchNameVisible:"isExchNameVisible",isBuySellLinkVisible:"isBuySellLinkVisible",isB5DataVisible:"isB5DataVisible",orderEntry:"orderEntry"},features:[n.\u0275\u0275NgOnChangesFeature],decls:2,vars:2,consts:[[3,"ngClass"],["class","combined-div watch-tab-box",4,"ngFor","ngForOf"],[1,"combined-div","watch-tab-box"],[3,"Scrip","PageSource","isB5DataVisible","isB5HdrVisible","isExchNameVisible","isBuySellLinkVisible","isLookUp","orderEntry"]],template:function(u,m){1&u&&(n.\u0275\u0275elementStart(0,"div",0),n.\u0275\u0275template(1,b,2,8,"div",1),n.\u0275\u0275elementEnd()),2&u&&(n.\u0275\u0275property("ngClass",m.oderEntryClass?"combined-depthOE":"combined-depth"),n.\u0275\u0275advance(1),n.\u0275\u0275property("ngForOf",m.listOfScrips))},directives:[l.mk,l.sg,g.t],encapsulation:2}),h})()},7479:(je,ke,x)=>{x.d(ke,{U:()=>Z});var a=x(1705),T=x(5607);class G{constructor(){this.IndexHistory=[0,0,0,0,0],this.ScripDetail=new T.u,this.IndexSparkLine=[],this.state=!0,this.LTPTrend="left idx_nochg",this.DecimalLocator=100,this.SparklineVisible=!0,this.ClosingIndexValue=null,this.iPercChange=0,this.intHistorySize=5,this._IndexValue="",this.oldLTP=0,this.SymbolTrend="left idx_nochg"}GetNoOfZeros(re){re=parseFloat(re);for(var X=0,ne=0;0==ne;)ne=re%10,re/=10,X++;return X-1}get IndexValue(){return this._IndexValue}set IndexValue(re){this._IndexValue=re;var X=this._IndexValue;this.iNetChange=(this._IndexValue-this.ClosingIndexValue).toString(),0==parseFloat(this.iNetChange)?this.SymbolTrend="left idx_nochg":parseFloat(this.iNetChange)>0?this.SymbolTrend="left idx_up":parseFloat(this.iNetChange)<0&&(this.SymbolTrend="left idx_dwn"),X>this.oldLTP?this.LTPTrend="left idx_up":X<this.oldLTP&&(this.LTPTrend="left idx_dwn"),0==this.oldLTP&&(0==parseFloat(this.iNetChange)?this.LTPTrend="left idx_nochg":parseFloat(this.iNetChange)>0?this.LTPTrend="left idx_up":parseFloat(this.iNetChange)<0&&(this.LTPTrend="left idx_dwn")),this.oldLTP=this._IndexValue,!isNaN(parseFloat(this.ClosingIndexValue))&&0!=parseFloat(this.ClosingIndexValue)&&(this.iPercChange=parseFloat(this.iNetChange)/parseFloat(this.ClosingIndexValue)*100,this.iPercChange="("+this.iPercChange.toFixed(2)+"%)",this.PercentChange=this.iPercChange);var ne=this.GetNoOfZeros(this.DecimalLocator);this.iNetChange=this.iNetChange>0?"+"+parseFloat(this.iNetChange).toFixed(ne):parseFloat(this.iNetChange).toFixed(ne),this.NetChange=this.iNetChange,this.IndexSparkLine=this.IndexHistory}}class n{constructor(){this.OperationType=0,this.ScripList=[],this.By
1passRequestStore=!1}}var l=x(8407),g=x(2282),b=x(4381),p=x(372),h=x(2741),o=x(2232),u=x(9162),m=x(1739),e=x(9873),f=x(6274),i=x(8906),P=x(823),_=x(9018),k=x(3324),W=x(9117),N=x(6228),Q=x(4699);const H=["indexSearchView"];function V(F,re){if(1&F&&(h.\u0275\u0275elementStart(0,"div",16),h.\u0275\u0275element(1,"div",17),h.\u0275\u0275elementStart(2,"div",18),h.\u0275\u0275elementStart(3,"span"),h.\u0275\u0275text(4),h.\u0275\u0275elementEnd(),h.\u0275\u0275text(5,"\xa0 "),h.\u0275\u0275elementStart(6,"span"),h.\u0275\u0275text(7),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(8,"div",19),h.\u0275\u0275elementStart(9,"span",20),h.\u0275\u0275text(10),h.\u0275\u0275elementEnd(),h.\u0275\u0275text(11,"\xa0\xa0 "),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(12,"div",19),h.\u0275\u0275elementStart(13,"span"),h.\u0275\u0275text(14),h.\u0275\u0275elementEnd(),h.\u0275\u0275text(15,"\xa0\xa0 "),h.\u0275\u0275elementStart(16,"span"),h.\u0275\u0275text(17),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd()),2&F){const X=re.$implicit;h.\u0275\u0275advance(4),h.\u0275\u0275textInterpolate(X.ScripDetail._ExchangeName),h.\u0275\u0275advance(3),h.\u0275\u0275textInterpolate(X.ScripDetail.MWSecurityDesc),h.\u0275\u0275advance(1),h.\u0275\u0275property("className",X.LTPTrend),h.\u0275\u0275advance(2),h.\u0275\u0275textInterpolate(X.IndexValue),h.\u0275\u0275advance(2),h.\u0275\u0275property("className",X.SymbolTrend),h.\u0275\u0275advance(2),h.\u0275\u0275textInterpolate(X.NetChange),h.\u0275\u0275advance(3),h.\u0275\u0275textInterpolate(X.PercentChange)}}function w(F,re){if(1&F){const X=h.\u0275\u0275getCurrentView();h.\u0275\u0275elementStart(0,"mat-list-item"),h.\u0275\u0275elementStart(1,"mat-checkbox",21),h.\u0275\u0275listener("ngModelChange",function(he){return h.\u0275\u0275restoreView(X).$implicit.selected=he})("change",function(he){const fe=h.\u0275\u0275restoreView(X),Te=fe.$implicit,Ce=fe.index;return h.\u0275\u0275nextContext().checkIdxList(Te,Ce,he)}),h.\u0275\u0275text(2),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd()}if(2&F){const X=re.$implicit;h.\u0275\u0275advance(1),h.\u0275\u0275property("checked",X.selected)("ngModel",X.selected),h.\u0275\u0275advance(1),h.\u0275\u0275textInterpolate1(" ",X.ScripDesc," ")}}let Z=(()=>{class F{constructor(X,ne,he,fe,Te,Ce,be){this.pubSubService=X,this.httpService=ne,this.zone=he,this.logService=fe,this.ref=Te,this.dialogsService=Ce,this.router=be,this.indiceSrNo=null,this.isResetRotateIndex=null,this.scripKey=[],this.arrSubTokens=[],this.currentDisplayIndex=[],this.arrMasterIndices=[],this.arrMasterIndicesCopy=[],this.indexSearch="",this.marketSegmentId="-1",this.mapmarketSegmentId="",this.iCounter=0,this.iLoopCounter=0,this.validationError="",this.arrGlobalIndx=[],this.showIndexError=!1,this.timer=null,this.tempIDXScripList=[],this.tempScripKeyList=[],this.setIndexRotateInterval=null,this.IDXScripList=[],this.objTLReqGL=new n}set indexMaster(X){this.arrMasterIndicesCopy=X,this.arrMasterIndices=X}set userSelectedIndex(X){null!=X&&this.fn_GetIndexInfoDataCompleted(X)}set IndicesSrNo(X){this.indiceSrNo=X}detectChange(){this.ref.markForCheck()}ngOnInit(){try{this.SubScribeMessages(),this.FillGlobalIndexArray()}catch(X){this.logService.WriteLog("Exception: "+X.message,"ngOnInit()","index.component.ts","")}}SubScribeMessages(){this.arrSubTokens=[];var X=X=this.pubSubService.subscribe("MTLRES",(ne,he)=>{this.HandleTLIndexResponse(he)});this.arrSubTokens.push(X)}FillGlobalIndexArray(){this.arrGlobalIndx.push(a.gT.C_V_GLOBALINDEX_DJ.toString()),this.arrGlobalIndx.push(a.gT.C_V_GLOBALINDEX_SP.toString()),this.arrGlobalIndx.push(a.gT.C_V_GLOBALINDEX_FTSE100.toString())}saveIndexArr(){for(var X=this.arrMasterIndicesCopy.filter(Ze=>Ze.selected),ne=this.IDXScripList.slice(),he=this.IDXScripList.slice(),fe=[],Te=0;Te<ne.length;Te++){for(var Ce=!1,be=0;be<X.length;be++)ne[Te].ScripDetail.ScripDet.MapMktSegId==X[be].MapMktSegId&&ne[Te].ScripDetail.ScripDet.Token==X[be].Token&&(Ce=!0);if(!Ce){fe.Add(ne[Te].ScripDetail.ScripDet);for(var Me=-1,ue=0;ue<he.length;ue++){ne[Te].ScripDetail.ScripDet.MapMktSegId==he[ue].ScripDetail.ScripDet.MapMktSegId&&ne[Te].ScripDetail.ScripDet.Token==he[ue].ScripDetail.ScripDet.Token&&(Me=ue);break}he.splice(Me,1)}}fe.length>0&&this.fn_SendIndexInfoRequest(fe,2);var Re=[];for(Te=0;Te<X.length;Te++){for(Ce=!1,be=0;be<ne.length;
1be++)X[Te].MapMktSegId==ne[be].ScripDetail.ScripDet.MapMktSegId&&X[Te].Token==ne[be].ScripDetail.ScripDet.Token&&(Ce=!0);if(!Ce){var K=new T.u,de=new g.A;de.MktSegId=X[Te].MarketSegmentId,de.MapMktSegId=X[Te].MapMktSegId,de.Token=X[Te].Token,K.ScripDet=de,K.ExchangeName=l.X.GetExchangeName(de.MktSegId),K.MWSecurityDesc=X[Te].ScripDesc.trim(),K.Symbol=X[Te].Symbol.trim(),K.Series="",K.InstrumentName="",K.ExpiryDate="",K.StrikePrice="",K.OptionType="";var Ee=100;"26017"==de.Token&&(Ee=1e4),K.DecimalLocator=Ee.toString(),K.PriceTick="100";var Ue=new G;Re.Add(de),Ue.ScripDetail=K,he.push(Ue)}}Re.length>0&&this.fn_SendIndexInfoRequest(Re,1),this.IDXScripList=he,this.iCounter=this.IDXScripList.length,this.SaveProfile(),this.isResetRotateIndex=!0,this.RotateIndex(this.isResetRotateIndex)}filterIndexMaster(){this.arrMasterIndices=this.indexSearch.length>0?this.arrMasterIndicesCopy.filter(X=>X.ScripDesc.toLowerCase().indexOf(this.indexSearch.toLowerCase())>-1):this.sortIndices(this.arrMasterIndicesCopy)}checkIdxList(X,ne,he){var fe=this.arrMasterIndicesCopy.filter(Te=>Te.selected);X.selected?fe.length>3&&(he.checked=!1,he.source.checked=!1,this.arrMasterIndices[ne].selected=!1,this.showIndexError=!0,this.validationError="Maximum 3 indices can be selected",null!=this.timer&&(clearTimeout(this.timer),this.validationError="Maximum 3 indices can be selected",this.showIndexError=!0),this.timer=setTimeout(()=>{this.showIndexError=!1},2e3)):fe.length<1&&(this.validationError="Minimum 1 index should be selected",this.showIndexError=!0,this.timer=setTimeout(()=>{this.showIndexError=!1},2e3),he.checked=!0,he.source.checked=!0,this.arrMasterIndices[ne].selected=!0)}sortArrIndex(){this.indexSearch="",this.arrMasterIndices=this.arrMasterIndicesCopy,this.arrMasterIndices=this.sortIndices(this.arrMasterIndices),document.getElementById("indexSearchView"),this.indexPanel.nativeElement.scrollTop=0}checkIdxSelected(){for(var X=0;X<this.IDXScripList.length;X++)for(var ne=0;ne<this.arrMasterIndices.length;ne++)this.IDXScripList[X].ScripDetail.ScripDet.Token==this.arrMasterIndices[ne].Token&&this.IDXScripList[X].ScripDetail.ScripDet.MapMktSegId==this.arrMasterIndices[ne].MapMktSegId&&(this.arrMasterIndices[ne].selected=!0);this.arrMasterIndices=this.sortIndices(this.arrMasterIndices),this.detectChange()}sortIndices(X){var ne=X.filter(fe=>fe.selected),he=X.filter(fe=>!fe.selected);return ne.concat(he)}SaveProfile(){try{for(var X=[],ne=0;ne<this.IDXScripList.length;ne++)X.push({MWSecurityDesc:this.IDXScripList[ne].ScripDetail.MWSecurityDesc,Token:this.IDXScripList[ne].ScripDetail.ScripDet.Token,MapMktSegId:this.IDXScripList[ne].ScripDetail.ScripDet.MapMktSegId});var he={UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,IndiceSrNo:this.indiceSrNo,Indice:JSON.stringify(X)};this.httpService.postData(a.xB.tradingAPIUrl,"SaveMoreAndGlobalIndexInfoDetails",he).subscribe(fe=>{})}catch(fe){this.logService.WriteLog("Exception: "+fe.message,"SaveProfile()","index.component.ts","")}}fn_SendIndexInfoRequest(X,ne){try{for(var he=[],fe=[],Te=0;Te<X.length;Te++)this.arrGlobalIndx.Contains(X[Te].Token)?fe.push(X[Te]):he.push(X[Te]);var Ce=[];if(Ce.push.apply(Ce,a.xB.User.LoginMode==a.gT.C_S_STREAMING_MODE?he:X),null!=Ce&&Ce.length>0){var be=new n;be.OperationType=ne;for(var Me=[],ue=0;ue<Ce.length;ue++)Me[ue]={},Me[ue].Token=Ce[ue].Token,Me[ue].MapMktSegId=Ce[ue].MapMktSegId,Me[ue].MktSegId=Ce[ue].MktSegId;be.ScripList=Me,this.objTLReqGL=be,this.pubSubService.publish("MTLREQ",be)}if(a.xB.User.LoginMode==a.gT.C_S_STREAMING_MODE){for(var Re=0;Re<fe.length;Re++)fe[Re].IsGlobal="1";if(null!=fe&&fe.length>0){var K=new b.U;K.OperationType=ne;for(var de=[],Ee=0;Ee<fe.length;Ee++)de[Ee]={},de[Ee].Token=fe[Ee].Token,de[Ee].MapMktSegId=fe[Ee].MapMktSegId,de[Ee].MktSegId=fe[Ee].MktSegId;K.ScripList=de,this.pubSubService.publish("MTLREQ",K)}}}catch(Ue){this.logService.WriteLog("Exception: "+Ue.message,"SendIndexInfoRequest()","index.component.ts","")}}Publish(){this.pubSubService.publish("MTLREQ",this.objTLReqGL)}HandleTLIndexResponse(X){if(null!=X){try{for(var ne=!1,he=this.IDXScripList.length;he--;)this.IDXScripList[he].ScripDetail.ScripDet.Token==X.Scrip.Token&&this.IDXScripList[he].ScripDetail.ScripDet.MktSegId==X.Scrip.MktSegId&&(this.IDXScripList[he].ClosingIndexValue=X.ClosePrice,this.IDXScripList[he].DecimalLocator=X.DecimalLocator,this.IDXScripList[he].IndexValue=X.LTP,this.IDXScripList[he].OpenPrice=X.OpenPrice,this.IDXScripList[he].ClosePrice=X.ClosePrice,this.IDXScripList[he].HighPrice=X.HighPrice,this.IDXScripList[he].LowPrice=X.LowPrice,ne=!0),this.currentDisplayIndex.length>0&&this.currentDisplayIndex[0].ScripDetail.ScripDet.Token==X.Scrip.Token&&this.currentDisplayIndex[0].ScripDetail.ScripDet.MktSegId==X.Scrip.MktSegId&&(this.currentDisplayIndex[0].ClosingIndexValue=X.ClosePrice,this.currentDisplayIndex[0].DecimalLocator=X.DecimalLocator,this.currentDisplayIndex[0].OpenPrice=X.OpenPrice,this.currentDisplayIndex[0].ClosePrice=X.ClosePrice,this.currentDisplayIndex[0].HighPrice=X.HighPrice,this.currentDisplayIndex[0].LowPrice=X.LowPrice,ne=!0)}catch(Te){this.logService.WriteLog("Exception: "+Te.message,"HandleTLIndexResponse()","index.component.ts","")}ne&&this.detectChange()}}RotateIndex(X){try{X?(clearInterval(this.setIndexRotateInterval),this.FillTimerarray(),this.detectChange(),this.setIndexRotateInterval=setInterval(()=>{this.FillTimerarray()},5e3)):0==this.iLoopCounter&&(this.FillTimerarray(),this.iLoopCounter++),X||(this.setIndexRotateInterval=setInterval(()=>{this.FillTimerarray()},5e3))}catch(ne){this.logService.WriteLog("Exception: "+ne.message,"RotateIndex()","index.component.ts","")}}FillTimerarray(){if(this.IDXScripList.length>0){this.currentDisplayIndex.splice(0,this.currentDisplayIndex.length),this.iCounter==this.IDXScripList.length&&(this.iCounter=0);for(var X=0;X<this.IDXScripList.length;X++)if(this.iCounter==X){this.currentDisplayIndex.push(this.IDXScripList[X]),this.iCounter++;break}this.detectChange()}}fn_GetIndexInfoDataCompleted(X){try{this.IDXScripList=[];var ne=[];this.tempIDXScripList=[];for(var fe=a.xB.ExchManager.AllowedSegments,Te=X,Ce=0;Ce<Te.length;Ce++)if(""!=Te[Ce]){var be=Te[Ce].MapMktSegId,Me=Te[Ce].Token,ue=l.X.GetMarketSegmentID(parseInt(be,10));if(fe.containsKey(be)&&fe[be]==a.gT.C_S_ON)for(var Re=0;Re<this.arrMasterIndices.length;Re++)if(this.arrMasterIndices[Re].MapMktSegId==be&&this.arrMasterIndices[Re].Token==Me){var K=this.getIndexScripObj(ue,be,Me,this.arrMasterIndices[Re]);this.scripKey.Add(K.objScrp),ne.Add(K.objIndexScrip)}}for(0==ne.length&&(be=this.arrMasterIndices[0].MapMktSegId,ue=l.X.GetMarketSegmentID(parseInt(be,10)),K=this.getIndexScripObj(ue,be,Me=this.arrMasterIndices[0].Token,this.arrMasterIndices[0]),this.scripKey.Add(K.objScrp),ne.Add(K.objIndexScrip)),Re=0;Re<ne.length;Re++){var de=new G;de.ScripDetail=ne[Re],this.tempScripKeyList.push(de.ScripDetail.ScripDet),this.tempIDXScripList.push(de)}this.scripKey=this.tempScripKeyList,this.IDXScripList=this.tempIDXScripList,this.fn_SendIndexInfoRequest(this.scripKey,1),this.IDXScripList.length>0&&(this.checkIdxSelected(),this.isResetRotateIndex=!1,this.RotateIndex(this.isResetRotateIndex))}catch(Ee){this.logService.WriteLog("Exception: "+Ee.message,"GetIndexInfoDataCompleted()","index.component.ts","")}}getIndexScripObj(X,ne,he,fe){var Te=new T.u,Ce=new g.A;Ce.MktSegId=X,Ce.MapMktSegId=ne,Ce.Token=he,Te.ScripDet=Ce,Te.Series="",Te.InstrumentName="",Te.ExpiryDate="",Te.StrikePrice="",Te.OptionType="",Te.IsIndex=1;var be=100;return"26017"==Ce.Token&&(be=1e4),Te.DecimalLocator=be.toString(),Te.PriceTick="100",Te.ExchangeName=l.X.GetExchangeName(Ce.MktSegId),Te.MWSecurityDesc=fe.ScripDesc,Te.Symbol=fe.Symbol,{objScrp:Ce,objIndexScrip:Te}}AdvanceChart(){this.dialogsService.openComponent("Advance Chart",p.m,this.currentDisplayIndex[0].ScripDetail,"1400px","800px")}}return F.\u0275fac=function(X){return new(X||F)(h.\u0275\u0275directiveInject(a.hC),h.\u0275\u0275directiveInject(a.OE),h.\u0275\u0275directiveInject(h.NgZone),h.\u0275\u0275directiveInject(a.mQ),h.\u0275\u0275directiveInject(h.ChangeDetectorRef),h.\u0275\u0275directiveInject(o.Hr),h.\u0275\u0275directiveInject(u.F0))},F.\u0275cmp=h.\u0275\u0275defineComponent({type:F,selectors:[["app-index"]],viewQuery:function(X,ne){if(1&X&&h.\u0275\u0275viewQuery(H,7),2&X){let he;h.\u0275\u0275queryRefresh(he=h.\u0275\u0275loadQuery())&&(ne.indexPanel=he.first)}},inputs:{indexMaster:"indexMaster",userSelectedIndex:"userSelectedIndex",IndicesSrNo:"IndicesSrNo"},decls:22,vars:6,consts:[["dropdown","",3,"onOpen","onClose"],["href","javascript:void(0);","dropdown-open","","data-toggle","dropdown",1,"dropdown-toggle"],[1,"indexPanel"],[1,"lestSection"],["id","index-container","class","index-container",4,"ngFor","ngForOf"],[1,"rightSection"],[1,"mat-select-arrow"],[1,"caret"],["dropdown-not-closable-zone","",1,"dropdown-index"],[2,"margin-left","20px"],["matInput","","maxlength","30","placeholder","Search",3,"ngModel","ngModelChange"],[1,"mat-error_droopD",3,"hidden"],[1,"dropdown",2,"overflow","auto","height","250px"],["indexSearchView",""],[4,"ngFor","ngForOf"],[1,"Nifty_Chart_icon",3,"matTooltip","click"],["id","index-container",1,"index-container"],["id","lstIndex",1,"lstIndex","list-style-none"],[2,"display","inline-block","float","left","margin-top","3px"],[2,"display","inline-block",3,"className"],[2,"padding-left","5px"],[3,"checked","ngModel","ngModelChange","change"]],template:function(X,ne){1&X&&(h.\u0275\u0275elementStart(0,"div"),h.\u0275\u0275elementStart(1,"div",0),h.\u0275\u0275listener("onOpen",function(){return ne.sortArrIndex()})("onClose",function(){return ne.saveIndexArr()}),h.\u0275\u0275elementStart(2,"div",1),h.\u0275\u0275elementStart(3,"div",2),h.\u0275\u0275elementStart(4,"div",3),h.\u0275\u0275template(5,V,18,7,"div",4),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(6,"div",5),h.\u0275\u0275element(7,"span",6),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275element(8,"span",7),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(9,"ul",8),h.\u0275\u0275elementStart(10,"li"),h.\u0275\u0275elementStart(11,"mat-form-field",9),h.\u0275\u0275elementStart(12,"input",10),h.\u0275\u0275listener("ngModelChange",function(fe){return ne.indexSearch=fe})("ngModelChange",function(){return ne.filterIndexMaster()}),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275element(13,"br"),h.\u0275\u0275elementStart(14,"div",11),h.\u0275\u0275text(15),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(16,"li",12,13),h.\u0275\u0275elementStart(18,"mat-list"),h.\u0275\u0275template(19,w,3,3,"mat-list-item",14),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementStart(20,"div"),h.\u0275\u0275elementStart(21,"div",15),h.\u0275\u0275listener("click",function(){return ne.AdvanceChart()}),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd(),h.\u0275\u0275elementEnd()),2&X&&
1(h.\u0275\u0275advance(5),h.\u0275\u0275property("ngForOf",ne.currentDisplayIndex),h.\u0275\u0275advance(7),h.\u0275\u0275property("ngModel",ne.indexSearch),h.\u0275\u0275advance(2),h.\u0275\u0275property("hidden",!ne.showIndexError),h.\u0275\u0275advance(1),h.\u0275\u0275textInterpolate1(" ",ne.validationError," "),h.\u0275\u0275advance(4),h.\u0275\u0275property("ngForOf",ne.arrMasterIndices),h.\u0275\u0275advance(2),h.\u0275\u0275property("matTooltip","Chart"))},directives:[m.w,e.X,f.sg,i.i,P.KE,_.Nt,k.Fj,k.nD,k.JJ,k.On,W.i$,N.gM,W.Tg,Q.oG],encapsulation:2,changeDetection:0}),F})()},5197:(je,ke,x)=>{x.d(ke,{Q:()=>Lr});var a=x(1705),T=x(8497),G=x(8732),n=x(9473),l=x(8407),g=x(3305),b=x(8638),p=x(2552),h=x(109),o=x(1330),u=x(1263),m=x(6413),e=x(372),f=x(2345),i=x(2741),P=x(7789),_=x(4471),k=x(7689),W=x(2184),N=x(6345),Q=x(9162),H=x(1767),V=x(6274),w=x(823),Z=x(3045),F=x(3324),re=x(6228),X=x(2150),ne=x(1129),he=x(9009),fe=x(5117),Te=x(688),Ce=x(7617),be=x(9018),Me=x(5019),ue=x(582),Re=x(8339),K=x(4143);const de=["nvd3"];let Ee=(()=>{class D{constructor(c){this.themeService=c,this.data=[],this.options={chart:{type:"lineChart",noData:"",height:15,width:30,margin:{top:0,right:0,bottom:0,left:0},useInteractiveGuideline:!0,showXAxis:!1,showYAxis:!1,showLegend:!1,pointActive:function(C){return null},interactiveLayer:{tooltip:{headerEnabled:!1}},yAxis:{tickFormat:function(C){return d3.format(",.2f")(C)},showMaxMin:!1}}}}ngOnInit(){this.drawChart(),this.themeSub=this.themeService.themeChangeDetect.subscribe(()=>{this.drawChart()})}ngOnDestroy(){this.themeSub&&this.themeSub.unsubscribe()}ngOnChanges(c){c.inputdata&&this.drawChart()}drawChart(){this.data=this.lineChartData()}lineChartData(){var c=[];if(new Date,null!=this.inputdata){if(this.inputdata.length>0||null!=this.inputdata)for(var v=0;v<this.inputdata.length;v++)c.push({x:v+1,y:parseFloat(this.inputdata[v])});return[{values:c,color:a.US.SPARKLINE_LINE_CHART}]}}}return D.\u0275fac=function(c){return new(c||D)(i.\u0275\u0275directiveInject(a.fY))},D.\u0275cmp=i.\u0275\u0275defineComponent({type:D,selectors:[["sparkline"]],viewQuery:function(c,C){if(1&c&&i.\u0275\u0275viewQuery(de,7),2&c){let v;i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.nvd3=v.first)}},inputs:{inputdata:"inputdata"},features:[i.\u0275\u0275NgOnChangesFeature],decls:3,vars:2,consts:[[3,"options","data"],["nvd3",""]],template:function(c,C){1&c&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275element(1,"nvd3",0,1),i.\u0275\u0275elementEnd()),2&c&&(i.\u0275\u0275advance(1),i.\u0275\u0275property("options",C.options)("data",C.data))},directives:[K.ZV],encapsulation:2,changeDetection:0}),D})();var Ue=x(1414),Ze=x(3493);let Tt=(()=>{class D{constructor(c,C){this.logService=c,this.httpService=C,this.Resistance4=0,this.Resistance3=0,this.Resistance2=0,this.Resistance1=0,this.PivotPoint=0,this.Support1=0,this.Support2=0,this.Support3=0,this.Support4=0,this.PPFormula="",this.CalculationMethod="",this.PrevDayOpen="0.0000",this.PrevDayHigh="0.0000",this.PrevDayLow="0.0000",this.PrevDayClose="0.0000",this.Range=0,this.FBRatio1=0,this.FBRatio2=0,this.FBRatio3=0,this.FBRatio4=0,this.SelDecimalloc=100,this.SelectedPivotPointFormula="",this.SelectedCalcMethod="",this.arrPivotPointFormula=[a.gT.C_S_PP_FORMULA_HLC,a.gT.C_S_PP_FORMULA_HLO,a.gT.C_S_PP_FORMULA_HLCO,a.gT.C_S_PP_FORMULA_HLCC,a.gT.C_S_PP_FORMULA_HLOO,a.gT.C_S_PP_FORMULA_HL,a.gT.C_S_PP_FORMULA_HC,a.gT.C_S_PP_FORMULA_LC],this.arrCalcMethod=[a.gT.C_S_PP_METHOD_CLASSIC,a.gT.C_S_PP_METHOD_WOODIE,a.gT.C_S_PP_METHOD_CAMARILLA,a.gT.C_S_PP_METHOD_FIBONACCI]}ngOnInit(){void 0!==this.Scrip&&null!=this.Scrip&&this.getPivotPointData(this.Scrip)}getPivotPointData(c){try{this.httpService.postData(a.xB.tradingAPIUrl,"GetPPDataForSpecifiedScrip",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:c.ScripDet.MktSegId,ScripTkn:c.ScripDet.Token}).subscribe(v=>{this.getPivotPointDataCompleted(v)})}catch(v){this.logService.WriteLog("Exception: "+v.message,"getPivotPointData()","pivotPointData.component.ts","")}}getPivotPointDataCompleted(c){try{if(1==c.ResponseStatus&&c.ResponseObject.Table.length>0){var C=c.ResponseObject.Table;null!=C&&(this.PrevDayOpen=C[0].PrevOpen,this.PrevDayHigh=C[0].PrevHigh,this.PrevDayLow=C[0].PrevLow,this.PrevDayClose
1=C[0].PrevClose,this.calculatePivotPoint())}}catch(v){this.logService.WriteLog("Exception: "+v.message,"getPivotPointDataCompleted()","pivotPointData.component.ts","")}}calculatePivotPoint(){this.SelectedPivotPointFormula=0!=a.xB.User.PivotPrefDetails.length&&null!=a.xB.User.PivotPrefDetails&&null!=a.xB.User.PivotPrefDetails?a.xB.User.PivotPrefDetails[0].sPivotPointFormula:this.arrPivotPointFormula[0],this.SelectedCalcMethod=0!=a.xB.User.PivotPrefDetails.length&&null!=a.xB.User.PivotPrefDetails&&null!=a.xB.User.PivotPrefDetails?a.xB.User.PivotPrefDetails[0].sCalculationMethod:this.arrCalcMethod[0],this.FBRatio1=0!=a.xB.User.PivotPrefDetails.length&&null!=a.xB.User.PivotPrefDetails&&null!=a.xB.User.PivotPrefDetails?a.xB.User.PivotPrefDetails[0].nRatio1:"0.0000",this.FBRatio2=0!=a.xB.User.PivotPrefDetails.length&&null!=a.xB.User.PivotPrefDetails&&null!=a.xB.User.PivotPrefDetails?a.xB.User.PivotPrefDetails[0].nRatio2:"0.0000",this.FBRatio3=0!=a.xB.User.PivotPrefDetails.length&&null!=a.xB.User.PivotPrefDetails&&null!=a.xB.User.PivotPrefDetails?a.xB.User.PivotPrefDetails[0].nRatio3:"0.0000",this.FBRatio4=0!=a.xB.User.PivotPrefDetails.length&&null!=a.xB.User.PivotPrefDetails&&null!=a.xB.User.PivotPrefDetails?a.xB.User.PivotPrefDetails[0].nRatio4:"0.0000",this.CalculationMethod=this.SelectedCalcMethod,this.PPFormula=this.SelectedPivotPointFormula,this.calculatePP()}calculatePP(){this.PivotPoint=l.X.calculatePP(this.PPFormula,this.PrevDayHigh,this.PrevDayLow,this.PrevDayClose,this.PrevDayOpen),this.Range=parseFloat(this.PrevDayHigh)-parseFloat(this.PrevDayLow);var c=l.X.calculateSupportResistance(this.CalculationMethod,this.PivotPoint,this.Range,this.PrevDayLow,this.PrevDayHigh,this.PrevDayClose,this.FBRatio4,this.FBRatio3,this.FBRatio2,this.FBRatio1);this.Resistance4=c[2].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Resistance3=c[3].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Resistance2=c[4].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Resistance1=c[5].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Support1=c[6].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Support2=c[7].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Support3=c[8].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1)),this.Support4=c[9].toFixed(a.xB.ExchManager.ReturnPrecisionForPrice(this.Scrip.ScripDet.MktSegId,this.Scrip.DecimalLocator.toString().length-1))}}return D.\u0275fac=function(c){return new(c||D)(i.\u0275\u0275directiveInject(a.mQ),i.\u0275\u0275directiveInject(a.OE))},D.\u0275cmp=i.\u0275\u0275defineComponent({type:D,selectors:[["pivot-point"]],inputs:{Scrip:"Scrip"},decls:37,vars:9,consts:[[1,"Pivot_point_Parent"],[1,"tbl-alt-row"],[1,"GreenClr"],[1,"RedClr"],[1,"Pvt_Data"]],template:function(c,C){1&c&&(i.\u0275\u0275elementStart(0,"div",0),i.\u0275\u0275elementStart(1,"div",1),i.\u0275\u0275elementStart(2,"table"),i.\u0275\u0275elementStart(3,"thead"),i.\u0275\u0275elementStart(4,"tr"),i.\u0275\u0275elementStart(5,"th"),i.\u0275\u0275text(6,"Support"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(7,"th"),i.\u0275\u0275text(8,"Resistance"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(9,"tr"),i.\u0275\u0275elementStart(10,"td",2),i.\u0275\u0275text(11),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(12,"td",3),i.\u0275\u0275text(13),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(14,"tr"),i.\u0275\u0275elementStart(15,"td",2),i.\u0275\u0275text(16),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(17,"td",3),i.\u0275\u0275text(18),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(19,"tr"),i.\u0275\u0275elementStart(20,"td",2),i.\u0275\u0275text(2
11),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(22,"td",3),i.\u0275\u0275text(23),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(24,"tr"),i.\u0275\u0275elementStart(25,"td",2),i.\u0275\u0275text(26),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(27,"td",3),i.\u0275\u0275text(28),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(29,"div",4),i.\u0275\u0275elementStart(30,"ul"),i.\u0275\u0275elementStart(31,"li"),i.\u0275\u0275elementStart(32,"h1"),i.\u0275\u0275text(33,"Pivot Point Data"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(34,"li"),i.\u0275\u0275elementStart(35,"span"),i.\u0275\u0275text(36),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&c&&(i.\u0275\u0275advance(11),i.\u0275\u0275textInterpolate1("S1 : ",C.Support1,""),i.\u0275\u0275advance(2),i.\u0275\u0275textInterpolate1("R1 : ",C.Resistance1,""),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate1("S2 : ",C.Support2,""),i.\u0275\u0275advance(2),i.\u0275\u0275textInterpolate1("R2 : ",C.Resistance2,""),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate1("S3 : ",C.Support3,""),i.\u0275\u0275advance(2),i.\u0275\u0275textInterpolate1("R3 : ",C.Resistance3,""),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate1("S4 : ",C.Support4,""),i.\u0275\u0275advance(2),i.\u0275\u0275textInterpolate1("R4 : ",C.Resistance4,""),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(C.PivotPoint))},encapsulation:2}),D})();var ot=x(5741),ht=x(5607);function nt(D,le){1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275element(1,"nn-progressbar",5),i.\u0275\u0275elementEnd()),2&D&&(i.\u0275\u0275advance(1),i.\u0275\u0275property("type","PS"))}function ut(D,le){1&D&&(i.\u0275\u0275elementStart(0,"div",6),i.\u0275\u0275elementStart(1,"span"),i.\u0275\u0275text(2,"No Data Found"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd())}function ae(D,le){1&D&&(i.\u0275\u0275elementStart(0,"li",13),i.\u0275\u0275text(1,"|"),i.\u0275\u0275elementEnd())}function Pe(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Traded Currency"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(3,"br"),i.\u0275\u0275elementStart(4,"span"),i.\u0275\u0275text(5),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(5),i.\u0275\u0275textInterpolate(c.TradeCurr)}}function E(D,le){1&D&&(i.\u0275\u0275elementStart(0,"li",13),i.\u0275\u0275text(1,"|"),i.\u0275\u0275elementEnd())}function R(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Base Currency"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(3,"br"),i.\u0275\u0275elementStart(4,"span"),i.\u0275\u0275text(5),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(5),i.\u0275\u0275textInterpolate(c.BaseCurr)}}function Y(D,le){1&D&&(i.\u0275\u0275elementStart(0,"li",13),i.\u0275\u0275text(1,"|"),i.\u0275\u0275elementEnd())}function ie(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Ref Rate"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(3,"br"),i.\u0275\u0275elementStart(4,"span"),i.\u0275\u0275text(5),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(5),i.\u0275\u0275textInterpolate(c.RefRate)}}function ge(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"div",7),i.\u0275\u0275elementStart(2,"div",8),i.\u0275\u0275elementStart(3,"h1",9),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(5,"div",10),i.\u0275\u0275elementStart(6,"div",11),i.\u0275\u0275elementStart(7,"div",12),i.\u0275\u0275elementStart(8,"ul"),i.\u0275\u0275elementStart(9,"li"),i.\u0275\u0275elementStart(10,"label"),i.\u0275\u0275text(11,"Code"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(12,"br"),i.\u0275\u0275elementStart(13,"span"),i.\u0275\u0275text(14),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(15,"li",13),i.\u0275\u0275text(16,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(17,"li"),i.\u0275\u0275elementStart(18,"label"),i.\u0275\u0275text(19,"Market Lot"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(2
10,"br"),i.\u0275\u0275elementStart(21,"span"),i.\u0275\u0275text(22),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(23,"li",13),i.\u0275\u0275text(24,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(25,"li"),i.\u0275\u0275elementStart(26,"label"),i.\u0275\u0275text(27,"Lot Unit"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(28,"br"),i.\u0275\u0275elementStart(29,"span"),i.\u0275\u0275text(30),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(31,"li",13),i.\u0275\u0275text(32,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(33,"li"),i.\u0275\u0275elementStart(34,"label"),i.\u0275\u0275text(35,"Price Tick(Rs.)"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(36,"br"),i.\u0275\u0275elementStart(37,"span"),i.\u0275\u0275text(38),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(39,"li",13),i.\u0275\u0275text(40,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(41,"li"),i.\u0275\u0275elementStart(42,"label"),i.\u0275\u0275text(43,"Maturity "),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(44,"br"),i.\u0275\u0275elementStart(45,"span"),i.\u0275\u0275text(46),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(47,"li",13),i.\u0275\u0275text(48,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(49,"li"),i.\u0275\u0275elementStart(50,"label"),i.\u0275\u0275text(51,"U/L Asset"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(52,"br"),i.\u0275\u0275elementStart(53,"span"),i.\u0275\u0275text(54),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(55,"li",13),i.\u0275\u0275text(56,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(57,"li"),i.\u0275\u0275elementStart(58,"label"),i.\u0275\u0275text(59,"IP Date "),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(60,"br"),i.\u0275\u0275elementStart(61,"span"),i.\u0275\u0275text(62),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(63,"li",13),i.\u0275\u0275text(64,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(65,"li"),i.\u0275\u0275elementStart(66,"label"),i.\u0275\u0275text(67,"Ex.Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(68,"br"),i.\u0275\u0275elementStart(69,"span"),i.\u0275\u0275text(70),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(71,"li",13),i.\u0275\u0275text(72,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(73,"li"),i.\u0275\u0275elementStart(74,"label"),i.\u0275\u0275text(75,"Price Quote"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(76,"br"),i.\u0275\u0275elementStart(77,"span"),i.\u0275\u0275text(78),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(79,"li",13),i.\u0275\u0275text(80,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(81,"li"),i.\u0275\u0275elementStart(82,"label"),i.\u0275\u0275text(83,"Margin % "),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(84,"br"),i.\u0275\u0275elementStart(85,"span"),i.\u0275\u0275text(86),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(87,"li",13),i.\u0275\u0275text(88,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(89,"li"),i.\u0275\u0275elementStart(90,"label"),i.\u0275\u0275text(91,"Ex.Multiplier"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(92,"br"),i.\u0275\u0275elementStart(93,"span"),i.\u0275\u0275text(94),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(95,"li",13),i.\u0275\u0275text(96,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(97,"li"),i.\u0275\u0275elementStart(98,"label"),i.\u0275\u0275text(99,"Max Order Size"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(100,"br"),i.\u0275\u0275elementStart(101,"span"),i.\u0275\u0275text(102),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(103,"li",13),i.\u0275\u0275text(104,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(105,"li"),i.\u0275\u0275elementStart(106,"label"),i.\u0275\u0275text(107,"Max Order Value"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(108,"br"),i.\u0275\u0275elementStart(109,"span"),i.\u0275\u0275text(110),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(111,"li",13),i.\u0275\u0275text(112,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(113,"li"),i.\u0275\u0275elementStart(114,"label"),i.\u0275\u0275text(115,"Settlement Type"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(116,"br"),i.\u0275\u0275elementStart(117,"span"),i.\u0275\u0275text(118),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(119,ae,2,0,"li",14),i.\u0275\u0275template(120,Pe,6,1,"li",3),i.\u0275\u0275template(121,E,2,0,"li",14),i.\u0275\u0275template(122,R,6,1,"li",3),i.\u0275\u0275template(123,Y,2,0,"li",14),i.\u0275\u0275template(124,ie,6,1,"li",3),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(125,"div",10),i.\u0275\u0275elementStart(126,"div",11),i.\u0275\u0275elementStart(127,"h3",15),i.\u0275\u0275text(128,"Contract Dates"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(129,"div",12),i.\u0275\u0275elementStart(130,"ul"),i.\u0275\u0275elementStart(131,"li"),i.\u0275\u0275elementStart(132,"label"),i.\u0275\u0275text(133,"Contract Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(134,"br"),i.\u0275\u0275elementStart(135,"span",16),i.\u0275\u0275text(136),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(137,"p",17),i.\u0275\u0275elementStart(138,"span",16),i.\u0275\u0275text(139),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(140,"li",13),i.\u0275\u0275text(141,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(142,"li"),i.\u0275\u0275elementStart(143,"label"),i.\u0275\u0275text(144,"Tender Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(145,"br"),i.\u0275\u0275elementStart(146,"span"),i.\u0275\u0275text(147),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(148,"p",17),i.\u0275\u0275elementStart(149,"span"),i.\u0275\u0275text(150),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(151,"li",13),i.\u0275\u0275text(152,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(153,"li"),i.\u0275\u0275elementStart(154,"label"),i.\u0275\u0275text(155,"Del Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(156,"br"),i.\u0275\u0275elementStart(157,"span"),i.\u0275\u0275text(158),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(159,"p",17),i.\u0275\u0275elementStart(160,"span"),i.\u0275\u0275text(161),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(162,"li",13),i.\u0275\u0275text(163,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(164,"li"),i.\u0275\u0275elementStart(165,"label"),i.\u0275\u0275text(166,"Near Month Identifier"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(167,"br"),i.\u0275\u0275elementStart(168,"span"),i.\u0275\u0275text(169),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(170,"li",13),i.\u0275\u0275text(171,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(172,"li"),i.\u0275\u0275elementStart(173,"label"),i.\u0275\u0275text(174,"Far Month Identifier"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(175,"br"),i.\u0275\u0275elementStart(176,"span"),i.\u0275\u0275text(177),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(178,"div",10),i.\u0275\u0275elementStart(179,"h2",18),i.\u0275\u0275text(180,"Margin Information"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(181,"div",10),i.\u0275\u0275elementStart(182,"div",11),i.\u0275\u0275elementStart(183,"h3",19),i.\u0275\u0275text(184,"Derivative/Currency Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(185,"div",12),i.\u0275\u0275elementStart(186,"ul"),i.\u0275\u0275elementStart(187,"li",20),i.\u0275\u0275elementStart(188,"label"),i.\u0275\u0275text(189,"Other Long Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(190,"br"),i.\u0275\u0275elementStart(191,"span"),i.\u0275\u0275text(192),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(193,"li",13),i.\u0275\u0275text(194,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(195,"li",21),i.\u0275\u0275elementStart(196,"label"),i.\u0275\u0275text(197,"Other Short Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(198,"br"),i.\u0275\u0275elementStart(199,"span"),i.\u0275\u0275text(200),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(201,"li",13),i.\u0275\u0275text(202,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(203,"li",22),i.\u0275\u0275elementStart(204,"label"),i.\u0275\u0275text(205,"Initial Long Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(2
106,"br"),i.\u0275\u0275elementStart(207,"span"),i.\u0275\u0275text(208),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(209,"li",13),i.\u0275\u0275text(210,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(211,"li",23),i.\u0275\u0275elementStart(212,"label"),i.\u0275\u0275text(213,"Initial Short Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(214,"br"),i.\u0275\u0275elementStart(215,"span"),i.\u0275\u0275text(216),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(217,"li",13),i.\u0275\u0275text(218,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(219,"li",24),i.\u0275\u0275elementStart(220,"label"),i.\u0275\u0275text(221,"Exposure Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(222,"br"),i.\u0275\u0275elementStart(223,"span"),i.\u0275\u0275text(224),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(225,"li",13),i.\u0275\u0275text(226,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(227,"li",25),i.\u0275\u0275elementStart(228,"label"),i.\u0275\u0275text(229,"Applicable Long Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(230,"br"),i.\u0275\u0275elementStart(231,"span"),i.\u0275\u0275text(232),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(233,"li",13),i.\u0275\u0275text(234,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(235,"li",26),i.\u0275\u0275elementStart(236,"label"),i.\u0275\u0275text(237,"Applicable Short Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(238,"br"),i.\u0275\u0275elementStart(239,"span"),i.\u0275\u0275text(240),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(241,"div",10),i.\u0275\u0275elementStart(242,"div",11),i.\u0275\u0275elementStart(243,"h3",27),i.\u0275\u0275text(244,"NCDEX/BSECOMM/NSECOMM/ICEX Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(245,"div",12),i.\u0275\u0275elementStart(246,"ul"),i.\u0275\u0275elementStart(247,"li"),i.\u0275\u0275elementStart(248,"label"),i.\u0275\u0275text(249,"Exposure Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(250,"br"),i.\u0275\u0275elementStart(251,"span"),i.\u0275\u0275text(252),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(253,"li",13),i.\u0275\u0275text(254,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(255,"li"),i.\u0275\u0275elementStart(256,"label"),i.\u0275\u0275text(257,"Additional Long Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(258,"br"),i.\u0275\u0275elementStart(259,"span"),i.\u0275\u0275text(260),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(261,"li",13),i.\u0275\u0275text(262,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(263,"li"),i.\u0275\u0275elementStart(264,"label"),i.\u0275\u0275text(265,"Additional Short Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(266,"br"),i.\u0275\u0275elementStart(267,"span"),i.\u0275\u0275text(268),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(269,"li",13),i.\u0275\u0275text(270,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(271,"li"),i.\u0275\u0275elementStart(272,"label"),i.\u0275\u0275text(273,"Additional PreExpiry Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(274,"br"),i.\u0275\u0275elementStart(275,"span"),i.\u0275\u0275text(276),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(277,"li",13),i.\u0275\u0275text(278,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(279,"li"),i.\u0275\u0275elementStart(280,"label"),i.\u0275\u0275text(281,"Special Long Cash Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(282,"br"),i.\u0275\u0275elementStart(283,"span"),i.\u0275\u0275text(284),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(285,"li",13),i.\u0275\u0275text(286,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(287,"li"),i.\u0275\u0275elementStart(288,"label"),i.\u0275\u0275text(289,"Special Short Cash Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(290,"br"),i.\u0275\u0275elementStart(291,"span"),i.\u0275\u0275text(292),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(293,"li",13),i.\u0275\u0275text(294,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(295,"li"),i.\u0275\u0275elementStart(296,"label"),i.\u0275\u0275text(297,"Applicable Long Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(298,"br"),i.\u0275\u0275elementStart(299,"span"),i.\u0275\u0275text(300),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(301,"li",13),i.\u0275\u0275text(302,"|"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(303,"li"),i.\u0275\u0275elementStart(304,"label"),i.\u0275\u0275text(305,"Applicable Short Margin"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(306,"br"),i.\u0275\u0275elementStart(307,"span"),i.\u0275\u0275text(308),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.ContractName),i.\u0275\u0275advance(10),i.\u0275\u0275textInterpolate(c.Token),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.MarketLot),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.LotUnit),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.PriceTick),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.Maturity),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.ULAsset),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.IPDate),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.ExDate),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.PriceQuote),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.Margin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.ExMultiplier),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.MaxOrderQty),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.MaxOrderValue),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.SettlementType),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.Is_CrossCur),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.Is_CrossCur),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.Is_CrossCur),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.Is_CrossCur),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.Is_CrossCur),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.Is_CrossCur),i.\u0275\u0275advance(12),i.\u0275\u0275textInterpolate(c.ContractStartDate),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate(c.ContractEndDate),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.TenderStartDate),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate(c.TenderEndDate),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.DelStartDate),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate(c.DelEndDate),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.NearMonthId),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.FarMonthId),i.\u0275\u0275advance(15),i.\u0275\u0275textInterpolate(c.OtLongMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.OtShortMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.InLongMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.InShortMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.ExposureMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AppLongMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AppShortMargin),i.\u0275\u0275advance(12),i.\u0275\u0275textInterpolate(c.ExMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AddLongMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AddShortMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AddPreMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.SPLGCMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.SPSHCMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AppLongMargin),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.AppShortMargin)}}let xe=(()=>{class D{constructor(c,C){this.logService=c,this.httpService=C,this.Is_CrossCur=!0,this.showProgressBar=!1,this.noDataFound=!1}ngOnInit(){try{a.xB.dConfigMaster.VERSION_IS_SP16B_DECODED==a.gT.C_S_OFF&&(this.IS_SP16B=!0),a.xB.applicationType==a.xB.MOBILE&&(this.isBackVisible=!0),this.DisplayDetails(this.Scrip.ScripDet.MktSegId,this.Scrip.InstrumentName,this.Scrip.ScripDet.Token,this.Scrip.Symbol,this.Scrip.ExpiryDate,this.Scrip.StrikePrice,this.Scrip.OptionType,this.Scrip.DecimalLocator)}catch(c){this.logService.WriteLog("Exception: "+c.message,"ngOnInit()","contractInfo.component.ts","")}}
1DisplayDetails(c,C,v,A,z,Se,ye,Oe){try{this.showProgressBar=!0,this.MarketSegId=c,(null==z||"undefined"==z)&&(z=""),(null==Se||"undefined"==Se)&&(Se=""),(null==ye||"undefined"==ye)&&(ye=""),(null==Oe||"undefined"==Oe)&&(Oe="100");var Fe=parseInt(c);c=l.X.GetMappedMarketSegmentId(parseInt(c)),this.httpService.postData(a.xB.tradingAPIUrl,"GetContractInfo",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:Fe,ScripTkn:v,Symbol:A,ExpDt:z,InstNm:C,StrkPrc:Se,OptTyp:ye,DecLocator:Oe}).subscribe(qe=>{this.GetContInfo(qe)},qe=>{this.showProgressBar=!1,this.noDataFound=!0})}catch(qe){this.logService.WriteLog("Exception: "+qe.message,"DisplayDetails","contractInfo.component.ts","")}}fn_CheckForNonMinusOne(c){var C=!1;try{C="-1.00"!=parseFloat(c).toFixed(2).toString()}catch(v){C=!1}return C}GetContInfo(c){try{if(this.showProgressBar=!1,null!=c.ResponseObject&&c.ResponseStatus){var v=a.xB.ExchManager.GetContractInfo(c.ResponseObject,parseInt(this.MarketSegId)),A=new ht.u;if(A.ScripDet.MktSegId=parseInt(this.MarketSegId),A.ScripDet.Token=v.Token,A.Symbol=v.sSymbol.toUpperCase(),A.Series=v.sSeries,A.InstrumentName=v.sInstrumentName,A.ExchangeName=l.X.GetExchangeName(parseInt(this.MarketSegId)),A.ExpiryDate=v.ExDate,A.OptionType=v.sOptionType,A.StrikePrice=v.nStrikePrice,A.DecimalLocator=v.nDecimalLocator,A.MWSecurityDesc=l.X.FormatScripDescForMW(A),this.ScripSymbol=A.MWSecurityDesc,this.ContractName=v.ContractName,this.Token=v.Token,this.ULAsset=v.ULAsset,this.IPDate=v.IPDate,this.MarketLot=v.MarketLot,this.PriceTick=v.PriceTick,this.Maturity=v.Maturity,this.ExDate=v.ExDate,this.PriceQuote=v.PriceQuote,this.Margin=v.Margin,this.ExMultiplier=v.ExMultiplier,this.ContractStartDate=v.ContractStartDate,this.ContractEndDate=v.ContractEndDate,this.TenderStartDate=v.TenderStartDate,this.TenderEndDate=v.TenderEndDate,this.DelStartDate=v.DelStartDate,this.DelEndDate=v.DelEndDate,this.NearMonthId=v.NearMonthId,this.FarMonthId=v.FarMonthId,this.OtLongMargin=v.OLongMargin,this.OtShortMargin=v.OShortMargin,this.ExMargin=v.ExMargin,this.AddLongMargin=v.AddLongMargin,this.AddShortMargin=v.AddShortMargin,this.ExposureMargin=v.ExposureMargin,this.AddPreMargin=v.AddPreMargin,this.SPLGCMargin=v.SPLGCMargin,this.SPSHCMargin=v.SPSHCMargin,this.InLongMargin=v.InLongMargin,this.InShortMargin=v.InShortMargin,this.AppLongMargin=v.AppLongMargin,this.AppShortMargin=v.AppShortMargin,this.LotUnit=v.LotUnit,this.MaxOrderQty=v.MaxOrderQty,this.MaxOrderValue=v.MaxOrderValue,this.SettlementValue=v.sDeliveryUnit,null!=this.SettlementValue&&null!=this.SettlementValue&&""!=this.SettlementValue){var z=this.SettlementValue.split("_")[0].toString();this.SettlementType=z==a.gT.C_S_PHYSICAL_SETTLEMENT_VALUE?a.gT.C_S_PHYSICAL_DELIVERY:z==a.gT.C_S_CASH_SETTLEMENT_VALUE?a.gT.C_S_CASH_SETTLEMENT:"NA"}else this.SettlementType="NA";this.Is_CrossCur=null!=v.sTradeCurrency&&""!=v.sTradeCurrency&&null!=v.sBaseCurrency&&""!=v.sBaseCurrency&&null!=v.nReferanceRate&&""!=v.nReferanceRate,this.TradeCurr=v.sTradeCurrency,this.BaseCurr=v.sBaseCurrency,this.RefRate=v.nReferanceRate,this.noDataFound=!1}else this.noDataFound=!0}catch(Se){this.logService.WriteLog("Exception: "+Se.message,"GetContInfo","contractInfo.component.ts","")}}}return D.\u0275fac=function(c){return new(c||D)(i.\u0275\u0275directiveInject(a.mQ),i.\u0275\u0275directiveInject(a.OE))},D.\u0275cmp=i.\u0275\u0275defineComponent({type:D,selectors:[["app-contractInfo"]],inputs:{Scrip:"Scrip"},decls:6,vars:3,consts:[["id","dvContractInfo",1,"ContractInfo"],[1,"nicescroll","con_info",2,"overflow","hidden"],[1,"SecCont-Info","SecurityInfo-loader-wrap"],[4,"ngIf"],["class","nodatafound",4,"ngIf"],[3,"type"],[1,"nodatafound"],[1,"SecCont-Info"],[1,"SecCont-Top"],["cp","Contract Name:"],[1,"clear"],[1,"contact-tab-wrap"],[1,"SecCont-details"],[1,"sep"],["class","sep",4,"ngIf"],["cp","Contract Dates"],[1,"flt-left"],[1,"right-arrow"],["cp","Margin Information"],["cp","Other Exchange Margin"],["cp","Other Long Margin"],["cp","Other Short Margin"],["cp","Initial Long Margin"],["cp","Initial Short Margin"],["cp","Exposure Margin"],["cp","Applicable Long Margin"],["cp","Applicable Short Margin"],["cp","NCDEX Margin"]],template:function(c,C){1&c&&(i.\u0275\u0275elementStart(0,"div",0),i.\u0275\u0275elementStart(1,"div",1),i.\u0275\u0275elementStart(2,"div",2),i.\u0275\u0275template(3,nt,2,1,"div",3),i.\u0275\u0275template(4,ut,3,0,"div",4),i.\u0275\u0275template(5,ge,309,44,"div",3),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&c&&(i.\u0275\u0275advance(3),i.\u0275\u0275property("ngIf",C.showProgressBar),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.noD
1ataFound),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!C.showProgressBar&&!C.noDataFound))},directives:[V.O5,fe.R],encapsulation:2}),D})();var oe=x(8351),me=x(3511),L=x(9852),te=x(4699);let J=(()=>{class D{constructor(c,C,v,A){this.httpService=c,this.logService=C,this.pubsubService=v,this.tradingSharedService=A,this.data=[],this.ArrSubTokens=[],this.chartTicks=[],this.chartDates=[],this.lastTickIndex=-1,this.startTickIndex=-1,this.options={chart:{type:"lineChart",noData:"No Chart Data",color:"white",height:50,width:140,margin:{top:0,right:0,bottom:0,left:0},useInteractiveGuideline:!0,xAxis:{tickFormat:function(z){return d3.time.format("%H:%M:%S")(new Date(parseInt(z)))},showMaxMin:!1},yAxis:{tickFormat:function(z){return d3.format(",.2f")(z)},showMaxMin:!1,ticks:5},showXAxis:!1,showYAxis:!1,showLegend:!1,pointActive:function(z){return null},interactiveLayer:{tooltip:{headerEnabled:!0}},x:function(z){return z.x},y:function(z){return z.y}}}}ngOnInit(){try{this.getAreaChartData()}catch(c){this.logService.WriteLog("Exception: "+c.message,"ngOnInit()","areachart.component.ts","")}}SubScribeMessages(){this.ArrSubTokens=[];var c=this.pubsubService.subscribe("MTLRES",(C,v)=>{this.ReceiveMWResponse(v)});this.ArrSubTokens.push(c)}ReceiveMWResponse(c){try{if(null!=c&&this.scrip.ScripDet.MapMktSegId==c.Scrip.MktSegId&&this.scrip.ScripDet.Token==c.Scrip.Token){var C=new Date(l.X.getDateTimePart(c.LTT)),v=parseFloat(c.LTP);this.addTicks(C,v)}}catch(A){this.logService.WriteLog("Exception: "+A.message,"ReceiveMWResponse()","areachart.component.ts","")}}getAreaChartData(){try{this.httpService.postToGetChart(a.xB.tradingAPIUrl,"GetAreaChartData",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,MktSegId:this.scrip.ScripDet.MapMktSegId,ScripTkn:this.scrip.ScripDet.Token,Symbol:this.scrip.Symbol,Lut:0,IntraHistFlag:0,IntradayDays:a.gT.DEFAULT_BASICINTRADAY_DAYS_NOS,ChartDataType:1,ChartType:0,ChartRecords:1,ChartContinuous:""}).subscribe(v=>{this.fn_PopulateJSChartResponce(v)})}catch(v){this.logService.WriteLog("Exception: "+v.message,"getAreaChartData()","areachart.component.ts","")}}fn_PopulateJSChartResponce(c){try{var v,A,z,C="",Se=new Uint8Array(c),ye=[];for(let Be=0;Be<Se.length;Be+=1)ye.push(String.fromCharCode(Se[Be]));if(null!=(C=ye.join(""))&&C.length>0){var Oe=C.replaceAll("\r\n","$").split("$");this.chartTicks=[],this.chartDates=[];for(var Fe=0;Fe<Oe.length;Fe++)if((z=Oe[Fe].split("|")).length>=2){v=l.X.ConvertToDateObj(parseInt(z[0])),A=parseInt(v.getTime().toString());var Qe=parseFloat(z[1])/parseInt(this.scrip.DecimalLocator);this.chartTicks.push(Qe),this.chartDates.push(A),this.startTickIndex=this.chartTicks.length-1,this.lastTickIndex=this.chartTicks.length-1}this.drawAreaChart()}this.SubScribeMessages();var qe=[];qe.push(this.scrip.ScripDet),this.tradingSharedService.sendTouchLineRequest(qe,1)}catch(Be){this.logService.WriteLog("Exception: "+Be.message,"fn_PopulateJSChartResponce()","areachart.component.ts","")}}drawAreaChart(){try{for(var c=[],v=(new Date,0);v<this.chartTicks.length;v++)c.push({x:this.chartDates[v],y:parseFloat(this.chartTicks[v])});this.data=[{values:c,color:"#2ca02c",area:!0}]}catch(A){this.logService.WriteLog("Exception: "+A.message,"drawAreaChart()","areachart.component.ts","")}}addTicks(c,C){try{var A=parseInt(c.getTime().toString());this.startTickIndex==this.lastTickIndex?(this.sTime=new Date(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),0),this.eTime=new Date(this.sTime.getFullYear(),this.sTime.getMonth(),this.sTime.getDate(),this.sTime.getHours(),this.sTime.getMinutes(),this.sTime.getSeconds()),this.eTime.setSeconds(this.sTime.getSeconds()+10),this.lastTickIndex++,this.chartTicks.push(C),this.chartDates.push(A)):c>this.sTime&&c<=this.eTime?(this.chartTicks[this.lastTickIndex]=C,this.chartDates[this.lastTickIndex]=A):c>this.eTime&&(this.sTime=new Date(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),0),this.eTime=new Date(this.sTime.getFullYear(),this.sTime.getMonth(),this.sTime.getDate(),this.sTime.getHours(),this.sTime.getMinutes(),this.sTime.getSeconds()),this.eTime.setSeconds(this.eTime.getSeconds()+10),this.chartTicks.push(C),this.chartDates.push(A),this.lastTickIndex++);var z=new Date;let Se=Number(a.xB.dConfigMaster.FINALYTICS_MW_AREACHARTINTERVAL);this.eIntervalTime||(this.eIntervalTime=z,this.eIntervalTime.setSeconds(z.getSeconds()+Se)),z>this.eIntervalTime&&(this.eIntervalTime=z,this.eIntervalTime.setSeconds(z.getSeconds()+Se),this.drawAreaChart())}catch(Se){this.logService.WriteLog("Exception: "+Se.message,"addTicks()","areachart.component.ts","")}}ngOnDestroy(){for(let c=0;c<this.ArrSubTokens.length;c++)this.pubsubService.unsubscribe(this.ArrSubTokens[c])}}return D.\u0275fac=function(c){return new(c||D)(i.\u0275\u0275directiveInject(a.OE),i.\u0275\u0275directiveInject(a.mQ),i.\u0275\u0275directiveInject(a.hC),i.\u0275\u0275directiveInject(N.F))},D.\u0275cmp=i.\u0275\u0275defineComponent({type:D,selectors:[["areachart"]],inputs:{scrip:"scrip"},decls:2,vars:2,consts:[[1,"areaChartCss"],[3,"options","data"]],template:function(c,C){1&c&&(i.\u0275\u0275elementStart(0,"div",0),i.\u0275\u0275element(1,"nvd3",1),i.\u0275\u0275elementEnd()),2&c&&(i.\u0275\u0275advance(1),i.\u0275\u0275property("options",C.options)("data",C.data))},directives:[K.ZV],encapsulation:2}),D})();var De=x(3213);const Ke=["mwTable"],Xe=["cellTmplAlert"],et=["cellTmplLTP"],ct=["cellTmplPercChng"],tt=["cellTmplNetChng"],Ct=["rowExpandTempl"],vt=["cellTemplEvents"],ze=["blockViewTempl"],Rt=["cellTemplScrip"],Ft=["cellTmplRemoveScrip"];function Nt(D,le){1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275element(1,"nn-progressbar",46),i.\u0275\u0275elementEnd()),2&D&&(i.\u0275\u0275advance(1),i.\u0275\u0275property("type","PS"))}function wt(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"mat-option",49),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()),2&D){const c=le.$implicit;i.\u0275\u0275property("value",c),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate1(" ",c.ProfileName," ")}}function Bt(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"mat-optgroup",47),i.\u0275\u0275template(1,wt,2,2,"mat-option",48),i.\u0275\u0275elementEnd()),2&D){const c=le.$implicit;i.\u0275\u0275property("label",c.Name),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.Data)}}function Gt(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"mat-option",49),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()),2&D){const c=le.$implicit;i.\u0275\u0275property("value",c),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.value)}}function Ut(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275elementStart(1,"span",50),i.\u0275\u0275text(2,"Top 50 based on"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"mat-form-field",7),i.\u0275\u0275elementStart(4,"mat-select",51),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().top50=v})("selectionChange",function(){i.\u0275\u0275restoreView(c);
1const v=i.\u0275\u0275nextContext();return v.fetchTop50(v.top50)}),i.\u0275\u0275template(5,Gt,2,2,"mat-option",48),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(4),i.\u0275\u0275property("ngModel",c.top50),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.indiceTop50)}}function Wt(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"mat-option",49),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()),2&D){const c=le.$implicit;i.\u0275\u0275property("value",c),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate1(" ",c," ")}}function Ht(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"mat-option",49),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()),2&D){const c=le.$implicit;i.\u0275\u0275property("value",c),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate1(" ",c," ")}}function Qt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275elementStart(1,"ul"),i.\u0275\u0275elementStart(2,"li"),i.\u0275\u0275elementStart(3,"mat-form-field",52),i.\u0275\u0275elementStart(4,"mat-select",53),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().SelectedCalcMethod=v}),i.\u0275\u0275template(5,Wt,2,2,"mat-option",48),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(6,"li"),i.\u0275\u0275elementStart(7,"mat-form-field",7),i.\u0275\u0275elementStart(8,"mat-select",54),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().SelectedPivotPointFormula=v}),i.\u0275\u0275template(9,Ht,2,2,"mat-option",48),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(10,"li"),i.\u0275\u0275elementStart(11,"button",55),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().CalculatePivotPoint()}),i.\u0275\u0275text(12,"Apply"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(4),i.\u0275\u0275property("ngModel",c.SelectedCalcMethod),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.arrCalcMethod),i.\u0275\u0275advance(3),i.\u0275\u0275property("ngModel",c.SelectedPivotPointFormula),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.arrPivotPointFormula)}}function Yt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"li",16),i.\u0275\u0275elementStart(1,"button",56),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().populateOE("ML")}),i.\u0275\u0275text(2,"Multileg"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()}}function Xt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",57),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().onFilter()}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275styleProp("background-color",c.showFilter?"#4c518a":""),i.\u0275\u0275property("matTooltip","Filter")}}function Kt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",58),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().openColumnView()}),i.\u0275\u0275elementEnd()}2&D&&i.\u0275\u0275property("matTooltip","Edit Columns")}function ee(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",62),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).changeView("Block")}),i.\u0275\u0275elementEnd()}2&D&&i.\u0275\u0275property("matTooltip","Block View")("className","blockViewImg")}function ve(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",63),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).changeView("Grid")}),i.\u0275\u0275elementEnd()}2&D&&i.\u0275\u0275property("matTooltip","Grid View")("className","gridViewImg")}function y(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",59),i.\u0275\u0275template(1,ee,1,2,"button",60),i.\u0275\u0275template(2,ve,1,2,"button",61),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.gridViewBtn),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.gridViewBtn)}}function B(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",71),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).NewProfileName=v}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275property("ngModel",c.NewProfileName)}}function se(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",72),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).NewProfileName=v}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275property("ngModel",c.NewProfileName)}}function _e(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",74),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().$implicit;i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.ProfileName)}}function Ae(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",84),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(3).$implicit.ProfileNameDisplay=v}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext(3).$implicit;i.\u0275\u0275propertyInterpolate("value",c.ProfileName),i.\u0275\u0275property("ngModel",c.ProfileNameDisplay)}}function Ye(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",85),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(3).$implicit.ProfileNameDisplay=v}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext(3).$implicit;i.\u0275\u0275propertyInterpolate("value",c.ProfileName),i.\u0275\u0275property("ngModel",c.ProfileNameDisplay)}}function Le(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",81),i.\u0275\u0275elementStart(1,"ul"),i.\u0275\u0275elementStart(2,"li"),i.\u0275\u0275elementStart(3,"mat-form-field"),i.\u0275\u0275template(4,Ae,1,2,"input",82),i.\u0275\u0275template(5,Ye,1,2,"input",83),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(4);i.\u0275\u0275advance(4),i.\u0275\u0275property("ngIf",c.appSyncON),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.appSyncON)}}function $e(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",86),i.\u0275\u0275listener("click",function(){i.\u0275\u0275restoreView(c);
1const v=i.\u0275\u0275nextContext(2).$implicit;return i.\u0275\u0275nextContext(2).EditProfile(v)}),i.\u0275\u0275elementEnd()}}function we(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",87),i.\u0275\u0275listener("click",function(){i.\u0275\u0275restoreView(c);const v=i.\u0275\u0275nextContext(2).$implicit;return i.\u0275\u0275nextContext(2).RenameProfile(v)}),i.\u0275\u0275elementEnd()}}function rt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",88),i.\u0275\u0275listener("click",function(){i.\u0275\u0275restoreView(c);const v=i.\u0275\u0275nextContext(2).$implicit;return i.\u0275\u0275nextContext(2).cancelProfileEdit(v)}),i.\u0275\u0275elementEnd()}}function Ot(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",89),i.\u0275\u0275listener("click",function(){i.\u0275\u0275restoreView(c);const v=i.\u0275\u0275nextContext(2).$implicit;return i.\u0275\u0275nextContext(2).RemoveProfile(v)}),i.\u0275\u0275elementEnd()}}function St(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275template(1,Le,6,2,"div",75),i.\u0275\u0275elementStart(2,"div",76),i.\u0275\u0275elementStart(3,"ul"),i.\u0275\u0275elementStart(4,"li"),i.\u0275\u0275template(5,$e,1,0,"button",77),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(6,"li"),i.\u0275\u0275template(7,we,1,0,"button",78),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(8,"li"),i.\u0275\u0275template(9,rt,1,0,"button",79),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(10,"li"),i.\u0275\u0275template(11,Ot,1,0,"button",80),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().$implicit;i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.ProfileEdit),i.\u0275\u0275advance(4),i.\u0275\u0275property("ngIf",!c.ProfileEdit),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",c.ProfileEdit),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",c.ProfileEdit),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",!c.ProfileEdit)}}function at(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275template(1,_e,2,1,"div",73),i.\u0275\u0275template(2,St,12,5,"div",2),i.\u0275\u0275elementEnd()),2&D){const c=le.$implicit;i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.ProfileEdit),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.IsEditRenameButtonVisible)}}function We(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div",64),i.\u0275\u0275elementStart(1,"div",65),i.\u0275\u0275elementStart(2,"ul"),i.\u0275\u0275elementStart(3,"li"),i.\u0275\u0275elementStart(4,"mat-form-field"),i.\u0275\u0275template(5,B,1,1,"input",66),i.\u0275\u0275template(6,se,1,1,"input",67),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(7,"li"),i.\u0275\u0275elementStart(8,"button",68),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().AddProfile()}),i.\u0275\u0275text(9,"Add Profile"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(10,"li"),i.\u0275\u0275elementStart(11,"button",68),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().displayProfilePopup()}),i.\u0275\u0275text(12,"Close"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(13,"div",69),i.\u0275\u0275elementStart(14,"h3"),i.\u0275\u0275text(15,"Profile List"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(16,"ul"),i.\u0275\u0275template(17,at,3,2,"li",70),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275property("@profileTemplateVisible",c.profileTemplateState),i.\u0275\u0275advance(5),i.\u0275\u0275property("ngIf",c.appSyncON),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.appSyncON),i.\u0275\u0275advance(11),i.\u0275\u0275property("ngForOf",c.objProfile.ProfileList[0].Data)}}function It(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",93),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(3).delRow()}),i.\u0275\u0275elementEnd()}}function kt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",94),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(3).RemoveScrip()}),i.\u0275\u0275elementEnd()}}function bt(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275template(1,It,1,0,"button",91),i.\u0275\u0275template(2,kt,1,0,"button",92),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.isOneChecked),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.isOneChecked)}}function Mt(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"mwTable",95,96),i.\u0275\u0275listener("ProcessOEandB5",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).ProcessOEandB5(v)})("dragSuccess",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).dragSuccess(v)})("onChecked",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).onCheckBoxSelect(v)})("colDragSuccess",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).colDragSuccess(v)})("onViewPortChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).onViewPortChange(v)}),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext(2),C=i.\u0275\u0275reference(77),v=i.\u
10275\u0275reference(52);i.\u0275\u0275advance(1),i.\u0275\u0275property("showFilter",c.showFilter)("layoutMode",c.reportGridLayoutMode)("blockViewTempl",C)("rowExpandTempl",v)("fixedHdrConfig",c.fixedHdrConfig)("fhTopHeight","38px")("columns",c.columns)("rows",c.rows)}}function ai(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",90),i.\u0275\u0275template(1,bt,3,2,"div",2),i.\u0275\u0275template(2,Mt,3,8,"div",2),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.gridViewBtn&&c.rows.length>0),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.showProgressBar)}}function si(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",99),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).delRow()}),i.\u0275\u0275elementEnd()}}function st(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",100),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext(2).RemoveScrip()}),i.\u0275\u0275elementEnd()}}function ci(D,le){if(1&D&&(i.\u0275\u0275template(0,si,1,0,"button",97),i.\u0275\u0275template(1,st,1,0,"button",98)),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275property("ngIf",!c.isOneChecked),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.isOneChecked)}}function Pi(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",103),i.\u0275\u0275listener("click",function(v){i.\u0275\u0275restoreView(c);const A=i.\u0275\u0275nextContext().row;return i.\u0275\u0275nextContext().HandleAddAlert(A,v)}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275property("className",c.AlertColor)("matTooltip","Alert")}}function Ei(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",104),i.\u0275\u0275listener("click",function(v){i.\u0275\u0275restoreView(c);const A=i.\u0275\u0275nextContext().row;return i.\u0275\u0275nextContext().GlobalNewsIndicator(A,v)}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275property("matTooltip","News")("className",c.ScripNewsIndicatorColor)}}function yi(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",104),i.\u0275\u0275listener("click",function(v){i.\u0275\u0275restoreView(c);const A=i.\u0275\u0275nextContext().row;return i.\u0275\u0275nextContext().ShowReco(A,v)}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275property("matTooltip","Calls")("className",c.ScripRecoIndicatorColor)}}function Ii(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",106),i.\u0275\u0275listener("click",function(v){const z=i.\u0275\u0275restoreView(c).$implicit;return i.\u0275\u0275nextContext(3).onHover(z,v)})("mousemove",function(v){const z=i.\u0275\u0275restoreView(c).$implicit;return i.\u0275\u0275nextContext(3).onHover(z,v)}),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()}if(2&D){const c=le.$implicit;i.\u0275\u0275nextContext(3);const C=i.\u0275\u0275reference(59);i.\u0275\u0275property("matPopoverTriggerFor",C),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.Icon)}}function Mi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"span"),i.\u0275\u0275template(1,Ii,2,2,"button",105),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.CorpAction)}}function xi(D,le){if(1&D&&(i.\u0275\u0275template(0,Pi,1,2,"input",101),i.\u0275\u0275template(1,Ei,1,2,"input",102),i.\u0275\u0275template(2,yi,1,2,"input",102),i.\u0275\u0275template(3,Mi,2,1,"span",2)),2&D){const c=le.row,C=i.\u0275\u0275nextContext();i.\u0275\u0275property("ngIf",C.isAlertAllowed),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.isNewsAllowed),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.isRecoAllowed),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.CorpAction.length>0)}}function Oi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",109),i.\u0275\u0275element(1,"sparkline",110),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275advance(1),i.\u0275\u0275property("inputdata",c.LTPSparkLine)}}function Di(D,le){if(1&D&&(i.\u0275\u0275element(0,"span",107),i.\u0275\u0275template(1,Oi,2,1,"div",108)),2&D){const c=le.row,C=i.\u0275\u0275nextContext();i.\u0275\u0275property("ngClass",c.LTPTrend)("innerHTML",c.LTP,i.\u0275\u0275sanitizeHtml),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.LTPSparklineVisible)}}function Ai(D,le){if(1&D&&i.\u0275\u0275element(0,"span",107),2&D){const c=le.row;i.\u0275\u0275property("ngClass",c.SymbolTrend)("innerHTML",c.PercNetChange,i.\u0275\u0275sanitizeHtml)}}function Li(D,le){if(1&D&&i.\u0275\u0275element(0,"span",107),2&D){const c=le.row;i.\u0275\u0275property("ngClass",c.SymbolTrend)("innerHTML",c.NetChangeInRs,i.\u0275\u0275sanitizeHtml)}}function bi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"div",121),i.\u0275\u0275element(2,"best-of-five",122),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"div",121),i.\u0275\u0275element(4,"pivot-point",123),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275advance(2),i.\u0275\u0275property("Scrip",c.ScripDetail)("isB5HdrVisible",!1)("isExchNameVisible",!1)("isBuySellLinkVisible",!1)("isLookUp",!1),i.\u0275\u0275advance(2),i.\u0275\u0275property("Scrip",c.ScripDetail)}}function Fi(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",127),i.\u0275\u0275listener("click",function(){i.\u0275\u0275restoreView(c);
1const v=i.\u0275\u0275nextContext(2).row;return i.\u0275\u0275nextContext().openAdvChart(v.ScripDetail)}),i.\u0275\u0275text(1,"Advanced Chart"),i.\u0275\u0275elementEnd()}}function ki(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",124),i.\u0275\u0275template(1,Fi,2,0,"button",125),i.\u0275\u0275element(2,"basic-chart",126),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row,C=i.\u0275\u0275nextContext();i.\u0275\u0275styleProp("width",C.screenWidth,"px"),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.isChartIQ),i.\u0275\u0275advance(1),i.\u0275\u0275property("Scrip",c.ScripDetail)("isB5HdrVisible",!1)}}function Vi(D,le){if(1&D&&i.\u0275\u0275element(0,"app-contractInfo",123),2&D){const c=i.\u0275\u0275nextContext(2).row;i.\u0275\u0275property("Scrip",c.ScripDetail)}}function Ri(D,le){if(1&D&&i.\u0275\u0275element(0,"app-securityInfo",123),2&D){const c=i.\u0275\u0275nextContext(2).row;i.\u0275\u0275property("Scrip",c.ScripDetail)}}function Ni(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275template(1,Vi,1,1,"app-contractInfo",128),i.\u0275\u0275template(2,Ri,1,1,"app-securityInfo",128),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.showSecurityInfo),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",!c.showSecurityInfo)}}function wi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275element(1,"combined-Depth",129),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row,C=i.\u0275\u0275nextContext();i.\u0275\u0275advance(1),i.\u0275\u0275property("PageSource",C.IpPageSource)("isExchNameVisible",!0)("isBuySellLinkVisible",!0)("Scrip",c.ScripDetail)}}function Bi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",132),i.\u0275\u0275element(1,"recommendhistory",133),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2).row,C=i.\u0275\u0275nextContext();i.\u0275\u0275styleProp("width",C.screenWidth,"px"),i.\u0275\u0275advance(1),i.\u0275\u0275property("ViewAllButton","false")("mwData",c)("recoLookUp",!1)("viewBtn",!1)("exchdropdwn",!1)}}function Gi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"mat-tab",130),i.\u0275\u0275text(1," //BT-41387:BhaveshM:03062021: Multi Leg order window in Aero "),i.\u0275\u0275template(2,Bi,2,7,"div",131),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",4==c.activeTabIndex)}}function Ui(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div",111),i.\u0275\u0275elementStart(1,"div",112),i.\u0275\u0275elementStart(2,"div"),i.\u0275\u0275elementStart(3,"mat-tab-group",113),i.\u0275\u0275listener("selectedIndexChange",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().activeTabIndex=v}),i.\u0275\u0275elementStart(4,"mat-tab",114),i.\u0275\u0275template(5,bi,5,6,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(6,"mat-tab",115),i.\u0275\u0275template(7,ki,3,5,"div",116),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(8,"mat-tab",117),i.\u0275\u0275template(9,Ni,3,2,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(10,"mat-tab",118),i.\u0275\u0275template(11,wi,2,4,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(12,Gi,3,1,"mat-tab",119),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(13,"div",120),i.\u0275\u0275elementStart(14,"button",17),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().populateOE("BUY")}),i.\u0275\u0275text(15,"BUY"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(16,"button",18),i.\u0275\u0275listener("click",function(){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().populateOE("SELL")}),i.\u0275\u0275text(17,"SELL"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()}if(2&D){const c=le.row,C=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("@.disabled","true"),i.\u0275\u0275advance(1),i.\u0275\u0275property("selectedIndex",C.activeTabIndex),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",0==C.activeTabIndex),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",1==C.activeTabIndex),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",2==C.activeTabIndex),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",3==C.activeTabIndex),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.isRecoAllowed&&1!=c.ScripDetail.IsSpread)}}function Wi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275element(1,"scripLink",134),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275advance(1),i.\u0275\u0275property("type","twopartdesc")("instru",c.ScripDetail.InstrumentName)("spread",c.ScripDetail.Spread)("pageSource","T")("mktSegId",c.ScripDetail.ScripDet.MapMktSegId)("token",c.ScripDetail.ScripDet.Token)("symbol",c.ScripDetail.MWSecurityDesc)("rowclassName",c.SymbolTrend)("descPart1",c.ScripDetail.DescPart1)("descPart2",c.ScripDetail.DescPart2)}}function Hi(D,le){1&D&&i.\u0275\u0275template(0,Wi,2,10,"div",2),2&D&&i.\u0275\u0275property("ngIf",le.row)}function Qi(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",106),i.\u0275\u0275listener("click",function(v){const z=i.\u0275\u0275restoreView(c).$implicit;return i.\u0275\u0275nextContext(3).onHover(z,v)})("mousemove",function(v){const z=i.\u0275\u0275restoreView(c).$implicit;return i.\u0275\u0275nextContext(3).onHover(z,v)}),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()}if(2&D){const c=le.$implicit;i.\u0275\u0275nextContext(3);const C=i.\u0275\u0275reference(59);i.\u0275\u0275property("matPopoverTriggerFor",C),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.Icon)}}function Yi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275template(1,Qi,2,2,"button",105),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.CorpAction)}}function Xi(D,le){1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"span"),i.\u0275\u0275text(2,"-"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd())}function Ki(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",135),i.\u0275\u0275template(1,Yi,2,1,"div",2),i.\u0275\u0275template(2,Xi,3,0,"div",2),i.\u0275\u0275elementEnd()),2&D){const c=le.row;i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.CorpAction.length>0),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",0==c.CorpAction.length)}}function di(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Face Value"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.FaceVal)}}function hi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Announcement Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.AnnounceDate)}}function pi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Dividend Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.RecordDate)}}function zt(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Dividend Amount Rs."),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.CARatio)}}function zi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Dividend Percentage"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate1("",c.Premium," %")}}function Ji(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Remark"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.Remark)}}function qi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",136),i.\u0275\u0275elementStart(1,"mat-card-content",137),i.\u0275\u0275template(2,di,5,1,"div",2),i.\u0275\u0275template(3,hi,5,1,"div",2),i.\u0275\u0275template(4,pi,5,1,"div",2),i.\u0275\u0275template(5,zt,5,1,"div",2),i.\u0275\u0275template(6,zi,5,1,"div",2),i.\u0275\u0275template(7,Ji,5,1,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",""!=c.FaceVal),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.AnnounceDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.RecordDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.Premium),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.CARatio),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.Remark)}}function Zi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Value"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.FaceVal)}}function $i(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Announcement Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.AnnounceDate)}}function ji(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Record Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.RecordDate)}}function er(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Split Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.CADate)}}function tr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Face Value Before"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.FaceValBefore)}}function ir(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Face Value After"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.FaceValAfter)}}function rr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Remark"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.Remark)}}function nr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",136),i.\u0275\u0275elementStart(1,"mat-card-content",137),i.\u0275\u0275template(2,Zi,5,1,"div",2),i.\u0275\u0275template(3,$i,5,1,"div",2),i.\u0275\u0275template(4,ji,5,1,"div",2),i.\u0275\u0275template(5,er,5,1,"div",2),i.\u0275\u0275template(6,tr,5,1,"div",2),i.\u0275\u0275template(7,ir,5,1,"div",2),i.\u0275\u0275template(8,rr,5,1,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",""!=c.FaceVal),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.AnnounceDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.RecordDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.CADate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.FaceValBefore),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.FaceValAfter),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.Remark)}}function mi(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Face Value"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.FaceVal)}}function ar(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Announcement Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.AnnounceDate)}}function sr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Record Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.RecordDate)}}function lr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Bonus Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.CADate)}}function or(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Bonus Ratio"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.CARatio)}}function cr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Remark"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.Remark)}}function dr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",136),i.\u0275\u0275elementStart(1,"mat-card-content",137),i.\u0275\u0275template(2,mi,5,1,"div",2),i.\u0275\u0275template(3,ar,5,1,"div",2),i.\u0275\u0275template(4,sr,5,1,"div",2),i.\u0275\u0275template(5,lr,5,1,"div",2),i.\u0275\u0275template(6,or,5,1,"div",2),i.\u0275\u0275template(7,cr,5,
11,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",""!=c.FaceVal),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.AnnounceDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.RecordDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.CADate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.CARatio),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.Remark)}}function hr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Face Value"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.FaceVal)}}function pr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Announcement Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.AnnounceDate)}}function mr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Record Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.RecordDate)}}function ur(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Right Date"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.CADate)}}function Sr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Right Ratio"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.CARatio)}}function _r(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Premium"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.Premium)}}function gr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275elementStart(1,"label"),i.\u0275\u0275text(2,"Remark"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(3,"span"),i.\u0275\u0275text(4),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext(2);i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate(c.Remark)}}function Tr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div",136),i.\u0275\u0275elementStart(1,"mat-card-content",137),i.\u0275\u0275template(2,hr,5,1,"div",2),i.\u0275\u0275template(3,pr,5,1,"div",2),i.\u0275\u0275template(4,mr,5,1,"div",2),i.\u0275\u0275template(5,ur,5,1,"div",2),i.\u0275\u0275template(6,Sr,5,1,"div",2),i.\u0275\u0275template(7,_r,5,1,"div",2),i.\u0275\u0275template(8,gr,5,1,"div",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",""!=c.FaceVal),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.AnnounceDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.RecordDate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.CADate),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.CARatio),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.Premium),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",""!=c.Remark)}}function fr(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"input",104),i.\u0275\u0275listener("click",function(v){i.\u0275\u0275restoreView(c);const A=i.\u0275\u0275nextContext().row;return i.\u0275\u0275nextContext().ShowReco(A,v)}),i.\u0275\u0275elementEnd()}if(2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275property("matTooltip","Calls")("className",c.ScripRecoIndicatorColor)}}function Cr(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"button",106),i.\u0275\u0275listener("click",function(v){const z=i.\u0275\u0275restoreView(c).$implicit;return i.\u0275\u0275nextContext(3).onHover(z,v)})("mousemove",function(v){const z=i.\u0275\u0275restoreView(c).$implicit;return i.\u0275\u0275nextContext(3).onHover(z,v)}),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd()}if(2&D){const c=le.$implicit;i.\u0275\u0275nextContext(3);const C=i.\u0275\u0275reference(59);i.\u0275\u0275property("matPopoverTriggerFor",C),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.Icon)}}function vr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"li"),i.\u0275\u0275template(1,Cr,2,2,"button",105),i.\u0275\u0275elementEnd()),2&D){const c=i.\u0275\u0275nextContext().row;i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",c.CorpAction)}}function Pr(D,le){1&D&&(i.\u0275\u0275elementStart(0,"span"),i.\u0275\u0275text(1," ("),i.\u0275\u0275elementEnd())}function Er(D,le){1&D&&(i.\u0275\u0275elementStart(0,"span"),i.\u0275\u0275text(1,")"),i.\u0275\u0275elementEnd())}function yr(D,le){1&D&&(i.\u0275\u0275elementStart(0,"span"),i.\u0275\u0275text(1," ("),i.\u0275\u0275elementEnd())}function Ir(D,le){1&D&&(i.\u0275\u0275elementStart(0,"span"),i.\u0275\u0275text(1,")"),i.\u0275\u0275elementEnd())}function Mr(D,le){}const xr=function(D,le){return{value:D,row:le}};function Or(D,le){if(1&D&&i.\u0275\u0275template(0,Mr,0,0,"ng-template",169),2&D){const c=i.\u0275\u0275nextContext(2),C=c.value,v=c.row;i.\u0275\u0275nextContext();const A=i.\u0275\u0275reference(52);i.\u0275\u0275property("ngTemplateOutlet",A)("ngTemplateOutletContext",i.\u0275\u0275pureFunction2(2,xr,C,v))}}function Dr(D,le){if(1&D&&(i.\u0275\u0275elementStart(0,"div"),i.\u0275\u0275template(1,Or,1,5,void 0,2),i.\u0275\u0275elementEnd()),2&D){i.\u0275\u0275nextContext(2);const c=i.\u0275\u0275reference(52);i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c)}}function Ar(D,le){if(1&D){const c=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div",138),i.\u0275\u0275elementStart(1,"div",139),i.\u0275\u0275listener("click",function(v){const z=i.\u0275\u0275restoreView(c).row;return i.\u0275\u0275nextContext().RowClickBV(z,v)}),i.\u0275\u0275elementStart(2,"div",140),i.\u0275\u0275elementStart(3,"div",141),i.\u0275\u0275elementStart(4,"ul"),i.\u0275\u0275elementStart(5,"li"),i.\u0275\u0275elementStart(6,"mat-checkbox",142),i.\u0275\u0275listener("ngModelChange",function(v){return i.\u0275\u0275restoreView(c).row.isCheckSelected=v})("click",function(v){return i.\u0275\u0275restoreView(c),i.\u0275\u0275nextContext().onBWCheckboxChange(v)}),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(7,"li"),i.\u0275\u0275elementStart(8,"input",143),i.\u0275\u0275listener("click",function(v){const z=i.\u0275\u0275restoreView(c).row;return i.\u0275\u0275nextContext().HandleAddAlert(z,v)}),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(9,"li"),i.\u0275\u0275elementStart(10,"input",143),i.\u0275\u0275listener("click",function(v){const z=i.\u0275\u0275restoreView(c).row;return i.\u0275\u0275nextContext().GlobalNewsIndicator(z,v)}),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(11,"li"),i.\u0275\u0275template(12,fr,1,2,"input",102),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(13,vr,2,1,"li",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(14,"div",144),i.\u0275\u0275element(15,"areachart",145),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(16,"div",146),i.\u0275\u0275elementStart(17,"label"),i.\u0275\u0275text(18,"LUT"),i.\u0275\u0275elementEnd(),i.\u0275\u0275text(19," \xa0 "),i.\u0275\u0275elementStart(20,"span"),i.\u0275\u0275text(2
11),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(22,"div",147),i.\u0275\u0275elementStart(23,"div",148),i.\u0275\u0275element(24,"scripLink",149),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(25,"div",150),i.\u0275\u0275elementStart(26,"div",151),i.\u0275\u0275elementStart(27,"div",152),i.\u0275\u0275element(28,"span",107),i.\u0275\u0275text(29," \xa0 "),i.\u0275\u0275element(30,"span",107),i.\u0275\u0275text(31," \xa0 "),i.\u0275\u0275element(32,"span",107),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(33,"div",23),i.\u0275\u0275elementStart(34,"div"),i.\u0275\u0275elementStart(35,"ul"),i.\u0275\u0275elementStart(36,"li"),i.\u0275\u0275elementStart(37,"label"),i.\u0275\u0275text(38,"Open"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(39,"br"),i.\u0275\u0275elementStart(40,"span"),i.\u0275\u0275text(41),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(42,"li"),i.\u0275\u0275elementStart(43,"label"),i.\u0275\u0275text(44,"Close"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(45,"br"),i.\u0275\u0275elementStart(46,"span"),i.\u0275\u0275text(47),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(48,"li"),i.\u0275\u0275elementStart(49,"label"),i.\u0275\u0275text(50,"Volume"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(51,"br"),i.\u0275\u0275elementStart(52,"span"),i.\u0275\u0275text(53),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(54,"li"),i.\u0275\u0275elementStart(55,"label"),i.\u0275\u0275text(56,"Open Int"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(57,"br"),i.\u0275\u0275elementStart(58,"span"),i.\u0275\u0275text(59),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(60,"li"),i.\u0275\u0275elementStart(61,"label"),i.\u0275\u0275text(62,"OI %"),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(63,"br"),i.\u0275\u0275elementStart(64,"span"),i.\u0275\u0275text(65),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(66,"div",153),i.\u0275\u0275elementStart(67,"div",154),i.\u0275\u0275elementStart(68,"div",155),i.\u0275\u0275elementStart(69,"div",156),i.\u0275\u0275elementStart(70,"h2",157),i.\u0275\u0275text(71,"Buy"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(72,"span"),i.\u0275\u0275text(73),i.\u0275\u0275elementEnd(),i.\u0275\u0275text(74,"\xa0"),i.\u0275\u0275template(75,Pr,2,0,"span",2),i.\u0275\u0275elementStart(76,"span",158),i.\u0275\u0275text(77),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(78,Er,2,0,"span",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(79,"div",23),i.\u0275\u0275element(80,"br"),i.\u0275\u0275elementStart(81,"div",159),i.\u0275\u0275elementStart(82,"div",156),i.\u0275\u0275elementStart(83,"h2",160),i.\u0275\u0275text(84,"Sell"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(85,"span"),i.\u0275\u0275text(86),i.\u0275\u0275elementEnd(),i.\u0275\u0275text(87,"\xa0"),i.\u0275\u0275template(88,yr,2,0,"span",2),i.\u0275\u0275elementStart(89,"span",158),i.\u0275\u0275text(90),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(91,Ir,2,0,"span",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(92,"div",161),i.\u0275\u0275elementStart(93,"div",162),i.\u0275\u0275elementStart(94,"ul"),i.\u0275\u0275elementStart(95,"li"),i.\u0275\u0275elementStart(96,"div",163),i.\u0275\u0275elementStart(97,"div",164),i.\u0275\u0275text(98," Today's Low/High "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(99,"div",165),i.\u0275\u0275element(100,"rangeSlider",166),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(101,"li"),i.\u0275\u0275elementStart(102,"div",163),i.\u0275\u0275elementStart(103,"div",164),i.\u0275\u0275text(104," Previous Low/High "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(10
15,"div",165),i.\u0275\u0275element(106,"rangeSlider",166),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(107,"li"),i.\u0275\u0275elementStart(108,"div",163),i.\u0275\u0275elementStart(109,"div",164),i.\u0275\u0275text(110," 52 Week Low/High "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(111,"div",165),i.\u0275\u0275element(112,"rangeSlider",166),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(113,"div",167),i.\u0275\u0275elementStart(114,"ul"),i.\u0275\u0275elementStart(115,"li"),i.\u0275\u0275elementStart(116,"h2"),i.\u0275\u0275text(117,"Weekly"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(118,"li"),i.\u0275\u0275elementStart(119,"label"),i.\u0275\u0275text(120,"Average Volume"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(121,"span",168),i.\u0275\u0275text(122),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(123,"li"),i.\u0275\u0275elementStart(124,"label"),i.\u0275\u0275text(125,"% Change"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(126,"span",168),i.\u0275\u0275text(127),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(128,"li"),i.\u0275\u0275elementStart(129,"div",163),i.\u0275\u0275elementStart(130,"div",164),i.\u0275\u0275text(131," Low/High "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(132,"div",165),i.\u0275\u0275element(133,"rangeSlider",166),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(134,"div",23),i.\u0275\u0275template(135,Dr,2,1,"div",2),i.\u0275\u0275elementEnd()}if(2&D){const c=le.row,C=i.\u0275\u0275nextContext();i.\u0275\u0275advance(1),i.\u0275\u0275property("ngClass",c.SelectedMWDataClass),i.\u0275\u0275advance(5),i.\u0275\u0275property("ngModel",c.isCheckSelected)("checked",c.isCheckSelected),i.\u0275\u0275advance(2),i.\u0275\u0275property("matTooltip","Alert")("ngClass",c.AlertColor),i.\u0275\u0275advance(2),i.\u0275\u0275property("matTooltip","News")("ngClass",c.ScripNewsIndicatorColor),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",C.isRecoAllowed),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.CorpAction.length>0),i.\u0275\u0275advance(2),i.\u0275\u0275property("scrip",c.ScripDetail),i.\u0275\u0275advance(6),i.\u0275\u0275textInterpolate(c.LUTFormatted),i.\u0275\u0275advance(3),i.\u0275\u0275property("type","twopartdesc")("pageSource","T")("mktSegId",c.ScripDetail.ScripDet.MapMktSegId)("token",c.ScripDetail.ScripDet.Token)("symbol",c.ScripDetail.MWSecurityDesc)("rowclassName",c.SymbolTrend)("descPart1",c.ScripDetail.DescPart1)("descPart2",c.ScripDetail.DescPart2),i.\u0275\u0275advance(4),i.\u0275\u0275property("ngClass",c.LTPTrend)("innerHTML",c.LTP,i.\u0275\u0275sanitizeHtml),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngClass",c.SymbolTrend)("innerHTML",c.NetChangeInRs,i.\u0275\u0275sanitizeHtml),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngClass",c.SymbolTrend)("innerHTML","("+c.PercNetChange+"%)",i.\u0275\u0275sanitizeHtml),i.\u0275\u0275advance(9),i.\u0275\u0275textInterpolate(c.OpenPrice),i.\u0275\u0275advance(6),i.\u0275\u0275textInterpolate(c.ClosePrice),i.\u0275\u0275advance(6),i.\u0275\u0275textInterpolate(c.Volume),i.\u0275\u0275advance(6),i.\u0275\u0275textInterpolate(c.OpenInt),i.\u0275\u0275advance(6),i.\u0275\u0275textInterpolate(c.PercOpenInt),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.BuyPrice),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",c.BuyQty),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngClass",c.BuyQtyTrend),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.BuyQty),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.BuyQty),i.\u0275\u0275advance(8),i.\u0275\u0275textInterpolate(c.SellPrice),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",c.SellQty),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngClass",c.SellQtyTrend),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(c.SellQty),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",c.SellQty),i.\u0275\u0275advance(9),i.\u0275\u0275property("min",c.LowPrice)("max",c.HighPrice)("datavalue",c.LTP),i.\u0275\u0275advance(6),i.\u0275\u0275property("min",c.PrevDayLow)("max",c.PrevDayHigh)("datavalue",c.LTP),i.\u0275\u0275advance(6),i.\u0275\u0275property("min",c.FiftyTwoWeekLow)("max",c.FiftyTwoWeekHigh)("datavalue",c.LTP),i.\u0275\u0275advance(10),i.\u0275\u0275textInterpolate(c.FiveDaysAverageV
1olume),i.\u0275\u0275advance(5),i.\u0275\u0275textInterpolate(c.OneWeekPerChange),i.\u0275\u0275advance(6),i.\u0275\u0275property("min",c.OneWeekLow)("max",c.OneWeekHigh)("datavalue",c.LTP),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",c.rowExpanded)}}let Lr=(()=>{class D{constructor(c,C,v,A,z,Se,ye,Oe,Fe,Qe,qe,Be,dt,Jt,br){this.global=c,this.zone=C,this.httpService=v,this.logService=A,this.pubsubService=z,this.dialogService=Se,this.menuManager=ye,this.tradingService=Oe,this.Alerts=Fe,this.toasterService=Qe,this.tradingSharedService=qe,this.route=Be,this.eleRef=dt,this.cdRef=Jt,this.awsappsync=br,this.isOneChecked=!1,this.activeTabIndex=0,this.showSecurityInfo=!1,this.IsScriptDragged=!1,this.reportGridLayoutMode="Grid",this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.profileTemplateState="",this.showFilter=!1,this.showProgressBar=!1,this.isTemplateModified=!1,this.isNewProfile=!1,this.objProfile=new g.N,this.isColumnViewVisible=!1,this.dcMWColList=new a.aM,this.MWColumnLayout=[],this.ColumnProfileId="3",this.ArrSubTokens=[],this.LTPSparklineVisible=!0,this.GlobalNewsIndicatorVis=!1,this.isPivotPoint=!1,this.arrPivotPointFormula=[a.gT.C_S_PP_FORMULA_HLC,a.gT.C_S_PP_FORMULA_HLO,a.gT.C_S_PP_FORMULA_HLCO,a.gT.C_S_PP_FORMULA_HLCC,a.gT.C_S_PP_FORMULA_HLOO,a.gT.C_S_PP_FORMULA_HL,a.gT.C_S_PP_FORMULA_HC,a.gT.C_S_PP_FORMULA_LC],this.SelectedPivotPointFormula=a.xB.User.PivotPrefDetails[0].sPivotPointFormula,this.arrCalcMethod=[a.gT.C_S_PP_METHOD_CLASSIC,a.gT.C_S_PP_METHOD_WOODIE,a.gT.C_S_PP_METHOD_CAMARILLA,a.gT.C_S_PP_METHOD_FIBONACCI],this.SelectedCalcMethod=a.xB.User.PivotPrefDetails[0].sCalculationMethod,this.SelectedView="Grid",this.isSVColumnsExists=!1,this.ScripKey=[],this.viewPortScripKeys=[],this.countCol=!0,this.marketWatchFilterOptions=[],this.isFirstCallForColumnTemplate=!0,this.gridViewBtn=!0,this.noViewBtn=!0,this.isAlertAllowed=!1,this.isNewsAllowed=!1,this.isRecoAllowed=!1,this.indiceTop50=[],this.showFilterInBV=!0,this.screenWidth=a.xB.ScreenWidth,this.isFirstResponse=!0,this.isMoreColumnsExists=!1,this.isCAColumnExists=!1,this.DeleteAWSAppsyncWatchListScrip=[],this.addNewScrip=[],this.SelectedMWData=new G.N,this.MWScripList=[],this.TemplateId="",this.IsDefaultTemplate=!1,this.ColumnLayout="",this.MWProfile=new g.N,this.isFirstCallForPivotWatch=!0,this.count=0,this.isEditOptionSelected=!1,this.NewProfileName="",this.scripStatus=!1,this.appSyncON=!1,this.ProfileToBeRenamed=null,this.ShowRenameProfile=function(qt){if(qt.ProfileName!=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE&&qt.ProfileId!=a.gT.C_S_SYSTEM_PROFILEID)for(var _t=this.objProfile.ProfileList[0].Data,pt=0,Fr=_t.length;pt<Fr;pt++)_t[pt].IsEditRenameButtonVisible()&&qt.ProfileId==_t[pt].ProfileId&&qt.ProfileName==_t[pt].ProfileName?_t[pt].ProfileName!=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE&&(_t[pt].IsProfileNameTxtVisible=!0,_t[pt].ProfileNameFocus=!0,_t[pt].ShowProfileName=!1,_t[pt].ProfileNameDisplay=qt.ProfileName,_t[pt].IsEditRenameButtonVisible=!1):_t[pt].ProfileName!=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE&&(_t[pt].IsProfileNameTxtVisible=!1,_t[pt].ProfileNameFocus=!1,_t[pt].ShowProfileName=!0,_t[pt].IsEditRenameButtonVisible=!0);else this.dialogService.alert("Cannot rename the Default profile")},this.ProfileToBeRemoved=null,this.firstkafirst=!0,this.tagName="TBODY",this.isChartIQ=!1}ngOnInit(){try{this.SubScribeMessages(),this.indiceTop50.push({id:"ALPHA",value:"Alphabetic"},{id:"VOL",value:"Volume"},{id:"VAL",value:"Value"}),this.sub=this.route.params.subscribe(c=>{"MW"==c.type?(this.SelectedView=a.xB.User.MarketWatchPerfDetails[0].sDefaultMWView,this.gridViewBtn=this.SelectedView==a.gT.C_S_TAG_GRIDVIEW,this.showFilterInBV=this.SelectedView==a.gT.C_S_TAG_GRIDVIEW,this.reportGridLayoutMode=this.SelectedView,this.noViewBtn=!0,this.isFirstCallForColumnTemplate=!0):(this.SelectedView="Pivot Point",this.ColumnProfileId="7",this.reportGridLayoutMode="Grid",this.noViewBtn=!1,this.isFirstCallForPivotWatch=!0),this.top50=this.indiceTop50[2],a.xB.dConfigMaster.CONST_ALERT_ALLOWED==a.gT.C_S_ON&&a.vV.IsAllowedClientFacility(a.gT.C_S_FACILITY_ALERT)&&(this.isAlertAllowed=!0),a.xB.dConfigMaster.CONST_NEWS_ALLOWED==a.gT.C_S_ON&&""!=a.xB.User.NewsVen
1dorId&&""!=a.xB.User.NewsCategories&&(this.isNewsAllowed=!0),a.xB.dConfigMaster.EBUZZ_MANUALRECOMMENDATION==a.gT.C_S_ON&&(this.isRecoAllowed=!0),this.showProgressBar=!0,this.isTemplateModified=!1,this.objProfile=new g.N,this.setSparkLineStatus(),this.fillFilterOptions(),this.initTableOptions()}),this.ToggleAdvBtnForChartIQ()}catch(c){this.logService.WriteLog("Exception: "+c.message,"ngOnInit()","marketwatch.component.ts","")}}setSparkLineStatus(){null!=a.xB.User.MarketWatchPerfDetails&&null!=a.xB.User.MarketWatchPerfDetails&&(this.LTPSparklineVisible="1"==a.xB.User.MarketWatchPerfDetails[0].nDisplaySparkLine)}fillFilterOptions(){this.marketWatchFilterOptions.push({key:"All",option:"All"},{key:"Act_Vol",option:"Most Active by Volume"},{key:"Act_Val",option:"Most Active by Value"},{key:"OI_G",option:"OI gainers"},{key:"OI_L",option:"OI Losers"},{key:"Premium",option:"Premium"},{key:"Discount",option:"Discount"},{key:"Price_G",option:"Price Gainers"},{key:"Price_L",option:"Price Losers"}),this.filterMarketWatch=this.marketWatchFilterOptions[0]}initTableOptions(){this.isPivotPoint=!1,this.SelectedView==a.gT.C_S_TAG_GRIDVIEW?this.loadMarketWatch():this.SelectedView==a.gT.C_S_TAG_PP?this.loadPPWatch():this.SelectedView==a.gT.C_S_TAG_BLOCKVIEW&&this.LoadProfileList()}loadMarketWatch(){this.tradingSharedService.FetchColumnTemplateDetails({UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:3,TmpltNm:"UDCOLTMPT",ProfNm:this.objProfile.SelectedProfileName,ResetUser:"Y"}).then(v=>{this.fn_GetMWColumnList(v,!1),this.isFirstCallForColumnTemplate=!1,this.LoadProfileList()})}loadPPWatch(){this.tradingSharedService.FetchColumnTemplateDetails({UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:7,TmpltNm:"",ProfNm:this.objProfile.SelectedProfileName,ResetUser:"Y"}).then(v=>{this.fn_GetPivotWatchColumnList(v),this.LoadProfileList()})}displayProfilePopup(){this.NewProfileName="";for(var c=this.objProfile.ProfileList[0].Data,C=0,v=c.length;C<v;C++)c[C].ProfileEdit=!1;this.profileTemplateState="shown"==this.profileTemplateState?"hidden":"shown"}addScripCallBack(c){this.AddScripToMarketWatchList(c)}AddScripToMarketWatchList(c){try{if(this.MWScripList.length<a.xB.dConfigMaster.CONST_STR_SCRIPS_PER_PROFILE){var C=!1;""==c.ScripDet.Token&&(this.dialogService.alert("Scrip does not exist"),C=!0);for(var v=this.MWScripList.length;v--;)if(this.MWScripList[v].ScripDetail.ScripDet.MktSegId==c.ScripDet.MktSegId&&this.MWScripList[v].ScripDetail.ScripDet.Token==c.ScripDet.Token){this.toasterService.toastMessage("error","Market Watch","The scrip already exists"),C=!0;break}if(0==C){c.MWSecurityDescShort=l.X.FormatScripDescForMW(c);var A=new G.N;if(A.ScripDetail=c,this.SelectedView==a.gT.C_S_TAG_PP&&(A.PPWData=new n.V),this.Alerts.ScripAlertList.Count()>0){var z=null;for(v=0;v<this.Alerts.ScripAlertList.length;v++)if(this.Alerts.ScripAlertList[v].ScripData.MktSegId===A.ScripDetail.ScripDet.MktSegId&&this.Alerts.ScripAlertList[v].ScripData.Token===A.ScripDetail.ScripDet.Token){z=this.Alerts.ScripAlertList[v];break}null!==z&&(A.AlertColor=z.AlertColor)}A.rowExpanded=!1,this.MWScripList.length>0?this.MWScripList.splice(0,0,A):(this.MWScripList=[],this.MWScripList.push(A)),this.MWScripList=[...this.MWScripList],this.mwTable&&(this.mwTable.reApplyFH(),this.mwTable.detectChange()),this.ScripKey.splice(0,0,A.ScripDetail.ScripDet);var Se=[];Se.push(c.ScripDet),this.getCAColumnDetails(Se),this.getMoreColumnHistoricData(Se),this.isTemplateModified=!0,this.toasterService.toastMessage("success","Market Watch",this.filterMarketWatch==this.marketWatchFilterOptions[0]?"Script added to watchlist":"Script added to watchlist and filters applied"),this.SaveAsProfile("U"),this.SelectedView==a.gT.C_S_TAG_PP?this.LoadPPW(Se):this.isSVColumnsExists&&this.GetSVMWColumn(),setTimeout(()=>{this.applyFilter()},100)}}else this.dialogService.alert("Maximum number of scrips allowed in a profile are "+a.xB.dConfigMaster.CONST_STR_SCRIPS_PER_PROFILE)}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"AddScripToMarketWatchList()","marketwatch.component.ts","")}}RemoveScrip(){var C=-1;if(0==this.rows.length)this.dialogService.alert("Atleast one scrip is required for remove");else if(this.rows.length>1){for(var v=0,A=this.rows.length;v<A;v++)this.rows[v].isCheckSelected&&C++;C>=0?C!=this.rows.length-1?this.dialogService.confirm("Do you want to remove selected scrip(s)").subscribe(z=>{z&&(this.RemoveScripConfirm(),this.isOneChecked=!1)}):this.dialogService.alert("You can not delete all scrips. Atleast one scrip is required in marketwatch"):C>0&&this.dialogService.alert("Atleast one scrip is required for remove")}else this.dialogService.alert("You can not delete all scrips. Atleast one scrip is required in marketwatch")}RemoveScripConfirm(){var c=[];this.DeleteAWSAppsyncWatchListScrip=[];for(var C=0,v=this.MWScripList.length;C<v;C++)if(this.MWScripList[C].isCheckSelected){var A=this.MWScripList.indexOf(this.MWScripList[C]);if(this.DeleteAWSAppsyncWatchListScrip.push(this.MWScripList[C].ScripDetail.ScripDet),A>-1){var z=this.MWScripList.splice(A,1);c.push(z[0].ScripDetail.ScripDet),v=this.MWScripList.length,C=-1}}if(this.ScripKey=[],this.MWScripList.length>0)for(C=0;C<this.MWScripList.length;C++)this.ScripKey.push(this.MWScripList[C].ScripDetail.ScripDet);this.MWScripList[0].SelectedMWDataClass="ht03 odd mdetail mwgrid_selected",this.SelectedMWData=this.MWScripList[0],this.SelectedMWData=this.MWScripList[0],this.isTemplateModified=!0,this.MWScripList=[...this.MWScripList],this.mwTable&&(this.mwTable.reAlignFH(),this.mwTable.detectChange()),setTimeout(()=>{this.applyFilter()},0),this.SaveAsProfile("D")}LoadPPW(c){try{for(var C=new a.HT,v=0,A=c.length;v<A;v++)for(var z=0;z<this.MWScripList.length;z++)if(this.MWScripList[z].ScripDetail.ScripDet.Token==c[v].Token&&this.MWScripList[z].ScripDetail.ScripDet.MktSegId==c[v].MktSegId){""==this.MWScripList[z].PPWData.CalculationMethod&&C.Append(v<A-1?l.X.GetMappedMarketSegmentId(c[v].MktSegId)+a.gT.C_S_NAMEVALUE_DELIMITER+c[v].Token+a.gT.C_S_RECORD_DELIMITER:l.X.GetMappedMarketSegmentId(c[v].MktSegId)+a.gT.C_S_NAMEVALUE_DELIMITER+c[v].Token);break}var Se=C.toString();""!=Se&&this.httpService.postData(a.xB.tradingAPIUrl,"GetPivotPointDataForNetNet",{UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ScripList:Se}).subscribe(Oe=>{this.fn_GetPivotPointDataCompleted(Oe)})}catch(Oe){this.logService.WriteLog("Exception: "+Oe.message,"LoadPPW","marketwatch.component.ts","")}}CalculatePivotPoint(){for(var c=0,C=this.MWScripList.length;c<C;c++)if(null!=this.MWScripList[c].PPWData&&""!=this.MWScripList[c].PPWData.CalculationMethod){if(this.MWScripList[c].PPWData.CalculationMethod==this.SelectedCalcMethod&&this.MWScripList[c].PPWData.PPFormula==this.SelectedPivotPointFormula)break;this.MWScripList[c].PPWData.CalculationMethod=this.SelectedCalcMethod,this.MWScripList[c].PPWData.PPFormula=this.SelectedPivotPointFormula,this.MWScripList[c].PPWData.CalculatePP(this.MWScripList[c].ScripDetail.ScripDet.MktSegId,this.MWScripList[c].ScripDetail.DecimalLocator)}this.mwTable&&(this.mwTable.reApplyFH(),this.mwTable.detectChange())}fn_GetPivotPointDataCompleted(c){if(c.ResponseStatus){for(var C=c.ResponseObject.Table,v=0,A=this.MWScripList.length;v<A;v++)for(var z=0,Se=C.length;z<Se;z++)if(null!=C[z]&&parseFloat(this.MWScripList[v].ScripDetail.ScripDet.Token)==parseFloat(C[z].nToken)&&this.MWScripList[v].ScripDetail.ScripDet.MapMktSegId==parseFloat(C[z].nMarketSegmentId)){this.MWScripList[v].PPWData.PrevDayOpen=Number(C[z].PrevOpen).toFixed(4),this.MWScripList[v].PPWData.PrevDayHigh=Number(C[z].PrevHigh).toFixed(4),this.MWScripList[v].PPWData.PrevDayLow=Number(C[z].PrevLow).toFixed(4),this.MWScripList[v].PPWData.PrevDayClose=Number(C[z].PrevClose).toFixed(4),this.MWScripList[v].PPWData.CalculationMethod=this.SelectedCalcMethod,this.MWScripList[v].PPWData.PPFormula=this.SelectedPivotPointFormula,this.MWScripList[v].PPWData.CalculatePP(this.MWScripList[v].ScripDetail.ScripDet.MktSegId,this.MWScripList[v].ScripDetail.DecimalLocator);break}this.mwTable&&(this.mwTable.reApplyFH(),this.mwTable.detectChange()),this.showProgressBar=!1}}fn_ShowAlerts(c){try{if(this.MWScripList.Count()>0){try{for(var C=null,v=0;v<this.MWScripList.length;v++)if(null!=c.ScripDet&&this.MWScripList[v].ScripDetail.ScripDet.MktSegId===parseInt(c.ScripDet.MktSegId)&&this.MWScripList[v].ScripDetail.ScripDet.Token===c.ScripDet.Token){C=this.MWScripList[v];break}null!==C&&(C.AlertColor=c.AlertColor)}catch(A){this.logService.WriteLog("Exception: "+A.message,"ShowAlerts","tr_MarketWatch.js","")}this.mwTable&&this.mwTable.detectChange()}}catch(A){this.logService.WriteLog("Exception: "+A.message,"ShowAlerts","tr_MarketWatch.js","")}}ngOnDestroy(){try{this.isNewProfile&&this.objProfile.ProfileList[0].Data.pop();for(let c=0;c<this.ArrSubTokens.length-2;c++)this.pubsubService.unsubscribe(this.ArrSubTokens[c]);(null!=this.viewPortScripKeys||null!=this.viewPortScripKeys)&&this.viewPortScripKeys.length>0&&this.tradingSharedService.sendTouchLineRequest(this.viewPortScripKeys,2),clearInterval(this.moreColumsInterval),clearTimeout(this.filterInterval),null!=this.sub&&this.sub.unsubscribe()}catch(c){this.logService.WriteLog("Exception: "+c.message,"ngOnDestroy","marketwatch.component.ts","")}}Unsubscribe(){for(var c=0;c<this.ArrSubTokens.length;c++)this.pubsubService.unsubscribe(this.ArrSubTokens[c]);(null!=this.viewPortScripKeys||null!=this.viewPortScripKeys)&&this.viewPortScripKeys.length>0&&this.tradingSharedService.sendTouchLineRequest(this.viewPortScripKeys,2)}Subscribe(){this.SubScribeMessages(),(null!=this.viewPortScripKeys||null!=this.viewPortScripKeys)&&this.tradingSharedService.sendTouchLineRequest(this.viewPortScripKeys,2)}SubScribeMessages(){this.ArrSubTokens=[];var c=this.pubsubService.subscribe("MTLRES",(C,v)=>{this.ReceiveMWResponse(v)});this.ArrSubTokens.push(c),c=this.pubsubService.subscribe("ALERTRES",(C,v)=>{this.zone.run(()=>{this.fn_ShowAlerts(v)})}),this.ArrSubTokens.push(c),c=this.pubsubService.subscribe("NEWSRES",(C,v)=>{this.zone.run(()=>{this.fn_ShowScripNews(v)})}),this.ArrSubTokens.push(c),c=this.pubsubService.subscribe("STOCKVIEWMW",C=>{this.zone.run(()=>{this.GetScriptForMyHolding()})}),this.ArrSubTokens.push(c),c=this.pubsubService.subscribe("LOADPROFILEDATA",(C,v)=>{this.zone.run(()=>{v==this.objProfile.SelectedProfileId&&this.tradingSharedService.removeProfileToReloadProfileScrip(this.objProfile.SelectedProfileId)})}),this.ArrSubTokens.push(c),c=this.pubsubService.subscribe("RELOADMWPROFILE",(C,v)=>{this.zone.run(()=>{this.tradingSharedService.reloadProfileScrip(this.objProfile.SelectedProfileId,v)})}),this.ArrSubTokens.push(c)}fn_ShowScripNews(c){try{var C=c.OldToken.substring(1),v=c.OldToken.substring(0,1);if("2"!=v&&this.GlobalNewsIndicator(a.gT.C_S_NEWS_NORMALNEWS_UNREAD),null!=this.MWScripList&&this.MWScripList.length>0){try{null!=c.ISINs&&c.ISINs.Count()>0&&"Y"==c.Active&&("2"==C?this.fn_NewsUnderlyingWise(c):"3"==C?this.fn_NewsScripWise(c,v):this.fn_NewsIsinWise(c))}catch(A){this.logService.WriteLog("Exception: "+A.message,"ShowScripNews","marketwatch.component.ts","")}this.mwTable&&this.mwTable.detectChange()}}catch(A){this.logService.WriteLog("Exception: "+A.message,"ShowScripNews","marketwatch.component.ts","")}}fn_NewsIsinWise(c){for(var C=!1,v=0;v<c.ISINs.length;v++){var A=c.ISINs[v];if(""!==A||"undefined"!==A){for(var z=[],Se=0;Se<this.MWScripList.length;Se++){var ye=this.MWScripList[Se];ye.ScripDetail.ISIN==A&&z.push(ye)}C||z.length>0&&(C=!0);for(var Oe=0;Oe<z.length;Oe++){var Fe=z[Oe];null!==Fe&&(c.Type==a.gT.C_S_NEWSTYPE_HOT?(Fe.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_HOT,Fe.News=a.gT.C_S_NEWS_HOTNEWS_UNREAD):(Fe.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_UNREAD,Fe.News=a.gT.C_S_NEWS_NORMALNEWS_UNREAD))}z=null}}}fn_NewsScripWise(c,C){try{if("2"==C&&a.xB.dConfigMaster.EBUZZ_MANUALRECOMMENDATION==a.gT.C_S_ON||"2"!=C)for(var v=!1,A=0;A<c.ISINs.length;A++){var z=c.ISINs[A];if(""!==z||"undefined"!==z){for(var Se=z.split("$"),ye=Se[0],Oe=Se[1],Fe=[],Qe=0;Qe<this.MWScripList.length;Qe++){var qe=this.MWScripList[Qe];if(qe.ScripDetail.ScripDet.Token==Oe&&qe.ScripDetail.ScripDet.MapMktSegId==ye){Fe.push(qe);break}}v||Fe.length>0&&(v=!0);for(var Be=0;Be<Fe.length;Be++){var dt=Fe[Be];null!==dt&&("2"==C?c.Type==a.gT.C_S_NEWSTYPE_HOT?(dt.ScripRecoIndicatorColor=a.gT.C_S_RECO_
1CSS_HOT,dt.News(a.gT.C_S_NEWS_HOTNEWS_UNREAD)):(dt.ScripRecoIndicatorColor=a.gT.C_S_RECO_CSS_UNREAD,dt.News(a.gT.C_S_NEWS_NORMALNEWS_UNREAD)):c.Type==a.gT.C_S_NEWSTYPE_HOT?(dt.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_HOT,dt.News=a.gT.C_S_NEWS_HOTNEWS_UNREAD):(dt.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_UNREAD,dt.News=a.gT.C_S_NEWS_NORMALNEWS_UNREAD))}Fe=null}}}catch(Jt){this.logService.WriteLog("Exception: "+Jt.message,"fn_NewsScripWise()","marketwatch.component.ts","")}}fn_NewsUnderlyingWise(c){try{for(var C=!1,v=0;v<c.ISINs.length;v++){var A=c.ISINs[v];if(""!==A||"undefined"!==A){for(var z=A.split("$"),Se=z[0],ye=z[1],Oe=z[2],Fe=[],Qe=0;Qe<this.MWScripList.length;Qe++){var qe=this.MWScripList[Qe];(qe.ScripDetail.Token==Oe&&qe.ScripDetail.ScripDet.MktSegId==Se||qe.ScripDetail.AssetToken==Oe&&qe.ScripDetail.ScripDet.MktSegId==ye)&&Fe.push(qe)}C||Fe.length>0&&(C=!0);for(var Be=0;Be<Fe.length;Be++){var dt=Fe[Be];null!==dt&&(c.Type==a.gT.C_S_NEWSTYPE_HOT?(dt.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_HOT,dt.News=a.gT.C_S_NEWS_HOTNEWS_UNREAD):(dt.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_UNREAD,dt.News=a.gT.C_S_NEWS_NORMALNEWS_UNREAD))}Fe=null}}}catch(Jt){this.logService.WriteLog("Exception: "+Jt.message,"fn_NewsUnderlyingWise()","marketwatch.component.ts","")}}GetScriptForMyHolding(){try{var C="MYHOLD";this.LoadProfileScrips("300",C,"3");for(var A=0,z=this.objProfile.ProfileList[0].Data.length;A<z;A++)"300"==this.objProfile.ProfileList[0].Data[A].ProfileId&&C==this.objProfile.ProfileList[0].Data[A].ProfileName&&(this.objProfile.SelectedProfile=this.objProfile.ProfileList[0].Data[A]);this.dialogService.alert("Market Watch Profile Created")}catch(Se){this.logService.WriteLog("Exception: "+Se.message,"GetScriptForMyHolding()","marketwatch.component.ts","")}}GetSVMWColumn(){try{var c="COMBINED$";if(a.xB.User.ExchangeAllowedVal.length>0)for(var C=a.xB.User.ExchangeAllowedVal.split("$"),v=0;v<C.length;v++)c=c+l.X.GetExchangeName(parseInt(C[v]))+"$";this.httpService.postData(a.xB.tradingAPIUrl,"GetMWStockViewUpdate",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ExchAllowed:c}).subscribe(z=>{!0===z.ResponseStatus&&this.GetSVScripDetails(z.ResponseObject)})}catch(z){this.logService.WriteLog("Exception: "+z.message,"GetSVMWColumn()","marketwatch.component.ts","")}}GetSVScripDetails(c){for(var C=c.Table1,v=0;v<C.length;v++){var A=this.LookUp(C[v]);if(null!=this.MWScripList&&this.MWScripList.length>0)try{if(null!=C[v].strISIN)for(var z=0;z<this.MWScripList.length;z++)if(this.MWScripList[z].ScripDetail.ISIN===A.nISINCode)this.MWScripList[z].SVBODQT=A.nbodqty,this.MWScripList[z].SVBUYVAl=A.nbuyval;else{for(var ye="false",Oe=0;Oe<C.length;Oe++){var Fe=this.LookUp(C[Oe]);if(Fe=this.LookUp(C[Oe]),this.MWScripList[z].ScripDetail.ISIN===Fe.nISINCode){ye="true";break}}"false"==ye&&(this.MWScripList[z].SVBODQT="NA",this.MWScripList[z].SVBUYVAl="NA")}}catch(Qe){this.logService.WriteLog("Exception: "+Qe.message,"GetSVScripDetails","tr_MarketWatch.js","")}}}LookUp(c){var C=new a.aM;try{null!=c&&(C.add("nISINCode",c.strISIN),C.add("nbodqty",c.strBODQTY),C.add("nbuyval",c.strBUYVAL))}catch(Se){}return C}LoadProfileScrips(c,C,v){try{this._strLoadProfileId=c,this._strLoadProfileName=C,(this.objProfile.SelectedProfileId!=this._strLoadProfileId||"300"==this._strLoadProfileId)&&(this.isTemplateModified||this.isNewProfile?this.openDialog("ProfileChangeConfirm"):this.ContinueLoadingScrips(c,C,v))}catch(A){this.logService.WriteLog("Exception: "+A.message,"LoadProfileScrips()","marketwatch.component.ts","")}}fn_GetColumnTemplateProfileDetails(c){var C=0;a.xB.applicationType==a.xB.DESKTOP?C=3:a.xB.applicationType==a.xB.TABLET&&(C=10),this.tradingSharedService.FetchColumnTemplateDetails({UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:C,TmpltNm:"UDCOLTMPT",ProfNm:this.objProfile.SelectedProfileName,ResetUser:"Y"},c).then(A=>{this.fn_GetMWColumnList(A,c)})}onCheckboxChange(c){}HandleAddAlert(c,C){try{a.xB.dConfigMaster.CONST_ALERT_ALLOWED===a.gT.C_S_ON&&(a.vV.IsAllowedClientFacility(a.gT.C_S_FACILITY_ALERT)?("AlertClass-green"==c.AlertColor&&(c.AlertColor="AlertClass-orange"),this.dialogService.openComponent("Alert",p.Y,c).afterClosed().subscribe(A=>{this.onAlertClose(A)})):this.dialogService.alert(a.xB.dMsgMaster.NNSL272)),C.stopPropagation()}catch(v){this.logService.WriteLog("Exception: "+v.message,"HandleAddAlert","marketwatch.component.ts","")}}onAlertClose(c){}ProcessOEandB5(c){try{this.SelectedMWData.SelectedMWDataClass="ht03 odd mdetail",this.SelectedMWData=c.Row,this.SelectedMWData.SelectedMWDataClass="ht03 odd mdetail mwgrid_selected",c.isExpand&&this.expandRow(c.Row,c.rowRef)}catch(C){this.logService.WriteLog("Exception: "+C.message,"ProcessOEandB5()","marketwatch.component.ts","")}}populateOE(c,C=null){if(C=C||this.SelectedMWData,c==a.gT.C_S_ORDER_ML_TEXT)(v=new f.m(C.ScripDetail)).OrderSide=c,v.Price=C.SellPrice,v.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),v.LTP=C.LTP.toString(),this.menuManager.invokeMenu(a.gT.C_S_MENU_ML_OE,{sourceId:a.gT.C_S_MENU_TRADING_MKTWATCH,data:v});else if(1==C.ScripDetail.Spread){var v;(v=new f.m(C.ScripDetail)).OrderSide=c,v.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),this.menuManager.invokeMenu(a.gT.C_S_MENU_ML_OE,{sourceId:a.gT.C_S_MENU_TRADING_MKTWATCH,data:v})}else{var A=new T.Q(C.ScripDetail);A.OrderSide=c,A.SellPrice=C.SellPrice,A.BuyPrice=C.BuyPrice,A.Price=C.SellPrice,A.PageSource=a.gT.C_V_MARKETWATCH_PAGENO.toString(),A.BuyQty=C.BuyQty.toString(),A.SellQty=C.SellQty.toString(),A.LTP=C.LTP.toString(),A.ClosePrice=C.ClosePrice,""==C.ScripDetail.Symbol?this.dialogService.alert("No Scrips available"):this.menuManager.invokeMenu(a.gT.C_S_MENU_OE_SPOT,{sourceId:a.gT.C_S_MENU_TRADING_MKTWATCH,data:A})}}ContinueLoadingScrips(c,C,v){this.showProgressBar=!0,(!this.isTemplateModified||this.isNewProfile)&&(this.objProfile.SelectedProfileId!=c||"300"==c)&&((null!=this.viewPortScripKeys||null!=this.viewPortScripKeys)&&this.viewPortScripKeys.length>
10&&this.tradingSharedService.sendTouchLineRequest(this.viewPortScripKeys,2),this.objProfile.SelectedProfileId=c,this.objProfile.SelectedProfileName=C,this.objProfile.ProfileNameDisplay=C,a.xB.User.MarketWatchPerfDetails[0].nDefaultProfileId=c,this.tradingSharedService.getProfileScrips(c,C,v.toString(),this.objProfile.SelectedProfile.IsIndex,this.objProfile.SelectedProfile.MktSegId,this.top50).subscribe(A=>{this.fn_GetProfileScripsCompleted(A)}))}fetchTop50(){this.tradingSharedService.getProfileScrips(this.objProfile.SelectedProfileId,this.objProfile.SelectedProfileName,"",this.objProfile.SelectedProfile.IsIndex,this.objProfile.SelectedProfile.MktSegId,this.top50).subscribe(c=>{this.fn_GetProfileScripsCompleted(c)})}fn_GetProfileScripsCompleted(c){try{if(c.ResponseStatus&&null!=c.ResponseObject){var v;switch(this.MWScripList=[],this.ScripKey=[],this.viewPortScripKeys=[],this.SelectedView){case a.gT.C_S_TAG_GRIDVIEW:this.countCol&&(this.fn_CreateMarketWatchColumnView(),this.countCol=!1);break;case a.gT.C_S_TAG_BLOCKVIEW:this.countCol&&(this.countCol=!1);break;case a.gT.C_S_TAG_PP:this.countCol&&(this.fn_SetMWPivotWatch(),this.countCol=!1)}let ye=this.tradingSharedService.parseProfileScrips(c.ResponseObject.Table1,this.SelectedView==a.gT.C_S_TAG_PP);v=ye.tempMWList,this.ScripKey=ye.scripKey,clearInterval(this.moreColumsInterval),v.length>0&&(this.MWScripList=v,this.isFirstResponse=!0,this.firstkafirst=!0,this.firstResponseClearTimeout=setTimeout(()=>this.OnAllScripBroadcastLoad(),3e3),setTimeout(()=>{this.loadOtherMWData()},100)),this.mwTable&&this.mwTable.resetFilter(),this.applyFilter(),this.showProgressBar=!1}else this.rows=[],this.showProgressBar=!1;this.cdRef.markForCheck()}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"fn_GetProfileScripsCompleted()","marketwatch.component.ts","")}}loadOtherMWData(){a.xB.dConfigMaster.CONST_ALERT_ALLOWED===a.gT.C_S_ON&&a.vV.IsAllowedClientFacility(a.gT.C_S_FACILITY_ALERT)&&this.Alerts.getScripAlertList().subscribe(c=>{for(var C=0;C<this.MWScripList.Count();C++){var v=this.MWScripList[C];if(null!=this.Alerts.ScripAlertList){for(var A=null,z=0;z<this.Alerts.ScripAlertList.length;z++)if(this.Alerts.ScripAlertList[z].ScripData.MktSegId===v.ScripDetail.ScripDet.MktSegId&&this.Alerts.ScripAlertList[z].ScripData.Token===v.ScripDetail.ScripDet.Token){A=this.Alerts.ScripAlertList[z];break}null!==A&&(v.AlertColor=A.AlertColor)}}}),this.SelectedView!=a.gT.C_S_TAG_PP&&this.isSVColumnsExists&&this.GetSVMWColumn()}resetFilter(){this.mwTable&&this.mwTable.resetFilter()}applyFilter(c=!1){var C=this.filterMarketWatch;let v=[];switch(v=this.MWScripList,C.key){case"All":v=this.MWScripList;break;case"Act_Vol":v=v.filter(z=>parseFloat(z.Volume)>0),v=a.vV.sort(v,"Volume","desc",!0);break;case"Act_Val":v=v.filter(z=>parseFloat(z.Value)>0),v=a.vV.sort(v,"Value","desc",!0);break;case"OI_G":v=v.filter(z=>parseFloat(z.PercOpenInt)>0),v=a.vV.sort(v,"PercOpenInt","desc",!0);break;case"OI_L":v=v.filter(z=>parseFloat(z.PercOpenInt)<0),v=a.vV.sort(v,"PercOpenInt","asc",!0);break;case"Premium":v=v.filter(z=>parseFloat(z.Premium)>0),v=a.vV.sort(v,"Premium","desc",!0);break;case"Discount":v=v.filter(z=>parseFloat(z.Discount)<0),v=a.vV.sort(v,"Discount","desc",!0);break;case"Price_G":v=v.filter(z=>parseFloat(z.PercNetChange)>0),v=a.vV.sort(v,"PercNetChange","desc",!0);break;case"Price_L":v=v.filter(z=>parseFloat(z.PercNetChange)<0),v=a.vV.sort(v,"PercNetChange","asc",!0)}if(this.rows=v,!c){for(var A=this.MWScripList.length;A--;)this.MWScripList[A].SelectedMWDataClass="ht03 odd mdetail";this.rows.length>0?(this.rows[0].SelectedMWDataClass="ht03 odd mdetail mwgrid_selected",this.SelectedMWData=this.rows[0]):this.SelectedMWData=new G.N}this.mwTable&&this.mwTable.detectChange(),clearTimeout(this.filterInterval),"All"!=C.key&&(this.filterInterval=setTimeout(()=>{this.applyFilter(!0)},a.xB.dConfigMaster.FINALYTICS_MW_FILTERINTERVAL))}fn_FindValue(c){try{if(null!=c&&null!=c)return c.split(a.gT.C_S_NAMEVALUE_DELIMITER)[1]}catch(v){this.logService.WriteLog("Exception: "+v.message,"fn_FindValue()","marketwatch.component.ts","")}}fn_CreateMarketWatchColumnView(){this.isPivotPoint=!1,this.isFirstCallForPivotWatch=!0,this.isFirstCallForColumnTemplate&&(this.fn_GetColumnTemplateProfileDetails(!1),this.isFirstCallForColumnTemplate=!1)}fn_GetMWColumnList(c,C){try{if(this.dcMWColList=new a.aM,c.ResponseStatus){if(c.ResponseStatus){for(var v=0,A=c.ResponseObject.CompleteColumnList.length;v<A;v++){var z=c.ResponseObject.CompleteColumnList[v].sColumnId;z==a.gT.C_S_TAG_REFRESH.toString()||"Remove"==z||"Action"==z||"TrendIndicator"==z||this.dcMWColList.add(z,c.ResponseObject.CompleteColumnList[v].sColumnName)}this.MWProfile.ColumnLayout=c.ResponseObject.AssignedColumns.replaceAllChar("|","$"),a.xB.dConfigMaster.EBUZZ_MANUALRECOMMENDATION==a.gT.C_S_OFF&&this.dcMWColList.remove("199"),a.xB.applicationType==a.xB.DESKTOP?this.fn_SetMWColumnLayout(this.MWProfile.ColumnLayout):a.xB.applicationType==a.xB.TABLET&&this.fn_SetMWColumnLayout(this.MWProfile.TabletColumnLayout),this.mwTable&&this.mwTable.reApplyFH()}C&&(this.showProgressBar=!1,this.isMoreColumnsExists&&this.getMoreColumnHistoricData(this.viewPortScripKeys),this.isCAColumnExists&&this.getCAColumnDetails(this.viewPortScripKeys),this.isSVColumnsExists&&this.GetSVMWColumn(),this.cdRef.markForCheck())}}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"fn_GetMWColumnList","marketwatch.component.ts","")}}fn_GetProfileListCompleted(c){try{if(this.objProfile.ProfileList=[],this.objProfile.ProfileList=a.xB.User.ProfileList,this.MWProfile=this.objProfile,"-1"===this.objProfile.SelectedProfileId){var C=a.xB.User.ProfileList[0].Data.length-1;this.objProfile.SelectedProfile=a.xB.User.ProfileList[0].Data[C],this.objProfile.SelectedProfileId=a.xB.User.ProfileList[0].Data[C].ProfileId,this.objProfile.SelectedProfileName=a.xB.User.ProfileList[0].Data[C].ProfileName,this.LoadProfileScrips(this.objProfile.SelectedProfileId,this.objProfile.SelectedProfileName,this.ColumnProfileId)}
1else if(void 0!==a.xB.User.MarketWatchPerfDetails&&a.xB.User.MarketWatchPerfDetails.length>0){for(var A,v=a.xB.User.MarketWatchPerfDetails[0].nDefaultProfileId,z=[],Se=!1,ye=null,Oe=0,Fe=a.xB.User.ProfileList.length;Oe<Fe;Oe++)for(var Qe=0,qe=a.xB.User.ProfileList[Oe].Data.length;Qe<qe;Qe++)z.push(a.xB.User.ProfileList[Oe].Data[Qe].ProfileId),a.xB.User.ProfileList[Oe].Data[Qe].ProfileId==v&&(this.objProfile.SelectedProfile=this.objProfile.ProfileList[Oe].Data[Qe],Se=!0),a.xB.User.ProfileList[Oe].Data[Qe].ProfileId==a.gT.C_S_SYSTEM_PROFILEID&&(ye=this.objProfile.ProfileList[Oe].Data[Qe]),"300"==a.xB.User.ProfileList[Oe].Data[Qe].ProfileId&&(ye=this.objProfile.ProfileList[Oe].Data[Qe]);Se||(v=a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_AWSAPPSYNC?"300":a.gT.C_S_SYSTEM_PROFILEID,this.objProfile.SelectedProfile=ye),this.LoadProfileScrips(v,A=this.objProfile.SelectedProfile.ProfileName,this.ColumnProfileId),this.objProfile.SelectedProfileId=v,this.objProfile.SelectedProfileName=A,this.isColumnViewVisible=a.xB.User.MarketWatchPerfDetails[0].sDefaultMWView==a.gT.C_S_TAG_GRIDVIEW&&a.xB.applicationType==a.xB.DESKTOP}else this.LoadProfileScrips(a.gT.C_S_SYSTEM_PROFILEID,a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE,this.ColumnProfileId),this.objProfile.SelectedProfileId=a.gT.C_S_SYSTEM_PROFILEID,this.objProfile.SelectedProfileName=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE;c&&this.pubsubService.publish("PROFLISTCHANGE","")}catch(Be){this.logService.WriteLog("Exception: "+Be.message,"fn_GetProfileListCompleted","marketwatch.component.ts","")}}LoadProfileList(){try{this.objProfile.ForceProfileLoad||null==a.xB.User.ProfileList||0==a.xB.User.ProfileList.length?this.tradingService.getProfileList(this.objProfile.ForceProfileLoad).subscribe(c=>{this.fn_GetProfileListCompleted(this.objProfile.ForceProfileLoad),this.objProfile.ForceProfileLoad=!1}):this.fn_GetProfileListCompleted(this.objProfile.ForceProfileLoad)}catch(c){this.logService.WriteLog("Exception: "+c.message,"LoadProfileList","marketwatch.component.ts","")}}EditProfile(c){c.ProfileEdit=!0;for(var C=this.objProfile.ProfileList[0].Data,v=0,A=C.length;v<A;v++)0!=C[v].ProfileName.localeCompare(c.ProfileName)?(C[v].ProfileEdit=!1,C[v].ProfileNameDisplay=C[v].ProfileName):C[v].ProfileEdit=!0}cancelProfileEdit(c){c.ProfileEdit=!1,c.ProfileNameDisplay=c.ProfileName}SaveProfile(c=""){try{if(this.ScripKey=[],this.IsScriptDragged){if(this.rows.length>0)for(var C=0;C<this.rows.length;C++)this.ScripKey.push(this.rows[C].ScripDetail.ScripDet)}else if(this.MWScripList.length>0)for(C=0;C<this.MWScripList.length;C++)this.ScripKey.push(this.MWScripList[C].ScripDetail.ScripDet);if(this.ScripKey.length>0)if(this.objProfile.SelectedProfileName!=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE&&this.objProfile.SelectedProfileId!=a.gT.C_S_SYSTEM_PROFILEID){var v=this.objProfile.SelectedProfileId,A=this.objProfile.SelectedProfileName.toUpperCase(),z=this.TemplateId,Se=this.MWProfile.ColumnLayout.replaceAllChar("$","#","");this.tradingSharedService.saveProfile(v,A,this.ScripKey,z,Se,c,this.DeleteAWSAppsyncWatchListScrip).subscribe(ye=>{this.fn_SaveMarketWatchProfileCompleted(ye)})}else this.dialogService.alert("Cannot save default profile");else this.dialogService.alert("There are no scrips to save the current profile")}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"SaveProfile","marketwatch.component.ts","")}}SaveAsProfile(c=""){this.ScripKey.length>0?this.objProfile.SelectedProfileName==a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE||this.objProfile.SelectedProfileId==a.gT.C_S_SYSTEM_PROFILEID||"MYHOLD"==this.objProfile.SelectedProfileName||this.objProfile.SelectedProfile.IsIndex?(this.NewProfileName="",this.dialogService.openComponent("Save Profile",m.f,{},"500px","300px").afterClosed().subscribe(v=>{v.status&&(this.NewProfileName=v.profName,this.AddAndSaveNewProfile(!0,c))})):(this.NewProfileName=this.objProfile.SelectedProfileName,this.AddAndSaveNewProfile(!1,c)):this.dialogService.alert("There are no scrips to save the current profile")}AddAndSaveNewProfile(c=!1,C=""){this.NewProfileName.trim().length>0?(this.AddProfile(c)||this.NewProfileName==this.objProfile.SelectedProfileName)&&this.SaveProfile(C):this.dialogService.alert("Please enter a profile name")}fn_SaveMarketWatchProfileCompleted(c){try{c.ResponseStatus&&null!=c.ResponseObject&&("0"==c.ResponseObject.status?(this.objProfile.ForceProfileLoad=!0,this.isTemplateModified=!1,this.objProfile.SelectedProfileId==a.gT.C_S_INVALIDPROFILEID?this.isNewProfile=!1:this.pubsubService.publish("PROFCHANGE",{ProfileId:this.objProfile.SelectedProfileId,ProfileName:this.objProfile.SelectedProfileName}),("0"===this.objProfile.SelectedProfileId||"-1"===this.objProfile.SelectedProfileId||"100"===this.objProfile.SelectedProfileId)&&this.LoadProfileList()):this.dialogService.alert("Market Watch Profile Not Saved"))}catch(v){this.logService.WriteLog("Exception: "+v.message,"fn_SaveMarketWatchProfileCompleted","marketwatch.component.ts","")}}AddProfile(c=!1){try{if(a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_AWSAPPSYNC){this.appSyncON=!0;var C=new RegExp("^([0-9A-Za-z]){1,20}$")}else this.appSyncON=!1,C=new RegExp("^([0-9A-Za-z]){1,8}$");var v=new RegExp("[`~!@#$%^&*()_|+-=?;:',.<>]"),A=new RegExp("[\\S]+");if(!(this.NewProfileName.trim().length>0))return this.dialogService.alert("Please enter a profile name"),!1;if(!C.test(this.NewProfileName))return A.test(this.NewProfileName)?(this.dialogService.alert("White space not allowed in Profile Name"),!1):v.test(this.NewProfileName)?(this.dialogService.alert("Special Characters not allowed in Profile Name"),!1):(this.dialogService.alert("Please enter a valid profile name"),!1);if(this.objProfile.SelectedProfileName==this.NewProfileName)return!1;if(this.objProfile.ProfileList[0].Data.length>=parseInt(a.xB.dConfigMaster.MAX_PROFILE_COUNT,10))return this.dialogService.alert(a.xB.dMsgMaster.NNSL120+a.xB.dConfigMaster.MAX_PROFILE_COUNT),!1;var z=this.fn_CheckForExistingNewProfile(this.NewProfileName.trim());if(null!=z)return this.dialogService.alert(z),!1;this.objProfile.SelectedProfileId=a.gT.C_S_INVALIDPROFILEID,this.objProfile.SelectedProfileName=this.NewProfileName.toUpperCase(),this.isTemplateModified=!0,this.isNewProfile=!0;var Se={};Se.ProfileId=this.objProfile.SelectedProfileId,Se.ProfileName=this.objProfile.SelectedProfileName.toUpperCase(),Se.ProfileClass="profileSelected",Se.ProfileNameDisplay=this.objProfile.SelectedProfileName.toUpperCase(),Se.IsProfileNameTxtVisible=!1,Se.ShowProfileName=!0,Se.ProfileNameFocus=!0,Se.IsEditRenameButtonVisible=!0,this.objProfile.SelectedProfile=Se,Se.IsEditRenameButtonVisible=!!this.isEditOptionSelected,this.objProfile.ProfileNameDisplay=this.objProfile.SelectedProfileName.toUpperCase(),this.objProfile.ProfileList[0].Data.push(Se),this.NewProfileName="",(null!=this.viewPortScripKeys||null!=this.viewPortScripKeys)&&this.viewPortScripKeys.length>
10&&this.tradingSharedService.sendTouchLineRequest(this.viewPortScripKeys,2),c||(this.MWScripList=[],this.rows=[],this.ScripKey=[],this.viewPortScripKeys=[],this.applyFilter()),"shown"==this.profileTemplateState&&(this.profileTemplateState="hidden")}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"AddProfile","marketwatch.component.ts","")}return!0}fn_CheckForExistingNewProfile(c){var C=null;try{for(var v=this.objProfile.ProfileList[0].Data,A=v.length;A--;){if(v[A].ProfileId==a.gT.C_S_INVALIDPROFILEID){C=a.xB.dMsgMaster.NNSL122;break}if(v[A].ProfileName==c.toUpperCase()){C="Profile already exist.";break}C=null}return C}catch(z){this.logService.WriteLog("Exception: "+z.message,"fn_CheckForExistingNewProfile","marketwatch.component.ts","")}}RenameProfile(c){try{if(c.ProfileNameDisplay.trim().length>0)if(c.ProfileName!=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE&&c.ProfileId!=a.gT.C_S_SYSTEM_PROFILEID){if(a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_AWSAPPSYNC){this.appSyncON=!0;var C=new RegExp("^([0-9A-Za-z]){1,20}$")}else this.appSyncON=!1,C=new RegExp("^([0-9A-Za-z]){1,8}$");if(C.test(c.ProfileNameDisplay)){var v=this.fn_CheckForExistingNewProfile(c.ProfileNameDisplay.trim());if(null!=v)return void this.dialogService.alert(v);if(c.ProfileNameDisplay.trim()!=c.ProfileName.trim()){var A=c.ProfileId,z=c.ProfileName.toUpperCase(),Se=c.ProfileNameDisplay.toUpperCase();this.ProfileToBeRenamed=c,a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_DATABASE?this.httpService.postData(a.xB.tradingAPIUrl,"RenameMarketWatchProfile",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ProfId:A,ProfNm:z,NewProfNm:Se}).subscribe(Oe=>{this.fn_RenameMarketWatchProfileCompleted(Oe)}):a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_AWSAPPSYNC&&this.awsappsync.updateWatchListProfile({nWatchListId:A,sWatchListName:Se,bIsPrivate:!0,bIsDefault:!1,sCreatedBy:a.xB.User.APPSyncID,nTenantId:a.xB.dConfigMaster.TENANTID}).then(Fe=>{this.fn_RenameMarketWatchProfileCompleted(Fe)})}}else this.dialogService.alert("Please enter a valid profile name")}else this.objProfile.ProfileNameDisplay=this.objProfile.SelectedProfileName,this.dialogService.alert("Cannot rename the Default profile");else this.dialogService.alert("Please enter the profile name")}catch(Oe){this.logService.WriteLog("Exception: "+Oe.message,"RenameProfile","marketwatch.component.ts","")}}fn_RenameMarketWatchProfileCompleted(c){try{if(c.ResponseStatus&&null!=c.ResponseObject)if("0"==c.ResponseObject.status.trim()){for(var v=this.objProfile.ProfileList[0].Data,A=this.objProfile.ProfileList[0].Data.length;A--;)if(v[A].ProfileId==this.ProfileToBeRenamed.ProfileId){v[A].ProfileId=this.ProfileToBeRenamed.ProfileId,v[A].ProfileName=this.ProfileToBeRenamed.ProfileNameDisplay.toUpperCase(),a.xB.User.ProfileList=this.objProfile.ProfileList,v=[],v=a.xB.User.ProfileList[0].Data,this.objProfile.ProfileNameDisplay=this.ProfileToBeRenamed.ProfileNameDisplay.toUpperCase(),v[A].IsProfileNameTxtVisible=!1,v[A].ShowProfileName=!0,v[A].ProfileNameFocus=!1,v[A].IsEditRenameButtonVisible=!0,v[A].ProfileNameDisplay=v[A].ProfileName,this.objProfile.SelectedProfileName=v[A].ProfileName,this.objProfile.SelectedProfileId=v[A].ProfileId,v[A].ProfileEdit=!1,this.dialogService.alert("Profile renamed sucessfully");break}}else this.dialogService.alert("Cannot rename the profile")}catch(z){this.logService.WriteLog("Exception: "+z.message,"fn_RenameMarketWatchProfileCompleted","marketwatch.component.ts","")}}RemoveProfile(c){try{this.objProfileToBeRemoved=c,c.ProfileName!=a.xB.dConfigMaster.DEFAULT_PROFILE_VALUE&&c.ProfileId!=a.gT.C_S_SYSTEM_PROFILEID?this.openDialog("RemoveProfile",c):this.dialogService.alert("Cannot delete DEFAULT Profile")}catch(C){this.logService.WriteLog("Exception: "+C.message,"RemoveProfile()","marketwatch.component.ts","")}}yesCallbackDeleteProfile(){let c=this.objProfileToBeRemoved;var C=c.ProfileId,v=c.ProfileName;this.ProfileToBeRemoved=c;var A=this.objProfile.ProfileList[0].Data;if(C==a.gT.C_S_INVALIDPROFILEID){var z=A.indexOf(c);if(z>-1&&A.splice(z,1),this.ProfileToBeRemoved.ProfileId==this.objProfile.SelectedProfileId){let ye=A[0].ProfileId,Oe=A[0].ProfileName;this.isNewProfile=!1,this.isTemplateModified=!1,this.LoadProfileScrips(ye,Oe,this.ColumnProfileId)}}else a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_DATABASE?this.httpService.postData(a.xB.tradingAPIUrl,"RemoveMarketWatchProfile",{UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ProfId:C,ProfNm:v}).subscribe(ye=>{this.fn_RemoveMarketWatchProfileCompleted(ye)}):a.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==a.gT.C_S_FINALYTICS_PROFILE_DATA_AWSAPPSYNC&&this.awsappsync.deleteWatchList(C).then(ye=>{this.fn_RemoveMarketWatchProfileCompleted(ye)})}fn_RemoveMarketWatchProfileCompleted(c){try{if(c.ResponseStatus)if("0"==c.ResponseObject.status){for(var v=this.objProfile.ProfileList[0].Data,z=v.length;z--;)if(v[z].ProfileId==this.ProfileToBeRemoved.ProfileId){if(v.splice(z,1),a.xB.User.ProfileList=this.objProfile.ProfileList,this.ProfileToBeRemoved.ProfileId==this.objProfile.SelectedProfileId){var Se=v[0].ProfileId,ye=v[0].ProfileName;this.objProfile.SelectedProfile=v[0],this.LoadProfileScrips(Se,ye,this.ColumnProfileId)}break}this.pubsubService.publish("PROFLISTCHANGE",""),this.dialogService.alert("Profile removed"),this.cdRef.markForCheck()}else this.dialogService.alert("Profile not removed")}catch(Oe){this.logService.WriteLog("Exception: "+Oe.message,"fn_RemoveMarketWatchProfileCompleted()","marketwatch.component.ts","")}}yesCallbackProceedLoadingScrips(c){this.isNewProfile&&(this.objProfile.ProfileList[0].Data.pop(),this.isNewProfile=!1),this.isTemplateModified=!1,this.ContinueLoadingScrips(this._strLoadProfileId,this._strLoadProfileName,c)}noCallbackProceedLoadingScrips(c,C,v,A){}fn_SetMWPivotWatch(){this.isPivotPoint=!0,this.isFirstCallForPivotWatch&&(this.fn_GetColumnTemplatePivotPointDetails(),this.isFirstCallForPivotWatch=!1)}fn_SetMWColumnLayout(c){try{var v=c.split(a.gT.C_S_RECORD_DELIMITER),A=a.gT.C_S_TAG_MKTSEGID+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_INSTRUMENTID+a.gT.C_S_FIELD_DELIMITER;A+=a.gT.C_S_TAG_SERIES+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_SYMBOL+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_STRIKEPRICE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_EXPIRYDATE+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_OPTIONTYPE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_BUYQTY+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_BUYPRICE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_SELLQTY+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_SELLPRICE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_LTP+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_LTQ+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_LTT+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_LUT+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_OPENPRICE+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_HIGHPRICE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_LOWPRICE+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_CLOSEPRICE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_OPENINTEREST+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_PERCENTAGECHANGE+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_VOLUME+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_ATP+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_TOTBUYQTY+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_TOTSELLQTY+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_DPR+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_NETCHANGEINRS+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_MWSCRIPDESC+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_ALERTREMARK+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_NEWS_COL+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_BODQT+a.gT.C_S_FIELD_DELIMITER+a.gT.C_S_TAG_BUYVAL+a.gT.C_S_FIELD_DELIMITER,A+=a.gT.C_S_TAG_CURRENTVAL;for(var z=new a.aM,Se=[],ye=0;ye<v.length;ye++)try{if(this.dcMWColList.containsKey(v[ye])){z.add(v[ye],this.dcMWColList[v[ye]]);let Be={};if(Be.ColumnID=v[ye],Be.ColumnName=this.dcMWColList[v[ye]],Be.Visibility=!0,Be.ColumnClass="",Se.push(Be),"Buy Prc"==Be.ColumnName||"Sell Prc"==Be.ColumnName||"LTP"==Be.ColumnName)if(a.xB.applicationType==a.xB.DESKTOP){var Oe={ColumnName:""};Be.ColumnID=v[ye],Oe.ColumnClass="","Buy Prc"==Be.ColumnName||"Sell Prc"==Be.ColumnName?Oe.Visibility=!1:"LTP"==Be.ColumnName&&(Oe.Visibility=this.LTPSparklineVisible),Se.push(Oe),Oe=null}else a.xB.applicationType==a.xB.TABLET&&"LTP"==Be.ColumnName&&(Oe={ColumnName:""},Be.ColumnID=v[ye],Oe.ColumnClass="",Oe.Visibility=this.LTPSparklineVisible,Se.push(Oe),Oe=null);Be=null}}catch(Be){this.logService.WriteLog("Exception: "+Be.message,"fn_SetMWColumnLayout","marketwatch.component.ts","")}for(var Fe=A.split(a.gT.C_S_FIELD_DELIMITER),Qe=0;Qe<Fe.length;Qe++)try{if(!z.containsKey(Fe[Qe])){let Be={};Be.ColumnID=Fe[Qe],Be.ColumnName=this.dcMWColList[Fe[Qe]],Be.Visibility=!1,Be.ColumnClass="",Se.push(Be),Be=null}}catch(Be){this.logService.WriteLog("Exception: "+Be.message,"fn_SetMWColumnLayout","marketwatch.component.ts","")}this.MWColumnLayout=[],this.MWColumnLayout=Se,this.MWColumnLayout.splice(0,0,{ColumnID:"11004",ColumnName:"",Visibility:!0,ColumnClass:""}),this.fn_CreateColumnTemplate()}catch(qe){this.logService.WriteLog("Exception: "+qe.message,"fn_SetMWColumnLayout","marketwatch.component.ts","")}}fn_CreateColumnTemplate(){try{this.columns=[],this.columns.push({value:a.gT.C_V_TAG_CANCELCOLID,cType:"S",isCheckboxable:!0,enableFilter:!1,isSortable:!1,width:15,cellHeaderTemplate:this.cellTmplRemoveScrip});for(var c=0,C=this.MWColumnLayout.length;c<C;c++)if(this.MWColumnLayout[c].Visibility)switch(this.MWColumnLayout[c].ColumnID){case a.gT.C_S_TAG_ALERTREMARK:this.columns.push({cType:"S",deep:!1,value:"1003",name:this.MWColumnLayout[c].ColumnName,isSortable:!1,enableFilter:!1,width:120,cellTemplate:this.cellTmplAlert,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isCAColumnExists=!0;break;case a.gT.C_S_TAG_MWSCRIPDESC:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.MWSecurityDesc",name:this.MWColumnLayout[c].ColumnName,class:"SymbolTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,cellTemplate:this.cellTemplScrip,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_BUYQTY:this.columns.push({cType:"N",deep:!1,value:"BuyQty",name:this.MWColumnLayout[c].ColumnName,class:"BuyQtyTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_BUYPRICE:this.columns.push({cType:"N",deep:!1,value:"BuyPrice",n
1ame:this.MWColumnLayout[c].ColumnName,class:"BuyPriceTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SELLQTY:this.columns.push({cType:"N",deep:!1,value:"SellQty",name:this.MWColumnLayout[c].ColumnName,class:"SellQtyTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SELLPRICE:this.columns.push({cType:"N",deep:!1,value:"SellPrice",name:this.MWColumnLayout[c].ColumnName,class:"SellPriceTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_LTP:this.columns.push({value:"LTP",cType:"N",name:this.MWColumnLayout[c].ColumnName,class:"LTPTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,cellTemplate:this.cellTmplLTP,headerType:this.LTPSparklineVisible?"taL":"taR",ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_LTQ:this.columns.push({cType:"N",deep:!1,value:"LTQ",name:this.MWColumnLayout[c].ColumnName,class:"LTQTrend",isComputedClass:!0,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_VOLUME:this.columns.push({cType:"N",deep:!1,value:"Volume",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_OPENINTEREST:this.columns.push({cType:"N",deep:!1,value:"OpenInt",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_PERCENTAGECHANGE:this.columns.push({cType:"N",deep:!1,value:"PercNetChange",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"SymbolTrend",cellTemplate:this.cellTmplPercChng,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_ATP:this.columns.push({cType:"N",deep:!1,value:"ATP",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_TOTBUYQTY:this.columns.push({cType:"N",deep:!1,value:"TotalBuyQty",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_TOTSELLQTY:this.columns.push({cType:"N",deep:!1,value:"TotalSellQty",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_DPR:this.columns.push({cType:"S",deep:!1,value:"DPR",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!1,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_NETCHANGEINRS:this.columns.push({cType:"N",deep:!1,value:"NetChangeInRs",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"SymbolTrend",cellTemplate:this.cellTmplNetChng,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_MKTSEGID:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.ExchangeName",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_INSTRUMENTID:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.InstrumentName",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SERIES:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.Series",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SYMBOL:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.Symbol",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_STRIKEPRICE:this.columns.push({cType:"N",deep:!0,value:"ScripDetail.StrikePrice",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_EXPIRYDATE:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.ExpiryDate",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_OPTIONTYPE:this.columns.push({cType:"S",deep:!0,value:"ScripDetail.OptionType",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_LTT:this.columns.push({cType:"S",deep:!1,value:"LTTFormatted",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_LUT:this.columns.push({cType:"S",deep:!1,value:"LUTFormatted",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_OPENPRICE:this.columns.push({cType:"N",deep:!1,value:"OpenPrice",n
1ame:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_HIGHPRICE:this.columns.push({cType:"N",deep:!1,value:"HighPrice",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_LOWPRICE:this.columns.push({cType:"N",deep:!1,value:"LowPrice",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_CLOSEPRICE:this.columns.push({cType:"N",deep:!1,value:"ClosePrice",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_TRADE_EXECUTION_RANGE:this.columns.push({cType:"S",deep:!1,value:"TER",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_BODQT:this.columns.push({cType:"N",deep:!1,value:"SVBODQT",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isSVColumnsExists=!0;break;case a.gT.C_S_TAG_BUYVAL:this.columns.push({cType:"N",deep:!1,value:"SVBUYVAl",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isSVColumnsExists=!0;break;case a.gT.C_S_TAG_CURRENTVAL:this.columns.push({cType:"N",deep:!1,value:"SVCURVAl",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isSVColumnsExists=!0;break;case a.gT.C_V_TAG_LV_VALUE:this.columns.push({cType:"N",deep:!1,value:"Value",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_PERC_OPENINTEREST:this.columns.push({cType:"N",deep:!1,value:"PercOpenInt",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_ONE_WEEK_HIGH:this.columns.push({cType:"N",deep:!1,value:"OneWeekHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_ONE_WEEK_LOW:this.columns.push({cType:"N",deep:!1,value:"OneWeekLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_ONE_MONTH_HIGH:this.columns.push({cType:"N",deep:!1,value:"OneMonthHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_ONE_MONTH_LOW:this.columns.push({cType:"N",deep:!1,value:"OneMonthLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_THREE_MONTHS_HIGH:this.columns.push({cType:"N",deep:!1,value:"ThreeMonthsHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_THREE_MONTHS_LOW:this.columns.push({cType:"N",deep:!1,value:"ThreeMonthsLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_SIX_MONTHS_HIGH:this.columns.push({cType:"N",deep:!1,value:"SixMonthsHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_SIX_MONTHS_LOW:this.columns.push({cType:"N",deep:!1,value:"SixMonthsLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_ONE_WEEK_PER_CHANGE:this.columns.push({cType:"N",deep:!1,value:"OneWeekPerChange",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_ONE_MONTH_PER_CHANGE:this.columns.push({cType:"N",deep:!1,value:"OneMonthPerChange",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_THREE_MONTHS_PER_CHANGE:this.columns.push({cType:"N",deep:!1,value:"ThreeMonthsPerChange",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_SIX_MONTHS_PER_CHANGE:this.columns.push({cType:"N",deep:!1,value:"SixMonthsPerChange",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_PER_BELOW_52_WEEK_HIGH:this.columns.push({cType:"N",deep:!1,value:"PerBelow52WeekHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_PER_ABOVE_52_WEEK_LOW:this.columns.push({cType:"N",deep:!1,value:"PerAbove52WeekLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_YESTERDAY_HIGH:this.columns.push({cType:"N",deep:!1,value:"YesterdayHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_YESTERDAY_LOW:this.columns.push({cType:"N",deep:!1,value:"YesterdayLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_FIVE_DAYS_AVERAGE_VOLUME:this.columns.push({cType:"N",deep:!1,value:"FiveDaysAverageV
1olume",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_THREE_MONTHS_AVERAGE_VOLUME:this.columns.push({cType:"N",deep:!1,value:"ThreeMonthsAverageVolume",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_SIX_MONTHS_AVERAGE_VOLUME:this.columns.push({cType:"N",deep:!1,value:"SixMonthsAverageVolume",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_PREMIUM:this.columns.push({cType:"N",deep:!1,value:"Premium",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_DISCOUNT:this.columns.push({cType:"N",deep:!1,value:"Discount",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID}),this.isMoreColumnsExists=!0;break;case a.gT.C_S_TAG_PREVDAYOPEN:this.columns.push({cType:"N",deep:!0,value:"PPWData.PrevDayOpen",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_PREVDAYHIGH:this.columns.push({cType:"N",deep:!0,value:"PPWData.PrevDayHigh",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_PREVDAYLOW:this.columns.push({cType:"N",deep:!0,value:"PPWData.PrevDayLow",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_PREVDAYCLOSE:this.columns.push({cType:"N",deep:!0,value:"PPWData.PrevDayClose",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_RESISTANCE4:this.columns.push({cType:"N",deep:!0,value:"PPWData.Resistance4",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Resistance4",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_RESISTANCE3:this.columns.push({cType:"N",deep:!0,value:"PPWData.Resistance3",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Resistance3",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_RESISTANCE2:this.columns.push({cType:"N",deep:!0,value:"PPWData.Resistance2",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Resistance2",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_RESISTANCE1:this.columns.push({cType:"N",deep:!0,value:"PPWData.Resistance1",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Resistance1",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_PIVOTPOINT:this.columns.push({cType:"N",deep:!0,value:"PPWData.PivotPoint",name:this.MWColumnLayout[c].ColumnName,class:"PivotPointClass",isSortable:!0,isComputedClass:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SUPPORT1:this.columns.push({cType:"N",deep:!0,value:"PPWData.Support1",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Support1",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SUPPORT2:this.columns.push({cType:"N",deep:!0,value:"PPWData.Support2",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Support2",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SUPPORT3:this.columns.push({cType:"N",deep:!0,value:"PPWData.Support3",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Support3",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_SUPPORT4:this.columns.push({cType:"N",deep:!0,value:"PPWData.Support4",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,class:"Support4",isComputedClass:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_52_WEEK_HIGH:this.columns.push({cType:"N",deep:!1,value:"FiftyTwoWH",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID});break;case a.gT.C_S_TAG_52_WEEK_LOW:this.columns.push({cType:"N",deep:!1,value:"FiftyTwoWL",name:this.MWColumnLayout[c].ColumnName,isSortable:!0,enableFilter:!0,ColumnID:this.MWColumnLayout[c].ColumnID})}}catch(v){this.logService.WriteLog("Exception: "+v.message,"fn_SetMWColumnLayout","marketwatch.component.ts","")}}fn_GetColumnTemplatePivotPointDetails(c=!1){try{this.tradingSharedService.FetchColumnTemplateDetails({UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:7,TmpltNm:"",ProfNm:this.objProfile.SelectedProfileName,ResetUser:"Y"},c).then(A=>{this.fn_GetPivotWatchColumnList(A)})}catch(A){this.logService.WriteLog("Exception: "+A.message,"fn_GetColumnTemplatePivotPointDetails()","marketwatch.component.ts","")}}fn_GetPivotWatchColumnList(c){try{if(this.dcMWColList=new a.aM,c.ResponseStatus){for(var C=0,v=c.ResponseObject.CompleteColumnList.length;C<v;C++)this.dcMWColList.add(c.ResponseObject.CompleteColumnList[C].sColumnId,c.ResponseObject.CompleteColumnList[C].sColumnName);this.MWProfile.ColumnLayout=c.ResponseObject.AssignedColumns,this.fn_SetPivotWatchColumnLayout(this.MWProfile.ColumnLayout),this.fn_CreateColumnTemplate(),this.mwTable&&this.mwTable.reApplyFH(),this.showProgressBar=!1}}catch(z){this.logService.WriteLog("Exception: "+z.message,"fn_GetPivotWatchColumnList()","marketwatch.component.ts","")}}fn_SetPivotWatchColumnLayout(c){try{for(var v=c.split(a.gT.C_S_FIELD_DELIMITER),z=new a.aM,Se=[],Oe=0;Oe<v.length;Oe++)try{if(this.dcMWColList.containsKey(v[Oe])){z.add(v[Oe],this.dcMWColList[v[Oe]]);let Fe={};if(Fe.ColumnName=this.dcMWColList[v[Oe]],Fe.ColumnID=v[Oe],Fe.Visibility=!0,Fe.ColumnClass="",Se.push(Fe),"Buy Prc"==Fe.ColumnName||"Sell Prc"==Fe.ColumnName||"LTP"==Fe.ColumnName){let Qe={};Fe.ColumnID=v[Oe],Qe.ColumnName="",Qe.ColumnClass="","Buy Prc"==Fe.ColumnName||"Sell Prc"==Fe.ColumnName?Qe.Visibility=!1:"LTP"==Fe.ColumnName&&(Qe.Visibility=this.LTPSparklineVisible),Se.push(Qe),Qe=null}Fe=null}this.cdRef.markForCheck()}catch(Fe){}this.MWColumnLayout=[],this.MWColumnLayout=Se}catch(Fe){}}ReceiveMWResponse(c){try{if(null!=c)for(var C=this.MWScripList.length;C--;)if(this.MWScripList[C].ScripDetail.ScripDet.Token==c.Scrip.Token&&this.MWScripList[C].ScripDetail.ScripDet.MktSegId==c.Scrip.MktSegId){this.MWScripList[C].OpenPrice=c.OpenPrice,this.MWScripList[C].HighPrice=c.HighPrice,this.MWScripList[C].LowPrice=c.LowPrice,this.MWScripList[C].ClosePrice=c.ClosePrice,this.MWScripList[C].BuyQty=c.BuyQty,this.MWScripList[C].SellQty=c.SellQty,l.X.IsCommodityExchange(c.Scrip.MapMktSegId)?(this.MWScripList[C].BuyPrice=""==c.BuyQty?"":c.BuyPrice,this.MWScripList[C].SellPrice=""==c.SellQty?"":c.SellPrice):this.MWScripList[C].ScripDetail.IsSpread?(this.MWScripList[C].BuyPrice=""==c.BuyPrice?0:c.BuyPrice,this.MWScripList[C].SellPrice=""==c.SellPrice?0:c.SellPrice):(this.MWScripList[C].BuyPrice=c.BuyPrice,this.MWScripList[C].SellPrice=c.SellPrice),this.MWScripList[C].LTP=c.LTP,this.MWScripList[C].LTQ=c.LTQ,this.MWScripList[C].LTT=c.LTT,this.MWScripList[C].LUT=c.LUT,this.MWScripList[C].OpenInt=0!=c.OpenInt&&null!=c.OpenInt?c.OpenInt:"",this.MWScripList[C].PercNetChange=c.PercNetChange,this.MWScripList[C].Volume=c.Volume,this.MWScripList[C].ATP=c.ATP,this.MWScripList[C].TotalBuyQty=c.TotalBuyQty,this.MWScripList[C].TotalSellQty=c.TotalSellQty,this.MWScripList[C].PercOpenInt=c.PercOpenInt,this.MWScripList[C].FiftyTwoWH=c.LifeTimeHigh,this.MWScripList[C].FiftyTwoWL=c.LifeTimeLow,this.MWScripList[C].calculateData();var v=this.MWScripList[C];if("NA"!=this.MWScripList[C].SVBODQT&&null!=this.MWScripList[C].SVBODQT){var A=0!=this.MWScripList[C].LTP?this.MWScripList[C].LTP:parseFloat(this.MWScripList[C].ClosePrice),Se=(parseFloat(this.MWScripList[C].SVBODQT)*A).toFixed(2),ye=parseFloat(Se);v.SVCURVAl=ye.toString()}else v.SVCURVAl="NA";if(c.DPR&&(this.MWScripList[C].DPR=c.DPR),c.NetChangeInRs&&(this.MWScripList[C].NetChangeInRs=c.NetChangeInRs>=0?c.NetChangeInRs.replace("+",""):c.NetChangeInRs),a.xB.User.LoginMode==String(a.gT.C_S_REFRESH_MODE)&&(this.MWScripList[C].TER=c.TER),this.MWScripList[C].isFirstRsp&&(this.MWScripList[C].isFirstRsp=!1),this.mwTable&&this.mwTable.detectChange(),this.isFirstResponse){C%10==0&&this.mwTable&&this.mwTable.reApplyFH();var Oe=!0;for(let Fe=this.MWScripList.length;Fe--;)if(this.MWScripList[Fe].isFirstRsp){Oe=!1;break}Oe&&this.mwTable&&this.OnAllScripBroadcastLoad()}break}}catch(Fe){this.logService.WriteLog("Exception: "+Fe.message,"ReceiveMWResponse()","marketwatch.component.ts","")}}OnAllScripBroadcastLoad(){try{this.isFirstResponse=!1,clearTimeout(this.firstResponseClearTimeout),this.mwTable&&this.mwTable.reApplyFH()}catch(c){this.logService.WriteLog("Exception: "+c.message,"OnAllScripBroadcastLoad()","marketwatch.component.ts","")}}loadScript(){this.countCol=!0;let c=this.objProfile.SelectedProfile;this.LoadProfileScrips(c.ProfileId,c.ProfileName,"3"),this.filterMarketWatch=this.marketWatchFilterOptions[0]}onProfDDOpen(){this.oldSeProf=this.objProfile.SelectedProfile,this.profileTemplateState=this.profileTemplateState="hidden"}openDialog(c,C){let v;"RemoveProfile"==c&&(v="You are about to delete "+C.ProfileName+" profile",this.dialogService.confirm(v,"Confirm").subscribe(A=>{A&&this.yesCallbackDeleteProfile()}
1)),"ProfileChangeConfirm"==c&&(v="All the new changes in Profile will be discarded.Do you want to continue?",this.dialogService.confirm(v,"Confirm").subscribe(A=>{A?this.yesCallbackProceedLoadingScrips(this.ColumnProfileId):(this.showProgressBar=!1,this.oldSeProf&&(this.objProfile.SelectedProfile=this.oldSeProf,this.oldSeProf=null))}))}showSecurityInfo_ContractInfo(c){var C=c.ScripDetail.ScripDet.MktSegId;this.showSecurityInfo=C!=a.gT.C_V_NSE_CASH.toString()&&C!=a.gT.C_V_BSE_CASH.toString()&&C!=a.gT.C_V_MSX_CASH.toString()&&C!=a.gT.C_V_DSE_CASH.toString()&&C!=a.gT.C_V_OFS_IPO_BONDS.toString()}expandRow(c,C){this.showSecurityInfo_ContractInfo(c),this.MWScripList.forEach(v=>{v!==c&&(v.rowExpanded=!1)}),c.rowExpanded?c.rowExpanded=!1:(c.rowExpanded=!0,c.SelectedMWDataClass="ht03 odd mdetail accor-mark-open"),c.rowExpanded&&C&&setTimeout(()=>this.mwTable.setScrollOfExpandRow(C),0),this.activeTabIndex=0}changeView(c){if(this.MWScripList.forEach(C=>{C.rowExpanded=!1,C.rowExpandTransitionState="hidden"}),this.isFirstResponse=!0,this.showProgressBar=!0,!this.countCol)switch(this.SelectedView=c,c){case a.gT.C_S_TAG_GRIDVIEW:this.tagName="TBODY",this.reportGridLayoutMode="Grid",this.ColumnProfileId="3",this.fn_CreateMarketWatchColumnView(),this.countCol=!1,this.showProgressBar=!1,this.mwTable&&this.mwTable.reApplyFH(),this.gridViewBtn=!0,this.showFilterInBV=!0;break;case a.gT.C_S_TAG_BLOCKVIEW:this.tagName="DIV",this.reportGridLayoutMode="Block",this.ColumnProfileId="3",this.countCol=!1,this.showProgressBar=!1,this.isColumnViewVisible=!1,this.gridViewBtn=!1,this.showFilterInBV=!1,this.getMoreColumnHistoricData(this.viewPortScripKeys),this.getCAColumnDetails(this.viewPortScripKeys),this.mwTable&&this.mwTable.reApplyFH();break;case a.gT.C_S_TAG_PP:this.reportGridLayoutMode="Grid",this.ColumnProfileId="7",this.fn_SetMWPivotWatch(),this.countCol=!1,this.isColumnViewVisible=!0}}onFilter(){this.showFilter=!this.showFilter}openColumnView(){let C;this.SelectedView==a.gT.C_S_TAG_GRIDVIEW&&(C=a.gT.C_V_COLUMNTEMPLATE_MARKETWATCH),this.SelectedView==a.gT.C_S_TAG_PP&&(C=a.gT.C_V_COLUMNTEMPLATE_MW_PIVOT_WATCH),this.dialogService.openComponent("Edit Columns",h.V,{menuId:a.gT.C_S_MENU_TRADING_MKTWATCH,selectedProfile:this.objProfile.SelectedProfileName,reptId:C}).afterClosed().subscribe(z=>{this.onColumnViewClose(z)})}onColumnViewClose(c){c&&(this.SelectedView==a.gT.C_S_TAG_GRIDVIEW&&this.fn_GetColumnTemplateProfileDetails(!0),this.SelectedView==a.gT.C_S_TAG_PP&&this.fn_GetColumnTemplatePivotPointDetails(!0))}GlobalNewsIndicator(c,C){try{var v=[],A=a.xB.ExchManager.ExchangeAllowedWithNames;for(var z in A)v.push(z);var Se={};"1"!=c&&(Se={UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",NewsCat:a.xB.User.NewsCategories,MktSegId:c.ScripDetail.ScripDet.MapMktSegId,AssetTkn:c.ScripDetail.UnderlyingMktSegId,ISIN:c.ScripDetail.ISIN,ScripTkn:c.ScripDetail.ScripDet.Token},c.ScripNewsIndicatorColor=a.gT.C_S_NEWS_CSS_READ,this.dialogService.openComponent("News",o.Q,{jData:Se},"800px","650px").afterClosed().subscribe(Oe=>{this.onColumnViewClose(Oe)})),C&&C.stopPropagation()}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"GlobalNewsIndicator","marketwatch.component.ts","")}}ShowReco(c,C){try{c.ScripRecoIndicatorColor=a.gT.C_S_RECO_CSS_READ,this.dialogService.openComponent("Research Calls",u.c,{objmwdata:c},"850px","650px").afterClosed().subscribe(A=>{this.onColumnViewClose(A)}),C.stopPropagation()}catch(v){this.logService.WriteLog("Exception: "+v.message,"ShowReco","marketwatch.component.ts","")}}onKeyDown(c){if(this.tagName="Grid"==this.SelectedView?"TBODY":"DIV",this.eleRef.nativeElement.contains(c.target)){var C=c.which?c.which:c.keyCode;if(46===C&&"marketFilter"!=document.activeElement.getAttribute("name")&&this.RemoveScrip(),112===C||107===C||113===C||109===C)112==C||107==C?this.populateOE("BUY"):(113==C||109==C)&&this.populateOE("SELL"),c.preventDefault(),c.stopImmediatePropagation();else if(c.altKey&&67==C){if(this.SelectedMWData&&this.SelectedMWData.ScripDetail)this.dialogService.openComponent("Advance Chart",e.m,this.SelectedMWData.ScripDetail,"1400px","800px");else{const v={MktSegId:1,Token:26e3};this.tradingSharedService.getScripDetails(v.MktSegId,v.Token,!1,"","").subscribe(A=>{this.dialogService.openComponent("Advance Chart",e.m,A,"1400px","800px")})}c.preventDefault(),c.stopImmediatePropagation()}}}dragSuccess(c){this.rows=[...this.rows],c&&(this.IsScriptDragged=!0,this.isTemplateModified=!0,this.SaveAsProfile("R"))}colDragSuccess(c){c&&this.SaveDetails()}SaveDetails(){try{var c="",v="";this.SelectedView==a.gT.C_S_TAG_GRIDVIEW?this.ColumnProfileId="3":this.SelectedView==a.gT.C_S_TAG_PP&&(this.ColumnProfileId="7"),"3"==this.ColumnProfileId&&(v=a.gT.C_S_MW_SINGLE_COLTEMPLATE_NAME);for(var z=0;z<this.columns.length;z++)null!=this.columns[z].ColumnID&&null!=this.columns[z].ColumnID&&""!=this.columns[z].ColumnID&&(c+=this.columns[z].ColumnID+"$");c=c.substring(0,c.length-1),this.httpService.postData(a.xB.tradingAPIUrl,"SaveColumnTemplateDetails",{UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TmpltColProfId:this.ColumnProfileId,TmpltNm:v,ProfNm:"",AssgndColIds:c,TmpltSortColId:""}).subscribe(ye=>{this.SaveTemplateDetails(ye)})}catch(ye){this.logService.WriteLog("Exception: "+ye.message,"SaveDetails()","marketwatch.component.ts","")}}SaveTemplateDetails(c){0==c.ResponseStatus?this.dialogService.alert("Error while saving the details"):this.tradingSharedService.dicColumnTemplatesDetails.remove(this.ColumnProfileId)}canDeactivate(){return""==a.xB.User.OCToken||!this.isTemplateModified&&!this.isNewProfile||this.dialogService.confirm("All the new changes in Profile will be discarded.Do you want to continue?","Confirm")}getCAColumnDetails(c){try{if("Grid"==this.SelectedView&&!this.isCAColumnExists)return;if(null!=c){for(var C=[],v=0;v<c.length;v++)for(var A=0;A<this.MWScripList.length;A++)if(this.MWScripList[A].ScripDetail.ScripDet.Token==c[v].Token&&this.MWScripList[A].ScripDetail.ScripDet.MktSegId==c[v].MktSegId){this.MWScripList[A].CAFetched||(C.push({MktSegId:c[v].MapMktSegId,Token:c[v].Token}),this.MWScripList[A].CAFetched=!0);break}C.length>0&&this.httpService.postData(a.xB.AnalyticUrl,"GetCAColumnDetails",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,ScripList:C}).subscribe(Se=>{this.getCAColumnDetailsResponse(Se)})}}catch(Se){this.logService.WriteLog("Exception: "+Se.message,"getCAColumnDetails()","marketwatch.component.ts","")}}getCAColumnDetailsResponse(c){try{if(c.ResponseStatus&&null!=c.ResponseObject){var C=c.ResponseObject;if(C.length>0)for(let A=0;A<C.length;A++)for(var v=0;v<this.MWScripList.length;v++)if(this.MWScripList[v].ScripDetail.ScripDet.Token==C[A].token&&this.MWScripList[v].ScripDetail.ScripDet.MapMktSegId==C[A].mktSegId){this.MWScripList[v].CorpAction.push({ScripDesc:C[A].co_name,AnnounceDate:C[A].announceDate,RecordDate:C[A].recordDate,CADate:C[A].caDate,CARatio:C[A].caRatio,CAPremium:C[A].premium,Remark:C[A].remark,Icon:C[A].icon,Sector:C[A].sector,FaceValue:C[A].faceVal});break}this.mwTable&&this.mwTable.detectChange()}}catch(A){this.logService.WriteLog("Exception: "+A.message,"getCAColumnDetailsResponse()","marketwatch.component.ts","")}}getMoreColumnHistoricData(c){try{if("Grid"==this.SelectedView&&!this.isMoreColumnsExists)return;if(null!=c){for(var C=[],v=0;v<c.length;v++)C.push({MktSegId:c[v].MapMktSegId,Token:c[v].Token});this.httpService.postData(a.xB.AnalyticUrl,"GetMoreColumnHistoricData",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,ScripList:C}).subscribe(z=>{this.getMoreColumnHistoricDataResponse(z)})}}catch(z){this.logService.WriteLog("Exception: "+z.message,"getMoreColumnHistoricData()","marketwatch.component.ts","")}}getMoreColumnHistoricDataResponse(c){try{if(c.ResponseStatus&&null!=c.ResponseObject){var C=c.ResponseObject;if(C.length>0)for(var v=0;v<C.length;v++)if(l.X.IsCommodityExchange(C[v].mktSegId))this.ProcessGetMoreColumnHistoricDataResponseForNegExchange(C[v]);else for(var A=0;A<this.MWScripList.length;A++)if(this.MWScripList[A].ScripDetail.ScripDet.Token==C[v].token&&this.MWScripList[A].ScripDetail.ScripDet.MapMktSegId==C[v].mktSegId){this.MWScripList[A].OneWeekHigh=0!=C[v].nHighWeekly&&null!=C[v].nHighWeekly?C[v].nHighWeekly:"",this.MWScripList[A].OneWeekLow=0!=C[v].nLowWeekly&&null!=C[v].nLowWeekly?C[v].nLowWeekly:"",this.MWScripList[A].OneMonthHigh=0!=C[v].nHighMonthly&&null!=C[v].nHighMonthly?C[v].nHighMonthly:"",this.MWScripList[A].OneMonthLow=0!=C[v].nLowMonthly&&null!=C[v].nLowMonthly?C[v].nLowMonthly:"",this.MWScripList[A].ThreeMonthsHigh=0!=C[v].nHighQuarterly&&null!=C[v].nHighQuarterly?C[v].nHighQuarterly:"",this.MWScripList[A].ThreeMonthsLow=0!=C[v].nLowQuarterly&&null!=C[v].nLowQuarterly?C[v].nLowQuarterly:"",this.MWScripList[A].SixMonthsHigh=0!=C[v].nHigh6Monthly&&null!=C[v].nHigh6Monthly?C[v].nHigh6Monthly:"",this.MWScripList[A].SixMonthsLow=0!=C[v].nLow6Monthly&&null!=C[v].nLow6Monthly?C[v].nLow6Monthly:"",this.MWScripList[A].OneWeekPerChange=0!=C[v].n1WeekPercentChange&&null!=C[v].n1WeekPercentChange?Number(C[v].n1WeekPercentChange).toFixed(2):"",this.MWScripList[A].OneMonthPerChange=0!=C[v].n1MonthPercentChange&&null!=C[v].n1MonthPercentChange?Number(C[v].n1MonthPercentChange).toFixed(2):"",this.MWScripList[A].ThreeMonthsPerChange=0!=C[v].n3MonthsPercentChange&&null!=C[v].n3MonthsPercentChange?Number(C[v].n3MonthsPercentChange).toFixed(2):"",this.MWScripList[A].SixMonthsPerChange=0!=C[v].n6MonthsPercentChange&&null!=C[v].n6MonthsPercentChange?Number(C[v].n6MonthsPercentChange).toFixed(2):"",this.MWScripList[A].PerBelow52WeekHigh=0!=C[v].nPercentBelow52WeekHigh&&null!=C[v].nPercentBelow52WeekHigh?Number(C[v].nPercentBelow52WeekHigh).toFixed(2):"",this.MWScripList[A].PerAbove52WeekLow=0!=C[v].nPercentAbove52WeekLow&&null!=C[v].nPercentAbove52WeekLow?Number(C[v].nPercentAbove52WeekLow).toFixed(2):"",this.MWScripList[A].YesterdayHigh=0!=C[v].nYesterdayHigh&&null!=C[v].nYesterdayHigh?C[v].nYesterdayHigh:"",this.MWScripList[A].YesterdayLow=0!=C[v].nYesterdayLow&&null!=C[v].nYesterdayLow?C[v].nYesterdayLow:"",this.MWScripList[A].FiveDaysAverageV
1olume=0!=C[v].nVolumeWeekly&&null!=C[v].nVolumeWeekly?C[v].nVolumeWeekly:"",this.MWScripList[A].ThreeMonthsAverageVolume=0!=C[v].nVolumeQuarterly&&null!=C[v].nVolumeQuarterly?C[v].nVolumeQuarterly:"",this.MWScripList[A].SixMonthsAverageVolume=0!=C[v].nVolume6Monthly&&null!=C[v].nVolume6Monthly?C[v].nVolume6Monthly:"",this.MWScripList[A].Premium=null==C[v].nPremium?"NA":C[v].nPremium,this.MWScripList[A].Discount=null==C[v].nDiscount?"NA":C[v].nDiscount,this.MWScripList[A].PrevDayHigh=0!=C[v].nPrevDayHigh&&null!=C[v].nPrevDayHigh?C[v].nPrevDayHigh:"",this.MWScripList[A].PrevDayLow=0!=C[v].nPrevDayLow&&null!=C[v].nPrevDayLow?C[v].nPrevDayLow:"",this.MWScripList[A].PrevDayOpen=0!=C[v].nPrevDayOpen&&null!=C[v].nPrevDayOpen?C[v].nPrevDayOpen:"",this.MWScripList[A].PrevDayClose=0!=C[v].nPrevDayClose&&null!=C[v].nPrevDayClose?C[v].nPrevDayClose:"",this.MWScripList[A].FiftyTwoWeekHigh=0!=C[v].nLifeTimeHigh&&null!=C[v].nLifeTimeHigh?C[v].nLifeTimeHigh:"",this.MWScripList[A].FiftyTwoWeekLow=0!=C[v].nLifeTimeLow&&null!=C[v].nLifeTimeLow?C[v].nLifeTimeLow:"";break}}}catch(z){this.logService.WriteLog("Exception: "+z.message,"getMoreColumnHistoricDataResponse()","marketwatch.component.ts","")}}ProcessGetMoreColumnHistoricDataResponseForNegExchange(c){try{for(var C=0;C<this.MWScripList.length;C++)if(this.MWScripList[C].ScripDetail.ScripDet.Token==c.token&&this.MWScripList[C].ScripDetail.ScripDet.MapMktSegId==c.mktSegId){this.MWScripList[C].OneWeekHigh=null!=c.nHighWeekly?c.nHighWeekly:"",this.MWScripList[C].OneWeekLow=null!=c.nLowWeekly?c.nLowWeekly:"",this.MWScripList[C].OneMonthHigh=null!=c.nHighMonthly?c.nHighMonthly:"",this.MWScripList[C].OneMonthLow=null!=c.nLowMonthly?c.nLowMonthly:"",this.MWScripList[C].ThreeMonthsHigh=null!=c.nHighQuarterly?c.nHighQuarterly:"",this.MWScripList[C].ThreeMonthsLow=null!=c.nLowQuarterly?c.nLowQuarterly:"",this.MWScripList[C].SixMonthsHigh=null!=c.nHigh6Monthly?c.nHigh6Monthly:"",this.MWScripList[C].SixMonthsLow=null!=c.nLow6Monthly?c.nLow6Monthly:"",this.MWScripList[C].OneWeekPerChange=null!=c.n1WeekPercentChange?Number(c.n1WeekPercentChange).toFixed(2):"",this.MWScripList[C].OneMonthPerChange=null!=c.n1MonthPercentChange?Number(c.n1MonthPercentChange).toFixed(2):"",this.MWScripList[C].ThreeMonthsPerChange=null!=c.n3MonthsPercentChange?Number(c.n3MonthsPercentChange).toFixed(2):"",this.MWScripList[C].SixMonthsPerChange=null!=c.n6MonthsPercentChange?Number(c.n6MonthsPercentChange).toFixed(2):"",this.MWScripList[C].PerBelow52WeekHigh=null!=c.nPercentBelow52WeekHigh?Number(c.nPercentBelow52WeekHigh).toFixed(2):"",this.MWScripList[C].PerAbove52WeekLow=null!=c.nPercentAbove52WeekLow?Number(c.nPercentAbove52WeekLow).toFixed(2):"",this.MWScripList[C].YesterdayHigh=null!=c.nYesterdayHigh?c.nYesterdayHigh:"",this.MWScripList[C].YesterdayLow=null!=c.nYesterdayLow?c.nYesterdayLow:"",this.MWScripList[C].FiveDaysAverageVolume=null!=c.nVolumeWeekly?c.nVolumeWeekly:"",this.MWScripList[C].ThreeMonthsAverageVolume=null!=c.nVolumeQuarterly?c.nVolumeQuarterly:"",this.MWScripList[C].SixMonthsAverageVolume=null!=c.nVolume6Monthly?c.nVolume6Monthly:"",this.MWScripList[C].Premium=null==c.nPremium?"NA":c.nPremium,this.MWScripList[C].Discount=null==c.nDiscount?"NA":c.nDiscount,this.MWScripList[C].PrevDayHigh=null!=c.nPrevDayHigh?c.nPrevDayHigh:"",this.MWScripList[C].PrevDayLow=null!=c.nPrevDayLow?c.nPrevDayLow:"",this.MWScripList[C].PrevDayOpen=null!=c.nPrevDayOpen?c.nPrevDayOpen:"",this.MWScripList[C].PrevDayClose=null!=c.nPrevDayClose?c.nPrevDayClose:"",this.MWScripList[C].FiftyTwoWeekHigh=null!=c.nLifeTimeHigh?c.nLifeTimeHigh:"",this.MWScripList[C].FiftyTwoWeekLow=null!=c.nLifeTimeLow?c.nLifeTimeLow:"";break}}catch(v){this.logService.WriteLog("Exception: "+v.message,"ProcessGetMoreColumnHistoricDataResponseForNegExchange()","marketwatch.component.ts","")}}onHover(c,C){try{if(this.popoverDesc=c.ScripDesc,this.Icon=c.Icon,this.Remark=c.Remark,this.AnnounceDate=c.AnnounceDate,this.RecordDate=c.RecordDate,this.CADate=c.CADate,this.Premium=c.CAPremium,this.FaceVal=c.FaceValue,this.Sector=c.Sector,"S"===c.Icon){var v=c.CARatio.split(":");this.FaceValBefore=v[0],this.FaceValAfter=v[1]}else this.CARatio=c.CARatio;this.popoverHeader="D"==this.Icon?"Dividend":"S"==this.Icon?"Split":"B"==this.Icon?"Bonus":"Rights",C.stopPropagation()}catch(A){this.logService.WriteLog("Exception: "+A.message,"onHover()","marketwatch.component.ts","")}}preventClickEvent(c){c.stopPropagation()}RowClickBV(c,C){this.mwTable.RowClick(c,C)}onCheckBoxSelect(c){this.isOneChecked=c}delRow(){this.dialogService.alert("Atleast select one Scrip.")}onBWCheckboxChange(c){setTimeout(()=>{this.checkAnySel()},0),c.stopImmediatePropagation()}checkAnySel(){var c=this.MWScripList.filter(C=>C.isCheckSelected);this.isOneChecked=c.length>0}ToggleAdvBtnForChartIQ(){this.isChartIQ=a.xB.dConfigMaster.FINALYTICS_CHART_VENDOR==a.gT.CHART_VENDOR_CHARTIQ}openAdvChart(c){this.dialogService.openComponent("Advanced Chart",e.m,c,"1150px","800px")}onViewPortChange(c){try{0==this.viewPortScripKeys.length&&(this.viewPortScripKeys=c.scripKeys,this.tradingSharedService.sendTouchLineRequest
1(c.scripKeys,1),this.SelectedView!=a.gT.C_S_TAG_PP?(this.getCAColumnDetails(c.scripKeys),this.getMoreColumnHistoricData(c.scripKeys),clearInterval(this.moreColumsInterval),this.moreColumsInterval=setInterval(()=>{this.getMoreColumnHistoricData(this.viewPortScripKeys)},a.xB.dConfigMaster.FINALYTICS_MW_FILTERINTERVAL)):this.LoadPPW(this.viewPortScripKeys)),this.viewPortScripKeys=c.scripKeys,c.addedScripKeys.length>0&&(this.tradingSharedService.sendTouchLineRequest(c.addedScripKeys,1),this.SelectedView!=a.gT.C_S_TAG_PP?(this.getCAColumnDetails(c.addedScripKeys),this.getMoreColumnHistoricData(c.addedScripKeys)):this.LoadPPW(c.addedScripKeys)),c.removedScripKeys.length>0&&this.tradingSharedService.sendTouchLineRequest(c.removedScripKeys,2)}catch(C){this.logService.WriteLog("Exception: "+C.message,"onViewPortChange()","marketwatch.component.ts","")}}checkInstrumentType(c){return!(c==a.gT.C_S_INSTRUMENT_EQUITIES_TEXT||c==a.gT.C_S_INSTRUMENT_FUTSPT_TEXT)}}return D.\u0275fac=function(c){return new(c||D)(i.\u0275\u0275directiveInject(a.Uh),i.\u0275\u0275directiveInject(i.NgZone),i.\u0275\u0275directiveInject(a.OE),i.\u0275\u0275directiveInject(a.mQ),i.\u0275\u0275directiveInject(a.hC),i.\u0275\u0275directiveInject(P.H),i.\u0275\u0275directiveInject(a._V),i.\u0275\u0275directiveInject(_.D),i.\u0275\u0275directiveInject(k.m),i.\u0275\u0275directiveInject(W.M),i.\u0275\u0275directiveInject(N.F),i.\u0275\u0275directiveInject(Q.gz),i.\u0275\u0275directiveInject(i.ElementRef),i.\u0275\u0275directiveInject(i.ChangeDetectorRef),i.\u0275\u0275directiveInject(H.Y))},D.\u0275cmp=i.\u0275\u0275defineComponent({type:D,selectors:[["market-watch"]],viewQuery:function(c,C){if(1&c&&(i.\u0275\u0275viewQuery(Ke,5),i.\u0275\u0275viewQuery(Xe,7),i.\u0275\u0275viewQuery(et,7),i.\u0275\u0275viewQuery(ct,7),i.\u0275\u0275viewQuery(tt,7),i.\u0275\u0275viewQuery(Ct,7),i.\u0275\u0275viewQuery(vt,7),i.\u0275\u0275viewQuery(ze,7),i.\u0275\u0275viewQuery(Rt,7),i.\u0275\u0275viewQuery(Ft,7)),2&c){let v;i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.mwTable=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTmplAlert=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTmplLTP=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTmplPercChng=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTmplNetChng=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.rowExpandTempl=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTemplEvents=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.blockViewTempl=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTemplScrip=v.first),i.\u0275\u0275queryRefresh(v=i.\u0275\u0275loadQuery())&&(C.cellTmplRemoveScrip=v.first)}},hostBindings:function(c,C){1&c&&i.\u0275\u0275listener("keydown",function(A){return C.onKeyDown(A)},!1,i.\u0275\u0275resolveDocument)},decls:78,vars:22,consts:[[1,"Market_Watch"],[1,"container-fluid"],[4,"ngIf"],[1,"nopadding"],[1,"filterPanel"],[1,"zone2"],[1,"databox"],[1,"w100"],["disableOptionCentering","true","placeholder","Select Profile",3,"ngModel","ngModelChange","selectionChange","opened"],[3,"label",4,"ngFor","ngForOf"],[1,"pt5"],["type","button","field","quantity",1,"icon-bdr","qtyplus","Global_Filter",3,"matTooltip","click"],[1,"MarketWatch_Add_Script"],["headerVisibile","false",3,"PageSource","addScripCallBack"],[1,"zone3"],[1,"iconbox"],[1,"pt8"],["value","BUY",1,"Market_up_Collapse_Menu","btn","btn-primary",3,"click"],["value","SELL",1,"Market_down_Collapse_Menu","btn","btn-primary",3,"click"],["class","pt8",4,"ngIf"],["class","icon-bdr filtericon Global_Filter",3,"matTooltip","background-color","click",4,"ngIf"],["class","icon-bdr ColumnsViewicon Global_Filter",3,"matTooltip","click",4,"ngIf"],["class","icon-bdr Global_Filter blockview",4,"ngIf"],[1,"clear"],[1,"Add_profile"],[1,"popup"],["class","popuptext",4,"ngIf"],["class","market-w-wrap",4,"ngIf"],[1,"col"],["cellTmplRemoveScrip",""],["cellTmplAlert",""],["cellTmplLTP",""],["cellTmplPercChng",""],["cellTmplNetChng",""],["rowExpandTempl",""],["cellTemplScrip",""],["cellTemplEvents",""],[1,"devident_bg"],["x-position","before","y-position","above","mdPopoverTrigger","hover","mdPopoverPlacement","bottom",3,"overlapTrigger","mdPopoverDelay"],["appPopover","mdPopover"],[2,"height","65px"],[1,"devident_header"],[1,"devident_header_sub"],[1,"displ-Style","ClrBlack"],["class","padtop_10",4,"ngIf"],["blockViewTempl",""],[3,"type"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"dd-label"],["disableOptionCentering","true","placeholder","Top 50 based on",3,"ngModel","ngModelChange","selectionChange"],[1,"w80"],["disableOptionCentering","true","placeholder","Calc Method",3,"ngModel","ngModelChange"],["disableOptionCentering","true","placeholder","Formula",3,"ngModel","ngModelChange"],["mat-raised-button","",1,"btn","btn-primary",3,"click"],["value","ML",1,"mulileg_btn","btn","btn-primary",3,"click"],[1,"icon-bdr","filtericon","Global_Filter",3,"matTooltip","click"],[1,"icon-bdr","ColumnsViewicon","Global_Filter",3,"matTooltip","click"],[1,"icon-bdr","Global_Filter","blockview"],["src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=","alt","Block View",3,"matTooltip","className","click",4,"ngIf"],["src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=","alt","Grid View",3,"matTooltip","className","click",4,"ngIf"],["src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=","alt","Block View",3,"matTooltip","className","click"],["src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=","alt","Grid View",3,"matTooltip","className","click"],[1,"popuptext"],[1,"Prof_row1"],["matInput","","placeholder","Add New Profile","maxlength","20","nn-upper-case","",3,"ngModel","ngModelChange",4,"ngIf"],["matInput","","placeholder","Add New Profile","maxlength","8","nn-upper-case","",3,"ngModel","ngModelChange",4,"ngIf"],["mat-raised-button","",3,"click"],[1,"Prof_row2"],[4,"ngFor","ngForOf"],["matInput","","placeholder","Add New Profile","maxlength","20","nn-upper-case","",3,"ngModel","ngModelChange"],["matInput","","placeholder","Add New Profile","maxlength","8","nn-upper-case","",3,"ngModel","ngModelChange"],["class","add-pro-label",4,"ngIf"],[1,"add-pro-label"],["class","edit-user",4,"ngIf"],[1,"add-pro-btn"],["class","modify-btn",3,"click",4,"ngIf"],["class","Rename","matTooltip","Submit",3,"click",4,"ngIf"],["class","Remove","matTooltip","Cancel",3,"click",4,"ngIf"],["class","RemoveScripicon",3,"click",4,"ngIf"],[1,"edit-user"],["matInput","","placeholder","Add New Profile","maxlength","20","nn-upper-case","",3,"ngModel","value","ngModelChange",4,"ngIf"],["matInput","","placeholder","Add New Profile","maxlength","8","nn-upper-case","",3,"ngModel","value","ngModelChange",4,"ngIf"],["matInput","","placeholder","Add New Profile","maxlength","20","nn-upper-case","",3,"ngModel","value","ngModelChange"],["matInput","","placeholder","Add New Profile","maxlength","8","nn-upper-case","",3,"ngModel","value","ngModelChange"],[1,"modify-btn",3,"click"],["matTooltip","Submit",1,"Rename",3,"click"],["matTooltip","Cancel",1,"Remove",3,"click"],[1,"RemoveScripicon",3,"click"],[1,"market-w-wrap"],["class","trash_disabled","style","margin: 0 26p
1x!important;",3,"click",4,"ngIf"],["class","trash_active","style","margin: 0 26px!important;",3,"click",4,"ngIf"],[1,"trash_disabled",2,"margin","0 26px!important",3,"click"],[1,"trash_active",2,"margin","0 26px!important",3,"click"],[3,"showFilter","layoutMode","blockViewTempl","rowExpandTempl","fixedHdrConfig","fhTopHeight","columns","rows","ProcessOEandB5","dragSuccess","onChecked","colDragSuccess","onViewPortChange"],["mwTable",""],["class","trash_disabled",3,"click",4,"ngIf"],["class","trash_active",3,"click",4,"ngIf"],[1,"trash_disabled",3,"click"],[1,"trash_active",3,"click"],["type","button",3,"className","matTooltip","click",4,"ngIf"],["type","button",3,"matTooltip","className","click",4,"ngIf"],["type","button",3,"className","matTooltip","click"],["type","button",3,"matTooltip","className","click"],["class","eventBtn",3,"matPopoverTriggerFor","click","mousemove",4,"ngFor","ngForOf"],[1,"eventBtn",3,"matPopoverTriggerFor","click","mousemove"],[3,"ngClass","innerHTML"],["style","display:inline-block;margin: 0px 0px 0px 5px;",4,"ngIf"],[2,"display","inline-block","margin","0px 0px 0px 5px"],[3,"inputdata"],[1,"MarketWatch_collapseView"],[1,"Collapse_TabMenu"],[1,"demo-tab-group","mktTab",3,"selectedIndex","selectedIndexChange"],["label","Best Five"],["label","Chart"],["style","height:100%;position:relative",3,"width",4,"ngIf"],["label","Security/Contract Info"],["label","Combined Depth"],["label","Research Calls",4,"ngIf"],[1,"CollapseBuySell"],[1,"watch-tab-box"],[3,"Scrip","isB5HdrVisible","isExchNameVisible","isBuySellLinkVisible","isLookUp"],[3,"Scrip"],[2,"height","100%","position","relative"],["class","AdvancedChart_btn",3,"click",4,"ngIf"],[3,"Scrip","isB5HdrVisible"],[1,"AdvancedChart_btn",3,"click"],[3,"Scrip",4,"ngIf"],[3,"PageSource","isExchNameVisible","isBuySellLinkVisible","Scrip"],["label","Research Calls"],["class","research-info",3,"width",4,"ngIf"],[1,"research-info"],[3,"ViewAllButton","mwData","recoLookUp","viewBtn","exchdropdwn"],[3,"type","instru","spread","pageSource","mktSegId","token","symbol","rowclassName","descPart1","descPart2"],[1,"txt-center"],[1,"padtop_10"],[1,"devident"],[1,"profile_scroll","BlockView"],[1,"mdetail",3,"ngClass","click"],[1,"B1"],[1,"B1Top"],["type","checkbox",3,"ngModel","checked","ngModelChange","click"],["type","button",3,"matTooltip","ngClass","click"],[1,"B1Middle"],[3,"scrip"],[1,"B1Bottom"],[1,"B2"],[1,"B2ScripName"],[3,"type","pageSource","mktSegId","token","symbol","rowclassName","descPart1","descPart2"],[1,"B2Bottom"],[1,"B2Left"],[1,"LTPPrice"],[1,"B2Right"],[1,"LTPTrend"],[1,"LTPTrendTop"],[1,"LTPTrendPrice"],[1,"LTPTrendBuy"],[3,"ngClass"],[1,"LTPTrendBottom"],[1,"LTPTrendSell"],[1,"B3"],[1,"B3Top"],[1,"rangeslide"],[1,"rangeslidetitle"],[1,"rangeslidechart"],[3,"min","max","datavalue"],[1,"B3Middle"],[1,"padL-5"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(c,C){1&c&&(i.\u0275\u0275elementStart(0,"div",0),i.\u0275\u0275elementStart(1,"div",1),i.\u0275\u0275template(2,Nt,2,1,"div",2),i.\u0275\u0275elementStart(3,"div",3),i.\u0275\u0275elementStart(4,"div",4),i.\u0275\u0275elementStart(5,"div",5),i.\u0275\u0275elementStart(6,"div",6),i.\u0275\u0275elementStart(7,"ul"),i.\u0275\u0275elementStart(8,"li"),i.\u0275\u0275elementStart(9,"mat-form-field",7),i.\u0275\u0275elementStart(10,"mat-select",8),i.\u0275\u0275listener("ngModelChange",function(A){return C.objProfile.SelectedProfile=A})("selectionChange",function(){return C.loadScript()})("opened",function(){return C.onProfDDOpen()}),i.\u0275\u0275template(11,Bt,2,2,"mat-optgroup",9),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(12,"li",10),i.\u0275\u0275elementStart(13,"input",11),i.\u0275\u0275listener("click",function(){return C.displayProfilePopup()}),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(14,Ut,6,2,"li",2),i.\u0275\u0275elementStart(15,"li"),i.\u0275\u0275elementStart(16,"div",12),i.\u0275\u0275elementStart(17,"universalLookup",13),i.\u0275\u0275listener("addScripCallBack",function(A){return C.addScripCallBack(A)}),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(18,Qt,13,4,"li",2),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(19,"div",14),i.\u0275\u0275elementStart(20,"div",15),i.\u0275\u0275elementStart(21,"ul"),i.\u0275\u0275elementStart(22,"li",16),i.\u0275\u0275elementStart(23,"button",17),i.\u0275\u0275listener("click",function(){return C.populateOE("BUY")}),i.\u0275\u0275text(24,"BUY"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(25,"li",16),i.\u0275\u0275elementStart(26,"button",18),i.\u0275\u0275listener("click",function(){return C.populateOE("SELL")}),i.\u0275\u0275text(27,"SELL"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(28,Yt,3,0,"li",19),i.\u0275\u0275elementStart(29,"li"),i.\u0275\u0275template(30,Xt,1,3,"button",20),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(31,"li"),i.\u0275\u0275template(32,
1Kt,1,1,"button",21),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(33,"li"),i.\u0275\u0275template(34,y,3,2,"div",22),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(35,"div",23),i.\u0275\u0275elementStart(36,"div",24),i.\u0275\u0275elementStart(37,"div",25),i.\u0275\u0275template(38,We,18,4,"div",26),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(39,ai,3,2,"div",27),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(40,"div",28),i.\u0275\u0275template(41,ci,2,2,"ng-template",null,29,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(43,xi,4,4,"ng-template",null,30,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275template(45,Di,2,3,"ng-template",null,31,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275template(47,Ai,1,2,"ng-template",null,32,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275template(49,Li,1,2,"ng-template",null,33,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275template(51,Ui,18,7,"ng-template",null,34,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275template(53,Hi,1,1,"ng-template",null,35,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275template(55,Ki,3,2,"ng-template",null,36,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275elementStart(57,"div",37),i.\u0275\u0275elementStart(58,"md-popover",38,39),i.\u0275\u0275elementStart(60,"mat-card"),i.\u0275\u0275elementStart(61,"mat-card-header",40),i.\u0275\u0275elementStart(62,"mat-card-title",41),i.\u0275\u0275text(63),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(64,"mat-card-subtitle",42),i.\u0275\u0275elementStart(65,"span",43),i.\u0275\u0275text(66),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(67,"br"),i.\u0275\u0275elementStart(68,"span",43),i.\u0275\u0275elementStart(69,"mat-card-content"),i.\u0275\u0275text(70),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275element(71,"br"),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(72,qi,8,6,"div",44),i.\u0275\u0275template(73,nr,9,7,"div",44),i.\u0275\u0275template(74,dr,8,6,"div",44),i.\u0275\u0275template(75,Tr,9,7,"div",44),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd(),i.\u0275\u0275template(76,Ar,136,55,"ng-template",null,45,i.\u0275\u0275templateRefExtractor),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementEnd()),2&c&&(i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",C.showProgressBar),i.\u0275\u0275advance(8),i.\u0275\u0275property("ngModel",C.objProfile.SelectedProfile),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngForOf",C.objProfile.ProfileList),i.\u0275\u0275advance(2),i.\u0275\u0275property("matTooltip","Add New Profile"),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",null==C.objProfile.SelectedProfile?null:C.objProfile.SelectedProfile.IsIndex),i.\u0275\u0275advance(3),i.\u0275\u0275property("PageSource","1"),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf","Pivot Point"==C.SelectedView),i.\u0275\u0275advance(10),i.\u0275\u0275property("ngIf",1!=C.SelectedMWData.ScripDetail.IsSpread&&C.checkInstrumentType(C.SelectedMWData.ScripDetail.InstrumentName)),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",C.showFilterInBV),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",C.gridViewBtn),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",C.noViewBtn),i.\u0275\u0275advance(4),i.\u0275\u0275property("ngIf",""!=C.profileTemplateState),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",C.rows),i.\u0275\u0275advance(19),i.\u0275\u0275property("overlapTrigger",!1)("mdPopoverDelay",400),i.\u0275\u0275advance(5),i.\u0275\u0275textInterpolate1(" ",C.popoverHeader," "),i.\u0275\u0275advance(3),i.\u0275\u0275textInterpolate(C.popoverDesc),i.\u0275\u0275advance(4),i.\u0275\u0275textInterpolate1("(",C.Sector,")"),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf","D"==C.Icon),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf","S"==C.Icon),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf","B"==C.Icon),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf","R"==C.Icon))},directives:[V.O5,w.KE,Z.gD,F.JJ,F.On,V.sg,re.gM,X.e,ne.n,he.a8,he.dk,he.n5,he.$j,he.dn,fe.R,Te.Nv,Te.ey,Ce.lW,be.Nt,F.Fj,F.nD,Me.b,ue.H,Re.u,V.mk,Ee,Ue.SP,Ue.uX,Ze.t,Tt,ot.I,xe,oe.t,me.N,u.c,L.a,te.oG,J,De.A,V.tP],encapsulation:2,data:{animation:[(0,b.X$)("profileTemplateVisible",[(0,b.SB)("shown",(0,b.oB)({opacity:1,visibility:"visible",animation:"fadeIn 1s"})),(0,b.SB)("hidden",(0,b.oB)({opacity:0,visibility:"hidden"})),(0,b.eR)("shown => hidden",(0,b.jt)(".20s",(0,b.oB)({height:0}))),(0,b.eR)("* => shown",(0,b.jt)(".20s",(0,b.oB)({opacity:1,height:"*"})))])]},changeDetection:0}),D})()},1330:(je,ke,x)=>{x.d(ke,{Q:()=>p});var a=x(1705),T=x(2741),G=x(6274),n=x(5117),l=x(7324);function g(h,o){1&h&&(T.\u0275\u0275elementStart(0,"div"),T.\u0275\u0275element(1,"nn-progressbar",2),T.\u0275\u0275elementEnd()),2&h&&(T.\u0275\u0275advance(1),T.\u0275\u0275property("type","PS"))}function b(h,o){if(1&h&&(T.\u0275\u0275elementStart(0,"div"),T.\u0275\u0275element(1,"reportgrid",3),T.\u0275\u0275elementEnd()),2&h){const u=T.\u0275\u0275nextContext();T.\u0275\u0275advance(1),T.\u0275\u0275property("showPaging",!0)("pageSize",10)("IsWrapText",!0)("fhTopHeight","0px")("isFixedHeader",!1)("fixedHdrConfig",u.fixedHdrConfig)("columns",u.columns)("rows",u.rows)}}let p=(()=>{class h{constructor(u,m){this.httpService=u,this.logService=m,this.Newslist=[],this.isRowsAvailable=!1,this.showProgressBar=!1,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"}}ngOnInit(){try{var u;u=this.context.params.jData,""!=a.xB.dConfigMaster.FINALYTICS_NEWS_CONN_STRING.toString()&&this.getNewsList(u)}catch(m){this.logService.WriteLog("news.component.ts","ngOnInit()",m.message)}}getNewsList(u){this.showProgressBar=!0,this.httpService.postData(a.xB.tradingAPIUrl,"GetNewsData",u).subscribe(m=>{this.fn_GetNewsDataCompleted(m)})}fn_GetNewsDataCompleted(u){this.showProgressBar=!1;try{if(this.rows=[],null!=u.ResponseObject){if(this.initHeaders(),u.ResponseObject.Table1.length>0){for(var m=0;m<u.ResponseObject.Table1.length;m++)this.rows.push({DateTime:u.ResponseObject.Table1[m].NewsDateTime,HeadLines:u.ResponseObject.Table1[m].HL});this.isRowsAvailable=!0}}else this.isRowsAvailable=!1}catch(e){this.logService.WriteLog("Exception: "+e.message,"fn_GetNewsDataCompleted()","news.component.ts")}}initHeaders(){this.columns=[],this.columns.push({value:"HeadLines",name:"Headlines",cType:"S"}),this.columns.push({value:"DateTime",name:"Date Time",cType:"S"})}}
1return h.\u0275fac=function(u){return new(u||h)(T.\u0275\u0275directiveInject(a.OE),T.\u0275\u0275directiveInject(a.mQ))},h.\u0275cmp=T.\u0275\u0275defineComponent({type:h,selectors:[["news"]],inputs:{context:"context"},decls:3,vars:2,consts:[[4,"ngIf"],[1,"news_info","mwtable2"],[3,"type"],[3,"showPaging","pageSize","IsWrapText","fhTopHeight","isFixedHeader","fixedHdrConfig","columns","rows"]],template:function(u,m){1&u&&(T.\u0275\u0275template(0,g,2,1,"div",0),T.\u0275\u0275elementStart(1,"div",1),T.\u0275\u0275template(2,b,2,8,"div",0),T.\u0275\u0275elementEnd()),2&u&&(T.\u0275\u0275property("ngIf",m.showProgressBar),T.\u0275\u0275advance(2),T.\u0275\u0275property("ngIf",!m.showProgressBar))},directives:[G.O5,n.R,l.i],encapsulation:2}),h})()},6416:(je,ke,x)=>{x.d(ke,{O:()=>u});var a=x(1705),T=x(2741),G=x(7452),n=x(6274),l=x(9009),g=x(4699),b=x(3324);function p(m,e){if(1&m){const f=T.\u0275\u0275getCurrentView();T.\u0275\u0275elementStart(0,"mat-checkbox",6),T.\u0275\u0275listener("ngModelChange",function(P){return T.\u0275\u0275restoreView(f),T.\u0275\u0275nextContext().$implicit.Selected=P})("change",function(){return T.\u0275\u0275restoreView(f),T.\u0275\u0275nextContext(2).ShowMessages()}),T.\u0275\u0275text(1),T.\u0275\u0275elementEnd()}if(2&m){const f=T.\u0275\u0275nextContext().$implicit;T.\u0275\u0275property("ngModel",f.Selected)("checked",f.Selected),T.\u0275\u0275advance(1),T.\u0275\u0275textInterpolate1(" ",f.Caption," ")}}function h(m,e){if(1&m&&(T.\u0275\u0275elementStart(0,"div"),T.\u0275\u0275elementStart(1,"div",4),T.\u0275\u0275template(2,p,2,3,"mat-checkbox",5),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd()),2&m){const f=e.$implicit;T.\u0275\u0275advance(2),T.\u0275\u0275property("ngIf",f.Visible)}}function o(m,e){if(1&m&&(T.\u0275\u0275elementStart(0,"mat-card-content"),T.\u0275\u0275text(1),T.\u0275\u0275elementEnd()),2&m){const f=e.$implicit;T.\u0275\u0275advance(1),T.\u0275\u0275textInterpolate1(" ",f.MsgText," ")}}let u=(()=>{class m{constructor(f,i,P,_){this.pubsubService=f,this.zone=i,this.notificationService=P,this.logService=_,this.notifications=new Array,this.MessagesTypes=[],this.ArrMsg=[],this.Messages=[]}ngOnInit(){try{this.notificationSub=this.notificationService.notifications$.subscribe(f=>{f.displayInMsgBar&&(this.notifications.insert(0,f),this.ShowMessages())}),this.MessagesTypes.push({Type:"ORDER",Caption:"Order",Selected:!0,Visible:!0},{Type:"TRADE",Caption:"Trade",Selected:!0,Visible:!0},{Type:"LOGIN",Caption:"Login",Selected:!0,Visible:!0},{Type:a.gT.C_S_MSGCAT_ALERT,Caption:"Alert",Selected:!0,Visible:!0},{Type:"ALERTBKR",Caption:a.xB.dConfigMaster.BROKERCALL_CAPTION,Selected:!0,Visible:!0},{Type:"NEWS",Caption:"News",Selected:!0,Visible:!0},{Type:"POSCON",Caption:"POSCON",Selected:!0,Visible:!1})}catch(f){this.logService.WriteLog("Exception: "+f.message,"ngOnInit()","OnlineMessages.ts","")}}ShowMessages(){try{for(var f=[],i=[],P=0;P<this.MessagesTypes.length;P++)this.MessagesTypes[P].Selected&&f.push(this.MessagesTypes[P].Type);for(var _=0;_<this.notifications.length;_++)for(P=0;P<f.length;P++)this.notifications[_].messageType==f[P]&&i.push(this.notifications[_].msg);this.Messages=i}catch(k){this.logService.WriteLog("Exception: "+k.message,"ShowMessages","OnlineMessages.ts","")}}}return m.\u0275fac=function(f){return new(f||m)(T.\u0275\u0275directiveInject(a.hC),T.\u0275\u0275directiveInject(T.NgZone),T.\u0275\u0275directiveInject(G.gq),T.\u0275\u0275directiveInject(a.mQ))},m.\u0275cmp=T.\u0275\u0275defineComponent({type:m,selectors:[["app-onlineMessages"]],decls:5,vars:2,consts:[[1,"Online_Message_Parent"],[4,"ngFor","ngForOf"],[1,"Online_Message"],[1,"card"],[1,"Online_Message_Selection"],[3,"ngModel","checked","ngModelChange","change",4,"ngIf"],[3,"ngModel","checked","ngModelChange","change"]],template:function(f,i){1&f&&(T.\u0275\u0275elementStart(0,"div",0),T.\u0275\u0275template(1,h,3,1,"div",1),T.\u0275\u0275elementStart(2,"div",2),T.\u0275\u0275elementStart(3,"mat-card",3),T.\u0275\u0275template(4,o,2,1,"mat-card-content",1),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd(),T.\u0275\u0275elementEnd()),2&f&&(T.\u0275\u0275advance(1),T.\u0275\u0275property("ngForOf",i.MessagesTypes),T.\u0275\u0275advance(3),T.\u0275\u0275property("ngForOf",i.Messages))},directives:[n.sg,l.a8,n.O5,g.oG,b.JJ,b.On,l.dn],encapsulation:2}),m})()},6413:(je,ke,x)=>{x.d(ke,{f:()=>e});var a=x(2741),T=x(1705),G=x(823),n=x(6274),l=x(7617),g=x(9018),b=x(3324),p=x(5019),h=x(3433);function o(f,i){if(1&f){const P=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",6),a.\u0275\u0275listener("ngModelChange",function(k){return a.\u0275\u0275restoreView(P),a.\u0275\u0275nextContext().newProfileName=k}),a.\u0275\u0275elementEnd()}if(2&f){const P=a.\u0275\u0275nextContext();a.\u0275\u0275property("ngModel",P.newProfileName)}}function u(f,i){if(1&f){const P=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"input",7),a.\u0275\u0275listener("ngModelChange",function(k){return a.\u0275\u0275restoreView(P),a.\u0275\u0275nextContext().newProfileName=k}),a.\u0275\u0275elementEnd()}if(2&f){const P=a.\u0275\u0275nextContext();a.\u0275\u0275property("ngModel",P.newProfileName)}}function m(f,i){if(1&f&&(a.\u0275\u0275elementStart(0,"div",8),a.\u0275\u0275text(1),a.\u
10275\u0275elementEnd()),2&f){const P=a.\u0275\u0275nextContext();a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate(P.errmessage)}}let e=(()=>{class f{constructor(){this.newProfileName="",this.errmessage="",this.showErrmsg=!1,this.closeDialog=new a.EventEmitter,this.appSyncON=!1}onSaveProfile(){if(this.newProfileName=this.newProfileName.trim(),this.newProfileName.trim().length>0){if(T.xB.dConfigMaster.FINALYTICS_PROFILE_DATA==T.gT.C_S_FINALYTICS_PROFILE_DATA_AWSAPPSYNC){this.appSyncON=!0;var P=new RegExp("^([0-9A-Za-z]){1,20}$")}else this.appSyncON=!1,P=new RegExp("^([0-9A-Za-z]){1,8}$");var _=new RegExp("[`~!@#$%^&*()_|+-=?;:',.<>]"),k=new RegExp("[\\S]+");if(this.newProfileName.match(P)){for(var W=!1,N=T.xB.User.ProfileList[0].Data.length;N--;)if(T.xB.User.ProfileList[0].Data[N].ProfileName==this.newProfileName.toUpperCase()){W=!0;break}W?(this.errmessage="Profile already exist.",this.showErrmsg=!0):(this.showErrmsg=!1,this.closeDialog.emit({status:!0,profName:this.newProfileName}))}else _.test(this.newProfileName)?(this.errmessage="Special Characters not allowed in Profile Name",this.showErrmsg=!0):k.test(this.newProfileName)?(this.errmessage="White space not allowed in Profile Name",this.showErrmsg=!0):(this.showErrmsg=!0,this.errmessage="Please enter a valid profile name")}else this.showErrmsg=!0,this.errmessage="Please enter a profile name"}onCancel(){this.closeDialog.emit({status:!1,profName:""})}}return f.\u0275fac=function(P){return new(P||f)},f.\u0275cmp=a.\u0275\u0275defineComponent({type:f,selectors:[["saveAs-profile"]],outputs:{closeDialog:"closeDialog"},decls:11,vars:3,consts:[[1,"align"],["matInput","","placeholder","New Profile Name","maxlength","20","nn-upper-case","","autofocus","",3,"ngModel","ngModelChange",4,"ngIf"],["matInput","","placeholder","New Profile Name","maxlength","8","nn-upper-case","","autofocus","",3,"ngModel","ngModelChange",4,"ngIf"],["class","align_center",4,"ngIf"],[1,"margin-20"],["mat-raised-button","",1,"btn","btn-primary",3,"click"],["matInput","","placeholder","New Profile Name","maxlength","20","nn-upper-case","","autofocus","",3,"ngModel","ngModelChange"],["matInput","","placeholder","New Profile Name","maxlength","8","nn-upper-case","","autofocus","",3,"ngModel","ngModelChange"],[1,"align_center"]],template:function(P,_){1&P&&(a.\u0275\u0275elementStart(0,"div",0),a.\u0275\u0275elementStart(1,"mat-form-field"),a.\u0275\u0275template(2,o,1,1,"input",1),a.\u0275\u0275template(3,u,1,1,"input",2),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(4,"mat-error"),a.\u0275\u0275template(5,m,2,1,"div",3),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(6,"div",4),a.\u0275\u0275elementStart(7,"button",5),a.\u0275\u0275listener("click",function(){return _.onSaveProfile()}),a.\u0275\u0275text(8,"Save"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(9,"button",5),a.\u0275\u0275listener("click",function(){return _.onCancel()}),a.\u0275\u0275text(10,"Cancel"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()),2&P&&(a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf",_.appSyncON),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!_.appSyncON),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngIf",_.showErrmsg))},directives:[G.KE,n.O5,G.TO,l.lW,g.Nt,b.Fj,b.nD,p.b,h.h,b.JJ,b.On],encapsulation:2}),f})()},8351:(je,ke,x)=>{x.d(ke,{t:()=>e});var a=x(1705),T=x(5607),G=x(8407),n=x(2741),l=x(7007),g=x(6274),b=x(5117),p=x(328);function h(f,i){1&f&&(n.\u0275\u0275elementStart(0,"div"),n.\u0275\u0275element(1,"nn-progressbar",8),n.\u0275\u0275elementEnd()),2&f&&(n.\u0275\u0275advance(1),n.\u0275\u0275property("type","PS"))}function o(f,i){1&f&&(n.\u0275\u0275elementStart(0,"div",9),n.\u0275\u0275elementStart(1,"span"),n.\u0275\u0275text(2,"No Data Found"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd())}function u(f,i){if(1&f&&(n.\u0275\u0275elementStart(0,"li"),n.\u0275\u0275elementStart(1,"label"),n.\u0275\u0275text(2),n.\u0275\u0275pipe(3,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(4,"br"),n.\u0275\u0275elementStart(5,"span"),n.\u0275\u0275text(6),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd()),2&f){const P=n.\u0275\u0275nextContext(2);n.\u0275\u0275advance(2),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(3,2,"Settlement Cycle")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.SettlmtCycle)}}function m(f,i){if(1&f&&(n.\u0275\u0275elementStart(0,"div"),n.\u0275\u0275elementStart(1,"div",10),n.\u0275\u0275elementStart(2,"h1"),n.\u0275\u0275text(3),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(4,"div",11),n.\u0275\u0275elementStart(5,"ul"),n.\u0275\u0275elementStart(6,"li"),n.\u0275\u0275elementStart(7,"label"),n.\u0275\u0275text(8),n.\u0275\u0275pipe(9,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(10,"span"),n.\u0275\u0275text(11),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(12,"li",12),n.\u0275\u0275text(13,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(14,"li"),n.\u0275\u0275elementStart(15,"label"),n.\u0275\u0275text(16),n.\u0275\u0275pipe(17,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(18,"span"),n.\u0275\u0275text(19),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(20,"li",12),n.\u0275\u0275text(2
11,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(22,"li"),n.\u0275\u0275elementStart(23,"label"),n.\u0275\u0275text(24),n.\u0275\u0275pipe(25,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(26,"span"),n.\u0275\u0275text(27),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(28,"div",5),n.\u0275\u0275elementStart(29,"div",13),n.\u0275\u0275elementStart(30,"h3",14),n.\u0275\u0275text(31),n.\u0275\u0275pipe(32,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(33,"div",15),n.\u0275\u0275elementStart(34,"ul"),n.\u0275\u0275elementStart(35,"li"),n.\u0275\u0275elementStart(36,"label"),n.\u0275\u0275text(37),n.\u0275\u0275pipe(38,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(39,"br"),n.\u0275\u0275elementStart(40,"span"),n.\u0275\u0275text(41),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(42,"li",12),n.\u0275\u0275text(43,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(44,"li"),n.\u0275\u0275elementStart(45,"label"),n.\u0275\u0275text(46),n.\u0275\u0275pipe(47,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(48,"br"),n.\u0275\u0275elementStart(49,"span"),n.\u0275\u0275text(50),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(51,"li",12),n.\u0275\u0275text(52,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(53,"li"),n.\u0275\u0275elementStart(54,"label"),n.\u0275\u0275text(55),n.\u0275\u0275pipe(56,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(57,"br"),n.\u0275\u0275elementStart(58,"span"),n.\u0275\u0275text(59),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(60,"li",12),n.\u0275\u0275text(61,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(62,"li"),n.\u0275\u0275elementStart(63,"label"),n.\u0275\u0275text(64),n.\u0275\u0275pipe(65,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(66,"br"),n.\u0275\u0275elementStart(67,"span"),n.\u0275\u0275text(68),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(69,"li",12),n.\u0275\u0275text(70,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(71,"li"),n.\u0275\u0275elementStart(72,"label"),n.\u0275\u0275text(73),n.\u0275\u0275pipe(74,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(75,"br"),n.\u0275\u0275elementStart(76,"span"),n.\u0275\u0275text(77),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(78,"li",12),n.\u0275\u0275text(79,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(80,"li"),n.\u0275\u0275elementStart(81,"label"),n.\u0275\u0275text(82),n.\u0275\u0275pipe(83,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(84,"br"),n.\u0275\u0275elementStart(85,"span"),n.\u0275\u0275text(86),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(87,"li",12),n.\u0275\u0275text(88,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(89,"li"),n.\u0275\u0275elementStart(90,"label"),n.\u0275\u0275text(91),n.\u0275\u0275pipe(92,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(93,"br"),n.\u0275\u0275elementStart(94,"span"),n.\u0275\u0275text(95),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(96,"li",12),n.\u0275\u0275text(97,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(98,"li"),n.\u0275\u0275elementStart(99,"label"),n.\u0275\u0275text(100),n.\u0275\u0275pipe(101,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(102,"br"),n.\u0275\u0275elementStart(103,"span"),n.\u0275\u0275text(104),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(105,"li",12),n.\u0275\u0275text(106,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(107,"li"),n.\u0275\u0275elementStart(108,"label"),n.\u0275\u0275text(109),n.\u0275\u0275pipe(110,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(111,"br"),n.\u0275\u0275elementStart(112,"span"),n.\u0275\u0275text(113),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(114,"li",16),n.\u0275\u0275text(115,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(116,"li",17),n.\u0275\u0275elementStart(117,"label"),n.\u0275\u0275text(118),n.\u0275\u0275pipe(119,"translate"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(120,"br"),n.\u0275\u0275elementStart(121,"span"),n.\u0275\u0275text(122),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(123,"li",12),n.\u0275\u0275text(124,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275template(125,u,7,4,"li",3),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(126,"div",5),n.\u0275\u0275elementStart(127,"div",13),n.\u0275\u0275elementStart(128,"h3",18),n.\u0275\u0275text(129,"Book Closure/Record Date"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(130,"div",15),n.\u0275\u0275elementStart(131,"ul"),n.\u0275\u0275elementStart(132,"li"),n.\u0275\u0275elementStart(133,"label"),n.\u0275\u0275text(134,"Date"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(135,"br"),n.\u0275\u0275elementStart(136,"span"),n.\u0275\u0275text(137),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(138,"p",19),n.\u0275\u0275elementStart(139,"span"),n.\u0275\u0275text(140),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(141,"li",12),n.\u0275\u0275text(142,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(143,"li"),n.\u0275\u0275elementStart(144,"label"),n.\u0275\u0275text(145,"Ex.Date"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(146,"br"),n.\u0275\u0275elementStart(147,"span"),n.\u0275\u0275text(148),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(149,"li",12),n.\u0275\u0275text(150,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(151,"li"),n.\u0275\u0275elementStart(152,"label"),n.\u0275\u0275text(153,"Purpose"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(154,"br"),n.\u0275\u0275elementStart(155,"span"),n.\u0275\u0275text(156),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(157,"li",12),n.\u0275\u0275text(158,"|"),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementStart(159,"li"),n.\u0275\u0275elementStart(160,"label"),n.\u0275\u0275text(161,"GSM Category"),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(162,"br"),n.\u0275\u0275elementStart(163,"span"),n.\u0275\u0275text(164),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd()),2&f){const P=n.\u0275\u0275nextContext();n.\u0275\u0275advance(3),n.\u0275\u0275textInterpolate(P.SecurityName),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(9,36,"Code")),n.\u0275\u0275advance(3),n.\u0275\u0275textInterpolate(P.Token),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(17,38,"Instrument")),n.\u0275\u0275advance(3),n.\u0275\u0275textInterpolate(P.Instrument),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(25,40,"ISIN")),n.\u0275\u0275advance(3),n.\u0275\u0275textInterpolate(P.ISIN),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(32,42,"Security Details")),n.\u0275\u0275advance(6),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(38,44,"Market Lot")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.MarketLot),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(47,46,"Price Tick (Rs.)")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.PriceTick),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(56,48,"Issued Capital")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.IssuedCapital),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(65,50,"Face Value")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.FaceValue),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(74,52,"Qty Freeze")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.QtyFreeze),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(83,54,"Margin %")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.Margin),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate1("",n.\u0275\u0275pipeBind1(92,56,"Ex. Multiplier")," "),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.Multiplier),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(101,58,"Pre Open")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.PreOpen),n.\u0275\u0275advance(5),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(110,60,"Special Pre Open")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.SPOS),n.\u0275\u0275advance(1),n.\u0275\u0275property("hidden",P.isCAVisible),n.\u0275\u0275advance(2),n.\u0275\u0275property("hidden",P.isCAVisible),n.\u0275\u0275advance(2),n.\u0275\u0275textInterpolate(n.\u0275\u0275pipeBind1(119,62,"Call Auction")),n.\u0275\u0275advance(4),n.\u0275\u0275textInterpolate(P.CallAuction),n.\u0275\u0275advance(3),n.\u0275\u0275property("ngIf",P.showSettlmtCycle),n.\u0275\u0275advance(12),n.\u0275\u0275textInterpolate(P.StartDate),n.\u0275\u0275advance(3),n.\u0275\u0275textInterpolate(P.EndDate),n.\u0275\u0275advance(8),n.\u0275\u0275textInterpolate(P.ExDate),n.\u0275\u0275advance(8),n.\u0275\u0275textInterpolate(P.Purpose),n.\u0275\u0275advance(8),n.\u0275\u0275textInterpolate(P.GSMGrade)}}let e=(()=>{class f{constructor(P,_){this.logService=P,this.httpService=_,this.isCAVisible=!1,this.isBackVisible=!1,this.isSyncVisible=!1,this.showProgressBar=!1,this.noDataFound=!1,this.showSettlmtCycle=!0}ngOnInit(){try{a.xB.applicationType==a.xB.DESKTOP&&(this.isSyncVisible=!0),this.IsMWScripInSync=a.xB.applicationType!=a.xB.MOBILE,a.xB.applicationType==a.xB.MOBILE&&(this.isBackVisible=!0),this.DisplayDetails(this.Scrip.ScripDet.MktSegId,this.Scrip.ScripDet.Token)}catch(P){this.logService.WriteLog("Exception: "+P.message,"ngOnInit()","securityinfo.component.ts","")}}DisplayDetails(P,_){try{this.showProgressBar=!0,this.MktSegId=P,this.httpService.postData(a.xB.tradingAPIUrl,"GetSecurityInfo",{UserID:a.xB.User.
1UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:P,ScripTkn:_}).subscribe(N=>{this.GetSecInfo(N)},N=>{this.showProgressBar=!1,this.noDataFound=!0})}catch(N){this.logService.WriteLog("Exception: "+N.message,"DisplayDetails","securityinfo.component.ts","")}}HandleMWSynchResponse(P){try{this.IsMWScripInSync&&P.ScripDetail.InstrumentName==a.gT.C_S_INSTRUMENT_EQUITIES_TEXT&&this.DisplayDetails(P.ScripDetail.ScripDet.MktSegId(),P.ScripDetail.ScripDet.Token)}catch(_){this.logService.WriteLog("Exception: "+_.message,"HandleMWSynchResponse()","tr_BestFive.js","")}}GetSecInfo(P){try{this.showProgressBar=!1;var _=new T.u;if(null!=P.ResponseObject&&P.ResponseStatus){var W=a.xB.ExchManager.GetSecurityInfo(P.ResponseObject,this.MktSegId);_.ScripDet.MktSegId=parseInt(this.MktSegId),this.SecurityName=W.SecurityName,this.Token=W.Token,_.ScripDet.Token=W.Token,_.Symbol=W.sSymbol.toUpperCase(),_.Series=W.sSeries,_.InstrumentName="EQUITIES",_.ExchangeName=G.X.GetExchangeName(parseInt(this.MktSegId)),_.MWSecurityDesc=G.X.FormatScripDescForMW(_),this.ScripSymbol=_.MWSecurityDesc,this.Instrument=W.Instrument;var Q=W.GSMCategory;this.GSMGrade=1!=W.GSMConfig||this.MktSegId!=a.gT.C_V_NSE_CASH.toString()&&this.MktSegId!=a.gT.C_V_BSE_CASH.toString()||0==Q&&_.ExchangeName==a.gT.C_S_NSE_EXCHANGE_TEXT||100==Q&&_.ExchangeName==a.gT.C_S_BSE_EXCHANGE_TEXT?"No":99==Q&&_.ExchangeName==a.gT.C_S_NSE_EXCHANGE_TEXT||0==Q&&_.ExchangeName==a.gT.C_S_BSE_EXCHANGE_TEXT?"Yes":"Yes("+Q+")",this.ISIN=""==W.ISIN?"NA":W.ISIN,this.MarketLot=W.MarketLot,this.PriceTick=W.PriceTick,this.IssuedCapital=W.IssuedCapital,this.FaceValue=W.FaceValue,this.QtyFreeze=W.QtyFreeze,this.Margin=W.Margin,this.Multiplier=W.Multiplier,this.PreOpen=W.PreOpen,this.SPOS=W.SPOS,this.CallAuction=W.CallAuction,this.isCAVisible=""==W.CallAuction,this.MktSegId==a.gT.C_V_NSE_CASH.toString()||this.MktSegId==a.gT.C_V_BSE_CASH.toString()||this.MktSegId==a.gT.C_V_MSX_CASH.toString()||(this.showSettlmtCycle=!1),this.SettlmtCycle=W.sSettlementCycle,this.StartDate=W.StartDate,this.EndDate=W.EndDate,this.ExDate=W.ExDate,this.Purpose=""==W.Purpose?"NA":W.Purpose,this.noDataFound=!1}else this.noDataFound=!0}catch(H){this.logService.WriteLog("Exception: "+H.message,"GetSecInfo","securityinfo.component.ts","")}}}return f.\u0275fac=function(P){return new(P||f)(n.\u0275\u0275directiveInject(l.m),n.\u0275\u0275directiveInject(a.OE))},f.\u0275cmp=n.\u0275\u0275defineComponent({type:f,selectors:[["app-securityInfo"]],inputs:{Scrip:"Scrip"},decls:9,vars:3,consts:[["id","dvSecurityInfo",1,"SecurityInfo","nicescroll"],[1,"nicescroll","secu_scroll"],[1,"SecCont-Info","SecurityInfo-loader-wrap"],[4,"ngIf"],["class","nodatafound",4,"ngIf"],[1,"clear"],["id","lookUpSI",1,"lookUpSI",2,"display","none"],["id","closeSI","data-bind","click: closeSILookup",1,"close_look",2,"display","none"],[3,"type"],[1,"nodatafound"],[1,"SecCont-Top"],[1,"SecCont-CodeAsst"],[1,"sep"],[1,"contact-tab-wrap"],["cp","Security Details"],[1,"SecCont-details"],[1,"sep",3,"hidden"],[3,"hidden"],["cp","Book Closure/Record Date"],[1,"right-arrow"]],template:function(P,_){1&P&&(n.\u0275\u0275elementStart(0,"div",0),n.\u0275\u0275elementStart(1,"div",1),n.\u0275\u0275elementStart(2,"div",2),n.\u0275\u0275template(3,h,2,1,"div",3),n.\u0275\u0275template(4,o,3,0,"div",4),n.\u0275\u0275template(5,m,165,64,"div",3),n.\u0275\u0275elementEnd(),n.\u0275\u0275element(6,"div",5),n.\u0275\u0275element(7,"div",6),n.\u0275\u0275element(8,"div",7),n.\u0275\u0275elementEnd(),n.\u0275\u0275elementEnd()),2&P&&(n.\u0275\u0275advance(3),n.\u0275\u0275property("ngIf",_.showProgressBar),n.\u0275\u0275advance(1),n.\u0275\u0275property("ngIf",_.noDataFound),n.\u0275\u0275advance(1),n.\u0275\u0275property("ngIf",!_.showProgressBar&&!_.noDataFound))},directives:[g.O5,b.R],pipes:[p.B],encapsulation:2}),f})()},6340:(je,ke,x)=>{x.d(ke,{d:()=>W});var a=x(1705),T=x(3305),G=x(2741),n=x(4471),l=x(6345),g=x(6274),b=x(6228),p=x(823),h=x(3045),o=x(3324),u=x(688);function m(N,Q){1&N&&(G.\u0275\u0275elementStart(0,"span"),G.\u0275\u0275text(1," %"),G.\u0275\u0275elementEnd())}function e(N,Q){if(1&N&&(G.\u0275\u0275elementStart(0,"li",9),G.\u0275\u0275elementStart(1,"span",10),G.\u0275\u0275text(2),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementStart(3,"span",11),G.\u0275\u0275text(4),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementStart(5,"span",11),G.\u0275\u0275text(6),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementStart(7,"span",11),G.\u0275\u0275text(8),G.\u0275\u0275template(9,m,2,0,"span",12),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd()),2&N){const H=Q.$implicit;G.\u0275\u0275advance(2),G.\u0275\u0275textInterpolate1(" ",H.ScripDetail.MWSecurityDescShort,""),G.\u0275\u0275advance(1),G.\u0275\u0275property("className",H.SymbolTrend),G.\u0275\u0275advance(1),G.\u0275\u0275textInterpolate(H.LTP),G.\u0275\u0275advance(1),G.\u0275\u0275property("className",H.SymbolTrend),G.\u0275\u0275advance(1),G.\u0275\u0275textInterpolate(H.NetChangeInRs),G.\u0275\u0275advance(1),G.\u0275\u0275property("className",H.SymbolTrend),G.\u0275\u0275advance(1),G.\u0275\u0275textInterpolate1("",H.PercNetChange," "),G.\u0275\u0275advance(1),G.\u0275\u0275property("ngIf",""!=H.PercNetChange)}}function f(N,Q){if(1&N&&(G.\u0275\u0275elementStart(0,"marquee",6),G.\u0275\u0275elementStart(1,"ul",7),G.\u0275\u0275template(2,e,10,8,"li",8),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd()),2&N){const H=G.\u0275\u0275nextContext();G.\u0275\u0275advance(2),G.\u0275\u0275property("ngForOf",H.scripList)("ngForTrackBy",H.trackById)}}function i(N,Q){if(1&N&&(G.\u0275\u0275elementStart(0,"li",9),G.\u0275\u0275elementStart(1,"span",10),G.\u0275\u0275text(2),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd()),2&N){const H=Q.$implicit;G.\u0275\u0275advance(2),G.\u0275\u0275textInterpolate1(" ",H.HL,"")}}function P(N,Q){if(1&N&&(G.\u0275\u0275elementStart(0,"marquee",6),G.\u0275\u0275elementStart(1,"ul",7),G.\u0275\u0275template(2,i,3,1,"li",13),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd()),2&N){const H=G.\u0275\u0275nextContext();G.\u0275\u0275advance(2),G.\u0275\u0275property("ngForOf",H.newsList)}}function _(N,Q){if(1&N&&(G.\u0275\u0275elementStart(0,"mat-option",16),G.\u0275\u0275text(1),G.\u0275\u0275elementEnd()),2&N){const H=Q.$implicit;G.\u0275\u0275property("value",H),G.\u0275\u0275advance(1),G.\u0275\u0275textInterpolate1(" ",H.ProfileNameDisplay," ")}}function k(N,Q){if(1&N&&(G.\u0275\u0275elementStart(0,"mat-optgroup",14),G.\u0275\u0275template(1,_,2,2,"mat-option",15),G.\u0275\u0275elementEnd()),2&N){const H=Q.$implicit;G.\u0275\u0275property("label",H.Name),G.\u0275\u0275advance(1),G.\u0275\u0275property("ngForOf",H.Data)}}let W=(()=>{class N{constructor(H,V,w,Z,F,re,X){this.httpService=H,this.zone=V,this.pubsubService=w,this.tradingService=Z,this.logService=F,this.ref=re,this.tradingSharedService=X,this.profileList=[],this.profile=new T.N,this.scripList=[],this.ArrSubTokens=[],this.SVcolProfileId="3",this.newsList=[],this.isNewsShown=!0,this.locStorageUserTicker="userTickerPreference_"+a.xB.User.
1UserId,this.newScripAdded=!1,this.tickerList=[],this.onTickerChangeFlag=!0}ngOnInit(){try{var H={},V=[],w={};"ON"==a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY&&(H.Name="News Ticker",w.ProfileId="-1000",w.ProfileNameDisplay="News",V.push(w),H.Data=V,this.tickerList.push(H),this.selectedTicker=this.tickerList[0].Data[0]),(H={}).Name="Price Ticker",H.Data=[],this.tickerList.push(H),this.selectedTicker=this.tickerList[0].Data[0],a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY==a.gT.C_S_ON&&this.getNewsList(),this.LoadProfileList(),this.SubScribeMessages()}catch(Z){this.logService.WriteLog("Exception: "+Z.message,"ngOnInit()","ticker.component.ts","")}}ngOnDestroy(){(null!=this.ScripKey||null!=this.ScripKey)&&this.ScripKey.length>0&&this.tradingSharedService.sendTouchLineRequest(this.ScripKey,2)}detectChange(){this.ref.markForCheck()}LoadProfileList(){try{this.tradingService.getProfileList().subscribe(H=>{if(null!=a.xB.User.ProfileList){this.profileList=a.xB.User.ProfileList[0].Data,this.profile.ProfileList=a.xB.User.ProfileList[0].Data,"ON"==a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY?this.tickerList[1].Data=this.profileList:this.tickerList[0].Data=this.profileList;let V="";null!=localStorage.getItem(this.locStorageUserTicker)&&(V="-1000"==localStorage.getItem(this.locStorageUserTicker)&&a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY!=a.gT.C_S_ON?"":localStorage.getItem(this.locStorageUserTicker)),this.selectedTicker=-1==this.profileList.findIndex(w=>w.ProfileId==V)?"-1000"==V||-1==this.profileList.findIndex(w=>100==w.ProfileId)||""==V&&a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY==a.gT.C_S_ON?this.tickerList[0].Data[0]:this.profileList[this.profileList.findIndex(w=>100==w.ProfileId)]:this.profileList[this.profileList.findIndex(w=>w.ProfileId==V)],a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY==a.gT.C_S_ON&&this.onTickerChange(),this.detectChange()}})}catch(H){this.logService.WriteLog("Exception: "+H.message,"LoadProfileList()","ticker.component.ts","")}}LoadProfileScrips(H,V,w,Z){try{if(this.profile.SelectedProfileId!=H||"300"==H||Z){(null!=this.ScripKey||null!=this.ScripKey)&&this.ScripKey.length>0&&this.tradingSharedService.sendTouchLineRequest(this.ScripKey,2),this.scripList=[],this.ScripKey=[];for(var F=0,re=this.profile.ProfileList.length;F<re;F++)for(var X=0,ne=this.profile.ProfileList[F].length;X<ne;X++)H==this.profile.ProfileList[F][X].ProfileId?(this.profile.ProfileList[F][X].ProfileClass="profileSelected",this.profile.SelectedProfile=this.profile.ProfileList[F][X],this.profileModel=this.profile.ProfileList[F][X]):this.profile.ProfileList[F][X].ProfileClass="";this.profile.SelectedProfileId=H,this.profile.SelectedProfileName=V,this.profile.ProfileNameDisplay=V,this.tradingSharedService.getProfileScrips(H,this.profile.SelectedProfileName,w).subscribe(he=>{this.fn_GetProfileScripsCompleted(he)})}}catch(he){this.logService.WriteLog("Exception: "+he.message,"LoadProfileScrips()","ticker.component.ts","")}}fn_GetProfileScripsCompleted(H){try{if(H.ResponseStatus&&null!=H.ResponseObject){var w;this.scripList=[],this.ScripKey=[];let F=this.tradingSharedService.parseProfileScrips(H.ResponseObject.Table1);w=F.tempMWList,this.ScripKey=F.scripKey,this.newScripAdded&&(this.pubsubService.publish("RELOADMWPROFILE",H),this.newScripAdded=!1),w.length>0&&(this.scripList=w,this.tradingSharedService.sendTouchLineRequest(this.ScripKey,1),this.scripList.length>0&&(this.scripList[0].SelectedMWDataClass="ht03 odd mdetail mwgrid_selected")),this.onTickerChangeFlag=!0}}catch(F){this.logService.WriteLog("Exception: "+F.message,"fn_GetProfileScripsCompleted()","ticker.component.js","")}}SubScribeMessages(){this.ArrSubTokens=[];var H=this.pubsubService.subscribe("MTLRES",(V,w)=>{this.ReceiveMWResponse(w)});this.ArrSubTokens.push(H),this.pubsubService.subscribe("PROFCHANGE",(V,w)=>{this.zone.run(()=>{this.selectedTicker.ProfileId==w.ProfileId?(this.newScripAdded=!0,this.LoadProfileScrips(w.ProfileId,w.ProfileName,"1",!0)):this.pubsubService.publish("LOADPROFILEDATA",w.ProfileId)})}),this.pubsubService.subscribe("PROFLISTCHANGE",()=>{this.zone.run(()=>{var V=!1,w=this.selectedTicker.ProfileId;if(this.profileList=a.xB.User.ProfileList[0].Data,this.profile.ProfileList=a.xB.User.ProfileList[0].Data,"ON"==a.xB.dConfigMaster.FINALYTICS_NEWS_TICKER_VISIBILITY?this.tickerList[1].Data=this.profileList:this.tickerList[0].Data=this.profileList,"-1000"!=this.selectedTicker.ProfileId){for(var Z=0;Z<a.xB.User.ProfileList[0].Data.length;Z++)if(a.xB.User.ProfileList[0].Data[Z].ProfileId==w){this.selectedTicker=this.profileList[Z],V=!0;break}V||(this.selectedTicker=this.profileList[0]),this.selectedTicker.ProfileId!=w&&this.LoadProfileScrips(this.selectedTicker.ProfileId,this.selectedTicker.ProfileName,this.SVcolProfileId)}this.detectChange()})}),H=this.pubsubService.subscribe("NEWSRES",(V,w)=>{this.zone.run(()=>{var Z={HL:"",NewsDateTime:"",NewsId:""};Z.HL=w.Headline,Z.NewsId=w.NewsId,this.newsList.splice(0,0,Z)})}),this.ArrSubTokens.push(H)}ReceiveMWResponse(H){try{if(null!=H){try{for(var V=this.scripList.length;V--;)if(this.scripList[V].ScripDetail.ScripDet.Token==H.Scrip.Token&&this.scripList[V].ScripDetail.ScripDet.MktSegId==H.Scrip.MktSegId){this.scripList[V].OpenPrice=H.OpenPrice,this.scripList[V].HighPrice=H.HighPrice,this.scripList[V].LowPrice=H.LowPrice,this.scripList[V].ClosePrice=H.ClosePrice,this.scripList[V].LTP=H.LTP,this.scripList[V].PercNetChange=H.PercNetChange,H.NetChangeInRs&&(this.scripList[V].NetChangeInRs=H.NetChangeInRs);break}}catch(w){this.logService.WriteLog("Exception: "+w.message,"ReceiveMWResponse()","ticker.component.ts","")}this.detectChange()}}catch(w){this.logService.WriteLog("Exception: "+w.message,"ReceiveMWResponse()","ticker.component.ts","")}}Subscribe(){this.SubScribeMessages(),(null!=this.ScripKey||null!=this.ScripKey)&&this.ScripKey.length>
10&&this.tradingSharedService.sendTouchLineRequest(this.ScripKey,1)}trackById(H,V){return V.Token}onTickerChange(){this.onTickerChangeFlag=!1;try{"-1000"==this.selectedTicker.ProfileId?(this.isNewsShown=!0,this.onTickerChangeFlag=!0,(null!=this.ScripKey||null!=this.ScripKey)&&this.ScripKey.length>0&&this.tradingSharedService.sendTouchLineRequest(this.ScripKey,2)):(this.isNewsShown=!1,this.onTickerChangeFlag=!0,this.LoadProfileScrips(this.selectedTicker.ProfileId,this.selectedTicker.ProfileName,this.SVcolProfileId)),localStorage.setItem(this.locStorageUserTicker,this.selectedTicker.ProfileId)}catch(H){this.logService.WriteLog("Exception: "+H.message,"onTickerChange()","ticker.component.ts","")}}getNewsList(){try{this.httpService.postData(a.xB.tradingAPIUrl,"GetNewsData",{UserID:a.xB.User.UserId,GroupID:a.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",NewsCat:a.xB.User.NewsCategories,MktSegId:"",AssetTkn:"",ISIN:"",ScripTkn:""}).subscribe(V=>{this.getNewsDataCompleted(V)})}catch(V){this.logService.WriteLog("Exception: "+V.message,"getNewsList()","ticker.component.ts","")}}getNewsDataCompleted(H){try{if(this.newsList=[],null!=H.ResponseObject&&H.ResponseObject.Table1.length>0)for(var V=0;V<H.ResponseObject.Table1.length;V++)this.newsList.push(H.ResponseObject.Table1[V])}catch(Z){this.logService.WriteLog("Exception: "+Z.message,"getNewsDataCompleted()","ticker.component.ts")}}}return N.\u0275fac=function(H){return new(H||N)(G.\u0275\u0275directiveInject(a.OE),G.\u0275\u0275directiveInject(G.NgZone),G.\u0275\u0275directiveInject(a.hC),G.\u0275\u0275directiveInject(n.D),G.\u0275\u0275directiveInject(a.mQ),G.\u0275\u0275directiveInject(G.ChangeDetectorRef),G.\u0275\u0275directiveInject(l.F))},N.\u0275cmp=G.\u0275\u0275defineComponent({type:N,selectors:[["app-ticker"]],decls:10,vars:6,consts:[[1,"Ticker_Watch"],["class","marquee_wrapper","onmouseover","this.stop();","onmouseout","this.start();",4,"ngIf"],[1,"button-whatsnewbg"],[1,"Select_Ticker",3,"matTooltip","matTooltipPosition"],["disableOptionCentering","true",3,"ngModel","ngModelChange","selectionChange"],[3,"label",4,"ngFor","ngForOf"],["onmouseover","this.stop();","onmouseout","this.start();",1,"marquee_wrapper"],[1,"ulmarquee"],["class","limarquee",4,"ngFor","ngForOf","ngForTrackBy"],[1,"limarquee"],[1,"marspan1"],[3,"className"],[4,"ngIf"],["class","limarquee",4,"ngFor","ngForOf"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(H,V){1&H&&(G.\u0275\u0275elementStart(0,"div",0),G.\u0275\u0275template(1,f,3,2,"marquee",1),G.\u0275\u0275template(2,P,3,1,"marquee",1),G.\u0275\u0275elementStart(3,"div",2),G.\u0275\u0275text(4,"\xa0"),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementStart(5,"div",3),G.\u0275\u0275elementStart(6,"mat-form-field"),G.\u0275\u0275elementStart(7,"mat-select",4),G.\u0275\u0275listener("ngModelChange",function(Z){return V.selectedTicker=Z})("selectionChange",function(){return V.onTickerChange()}),G.\u0275\u0275elementStart(8,"span"),G.\u0275\u0275template(9,k,2,2,"mat-optgroup",5),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd(),G.\u0275\u0275elementEnd()),2&H&&(G.\u0275\u0275advance(1),G.\u0275\u0275property("ngIf",!V.isNewsShown&&V.scripList.length>0),G.\u0275\u0275advance(1),G.\u0275\u0275property("ngIf",V.isNewsShown&&V.newsList.length>0),G.\u0275\u0275advance(3),G.\u0275\u0275property("matTooltip","Ticker Type")("matTooltipPosition","after"),G.\u0275\u0275advance(2),G.\u0275\u0275property("ngModel",V.selectedTicker),G.\u0275\u0275advance(2),G.\u0275\u0275property("ngForOf",V.tickerList))},directives:[g.O5,b.gM,p.KE,h.gD,o.JJ,o.On,g.sg,u.Nv,u.ey],encapsulation:2,changeDetection:0}),N})()},1534:(je,ke,x)=>{x.r(ke),x.d(ke,{TradingModule:()=>Ks});var a=x(3324),T=x(4143),G=x(5991),n=x(1705),l=x(5569),g=x(4511),b=x(5349),p=x(9162),h=x(8497),o=x(8407),u=x(109),m=x(5607),e=x(2741),f=x(2232),i=x(274),P=x(6345),_=x(823),k=x(3045),W=x(6274),N=x(9018),Q=x(7617),H=x(688),V=x(5117);function w(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",14),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit,r=e.\u0275\u0275nextContext();e.\u0275\u0275property("value",t)("disabled",!r.EnableToProduct),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.sProdTxt)}}function Z(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"table"),e.\u0275\u0275elementStart(1,"tr",2),e.\u0275\u0275elementStart(2,"td",16),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.ExchangeName),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.SegWisePOSConversionQty)}}function F(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,Z,6,2,"table",15),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.lstPOSConvDetail)}}function re(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.validationError," ")}}
1function X(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div",17),e.\u0275\u0275element(1,"nn-progressbar",18),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}let ne=(()=>{class S{constructor(t,r,s,d,I,M,U){this.httpService=t,this.logService=r,this.pubsubService=s,this.zone=d,this.dialogService=I,this.menuManagerService=M,this.tradingSharedService=U,this.lstProductType=[],this.FromProd="",this.EnableToProduct=!0,this.EnableQuantity=!0,this.EnableValue=!0,this.SelectedQty="0",this.ModifiedQuantity=0,this.ArrSelQty=[],this.ProductTypeVal="",this.NetQuantity=0,this.BuyQuantity=0,this.SellQuantity=0,this.Lot=0,this.MktSegId=0,this.ddlToProd="",this.dcProductTypesegWise=new n.aM,this.closeDialog=new e.EventEmitter,this.combinedData=[],this.Qty1=0,this.Qty2=0,this.Qty3=0,this.BuySell="",this.lstPOSConvDetail=[],this.eDISMode="",this.disableBackground=!1,this.MTFPrepledge=n.xB.dConfigMaster.MTF_PREPLEDGE,this.subTokens=[]}ngOnInit(){try{null!=this.context&&this.onPositionConversionInit(this.context.params)}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","positionconv.component.ts","")}}ngOnDestroy(){this.UnSubscribeMessage()}UnSubscribeMessage(){for(var t=0;t<this.subTokens.length;t++)this.pubsubService.unsubscribe(this.subTokens[t]);this.subTokens=[]}onPositionConversionInit(t){try{var r=t.Selectedrow;switch(this.isInteropAllow=t.isInteropAllowed,this.combinedData=t.CombineTokenDetails,this.PosDetails=r,null==this.PosDetails.AvgBuyPrice?(this.NetQuantity=Math.abs(parseInt(this.PosDetails.PendingQty)-parseInt(this.PosDetails.Qty)),this.BuyQuantity=Math.abs(parseInt(this.PosDetails.PendingQty)-parseInt(this.PosDetails.Qty)),this.SellQuantity=Math.abs(parseInt(this.PosDetails.PendingQty)-parseInt(this.PosDetails.Qty)),this.BuySell="SELL"==this.PosDetails.BuySell?"2":"1"):(this.NetQuantity=Math.abs(this.PosDetails.NetQty),this.BuyQuantity=Math.abs(this.PosDetails.BuyQty),this.SellQuantity=Math.abs(this.PosDetails.SellQty),this.BuySell=this.PosDetails.NetQty>0?n.gT.C_V_ORDER_BUY.toString():n.gT.C_V_ORDER_SELL.toString()),this.PosDetails.SelectedQty){case n.gT.C_V_TAG_NETQTY.toString():this.SelectedQty="0",this.ModifiedQuantity=Math.abs(this.NetQuantity);break;case n.gT.C_V_TAG_BUYQTY.toString():this.SelectedQty="1",this.ModifiedQuantity=Math.abs(this.BuyQuantity);break;case n.gT.C_V_TAG_SELLQTY.toString():this.SelectedQty="2",this.ModifiedQuantity=Math.abs(this.SellQuantity);break;default:this.SelectedQty="0",this.ModifiedQuantity=Math.abs(this.NetQuantity)}if(null==this.PosDetails.AvgBuyPrice?(this.MktSegId=o.X.GetMappedMarketSegmentId(parseInt(this.PosDetails.scrip.ScripDet.MktSegId)),this.Lot=this.PosDetails.scrip.MarketLot):(this.MktSegId=this.PosDetails.SegmentId,this.Lot=this.PosDetails.RegularLot),this.ArrSelQty=[{key:"Net Quantity",value:"0"},{key:"Buy Quantity",value:"1"},{key:"Sell Quantity",value:"2"}],this.SelQty=this.ArrSelQty[0],this.PosDetails.Value=o.X.GetProductTypeValue(this.PosDetails.ProductType),this.ProductTypeVal=this.PosDetails.Value,this.FromProd=o.X.GetProductType(this.PosDetails.Value,o.X.GetMarketSegmentID(parseInt(this.PosDetails.SegmentId)),n.xB.User.ManagerVersion,""),null!=this.combinedData&&null!=this.combinedData){this.isCombinedData=!0,this.lstPOSConvDetail=[];for(var d=0;d<this.combinedData.length;d++){var I=parseInt(this.combinedData[d].SegmentId);this.templiststring=[],this.templiststring=this.getProductTypes(I,this.PosDetails.Value);for(var M=0;M<this.templiststring.length;M++)this.dcProductTypesegWise.containsKey(this.templiststring[M].sProdVal)||this.dcProductTypesegWise.add(this.templiststring[M].sProdVal,this.templiststring[M].sProdTxt);this.CalculateIntertOPNetQTY(d,this.combinedData[d])}if(this.dcProductTypesegWise.count()>0){for(var U in this.lstProductType=[],this.dcProductTypesegWise)this.dcProductTypesegWise.containsKey(U)&&"length"!=U&&this.lstProductType.push({sProdVal:U,sProdTxt:this.dcProductTypesegWise[U]});this.templiststring=[],this.templiststring=this.lstProductType,this.ddlToProd=this.templiststring[0]}}else this.templiststring=this.getProductTypes(this.MktSegId,this.PosDetails.Value),this.ddlToProd=this.templiststring[0];0!=this.templiststring?(this.ToProdTxt=this.templiststring[0].sProdTxt,this.ToProdVal=this.templiststring[0].sProdVal):(this.ToProdTxt="",this.ToProdVal=""),this.OnChangeQty(this.ArrSelQty[0],null==this.PosDetails.AvgBuyPrice?1:2),this.BOGatewayOrderNo=this.PosDetails.GatewayordNo,this.PosDetails.Value==n.gT.C_S_PRODUCTTYPE_BRACKET_VALUE&&(this.EnableToProduct=!1,this.EnableQuantity=!1,this.EnableValue=!1)}catch(Ie){this.logService.WriteLog("Exception: "+Ie.message,"onPositionConversionInit()","positionconv.component.ts","")}}onToProductChange(t){try{this.ddlToProd=t,this.ToProdTxt=t.sProdTxt,this.ToProdVal=t.sProdVal}catch(r){this.logService.WriteLog("Exception: "+r.message,"onToProductChange()","positionconv.component.ts","")}}onBlurMethod(){if(this.isDataValid(),this.lstPOSConvDetail=[],null!=this.combinedData&&null!=this.combinedData)for(var t=0;t<this.combinedData.length;t++)this.CalculateIntertOPNetQTY(t,this.combinedData[t]);let r=Math.pow(10,0),d=(isNaN(this.ModifiedQuantity)?0:this.ModifiedQuantity)*r/r;(0==d||isNaN(d))&&(d=0),this.ModifiedQuantity=d.toFixed(0)}onSubmit(){1==this.isDataValid()&&(this.ProductTypeVal==n.gT.C_S_PRODUCTTYPE_BRACKET_VALUE?this.dialogService.confirm(n.xB.dMsgMaster.NNSL369,"Yes","No").subscribe(t=>{t?this.yesCallbackPositionConversion():this.noCallbackPositionConversion()}):this.ToProdVal==n.gT.C_S_PRODUCTTYPE_MTF_VALUE?this.tradingSharedService.getScripDetails(this.segmentId,this.PosDetails.scrip.ScripDet.Token,!1,"","").subscribe(t=>{const r=t;this.ScripSymbol=r.Symbol,this.ScripISIN=r.ISIN,null!=this.ScripSymbol&&null!=this.ScripISIN&&null!=this.ModifiedQuantity&&"1"==this.BuySell&&"ON"==this.MTFPrepledge&&n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_PLEDGE)?this.checkMTF():this.yesCallbackPositionConversion()}):this.CheckForEDIS().then(()=>{this.multiscripRequestSubscription().then(t=>{this.exchangeCode=this.PosDetails.isCombined?"1"==this.PosDetails.prefMktSegId?n.gT.C_S_NSE_EXCHANGE_TEXT:n.gT.C_S_BSE_EXCHANGE_TEXT:this.PosDetails.Exch;const r={eDISMode:this.eDISMode,exchange:this.exchangeCode,scrip:this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE?{instrument:n.gT.C_S_INSTRUMENT_EQUITIES_TEXT,securityDesc:this.eDISParams.SecurityDesc,isin:this.eDISParams.ISIN,quantity:this.eDISParams.eDISQty,ProductType:this.tradingSharedService.GetProductTypeForEDIS(this.ToProdTxt)}:null};
1this.disableBackground=this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE,this.tradingSharedService.GoForEDISOnline(r,t?t.eDISReqDetails:[]).then(s=>{s&&(this.eDISParams.eDISTxnRefNo=s.refTxnNo,n.xB.User.Depository==n.gT.C_S_EDIS_MODE_CDSL?(this.eDISParams.ApprovedQuantity=s.ApprovedQuantity,this.eDISParams.TotalAvailableQty=s.TotalAvailableQty):n.xB.User.Depository==n.gT.C_S_EDIS_MODE_NSDL&&(this.eDISParams.ApprovedQuantity=this.eDISParams.eDISQty,this.eDISParams.TotalAvailableQty=s.TotalAvailableQty)),this.disableBackground=!1,this.sendPositionConversionRequest()}).catch(s=>{this.disableBackground=!1})}).catch(t=>{console.log(t)})}))}yesCallbackPositionConversion(){this.sendPositionConversionRequest()}noCallbackPositionConversion(){}isDataValid(){try{if(void 0===this.ToProdTxt||""==this.ToProdTxt)return this.isValidData=!1,this.validationError="To Product cannot be empty",!1;var r=0;if("0"==this.SelQty.value?r=this.NetQuantity:"1"==this.SelQty.value?r=this.BuyQuantity:"2"==this.SelQty.value&&(r=this.SellQuantity),!/^(\s*|\d+)$/.test(r.toString()))return this.isValidData=!1,this.validationError="Quantity is invaild",!1;if(!(parseInt(this.ModifiedQuantity)<=r)||parseInt(this.ModifiedQuantity)<=0)return this.validationError=this.ModifiedQuantity<=1?"Please enter Quantity between 1 and "+r:"Quantity greater than Net Quantity",this.isValidData=!1,!1;if(this.isValidData=!0,this.MktSegId==n.gT.C_V_MAPPED_BSE_DERIVATIVES||this.MktSegId==n.gT.C_V_MAPPED_NSE_DERIVATIVES||this.MktSegId==n.gT.C_V_MAPPED_NCDEX_DERIVATIVES||this.MktSegId==n.gT.C_V_MAPPED_NSE_CASH||this.MktSegId==n.gT.C_V_COMBINED_FNO){if(parseInt(this.ModifiedQuantity)%parseInt(this.Lot)!=0)return this.isValidData=!1,this.validationError="Entered quantity not in multiples of Market Lot",!1;this.isValidData=!0}return 0==parseInt(this.ModifiedQuantity)?(this.isValidData=!1,this.validationError="Quantity / Lot should be greater than 0",!1):this.isValidData}catch(s){this.logService.WriteLog(s.message,"isDataValid()","positionconv.component.ts","")}}AfterValidateConfirmOrder(){if(this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE)var t={depository:n.xB.User.Depository,isin:this.eDISParams.ISIN,dpId:n.xB.User.BeneficiaryId.substring(0,n.xB.User.BeneficiaryId.indexOf("#")),totalAvailableQty:this.eDISParams.TotalAvailableQty,approvedFree:this.eDISParams.ApprovedQuantity,requestType:this.PosDetails.reqType,edisReqId:this.eDISParams.eDISTxnRefNo,mktsegid:this.PosDetails.scrip.ScripDet.MktSegId,token:this.PosDetails.scrip.ScripDet.Token,cliOrderNo:"0",usercode:n.xB.User.UserCode,productCode:n.gT.C_S_PRODUCTNAME_NETNET_HTML5_TABLET_SL,orderQty:this.ModifiedQuantity};this.httpService.postData(n.xB.tradingAPIUrl,"InsertEDISReqResponse",t).subscribe(r=>{})}sendPositionConversionRequest(){try{if(this.isCombinedData){if(this.lstPOSConvDetail.length>0)for(var t=0;t<this.lstPOSConvDetail.length;t++)if(parseInt(this.lstPOSConvDetail[t].SegWisePOSConversionQty)>0){var r=this.createPosConvRequestforCombinedSeg(parseInt(this.lstPOSConvDetail[t].SegWisePOSConversionQty),this.lstPOSConvDetail[t].objCombinedData);this.pubsubService.publish("POSCONVREQ",r)}}else{var s=this.createPosConvRequest();this.pubsubService.publish("POSCONVREQ",s)}this.closeDialog.emit(!0),this.dialogService.alert("Position conversion request sent").subscribe(d=>{this.pubsubService.publish("NPRFRSH","")})}catch(d){this.logService.WriteLog(d.message,"sendPositionConversionRequest()","positionconv.component.ts","")}}createPosConvRequest(){var t={MktSegID:"",Token:"",Symbol:"",Series:"",Quantity:0,BuySell:"",ProductType:"",SourceProductType:"",LegIndicator:"",BOGatewayOrderNo:"",TraceNo:""};try{null==this.PosDetails.AvgBuyPrice?(t.MktSegID=o.X.GetMarketSegmentID(this.MktSegId),t.Token=this.PosDetails.scrip.ScripDet.Token,t.Symbol=this.PosDetails.Sym,t.Series=this.PosDetails.Series,t.Quantity=this.ModifiedQuantity,"0"==this.SelQty.value?t.BuySell=this.BuySell:"1"==this.SelQty.value?t.BuySell=n.gT.C_V_ORDER_BUY.toString():"2"==this.SelQty.value&&(t.BuySell=n.gT.C_V_ORDER_SELL.toString()),t.ProductType=this.ToProdVal,t.SourceProductType=this.ProductTypeVal,t.LegIndicator=this.PosDetails.LegIndicator,t.BOGatewayOrderNo=this.BOGatewayOrderNo,this.PosDetails.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(t.BuySell="BUY"==this.PosDetails.BuySell?n.gT.C_V_ORDER_BUY.toString():n.gT.C_V_ORDER_SELL.toString())):(t.MktSegID=o.X.GetMarketSegmentID(this.MktSegId),t.Token=this.PosDetails.Token,t.Symbol=this.PosDetails.Symbol,t.Series=this.PosDetails.Series,t.Quantity=this.ModifiedQuantity,"0"==this.SelQty.value?t.BuySell=this.BuySell:"1"==this.SelQty.value?t.BuySell=n.gT.C_V_ORDER_BUY.toString():"2"==this.SelQty.value&&(t.BuySell=n.gT.C_V_ORDER_SELL.toString()),t.ProductType=this.ToProdVal,t.SourceProductType=this.ProductTypeVal,t.LegIndicator=this.PosDetails.LegIndicator,t.BOGatewayOrderNo=this.PosDetails.BOGatewayOrderNo),t.TraceNo=n.vV.generateTraceNo()}catch(r){this.logService.WriteLog(r.message,"createPosConvRequest
1()","positionconv.component.ts","")}return t}createPosConvRequestforCombinedSeg(t,r){try{var s={MktSegID:"",Token:"",Symbol:"",Series:"",Quantity:0,BuySell:"",ProductType:"",SourceProductType:"",LegIndicator:"",BOGatewayOrderNo:"",TraceNo:""};s.MktSegID=o.X.GetMarketSegmentID(parseInt(r.SegmentId)),s.Token=r.Token,s.Symbol=r.Symbol,s.Series=r.Series,s.Quantity=Math.abs(t),"0"==this.SelQty.value?s.BuySell=this.PosDetails.NetQty<0?n.gT.C_V_ORDER_SELL.toString():n.gT.C_V_ORDER_BUY.toString():"1"==this.SelQty.value?s.BuySell=n.gT.C_V_ORDER_BUY.toString():"2"==this.SelQty.value&&(s.BuySell=n.gT.C_V_ORDER_SELL.toString()),s.ProductType=this.ToProdVal,s.SourceProductType=this.ProductTypeVal,s.LegIndicator=this.PosDetails.LegIndicator,s.BOGatewayOrderNo=this.PosDetails.BOGatewayOrderNo,s.TraceNo=n.vV.generateTraceNo()}catch(d){this.logService.WriteLog(d.message,"createPosConvRequestforCombinedSeg()","positionconv.component.ts","")}return s}getProductTypes(t,r){try{var s;s=n.xB.ExchManager.PopulateProductTypes(o.X.GetExchangeName(o.X.GetMarketSegmentID(parseInt(t))),o.X.GetMarketSegmentID(parseInt(t)),!1);for(var d=0;d<s.length;d++){var I=o.X.GetProductTypeValue(s[d]),M=s[d];r!=I&&(r==n.gT.C_S_PRODUCTTYPE_BRACKET_VALUE?I==n.gT.C_S_PRODUCTTYPE_DELIVERY_CARRYFORWARD_VALUE&&this.lstProductType.push({sProdVal:I,sProdTxt:M}):I!=n.gT.C_S_PRODUCTTYPE_MP_VALUE&&I!=n.gT.C_S_PRODUCTTYPE_BRACKET_VALUE&&this.lstProductType.push({sProdVal:I,sProdTxt:M}))}}catch(U){this.logService.WriteLog("Exception: "+U.message,"getProductTypes()","positionconv.component.ts","")}return this.lstProductType}OnChangeQty(t,r){try{this.SelQty=t,1==r?this.PosDetails.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?("0"==t.value||"1"==t.value||"2"==t.value)&&(this.ModifiedQuantity=Math.abs(parseInt(this.PosDetails.BOPosConvQty))):("0"==t.value||"1"==t.value||"2"==t.value)&&(this.ModifiedQuantity=Math.abs(parseInt(this.PosDetails.PendingQty)-parseInt(this.PosDetails.Qty))):this.PosDetails.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?("0"==t.value||"1"==t.value||"2"==t.value)&&(this.ModifiedQuantity=Math.abs(parseInt(this.PosDetails.BOPosConvQty))):"0"==t.value?this.ModifiedQuantity=Math.abs(this.PosDetails.NetQty):"1"==t.value?this.ModifiedQuantity=Math.abs(this.PosDetails.BuyQty):"2"==t.value&&(this.ModifiedQuantity=Math.abs(this.PosDetails.SellQty))}catch(s){this.logService.WriteLog("Exception: "+s.message,"OnChangeQty()","positionconv.component.ts","")}}CalculateIntertOPNetQTY(t,r){try{if(null!=r&&""!=r){var s,d=0,I="",M=parseInt(r.SegmentId),U=Math.abs(r.allowedNetQty);s=""!=this.ModifiedQuantity&&null!=this.ModifiedQuantity&&null!=this.ModifiedQuantity&&this.ModifiedQuantity>0?parseInt(this.ModifiedQuantity):this.NetQuantity,0==t&&s>0&&U>0?(this.Qty1=U>=s?s:U<s?U:s,this.Qty1>0&&(d=this.Qty1,I=o.X.GetExchangeName(o.X.GetMarketSegmentID(M))+" Qty",this.lstPOSConvDetail.push({MarketSegmentId:M,ExchangeName:I,SegWisePOSConversionQty:d,objCombinedData:r}))):1==t&&s>0&&U>0?(this.Qty2=U>=s-this.Qty1?s-this.Qty1:U<s-this.Qty1?U:s-this.Qty1,this.Qty2>0&&(d=this.Qty2,I=o.X.GetExchangeName(o.X.GetMarketSegmentID(M))+" Qty",this.lstPOSConvDetail.push({MarketSegmentId:M,ExchangeName:I,SegWisePOSConversionQty:d,objCombinedData:r}))):2==t&&s>0&&U>0&&(this.Qty3=U>=s-this.Qty1-this.Qty2?s-this.Qty1-this.Qty2:U<s-this.Qty1-this.Qty2?U:s-this.Qty1-this.Qty2,this.Qty3>0&&(d=this.Qty3,I=o.X.GetExchangeName(o.X.GetMarketSegmentID(M))+" Qty",this.lstPOSConvDetail.push({MarketSegmentId:M,ExchangeName:I,SegWisePOSConversionQty:d,objCombinedData:r})))}}catch(q){this.logService.WriteLog("Exception: "+q.message,"CalculateIntertOPNetQTY()","positionconv.component.ts","")}}CheckForEDIS(){return new Promise((t,r)=>{try{if(this.checkForEDISFlag()){let s;this.segmentId=1,this.segmentId=this.isInteropAllow||this.isCombinedData?n.gT.C_V_COMBINED_CASH:this.PosDetails.scrip.ScripDet.MktSegId,s=this.tradingSharedService.GetProductTypeForEDIS(this.ToProdTxt),this.tradingSharedService.FetchEDISQuantityDetails(this.segmentId,this.PosDetails.scrip.ScripDet.Token,s).then(d=>{if(d.ResponseStatus){this.settlmtCycle=d.ResponseObject.Table.length>0?d.ResponseObject.Table[0].nSettlementType:0;var I=o.X.checkForEdisMode(this.ModifiedQuantity,d.ResponseObject,this.segmentId,!1);this.validationError=I.sErrorMsg,this.validationError.length>0&&(this.isValidData=!1,this.validationError=I.sErrorMsg,r());let M=d.ResponseObject.Table[0]?d.ResponseObject.Table[0].TotalFreeQty:0;this.tradingSharedService.GetProductTypeForEDIS(this.ToProdTxt)==n.gT.C_S_PRODUCTTYPE_MTF_VALUE&&this.NetQuantity>M?(this.isValidData=!1,this.validationError="Free Quantity is not available",r()):(this.eDISMode=I.eDISMode,this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE&&(this.eDISParams={ISIN:d.ResponseObject.Table[0].sISINCode,SecurityDesc:d.ResponseObject.Table[0].sSecurityDesc,eDISQty:this.ModifiedQuantity-d.ResponseObject.Table[0].eDISCheckQty}),t(""))}else r()})}else t("")}catch(s){this.logService.WriteLog("positionconv.component.ts","CheckForEDIS()",s.message),r()}})}checkForEDISFlag(){let t=!1;try{t=!(n.xB.User.POAStatus&&n.xB.User.POAStatus||""==n.xB.User.Depository||
1!(this.ToProdTxt==n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT||this.ToProdTxt==n.gT.C_S_PRODUCTTYPE_AMO_DELIVERY_TEXT||this.ToProdTxt==n.gT.C_S_PRODUCTTYPE_MTF_TEXT&&n.xB.User.EDISForMTF)||!(this.SellQuantity-this.BuyQuantity>0))}catch(r){this.logService.WriteLog("positonconv.component.ts","checkForEDISFlag()",r.message)}return t}multiscripRequestSubscription(){return new Promise((t,r)=>{try{let s;s=this.tradingSharedService.GetProductTypeForEDIS(this.ToProdTxt);let d=this.PosDetails.scrip.ScripDet.Token;if(this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE&&(n.xB.User.Depository==n.gT.C_S_EDIS_MODE_CDSL||n.xB.User.Depository==n.gT.C_S_EDIS_MODE_NSDL&&""!=n.xB.dConfigMaster.EDIS_NSDL_MULTI_ISIN_SERVICE_URL.toString())){this.menuManagerService.invokeMenu(n.gT.C_S_MENU_EDIS,{type:n.xB.User.Depository==n.gT.C_S_EDIS_MODE_CDSL?n.gT.C_S_POPUP_EDIS_CDSL:n.gT.C_S_POPUP_EDIS_NSDL,eDISDetails:{ISIN:this.eDISParams.ISIN,HoldQty:this.eDISParams.eDISQty,mktsegid:this.MktSegId,SecurityDesc:this.eDISParams.SecurityDesc,ProductType:s,Token:d,SettlementCycle:this.settlmtCycle}});const M=this.pubsubService.subscribe("EDISOnlineRes",(U,q)=>{this.timer=setTimeout(()=>{this.zone.run(()=>{t(q)})},1e3)});this.subTokens.push(M)}else t("")}catch(s){r()}})}checkMTF(){return new Promise((t,r)=>{if(this.ToProdVal==n.gT.C_S_PRODUCTTYPE_MTF_VALUE){let q=n.xB.dConfigMaster.PLEDGE_REQUEST_NEWNETNET_URL,pe="LIGHT"==n.xB.CurrentTheme.Id?"L":"D",Ve="ODINAERO",He="Y",it=this.ScripISIN,ce="0.00",Je=this.ModifiedQuantity,lt=this.ScripSymbol;var d=document.createElement("form"),I={UserId:n.xB.User.UserId.trim(),GroupId:n.xB.User.GroupId.trim(),Product:Ve,ManagerIP:n.xB.User.ManagerIP,DealerCode:n.xB.User.UserCode,GroupCode:n.xB.User.GroupCode,theme:pe,SessionId:n.xB.User.OCToken,strMTF:He,strMTF_ISIN:it,strMTF_COLValue:ce,strMTF_QTY:Je,strMTF_ScripName:lt};for(var M in d.setAttribute("name","MTFPledge"),d.setAttribute("method","post"),d.setAttribute("action",q),I)if(I.hasOwnProperty(M)){var U=document.createElement("input");U.type="hidden",U.name=M,U.value=I[M],d.appendChild(U)}let mt=null;mt=window.open("","_blank","width=1000,height=800,location=no,toolbar=no,menubar=no,resizable=no"),mt.document.body.appendChild(d),mt.document.forms[0].submit()}window.addEventListener("message",q=>{if("MTFResp"==q.data.messageCode){var j="",Ie="";try{const pe=JSON.parse(q.data.respdata);null!=pe[0].ISINStatus?j=pe[0].ISINStatus:null!=pe[0].sStatus&&(j=pe[0].sStatus,null!=pe[0].sISINPledgeErrorMsg&&(Ie=pe[0].sISINPledgeErrorMsg)),console.log("Pledge Status :"+j),"Success"==j||"Completed"==j?this.sendPositionConversionRequest():(console.log("Pledge Status :"+j),this.validationError="Pledge Request Unsuccessful. Please try again. "+Ie,r("transaction failed"))}catch(pe){this.validationError="Pledge Request Unsuccessful. Please try again. "+Ie,this.isValidData=!1,r("transaction failed"),console.log(pe.message)}}},{once:!0})})}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(i._),e.\u0275\u0275directiveInject(P.F))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["positionconversion"]],inputs:{context:"context"},outputs:{closeDialog:"closeDialog"},decls:41,vars:9,consts:[["id","dvPosConv",1,"pop"],[1,"mwtable2"],[1,"height25"],[1,"form-control","padd-left"],[3,"ngModel","selectionChange","ngModelChange"],[3,"value","disabled",4,"ngFor","ngForOf"],[1,"padd-left"],["type","text","matInput","",1,"form-control",3,"ngModel","disabled","ngModelChange","blur"],[4,"ngIf"],[1,"position-conversion","col","flt-left","text-center","mt5"],[1,"clear"],[1,"text-center","mt5","border-top-dash","pt20"],["mat-raised-button","",3,"click"],["class","disable-background",4,"ngIf"],[3,"value","disabled"],[4,"ngFor","ngForOf"],[1,"wp30"],[1,"disable-background"],[3,"type"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275elementStart(2,"table"),e.\u0275\u0275elementStart(3,"tr",2),e.\u0275\u0275elementStart(4,"td"),e.\u0275\u0275elementStart(5,"label"),e.\u0275\u0275text(6,"From Product"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"td"),e.\u0275\u0275elementStart(8,"span",3),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"tr",2),e.\u0275\u0275elementStart(11,"td"),e.\u0275\u0275elementStart(12,"label"),e.\u0275\u0275text(13,"To Product"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"td"),e.\u0275\u0275elementStart(15,"mat-form-field"),e.\u0275\u0275elementStart(16,"mat-select",4),e.\u0275\u0275listener("selectionChange",function(){return r.onToProductChange(r.ddlToProd)})("ngModelChange",function(d){return r.ddlToProd=d}),e.\u0275\u0275template(17,w,2,3,"mat-option",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"tr",2),e.\u0275\u0275elementStart(19,"td"),e.\u0275\u0275elementStart(20,"label"),e.\u0275\u0275text(2
11,"Net Quantity: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"td"),e.\u0275\u0275elementStart(23,"span",6),e.\u0275\u0275text(24),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"tr",2),e.\u0275\u0275elementStart(26,"td"),e.\u0275\u0275elementStart(27,"label"),e.\u0275\u0275text(28,"Quantity"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(29,"td"),e.\u0275\u0275elementStart(30,"mat-form-field"),e.\u0275\u0275elementStart(31,"input",7),e.\u0275\u0275listener("ngModelChange",function(d){return r.ModifiedQuantity=d})("blur",function(){return r.onBlurMethod()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(32,F,2,1,"div",8),e.\u0275\u0275elementStart(33,"div",9),e.\u0275\u0275elementStart(34,"mat-error"),e.\u0275\u0275template(35,re,2,1,"div",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(36,"div",10),e.\u0275\u0275elementStart(37,"div",11),e.\u0275\u0275elementStart(38,"button",12),e.\u0275\u0275listener("click",function(){return r.onSubmit()}),e.\u0275\u0275text(39,"Submit"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(40,X,2,1,"div",13)),2&t&&(e.\u0275\u0275advance(9),e.\u0275\u0275textInterpolate(r.FromProd),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",r.ddlToProd),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",r.lstProductType),e.\u0275\u0275advance(7),e.\u0275\u0275textInterpolate(r.NetQuantity),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",r.ModifiedQuantity)("disabled",!r.EnableValue),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==r.isCombinedData),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",0==r.isValidData),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",r.disableBackground))},directives:[_.KE,k.gD,a.JJ,a.On,W.sg,N.Nt,a.Fj,W.O5,_.TO,Q.lW,H.ey,V.R],encapsulation:2}),S})();var he=x(2282),fe=x(3910);function Te(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",9),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t)}}function Ce(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label",5),e.\u0275\u0275text(2,"Validity"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"mat-form-field",6),e.\u0275\u0275elementStart(4,"mat-select",7),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().SelValidity=s})("selectionChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onSelValidityChange()}),e.\u0275\u0275template(5,Te,2,2,"mat-option",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",t.SelValidity),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.ArrValidity)}}let be=(()=>{class S{constructor(){this.closeDialog=new e.EventEmitter,this.ArrValidity=["DAY","IOC"]}ngOnInit(){this.SelValidity=this.ArrValidity[0],this.hasValidity=this.context.params.some(t=>t.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&("1"==t.posConvFlag||t.OrdStatus==n.gT.C_S_ORDERSTATUS_EXECUTED_TEXT)&&"1"==t.exitOptFlag)}onSelValidityChange(){}onExitAll(){this.closeDialog.emit({status:!0,data:this.context.params,validity:this.SelValidity})}onCancel(){this.closeDialog.emit({status:!1,profName:""})}}return S.\u0275fac=function(t){return new(t||S)},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["app-exit-all-bracket"]],inputs:{context:"context"},outputs:{closeDialog:"closeDialog"},decls:8,vars:1,consts:[[1,"align","margin-20"],[4,"ngIf"],[1,"martop-20"],["mat-raised-button","",1,"btn","btn-primary",3,"click"],["mat-raised-button","",1,"btn","btn-primary","m-r-0",3,"click"],[1,"marginR-15"],[1,"OE_Mat_Fields"],["id","_ddlValidity",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"ul"),e.\u0275\u0275template(2,Ce,6,2,"li",1),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",2),e.\u0275\u0275elementStart(4,"button",3),e.\u0275\u0275listener("click",function(){return r.onExitAll()}),e.\u0275\u0275text(5,"Yes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"button",4),e.\u0275\u0275listener("click",function(){return r.onCancel()}),e.\u0275\u0275text(7,"No"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.hasValidity))},directives:[W.O5,Q.lW,_.KE,k.gD,a.JJ,a.On,W.sg,H.ey],encapsulation:2}),S})();var Me=x(7324),ue=x(6228),Re=x(8845),K=x(4549);
1function de(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",7),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","ProgressBarWdgt"))}function Ee(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"reportgrid",8,9),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("fhTopHeight","0px")("IsWrapText","true")("pageSize",5)("showPaging",!0)("fixedHdrConfig",t.fixedHdrConfig)("noDataFoundMsg",t.noDataFoundMsg)("columns",t.columns)("rows",t.rows)("isFixedHeader",!1)}}let Ue=(()=>{class S{constructor(t,r,s){this.httpService=t,this.eqsipService=r,this.logService=s,this.columns=[],this.rows=[],this.systematicOBD=[],this.systematicOBDMain=[],this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"},this.showProgressBar=!1,this.isDataFound=!1,this.noDataFoundMsg="",this.isDataAvailable=!1}ngOnInit(){try{this.noDataFoundMsg=n.xB.dMsgMaster.NNSL708,this.detailRowObj=this.context.params,this.getOrderBookDetail(this.detailRowObj.SIPId)}catch(t){this.logService.WriteLog("eqsip-order-book-detail.component.ts","ngOnInit()",t.message)}}getOrderBookDetail(t){try{this.showProgressBar=!0,this.isDataFound=!1,this.eqsipService.getEqsipOrderBookDetail({UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",SIPId:t,MODE:n.gT.C_S_EQSIP_ORDERBOOK_DETAIL_MODE}).subscribe(s=>{if(this.showProgressBar=!1,this.isDataFound=!0,this.rows=[],null!=s&&null!=s){this.initHeader(),this.systematicOBDMain=s.Table,this.systematicOBD=s.Table1;for(let I=0;I<this.systematicOBD.length;I++)this.rows.push({nInstallmentNo:this.systematicOBD[I].InstallmentNo,sSymbol:this.systematicOBD[I].Symbol,sExchangeName:this.systematicOBD[I].ExchangeName,nOrderQty:this.systematicOBD[I].OrderQty,nTradedQty:this.systematicOBD[I].TradedQty,nTradedPrice1:this.systematicOBD[I].TradedPrice,nAmount1:this.systematicOBD[I].Amount,dtTransactionDate:this.systematicOBD[I].TransactionDate,sRemarks:this.systematicOBD[I].Remarks});let d=this.rows.map(I=>I.nTradedQty).reduce((I,M)=>I+M);this.Symbol=this.detailRowObj.Symbol,this.sipId=this.detailRowObj.SIPId,this.transactionType=this.detailRowObj.TransactionType,this.frequencyType=this.detailRowObj.FrequencyName,this.status=this.detailRowObj.Status,this.exchangeName=this.detailRowObj.ExchangeName,this.startDate=this.detailRowObj.StartDate,this.nextInstallment=""==this.detailRowObj.NextExecutionDate?"NA":this.detailRowObj.NextExecutionDate,this.totalInstallment=this.detailRowObj.NoOfInstallments,this.remainInstallment=this.systematicOBDMain[0].RemainingInstallments,this.failInstallment=this.totalInstallment-(this.remainInstallment+this.systematicOBD.length),this.investBy=this.detailRowObj.InvestmentType,this.marketValue=parseFloat(this.detailRowObj.CurrentValue).toFixed(2),this.investValue=parseFloat(this.detailRowObj.InvestmentValue).toFixed(2),this.averagePrice=isNaN(this.investValue/d)?"0.00":(this.detailRowObj.InvestmentValue/d).toFixed(2),this.installmentQtyValue=this.detailRowObj.InvestedVal,this.rows=Re.v.sort(this.rows,"nInstallmentNo","desc",!0)}else this.showProgressBar=!1,this.isDataFound=!0},s=>{this.showProgressBar=!1,this.isDataFound=!0})}catch(r){this.logService.WriteLog("eqsip-order-book-detail.component.ts","getOrderBookDetail()",r.message)}}initHeader(){this.columns=[],this.columns.push({value:"nInstallmentNo",name:"Installment No. ",cType:"S",width:10}),this.columns.push({value:"dtTransactionDate",name:"Transaction Date",cType:"S",width:10}),this.columns.push({value:"sRemarks",name:"Remarks",cType:"S",width:8}),this.columns.push({value:"nOrderQty",name:"Order Qty",cType:"N",width:10}),this.columns.push({value:"nTradedQty",name:"Traded Qty",cType:"N",width:10}),this.columns.push({value:"nTradedPrice1",name:"Traded Price",cType:"N",width:10}),this.columns.push({value:"nAmount1",name:"Amount",cType:"N",width:10})}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(K.X),e.\u0275\u0275directiveInject(n.mQ))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["eqsip-order-book-detail"]],inputs:{context:"context"},decls:84,vars:17,consts:[[1,"detail-odr-book"],[4,"ngIf"],[1,"detail"],[1,"head"],[1,"pull-left"],[1,"pull-right"],[1,"info"],[3,"type"],[3,"fhTopHeight","IsWrapText","pageSize","showPaging","fixedHdrConfig","noDataFoundMsg","columns","rows","isFixedHeader"],["reportGrid",""]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,de,2,1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275element(4,"div",4),e.\u0275\u0275element(5,"div",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",6),e.\u0275\u0275elementStart(7,"ul"),e.\u0275\u0275elementStart(8,"li"),e.\u0275\u0275elementStart(9,"label"),e.\u0275\u0275text(10,"Symbol :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"span"),e.\u0275\u0275text(12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"li"),e.\u0275\u0275elementStart(14,"label"),e.\u0275\u0275text(15,"Exchange :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"span"),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"li"),e.\u0275\u0275elementStart(19,"label"),e.\u0275\u0275text(20,"Frequency :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"span"),e.\u0275\u0275text(22),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"li"),e.\u0275\u0275elementStart(24,"label"),e.\u0275\u0275text(25,"Transaction Type :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"span"),e.\u0275\u0275text(27),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"li"),e.\u0275\u0275elementStart(29,"label"),e.\u0275\u0275text(30,"Invest By :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(31,"span"),e.\u0275\u0275text(32),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(33,"li"),e.\u0275\u0275elementStart(34,"label"),e.\u0275\u0275text(35,"Qty/Value :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(36,"span"),e.\u0275\u0275text(37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(38,"li"),e.\u0275\u0275elementStart(39,"label"),e.\u0275\u0275text(40,"Total Installments :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(41,"span"),e.\u0275\u0275text(42),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(43,"li"),e.\u0275\u0275elementStart(44,"label"),e.\u0275\u0275text(45,"Remaining Installments :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(46,"span"),e.\u0275\u0275text(47),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(48,"li"),e.\u0275\u0275elementStart(49,"label"),e.\u0275\u0275text(50,"Status :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(51,"span"),e.\u0275\u0275text(52),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(53,"li"),e.\u0275\u0275elementStart(54,"label"),e.\u0275\u0275text(55,"Invested Value :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(56,"span"),e.\u0275\u0275text(57),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(58,"li"),e.\u0275\u0275elementStart(59,"label"),e.\u0275\u0275text(60,"Current Value :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(61,"span"),e.\u0275\u0275text(62),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(63,"li"),e.\u0275\u0275elementStart(64,"label"),e.\u0275\u0275text(65,"Average Price (Rs.) :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(66,"span"),e.\u0275\u0275text(67),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(68,"li"),e.\u0275\u0275elementStart(69,"label"),e.\u0275\u0275text(70,"Start Date :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(71,"span"),e.\u0275\u0275text(72),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(73,"li"),e.\u0275\u0275elementStart(74,"label"),e.\u0275\u0275text(75,"Next Execution Date:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(76,"span"),e.\u0275\u0275text(77),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(78,"li"),e.\u0275\u0275elementStart(79,"label"),e.\u0275\u0275text(80,"SIP ID :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(81,"span"),e.\u0275\u0275text(82),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(83,Ee,3,9,"div",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(11),e.\u0275\u0275textInterpolate(r.Symbol),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.exchangeName),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.frequencyType),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.transactionType),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.investBy),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.installmentQtyValue),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.totalInstallment),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.remainInstallment),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.status),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.investValue),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.marketValue),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.averagePrice),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.startDate),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.nextInstallment),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(r.sipId),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.isDataFound))},directives:[W.O5,V.R,Me.i],encapsulation:2}),S})();var Ze=x(3449),Tt=x(3922),ot=x(634),ht=x(3940),nt=x(4113);const ut=["reportGrid"],ae=["cellTmplModify"],Pe=["cellTmplDetail"];
1function E(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",17),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function R(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-radio-button",18),e.\u0275\u0275listener("change",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().radioChanges(s)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&S){const t=O.$implicit;e.\u0275\u0275property("value",t.value),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.text," ")}}function Y(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",19),e.\u0275\u0275element(1,"reportgrid",20,21),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("hidden",t.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("layoutMode",t.layoutMode)("fhTopHeight","90px")("showPaging",!0)("pageSize",5)("blockViewTmpl",t.blockViewTmpl)("noDataFoundMsg",t.noDataFoundMsg)("fixedHdrConfig",t.fixedHdrConfig)("columns",t.columns)("rows",t.dispSOBArr)("showFilter",t.showFilter)("showSort",!0)}}function ie(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",24),e.\u0275\u0275elementStart(1,"a",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().populateOEFromOB(s)}),e.\u0275\u0275text(2," Modify"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function ge(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",24),e.\u0275\u0275elementStart(1,"a",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().resumeEQSIP(s)}),e.\u0275\u0275text(2,"Resume"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function xe(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",24),e.\u0275\u0275elementStart(1,"a",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().stopCancelEQSIP(s,"S")}),e.\u0275\u0275text(2,"Pause"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function oe(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",24),e.\u0275\u0275elementStart(1,"a",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PermanentStopEQSIP(s,"P")}),e.\u0275\u0275text(2,"Stop"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function me(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",22),e.\u0275\u0275template(1,ie,3,0,"div",23),e.\u0275\u0275template(2,ge,3,0,"div",23),e.\u0275\u0275template(3,xe,3,0,"div",23),e.\u0275\u0275template(4,oe,3,0,"div",23),e.\u0275\u0275elementEnd()),2&S){const t=O.row;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bModify),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bResume),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bStop),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bDeActivatedStop)}}function L(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",24),e.\u0275\u0275elementStart(1,"a",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().getDetails(s)}),e.\u0275\u0275text(2,"Details"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function te(S,O){1&S&&e.\u0275\u0275template(0,L,3,0,"div",23),2&S&&e.\u0275\u0275property("ngIf",O.row.bDetail)}let J=(()=>{class S{constructor(t,r,s,d,I,M){this.httpService=t,this.dialogService=r,this.logService=s,this.menuManager=d,this.pubsubService=I,this.zone=M,this.closeDialog=new e.EventEmitter,this.tempSOBArr=[],this.dispSOBArr=[],this.totalRecord=0,this.timer=null,this.showFilter=!1,this.showProgressBar=!1,this.noDataFoundMsg="Looks like you have no orders at this moment",this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.dateTypeOptions=[{value:1,text:"Request Date"},{value:2,text:"Next Installment Date"}],this.DateType=null,this.EqsiporderCount=0}ngOnInit(){try{this.DateType=this.dateTypeOptions[1].value,this.radioChanges({value:this.DateType}),this.layoutMode="G",this.subscribeMessages()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","mf-systematic-order-book.component.ts","")}}
1radioChanges(t){const r=new Date;t.value==n.gT.C_S_DATETYPE_NEXTINSTALLMENTDATE?(this.FromDate=new Date(r.getFullYear(),r.getMonth(),1),this.ToDate=new Date(r.getFullYear(),r.getMonth()+1,0)):t.value==n.gT.C_S_DATETYPE_REQUESTDATE&&(this.ToDate=new Date,this.FromDate=new Date(r.setDate(r.getDate()-30)))}initHeadersEQSIP(){this.columns=[],this.columns.push({value:"CancelFlag",sort:!1,width:15,filter:!1,cType:"S",export:!1,isCheckboxable:!0}),this.columns.push({value:"Action",name:"Action",cType:"",sort:!1,filter:!1,export:!1,cellTemplate:this.cellTmplModify}),this.columns.push({value:"bDetail",name:"Remarks",cType:"",sort:!1,filter:!1,export:!1,cellTemplate:this.cellTmplDetail}),this.columns.push({value:"SIPId",name:"SIP ID",cType:"S"}),this.columns.push({value:"ExchangeName",name:"Exchange",cType:"S"}),this.columns.push({value:"Symbol",name:"Symbol",cType:"S"}),this.columns.push({value:"Status",name:"Status",cType:"S"}),this.columns.push({value:"TransactionType",name:"Transaction Type",cType:"S"}),this.columns.push({value:"InvestmentType",name:"Invest By",cType:"S"}),this.columns.push({value:"InvestedVal",name:"Qty/Value",cType:"N"}),this.columns.push({value:"CapPrice",name:"Cap Price",cType:"N"}),this.columns.push({value:"FrequencyName",name:"Frequency Type",cType:"S"}),this.columns.push({value:"FrequencyDetails",name:"Frequency Details",cType:"S"}),this.columns.push({value:"NoOfInstallments",name:"No. of Installments",cType:"N"}),this.columns.push({value:"RequestDate",name:"Request Date",cType:"S"}),this.columns.push({value:"StartDate",name:"Start Date",cType:"S"}),this.columns.push({value:"NextExecutionDate",name:"Next Execution Date",cType:"S"}),this.columns.push({value:"LastModifiedBy",name:"Last Modified By",cType:"S"}),this.columns.push({value:"InvestmentValue",name:"Invested Value",cType:"N"}),this.columns.push({value:"CurrentValue",name:"Current Value",cType:"N"}),this.columns.push({value:"Overall",name:"Overall Gain/Loss",cType:"N"}),this.columns.push({value:"InitiatedFrom",name:"Initiated From",cType:"S"}),this.columns.push({value:"ModifiedFrom",name:"Modified From",cType:"S"})}getEQSIPOrderBook(){try{if(!this.DateValidation(this.FromDate.toString("MM/dd/yyyy"),this.ToDate.toString("MM/dd/yyyy")))return void(this.showProgressBar=!1);this.showProgressBar=!0;var t={};t.UserID=n.xB.User.UserId,t.GroupID=n.xB.User.GroupId,t.UCCClientID="",t.UCCGroupID="",t.Status="0",t.TransactionType="BOTH",t.FromDate=this.FromDate.toString("dd-MM-yyyy"),t.ToDate=this.ToDate.toString("dd-MM-yyyy"),t.DateType=this.DateType,this.httpService.postData(n.xB.eqsipAPIUrl,"FetchSystematicOrderBook",t).subscribe(r=>{this.eqsipOrderBookRes(r)}
1,()=>{this.showProgressBar=!1})}catch(r){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+r.message,"displayOrderBook()","mf-systematic-order-book.component.ts","")}}DateValidation(t,r){var s=!0;try{var d=(new Date).toString("MM/dd/yyyy"),I=[];if(null==t||null==t||""==t.toString()?(s=!1,this.dialogService.alert("From date is not Provided")):(null==r||null==r||""==r.toString())&&(s=!1,this.dialogService.alert("To date is not Provided")),this.DateType==n.gT.C_S_DATETYPE_REQUESTDATE?(Date.parse(t)>Date.parse(d)&&(s=!1,I.push("From date should be lower than or equal to Today's date")),Date.parse(r)>Date.parse(d)?(s=!1,I.push("To date should be lower than or equal to Today's date")):Date.parse(t)>Date.parse(r)&&(s=!1,I.push("From date should be lower than or equal to To date"))):this.DateType==n.gT.C_S_DATETYPE_NEXTINSTALLMENTDATE&&Date.parse(t)>Date.parse(r)&&(s=!1,I.push("From date should be lower than or equal to To date")),null!=I&&!s){var M=I.join(" ");this.dialogService.alert(M)}}catch(U){s=!1,this.logService.WriteLog("Exception: "+U.message,"DateValidation","mforderbook.ts","")}return s}eqsipOrderBookRes(t){try{if(null!=t||null!=t)if(this.dispSOBArr=[],null!=t.ResponseObject||null!=t.ResponseObject){this.tempSOBArr=t.ResponseObject.Table,this.initHeadersEQSIP(),this.EqsiporderCount=this.tempSOBArr.length;for(var r=0;r<this.tempSOBArr.length;r++){var s=this.setCancelBtnFlag(this.tempSOBArr[r].Status);this.dispSOBArr.push({CancelFlag:1==s?"1":"0",Canceldisabled:!s,SIPId:0!=this.tempSOBArr[r].SIPId?this.tempSOBArr[r].SIPId:"",Symbol:this.tempSOBArr[r].Symbol,TransactionType:this.tempSOBArr[r].TransactionType,FrequencyName:this.tempSOBArr[r].FrequencyName,FrequencyDetails:this.tempSOBArr[r].FrequencyDetails,NoOfInstallments:this.tempSOBArr[r].NoOfInstallments,RequestDate:this.tempSOBArr[r].RequestDate,StartDate:this.tempSOBArr[r].StartDate,LastModifiedBy:this.tempSOBArr[r].LastModifiedBy,InvestmentType:this.tempSOBArr[r].InvestmentType,InvestedVal:this.tempSOBArr[r].InvestedVal,AssetType:this.tempSOBArr[r].AssetType,NextExecutionDate:this.tempSOBArr[r].Status==n.gT.C_S_EQSIP_ORDER_STATUS_DEACTIVATED?"NA":this.tempSOBArr[r].NextExecutionDate,InitiatedFrom:this.tempSOBArr[r].InitiatedFrom,ModifiedFrom:this.tempSOBArr[r].ModifiedFrom,Series:this.tempSOBArr[r].Series,ExchangeName:this.tempSOBArr[r].ExchangeName,CurrentValue:this.tempSOBArr[r].CurrentValue,Overall:this.tempSOBArr[r].Overall,Status:this.tempSOBArr[r].Status==n.gT.C_S_EQSIP_ORDER_STATUS_STOPPED?n.gT.C_S_EQSIP_ORDER_STATUS_PAUSED:this.tempSOBArr[r].Status==n.gT.C_S_EQSIP_ORDER_STATUS_DEACTIVATED?n.gT.C_S_EQSIP_ORDER_STATUS_STOPPED:this.tempSOBArr[r].Status,bDetail:this.tempSOBArr[r].bDetail,bModify:this.tempSOBArr[r].bModify,bView:this.tempSOBArr[r].bView,bStop:this.tempSOBArr[r].Status==n.gT.C_S_EQSIP_ORDER_STATUS_RUNNING,bResume:this.tempSOBArr[r].bResume,InvestmentValue:this.tempSOBArr[r].InvestmentValue,Remarks:this.tempSOBArr[r].Remarks,LTP:this.tempSOBArr[r].LTP,CapPrice:this.tempSOBArr[r].CapPrice,bDeActivatedStop:this.tempSOBArr[r].bDeActivatedStop})}}else if(t.ErrorMessages.length>0){var d=Ze.h.ErrorMessages(t.ErrorMessages);""!=d&&this.dialogService.alert(d)}}catch(I){this.logService.WriteLog("Exception: "+I.message,"systematicOrderBookRes()","mf-systematic-order-book.component.ts","")}finally{this.showProgressBar=!1}}closeDialogRef(){this.closeDialog.emit(!0)}PermanentStopEQSIP(t,r){this.dialogService.confirm("Are you sure you want to permanently stop your SIP order?<br />Please note that this will cancel all your upcoming equity SIP installments for this order","Confirm","Cancel").subscribe(s=>{!0===s?this.stopCancelEQSIPInnerFunction(t,r):!1===s&&this.closeDialogRef()})}stopCancelEQSIP(t,r){this.dialogService.confirm("Are you sure you want to pause your current SIP order?<br />You may resume your order again later.","Confirm","Cancel").subscribe(s=>{!0===s?this.stopCancelEQSIPInnerFunction(t,r):!1===s&&this.closeDialogRef()})}stopCancelEQSIPInnerFunction(t,r){try{this.showProgressBar=!0;let s={};s.UserID=n.xB.User.UserId,s.GroupID=n.xB.User.GroupId,s.UCCClientID="",s.UCCGroupID="",s.SIPId=t.SIPId,1==t.CancelFlag&&t.Status==n.gT.C_S_EQSIP_ORDER_STATUS_PENDING?s.TransactionMode=n.gT.C_S_EQSIP_ORDER_REQUEST_CANCEL:"S"==r&&1==t.bStop&&t.Status==n.gT.C_S_EQSIP_ORDER_STATUS_RUNNING?s.TransactionMode=n.gT.C_S_EQSIP_ORDER_REQUEST_STOP:("P"==r&&1==t.bDeActivatedStop&&t.Status==n.gT.C_S_EQSIP_ORDER_STATUS_RUNNING||t.Status==n.gT.C_S_EQSIP_ORDER_STATUS_PAUSED)&&(s.TransactionMode=n.gT.C_S_EQSIP_ORDER_REQUEST_DEACTIVATE),this.httpService.postData(n.xB.eqsipAPIUrl,"CancelEQSIPOrder",s).subscribe(d=>{this.showProgressBar=!1,this.stopCancelEQSIPres(d,t.SIPId,r)})}catch(s){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+s.message,"stopCancelEQSIP()","order-book.component.ts","")}finally{this.showProgressBar=!1}}stopCancelEQSIPres(t,r,s){null!=t.ErrorMessages&&this.dialogService.alert(t.ErrorMessages[0]),"S"==s?this.dialogService.alert("Your Equity SIP has been paused successfully, SIP order ID:"+r):"P"==s&&this.dialogService.alert("Your Equity SIP has stopped successfully, SIP order ID:"+r),this.showProgressBar=!1,this.getEQSIPOrderBook()}resumeEQSIP(t){try{let r="";n.gT.C_S_EQSIP_ORDER_STATUS_STOPPED&&(r="Are you sure you want to Resume EQSIP ?",this.dialogService.confirm(r,"Confirm").subscribe(s=>{if(s){this.showProgressBar=!0;let d={};
1d.UserID=n.xB.User.UserId,d.GroupID=n.xB.User.GroupId,d.UCCClientID="",d.UCCGroupID="",d.SIPId=t.SIPId,this.httpService.postData(n.xB.eqsipAPIUrl,"ResumeEQSIPOrder",d).subscribe(I=>{this.showProgressBar=!1,this.resumeEQSIPres(I)})}}))}catch(r){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+r.message,"stopCancelEQSIP()","order-book.component.ts","")}}resumeEQSIPres(t){null!=t.ErrorMessages&&this.dialogService.alert(t.ErrorMessages[0]),this.showProgressBar=!1,this.getEQSIPOrderBook()}getDetails(t){try{""!=t&&this.dialogService.openComponent("EQSIP Order Book Details",Ue,t,"960px","530px",!0).afterClosed().subscribe(d=>{this.onAlertClose(d)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getDetails()","eqsip-orderbook.component.ts","")}finally{this.showProgressBar=!1}}onAlertClose(t){}CreateScripSymbolsRequest(t,r,s,d){try{var I={UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,MKtSegId:t,InstNm:r,Symbol:this.Trim(s),Series:this.Trim(d),UCCClientID:"",UCCGroupID:""}}catch(M){this.logService.WriteLog("Exception: "+M.message,"CreateScripSymbolsRequest","eqsip-orderbook.component.ts","")}return I}Trim(t){return t.toString().split(" ").join("")}populateOEFromOB(t){try{let r=t.ExchangeName==n.gT.C_S_EQSIP_EXCHANGETEXT_NSE?1:t.ExchangeName==n.gT.C_S_EQSIP_EXCHANGETEXT_BSE?3:-1,s=this.CreateScripSymbolsRequest(r,n.gT.C_S_INSTRUMENT_EQUITIES_TEXT,t.Symbol,t.Series);this.httpService.postData(n.xB.tradingAPIUrl,"LoadScripDetailsForEQ",s).subscribe(d=>{if(!0===d.ResponseStatus&&null!=d.ResponseObject){var I=new m.u,M=d.ResponseObject[0];I.ScripDet.MktSegId=r,I.ScripDet.Token=M.nToken,I.AssetToken=M.nAssetToken,I.Symbol=t.Symbol,I.Series=t.Series,I.DecimalLocator=M.nPriceBdAttribute,I.InstrumentName=M.sInstrumentName,I.ExchangeName=o.X.GetExchangeName(I.ScripDet.MktSegId),I.ExpiryDate=M.ExpiryDate,I.PriceTick=M.nPriceTick,I.ISIN=M.sISINCode,I.MarketLot=M.nRegularLot,I.IsSIP=1,I.MWSecurityDesc=o.X.FormatScripDescForMW(I),I.SecurityDesc=M.sSecurityDesc;var U=new Tt.u(I);if(U.OrderSide=t.TransactionType,U.InvestmentType=t.InvestmentType,U.TransactionMode=n.gT.C_S_EQSIP_TRANSACTIONTYPE_MODIFY,U.QtyValue=t.InvestedVal,U.CapPrice=t.CapPrice,U.Frequency=t.FrequencyName,U.Installments=t.NoOfInstallments,U.SIPId=t.SIPId,U.StartDate=t.StartDate,t.FrequencyDetails.length>0&&t.FrequencyDetails.startsWith("Every")){let q=t.FrequencyDetails.split(" ");t.FrequencyName==n.gT.C_S_EQSIP_FREQUENCY_MODE_WEEKLY&&q[1].length>0?U.PrefDay=q[1]:t.FrequencyName==n.gT.C_S_EQSIP_FREQUENCY_MODE_MONTHLY&&q[1].length>0&&q[2].length>0&&(U.PrefWeek=q[1],U.PrefDay=q[2])}else-1!=t.NextExecutionDate.indexOf("-")&&(t.FrequencyName==n.gT.C_S_EQSIP_FREQUENCY_MODE_FORTHNIGHTLY||t.FrequencyName==n.gT.C_S_EQSIP_FREQUENCY_MODE_MONTHLY)&&(U.SpecificDate=t.NextExecutionDate.split("-")[0],U.SpecificDate=U.SpecificDate.startsWith("0")?U.SpecificDate.slice(1,2):U.SpecificDate);U.PageSource=n.gT.C_V_ORDERBOOK_PAGENO.toString(),this.menuManager.invokeMenu(n.gT.C_S_MENU_EQSIP_OE,{sourceId:n.gT.C_S_MENU_TRADING_ORDERBOOK,data:U})}})}catch(r){this.logService.WriteLog("Exception: "+r.message,"populateOEFromOB()","eqsip-orderbook.component.ts","")}}setCancelBtnFlag(t){try{return t==n.gT.C_S_EQSIP_ORDER_STATUS_PENDING}catch(r){this.logService.WriteLog("Exception: "+r.message,"SetCancelBtnFlag","eqsip-orderbook.component.ts","")}}onFilterEQSIP(){this.showFilter=!this.showFilter}refresh(){this.getEQSIPOrderBook()}subscribeMessages(){null==this.sub&&(this.sub=this.pubsubService.subscribe("EQSIPOB",()=>{this.timer=setTimeout(()=>{this.zone.run(()=>{this.refresh()})},600)})),this.getEQSIPOrderBook()}ngOnDestroy(){this.pubsubService.unsubscribe(this.sub)}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n._V),e.\u0275\u0275directiveInject(ot.h),e.\u0275\u0275directiveInject(e.NgZone))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["eqsip-order-book"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(ut,5),e.\u0275\u0275viewQuery(ae,7),e.\u0275\u0275viewQuery(Pe,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplModify=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplDetail=s.first)}},outputs:{closeDialog:"closeDialog"},decls:31,vars:12,consts:[[1,"eqsip-ord-bk"],[1,"container-fluid"],[4,"ngIf"],[1,"fltr"],["name","more_options2",3,"ngModel","ngModelChange"],["name","more_options2",3,"value","change",4,"ngFor","ngForOf"],["matInput","","placeholder","From",3,"matDatepicker","ngModel","readonly","ngModelChange"],["matSuffix","",3,"for"],["FromDatepicker",""],[1,"forwardicon","verticle_align_sub"],["matInput","","placeholder","To",3,"matDatepicker","ngModel","readonly","ngModelChange"],["ToDatepicker",""],["mat-raised-button","",3,"ngClass","click"],[3,"hidden",4,"ngIf"],["cellTmplModify",""],["class","text-center"],["cellTmplDetail",""],[3,"type"],["name","more_options2",3,"value","change"],[3,"hidden"],[3,"layoutMode","fhTopHeight","showPaging","pageSize","blockViewTmpl","noDataFoundMsg","fixedHdrConfig","columns","rows","showFilter","showSort"],["reportGrid",""],[1,"actionBtns"],["class","Modify_Text",4,"ngIf"],[1,"Modify_Text"],["href","javascript:void(0);",1,"link-wrap",3,"click"]],template:function(t,r){if(1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,E,2,1,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275elementStart(4,"ul"),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275text(6," Date Type: "),e.\u0275\u0275elementStart(7,"mat-radio-group",4),e.\u0275\u0275listener("ngModelChange",function(d){return r.DateType=d}),e.\u0275\u0275template(8,R,2,2,"mat-radio-button",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"li"),e.\u0275\u0275elementStart(10,"mat-form-field"),e.\u0275\u0275elementStart(11,"input",6),e.\u0275\u0275listener("ngModelChange",function(d){return r.FromDate=d}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(12,"mat-datepicker-toggle",7),e.\u0275\u0275element(13,"mat-datepicker",null,8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"li"),e.\u0275\u0275element(16,"div",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"li"),e.\u0275\u0275elementStart(18,"mat-form-field"),e.\u0275\u0275elementStart(19,"input",10),e.\u0275\u0275listener("ngModelChange",function(d){return r.ToDate=d}
1),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(20,"mat-datepicker-toggle",7),e.\u0275\u0275element(21,"mat-datepicker",null,11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"li"),e.\u0275\u0275elementStart(24,"button",12),e.\u0275\u0275listener("click",function(){return r.refresh()}),e.\u0275\u0275text(25,"Go"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(26,Y,3,12,"div",13),e.\u0275\u0275template(27,me,5,4,"ng-template",null,14,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(29,te,1,1,"ng-template",15,16,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t){const s=e.\u0275\u0275reference(14),d=e.\u0275\u0275reference(22);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.DateType),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",r.dateTypeOptions),e.\u0275\u0275advance(3),e.\u0275\u0275property("matDatepicker",s)("ngModel",r.FromDate)("readonly",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("for",s),e.\u0275\u0275advance(7),e.\u0275\u0275property("matDatepicker",d)("ngModel",r.ToDate)("readonly",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("for",d),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",r.dispSOBArr)}},directives:[W.O5,ht.VQ,a.JJ,a.On,W.sg,_.KE,N.Nt,nt.hl,a.Fj,nt.nW,_.R9,nt.Mq,Q.lW,W.mk,V.R,ht.U0,Me.i],encapsulation:2}),S})();function De(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",7),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","ProgressBarWdgt"))}function Ke(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",8),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.noDataFoundMsg)}}function Xe(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"th"),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.name)}}function et(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"th"),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.name)}}function ct(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"tbody"),e.\u0275\u0275elementStart(1,"tr",19),e.\u0275\u0275elementStart(2,"td",20),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td",14),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"td",14),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"td",14),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"td",14),e.\u0275\u0275text(11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"td",14),e.\u0275\u0275text(13),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"td",14),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"td",14),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"td",14),e.\u0275\u0275text(19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"td",21),e.\u0275\u0275text(21),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.Id),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Time),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Price),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.QuantityOpen),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.TotalQuantity),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.QuantityExcuted),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Settlor),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.PartType),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Status),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Reason)}}function tt(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"td",16),e.\u0275\u0275elementStart(1,"div",17),e.\u0275\u0275elementStart(2,"table",18),e.\u0275\u0275elementStart(3,"thead"),e.\u0275\u0275elementStart(4,"tr"),e.\u0275\u0275template(5,et,3,1,"th",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,ct,22,10,"tbody",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(5),e.\u0275\u0275property("ngForOf",t.SchmDtlHeader),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.SchmWiseHld)}}function Ct(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tbody"),e.\u0275\u0275elementStart(1,"tr",11),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).getGtdOrderDetail(d)}),e.\u0275\u0275elementStart(2,"td"),e.\u0275\u0275element(3,"span",12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td",13),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"td",14),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"td",14),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"td",14),e.\u0275\u0275text(11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"td",14),e.\u0275\u0275text(13),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"td",14),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"td",14),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"td",14),e.\u0275\u0275text(19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"td",14),e.\u0275\u0275text(2
11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"td",14),e.\u0275\u0275text(23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"td",14),e.\u0275\u0275text(25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"tr"),e.\u0275\u0275template(27,tt,7,2,"td",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=O.$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.CheckBoxTreeClass),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Date),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.OrderEntryTime),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.ExchangeOrderNumber),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.ClientOrderNumber),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Price),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.QuantityOpen),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.TotalQuantity),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.QuantityExcuted),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.PrevTradedQuantity),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.GTDOrderStatus),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.Status),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.IsDetailVisible)}}function vt(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"table",9),e.\u0275\u0275elementStart(1,"thead"),e.\u0275\u0275elementStart(2,"tr"),e.\u0275\u0275template(3,Xe,3,1,"th",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Ct,28,13,"tbody",10),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",t.summaryColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.summaryRow)}}const ze=function(S){return{active:S}};function Rt(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",25),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).setPage(d)}),e.\u0275\u0275elementStart(1,"a",29),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=O.$implicit,r=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(2,ze,r.currentIndex==t)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t)}}const Ft=function(S){return{disabled:S}};function Nt(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",22),e.\u0275\u0275elementStart(1,"div",23),e.\u0275\u0275elementStart(2,"ul",24),e.\u0275\u0275elementStart(3,"li",25),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().prevPage()}),e.\u0275\u0275element(4,"button",26),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Rt,3,4,"li",27),e.\u0275\u0275elementStart(6,"li",25),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().nextPage()}),e.\u0275\u0275element(7,"button",26),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",28),e.\u0275\u0275elementStart(9,"label"),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(7,Ft,t.bDisablePrev||0==t.pageNumber)),e.\u0275\u0275advance(1),e.\u0275\u0275property("className","pageStart"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.pagesIndex),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(9,Ft,t.bDisableNext||0==t.pageNumber)),e.\u0275\u0275advance(1),e.\u0275\u0275property("className","pageend"),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate2("Showing Page ",t.currentIndex," of ",t.pageNumber,"")}}let wt=(()=>{class S{constructor(t,r){this.httpService=t,this.logService=r,this.summaryRow=[],this.detailRow=[],this.showProgressBar=!1,this.isDataFound=!1,this.Date="",this.summaryColumns=[],this.detailColumns=[],this.clientOrderNo="",this.pageSize=5,this.pages=5,this.defaultPageSize=9999,this.pageNumber=0,this.currentIndex=1,this.pageStart=1,this.bDisableNext=!1,this.bDisablePrev=!0}ngOnInit(){this.noDataFoundMsg=n.xB.dMsgMaster.NNSL708,this.summaryRowObj=this.context.params,this.setPage(parseInt(n.gT.C_S_GTD_PAGE_INDEX))}getOrderBookSummary(t,r=1){try{this.showProgressBar=!0,this.isDataFound=!1,this.httpService.postData(n.xB.tradingAPIUrl,"FetchGTDOrderSummary",{UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",GTDOrderId:t.GTDOrderId,PageIndex:r,PageSize:n.gT.C_S_GTD_PAGE_SIZE}).subscribe(d=>{if(this.showProgressBar=!1,this.isDataFound=!0,this.summaryRow=[],d.ResponseStatus){if(d.ResponseObject.Table.length>0){this.initHeader(),this.gtdSummaryObj=d.ResponseObject.Table,this.recordCount=this.gtdSummaryObj[0].TotalCount;for(var I=0;I<this.gtdSummaryObj.length;I++)this.summaryRow.push({Id:I+1,Date:this.gtdSummaryObj[I].Date,OrderEntryTime:this.gtdSummaryObj[I].OrderEntryTime,GTDOrderId:this.gtdSummaryObj[I].GTDOrderId,ExchangeOrderNumber:this.gtdSummaryObj[I].ExchangeOrderNumber,ClientOrderNumber:this.gtdSummaryObj[I].ClientOrderNumber,QuantityOpen:this.gtdSummaryObj[I].QuantityOpen,QuantityExcuted:this.gtdSummaryObj[I].QuantityExcuted,PrevTradedQuantity:this.gtdSummaryObj[I].PrevTradedQuantity,TotalQuantity:this.gtdSummaryObj[I].TotalQuantity,Price:this.gtdSummaryObj[I].Price,GTDOrderStatus:this.gtdSummaryObj[I].GTDOrderStatus,Status:this.gtdSummaryObj[I].Status,Exchange:t.Exchange,IsDetailVisible:!1,SchmDtlHeader:"",SchmWiseHld:"",CheckBoxTreeClass:"ExpandCheckBoxTree",TotalCount:this.gtdSummaryObj[I].TotalCount})}}else this.showProgressBar=!1,this.isDataFound=!1;this.init(r)},d=>{this.showProgressBar=!1,this.isDataFound=!1})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getOrderBookSummary","gtd-order-summary-detail.component.ts","")}}getGtdOrderDetail(t){try{this.Date=this.Date!=t.Date?t.Date:"";const r={UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",GTDOrderId:t.GTDOrderId,Date:n.vV.formatMonthStringToNum(t.Date),PageIndex:n.gT.C_V_GTD_MAX_PAGE_INDEX,PageSize:n.gT.C_V_GTD_MAX_PAGE_SIZE};this.httpService.postData(n.xB.tradingAPIUrl,"FetchGTDOrderDetails",r).subscribe(s=>{if(s.ResponseStatus&&s.ResponseObject.Table.length>0){this.detailRow=[],this.gtdDetailObj=s.ResponseObject.Table;for(let d=0;d<this.gtdDetailObj.length;d++)this.detailRow.push({Id:this.gtdDetailObj[d].Id,TotalQuantity:this.gtdDetailObj[d].TotalQuantity,QuantityOpen:this.gtdDetailObj[d].QuantityOpen,QuantityExcuted:this.gtdDetailObj[d].QuantityExcuted,Price:this.gtdDetailObj[d].Price,Time:this.gtdDetailObj[d].Time.slice(11,19),Settlor:this.gtdDetailObj[d].Settlor,PartType:this.gtdDetailObj[d].PartType,Reason:this.gtdDetailObj[d].Reason,Status:this.gtdDetailObj[d].Status});this.summaryRow=[];for(let d=0;d<this.gtdSummaryObj.length;d++)this.summaryRow.push(this.Date==this.gtdSummaryObj[d].Date?{Id:d+1,Date:this.gtdSummaryObj[d].Date,OrderEntryTime:this.gtdSummaryObj[d].OrderEntryTime,GTDOrderId:this.gtdSummaryObj[d].GTDOrderId,ExchangeOrderNumber:this.gtdSummaryObj[d].ExchangeOrderNumber,ClientOrderNumber:this.gtdSummaryObj[d].ClientOrderNumber,QuantityOpen:this.gtdSummaryObj[d].QuantityOpen,QuantityExcuted:this.gtdSummaryObj[d].QuantityExcuted,PrevTradedQuantity:this.gtdSummaryObj[d].PrevTradedQuantity,TotalQuantity:this.gtdSummaryObj[d].TotalQuantity,Price:this.gtdSummaryObj[d].Price,GTDOrderStatus:this.gtdSummaryObj[d].GTDOrderStatus,Status:this.gtdSummaryObj[d].Status,IsDetailVisible:!0,SchmDtlHeader:this.detailColumns,SchmWiseHld:this.detailRow,CheckBoxTreeClass:"CollapseCheckBoxTree"}:{Id:d+1,Date:this.gtdSummaryObj[d].Date,OrderEntryTime:this.gtdSummaryObj[d].OrderEntryTime,GTDOrderId:this.gtdSummaryObj[d].GTDOrderId,ExchangeOrderNumber:this.gtdSummaryObj[d].ExchangeOrderNumber,ClientOrderNumber:this.gtdSummaryObj[d].ClientOrderNumber,QuantityOpen:this.gtdSummaryObj[d].QuantityOpen,QuantityExcuted:this.gtdSummaryObj[d].QuantityExcuted,PrevTradedQuantity:this.gtdSummaryObj[d].PrevTradedQuantity,TotalQuantity:this.gtdSummaryObj[d].TotalQuantity,Price:this.gtdSummaryObj[d].Price,GTDOrderStatus:this.gtdSummaryObj[d].GTDOrderStatus,Status:this.gtdSummaryObj[d].Status,IsDetailVisible:!0,SchmDtlHeader:"",SchmWiseHld:"",CheckBoxTreeClass:"ExpandCheckBoxTree"})}},s=>{})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getGtdOrderDetail","gtd-order-summary-detail.component.ts","")}}initHeader(){this.summaryColumns=[],this.detailColumns=[],this.summaryColumns.push({name:"",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"Date",name:"Date",cType:"S",width:30}),this.summaryColumns.push({footer:!0,value:"OrderEntryTime",name:"Order Entry Time",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"ExchangeOrderNumber",name:"Exch. Order No.",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"ClientOrderNumber",name:"Client Order No.",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"Price",name:"Price",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"QuantityOpen",name:"Open Qty",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"TotalQuantity",name:"Total Qty",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"QuantityExcuted",name:"Executed Qty",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"PrevTradedQuantity",name:"Prev. Traded Qty",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"GTDOrderStatus",name:"GTD Ord. Status",cType:"S",width:10}),this.summaryColumns.push({footer:!0,value:"Status",name:" Ord. Status",cType:"S",width:10}),this.detailColumns.push({value:"Id",name:"Id",cType:"S",width:10}),this.detailColumns.push({value:"Time",name:"Time",cType:"S",width:10}),this.detailColumns.push({value:"Price",name:"Price",cType:"S",width:10}),this.detailColumns.push({value:"QuantityOpen",name:"Open Qty",cType:"S",width:10}),this.detailColumns.push({value:"TotalQuantity",name:"Total Qty",cType:"S",width:10}),this.detailColumns.push({value:"QuantityExcuted",name:"Executed Qty",cType:"S",width:10}),this.detailColumns.push({value:"Settlor",name:"Settlor",cType:"S",width:10}),this.detailColumns.push({value:"PartType",name:"Part Type",cType:"S",width:10}),this.detailColumns.push({value:"Status",name:" Ord. Status",cType:"S",width:10}
1),this.detailColumns.push({value:"Reason",name:"Reason",cType:"S",width:10})}init(t){this.pages=5;let r=0;r=this.recordCount,this.currentIndex=t,this.defaultPageSize=this.pageSize,this.pageNumber=parseInt(""+Math.ceil(r/this.defaultPageSize)),this.pageNumber<this.pages&&(this.pages=this.pageNumber),this.pagesIndex=this.fillArray(),this.bDisableNext=!!this.pagesIndex.Contains(this.pageNumber)}fillArray(){for(var t=new Array,r=this.pageStart;r<this.pageStart+this.pages;r++)r<=this.pageNumber&&t.push(r);return t}prevPage(){this.bDisablePrev||(this.currentIndex>1&&(this.currentIndex=this.pagesIndex[0]),1!=this.pageStart&&(this.pageStart=this.pagesIndex[0]-this.pages,this.currentIndex=this.pageStart,this.pagesIndex=this.fillArray()),1==this.pageStart&&(this.bDisablePrev=!0),this.pagesIndex[this.pagesIndex.length-1]<this.pageNumber&&(this.bDisableNext=!1)),this.setPage(this.pagesIndex[0])}nextPage(){this.pagesIndex[this.pagesIndex.length-1]==this.pageNumber?this.bDisableNext=!0:(this.currentIndex=this.pagesIndex[this.pagesIndex.length-1],this.currentIndex<this.pageNumber&&this.currentIndex++,this.currentIndex>=this.pageStart+this.pages&&(this.pageStart=this.currentIndex),this.pagesIndex=this.fillArray(),this.pagesIndex.Contains(this.pageNumber)&&(this.bDisableNext=!0),this.bDisablePrev=1==this.pagesIndex[0],this.setPage(this.pagesIndex[0]))}setPage(t){this.getOrderBookSummary(this.summaryRowObj,t)}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["app-gtd-order-summary-detail"]],inputs:{context:"context"},decls:8,vars:4,consts:[[1,"gtd_odr_summary"],[4,"ngIf"],["class","nodatafound",4,"ngIf"],[1,"reportsgrid"],["id","AMCMFholding","class","wp100 mar-0Auto","cellpadding","0","cellspacing","0",4,"ngIf"],[1,"details_pagination"],["class","pagination",4,"ngIf"],[3,"type"],[1,"nodatafound"],["id","AMCMFholding","cellpadding","0","cellspacing","0",1,"wp100","mar-0Auto"],[4,"ngFor","ngForOf"],[1,"ht03","odd","mdetail",3,"click"],[3,"ngClass"],[1,"cliptext","taL"],[1,"cliptext","taR"],["colspan","14","class","pad0","id","divSchemeWiseUH",4,"ngIf"],["colspan","14","id","divSchemeWiseUH",1,"pad0"],[1,"MF_Details","max_height"],["border","0","cellspacing","0","cellpadding","0",1,"wp100"],[1,"ht03"],[1,"cliptext"],[1,"cliptext","taR","whiteSpce"],[1,"pagination"],[1,"number"],[1,"float-right"],[3,"ngClass","click"],[2,"cursor","pointer",3,"className"],[3,"ngClass","click",4,"ngFor","ngForOf"],[1,"Paging_name"],["href","javascript:void(0);"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,De,2,1,"div",1),e.\u0275\u0275template(2,Ke,3,1,"div",2),e.\u0275\u0275elementStart(3,"div"),e.\u0275\u0275elementStart(4,"div",3),e.\u0275\u0275template(5,vt,5,2,"table",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",5),e.\u0275\u0275template(7,Nt,11,11,"div",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.isDataFound&&!r.showProgressBar),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",r.isDataFound&&!r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isDataFound&&!r.showProgressBar))},directives:[W.O5,V.R,W.sg,W.mk],encapsulation:2}),S})();const Bt=["reportGrid"],Gt=["cellTmplModify"],Ut=["cellTmplSummary"];function Wt(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",5),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Ht(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"reportgrid",7,8),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("hidden",t.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("layoutMode",t.layoutMode)("fhTopHeight","40px")("showPaging",!0)("pageSize",6)("blockViewTmpl",t.blockViewTmpl)("noD
1ataFoundMsg",t.noDataFoundMsg)("fixedHdrConfig",t.fixedHdrConfig)("columns",t.columns)("rows",t.dispGTDOBArr)("showFilter",t.showFilter)("showSort",!0)}}function Qt(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",12),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateOEFromGOB(s)}),e.\u0275\u0275text(1," Modify "),e.\u0275\u0275elementEnd()}}function Yt(S,O){1&S&&(e.\u0275\u0275elementStart(0,"span",13),e.\u0275\u0275text(1,"|"),e.\u0275\u0275elementEnd())}function Xt(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",14),e.\u0275\u0275listener("click",function(s){e.\u0275\u0275restoreView(t);const d=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().onWithdrawGTDOrderClick(d,s)}),e.\u0275\u0275text(1," Withdraw "),e.\u0275\u0275elementEnd()}}function Kt(S,O){if(1&S&&(e.\u0275\u0275template(0,Qt,2,0,"div",9),e.\u0275\u0275template(1,Yt,2,0,"span",10),e.\u0275\u0275template(2,Xt,2,0,"div",11)),2&S){const t=O.row;e.\u0275\u0275property("ngIf",1==t.ModifyFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.ModifyFlag&&1==t.CancelFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.CancelFlag)}}let ee=(()=>{class S{constructor(t,r,s,d,I,M,U){this.httpService=t,this.dialogService=r,this.logService=s,this.menuManager=d,this.pubsubService=I,this.zone=M,this.cdr=U,this.isGTDOB=!1,this.isGTDHB=!1,this.dcOrderDetails=new n.aM,this.isConfirmCancelled=!1,this.tempGTDOBArr=[],this.dispGTDOBArr=[],this.totalRecord=0,this.showFilter=!1,this.showProgressBar=!1,this.timer=null,this.tempGTDHBArr=[],this.dispGTDHBArr=[],this.pageStart=1,this.isExport=!1,this.excelName="GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Order Book":"GTT Order Book",this.noDataFoundMsg="Looks like you have no orders at this moment",this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.GTDCount=0,this.GTDOrderType=null,this.recordCount=0,this.onActiveButton=new e.EventEmitter}ngOnInit(){try{this.layoutMode="G",this.GTDOrderType=1,this.radioChanges({value:this.GTDOrderType}),this.subscribeMessages()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit","gtd-order-history-book.component.ts","")}}initHeadersGTDOB(){this.columns=[],this.columns.push({value:"Action",name:"Action",cType:"",sort:!1,filter:!1,export:!1,cellTemplate:this.cellTmplModify}),this.columns.push({value:"GTDOrderId",name:"GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Ord. ID":"GTT Ord. ID",cType:"S"}),this.columns.push({value:"Exchange",name:"Exch.",cType:"S"}),this.columns.push({value:"Instrument",name:"Instrument",cType:"S"}),this.columns.push({value:"Symbol",name:"Symbol",cType:"S"}),this.columns.push({value:"Series",name:"Series",cType:"S"}),this.columns.push({value:"ExpDate",name:"Exp.Date",cType:"S"}),this.columns.push({value:"StrPrice",name:"Str.Price",cType:"S"}),this.columns.push({value:"OptType",name:"Opt.Type",cType:"S"}),this.columns.push({value:"GTDOrderStatus",name:"GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Ord. Status":"GTT Ord. Status",cType:"S"}),this.columns.push({value:"BuySell",name:"Buy/Sell",cType:"S"}),this.columns.push({value:"OrderType",name:"Order Type",cType:"S"}),this.columns.push({value:"Price",name:"Price",cType:"N"}),this.columns.push({value:"TriggerPrice",name:"Trigger Price",cType:"N"}),this.columns.push({value:"TargetPrice",name:"Target Price",cType:"N"}),this.columns.push({value:"TargetTriggerPrice",name:"Target Trigger Price",cType:"N"}),this.columns.push({value:"QuantityOpen",name:"Open Qty",cType:"N"}),this.columns.push({value:"TotalQuantity",name:"Total Qty",cType:"N"}),this.columns.push({value:"QuantityExecuted",name:"Executed Qty",cType:"N"}),this.columns.push({value:"PrevTradedQuantity",name:"Prev. Traded Qty",cType:"N"}),this.columns.push({value:"GTDDay",name:"GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Day":"GTT Day",cType:"N"}),this.columns.push({value:"GTDDate",name:"GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Date":"GTT Date",cType:"S"}),this.columns.push({value:"GTDOrdTime",name:"GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Ord. Time":"GTT Ord. Time",cType:"S"}),this.columns.push({value:"Error",name:"Error",cType:"S"}),this.columns.push({value:"InitiatedFrom",name:"Initiated From",cType:"S"}),this.columns.push({value:"ModifiedFrom",name:"Modified From",cType:"S"})}getGTDOrderBook(){try{this.showProgressBar=!0;var t={};
1t.UserID=n.xB.User.UserId,t.GroupID=n.xB.User.GroupId,t.UCCClientID="",t.UCCGroupID="",t.MktSegId="0",t.Symbol="",this.httpService.postData(n.xB.tradingAPIUrl,"FetchGTDOrderBook",t).subscribe(r=>{this.gtdOrderBookRes(r)},()=>{this.showProgressBar=!1})}catch(r){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+r.message,"getGTDOrderBook","gtd-order-history-book.component.ts","")}}gtdOrderBookRes(t){try{if(null!=t||null!=t)if(this.dispGTDOBArr=[],null!=t.ResponseObject.objJSONRows||null!=t.ResponseObject.objJSONRows){this.tempGTDOBArr=t.ResponseObject.objJSONRows,this.initHeadersGTDOB(),this.GTDCount=this.tempGTDOBArr.length;for(var r=0;r<this.tempGTDOBArr.length;r++){var s=n.xB.ExchManager.GetCurrentExchange(this.tempGTDOBArr[r].Exchange).dcMarketSegementId[n.gT.C_S_INSTRUMENT_EQUITIES_TEXT],d=new m.u;d.ScripDet.Token=this.tempGTDOBArr[r].ScripCode,d.ScripDet.MktSegId=s,d.ExchangeName=this.tempGTDOBArr[r].Exchange,d.InstrumentName=this.tempGTDOBArr[r].Instrument,d.Symbol=this.tempGTDOBArr[r].Symbol,d.Series=this.tempGTDOBArr[r].Series,d.ExpiryDate=this.tempGTDOBArr[r].ExpDate,d.StrikePrice="NA"==this.tempGTDOBArr[r].StrPrice?0:this.tempGTDOBArr[r].StrPrice,d.OptionType=this.tempGTDOBArr[r].OptType,d.DecimalLocator=this.tempGTDOBArr[r].DecimalLoc,d.MarketLot=this.tempGTDOBArr[r].MarketLot,d.PriceTick=this.tempGTDOBArr[r].PriceTick,this.dispGTDOBArr.push({ModifyFlag:this.tempGTDOBArr[r].ModifyFlag,CancelFlag:this.tempGTDOBArr[r].CancelFlag,GTDOrderId:0!=this.tempGTDOBArr[r].GTDOrderId?this.tempGTDOBArr[r].GTDOrderId:"",Exchange:this.tempGTDOBArr[r].Exchange,Symbol:this.tempGTDOBArr[r].Symbol,Series:this.tempGTDOBArr[r].Series,BuySell:this.tempGTDOBArr[r].BuySell,GTDDate:this.tempGTDOBArr[r].GTDDate,Price:this.tempGTDOBArr[r].Price,TriggerPrice:this.tempGTDOBArr[r].TriggerPrice,GTDOrderStatus:this.tempGTDOBArr[r].GTDOrderStatus,Status:this.tempGTDOBArr[r].Status,TotalQuantity:this.tempGTDOBArr[r].TotalQuantity,QuantityOpen:this.tempGTDOBArr[r].QuantityOpen,QuantityExecuted:this.tempGTDOBArr[r].QuantityExecuted,GTDDay:this.tempGTDOBArr[r].GTDDay,PrevTradedQuantity:this.tempGTDOBArr[r].PrevTradedQuantity,OrderType:this.tempGTDOBArr[r].OrderType,MarketSegID:s,OrderTime:this.tempGTDOBArr[r].OrderTime,GatewayOrderNumber:this.tempGTDOBArr[r].GatewayOrderNumber,ExchangeOrderNumber:this.tempGTDOBArr[r].ExchangeOrderNumber,ClientOrderNumber:this.tempGTDOBArr[r].ClientOrderNumber,ProdType:this.tempGTDOBArr[r].ProdType,DiscQty:this.tempGTDOBArr[r].DiscQty,ScripCode:this.tempGTDOBArr[r].ScripCode,MarketLot:this.tempGTDOBArr[r].MarketLot,PriceTick:this.tempGTDOBArr[r].PriceTick,DecimalLoc:this.tempGTDOBArr[r].DecimalLoc,GTDOrdTime:this.tempGTDOBArr[r].GTDOrdTime.indexOf("1970")>0?"":this.tempGTDOBArr[r].GTDOrdTime,Instrument:this.tempGTDOBArr[r].Instrument,ExpDate:this.tempGTDOBArr[r].ExpDate,StrPrice:this.tempGTDOBArr[r].StrPrice,OptType:this.tempGTDOBArr[r].OptType,TargetTriggerPrice:this.tempGTDOBArr[r].TargetTriggerPrice,TargetPrice
1:this.tempGTDOBArr[r].TargetPrice,Error:this.tempGTDOBArr[r].Error,InitiatedFrom:this.tempGTDOBArr[r].InitiatedFrom,ModifiedFrom:this.tempGTDOBArr[r].ModifiedFrom,scrip:d})}}else if(t.ErrorMessages.length>0){var I=Ze.h.ErrorMessages(t.ErrorMessages);""!=I&&this.dialogService.alert(I)}}catch(M){this.logService.WriteLog("Exception: "+M.message,"gtdOrderBookRes","gtd-order-history-book.component.ts","")}finally{this.showProgressBar=!1}}initHeaderGTDHB(){this.columns=[],this.columns.push({value:"summary",name:"Remarks",cType:"",sort:!1,filter:!1,export:!1,cellTemplate:this.cellTmplSummary}),this.columns.push({value:"GTDOrderId",name:"GTD Ord. ID",cType:"S"}),this.columns.push({value:"Exchange",name:"Exch.",cType:"S"}),this.columns.push({value:"Symbol",name:"Symbol",cType:"S"}),this.columns.push({value:"Series",name:"Series",cType:"S"}),this.columns.push({value:"BuySell",name:"Buy/Sell",cType:"S"}),this.columns.push({value:"Price",name:"Price",cType:"N"}),this.columns.push({value:"QuantityOpen",name:"Open Qty",cType:"N"}),this.columns.push({value:"TotalQuantity",name:"Total Qty",cType:"N"}),this.columns.push({value:"QuantityExcuted",name:"Executed Qty",cType:"N"}),this.columns.push({value:"PrevTradedQuantity",name:"Prev. Traded Qty",cType:"N"}),this.columns.push({value:"GTDOrderStatus",name:"GTD Ord. Status",cType:"S"}),this.columns.push({value:"Status",name:"Ord. Status",cType:"S"})}getGTDHistoryBook(t=1,r=6){try{if(!this.DateValidation(this.FromDate.toString("MM/dd/yyyy"),this.ToDate.toString("MM/dd/yyyy")))return void(this.showProgressBar=!1);this.showProgressBar=!0;var s={};s.UserID=n.xB.User.UserId,s.GroupID=n.xB.User.GroupId,s.UCCClientID="",s.UCCGroupID="",s.PageIndex=t,s.PageSize=r,s.FromDate=this.FromDate.toString("dd-MM-yyyy"),s.ToDate=this.ToDate.toString("dd-MM-yyyy"),this.httpService.postData(n.xB.tradingAPIUrl,"FetchGTDOrderBookHistory",s).subscribe(d=>{this.gtdHistoryBookRes(d)},()=>{this.showProgressBar=!1})}catch(d){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+d.message,"getGTDHistoryBook","gtd-order-history-book.component.ts","")}}DateValidation(t,r){try{var s=!0,d=(new Date).toString("MM/dd/yyyy"),I=[],U=Math.abs(Date.parse(t)-Date.parse(r)),q=Math.round(U/864e5);if(null==t||null==t||""==t.toString()?(s=!1,this.dialogService.alert("From date is not Provided")):(null==r||null==r||""==r.toString())&&(s=!1,this.dialogService.alert("To date is not Provided")),Date.parse(t)>=Date.parse(d)&&(s=!1,I.push("From date should be less than Today's Date <br> ")),Date.parse(r)>=Date.parse(d)?(s=!1,I.push("To date should be less than Today's Date <br> ")):Date.parse(t)>Date.parse(r)?(s=!1,I.push("From date should be less than or equal to To date <br>")):q>365&&(s=!1,I.push("Gap between from date and to date cannot be more than 365 day <br>")),null!=I&&!s){var j=I.join(" ");this.dialogService.alert(j)}}catch(Ie){s=!1,this.logService.WriteLog("Exception: "+Ie.message,"DateValidation","gtd-order-history-book.component.ts","")}return s}gtdHistoryBookRes(t){try{if(null!=t||null!=t)if(this.dispGTDHBArr=[],null!=t.ResponseObject.Table||null!=t.ResponseObject.Table){this.tempGTDHBArr=t.ResponseObject.Table,this.recordCount=this.tempGTDHBArr[0].TotalCount,this.initHeaderGTDHB();for(var r=0;r<this.tempGTDHBArr.length;r++)this.dispGTDHBArr.push({GTDOrderId:0!=this.tempGTDHBArr[r].GTDOrderId?this.tempGTDHBArr[r].GTDOrderId:"",Exchange:this.tempGTDHBArr[r].Exchange,Symbol:this.tempGTDHBArr[r].Symbol,Series:this.tempGTDHBArr[r].Series,Price:this.tempGTDHBArr[r].Price,GTDOrderStatus:this.tempGTDHBArr[r].GTDOrderStatus,Status:this.tempGTDHBArr[r].Status,QuantityOpen:this.tempGTDHBArr[r].QuantityOpen,QuantityExcuted:this.tempGTDHBArr[r].QuantityExcuted,BuySell:this.tempGTDHBArr[r].BuySell,TotalQuantity:this.tempGTDHBArr[r].TotalQuantity,PrevTradedQuantity:this.tempGTDHBArr[r].PrevTradedQuantity,TotalCount:this.tempGTDHBArr[r].TotalCount});this.isExport&&(this.cdr.detectChanges(),this.reportGrid.exportCSV(this.excelName),this.isExport=!1)}else if(t.ErrorMessages.length>0){var s=Ze.h.ErrorMessages(t.ErrorMessages);""!=s&&this.dialogService.alert(s)}}catch(d){this.logService.WriteLog("Exception: "+d.message,"gtdHistoryBookRes","gtd-order-history-book.component.ts","")}finally{this.showProgressBar=!1}}changePageIndex(t){"object"==typeof t?(this.pi=t.pageIndex,this.getGTDHistoryBook(this.pi)):(this.pi=t,this.getGTDHistoryBook(this.pi))}getNewGTDHistoryBook(){this.reportGrid.resetPagination(),this.show
1Filter=!1,this.getGTDHistoryBook()}radioChanges(t){if(t.value==n.gT.C_S_GTD_Active_Order)this.isGTDHB=!1,this.isGTDOB=!0,this.getGTDOrderBook();else if(t.value==n.gT.C_S_GTD_History_Order){var r=new Date;this.FromDate=new Date(r.setDate(r.getDate()-1)),this.ToDate=new Date(r.setDate(r.getDate())),this.isGTDHB=!0,this.isGTDOB=!1,this.getGTDHistoryBook()}this.onActiveButton.emit(this.isGTDHB)}refreshGTD(){this.radioChanges({value:this.GTDOrderType})}onFilterGTD(){this.showFilter=!this.showFilter,this.isGTDHB&&this.showFilter&&this.getGTDHistoryBook(n.gT.C_V_GTD_MAX_PAGE_INDEX,n.gT.C_V_GTD_MAX_PAGE_SIZE)}exportGTD(){this.isGTDHB?(this.isExport=!0,this.getGTDHistoryBook(n.gT.C_V_GTD_MAX_PAGE_INDEX,n.gT.C_V_GTD_MAX_PAGE_SIZE)):this.reportGrid.exportCSV(this.excelName)}getSummary(t){try{""!=t&&this.dialogService.openComponent("Summary Details",wt,t,"1150px","530px",!0).afterClosed().subscribe(d=>{this.onAlertClose(d)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getSummary()","gtd-order-history-book.component.ts","")}}onAlertClose(t){}PopulateOEFromGOB(t){try{var r=new h.Q(t.scrip);r.OrderSide="B"==t.BuySell?"BUY":"SELL",r.OrderType=t.OrderType==n.gT.C_S_ORDER_STOPLOSS_TEXT||t.OrderType==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?n.gT.C_S_ORDER_STOPLOSS_TEXT:n.gT.C_S_ORDER_REGULARLOT_TEXT,r.OrderType=t.OrderType,r.Qty=t.QuantityOpen,r.LastPendingQty=t.QuantityOpen,r.SellPrice=t.Price,t.OrderType==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||t.OrderType==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?(r.BuyPrice=0,r.SellPrice=0):(r.BuyPrice=t.Price,r.SellPrice=t.Price),r.DiscQty=t.DiscQty,r.TriggerPrice=t.TriggerPrice,r.ProductType=t.ProductType,r.Validity="GTD"==n.gT.C_S_VALUE_EQUITY_GTD?n.gT.C_S_VALUE_EQUITY_GTD:n.gT.C_S_VALUE_GTT,r.DecimalLocator=t.DecimalLoc,r.ProductType=t.ProdType,r.Exchange=t.Exchange,r.Symbol=t.Symbol,r.Instrument=t.Instrument,r.MarketLot=t.MarketLot,r.PriceTick=t.PriceTick,r.Series=t.Series,r.Days=t.GTDDay,r.MarketSegID=t.MarketSegID,r.ClientOrderNumber=t.ClientOrderNumber,r.TokenNo=t.ScripCode,r.ExchangeOrderNo=t.ExchangeOrderNumber,r.GatewayOrderNo=t.GatewayOrderNumber,r.OrderTime=t.OrderTime,r.isSOR=!1,r.PageSource=n.gT.C_V_GTDORDERBOOK_PAGENO.toString(),r.BracketOrderModifyBit=t.BracketOrdModifyBit,r.LastTradedQty=t.QuantityOpen,r.TargetPrice=t.TargetPrice,r.TargetTriggerPrice=t.TargetTriggerPrice,this.menuManager.invokeMenu(n.gT.C_S_MENU_OE_SPOT,{sourceId:n.gT.C_V_GTDORDERBOOK_PAGENO,data:r})}catch(s){this.logService.WriteLog("Exception: "+s.message,"PopulateOEFromGOB()","gtd-order-history-book.component.ts","")}}WithdrawEQGTD(t){for(var r=!1,s=0;s<this.dispGTDOBArr.length;s++)if(1==this.dispGTDOBArr[s].isCheckSelected){r=!0;break}r?this.dialogService.confirm("Would you like to withdraw the order(s)","Yes","No").subscribe(I=>{I?this.withdrawSelectedOrders(t):this.noCallbackWithdrawOrders()}):this.dialogService.alert("Kindly select atleast one order to Withdraw","GTD Order Book")}withdrawSelectedOrders(t){var r=this.dispGTDOBArr;for(let s=0;s<r.length;s++)1==r[s].isCheckSelected&&this.SendWithdrawOrderRequest(r[s])}noCallbackWithdrawOrders(){this.isConfirmCancelled=!0}onWithdrawGTDOrderClick(t){try{this.dialogService.confirm("Would you like to withdraw the order(s)","Yes","No").subscribe(s=>{s?setTimeout(()=>{this.SendWithdrawOrderRequest(t)},300):this.noCallbackWithdrawOrders()})}catch(s){this.logService.WriteLog("Exception: "+s.message,"onWithdrawGTDOrderClick()","gtd-order-history-book.component.ts","")}}subscribeMessages(){null==this.sub&&(this.sub=this.pubsubService.subscribe("OLRES",(t,r)=>{(r.MsgCode==n.gT.C_V_MSGCODES_GTDORDER_ORDER_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_GTDORDER_ORDER_ACKNOWLEDGEMENT)&&(this.timer=setTimeout(()=>{this.zone.run(()=>{this.getGTDOrderBook()})},600))}))}SendWithdrawOrderRequest(t){try{var r=n.xB.ExchManager.GetCurrentExchange(t.Exchange).dcMarketSegementId[t.Instrument];this.dcOrderDetails.add("SelOperation",t.BuySell),this.dcOrderDetails.add("SelExchange",t.Exchange),this.dcOrderDetails.add("SelInstrument",t.Instrument),this.dcOrderDetails.add("MarketSegmentId",r),this.dcOrderDetails.add("MapMarketSegmentId"," "),this.dcOrderDetails.add("SelSymbol",t.Symbol),this.dcOrderDetails.add("SelSeries",t.Series),this.dcOrderDetails.add("SelQty",t.QuantityOpen),this.dcOrderDetails.add("SelPrice",t.Price),this.dcOrderDetails.add("SelDiscQty",t.DiscQty),this.dcOrderDetails.add("SelTriggerPrice",t.TriggerPrice),this.dcOrderDetails.add("SelDay",t.GTDDay),this.dcOrderDetails.add("SelValidity","GTD"==n.gT.C_S_VALUE_EQUITY_GTD?n.gT.C_S_VALUE_EQUITY_GTD:n.gT.C_S_VALUE_GTT),this.dcOrderDetails.add("SelProduct",t.ProdType),this.dcOrderDetails.add("SelMarketLot",t.MarketLot),this.dcOrderDetails.add("SelDecimalloc",t.DecimalLoc),this.dcOrderDetails.add("SelPriceTick",t.PriceTick),this.dcOrderDetails.add("SelToken",t.ScripCode),this.dcOrderDetails.add("ModifyFlag",!1),this.dcOrderDetails.add("CancelFlag",!0),this.dcOrderDetails.add("AMOID",""),this.dcOrderDetails.add("ExchangeOrderNo",t.ExchangeOrderNumber),this.dcOrderDetails.add("ClientOrderNumber",t.ClientOrderNumber),this.dcOrderDetails.add("GatewayOrderNo",t.GatewayOrderNumber),this.dcOrderDetails.add("OrderTime",t.OrderTime);var s="B"==t.BuySell?"BUY":"SELL",d="B"==t.BuySell?"1":"2";this.dcOrderDetails.add("SelOrderTypes",t.OrderType),this.dcOrderDetails.add("SelOperation",s),this.dcOrderDetails.add("BuyOrSell",d),this.dcOrderDetails.add("PageSource",n.gT.C_V_GTDORDERBOOK_PAGENO),this.dcOrderDetails.add("isGTT",!0),this.dcOrderDetails.add("IsSpread","0"),this.dcOrderDetails.add("isGTD",!0);
1var I=n.xB.ExchManager.FillOrderRequest(this.dcOrderDetails,!0);this.pubsubService.publish("OEREQ",I)}catch(M){this.logService.WriteLog("Exception: "+M.message,"SendWithdrawOrderRequest()","gtd-order-history-book.component.ts","")}}ngOnDestroy(){this.pubsubService.unsubscribe(this.sub)}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n._V),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(e.ChangeDetectorRef))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["gtd-order-history-book"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(Bt,5),e.\u0275\u0275viewQuery(Gt,7),e.\u0275\u0275viewQuery(Ut,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplModify=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplSummary=s.first)}},outputs:{onActiveButton:"onActiveButton"},decls:6,vars:2,consts:[[1,"eqsip-ord-bk","gtd_odr"],[1,"container-fluid"],[4,"ngIf"],[3,"hidden",4,"ngIf"],["cellTmplModify",""],[3,"type"],[3,"hidden"],[3,"layoutMode","fhTopHeight","showPaging","pageSize","blockViewTmpl","noDataFoundMsg","fixedHdrConfig","columns","rows","showFilter","showSort"],["reportGrid",""],["class","Modify_Text displ-Style",3,"click",4,"ngIf"],["class","marLR5",4,"ngIf"],["class","cursor displ-Style alert-error",3,"click",4,"ngIf"],[1,"Modify_Text","displ-Style",3,"click"],[1,"marLR5"],[1,"cursor","displ-Style","alert-error",3,"click"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,Wt,2,1,"div",2),e.\u0275\u0275template(3,Ht,3,12,"div",3),e.\u0275\u0275template(4,Kt,3,3,"ng-template",null,4,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.isGTDOB))},directives:[W.O5,V.R,Me.i],encapsulation:2}),S})();var ve=x(2765);const y=["reportGrid"],B=["cellTmplModify"],se=["cellTmplSummary"];function _e(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",6),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Ae(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateMLOEFromMLOB(s)}),e.\u0275\u0275text(1," Modify "),e.\u0275\u0275elementEnd()}}function Ye(S,O){1&S&&(e.\u0275\u0275elementStart(0,"span",11),e.\u0275\u0275text(1,"|"),e.\u0275\u0275elementEnd())}function Le(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",12),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().onCancelMLOrderClick(s)}),e.\u0275\u0275text(1," Cancel "),e.\u0275\u0275elementEnd()}}function $e(S,O){if(1&S&&(e.\u0275\u0275template(0,Ae,2,0,"div",7),e.\u0275\u0275template(1,Ye,2,0,"span",8),e.\u0275\u0275template(2,Le,2,0,"div",9)),2&S){const t=O.row;e.\u0275\u0275property("ngIf",1==t.ModifyFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.ModifyFlag&&1==t.CancelFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.CancelFlag)}}let we=(()=>{class S{constructor(t,r,s,d,I,M){this.httpService=t,this.dialogService=r,this.logService=s,this.menuManager=d,this.pubsubService=I,this.zone=M,this.totalRecord=0,this.showFilter=!1,this.showProgressBar=!1,this.timer=null,this.noDataFoundMsg="Looks like you have no orders at this moment",this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.tempMLOBArr=[],this.dispMLOBArr=[],this.selSpreadObj=new ve.P,this.selScripObjLeg1=new ve.P,this.selScripObjLeg2=new ve.P,this.selScripObjLeg3=new ve.P,this.Scrip=new ve.P,this.spreadScrip=[],this.dcOrderDetails=new n.aM,this.ModifyFlag=!1,this.CancelFlag=!1,this.IsSpread=!0,this.IsT
1woLeg=!1,this.IsThreeLeg=!1,this.isConfirmCancelled=!1,this.MultilegCount=0}ngOnInit(){try{this.layoutMode="G";try{this.OBRefreshTimer=parseInt(n.xB.dConfigMaster.FINALYTICS_ORDER_BOOK_REFRESH_TIMER)}catch(t){this.OBRefreshTimer=600}(NaN==Number(this.OBRefreshTimer)||0==Number(this.OBRefreshTimer))&&(this.OBRefreshTimer=600),this.subscribeMessages()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit","gtd-order-history-book.component.ts","")}}initHeadersMLOB(){this.columns=[],this.columns.push({value:"CancelFlag",sort:!1,width:15,filter:!1,cType:"S",export:!1,isCheckboxable:!0}),this.columns.push({value:"Action",name:"Action",cType:"",sort:!1,filter:!1,export:!1,cellTemplate:this.cellTmplModify}),this.columns.push({value:"MultiLegType",name:"MultiLeg Type",cType:"S"}),this.columns.push({value:"L1BuySell",name:"L1BuySell",cType:"S"}),this.columns.push({value:"L1Sym",name:"L1Sym",cType:"S"}),this.columns.push({value:"L1ExpDate",name:"L1ExpDate",cType:"S"}),this.columns.push({value:"L1StrPrc",name:"L1StrPrc",cType:"N"}),this.columns.push({value:"L1OptType",name:"L1OptType",cType:"S"}),this.columns.push({value:"L1PendQty",name:"L1PendQty",cType:"N"}),this.columns.push({value:"L1Qty",name:"L1Qty",cType:"N"}),this.columns.push({value:"L1Prc",name:"L1Prc",cType:"N"}),this.columns.push({value:"L1ExOrderNo",name:"L1ExOrderNo",cType:"N"}),this.columns.push({value:"L2BuySell",name:"L2BuySell",cType:"S"}),this.columns.push({value:"L2Sym",name:"L2Sym",cType:"S"}),this.columns.push({value:"L2ExpDate",name:"L2ExpDate",cType:"S"}),this.columns.push({value:"L2StrPrc",name:"L2StrPrc",cType:"N"}),this.columns.push({value:"L2OptType",name:"L2OptType",cType:"S"}),this.columns.push({value:"L2PendQty",name:"L2PendQty",cType:"N"}),this.columns.push({value:"L2Qty",name:"L2Qty",cType:"N"}),this.columns.push({value:"L2Prc",name:"L2Prc",cType:"N"}),this.columns.push({value:"L2ExOrderNo",name:"L2ExOrderNo",cType:"N"}),this.columns.push({value:"L3BuySell",name:"L3BuySell",cType:"S"}),this.columns.push({value:"L3Sym",name:"L3Sym",cType:"S"}),this.columns.push({value:"L3ExpDate",name:"L3ExpDate",cType:"S"}),this.columns.push({value:"L3StrPrc",name:"L3StrPrc",cType:"N"}),this.columns.push({value:"L3OptType",name:"L3OptType",cType:"S"}),this.columns.push({value:"L3PendQty",name:"L3PendQty",cType:"N"}),this.columns.push({value:"L3Qty",name:"L3Qty",cType:"N"}),this.columns.push({value:"L3Prc",name:"L3Prc",cType:"N"}),this.columns.push({value:"L3ExOrderNo",name:"L3ExOrderNo",cType:"N"}),this.columns.push({value:"strOrderStatus",name:"OrdStat",cType:"S"}),this.columns.push({value:"strValidity",name:"Validity",cType:"S"}),this.columns.push({value:"Error",name:"Error",cType:"S"}),this.columns.push({value:"Time",name:"Time",cType:"N"}),this.columns.push({value:"OrderDate",name:"OrderDate ",cType:"S"}),this.columns.push({value:"OrderTime",name:"OrderTime",cType:"N"})}getMLOrderBook(){try{this.showProgressBar=!0;var t={};t.UserID=n.xB.User.UserId,t.GroupID=n.xB.User.GroupId,t.UCCClientID="",t.UCCGroupID="",t.LegIndicator="0",this.httpService.postData(n.xB.tradingAPIUrl,"GetMultiLegOrderBook",t).subscribe(r=>{this.MLOrderBookRes(r)}
1,()=>{this.showProgressBar=!1})}catch(r){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+r.message,"getMLOrderBook","ml-orderbook.component.ts","")}}MLOrderBookRes(t){try{var Ve,He,it,r=0,s=0,d=0,I=0,M=0,U=0;if(null!=t||null!=t)if(this.dispMLOBArr=[],null!=t.ResponseObject.Table||null!=t.ResponseObject.Table){this.tempMLOBArr=t.ResponseObject.Table,this.initHeadersMLOB(),this.MultilegCount=this.tempMLOBArr.length;for(var ce=0;ce<this.tempMLOBArr.length;ce++){var Je=n.vV.getMultilegType(this.tempMLOBArr[ce].LegIndicator);if(this.ModifyFlag=!1,this.CancelFlag=!1,("5"==this.tempMLOBArr[ce].OrdStat||"18"==this.tempMLOBArr[ce].OrdStat)&&"4"==this.tempMLOBArr[ce].LegIndicator&&"1"==this.tempMLOBArr[ce].Validity&&(this.ModifyFlag=!0),("3"==this.tempMLOBArr[ce].OrdStat||"5"==this.tempMLOBArr[ce].OrdStat||"18"==this.tempMLOBArr[ce].OrdStat)&&(this.CancelFlag=!0),null!=this.tempMLOBArr[ce].nPriceDiff&&null!=this.tempMLOBArr[ce].nPriceDiff&&(r=o.X.ConvertToRe(this.tempMLOBArr[ce].nPriceDiff,this.tempMLOBArr[ce].MarketSegmentId,this.tempMLOBArr[ce].L1DecimalLoc)),null!=this.tempMLOBArr[ce].L1Prc&&null!=this.tempMLOBArr[ce].L1Prc&&(s=o.X.ConvertToRe(this.tempMLOBArr[ce].L1Prc,this.tempMLOBArr[ce].MarketSegmentId,this.tempMLOBArr[ce].L1DecimalLoc)),null!=this.tempMLOBArr[ce].L2Prc&&null!=this.tempMLOBArr[ce].L2Prc&&(d=o.X.ConvertToRe(this.tempMLOBArr[ce].L2Prc,this.tempMLOBArr[ce].MarketSegmentId,this.tempMLOBArr[ce].L2DecimalLoc)),null!=this.tempMLOBArr[ce].L3Prc&&null!=this.tempMLOBArr[ce].L3Prc&&(I=o.X.ConvertToRe(this.tempMLOBArr[ce].L3Prc,this.tempMLOBArr[ce].MarketSegmentId,this.tempMLOBArr[ce].L3DecimalLoc)),U=o.X.GetMappedMarketSegmentId(M=this.tempMLOBArr[ce].MarketSegmentId),-1!=this.tempMLOBArr[ce].L1StrPrc&&null!=this.tempMLOBArr[ce].L1StrPrc&&-1!=this.tempMLOBArr[ce].L2StrPrc&&null!=this.tempMLOBArr[ce].L2StrPrc){var lt=n.xB.ExchManager.ReturnPrecisionForPrice(M,this.tempMLOBArr[ce].L1DecimalLoc.toString().length-1),mt=n.xB.ExchManager.ReturnPrecisionForPrice(M,this.tempMLOBArr[ce].L2DecimalLoc.toString().length-1);if(Ve=parseFloat(parseFloat((this.tempMLOBArr[ce].L1StrPrc/this.tempMLOBArr[ce].L1DecimalLoc).toString()).toString()).toFixed(lt),He=parseFloat(parseFloat((this.tempMLOBArr[ce].L2StrPrc/this.tempMLOBArr[ce].L2DecimalLoc).toString()).toString()).toFixed(mt),6===this.tempMLOBArr[ce].LegIndicator&&-1!=this.tempMLOBArr[ce].L3StrPrc){var Ne=n.xB.ExchManager.ReturnPrecisionForPrice(M,this.tempMLOBArr[ce].L3DecimalLoc.toString().length-1);it=parseFloat(parseFloat((this.tempMLOBArr[ce].L3StrPrc/this.tempMLOBArr[ce].L3DecimalLoc).toString()).toString()).toFixed(Ne)}}this.dispMLOBArr.push({ModifyFlag:this.ModifyFlag,CancelFlag:this.CancelFlag,MultiLegType:Je,SpreadPrice:r,LegIndicator:this.tempMLOBArr[ce].LegIndicator,L1BuySell:1==this.tempMLOBArr[ce].L1BuySell?"BUY":"SELL",L1ScripTkn:this.tempMLOBArr[ce].L1ScripTkn,L1Sym:this.tempMLOBArr[ce].L1Sym,L1ExpDate:this.tempMLOBArr[ce].L1ExpDate,L1StrPrc:-1==this.tempMLOBArr[ce].L1StrPrc?"NA":Ve,L1OptType:this.tempMLOBArr[ce].L1OptType,L1Inst:this.tempMLOBArr[ce].L1Inst,L1PendQty:this.tempMLOBArr[ce].L1PendQty,L1Qty:this.tempMLOBArr[ce].L1Qty,L1Prc:s,L1ProdType:this.tempMLOBArr[ce].L1ProdType,L1ExOrderNo:this.tempMLOBArr[ce].L1ExOrderNo,L1MktLot:this.tempMLOBArr[ce].L1MktLot,L1DecimalLoc:this.tempMLOBArr[ce].L1DecimalLoc,L1PrcTick:this.tempMLOBArr[ce].L1PrcTick,L2BuySell:1==this.tempMLOBArr[ce].L2BuySell?"BUY":"SELL",L2ScripTkn:this.tempMLOBArr[ce].L2ScripTkn,L2Sym:this.tempMLOBArr[ce].L2Sym,L2ExpDate:this.tempMLOBArr[ce].L2ExpDate,L2StrPrc:-1==this.tempMLOBArr[ce].L2StrPrc?"NA":He,L2OptType:this.tempMLOBArr[ce].L2OptType,L2Inst:this.tempMLOBArr[ce].L2Inst,L2PendQty:this.tempMLOBArr[ce].L2PendQty,L2Qty:this.tempMLOBArr[ce].L2Qty,L2Prc:d,L2ProdType:this.tempMLOBArr[ce].L2ProdType,L2ExOrderNo:this.tempMLOBArr[ce].L2ExOrderNo,L2MktLot:this.tempMLOBArr[ce].L2MktLot,L2DecimalLoc:this.tempMLOBArr[ce].L2DecimalLoc,L2PrcTick:this.tempMLOBArr[ce].L2PrcTick,L3BuySell:6===this.tempMLOBArr[ce].LegIndicator?1==this.tempMLOBArr[ce].L3BuySell?"BUY":"SELL":this.tempMLOBArr[ce].L3BuySell,L3Sym:this.tempMLOBArr[ce].L3Sym,L3ExpDate:this.tempMLOBArr[ce].L3ExpDate,L3StrPrc:6===this.tempMLOBArr[ce].LegIndicator?-1==this.tempMLOBArr[ce].L3StrPrc?"NA":it:"",L3OptType:this.tempMLOBArr[ce].L3OptType,L3Inst:this.tempMLOBArr[ce].L3Inst,L3PendQty:this.tempMLOBArr[ce].L3PendQty,L3Qty:this.tempMLOBArr[ce].L3Qty,L3Prc:6===this.tempMLOBArr[ce].LegIndicator?I:0,L3ExOrderNo:this.tempMLOBArr[ce].L3ExOrderNo,GatewayOrdNo:this.tempMLOBArr[ce].GatewayOrdNo,ClientOrdNo:this.tempMLOBArr[ce].ClientOrdNo,MarketSegmentId:M,MapSegmentId:U,OrderType:this.tempMLOBArr[ce].OrderType,strOrderType:o.X.GetOrderType(this.tempMLOBArr[ce].OrderType),strOrderStatus:o.X.GetOrderStatus(this.tempMLOBArr[ce].OrdStat),OrdStat:this.tempMLOBArr[ce].OrdStat,Validity:this.tempMLOBArr[ce].Validity,strValidity:this.GetValidityStringFormat(this.tempMLOBArr[ce].Validity),Error:this.tempMLOBArr[ce].Error,Time:this.tempMLOBArr[ce].Time,OrderDate:this.tempMLOBArr[ce].OrderDate,OrderTime:this.tempMLOBArr[ce].OrderTime,COL:this.tempMLOBArr[ce].COL,MktProt:this.tempMLOBArr[ce].MktProt,OrderId:this.tempMLOBArr[ce].OrderId,InstrumentName:this.tempMLOBArr[ce].sInstrumentName,TokenNumber:this.tempMLOBArr[ce].nToken,ExpiryDate:this.tempMLOBArr[ce].nExpiryDate,SpreadSymbol:this.tempMLOBArr[ce].SpreadSymbol,Exchange:o.X.GetExchangeName(M)})}this.dispMLOBArr=n.vV.sort(this.dispMLOBArr,"Time","desc",!0)}else if(t.ErrorMessages.length>
10){var gt=Ze.h.ErrorMessages(t.ErrorMessages);""!=gt&&this.dialogService.alert(gt)}}catch(ft){this.logService.WriteLog("Exception: "+ft.message,"MLOrderBookRes","ml-orderbook.component.ts","")}finally{this.showProgressBar=!1}}onFilterML(){this.showFilter=!this.showFilter}refresh(){this.getMLOrderBook()}subscribeMessages(){null==this.sub&&(this.sub=this.pubsubService.subscribe("OLRES",(t,r)=>{(r.MsgCode==n.gT.C_S_MSGCODES_MULTILEGORDER_RESPONSE||r.MsgCode==n.gT.C_S_MSGCODES_MULTILEGORDER_ACK||r.MsgCode==n.gT.C_V_MSGCODES_ORDER_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_ORDER_ACKNOWLEDGEMENT)&&(this.timer=setTimeout(()=>{this.zone.run(()=>{this.getMLOrderBook()})},600))})),this.getMLOrderBook()}ngOnDestroy(){this.pubsubService.unsubscribe(this.sub)}PopulateMLOEFromMLOB(t){var r=t.Exchange,s=t.L1ExOrderNo,d=t.L1ExpDate,I=t.L1PendQty,M=t.L1Prc,q=t.L1BuySell,j="NA"==t.L1StrPrc?"":t.L1StrPrc,Ie=t.L1DecimalLoc,pe=t.L1PrcTick,Ve=t.L1MktLot,He=t.L1ScripTkn,ce=t.L1Inst,Je=t.L1ProdType,lt=t.L2ExOrderNo,mt=t.L2ExpDate,Ne=t.L2PendQty,gt=t.L2Prc,Pt=t.L2BuySell,Et="NA"==t.L2StrPrc?"":t.L2StrPrc,yt=t.L2DecimalLoc,Dt=t.L2PrcTick,At=t.L2MktLot,Zt=t.L2ScripTkn,Vt=t.L2Inst,$t=t.L1Sym.trim(),jt=t.L2Sym.trim(),ei=t.LegIndicator,ti=t.MarketSegmentId,ii=t.MapSegmentId,xt=t.L1OptType,Si=t.OrderTime,_i=t.SpreadSymbol,gi=t.StrikePrice,Ti=t.ExpiryDate,Vr=t.InstrumentName,fi=t.TokenNumber,Ci=t.Validity,vi=t.GatewayOrdNo,Lt=t.OrdStat,oi=o.X.GetOrderType(t.OrderType),ni=t.ClientOrdNo,wr=t.L2BuySell;this.dcOrderDetails.add("LegIndicator",ei),this.dcOrderDetails.add("MarketSegID",ti),this.dcOrderDetails.add("MapMarketSegID",ii),this.dcOrderDetails.add("Exchange",r),this.dcOrderDetails.add("Validity",Ci),this.dcOrderDetails.add("OrderSide",wr),this.dcOrderDetails.add("ModifyFlag",!0),this.dcOrderDetails.add("CancelFlag",!1),this.dcOrderDetails.add("GatewayOrderNo",vi),this.dcOrderDetails.add("OrderTime",Si),this.dcOrderDetails.add("ParticipantID",""),this.dcOrderDetails.add("ProtPerc",0),this.dcOrderDetails.add("MarketStatus",Lt),this.dcOrderDetails.add("IsSpread",1),this.dcOrderDetails.add("IsTwoLeg",!1),this.dcOrderDetails.add("IsThreeLeg",!1),this.dcOrderDetails.add("COL",!1),this.dcOrderDetails.add("ProductType",Je),this.dcOrderDetails.add("ExchangeOrderNo",s),this.dcOrderDetails.add("DecimalLocator",Ie),this.dcOrderDetails.add("SpreadSymbol",_i),this.dcOrderDetails.add("StrikePrice",gi),this.dcOrderDetails.add("OptionType",xt),this.dcOrderDetails.add("ExpiryDate",Ti),this.dcOrderDetails.add("InstrumentName",Vr),this.dcOrderDetails.add("Token",fi),this.dcOrderDetails.add("OrderSide1",q),this.dcOrderDetails.add("OrderSide2",Pt),this.dcOrderDetails.add("Symbol1",$t),this.dcOrderDetails.add("Symbol2",jt),this.dcOrderDetails.add("OrderType1",oi),this.dcOrderDetails.add("OrderType2",oi),this.dcOrderDetails.add("Series1",""),this.dcOrderDetails.add("Series2",""),this.dcOrderDetails.add("ExpDate1",d),this.dcOrderDetails.add("ExpDate2",mt),this.dcOrderDetails.add("StrikePrice1",j),this.dcOrderDetails.add("StrikePrice2",Et),this.dcOrderDetails.add("OptionType1",""),this.dcOrderDetails.add("OptionType2",""),this.dcOrderDetails.add("Decimalloc1",Ie),this.dcOrderDetails.add("Decimalloc2",yt),this.dcOrderDetails.add("MarketLot1",Ve),this.dcOrderDetails.add("MarketLot2",At),this.dcOrderDetails.add("PriceTick1",pe),this.dcOrderDetails.add("PriceTick2",Dt),this.dcOrderDetails.add("TokenNo1",He),this.dcOrderDetails.add("TokenNo2",Zt),this.dcOrderDetails.add("ClientOrderNumber1",ni),this.dcOrderDetails.add("ClientOrderNumber2",ni),this.dcOrderDetails.add("ExchangeOrderNo1",s),this.dcOrderDetails.add("ExchangeOrderNo2",lt),this.dcOrderDetails.add("FIILimit",""),this.dcOrderDetails.add("NRILimit",""),this.dcOrderDetails.add("Qty1",I),this.dcOrderDetails.add("Qty2",Ne),this.dcOrderDetails.add("Price1",M),this.dcOrderDetails.add("Price2",gt),this.dcOrderDetails.add("Instrument1",ce),this.dcOrderDetails.add("Instrument2",Vt);var Br=n.xB.ExchManager.FillMultiLegOrderRequest(this.dcOrderDetails);this.menuManager.invokeMenu(n.gT.C_S_MENU_ML_OE,{sourceId:n.gT.C_S_MENU_TRADING_ORDERBOOK,data:Br})}CancelMLOrders(t){for(var r=!1,s=0;s<this.dispMLOBArr.length;s++)if(1==this.dispMLOBArr[s].isCheckSelected){r=!0;break}r?this.dialogService.confirm("Would you like to Cancel the order(s) ?","Yes","No").subscribe(I=>{I?this.cancelSelectedOrders(t):this.noCallbackCancelOrders()}
1):this.dialogService.alert("Kindly select atleast one order to Cancel","ML Order Book")}cancelSelectedOrders(t){var r=this.dispMLOBArr;for(let s=0;s<r.length;s++)1==r[s].isCheckSelected&&this.SendCancelMLOrderRequest(r[s])}onCancelMLOrderClick(t){try{this.dialogService.confirm("Would you like to withdraw the order(s) ?","Yes","No").subscribe(s=>{s?setTimeout(()=>{this.SendCancelMLOrderRequest(t)},300):this.noCallbackCancelOrders()})}catch(s){this.logService.WriteLog("Exception: "+s.message,"onWithdrawGTDOrderClick()","gtd-order-history-book.component.ts","")}}noCallbackCancelOrders(){this.isConfirmCancelled=!0}GetValidityStringFormat(t){var r="";try{switch(t){case n.gT.C_V_ORDER_VALID_TILL_DAY:r=n.gT.C_S_VALUE_DAY;break;case n.gT.C_V_ORDER_IOC:r=n.gT.C_S_VALUE_IOC;break;case n.gT.C_V_ORDER_GTD:r=n.gT.C_S_VALUE_GTD;break;case n.gT.C_V_ORDER_GTC:r=n.gT.C_S_VALUE_GTC;break;case n.gT.C_V_ORDER_EOSESS:r=n.gT.C_S_VALUE_EOSESS;break;case n.gT.C_V_ORDER_EOTODY:r=n.gT.C_S_VALUE_EOTODY;break;case n.gT.C_V_ORDER_EOSTLM:r=n.gT.C_S_VALUE_EOSTLM;break;case n.gT.C_V_ORDER_EOS:r=n.gT.C_S_VALUE_EOS;break;case n.gT.C_V_ORDER_FOK:case"FILLORKILL":r=n.gT.C_S_ORDER_FOK;break;case n.gT.C_V_ORDER_GTT:r=n.gT.C_S_VALUE_GTT}}catch(s){}return r}SendCancelMLOrderRequest(t){try{var r=t,s=r.Exchange,d=r.L1ExOrderNo,I=r.L1ExpDate,M=r.L1PendQty,U=r.L1Prc,j="BUY"==r.L1BuySell?"1":"2",Ie="NA"==r.L1StrPrc?"":r.L1StrPrc.toString(),pe=r.L1DecimalLoc,Ve=r.L1PrcTick,He=r.L1MktLot,it=r.L1ScripTkn,Je=r.L1Inst,lt=r.L1ProdType,mt=r.L1OptType,Ne=r.L2ExOrderNo,gt=r.L2ExpDate,ft=r.L2PendQty,Pt=r.L2Prc,yt="BUY"==r.L2BuySell?"1":"2",Dt="NA"==r.L2StrPrc?"":r.L2StrPrc.toString(),At=r.L2DecimalLoc,Zt=r.L2PrcTick,Ge=r.L2MktLot,Vt=r.L2ScripTkn,$t=r.L2Inst,jt=r.L2ProdType,ei=r.L2OptType,ti=r.L1Sym.trim(),ii=r.L2Sym.trim(),xt=r.LegIndicator;if("6"==xt)var Si=r.L3ExOrderNo,_i=r.L3ExpDate,gi=r.L3PendQty,Ti=r.L3Prc,fi="BUY"==r.L3BuySell?"1":"2",Rr="NA"==r.L3StrPrc?"":r.L3StrPrc.toString(),Nr=r.L3DecimalLoc,Ci=r.L3PrcTick,vi=r.L3MktLot,Lt=r.L3ScripTkn,ni=r.L3Inst,wr=r.L3OptType,Br=r.L3ProdType,zs=r.L3Sym.trim();var Js=r.MarketSegmentId,qs=r.MapSegmentId,Zs=r.OrderTime,$s=r.SpreadSymbol.trim(),js=this.GetValidityStringFormat(r.Validity),el=r.GatewayOrdNo,tl=r.OrdStat,Gr=o.X.GetOrderType(r.OrderType),rn=r.ClientOrdNo,il=r.L2BuySell,rl=r.TokenNumber;this.dcOrderDetails.add("SpreadSymbol",$s),this.dcOrderDetails.add("SpreadToken",rl),this.dcOrderDetails.add("OrderSide",il),this.dcOrderDetails.add("ProductType","D"),this.dcOrderDetails.add("ExchangeOrderNo",d),this.dcOrderDetails.add("LegIndicator",xt),this.dcOrderDetails.add("MarketSegID",Js),this.dcOrderDetails.add("MapMarketSegID",qs),this.dcOrderDetails.add("Exchange",s),this.dcOrderDetails.add("Validity",js),this.dcOrderDetails.add("ModifyFlag",!1),this.dcOrderDetails.add("CancelFlag",!0),this.dcOrderDetails.add("GatewayOrderNo",el),this.dcOrderDetails.add("OrderTime",Zs),this.dcOrderDetails.add("ParticipantID",""),this.dcOrderDetails.add("ProtPerc",0),this.dcOrderDetails.add("MarketStatus",tl),this.dcOrderDetails.add("IsSpread",this.IsSpread),this.dcOrderDetails.add("IsTwoLeg",this.IsTwoLeg),this.dcOrderDetails.add("IsThreeLeg",this.IsThreeLeg),this.dcOrderDetails.add("DecimalLocator",pe),this.dcOrderDetails.add("COL",!1),this.dcOrderDetails.add("OrderSide1",j),this.dcOrderDetails.add("OrderSide2",yt),this.dcOrderDetails.add("Symbol1",ti),this.dcOrderDetails.add("Symbol2",ii),this.dcOrderDetails.add("OrderType1",Gr),this.dcOrderDetails.add("OrderType2",Gr),this.dcOrderDetails.add("Series1",""),this.dcOrderDetails.add("Series2",""),this.dcOrderDetails.add("ExpDate1",I),this.dcOrderDetails.add("ExpDate2",gt),this.dcOrderDetails.add("StrikePrice1",Ie),this.dcOrderDetails.add("StrikePrice2",Dt),this.dcOrderDetails.add("OptionType1",mt),this.dcOrderDetails.add("OptionType2",ei),this.dcOrderDetails.add("ProductType1",lt),this.dcOrderDetails.add("ProductType2",jt),this.dcOrderDetails.add("Decimalloc1",pe),this.dcOrderDetails.add("Decimalloc2",At),this.dcOrderDetails.add("MarketLot1",He),this.dcOrderDetails.add("MarketLot2",Ge),this.dcOrderDetails.add("PriceTick1",Ve),this.dcOrderDetails.add("PriceTick2",Zt),this.dcOrderDetails.add("TokenNo1",it),this.dcOrderDetails.add("TokenNo2",Vt),this.dcOrderDetails.add("ClientOrderNumber1",rn),this.dcOrderDetails.add("ClientOrderNumber2",rn),this.dcOrderDetails.add("ExchangeOrderNo1",d),this.dcOrderDetails.add("ExchangeOrderNo2",Ne),this.dcOrderDetails.add("FIILimit",""),this.dcOrderDetails.add("NRILimit",""),this.dcOrderDetails.add("Qty1",M),this.dcOrderDetails.add("Qty2",ft),this.dcOrderDetails.add("Price1",U),this.dcOrderDetails.add("Price2",Pt),this.dcOrderDetails.add("Instrument1",Je),this.dcOrderDetails.add("Instrument2",$t),this.IsThreeLeg&&(this.dcOrderDetails.add("OrderSide3",fi),this.dcOrderDetails.add("Symbol3",zs),this.dcOrderDetails.add("OrderType3",Gr),this.dcOrderDetails.add("Series3",""),this.dcOrderDetails.add("ExpDate3",_i),this.dcOrderDetails.add("StrikePrice3",Rr),this.dcOrderDetails.add("OptionType3",wr),this.dcOrderDetails.add("ProductType3",Br),this.dcOrderDetails.add("Decimalloc3",
1Nr),this.dcOrderDetails.add("MarketLot3",vi),this.dcOrderDetails.add("PriceTick3",Ci),this.dcOrderDetails.add("TokenNo3",Lt),this.dcOrderDetails.add("ExchangeOrderNo3",Si),this.dcOrderDetails.add("Qty3",gi),this.dcOrderDetails.add("Price3",Ti),this.dcOrderDetails.add("Instrument3",ni));var nl=n.xB.ExchManager.FillMultiLegOrderRequest(this.dcOrderDetails);this.pubsubService.publish("MLOEREQ",nl)}catch(al){this.logService.WriteLog("Exception: "+al.message,"SendCancelMLOrderRequest()","ml-orderbook.component.ts","")}}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n._V),e.\u0275\u0275directiveInject(ot.h),e.\u0275\u0275directiveInject(e.NgZone))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["ml-order-book"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(y,5),e.\u0275\u0275viewQuery(B,7),e.\u0275\u0275viewQuery(se,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplModify=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplSummary=s.first)}},decls:7,vars:11,consts:[[1,"eqsip-ord-bk"],[1,"container-fluid"],[4,"ngIf"],[3,"layoutMode","fhTopHeight","showPaging","pageSize","noDataFoundMsg","fixedHdrConfig","columns","rows","showFilter","showSort"],["reportGrid",""],["cellTmplModify",""],[3,"type"],["class","Modify_Text displ-Style",3,"click",4,"ngIf"],["class","marLR5",4,"ngIf"],["class","cursor displ-Style alert-error",3,"click",4,"ngIf"],[1,"Modify_Text","displ-Style",3,"click"],[1,"marLR5"],[1,"cursor","displ-Style","alert-error",3,"click"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,_e,2,1,"div",2),e.\u0275\u0275element(3,"reportgrid",3,4),e.\u0275\u0275template(5,$e,3,3,"ng-template",null,5,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("layoutMode",r.layoutMode)("fhTopHeight","40px")("showPaging",!0)("pageSize",5)("noDataFoundMsg",r.noDataFoundMsg)("fixedHdrConfig",r.fixedHdrConfig)("columns",r.columns)("rows",r.dispMLOBArr)("showFilter",r.showFilter)("showSort",!0))},directives:[W.O5,Me.i,V.R],encapsulation:2}),S})();const rt=["eqsipOrderBook"],Ot=["reportGrid"],St=["cellTmplModify"],at=["blockViewTmpl"],We=["cellTemplExpand"],It=["gtdorderhistrybook"],kt=["mlorderbook"];function bt(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",13),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Mt(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"button",5),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().getDataForOrders("EQSIP")}),e.\u0275\u0275text(2,"EQSIP Orders"),e.\u0275\u0275elementStart(3,"a"),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.eqsipCss),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.EqsiporderCount)}}function ai(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onFilter()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Filter")}function si(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",23),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).exportCSV()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function st(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onCancelOrder()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Cancel Order")}function ci(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",25),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).openColumnView()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Edit Columns")}function Pi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",26),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onExitAllBracketOrder()}),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("disabled",!t.disableExit)("ngClass",t.disableExit?"":"ExitAllBtnBlur")}}function Ei(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li"),e.\u0275\u0275template(2,ai,1,1,"button",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"li"),e.\u0275\u0275elementStart(4,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275template(6,si,1,1,"button",17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"li"),e.\u0275\u0275template(8,st,1,1,"button",18),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"li"),e.\u0275\u0275template(10,ci,1,1,"button",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"li"),e.\u0275\u0275elementStart(12,"div",20),e.\u0275\u0275template(13,Pi,1,2,"button",21),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isDataFound&&t.showCancelBtn),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Exit all for BO")("matTooltipDisabled",!1),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isDataFound&&t.showExitAllBtn)}}function yi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li"),e.\u0275\u0275elementStart(2,"button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onFilterEQSIP()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"li"),e.\u0275\u0275elementStart(4,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).refreshEQSIP()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275elementStart(6,"button",23),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).exportCSVEQSIP()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"li"),e.\u0275\u0275elementStart(8,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onCancelEQSIP()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}2&S&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Filter"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Export"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Cancel Order"))}function Ii(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onWithdrawEQGTD()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Withdraw Order")}function Mi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li"),e.\u0275\u0275elementStart(2,"button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onFilterGTD()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"li"),e.\u0275\u0275elementStart(4,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).refreshGTD()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275elementStart(6,"button",23),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).exportCSVGTD()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"li"),e.\u0275\u0275template(8,Ii,1,1,"button",18),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Filter"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Export"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isGTDHB)}}function xi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li"),e.\u0275\u0275elementStart(2,"button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onFilterML()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"li"),e.\u0275\u0275elementStart(4,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).refreshML()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275elementStart(6,"button",23),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).exportCSVML()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"li"),e.\u0275\u0275elementStart(8,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onCancelML()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}2&S&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Filter"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Export"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Cancel Order"))}function Oi(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",14),e.\u0275\u0275template(1,Ei,14,8,"ul",2),e.\u0275\u0275template(2,yi,9,4,"ul",2),e.\u0275\u0275template(3,Mi,9,4,"ul",2),e.\u0275\u0275template(4,xi,9,4,"ul",2),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isGTDOHB&&!t.isEQSIP&&!t.isML),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isEQSIP),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isGTDOHB),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isML)}}
1function Di(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"eqsip-order-book",null,27),e.\u0275\u0275elementEnd())}function Ai(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275elementStart(1,"gtd-order-history-book",28,29),e.\u0275\u0275listener("onActiveButton",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().radioButtonHandle(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function Li(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"ml-order-book",null,30),e.\u0275\u0275elementEnd())}function bi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",35),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateOEFromOB(s)}),e.\u0275\u0275text(1," Modify "),e.\u0275\u0275elementEnd()}}function Fi(S,O){1&S&&(e.\u0275\u0275elementStart(0,"span",36),e.\u0275\u0275text(1,"|"),e.\u0275\u0275elementEnd())}function ki(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",37),e.\u0275\u0275listener("click",function(s){e.\u0275\u0275restoreView(t);const d=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().onCancelOrderClick(d,s)}),e.\u0275\u0275text(1," Cancel "),e.\u0275\u0275elementEnd()}}function Vi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",38),e.\u0275\u0275elementStart(1,"a",39),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().exitOption(s)}),e.\u0275\u0275text(2,"Exit Option"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function Ri(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",38),e.\u0275\u0275elementStart(1,"a",39),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().openPositionConv(s)}),e.\u0275\u0275text(2,"Pos. Convert"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function Ni(S,O){if(1&S&&(e.\u0275\u0275template(0,bi,2,0,"div",31),e.\u0275\u0275template(1,Fi,2,0,"span",32),e.\u0275\u0275template(2,ki,2,0,"div",33),e.\u0275\u0275template(3,Vi,3,0,"div",34),e.\u0275\u0275template(4,Ri,3,0,"div",34)),2&S){const t=O.row;e.\u0275\u0275property("ngIf",1==t.ModifyFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.CancelFlag&&1==t.ModifyFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.CancelFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.exitOptFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.posConvFlag)}}function wi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"span",48),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateOEFromOB(s)}),e.\u0275\u0275element(1,"img",49),e.\u0275\u0275elementEnd()}}function Bi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"span",48),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().onCancelOrder(s)}),e.\u0275\u0275element(1,"img",50),e.\u0275\u0275elementEnd()}}function Gi(S,O){}const Ui=function(S,O,t){return{value:S,row:O,column:t}};function Wi(S,O){if(1&S&&e.\u0275\u0275template(0,Gi,0,0,"ng-template",51),2&S){const t=e.\u0275\u0275nextContext(2),r=t.value,s=t.row,d=t.column,I=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngTemplateOutlet",I.expandTemplate)("ngTemplateOutletContext",e.\u0275\u0275pureFunction3(2,Ui,r,s,d))}}function Hi(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,Wi,1,6,void 0,2),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.expandTemplate)}}function Qi(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275elementStart(1,"div",40),e.\u0275\u0275elementStart(2,"div",41),e.\u0275\u0275elementStart(3,"div",42),e.\u0275\u0275element(4,"span",43),e.\u0275\u0275element(5,"span",44),e.\u0275\u0275element(6,"span",43),e.\u0275\u0275elementStart(7,"div",45),e.\u0275\u0275template(8,wi,2,0,"span",46),e.\u0275\u0275template(9,Bi,2,0,"span",46),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"br"),e.\u0275\u0275elementStart(11,"div"),e.\u0275\u0275text(12," Pending Qty : "),e.\u0275\u0275element(13,"span",44),e.\u0275\u0275text(14," Order Price : "),e.\u0275\u0275element(15,"span",44),e.\u0275\u0275text(16," Ex Order No. : "),e.\u0275\u0275element(17,"span",44),e.\u0275\u0275text(18," Validity : "),e.\u0275\u0275element(19,"span",44),e.\u0275\u0275text(20," Days : "),e.\u0275\u0275element(21,"span",44),e.\u0275\u0275element(22,"span",44),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div"),e.\u0275\u0275text(24," Total Qty : "),e.\u0275\u0275element(25,"span",44),e.\u0275\u0275text(26," Trigger Price : "),e.\u0275\u0275element(27,"span",44),e.\u0275\u0275text(28," CLI Order No. : "),e.\u0275\u0275element(29,"span",44),e.\u0275\u0275text(30," Last Updated : "),e.\u0275\u0275element(31,"span",44),e.\u0275\u0275elementStart(32,"span"),e.\u0275\u0275elementStart(33,"a",47),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).row;
1return e.\u0275\u0275nextContext().setViewMore(d)}),e.\u0275\u0275text(34,"View More"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(35,"br"),e.\u0275\u0275element(36,"br"),e.\u0275\u0275template(37,Hi,2,1,"div",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=O.row;e.\u0275\u0275advance(4),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML","B"==t.BuySell?"BUY":"SELL",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML",t.MWSecurityDesc,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.ProductType)("innerHTML",t.ProductType,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",1==t.ModifyFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.CancelFlag),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngClass",t.PendingQty)("innerHTML",t.PendingQty,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.Price)("innerHTML",t.Price,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.ExOrderNo)("innerHTML",t.ExOrderNo,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.Validity)("innerHTML",t.Validity,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.Days)("innerHTML",""==t.Days?"NA":t.Days,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.cellClassName)("innerHTML",t.OrdStatus,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.PendingQty)("innerHTML",t.PendingQty,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.Price)("innerHTML",t.Price,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.ExOrderNo)("innerHTML",t.ExOrderNo,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.Time)("innerHTML",t.Time,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",t.isRowExpanded)}}function Yi(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"span",54),e.\u0275\u0275text(2," : "),e.\u0275\u0275element(3,"span",54),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext().$implicit,r=e.\u0275\u0275nextContext().row;e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.name,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",r[t.value],e.\u0275\u0275sanitizeHtml)}}function Xi(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",53),e.\u0275\u0275template(1,Yi,4,2,"div",2),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.expandcol)}}function Ki(S,O){if(1&S&&e.\u0275\u0275template(0,Xi,2,1,"div",52),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngForOf",t.filteredCols)}}let di=(()=>{class S{constructor(t,r,s,d,I,M,U){this.httpService=t,this.dialogService=r,this.logService=s,this.pubsubService=d,this.zone=I,this.menuManager=M,this.tradingSharedService=U,this.filterCss="btn-filter",this.sortCss="btn-sort",this.showProgressBar=!1,this.showFilter=!1,this.completedRows=[],this.pendingRows=[],this.allRows=[],this.isFirstReq=!0,this.dcOrderDetails=new n.aM,this.ArrSubTokens=null,this.isToBeRefreshed=!1,this.isWCFReqInProgress=!1,this.isConfReq=!1,this.isConfirmCancelled=!1,this.result=!1,this.isDataFound=!0,this.showOpenOrder=!0,this.showCompletedOrder=!1,this.showAllOrder=!1,this.showOrderCount=!0,this.isEQSIP=!1,this.isGTDOHB=!1,this.isGTDHB=!1,this.isML=!1,this.sortvalues=["Scrip","Status","Last Update","Buy/Sell","Time"],this.dirvalues=["asc","desc"],this.exchArray=[],this.productArray=[],this.ordStatusArray=[],this.rowFilter=[],this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.filteredCols=[],this.isFilterApp=!1,this.ooCss="tab-btn-activated",this.scripList=[],this.isBracketOrderExited=!1,this.timer=null,this.noDataFoundMsg="Looks like you have no orders at this moment",this.selRowForExitBO=null,this.showSIP=!1,this.disableExit=!1,this.showExitAllBtn=!1,this.exitAllSelValidity="DAY",this.OB_PageSize="6",this.OB_extendedPageSize="12",this.silentRefresh=!1}ngOnInit(){try{this.layoutMode=""!=n.xB.dConfigMaster.FINALYTICS_REPORTS_VIEWTYPE?n.xB.dConfigMaster.FINALYTICS_REPORTS_VIEWTYPE:"G",this.GTDName="GTD"==n.gT.C_S_VALUE_EQUITY_GTD?"GTD Orders":"GTT Orders";try{this.OBRefreshTimer=parseInt(n.xB.dConfigMaster.FINALYTICS_ORDER_BOOK_REFRESH_TIMER)}catch(t){this.OBRefreshTimer=600}
1(NaN==Number(this.OBRefreshTimer)||0==Number(this.OBRefreshTimer))&&(this.OBRefreshTimer=600),(0,fe.isNullOrUndefined)(n.xB.PageSizeDetails)||(this.OB_PageSize=n.xB.PageSizeDetails.OB_PageSize,this.OB_extendedPageSize=n.xB.PageSizeDetails.OB_extendedPageSize),this.pubsubService.subscribe("OBMAX",(t,r)=>{console.log("Orderbook loaded"),this.refresh()}),this.pubsubService.subscribe("OBRFRSH",()=>{this.refresh()}),this.subscribeMessages(),this.showCancelBtn=!0,this.tabClicked="Open",this.showExitAllBtn=!0,this.sortOption=this.sortvalues[4],this.direction=this.dirvalues[1],n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_EQSIP)&&(this.showSIP=!0)}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","orderbook.component.ts","")}}onFilter(){this.showFilter=!this.showFilter}refresh(){this.getOrderBook()}onFilterClick(){(null==this.exchange||null==this.productType||null==this.ordStatus)&&("Open"==this.tabClicked?(this.getExchanges(this.pendingRows),this.getProductType(this.pendingRows),this.getOrderStatus(this.pendingRows)):"Completed"==this.tabClicked?(this.getExchanges(this.completedRows),this.getProductType(this.completedRows),this.getOrderStatus(this.completedRows)):"All"==this.tabClicked&&(this.getExchanges(this.allRows),this.getProductType(this.allRows),this.getOrderStatus(this.allRows)),this.exchange=this.exchArray[0],this.productType=this.productArray[0],this.ordStatus=this.ordStatusArray[0])}getExchanges(t){let r;this.exchArray=[];let s=!1;this.exchArray.push({key:"Exch",value:"All"});for(var d=0;d<t.length;d++)if(r=t[d].Exch,this.exchArray.length>0){for(var I=0;I<this.exchArray.length;I++){if(I==this.exchArray.length-1){if(r!=this.exchArray[I].value){s=!0;break}s=!1;break}if(r==this.exchArray[I].value){s=!1;break}s=!0,s=!1}s&&this.exchArray.push({key:"Exch",value:r})}else this.exchArray.push({key:"Exch",value:r})}getProductType(t){this.productArray=[];let r,s=!1;this.productArray.push({key:"Product",value:"All"});for(var d=0;d<t.length;d++)if(r=t[d].ProductType,this.productArray.length>0){for(var I=0;I<this.productArray.length;I++){if(I==this.productArray.length-1){if(r!=this.productArray[I].value){s=!0;break}s=!1;break}if(r==this.productArray[I].value){s=!1;break}s=!0,s=!1}s&&this.productArray.push({key:"Product",value:r})}else this.productArray.push({key:"Product",value:r})}getOrderStatus(t){this.ordStatusArray=[];let r,s=!1;this.ordStatusArray.push({key:"OrderStatus",value:"All"});for(var d=0;d<t.length;d++)if(r=t[d].OrdStatus,this.ordStatusArray.length>0){for(var I=0;I<this.ordStatusArray.length;I++){if(I==this.ordStatusArray.length-1){if(r!=this.ordStatusArray[I].value){s=!0;break}s=!1;break}if(r==this.ordStatusArray[I].value){s=!1;break}s=!0,s=!1}s&&this.ordStatusArray.push({key:"OrderStatus",value:r})}else this.ordStatusArray.push({key:"OrderStatus",value:r})}getDataForOrders(t){"Open"==t?(this.ooCss="tab-btn-activated",this.coCss="",this.aoCss="",this.eqsipCss="",this.gtdCss="",this.mlCss="",this.showOpenOrder=!0,this.showCancelBtn=!0,this.isEQSIP=!1,this.isDataFound=!1,this.isGTDOHB=!1,this.showExitAllBtn=!0,this.isML=!1,this.pendingRows.length>0?this.pendingRowsCount=this.pendingRows.length:(this.isDataFound=!0,this.pendingRowsCount=0)):"Completed"==t?(this.ooCss="",this.coCss="tab-btn-activated",this.aoCss="",this.eqsipCss="",this.gtdCss="",this.mlCss="",this.isDataFound=!1,this.showCancelBtn=!1,this.showOpenOrder=!1,this.isEQSIP=!1,this.isGTDOHB=!1,this.showCompletedOrder=!0,this.showExitAllBtn=!1,this.isML=!1,this.completedRows.length>0?this.completedRowsCount=this.completedRows.length:(this.isDataFound=!0,this.completedRowsCount=0)):"EQSIP"==t?(this.ooCss="",this.coCss="",this.aoCss="",this.eqsipCss="tab-btn-activated",this.gtdCss="",this.mlCss="",this.isEQSIP=!0,this.isGTDOHB=!1,this.isDataFound=!1,this.showOpenOrder=!1,this.isML=!1,this.showAllOrder=1!=this.isEQSIP,this.showCompletedOrder=!1):"GTD"==t?(this.ooCss="",this.coCss="",this.aoCss="",this.mlCss="",this.eqsipCss="",this.gtdCss="tab-btn-activated",this.isGTDOHB=!0,this.isEQSIP=!1,this.isDataFound=!1,this.showOpenOrder=!1,this.isML=!1,this.showAllOrder=1!=this.isGTDOHB,this.showCompletedOrder=!1):"ML"==t?(this.ooCss="",this.coCss="",this.aoCss="",this.eqsipCss="",this.mlCss="tab-btn-activated",this.gtdCss="",this.isGTDOHB=!1,this.isEQSIP=!1,this.isDataFound=!1,this.showOpenOrder=!1,this.isML=!0,this.showCompletedOrder=!1):(this.ooCss="",this.coCss="",this.aoCss="tab-btn-activated",this.gtdCss="",this.eqsipCss="",this.mlCss="",this.showOpenOrder=!1,this.showCancelBtn=!0,this.showCompletedOrder=!1,this.isEQSIP=!1,this.isGTDOHB=!1,this.isDataFound=!1,this.showAllOrder=!0,this.showExitAllBtn=!0,this.isML=!1,this.allRows.length>0?this.allRowsCount=this.allRows.length:(this.isDataFound=!0,this.allRowsCount=0)),this.tabClicked=t,this.showOpenOrder?this.rows=this.pendingRows:this.showCompletedOrder?this.rows=this.completedRows:"All"==t&&(this.rows=this.allRows),this.reportGrid.resetFilter(),this.rowFilter=this.rows,this.Symbol="",this.isFilterApp=!0}subscribeMessages(){null==this.ArrSubTokens&&(this.ArrSubTokens=this.pubsubService.subscribe("OLRES",(t,r)=>{(r.MsgCode==n.gT.C_V_MSGCODES_TRADE_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_ORDER_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_ORDER_ACKNOWLEDGEMENT||r.MsgCode==n.gT.C_V_MSGCODES_SLTRIGGER_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_BRACKETORDER_ORDER_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_BRACKETORDER_ORDER_ACKNOWLEDGEMENT||r.MsgCode==n.gT.C_V_MSGCODES_GTDORDER_ORDER_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_GTDORDER_ORDER_ACKNOWLEDGEMENT)&&(this.timer=setTimeout(()=>{this.zone.run(()=>{this.isToBeRefreshed=!0,this.silentRefresh=!0,this.checkAndUpdateOrderBook()})},this.OBRefreshTimer))})),this.getOrderBook()}getOrderBook(){try{this.silentRefresh||(this.showProgressBar=!0),this.httpService.postData(n.xB.tradingAPIUrl,"GetOrderBook",{RequireHeader:1==this.isFirstReq?"1":"0",UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(r=>{this.callBackGetOrderBook(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"GetOrderBook()","orderbook.component.ts","")}}callBackGetOrderBook(t){this.showProgressBar=!1,t=t.ResponseObject,this.rows=[],this.completedRows=[],this.pendingRows=[],this.allRows=[];let r=[];this.pendingRowsCount=0,this.completedRowsCount=0,this.allRowsCount=0,this.GTDCount=0,this.MultilegCount=0,this.EqsiporderCount=0,this.isFirstReq&&(this.initHeaders(t.objJSONHeader),this.isFirstReq=!1);var s=t.objJSONRows;if(void 0!==s&&s.length>0){var d="0",I="0";this.GTDCount=s[s.length-1].GTDCount,this.MultilegCount=s[s.length-1].MultilegCount,this.EqsiporderCount=s[s.length-1].EqsiporderCount;for(var M=0;M<s.length-1;M++){var U=s[M].OrdStat,q=s[M].CancelFlag,j=s[M].BuySell,Ie=n.xB.ExchManager.GetCurrentExchange(s[M].Exch).dcMarketSegementId[s[M].Inst];d=s[M].ISGTD&&s[M].GTDOrdStatus==n.gT.C_S_GTDORDERSTATUS_ACTIVE_TEXT&&s[M].OrdStat==n.gT.C_S_ORDERSTATUS_PENDING_TEXT?"1":s[M].ModifyFlag,I=s[M].ISGTD&&s[M].GTDOrdStatus==n.gT.C_S_GTDORDERSTATUS_ACTIVE_TEXT?"1":s[M].CancelFlag;var pe=new m.u;pe.ScripDet.Token=s[M].ScripCode,pe.ScripDet.MktSegId=Ie,pe.ExchangeName=s[M].Exch,pe.InstrumentName=s[M].Inst,pe.Symbol=s[M].Sym,pe.Series=s[M].Series,pe.ExpiryDate=s[M].ExpDate,pe.StrikePrice="NA"==s[M].StrPrc?0:s[M].StrPrc,pe.OptionType=s[M].OptType,pe.DecimalLocator=s[M].DecimalLoc,pe.MarketLot=s[M].MktLot,pe.PriceTick=s[M].PrcTick,this.rows.push({CancelFlag:I,ModifyFlag:d,exitOptFlag:s[M].exitOptFlag,posConvFlag:s[M].posConvFlag,ExOrderNo:s[M].ExOrderNo,Exch:s[M].Exch,BuySell:"B"==s[M].BuySell?"BUY":"SELL",PendingQty:s[M].PendQty,Qty:s[M].Qty,Sym:s[M].Sym,ExpDate:s[M].ExpDate,StrPrc:s[M].StrPrc,OptType:s[M].OptType,Price:s[M].ProdType==n.gT.C_S_PRODUCTTYPE_MP_TEXT?s[M].ProfitOrdPrc:s[M].Prc,AMOID:s[M].AMOID,ProductType:s[M].ProdType,OrdStatus:s[M].OrdStat,Series:s[M].Series,Instru:s[M].Inst,OrderType:s[M].OrderType,TrigPrice:s[M].TrigPrc,Days:s[M].Days,Time:s[M].Time,GatewayordNo:s[M].GatewayOrdNo,Validity:s[M].Validity,Error:s[M].Error,ScripCode:s[M].ScripCode,OrderDate:s[M].OrderDate,SecurityDesc:s[M].SecurityDesc,DiscloseQty:s[M].DiscQty,Initiated_From:s[M].InitiatedFrm,Modified_From:s[M].ModifiedFrm,Misc:s[M].Misc,SORID:s[M].SORID,Client_Odr_Nm:s[M].ClientOdrNo,Odr_From:s[M].OdrFrom,GTTTime:s[M].GTTTime,Fill:s[M].Fill,Private:s[M].Private,Private_Val:s[M].PrivateVal,MktLot:s[M].MktLot,DecimalLoc:s[M].DecimalLoc,LastTradedQty:s[M].LastTradedQty,PrcTick:s[M].PrcTick,OrderTime:s[M].OrderTime,COL:s[M].COL,SLJumpPrice:s[M].SLJumpPrc,LTPJumpPrice:s[M].LTPJumpPrc,Profit_Order_Price:s[M].ProdType==n.gT.C_S_PRODUCTTYPE_MP_TEXT?"0.00":s[M].ProfitOrdPrc,SL_Price:s[M].SLOrdPrc,SL_Trigger_Price:s[M].ProdType==n.gT.C_S_PRODUCTTYPE_MP_TEXT&&"2"==s[M].LegIndicator&&"RL"==s[M].OrderType?s[M].TrigPrc:s[M].SLTrigPrc,Bracket_Order_Status:s[M].BracketOrderStatus,SPOSFLAG:s[M].SPOSFLAG,LegIndicator:s[M].LegIndicator,PosIndicator:s[M].PosIndicator,BracketOrdId:s[M].BracketOrdId,BracketOrdModifyBit:s[M].BracketOrdModifyBit,BracketOrdSLOrdType:s[M].BracketOrdSLOrdType,MKT_PROT:s[M].MktProt,OFS_Margin:s[M].OFSMargin,ClientOrderNumber:s[M].ClientOrdNo,ParticipantID:s[M].ParticipantID,ServerEntryTime:s[M].ServerEntryTime,cellClassName:this.getRowCSS(U,j),Canceldisabled:1!=q,isCheckSelected:!1,isRowExpanded:!1,MWSecurityDesc:o.X.FormatScripDescForMW(pe),scrip:pe,Spread:null!=s[M].Spread?s[M].Spread:" ",isGTD:s[M].ISGTD,GTDOrdStatus:s[M].GTDOrdStatus,BOPriceIndicator:s[M].BOPriceIndicator,sBOPriceIndicator:s[M].ProdType===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_PERCENT?n.gT.C_S_BO_PI_PRICE_PERCENT:s[M].ProdType===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_DIFFERENCE?n.gT.C_S_BO_PI_PRICE_DIFFERENCE:s[M].ProdType===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&s[M].BOPriceIndicator==n.gT.C_V_BO_PI_ACTUAL_PRICE?n.gT.C_S_BO_PI_ACTUAL_PRICE:"",SLTriggerPriceDiffOrPerCent:s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_PERCENT?s[M].SLTriggerPriceDiffOrPerCent/100:s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_DIFFERENCE?s[M].SLTriggerPriceDiffOrPerCent/s[M].DecimalLoc:s[M].SLTriggerPriceDiffOrPerCent,SLOrderPriceDiffOrPerCent:s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_PERCENT?s[M].SLOrderPriceDiffOrPerCent/100:s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_DIFFERENCE?s[M].SLOrderPriceDiffOrPerCent/s[M].DecimalLoc:s[M].SLOrderPriceDiffOrPerCent,ProfitPriceDiffOrPerCent:s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_PERCENT?s[M].ProfitPriceDiffOrPerCent/100:s[M].BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_DIFFERENCE?s[M].ProfitPriceDiffOrPerCent/s[M].DecimalLoc:s[M].ProfitPriceDiffOrPerCent,BOPosConvQty:s[M].BOPosConvQty,Indicator:s[M].ProdType==n.gT.C_S_PRODUCTTYPE_MP_TEXT&&"1"==s[M].LegIndicator?n.gT.C_S_MARGIN_MAIN_LEG_INDICATOR:s[M].ProdType==n.gT.C_S_PRODUCTTYPE_MP_TEXT&&"2"==s[M].LegIndicator?n.gT.C_S_MARGIN_SL_LEG_INDICATOR:"",Publisher:s[M].Publisher}),r=this.rows}this.rowFilter=r,r=this.rowFilter;for(let Ve=0;Ve<r.length;Ve++)r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_DEVICEXMITTED_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_PENDING_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_ADMINPENDING_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_OMSXMITTED_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_GATEWAYXMITTED_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_EXCHANGEXMITTED_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_FROZEN_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_AMOSUBMITTED_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_ADMINACCEPT_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_MINIADMINPENDING_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_ADMINMODIFY_TEXT?(this.pendingRows.push(r[Ve]),this.allRows.push(r[Ve])):r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_TRADED_TEXT||r[Ve].OrdStatus==n.gT.C_S_ORDERSTATUS_EXECUTED_TEXT?(this.completedRows.push(r[Ve]),this.allRows.push(r[Ve])):this.allRows.push(r[Ve]);this.rows=this.showOpenOrder?this.pendingRows:this.showCompletedOrder?this.completedRows:this.allRows,this.showOrderCount&&(this.pendingRowsCount=this.pendingRows.length>0?this.pendingRows.length:0,this.completedRowsCount=this.completedRows.length>0?this.completedRows.length:0,this.allRowsCount=this.allRows.length>0?this.allRows.length:0),this.applyFilter(""),this.pendingRows.length>0&&(this.isDataFound=!1)}else this.isDataFound=!0;this.isWCFReqInProgress=!1,this.checkAndUpdateOrderBook(),this.enableDisableExitAll()}initHeaders(t){var d;if(this.arrayheader=[],this.arrayheader.Cancel={value:"110012",sort:!1,width:15,filter:!1,cType:"S",export:!1,isCheckboxable:!0},this.arrayheader.Action={value:"Action",sort:!1,filter:!1,cType:"",export:!1,cellTemplate:this.cellTmplModify},this.arrayheader[1]={value:"Exch",cType:"S"},this.arrayheader[10]={value:"ClientOrdNo",cType:"S"},this.arrayheader[11]={value:"BuySell",cType:"S"},this.arrayheader[110017]={value:"Bracket_Order_Status",cType:"S"},this.arrayheader[12]={value:"Qty",cType:"N"},this.arrayheader[13]={value:"DiscloseQty",cType:"N"},this.arrayheader[14]={value:"Price",cType:"N"},this.arrayheader[15]={value:"TrigPrice",cType:"N"},this.arrayheader[16]={value:"Validity",cType:"S"},this.arrayheader[18]={value:"ExOrderNo",cType:"N"},this.arrayheader[19]={value:"Error",cType:"S"},this.arrayheader[20]={value:"OrdStatus",cType:"S"},this.arrayheader[21]={value:"Days",cType:"N"},this.arrayheader[250]={value:"PendingQty",cType:"N"},this.arrayheader[254]={value:"Time",cType:"S"},this.arrayheader[28]={value:"GatewayordNo",cType:"S"},this.arrayheader[31]={value:"Sym",cType:"S"},this.arrayheader[32]={value:"Series",cType:"S"},this.arrayheader[33]={value:"ExpDate",cType:"S"},this.arrayheader[34]={value:"StrPrc",cType:"N"},this.arrayheader[35]={value:"OptType",cType:"S"},this.arrayheader[368]={value:"ProductType",cType:"S"},this.arrayheader[383]={value:"AMOID",cType:"N"},this.arrayheader[399]={value:"DecimalLocator",cType:"N, numeric: true"},this.arrayheader[424]={value:"SORID",cType:"N"},this.arrayheader[43]={value:"Instru",cType:"S"},this.arrayheader[430]={value:"Client_Odr_Nm",cType:"S"},this.arrayheader[47]={value:"Market Lot",cType:"N"},this.arrayheader[471]={value:"Spread",cType:"S"},this.arrayheader[477]={value:"GTTTime",cType:"S"},this.arrayheader[48]={value:"PriceTick",cType:"N"},this.arrayheader[480]={value:"Fill",cType:"S"},this.arrayheader[481]={value:"Private",cType:"N"},this.arrayheader[488]={value:"Private_Val",cType:"N"},this.arrayheader[489]={value:"SLJumpPrice",cType:"N"},this.arrayheader[490]={value:"LTPJumpPrice",cType:"N"},this.arrayheader[491]={value:"SL_Price",cType:"N"},this.arrayheader[492]={value:"SL_Trigger_Price",cType:"N"},this.arrayheader[493]={value:"Profit_Order_Price",cType:"N"},this.arrayheader[494]={value:"BracketOrdId",cType:"N"},this.arrayheader[498]={value:"Lend_Yield",cType:"N"},this.arrayheader[5e3]={value:"Odr_From",cType:"S"},this.arrayheader[503]={value:"OFS_Margin",cType:"S"},this.arrayheader[5040]={value:"Misc",cType:"S"},this.arrayheader[5050]={value:"ServerEntryTime",cType:"S"},this.arrayheader[57]={value:"COL",cType:"S"},this.arrayheader[60]={value:"ParticipantID",cType:"S"},this.arrayheader[7]={value:"ScripCode",cType:"N"},this.arrayheader[72]={value:"OrderType",cType:"S"},this.arrayheader[900931]={value:"Modify",cType:"S"},this.arrayheader[901]={value:"OrderDate",cType:"S"},this.arrayheader[902]={value:"SecurityDesc",cType:"S"},this.arrayheader[903]={value:"Initiated_From",cType:"S"},this.arrayheader[904]={value:"Modified_From",cType:"S"},this.arrayheader[988]={value:"Order_Book_Time",cType:"S"},this.arrayheader[989]={value:"OrderBook_MktSegmentID",cType:"S"},this.arrayheader[521]={value:"LastTradedQty",cType:"N"},this.arrayheader[1106]={value:"sBOPriceIndicator",cType:"N"},this.arrayheader[1107]={value:"SLOrderPriceDiffOrPerCent",cType:"N"},this.arrayheader[1108]={value:"SLTriggerPriceDiffOrPerCent",cType:"N"},this.arrayheader[1109]={value:"ProfitPriceDiffOrPerCent",cType:"N"},this.arrayheader[513]={value:"Indicator",cType:"N"},this.arrayheader.Publisher={value:"Publisher",cType:"S"},this.columns=[],"B"==this.layoutMode){var I=["Cancel","Action","1","10","11","12","14","15","16","18","20","21","250","43
10","254"],M=[];for(let j=0;j<I.length;j++)M[I[j]]=I[j];if(void 0!==t){for(let j=0;j<t.length;j++)this.arrayheader.length>0&&((U=this.arrayheader[t[j].Id]).name=t[j].Nm,this.arrayheader[t[j].Id]=U);for(let j=0;j<t.length;j++)if(null!=(U=this.arrayheader[M[t[j].Id]]))for(let pe=0;pe<I.length;pe++)if(t[j].Id==I[pe]){U.expandcol=!1,this.columns.push(U);break}for(let j=0;j<t.length;j++)if(null!=(U=this.arrayheader[t[j].Id])){for(let pe=0;pe<this.columns.length;pe++){if(pe==this.columns.length-1){if(this.arrayheader[t[j].Id].name!=this.columns[pe].name){d=!0;break}d=!1;break}if(this.arrayheader[t[j].Id].name==this.columns[pe].name){d=!1;break}d=!0,d=!1}d&&(U.expandcol=!0,this.columns.push(U),this.filteredCols=this.columns.filter(pe=>1==pe.expandcol))}}}else if(void 0!==t)for(let q=0;q<t.length;q++)if(this.arrayheader.length>0){var U;(U=this.arrayheader[t[q].Id]).name=t[q].Nm,this.columns.push(U)}}getRowCSS(t,r){var s="";return t==n.gT.C_S_ORDERSTATUS_ADMINPENDING_TEXT?s="AMOPENDINGCSS":t==n.gT.C_S_ORDERSTATUS_PENDING_TEXT?"B"==r||"BUY"==r?s="BuyCSS":("S"==r||"SELL"==r)&&(s="SellCSS"):t==n.gT.C_S_ORDERSTATUS_OMSXMITTED_TEXT?s="OMSXMITTEDCSS":t==n.gT.C_S_ORDERSTATUS_CANCEL_TEXT?s="CANCELCSS":t==n.gT.C_S_ORDERSTATUS_EXECUTED_TEXT?s="EXECUTEDCSS":t==n.gT.C_S_ORDERSTATUS_FROZEN_TEXT?s="FROZENCSS":t==n.gT.C_S_ORDERSTATUS_GATEWAYREJECT_TEXT?s="GATEWAYREJECTECSS":t==n.gT.C_S_ORDERSTATUS_OMSREJECT_TEXT&&(s="OMSREJECTECSS"),s}exportCSV(){this.reportGrid.exportCSV("Order Book")}onCancelOrder(t){try{var r,s=!1;if("B"==this.layoutMode)if(null==t){for(var I=0;I<this.rowFilter.length;I++)if("1"==this.rowFilter[I].CancelFlag){s=!0,r=this.rowFilter[I].scrip.ScripDet._MktSegId;break}}else"1"==t.CancelFlag&&(s=!0,r=o.X.GetMarketSegmentIDFromExName(t.Exch));else for(I=0;I<this.rowFilter.length;I++)if(1==this.rowFilter[I].isCheckSelected){s=!0,r=this.rowFilter[I].scrip.ScripDet._MktSegId;break}if(s){var M=[];null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic&&(M=n.xB.User.OrderPrefDic[r].sOrderConfMode.split("#"),this.isConfReq=!(!M.Contains("All")&&!M.Contains("OC"))),this.isConfReq?this.dialogService.confirm("B"==this.layoutMode&&null==t?this.isFilterApp?"Would you like to cancel all pending orders as per filtered criteria":"Would you like to cancel all pending orders":"Would you like to cancel the order(s)","Yes","No").subscribe(U=>{U?this.yesCallbackCancelOrders(t):this.noCallbackCancelOrders()}):this.cancelSelectedOrders(t)}else this.dialogService.alert("Kindly select atleast one order to cancel","Order Book")}catch(U){this.logService.WriteLog("Exception: "+U.message,"CancelOrders()","tr_OrderBook.js","")}}yesCallbackCancelOrders(t){this.cancelSelectedOrders(t)}noCallbackCancelOrders(){this.isConfirmCancelled=!0}cancelSelectedOrders(t){try{if("B"==this.layoutMode)if(null==t)for(var s=0;s<this.rowFilter.length;s++)"1"==this.rowFilter[s].CancelFlag&&this.SendCancelOrderRequest(this.rowFilter[s],0,0,0,0,0,0);else"1"==t.CancelFlag&&this.SendCancelOrderRequest(t,0,0,0,0,0,0);else for(s=0;s<this.rowFilter.length;s++)1==this.rowFilter[s].isCheckSelected&&this.SendCancelOrderRequest(this.rowFilter[s],0,0,0,0,0,0)}catch(d){this.logService.WriteLog("Exception: "+d.message,"CancelSelectedOrders()","orderbook.component.ts","")}}onCancelOrderClick(t){try{this.dialogService.confirm("Would you like to cancel the order(s)","Yes","No").subscribe(s=>{s?setTimeout(()=>{this.SendCancelOrderRequest(t,0,0,0,0,0,0)},300):this.noCallbackCancelOrders()})}catch(s){this.logService.WriteLog("Exception: "+s.message,"onCancelOrderClick()","orderbook.component.ts","")}}SendCancelOrderRequest(t,r,s,d,I,M,U){try{var j,At,Lt=0;j=n.xB.ExchManager.GetCurrentExchange(t.Exch).dcMarketSegementId[t.Instru],At=t.ProductType,this.dcOrderDetails.add("SelOperation",t.BuySell),this.dcOrderDetails.add("SelExchange",t.Exch),this.dcOrderDetails.add("SelInstrument",t.Instru),this.dcOrderDetails.add("MarketSegmentId",j),this.dcOrderDetails.add("MapMarketSegmentId"," "),this.dcOrderDetails.add("SelSymbol",t.Sym),this.dcOrderDetails.add("SelSeries",t.Series),this.dcOrderDetails.add("SelExpire",t.ExpDate),this.dcOrderDetails.add("SelStr
1ikePrice",t.StrPrc),this.dcOrderDetails.add("SelOptionType",t.OptType),this.dcOrderDetails.add("SelOrderTypes",t.OrderType),Lt=At==n.xB.dConfigMaster.BRACKET_ORDER_TEXT?null==n.xB.User.OrderPrefDic||null==n.xB.User.OrderPrefDic[j]||null==n.xB.User.OrderPrefDic[j].nProtPerc||""==n.xB.User.OrderPrefDic[j].nProtPerc?5:n.xB.User.OrderPrefDic[j].nProtPerc:parseInt(t.MKT_PROT)/parseInt("100"),this.dcOrderDetails.add("SelProdPer",Lt.toString()),this.dcOrderDetails.add("SelQty",t.Qty),this.dcOrderDetails.add("SelPrice",t.Price),this.dcOrderDetails.add("SelDiscQty",t.DiscloseQty),this.dcOrderDetails.add("SelTriggerPrice",t.TrigPrice),this.dcOrderDetails.add("SelDay",t.Days),this.dcOrderDetails.add("SelValidity","1"!=t.exitOptFlag||t.OrdStatus!=n.gT.C_S_ORDERSTATUS_EXECUTED_TEXT&&"1"!=t.posConvFlag?t.Validity:this.exitAllSelValidity),this.dcOrderDetails.add("SelValidity",t.Validity),this.dcOrderDetails.add("SelProduct",t.ProductType),this.dcOrderDetails.add("SelMarketLot",t.MktLot),this.dcOrderDetails.add("SelDecimalloc",t.DecimalLoc),this.dcOrderDetails.add("SelPriceTick",t.PrcTick),this.dcOrderDetails.add("SelToken",t.ScripCode),this.dcOrderDetails.add("SelMPMFFlag"," "),this.dcOrderDetails.add("IsSpread",!1),this.dcOrderDetails.add("ModifyFlag",!1),this.dcOrderDetails.add("CancelFlag",!0),this.dcOrderDetails.add("FIILimit",""),this.dcOrderDetails.add("NRILimit",""),this.dcOrderDetails.add("AMOID",""),this.dcOrderDetails.add("ExchangeOrderNo",t.ExOrderNo),this.dcOrderDetails.add("ClientOrderNumber",t.ClientOrderNumber),this.dcOrderDetails.add("GatewayOrderNo",t.GatewayordNo),this.dcOrderDetails.add("OrderTime",t.OrderTime),this.dcOrderDetails.add("ParticipantID"," "),this.dcOrderDetails.add("SelCOL","ON"==t.COL?"true":"false"),this.dcOrderDetails.add("SLJumpPrice",t.SLJumpPrice),this.dcOrderDetails.add("LTPJumpPrice",t.LTPJumpPrice),this.dcOrderDetails.add("ProfitOrderPrice",t.Profit_Order_Price),this.dcOrderDetails.add("SLOrderPrice",t.SL_Price),this.dcOrderDetails.add("SLTriggerPrice",t.SL_Trigger_Price),this.dcOrderDetails.add("BracketOrderId",t.BracketOrdId),this.dcOrderDetails.add("LegIndicator",t.LegIndicator),At==n.xB.dConfigMaster.BRACKET_ORDER_TEXT&&(this.dcOrderDetails.add("MPLTP",r),this.dcOrderDetails.add("MPClosePrice",s),this.dcOrderDetails.add("BuyPrice",d),this.dcOrderDetails.add("SellPrice",I),this.dcOrderDetails.add("MPLowPr",U),this.dcOrderDetails.add("MPHighPr",M));var oi=n.xB.ExchManager.FillOrderRequest(this.dcOrderDetails,!0);this.pubsubService.publish("OEREQ",oi)}catch(ni){this.logService.WriteLog("Exception: "+ni.message,"SendCancelOrderRequest()","orderbook.component.ts","")}}checkAndUpdateOrderBook(){setTimeout(()=>{this.isToBeRefreshed&&!this.isWCFReqInProgress&&(console.log("isToBeRefreshed",this.isToBeRefreshed),console.log("isWCFReqInProgress",this.isWCFReqInProgress),this.getOrderBook(),this.isToBeRefreshed=!1,this.isWCFReqInProgress=!0,this.silentRefresh=!1)},1e3)}PopulateOEFromOB(t){try{var r=new h.Q(t.scrip);if(r.OrderSide="BUY"==t.BuySell?"BUY":"SELL",r.OrderType=t.OrderType,r.Qty=t.PendingQty,r.LastPendingQty=t.PendingQty,r.SellPrice=t.Price,t.OrderType==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||t.OrderType==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?(r.BuyPrice=0,r.SellPrice=0):(r.BuyPrice=t.Price,r.SellPrice=t.Price),r.DiscQty=t.DiscloseQty,r.TriggerPrice=t.TrigPrice,r.ProductType=t.ProductType,r.IsGTD=t.isGTD,r.Validity="1"===t.isGTD?n.gT.C_S_VALUE_GTD:t.Validity,r.Days=t.Days,r.ProtPerc=t.MKT_PROT,r.ClientOrderNumber=t.ClientOrderNumber,r.ExchangeOrderNo=t.ExOrderNo,r.GatewayOrderNo=t.GatewayordNo,r.OrderTime=t.OrderTime,r.isSOR=!1,r.COL=t.COL,r.ProfitOrderPrice=t.ProfitOrderPrice,r.TrailingSL=!1,r.SLJumpPrice=t.SLJumpPrice,r.LTPJumpPrice=t.LTPJumpPrice,r.SLOrderPrice=t.SL_Price,r.SLTriggerPrice=t.SL_Trigger_Price,r.BracketOrderId=t.BracketOrdId,r.LegIndicator=t.LegIndicator,r.SLOrderType=t.BracketOrdSLOrdType,r.ProfitOrderPrice=t.Profit_Order_Price,r.OFSMargin=t.OFS_MARGIN,r.PageSource=n.gT.C_V_ORDERBOOK_PAGENO.toString(),r.BracketOrderModifyBit=t.BracketOrdModifyBit,r.LastTradedQty=t.LastTradedQty,r.BOPriceIndicator=t.BOPriceIndicator,r.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&((t.BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_DIFFERENCE||t.BOPriceIndicator==n.gT.C_V_BO_PI_PRICE_PERCENT)&&(r.SLOrderPrice=t.SLOrderPriceDiffOrPerCent,r.SLTriggerPrice=t.SLTriggerPriceDiffOrPerCent,r.ProfitOrderPrice=t.ProfitPriceDiffOrPerCent),r.OrderStatus=t.OrdStatus,r.BracketOrderStatus=t.Bracket_Order_Status,r.LegIndicator==n.gT.C_V_BRACKET_PROFIT_LEG_INDICATOR.toString()||r.LegIndicator==n.gT.C_V_BRACKET_PROFIT_RESV_LEG_INDICATOR.toString()||r.LegIndicator==n.gT.C_V_BRACKET_SL_LEG_INDICATOR.toString()||r.LegIndicator==n.gT.C_V_BRACKET_SL_RESV_LEG_INDICATOR.toString()))for(let s=0;s<this.allRows.length;s++)if(this.allRows[s].BracketOrdId==t.BracketOrdId&&this.allRows[s].LegIndicator==n.gT.C_V_BRACKET_MAIN_LEG_INDICATOR.toString()){r.BuyPrice=this.allRows[s].Price,r.SellPrice=this.allRows[s].Price,r.BOGatewayOrderNo=this.allRows[s].GatewayordNo,r.OrderSide="BUY"==this.allRows[s].BuySell?"BUY":"SELL",r.Qty=this.allRows[s].PendingQty,r.SLJumpPrice=this.allRows[s].SLJumpPrice,r.LTPJumpPrice=this.allRows[s].LTPJumpPrice,r.SLOrderPrice=this.allRows[s].SL_Price,r.SLTriggerPrice=this.allRows[s].SL_Trigger_Price,r.ProfitOrderPrice=this.allRows[s].Profit_Order_Price,r.SLOrderType=this.allRows[s].BracketOrdSLOrdType;break}if(r.ProductType==n.gT.C_S_PRODUCTTYPE_MP_TEXT&&(r.Qty=t.Qty,"2"==r.LegIndicator))for(let s=0;s<this.allRows.length;s++)if(this.allRows[s].BracketOrdId==t.BracketOrdId&&"1"==this.allRows[s].LegIndicator){"2"==t.LegIndicator&&("RL MKT"==t.OrderType||"RL"==t.OrderType||"SL MKT"==t.OrderType)&&0==parseInt(r.SLTriggerPrice)&&(r.SLOrderType="RL"),r.OrderType=this.allRows[s].OrderType,r.OrderSide="BUY"==this.allRows[s].BuySell?"BUY":"SELL",r.Qty=this.allRows[s].PendingQty,r.BuyPrice=this.allRows[s].Price,r.SellPrice=this.allRows[s].Price;break}this.menuManager.invokeMenu(n.gT.C_S_MENU_OE_SPOT,{sourceId:n.gT.C_S_MENU_TRADING_ORDERBOOK,data:r})}
1catch(s){this.logService.WriteLog("Exception: "+s.message,"PopulateOEFromOB()","orderbook.component.ts","")}}openColumnView(){this.dialogService.openComponent("Edit Columns",u.V,{menuId:n.gT.C_S_MENU_TRADING_ORDERBOOK,reptId:n.gT.C_V_COLUMNTEMPLATE_ORDERBOOK}).afterClosed().subscribe(r=>{this.onColumnViewClose(r)})}onColumnViewClose(t){1==t&&(this.isFirstReq=!0,this.getOrderBook())}ngOnDestroy(){this.ArrSubTokens&&(this.pubsubService.unsubscribe(this.ArrSubTokens),this.ArrSubTokens=null)}sortData(){let t=[];for(var r=this.sortOption,s=this.direction,d=0;d<this.rowFilter.length;d++)t[d]=this.rowFilter[d];switch(r){case"Scrip":t=n.vV.sort(t,"Sym",s,!1);break;case"Status":t=n.vV.sort(t,"OrdStatus",s,!1);break;case"Last Update":t=n.vV.sort(t,"OrderTime",s,!0);break;case"Buy/Sell":t=n.vV.sort(t,"BuySell",s,!1);break;case"Time":t=n.vV.sort(t,"Time",s,!1);break;default:t=this.rows}this.rowFilter=[],this.rowFilter=t}filterScrip(t){this.Symbol={key:"Scrip",value:t},this.Symbol1={key:"Scrip",value:t},this.isFilterApp=!0,this.applyFilter(this.Symbol1)}onExchangeChange(t){this.exchange=t,this.isFilterApp=!0,this.applyFilter(this.exchange)}onProductChange(t){this.productType=t,this.isFilterApp=!0,this.applyFilter(this.productType)}onOrdStatChange(t){this.ordStatus=t,this.isFilterApp=!0,this.applyFilter(this.ordStatus)}applyFilter(t){var r=this.rows;null!=this.Symbol1&&""!=this.Symbol1.value&&(r=r.filter(s=>s.Sym.indexOf(this.Symbol1.value.toUpperCase())>=0)),null!=this.exchange&&"All"!=this.exchange.value&&(r=r.filter(s=>s.Exch.indexOf(this.exchange.value)>=0)),null!=this.productType&&"All"!=this.productType.value&&(r=r.filter(s=>s.ProductType.indexOf(this.productType.value)>=0)),null!=this.ordStatus&&"All"!=this.ordStatus.value&&(r=r.filter(s=>s.OrdStatus.indexOf(this.ordStatus.value)>=0)),this.rowFilter=[],this.rowFilter=r}setViewMore(t){this.rows.forEach(r=>{r!==t&&(r.isRowExpanded=!1)}),t.isRowExpanded=1!=t.isRowExpanded,this.expandTemplate=this.cellTemplExpand}openPositionConv(t){this.PositionConversion(t)&&("0"==t.NetQty?this.dialogService.alert("Cannot convert position as Net Qty is 0"):this.dialogService.openComponent("Position Conversion",ne,{Selectedrow:t,CombineTokenDetails:null}).afterClosed().subscribe(d=>{this.onPositionConvClose(d)}))}PositionConversion(t){try{var r=!0;if(n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_POSITIONCONVERSION)){var d={OrderSide:"",NetQuantity:"",BuyQuantity:"",SellQuantity:"",MktSegId:"",Series:"",ProductType:"",BOGatewayOrderNo:""};d.OrderSide=n.gT.C_V_ORDER_BUY.toString(),t.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(d.BuyQuantity=parseInt(t.BOPosConvQty).toString(),d.SellQuantity=parseInt(t.BOPosConvQty).toString(),d.NetQuantity=parseInt(t.BOPosConvQty).toString()):(d.BuyQuantity=(parseInt(t.PendingQty)-parseInt(t.Qty)).toString(),d.SellQuantity=(parseInt(t.PendingQty)-parseInt(t.Qty)).toString(),d.NetQuantity=(parseInt(t.PendingQty)-parseInt(t.Qty)).toString()),d.MktSegId=t.scrip.ScripDet.MktSegId,d.Series=t.Series,d.ProductType=t.ProductType,d.BOGatewayOrderNo=t.GatewayordNo}n.xB.ExchManager.LoginAllowed[parseInt(d.MktSegId,10)]==n.gT.C_S_ON?d.MktSegId==n.gT.C_V_NSEL_DERIVATIVES.toString()||d.MktSegId==n.gT.C_V_DGCX_DERIVATIVES.toString()||d.MktSegId==n.gT.C_V_BFX_DERIVATIVES.toString()?(r=!1,this.dialogService.alert("Position conversion not allowed")):d.ProductType!=n.gT.C_S_PRODUCTTYPE_MTF_VALUE&&d.Series!=n.gT.C_S_SERIES_SM?r=!0:null!=d.NetQuantity&&null!=d.BuyQuantity&&null!=d.SellQuantity&&(0==parseInt(d.NetQuantity)||0==parseInt(d.BuyQuantity)||0==parseInt(d.SellQuantity)?(r=!1,this.dialogService.alert("No position available for conversion")):(r=!1,this.dialogService.alert("Position conversion not allowed"))):(r=!1,this.dialogService.alert("You are currently not allowed to convert the position for this Segment"))}catch(I){this.logService.WriteLog("Exception: "+I.message,"positionConversion","orderbook.component.ts","")}return r}onPositionConvClose(t){}exitOption(t){this.dialogService.confirm("Are you sure?","Yes","No").subscribe(r=>{r?this.yesCallbackExitOption(t):this.noCallbackExitOption()})}yesCallbackExitOption(t){this.selRowForExitBO=t,this.isBracketOrderExited=!0,this.CreateAndSendMultiTouchLineRequest
1(t),this.timer=setTimeout(()=>{this.isBracketOrderExited&&(this.isBracketOrderExited=!1,this.SendCancelOrderRequest(t,0,0,0,0,0,0))},300)}noCallbackExitOption(){}CreateAndSendMultiTouchLineRequest(t){try{null!==this.scripList&&this.scripList.length>0&&this.tradingSharedService.sendTouchLineRequest(this.scripList,2),this.scripList=[];var r=new he.A;r.MktSegId=t.scrip.ScripDet._MktSegId,r.Token=t.scrip.ScripDet.Token,r.MTM=0,null!=r.MktSegId&&""!=r.Token&&null!=r.Token&&(this.scripList.push(r),this.RegisterMWResponse(),this.tradingSharedService.sendTouchLineRequest(this.scripList,1))}catch(s){this.logService.WriteLog("Exception: "+s.message,"CreateAndSendMultiTouchLineRequest","orderentry.component.ts","")}}RegisterMWResponse(){this.ArrSubTokens=[];var t=this.pubsubService.subscribe("MTLRES",(r,s)=>{this.zone.run(()=>{this.HandleMultiTouchResp(s)})});this.ArrSubTokens.push(t)}UnRegisterMWResponse(){for(var t=0;t<this.ArrSubTokens.length;t++)this.pubsubService.unsubscribe(this.ArrSubTokens[t]);this.ArrSubTokens=[]}HandleMultiTouchResp(t){try{if(this.scripList[0].MktSegId==t.Scrip.MktSegId.toString()&&this.scripList[0].Token==t.Scrip.Token&&(this.isBracketOrderExited||this.isBracketOrderAllExited&&this.bracketOrderData.length>0)){this.isBracketOrderExited=!1,this.UnRegisterMWResponse();var d,I,M,U,r=t.Scrip.MktSegId.toString(),s=o.X.GetMappedMarketSegmentId(r);o.X.IsCommodityExchange(s)?(d=""==t.LTP?"":parseFloat(t.LTP),I=""==t.ClosePrice?"":parseFloat(t.ClosePrice),M=""==t.BuyPrice?"":parseFloat(t.BuyPrice),U=""==t.SellPrice?"":parseFloat(t.SellPrice)):d=""==t.LTP?0:parseFloat(t.LTP),I=""==t.ClosePrice?0:parseFloat(t.ClosePrice),M=""==t.BuyPrice?0:parseFloat(t.BuyPrice),U=""==t.SellPrice?0:parseFloat(t.SellPrice);var q=0,j=0;if(""!=t.DPR&&(q=t.DPR.split("-")[1],j=t.DPR.split("-")[0],("-"==q||""==q)&&(q=0),("-"==j||""==j)&&(j=0)),q=parseFloat(q),j=parseFloat(j),this.isBracketOrderAllExited){let Ie=this.bracketOrderData.findIndex(pe=>pe.scrip.ScripDet._MktSegId==t.Scrip.MktSegId&&pe.scrip.ScripDet.Token==t.Scrip.Token&&"1"==pe.exitOptFlag);if(Ie>=0){const pe=this.bracketOrderData.splice(Ie,1);this.SendCancelOrderRequest(pe[0],d,I,M,U,q,j)}this.isBracketOrderAllExited=this.bracketOrderData.length>0}else this.SendCancelOrderRequest(this.selRowForExitBO,d,I,M,U,q,j)}}catch(Ie){this.logService.WriteLog("Exception: "+Ie.message,"HandleMultiTouchResp","orderentry.component.ts","")}}onCancelEQSIP(){try{for(var t=this.eqsipOrderBook.dispSOBArr,r=!1,d=0;d<t.length;d++)if(1==t[d].isCheckSelected){r=!0;break}r?this.dialogService.confirm("Are you sure you want to Cancel EQSIP ?","Confirm").subscribe(I=>{I&&this.cancelEQSIPSelectedOrders()}):this.dialogService.alert("Kindly select atleast one order to cancel","EQSIP Order Book")}catch(I){this.showProgressBar=!1,this.logService.WriteLog("Exception: "+I.message,"onCancelEQSIP()","EQSIP Order Book","")}}cancelEQSIPSelectedOrders(){try{for(var r=this.eqsipOrderBook.dispSOBArr,s=0;s<r.length;s++)1==r[s].isCheckSelected&&this.eqsipOrderBook.stopCancelEQSIPInnerFunction(r[s],"C")}catch(d){this.logService.WriteLog("Exception: "+d.message,"CancelEQSIPSelectedOrders()","orderbook.component.ts","")}}exportCSVEQSIP(){this.eqsipOrderBook.reportGrid.exportCSV("EQSIP Order Book")}refreshEQSIP(){this.eqsipOrderBook.getEQSIPOrderBook(),this.EqsiporderCount=this.eqsipOrderBook.EqsiporderCount}onFilterEQSIP(){this.eqsipOrderBook.onFilterEQSIP()}onWithdrawEQGTD(t){this.gtdorderhistrybook.WithdrawEQGTD(t)}onFilterGTD(){this.gtdorderhistrybook.onFilterGTD()}refreshGTD(){this.gtdorderhistrybook.refreshGTD(),this.GTDCount=this.gtdorderhistrybook.GTDCount}exportCSVGTD(t){this.gtdorderhistrybook.exportGTD()}radioButtonHandle(t){1==this.isGTDOHB&&(this.isGTDHB=t)}enableDisableExitAll(){this.disableExit=this.allRows.some(t=>t.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&t.Bracket_Order_Status==n.gT.C_S_ORDERSTATUS_PENDING_TEXT&&"1"==t.exitOptFlag)}onExitAllBracketOrder(){try{let t=this.allRows;this.dialogService.openComponent("Cancel All Pending orders and Square off All Open positions?",be,t,"500px","300px").afterClosed().subscribe(s=>{if(null!=s&&s.status){t=s.data,this.exitAllSelValidity=s.validity,this.bracketOrderData=t.filter(d=>d.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&"1"==d.exitOptFlag),this.isBracketOrderAllExited=this.bracketOrderData.length>0;for(let d=0;d<this.bracketOrderData.length;d++)"1"==this.bracketOrderData[d].exitOptFlag?this.CreateAndSendMultiTouchLineRequest
1(this.bracketOrderData[d]):this.noCallbackExitOption()}setTimeout(()=>{(this.bracketOrderData.length>0?this.bracketOrderData.slice():"").forEach(I=>{if(this.isBracketOrderAllExited&&this.bracketOrderData.length>0){const M=this.bracketOrderData.findIndex(U=>U.Client_Odr_Nm==I.Client_Odr_Nm);M>=0&&(this.bracketOrderData.splice(M,1),this.SendCancelOrderRequest(I,0,0,0,0,0,0)),this.isBracketOrderAllExited=this.bracketOrderData.length>0}})},300)})}catch(t){this.logService.WriteLog("Exception: "+t.message,"onExitAllBracketOrder()","Order Book","")}}onFilterML(){this.mlorderbook.onFilterML()}refreshML(){this.mlorderbook.refresh(),this.MultilegCount=this.mlorderbook.MultilegCount}exportCSVML(){this.mlorderbook.reportGrid.exportCSV("ML Order Book")}onCancelML(t){this.mlorderbook.CancelMLOrders(t)}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(n._V),e.\u0275\u0275directiveInject(P.F))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["order-book"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(rt,5),e.\u0275\u0275viewQuery(Ot,5),e.\u0275\u0275viewQuery(St,7),e.\u0275\u0275viewQuery(at,7),e.\u0275\u0275viewQuery(We,7),e.\u0275\u0275viewQuery(It,5),e.\u0275\u0275viewQuery(kt,5)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.eqsipOrderBook=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplModify=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.blockViewTmpl=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTemplExpand=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.gtdorderhistrybook=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.mlorderbook=s.first)}},decls:45,vars:30,consts:[[1,"OrderBook_Parent"],[1,"container-fluid"],[4,"ngIf"],[1,"OrderBook_Row1"],[1,"Select_orders"],["mat-raised-button","",1,"tab-button",3,"ngClass","click"],["class","Orderbook_Filtericons",4,"ngIf"],[3,"hidden"],[3,"layoutMode","fhTopHeight","showPaging","pageSize","blockViewTmpl","extendedPageSize","noDataFoundMsg","fixedHdrConfig","columns","rows","showFilter","showSort"],["reportGrid",""],["cellTmplModify",""],["blockViewTmpl",""],["cellTemplExpand",""],[3,"type"],[1,"Orderbook_Filtericons"],["class","filtericon Global_Filter",3,"matTooltip","click",4,"ngIf"],[1,"btn-ref","Global_Filter",3,"matTooltip","click"],["class","btn-export Global_Filter",3,"matTooltip","click",4,"ngIf"],["class","btn-cancel-ord Global_Filter",3,"matTooltip","click",4,"ngIf"],["class","ColumnsViewicon Global_Filter",3,"matTooltip","click",4,"ngIf"],[3,"matTooltip","matTooltipDisabled"],["class","exitall Global_Filter",3,"disabled","ngClass","click",4,"ngIf"],[1,"filtericon","Global_Filter",3,"matTooltip","click"],[1,"btn-export","Global_Filter",3,"matTooltip","click"],[1,"btn-cancel-ord","Global_Filter",3,"matTooltip","click"],[1,"ColumnsViewicon","Global_Filter",3,"matTooltip","click"],[1,"exitall","Global_Filter",3,"disabled","ngClass","click"],["eqsipOrderBook",""],[3,"onActiveButton"],["gtdorderhistrybook",""],["mlorderbook",""],["class","Modify_Text displ-Style",3,"click",4,"ngIf"],["class","marLR5",4,"ngIf"],["class","Cancel_Text displ-Style alert-error",3,"click",4,"ngIf"],["class","Modify_Text",4,"ngIf"],[1,"Modify_Text","displ-Style",3,"click"],[1,"marLR5"],[1,"Cancel_Text","displ-Style","alert-error",3,"click"],[1,"Modify_Text"],["href","javascript:void(0);",1,"link-wrap",3,"click"],[1,"profile_scroll","BlockView"],[1,"rptgrid"],[1,"scripDetails"],[3,"ngClass","innerHTML"],[1,"marright-50",3,"ngClass","innerHTML"],[1,"float-right"],["title","Modify Order","class","float-left",3,"click",4,"ngIf"],["href","javascript:void(0);",1,"marright-50",3,"click"],["title","Modify Order",1,"float-left",3,"click"],["id","Img1",1,"imgEditAlert"],["id","Img1",1,"closeimg"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["style","display:inline-block; width:25%",4,"ngFor","ngForOf"],[2,"display","inline-block","width","25%"],[3,"innerHTML"]],template:function(t,r){if(1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,bt,2,1,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275elementStart(4,"div",4),e.\u0275\u0275elementStart(5,"ul"),e.\u0275\u0275elementStart(6,"li"),e.\u0275\u0275elementStart(7,"button",5),e.\u0275\u0275listener("click",function(){return r.getDataForOrders("Open")}),e.\u0275\u0275text(8,"Open Orders "),e.\u0275\u0275elementStart(9,"a"),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"li"),e.\u0275\u0275elementStart(12,"button",5),e.\u0275\u0275listener("click",function(){return r.getDataForOrders("Completed")}),e.\u0275\u0275text(13,"Completed Orders "),e.\u0275\u0275elementStart(14,"a"),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"li"),e.\u0275\u0275elementStart(17,"button",5),e.\u0275\u0275listener("click",function(){return r.getDataForOrders("All")}),e.\u0275\u0275text(18,"All Orders "),e.\u0275\u0275elementStart(19,"a"),e.\u0275\u0275text(20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(21,Mt,5,2,"li",2),e.\u0275\u0275elementStart(22,"li"),e.\u0275\u0275elementStart(23,"button",5),e.\u0275\u0275listener("click",function(){return r.getDataForOrders("GTD")}),e.\u0275\u0275text(24),e.\u0275\u0275elementStart(25,"a"),e.\u0275\u0275text(26),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"li"),e.\u0275\u0275elementStart(28,"button",5),e.\u0275\u0275listener("click",function(){return r.getDataForOrders("ML")}),e.\u0275\u0275text(29,"Multi Leg Orders "),e.\u0275\u0275elementStart(30,"a"),e.\u0275\u0275text(31),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(32,Oi,5,4,"div",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(33,Di,3,0,"div",2),e.\u0275\u0275template(34,Ai,3,0,"div",2),e.\u0275\u0275template(35,Li,3,0,"div",2),e.\u0275\u0275elementStart(36,"div",7),e.\u0275\u0275element(37,"reportgrid",8,9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(39,Ni,5,5,"ng-template",null,10,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(41,Qi,38,29,"ng-template",null,11,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(43,Ki,1,1,"ng-template",null,12,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&t){const s=e.\u0275\u0275reference(42);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngClass",r.ooCss),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(r.pendingRowsCount),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",r.coCss),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(r.completedRowsCount),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",r.aoCss),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(r.allRowsCount),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showSIP),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",r.gtdCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",r.GTDName," "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.GTDCount),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",r.mlCss),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(r.MultilegCount),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","G"==r.layoutMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.isEQSIP),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.isGTDOHB),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.isML),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",r.showProgressBar||r.isEQSIP||r.isGTDOHB||r.isML),e.\u0275\u0275advance(1),e.\u0275\u0275property("layoutMode",r.layoutMode)("fhTopHeight","40px")("showPaging",!0)("pageSize",r.OB_PageSize)("blockViewTmpl",s)("extendedPageSize",r.OB_extendedPageSize)("noDataFoundMsg",r.noDataFoundMsg)("fixedHdrConfig",r.fixedHdrConfig)("columns",r.columns)("rows",r.rowFilter)("showFilter",r.showFilter)("showSort",!0)}},directives:[W.O5,Q.lW,W.mk,Me.i,V.R,ue.gM,J,ee,we,W.tP,W.sg],encapsulation:2}),S})();var hi=x(4667),pi=x(8915),zt=x(1414),zi=x(2150),Ji=x(3433),qi=x(4699),Zi=x(3511),$i=x(328);function ji(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-button-toggle",32),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngClass",t.OEnseCSS),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.scripInfo1.ExchangeName)}}function er(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-button-toggle",33),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngClass",t.OEbseCSS),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.scripInfo2.ExchangeName)}}function tr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-button-toggle-group",29,15),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).selectedExchangeId=s}
1)("change",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onSelExchChange()}),e.\u0275\u0275template(2,ji,2,2,"mat-button-toggle",30),e.\u0275\u0275template(3,er,2,2,"mat-button-toggle",31),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("ngModel",t.selectedExchangeId),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null!=t.scripInfo1.ExchangeName),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!=t.scripInfo2.ExchangeName)}}function ir(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"span",26),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.ScripLTP)}}function rr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"span",34),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("className",t.NetChangeTrend),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.ScripNetChgInRs)}}function nr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"span",34),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("className",t.NetChangeTrend),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.ScripPercChange)}}const mi=function(S){return{"pointer-events":S}};function ar(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"span",35),e.\u0275\u0275elementStart(1,"mat-button-toggle",36),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).ChangeScrip()}),e.\u0275\u0275elementStart(2,"span",37),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(5,mi,t.hasSymbol?"auto":"none"))("disabled",!t.hasSymbol),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,3,"Change Scrip"))}}function sr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",22),e.\u0275\u0275elementStart(1,"div",23),e.\u0275\u0275elementStart(2,"ul"),e.\u0275\u0275elementStart(3,"li"),e.\u0275\u0275elementStart(4,"span",24),e.\u0275\u0275template(5,tr,4,3,"mat-button-toggle-group",25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"li"),e.\u0275\u0275elementStart(7,"h1",26),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"li"),e.\u0275\u0275elementStart(10,"h1",27),e.\u0275\u0275text(11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(12,ir,3,1,"li",3),e.\u0275\u0275template(13,rr,3,2,"li",3),e.\u0275\u0275template(14,nr,3,2,"li",3),e.\u0275\u0275elementStart(15,"li"),e.\u0275\u0275template(16,ar,5,7,"span",28),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",t.ShowSwitch),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.ScripSymbol),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.ScripData),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isDataAvailable),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isDataAvailable),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isDataAvailable),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.bShowChangeScrip)}}function lr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",38),e.\u0275\u0275elementStart(1,"universalLookup",39),e.\u0275\u0275listener("addScripCallBack",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).addScripCallBack(s)})("closeLookup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).closeLookup(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isFocus",!0))}function or(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275styleProp("color","Buy"==t.BuySell?"#099b3e":"#ea3a3a"),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.BuySell)}}function cr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.BuySell)}}function dr(S,O){if(1&S&&e.\u0275\u0275text(0),2&S){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275textInterpolate(t)}}function hr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-tab",40),e.\u0275\u0275template(1,dr,1,1,"ng-template",41),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("disabled",!t.hasProductType)}}function pr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",68),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t)}}function mr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Trigger Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",69,70),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).SelTriggerPrice=s})("blur",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275reference(6);return e.\u0275\u0275nextContext(3).transformValue("TP",s,"")})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onkeyup("TP",s)})("change",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).getMargin("TP")}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-hint",49),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(5),e.\u0275\u0275property("step",t.IncrementPriceTick)("min",t.min)("ngModel",t.SelTriggerPrice)("disabled",!t.hasTriggerPrice),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.SLCaption)}}
1function ur(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div",71),e.\u0275\u0275elementStart(1,"h2"),e.\u0275\u0275text(2,"Target Price Details"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd())}function Sr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul",56),e.\u0275\u0275elementStart(1,"li",72),e.\u0275\u0275elementStart(2,"label"),e.\u0275\u0275text(3,"Target Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"br"),e.\u0275\u0275elementStart(5,"mat-form-field",44),e.\u0275\u0275elementStart(6,"input",73,51),e.\u0275\u0275listener("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).isTargetPriceOnFocusChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onkeyup("TargetPrice",s)})("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).TargetPrice=s}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"li",74),e.\u0275\u0275elementStart(9,"label"),e.\u0275\u0275text(10,"Target Trigger Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(11,"br"),e.\u0275\u0275elementStart(12,"mat-form-field",44),e.\u0275\u0275elementStart(13,"input",75,51),e.\u0275\u0275listener("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).isTargetTriggerPriceOnFocusChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onkeyup("TargetTriggerPrice",s)})("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).TargetTriggerPrice=s}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(6),e.\u0275\u0275property("appAutofocus","TargetrPrice"===t.focusOn)("autofocusDelay","700")("step",t.IncrementPriceTick)("min",t.min)("ngModel",t.TargetPrice),e.\u0275\u0275advance(7),e.\u0275\u0275property("appAutofocus","TargetTriggerPrice"===t.focusOn)("autofocusDelay","700")("step",t.IncrementPriceTick)("min",t.min)("ngModel",t.TargetTriggerPrice)}}function _r(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li",76),e.\u0275\u0275elementStart(2,"span",77),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"br"),e.\u0275\u0275elementStart(5,"label",78),e.\u0275\u0275text(6,"Available Margin"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"li",76),e.\u0275\u0275elementStart(8,"span",77),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"br"),e.\u0275\u0275elementStart(11,"label",78),e.\u0275\u0275text(12,"Approx. Margin"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"li",76),e.\u0275\u0275elementStart(14,"span",77),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(16,"br"),e.\u0275\u0275elementStart(17,"label",78),e.\u0275\u0275text(18,"Margin Shortfall"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"li",79),e.\u0275\u0275element(20,"br"),e.\u0275\u0275elementStart(21,"button",80),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).Refresh()}),e.\u0275\u0275elementStart(22,"span",81),e.\u0275\u0275text(23,"Refresh"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.AvailableMargin),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(t.ApproxMargin),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(t.MarginShortfall),e.\u0275\u0275advance(6),e.\u0275\u0275property("matTooltip","Refresh")("disabled",!t.isMarginBtnEnable)}}function gr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",68),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t)}}function Tr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Days"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",88),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelDay=s}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.SelDay)("disabled",!t.hasDay)("step",1)}}function fr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Date"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",89),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelDate=s})("dateChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).onDateChange(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(6,"mat-datepicker-toggle",90),e.\u0275\u0275element(7,"mat-datepicker",null,91),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275reference(8),r=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(5),e.\u0275\u0275property("matDatepicker",t)("ngModel",r.SelDate)("min",r.minDate)("max",r.maxDate)("readonly",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("for",t)}}function Cr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",92),e.\u0275\u0275elementStart(1,"mat-checkbox",93),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).amoStatus.isAMOChecked=s}),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(2,"AMO "),e.\u0275\u0275element(3,"img",94),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.amoStatus.isAMOEnabled?"":"AMOCheckBoxBlur")("ngModel",t.amoStatus.isAMOChecked)("disabled",!t.amoStatus.isAMOEnabled),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip",t.AMOToolTipDisclaimer)}}function vr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",99),e.\u0275\u0275element(1,"img",100),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275property("matTooltip",t.ProtPercDisclaimer)}}function Pr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",95),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Protection %"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",96,97),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelProdPer=s})("blur",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275reference(6);return e.\u0275\u0275nextContext(4).transformValue("MKTPR",s,"")}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(7,vr,2,1,"div",98),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.SelProdPer)("disabled",!t.hasProdPer)("step",1),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.showProtPercDisclaimer)}}function Er(S,O){if(1&S&&e.\u0275\u0275element(0,"img",94),2&S){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275property("matTooltip",t.COLDisclaimer)}}function yr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",101),e.\u0275\u0275elementStart(1,"mat-checkbox",102),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelCOL=s}),e.\u0275\u0275text(2,"COL"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,Er,1,1,"img",103),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",t.SelCOL)("disabled",!t.hasCOLEnabled),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.hasCOL)}}function Ir(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",101),e.\u0275\u0275elementStart(1,"mat-checkbox",104),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelCutOff=s}),e.\u0275\u0275text(2,"Cut Off"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",t.SelCutOff)}}function Mr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",68),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t)}}function xr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",95),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Margin"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"mat-select",105),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelMargin=s}),e.\u0275\u0275template(6,Mr,2,2,"mat-option",46),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.SelMargin),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.ArrMargin)}}function Or(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",92),e.\u0275\u0275elementStart(1,"mat-checkbox",106),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).isOCOChecked=s}),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(2,"OCO "),e.\u0275\u0275element(3,"img",94),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.isOCOEnabled?"":"AMOCheckBoxBlur")("ngModel",t.isOCOChecked)("disabled",!t.hasValidity),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip",t.OCOToolTipDisclaimer)}}function Dr(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li"),e.\u0275\u0275elementStart(2,"label"),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"br"),e.\u0275\u0275elementStart(5,"mat-form-field",44),e.\u0275\u0275elementStart(6,"input",82,83),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).SelDiscQty=s})("blur",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275reference(7);return e.\u0275\u0275nextContext(3).transformValue("DISCQTY",s,0)})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onkeyup("DISCQTY",s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"li"),e.\u0275\u0275elementStart(9,"label"),e.\u0275\u0275text(10,"Validity"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(11,"br"),e.\u0275\u0275elementStart(12,"mat-form-field",44),e.\u0275\u0275elementStart(13,"mat-select",84),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).SelValidity=s}
1)("selectionChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).onSelValidityChange()}),e.\u0275\u0275template(14,gr,2,2,"mat-option",46),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(15,Tr,6,3,"li",3),e.\u0275\u0275template(16,fr,9,6,"li",3),e.\u0275\u0275template(17,Cr,4,4,"li",85),e.\u0275\u0275template(18,Pr,8,4,"li",86),e.\u0275\u0275template(19,yr,4,3,"li",87),e.\u0275\u0275template(20,Ir,3,1,"li",87),e.\u0275\u0275template(21,xr,7,2,"li",86),e.\u0275\u0275template(22,Or,4,4,"li",85),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("Disclosed ",t.QtyCaption,""),e.\u0275\u0275advance(3),e.\u0275\u0275property("step",t.IncrementLot)("ngModel",t.SelDiscQty)("disabled",!t.hasDiscQty),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",t.SelValidity)("disabled",!t.hasValidity),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.ArrValidity),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasDay),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasGTDDay),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.amoStatus.hasAMO),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasProdPer),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasCOL),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasCutOff),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasMargin),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isOCOEnabled)}}function Ar(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"ul",109),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.MPTableText)}}function Lr(S,O){if(1&S&&e.\u0275\u0275element(0,"img",94),2&S){const t=e.\u0275\u0275nextContext(6);e.\u0275\u0275property("matTooltip",t.TrailingSLDisclaimer)}}function D(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",92),e.\u0275\u0275elementStart(1,"mat-checkbox",113),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).SelTrailingSL=s})("change",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).onSelTrailingSLChange()}),e.\u0275\u0275text(2,"Trailing SL"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,Lr,1,1,"img",103),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",t.SelTrailingSL)("disabled",!t.hasTrailingSL),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible)}}function le(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"SL Jump Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",114),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).SelSLJumpPrice=s})("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).isSLJumpPriceChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).onkeyup("SLJumpPrice",s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.SelSLJumpPrice)("disabled",!t.hasSLJumpPrice)("step",t.IncrementPriceTick)}}function c(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"LTP Jump Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",115),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).SelLTPJumpPrice=s})("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).isLTPJumpPriceChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).onkeyup("LTPJumpPrice",s
1)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.SelLTPJumpPrice)("disabled",!t.hasLTPJumpPrice)("step",t.IncrementPriceTick)}}function C(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Profit Order Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"mat-form-field",44),e.\u0275\u0275elementStart(5,"input",116),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).SelProfitOrderPrice=s})("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).isProfitOrderPriceChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).onkeyup("POPrice",s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-hint",49),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275advance(5),e.\u0275\u0275property("disabled",!t.hasProfitOrderPrice)("placeholder",t.sBOPricePrefDisplayName)("ngModel",t.SelProfitOrderPrice)("step","Price %"==t.sBOPricePrefDisplayName?.01:t.IncrementPriceTick),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.PPRVal)}}function v(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275elementStart(1,"li",72),e.\u0275\u0275elementStart(2,"label"),e.\u0275\u0275text(3,"Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"br"),e.\u0275\u0275elementStart(5,"mat-form-field",44),e.\u0275\u0275elementStart(6,"input",110),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelMPPrice=s})("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).onisMPPriceOnFocusChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).onkeyup("MPP",s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-hint",49),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"li",111),e.\u0275\u0275elementStart(10,"label"),e.\u0275\u0275text(11,"Trigger Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(12,"br"),e.\u0275\u0275elementStart(13,"mat-form-field",44),e.\u0275\u0275elementStart(14,"input",112),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).SelMPTriggerPrice=s})("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).isMPTrigPriceOnFocusChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).onkeyup("TP",s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"mat-hint",49),e.\u0275\u0275text(16),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(17,D,4,3,"li",85),e.\u0275\u0275template(18,le,6,3,"li",3),e.\u0275\u0275template(19,c,6,3,"li",3),e.\u0275\u0275template(20,C,8,5,"li",3),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(6),e.\u0275\u0275property("step","Price %"==t.sBOPricePrefDisplayName?.01:t.IncrementPriceTick)("placeholder",t.sBOPricePrefDisplayName)("ngModel",t.SelMPPrice)("disabled",!t.hasMPPrice),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.LPRVal),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",t.SelMPTriggerPrice)("step","Price %"==t.sBOPricePrefDisplayName?.01:t.IncrementPriceTick)("disabled",!t.hasMPTriggerPrice)("placeholder",t.sBOPricePrefDisplayName),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.TPRVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible&&t.hasSLJumpPrice),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible&&t.hasLTPJumpPrice),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible)}}function A(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",107),e.\u0275\u0275template(1,Ar,3,1,"ul",108),e.\u0275\u0275template(2,v,21,14,"ul",3),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible)}}function z(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",117),e.\u0275\u0275element(1,"span",118),e.\u0275\u0275element(2,"span",118),e.\u0275\u0275element(3,"span",118),e.\u0275\u0275element(4,"span",118),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.sBanScripMsg,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.sBanGSMMsg,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.sPhySetMsg,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.sT2TScripWrnMsg,e.\u0275\u0275sanitizeHtml)}}function Se(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",117),e.\u0275\u0275element(1,"span",118),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.sErrorMsg,e.\u0275\u0275sanitizeHtml)}}function ye(S,O){if(1&S&&e.\u0275\u0275element(0,"img",119),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("matTooltip",t.MPDisclaimer)}}function Oe(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",120),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).showOrderCharges()}),e.\u0275\u0275text(1,"Brokerage and Charges"),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("disabled",!(t.SelQty>0))}}function Fe(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",121),e.\u0275\u0275elementStart(1,"div",95),e.\u0275\u0275element(2,"combined-Depth",122),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",123),e.\u0275\u0275elementStart(4,"div",124),e.\u0275\u0275elementStart(5,"table",125),e.\u0275\u0275elementStart(6,"tr"),e.\u0275\u0275elementStart(7,"th"),e.\u0275\u0275text(8,"Support"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"th"),e.\u0275\u0275text(10,"Resistance"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"tr"),e.\u0275\u0275elementStart(12,"td"),e.\u0275\u0275elementStart(13,"label"),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"td"),e.\u0275\u0275elementStart(16,"span"),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"tr"),e.\u0275\u0275elementStart(19,"td"),e.\u0275\u0275elementStart(20,"label"),e.\u0275\u0275text(2
11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"td"),e.\u0275\u0275elementStart(23,"span"),e.\u0275\u0275text(24),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"tr"),e.\u0275\u0275elementStart(26,"td"),e.\u0275\u0275elementStart(27,"label"),e.\u0275\u0275text(28),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(29,"td"),e.\u0275\u0275elementStart(30,"span"),e.\u0275\u0275text(31),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"tr"),e.\u0275\u0275elementStart(33,"td"),e.\u0275\u0275elementStart(34,"label"),e.\u0275\u0275text(35),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(36,"td"),e.\u0275\u0275elementStart(37,"span"),e.\u0275\u0275text(38),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(39,"div",126),e.\u0275\u0275elementStart(40,"ul"),e.\u0275\u0275elementStart(41,"li"),e.\u0275\u0275elementStart(42,"h1"),e.\u0275\u0275text(43,"Pivot Point Data"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(44,"li"),e.\u0275\u0275elementStart(45,"span"),e.\u0275\u0275text(46),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(2),e.\u0275\u0275property("PageSource",t.IpPageSource)("isExchNameVisible",!0)("isBuySellLinkVisible",!1)("isB5DataVisible",!1)("Scrip",t.objScrip)("orderEntry","true"),e.\u0275\u0275advance(12),e.\u0275\u0275textInterpolate1("S1 : ",t.Support1,""),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("R1 : ",t.Resistance1,""),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("S2 : ",t.Support2,""),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("R2 : ",t.Resistance2,""),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("S3 : ",t.Support3,""),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("R3 : ",t.Resistance3,""),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("S4 : ",t.Support4,""),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("R4 : ",t.Resistance4,""),e.\u0275\u0275advance(8),e.\u0275\u0275textInterpolate(t.PivotPoint)}}function Qe(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275elementStart(1,"div",42),e.\u0275\u0275elementStart(2,"div",43),e.\u0275\u0275elementStart(3,"ul"),e.\u0275\u0275elementStart(4,"li"),e.\u0275\u0275elementStart(5,"label"),e.\u0275\u0275text(6,"Order Type"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(7,"br"),e.\u0275\u0275elementStart(8,"mat-form-field",44),e.\u0275\u0275elementStart(9,"mat-select",45),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).SelOrderTypes=s})("selectionChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onSelOrderTypesChange()}),e.\u0275\u0275template(10,pr,2,2,"mat-option",46),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"li"),e.\u0275\u0275elementStart(12,"label"),e.\u0275\u0275text(13),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(14,"br"),e.\u0275\u0275elementStart(15,"mat-form-field",44),e.\u0275\u0275elementStart(16,"input",47,48),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).SelQty=s})("blur",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275reference(17);return e.\u0275\u0275nextContext(2).transformValue("QTY",s,0)})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onkeyup("QTY",s)})("change",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).getMargin("QTY")}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"mat-hint",49),e.\u0275\u0275elementStart(19,"strong"),e.\u0275\u0275text(20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"li"),e.\u0275\u0275elementStart(22,"label"),e.\u0275\u0275text(23,"Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(24,"br"),e.\u0275\u0275elementStart(25,"mat-form-field",44),e.\u0275\u0275elementStart(26,"input",50,51),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).SelPrice=s})("blur",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275reference(27),d=e.\u0275\u0275nextContext(2);return d.transformValue("PRICE",s,""),d.isPriceOnFocusChange()})("keyup",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onkeyup("PRICE",s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"mat-hint",49),e.\u0275\u0275text(29),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(30,mr,9,5,"li",3),e.\u0275\u0275elementStart(31,"li",52),e.\u0275\u0275elementStart(32,"mat-button-toggle",53),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).ShowAdvance()}),e.\u0275\u0275text(33),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(34,ur,3,0,"div",54),e.\u0275\u0275template(35,Sr,15,10,"ul",55),e.\u0275\u0275template(36,_r,24,5,"ul",3),e.\u0275\u0275elementStart(37,"div",56),e.\u0275\u0275template(38,Dr,23,15,"ul",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(39,A,3,2,"div",57),e.\u0275\u0275template(40,z,5,4,"div",58),e.\u0275\u0275template(41,Se,2,1,"div",58),e.\u0275\u0275elementStart(42,"div",59),e.\u0275\u0275elementStart(43,"ul"),e.\u0275\u0275elementStart(44,"li",60),e.\u0275\u0275elementStart(45,"span"),e.\u0275\u0275template(46,ye,1,1,"img",61),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(47,"span"),e.\u0275\u0275elementStart(48,"button",62),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).SubmitOrder()}),e.\u0275\u0275text(49),e.\u0275\u0275pipe(50,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(51,"button",63),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).Reset()}),e.\u0275\u0275text(52),e.\u0275\u0275pipe(53,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(54,Oe,2,1,"button",64),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(55,"li",65),e.\u0275\u0275elementStart(56,"mat-button-toggle",66),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).ShowMore()}),e.\u0275\u0275text(57),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(58,Fe,47,15,"div",67),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("className",t.bckgrndColor),e.\u0275\u0275advance(8),e.\u0275\u0275property("ngModel",t.SelOrderTypes)("disabled",!t.hasOrderType),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.ArrOrderTypes),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.QtyCaption),e.\u0275\u0275advance(3),e.\u0275\u0275property("appAutofocus","qty"===t.focusOn)("autofocusDelay","700")("step",t.IncrementLot)("ngModel",t.SelQty)("disabled",!t.hasQty),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(t.ScripMarketLot),e.\u0275\u0275advance(6),e.\u0275\u0275property("appAutofocus","price"===t.focusOn)("autofocusDelay","700")("step",t.IncrementPriceTick)("min",t.min)("ngModel",t.SelPrice)("disabled","MARGINPLUS"==t.SelProduct&&"2"==t.LegIndicator?t.hasPrice:!t.hasPrice),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.ScripDPR),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasTriggerPrice),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.AdvanceBtnCaption),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isOCOChecked),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isOCOChecked),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMarginDisplay),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.bShowAdvance),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bBanScripMsg||t.bBanGSMMsg||t.bPhySetMsg||t.isT2TSeriesScrip),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.sErrorMsg.length>0),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",t.showMPDisclaimer),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("border",t.poBtnBorder),e.\u0275\u0275property("disabled",t.IsSubmitDisabled)("className",t.poBtnColor),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(50,37,"Place Order")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(53,39,"Reset")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","GTT"!=t.SelValidity&&t.sURLOrderRegCharges&&t.sURLOrderRegCharges.length>0&&t.PageSource!=t.pgSrcNetPosition),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.ShowMoreBtnCaption),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bShowMore)}}function qe(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",127),e.\u0275\u0275element(1,"span",128),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.sErrorMsgCoverOrder,e.\u0275\u0275sanitizeHtml)}}function Be(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,sr,17,7,"div",7),e.\u0275\u0275template(2,lr,2,1,"div",8),e.\u0275\u0275elementStart(3,"div",9),e.\u0275\u0275elementStart(4,"ul"),e.\u0275\u0275elementStart(5,"li",10),e.\u0275\u0275elementStart(6,"label",11),e.\u0275\u0275text(7,"We Recommend"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(8,or,2,3,"span",12),e.\u0275\u0275template(9,cr,2,1,"span",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"li",13),e.\u0275\u0275elementStart(11,"mat-button-toggle-group",14,15),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().SelOperation=s})("change",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onSelOperationChange()}),e.\u0275\u0275elementStart(13,"mat-button-toggle",16),e.\u0275\u0275text(14,"BUY"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"mat-button-toggle",17),e.\u0275\u0275text(16,"SELL"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"div",18),e.\u0275\u0275elementStart(18,"div"),e.\u0275\u0275elementStart(19,"mat-tab-group",19),e.\u0275\u0275listener("selectedIndexChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().activeTabIndex=s})("selectedTabChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onSelProductChange(s)}),e.\u0275\u0275template(20,hr,2,1,"mat-tab",20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(21,Qe,59,41,"div",3),e.\u0275\u0275template(22,qe,2,1,"div",21),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.bChangeScrip),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bChangeScrip),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",t.ArrResearchCall.length>0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.ArrResearchCall.length>0),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.SelOperation)("ngStyle",e.\u0275\u0275pureFunction1(14,mi,t.hasBuySell?"auto":"none"))("disabled",!t.hasBuySell),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.buyCSS),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.sellCSS),e.\u0275\u0275advance(3),e.\u0275\u0275property("@.disabled","true"),e.\u0275\u0275advance(1),e.\u0275\u0275property("selectedIndex",t.activeTabIndex),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.ArrProductTypes),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bIsCoverOrderValid),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.bIsCoverOrderValid)}}function dt(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span",139),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("ngClass",t.OEplaceordprice),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelQty)}}function Jt(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span",139),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("ngClass",t.OEplaceordprice),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelQtyAfterMaxOrdSlices)}}function br(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span",139),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Disclosed ",t.QtyCaption,""),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.OEplaceordprice),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelDiscQty)}}function qt(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Trigger Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.SelTriggerPrice)}}
1function _t(S,O){1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1,"OCO"),e.\u0275\u0275elementEnd())}function pt(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Target Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.TargetPrice)}}function Fr(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Target Trigger Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.TargetTriggerPrice)}}function nn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Date"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.selDateDisplay)}}function an(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Date"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.selDateDisplay)}}function sn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Price Indicator"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.sBOPricePrefDisplayName)}}function ln(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"AMO"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.AMOSelected)}}function on(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div",71),e.\u0275\u0275elementStart(1,"h2"),e.\u0275\u0275text(2,"Stop Loss Order Details"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd())}function cn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Order Side"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.SelMPOrderSide)}}function dn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.calcSLPrice,"")}}function hn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelMPPrice)}}function pn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275template(4,dn,2,1,"span",146),e.\u0275\u0275template(5,hn,2,1,"ng-template",null,147,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275reference(6),r=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",r.SelProduct==r.sBracketOrderTxt&&(r.sBOPricePreference==r.sPriceDiffIndicatorValue||r.sBOPricePreference==r.sPricePercentIndicatorValue))("ngIfElse",t)}}function mn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.calcSLTriggerPrice)}}function un(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelMPTriggerPrice)}}function Sn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Trigger Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275template(4,mn,2,1,"span",146),e.\u0275\u0275template(5,un,2,1,"ng-template",null,148,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275reference(6),r=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",r.SelProduct==r.sBracketOrderTxt&&(r.sBOPricePreference==r.sPriceDiffIndicatorValue||r.sBOPricePreference==r.sPricePercentIndicatorValue))("ngIfElse",t)}}function _n(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"SL Jump Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.SelSLJumpPrice)}}function gn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"LTP Jump Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.SelLTPJumpPrice)}}function Tn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275template(1,cn,6,1,"li",3),e.\u0275\u0275template(2,pn,7,2,"li",3),e.\u0275\u0275template(3,
1Sn,7,2,"li",3),e.\u0275\u0275template(4,_n,6,1,"li",3),e.\u0275\u0275template(5,gn,6,1,"li",3),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible&&t.SelTrailingSL),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible&&t.SelTrailingSL)}}function fn(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div",71),e.\u0275\u0275text(1," Profit Order Details"),e.\u0275\u0275elementEnd())}function Cn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Order Side"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(t.SelMPOrderSide)}}function vn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.calcPriceOrderPrice)}}function Pn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelProfitOrderPrice)}}function En(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Profit Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275template(4,vn,2,1,"span",146),e.\u0275\u0275template(5,Pn,2,1,"ng-template",null,149,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275reference(6),r=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",r.SelProduct==r.sBracketOrderTxt&&(r.sBOPricePreference==r.sPriceDiffIndicatorValue||r.sBOPricePreference==r.sPricePercentIndicatorValue))("ngIfElse",t)}}function yn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"ul"),e.\u0275\u0275template(1,Cn,6,1,"li",3),e.\u0275\u0275template(2,En,7,2,"li",3),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible)}}function In(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate3("",t.slicingMultiplier," order(s) of ",t.MaxSingleTransactionQty," ",t.QtyCaption,".")}}function Mn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate3("",t.MaxOrderSlices," order(s) of ",t.MaxSingleTransactionQty," ",t.QtyCaption,".")}}function xn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate2("1 order of ",t.slicingRemQty," ",t.QtyCaption," will be placed.")}}function On(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",150),e.\u0275\u0275elementStart(1,"ul"),e.\u0275\u0275template(2,In,2,3,"li",3),e.\u0275\u0275template(3,Mn,2,3,"li",3),e.\u0275\u0275template(4,xn,2,2,"li",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",0==t.SliceQtyErrorMsg.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.SliceQtyErrorMsg.length>0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.slicingRemQty>0&&0==t.SliceQtyErrorMsg.length)}}function Dn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",151),e.\u0275\u0275element(1,"span",152),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.strQtyMessgae,e.\u0275\u0275sanitizeHtml)}}function An(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",129),e.\u0275\u0275elementStart(1,"div",130),e.\u0275\u0275elementStart(2,"div",131),e.\u0275\u0275elementStart(3,"span",132),e.\u0275\u0275text(4,"You are about to "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"span",133),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",134),e.\u0275\u0275elementStart(8,"span"),e.\u0275\u0275elementStart(9,"h2",135),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"h1",136),e.\u0275\u0275text(12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",137),e.\u0275\u0275elementStart(14,"ul"),e.\u0275\u0275elementStart(15,"li"),e.\u0275\u0275elementStart(16,"label"),e.\u0275\u0275text(17,"Order Type"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(18,"br"),e.\u0275\u0275elementStart(19,"span"),e.\u0275\u0275text(20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"li"),e.\u0275\u0275elementStart(22,"label"),e.\u0275\u0275text(23),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(24,"br"),e.\u0275\u0275template(25,dt,2,2,"span",138),e.\u0275\u0275template(26,Jt,2,2,"span",138),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(27,br,6,3,"li",3),e.\u0275\u0275elementStart(28,"li"),e.\u0275\u0275elementStart(29,"label"),e.\u0275\u0275text(30,"Price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(31,"br"),e.\u0275\u0275elementStart(32,"span",139),e.\u0275\u0275text(33),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(34,qt,6,1,"li",3),e.\u0275\u0275elementStart(35,"li"),e.\u0275\u0275elementStart(36,"label"),e.\u0275\u0275text(37,"Product Type"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(38,"br"),e.\u0275\u0275elementStart(39,"span"),e.\u0275\u0275text(40),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(41,"li"),e.\u0275\u0275elementStart(42,"label"),e.\u0275\u0275text(43,"Validity"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(44,"br"),e.\u0275\u0275elementStart(45,"span"),e.\u0275\u0275text(46),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(47,_t,2,0,"span",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(48,pt,6,1,"li",3),e.\u0275\u0275template(49,Fr,6,1,"li",3),e.\u0275\u0275template(50,nn,6,1,"li",3),e.\u0275\u0275template(51,an,6,1,"li",3),e.\u0275\u0275template(52,sn,6,1,"li",3),e.\u0275\u0275template(53,ln,6,1,"li",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(54,on,3,0,"div",54),e.\u0275\u0275template(55,Tn,6,5,"ul",3),e.\u0275\u0275template(56,fn,2,0,"div",54),e.\u0275\u0275template(57,yn,3,2,"ul",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(58,On,5,3,"div",140),e.\u0275\u0275template(59,Dn,2,1,"div",141),e.\u0275\u0275elementStart(60,"div",142),e.\u0275\u0275elementStart(61,"span"),e.\u0275\u0275elementStart(62,"button",143),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().ConfirmClick()}),e.\u0275\u0275text(63),e.\u0275\u0275pipe(64,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(65,"span",144),e.\u0275\u0275elementStart(66,"button",145),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().GoBack()}),e.\u0275\u0275text(67),e.\u0275\u0275pipe(68,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("ngClass",t.OperationTrend),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelBuySell),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(t.ScripSymbol),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.ScripData),e.\u0275\u0275advance(8),e.\u0275\u0275textInterpolate(t.SelOrderTypes),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.QtyCaption),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",0==t.SliceQtyErrorMsg.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.SliceQtyErrorMsg.length>0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasDiscQty&&t.SelDiscQty>0),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngClass",t.OEplaceordprice),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.SelPrice),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasTriggerPrice),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(t.SelProduct),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate(t.SelValidity),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isOCOChecked),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isOCOChecked),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isOCOChecked),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasGTDDay),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.hasGTTDay),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.amoStatus.hasAMO),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isMPVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isBracketDetailsVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isSlicingRequired),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.strQtyMessgae.length>0),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",t.IsConfirmDisabled||t.edisProcessing),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(64,31,"Confirm")),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",t.edisProcessing),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(68,33,"Back"))}}
1function Ln(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div",153),e.\u0275\u0275element(1,"nn-progressbar",154),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function bn(S,O){1&S&&e.\u0275\u0275element(0,"div",155)}let Ur=(()=>{class S{constructor(t,r,s,d,I,M,U,q){this.menumangerService=t,this.validate=r,this.logService=s,this.httpService=d,this.pubsubService=I,this.zone=M,this.dialogService=U,this.tradingSharedService=q,this.sOrderAlert="Your order has been submitted.<br />Please check Order Book for status.",this.min=0,this.closeDialog=new e.EventEmitter,this.ScripDetail=new m.u,this.bShowMore=!1,this.bChangeScrip=!1,this.bShowAdvance=!1,this.sErrorMsg="",this.strQtyMessgae="",this.sBanGSMMsg="",this.bBanGSMMsg=!1,this.bIsCoverOrderValid=!0,this.sErrorMsgCoverOrder="",this.ContainerId="",this.bFormat=!1,this.ArrSubTokens=[],this.ArrSubTokensLookup=[],this.IS_SP16B=!1,this.ArrExchange=[],this.SelExchange=this.ArrExchange[0],this.ArrScripMaster=[],this.ArrInstruments=[],this.SelInstrument=this.ArrInstruments[0],this.ArrValidity=[],this.SelValidity=this.ArrValidity[1],this.ArrProductTypes=[],this.SelProduct=this.ArrProductTypes[0],this.dcProductType=new n.aM,this.activeTabIndex=0,this.ArrOrderTypes=[],this.SelOrderTypes=this.ArrOrderTypes[0],this.SelOriginalOrderType="",this.ArrMargin=[],this.SelMargin=this.ArrMargin[0],this.RecommendationId="",this.BS=["BUY","SELL"],this.OEnseCSS="OEnseCSS",this.ArrBuySell=this.BS,this.SelBuySell=this.ArrBuySell[0],this.OEOperation="selectOEB",this.OEOperationDiv="OE-container bg7",this.hasBuySell=!0,this.hasExchange=!0,this.hasInstrument=!0,this.hasSymbol=!0,this.hasOrderType=!0,this.hasQty=!0,this.hasPrice=!0,this.hasDiscQty=!0,this.hasTriggerPrice=!0,this.hasProductType=!0,this.hasValidity=!0,this.hasDay=!0,this.hasSeries=!1,this.hasOptionType=!1,this.hasExpire=!1,this.hasProdPer=!1,this.hasStrikePrice=!1,this.hasCOL=!1,this.hasCOLEnabled=!1,this.hasCutOff=!1,this.hasMargin=!1,this.defaultProduct="",this.SelOperation=this.ArrBuySell[0],this.SelSymbol="",this.scripStatus=!1,this.bPhySetMsg=!1,this.bBanScripMsg=!1,this.sPhySetMsg="",this.sBanScripMsg="",this.sT2TScripWrnMsg="",this.isT2TSeriesScrip=!1,this.T2TSeriesList=[],this.ArrSeries=[],this.SelSeries="",this.ArrStrikePrice=[],this.SelStrikePrice="",this.ArrOptionType=[],this.SelOptionType="",this.ArrExpire=[],this.SelExpire="",this.SelProdPer="",this.isSymbolOnFocus=!1,this.isQtyOnFocus=!1,this.isPriceOnFocus=!1,this.isTrigPriceOnFocus=!1,this.MarketSegmentId="",this.MapMarketSegmentId="",this.SelMarketLot="",this.SelDecimalloc=100,this.SelPriceTick="",this.PriceTickInRs="",this.PriceNumerator=1,this.PriceDenominator=1,this.GenNumerator=1,this.GenDenominator=1,this.IntrinsicValue=1,this.SelToken="",this.SelMPMFFlag="0",this.IsSpread=!1,this.ModifyFlag=!1,this.FIILimit="",this.NRILimit="",this.AMOID="",this.ExchangeOrderNo="",this.GatewayOrderNo="",this.ClientOrderNumber="",this.OrderTime="",this.ParticipantID="",this.SPOS="",this.POSType="",this.PageSource="",this.QtyCaption="Qty",this.DiscQtyCaption="Disc Qty",this.IsBulkOrderEntry=!1,this.RowSequence="",this.QtyAlert=0,this.PriceAlert=0,this.ValueAlert=0,this.bConfReq=!0,this.bAlertConfQty=!0,this.bAlertConfPrice=!0,this.bAlertConfValue=!0,this.strMessage="Do you want to place the order?",this.LTP=0,this.TempQty="",this.TempPrice="",this.isMPVisible=!1,this.showMPDisclaimer=!1,this.MPDisclaimer="",this.MPTriggerPriceLowRange=0,this.MPTriggerPriceHighRange=0,this.MPLimitPriceLowRange=0,this.MPLimitPriceHighRange=0,this.MPCount=0,this.MPHighPr=0,this.MPLowPr=0,this.MPDecLoc=100,this.MPDecPrecision=2,this.MPLimitTrigPerc=0,this.MPTrigLimitPerc=0,this.MPDPRFlag="",this.MPDPRRangePerc=0,this.MPLTP=0,this.MPClosePrice=0,this.MPPriceTick=0,this.MPBasePrice=0,this.MPSetPrice=0,this.MPVirtualHighPr=0,this.MPVirtualLowPr=0,this.MPActualHighPr=0,this.MPActualLowPr=0,this.MPSuccessFailure=!1,this.MPIsLimitPrEnteredFirst=!1,this.MPExpiryValue="",this.MPStrikePriceValue="",this.MPTradingAllowed=0,this.MPLimitTrigPercMin=0,this.MPOEOperationDiv="bg8",this.MPOEOperation="selectOES",this.SelMPOrderType="",this.SelMPPrice="",this.isMPPriceOnFocus=!1,this.isMPTrigPriceOnFocus=!1,this.hasMPOrderType=!1,this.hasMPTriggerPrice=!0,this.hasMPPrice
1=!0,this.SelMPOrderSide="",this.MPLowerLTPTrigger=0,this.scripDesc="",this.EnbDisSubmit=!0,this.sOriginalQty="",this.ValueAlertFlag=!1,this.showProtPercDisclaimer=!1,this.ProtPercDisclaimer="",this.COLDisclaimer=n.xB.dMsgMaster.OE106,this.SelCOL=!1,this.SelCutOff=!1,this.SelAMO=!1,this.isOCOChecked=!1,this.isOCOEnabled=!1,this.ArrResearchCall=[],this.SelTrailingSL=!1,this.TrailingSLDisclaimer=n.xB.dMsgMaster.NNSL368,this.PPRVal="",this.ProfitPriceLowRange=0,this.ProfitPriceHighRange=0,this.BracketOrderId="",this.LegIndicator="",this.BOGatewayOrderNo="",this.ProfitPricePerc=0,this.MPProdTypeIndicator="0",this.isProfitOrderPriceOnFocus=!1,this.isSLJumpPriceOnFocus=!1,this.isLTPJumpPriceOnFocus=!1,this.hasProfitOrderPrice=!0,this.hasTrailingSL=!0,this.isBracketDetailsVisible=!1,this.hasSLJumpPrice=!1,this.hasLTPJumpPrice=!1,this.MPTableText="",this.divMPWidthClass="MPWidth",this.BOSuccessFailure=!1,this.OEJSONData="",this.scripList=[],this.IsPopulatePrice=!1,this.IsComputeMPRange=!1,this.BuyPrice=0,this.SellPrice=0,this.MPArrStrikePrice=[],this.UnderlyingMktSegId="",this.UnderlyingToken="",this.IsComputeMPOptionParams=!1,this.MPdblStrikePrice=0,this.CapPrice=0,this.FloorPrice=0,this.SetPrice=0,this.IsLastClosingPrice=0,this.IsCutOffAllowed=0,this.IsSetPrice=0,this.SendMktReqFlag=!1,this.UnderlyingLTP=0,this.showOEDiv=!0,this.show2FA=!1,this.dcEnableDisableFields=new n.aM,this.dcOrderDetails=new n.aM,this.SLCaption="(in case Stoploss order)",this.PPFormula="",this.CalculationMethod="",this.PrevDayOpen="0.0000",this.PrevDayHigh="0.0000",this.PrevDayLow="0.0000",this.PrevDayClose="0.0000",this.FBRatio1=0,this.FBRatio2=0,this.FBRatio3=0,this.FBRatio4=0,this.Resistance4=0,this.Resistance3=0,this.Resistance2=0,this.Resistance1=0,this.PivotPoint=0,this.Support1=0,this.Support2=0,this.Support3=0,this.Support4=0,this.Range=0,this.SelectedCalcMethod="",this.SelectedPivotPointFormula="",this.arrCalcMethod=[n.gT.C_S_PP_METHOD_CLASSIC,n.gT.C_S_PP_METHOD_WOODIE,n.gT.C_S_PP_METHOD_CAMARILLA,n.gT.C_S_PP_METHOD_FIBONACCI],this.arrPivotPointFormula=[n.gT.C_S_PP_FORMULA_HLC,n.gT.C_S_PP_FORMULA_HLO,n.gT.C_S_PP_FORMULA_HLCO,n.gT.C_S_PP_FORMULA_HLCC,n.gT.C_S_PP_FORMULA_HLOO,n.gT.C_S_PP_FORMULA_HL,n.gT.C_S_PP_FORMULA_HC,n.gT.C_S_PP_FORMULA_LC],this.ShowConfirm=!1,this.tabs=[],this.AdvanceBtnCaption="Show advanced",this.ShowMoreBtnCaption="Show more",this.poBtnColor="#be3825",this.poBtnBorder="1px solid white",this.bckgrndColor="oe_grad_green",this.selectedExchangeId="1",this.scripDetail=new m.u,this.scripInfo1=new m.u,this.scripInfo2=new m.u,this.ShowSwitch=!1,this.bShowChangeScrip=!0,this.IsSubmitDisabled=!1,this.IsConfirmDisabled=!1,this.LTPTrend="",this.NetChangeTrend="",this.oldLTP=0,this.ScripData="",this.ScripSymbol="",this.OETitle="Order Entry",this.isDataAvailable=!1,this.hasAMO="True"==n.xB.User.AMOLicenseAllowedForUser,this.isAMOEnabled=!1,this.isAMOChecked=!1,this.AMODisclaimer=n.xB.dMsgMaster.OE111,this.AMOToolTipDisclaimer=n.xB.dMsgMaster.OE112,this.edisProcessing=!1,this.eDISOnline=!1,this.eDISRequire=!1,this.eDISMode="",this.eDISParams=null,this.disableBackground=!1,this.type=1,this.isGTD=!1,this.hasGTDDay=!1,this.isGTT=!1,this.hasGTTDay=!1,this.bAllowGTT=!1,this.strGTTallowexch=[],this.OCOToolTipDisclaimer=n.xB.dMsgMaster.OE217,this._BOPricePreference="",this.sBracketOrderTxt=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT,this.sPriceDiffIndicatorValue=n.gT.C_V_BO_PI_PRICE_DIFFERENCE,this.sPricePercentIndicatorValue=n.gT.C_V_BO_PI_PRICE_PERCENT,this.OrderStatus="",this.BracketOrderStatus="",this.isMarginDisplayPreference=!1,this.isMarginDisplayServer=n.xB.User.ShowMarginOnOrderEntry,this.isMarginDisplay=!1,this.isMarginBtnEnable=!0,this.AvailableMargin=parseFloat("0.00").toFixed(2),this.ApproxMargin=parseFloat("0.00").toFixed(2),this.MarginShortfall=parseFloat("0.00").toFixed(2),this.isfirstTime=!0,this.oldqty=0,this.oldprice=0,this.settlmtCycle="",this.subTokens=[],this.LTQ=0,this.sPriceBandWarning="",this.brokerageCost=0,this.sURLOrderRegCharges=n.xB.dConfigMaster.ORDER_REG_CHRGS_NETNET_URL,this.pgSrcNetPosition=n.gT.C_V_NETPOSITION_PAGENO,this.ArrOrdSubTokens=[],this.IsFundShortFallRej=!1,this.SetFundShortFallAmt="0.00",this.ClientRefNo="",this.BracketOrdModifyBit=0,this.SLOrderType="",this.CloseOELoaderTimer=null,this.sSurvMeasureDescription=null,this.ShowOEMarketDepth="ShowOEMarketDepth_"+n.xB.User.
1UserId,this.MaxSingleTransactionQty=0,this.slicingMultiplier=0,this.slicingRemQty=0,this.isSlicingRequired=!1,this.strMTF_QTY=0,this.MTFPrepledge=n.xB.dConfigMaster.MTF_PREPLEDGE,this.SliceQtyErrorMsg="",this.SelQtyAfterMaxOrdSlices=0,this.MaxOrderSlices=0,this.scripDetails=[],this.placeOrder=!1,this.confirmOrder=!1,this.confirmDialog=!1,this.isDialog=!1,this.UnderlyingClosePrice=0,this.IpPageSource=n.gT.C_V_ORDERENTRY_PAGE,n.xB.dConfigMaster.VERSION_IS_SP16B_DECODED==n.gT.C_S_OFF&&(this.IS_SP16B=!0)}ngOnInit(){try{this.PageSource="MANUAL",this.ArrExchange=n.xB.ExchManager.PopulateExchanges(n.gT.C_V_ORDERENTRY_PAGE),this.SelExchange=this.ArrExchange[0],this.onSelExchangeChange(),null!=this.context&&null!=this.context.params&&this.handleParams(),"OFF"==n.xB.dConfigMaster.ORDERENTRY_SHOWMORE_DEFAULT?(this.ShowMoreBtnCaption="Show more",this.bShowMore=!1):(this.ShowMoreBtnCaption="Show less",this.bShowMore=!0),null!=localStorage.getItem(this.ShowOEMarketDepth)&&("true"==localStorage.getItem(this.ShowOEMarketDepth)?(this.ShowMoreBtnCaption="Show less",this.bShowMore=!0):(this.ShowMoreBtnCaption="Show more",this.bShowMore=!1)),this.getOrderentryReco(),this.min=o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?"-9999999":"0",this.tradingSharedService.loadLTPPriceBandMaster()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","orderentry.component.ts","")}}ngAfterContentInit(){200==this.context.params.sourceId&&(this.allowedGTDProducts(),this.allowedGTTProducts())}handleParams(){if(this.context.params.sourceId==n.gT.C_S_MENU_TRADING_KEYBOARDSHORTCUTS){var t=new h.Q;t.OrderSide=this.context.params.data,t.PageSource=n.gT.C_S_MENU_TRADING_KEYBOARDSHORTCUTS,this.PopulateOE(t)}else this.PopulateOE(this.context.params.data)}changeParams(){null!=this.context&&null!=this.context.params&&this.handleParams()}set sBOPricePreference(t){this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(this._BOPricePreference=t,this.sBOPricePrefDisplayName=t==n.gT.C_V_BO_PI_PRICE_PERCENT?n.gT.C_S_BO_PI_PRICE_PERCENT:t==n.gT.C_V_BO_PI_PRICE_DIFFERENCE?n.gT.C_S_BO_PI_PRICE_DIFFERENCE:n.gT.C_S_BO_PI_ACTUAL_PRICE):(this._BOPricePreference="",this.sBOPricePrefDisplayName="")}get sBOPricePreference(){return this._BOPricePreference}ngOnDestroy(){this.DestroyView()}fn_ResetFields(){try{this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.PageSource!=n.gT.C_V_STOCKVIEW_PAGENO.toString()&&this.PageSource!=n.gT.C_V_GTDORDERBOOK_PAGENO.toString()&&(this.SelProdPer="",this.SelQty="",this.SelPrice="",this.SelDiscQty="",this.SelTriggerPrice="",this.TargetPrice="",this.TargetTriggerPrice="",this.SelDay="",this.ArrSeries=[],this.SelSeries="",this.ArrStrikePrice=[],this.SelStrikePrice="",this.ArrOptionType=[],this.SelOptionType="",this.ArrExpire=[],this.SelExpire="",this.ArrProductTypes.Count()>0&&(this.SelProduct=this.ArrProductTypes[0],this.activeTabIndex=0),this.SelPriceTick="",this.SelToken="",this.SelMPMFFlag="0",this.IsSpread=!1,this.ModifyFlag=!1,this.FIILimit="",this.NRILimit="",this.AMOID="",this.ExchangeOrderNo="",this.ClientOrderNumber="",this.GatewayOrderNo="",this.OrderTime="",this.ParticipantID="",this.SPOS="",this.POSType="",this.SelDecimalloc=100,this.SendMktReqFlag=!1,this.isMPVisible=!1,this.showMPDisclaimer=!1,this.MPDisclaimer="",this.MPTriggerPriceLowRange=0,this.MPTriggerPriceHighRange=0,this.MPLimitPriceLowRange=0,this.MPLimitPriceHighRange=0,this.MPCount=0,this.MPHighPr=0,this.MPLowPr=0,this.MPDecLoc=100,this.MPDecPrecision=2,this.MPLimitTrigPerc=0,this.MPTrigLimitPerc=0,this.MPDPRFlag="",this.MPDPRRangePerc=0,this.MPLTP=0,this.MPClosePrice=0,this.MPPriceTick=0,this.MPBasePrice=0,this.MPSetPrice=0,this.MPVirtualHighPr=0,this.MPVirtualLowPr=0,this.MPActualHighPr=0,this.MPActualLowPr=0,this.MPSuccessFailure=!1,this.MPIsLimitPrEnteredFirst=!1,this.MPExpiryValue="",this.MPStrikePriceValue="",this.sOriginalQty="",this.SelMPOrderSide="",this.TempPrice="",this.TempQty="",this.LTPVal="",this.LPRVal="",this.TPRVal="",this.MPTradingAllowed=0,this.MPLimitTrigPercMin=0,this.SelMPPrice="",this.SelMPTriggerPrice="",this.scripDesc="",this.ProtPercDisclaimer="",this.showProtPercDisclaimer=!1,this.SelCOL=!1,this.SelProfitOrderPrice="",this.SelTrailingSL=!1,this.SelSLJumpPrice="",this.SelLTPJumpPrice="",this.PPRVal="",this.ProfitPriceLowRange=0,this.ProfitPriceHighRange=0,this.ProfitPricePerc=0,this.MPProdTypeIndicator="0",this.BOSuccessFailure=!1,this.OEJ
1SONData="",this.tradingSharedService.sendTouchLineRequest(this.scripList,2),this.scripList=[],this.IsPopulatePrice=!1,this.IsComputeMPRange=!1,this.BuyPrice=0,this.SellPrice=0,this.MPArrStrikePrice=[],this.UnderlyingMktSegId="",this.UnderlyingToken="",this.IsComputeMPOptionParams=!1,this.UnderlyingLTP=0,this.hasCutOff=!1,this.SelCutOff=!1,this.ScripLTP="",this.ScripNetChgInRs="",this.ScripPercChange="",this.ScripDPR="",this.ScripMarketLot="",this.ScripDetail.MWSecurityDesc="",this.Resistance4="",this.Resistance3="",this.Resistance2="",this.Resistance1="",this.Support1="",this.Support2="",this.Support3="",this.Support4="",this.PivotPoint="",this.ValueAlertFlag=!1,this.SelAMO=!1,this.hasPrice=!0,this.SelOriginalOrderType="",this.IsSubmitDisabled=!1,this.ScripSymbol="",this.ScripData="",this.sBanGSMMsg="",this.bBanGSMMsg=!1,this.sPhySetMsg="",this.sBanScripMsg="",this.bPhySetMsg=!1,this.bBanScripMsg=!1,this.sErrorMsg="",this.hasGTDDay=!1,this.hasGTTDay=!1)}catch(t){this.logService.WriteLog("Exception: "+t.message,"ResetFields()","orderentry.component.ts","")}}onTest(t){console.log(t)}onSelOperationChange(){try{"BUY"==this.SelOperation?(this.OEOperation="selectOEB",this.OEOperationDiv="OE-container bg7",this.MPOEOperation="selectOES",this.MPOEOperationDiv="bg8",this.buyCSS="buyCSS",this.sellCSS="sellnull",this.poBtnColor="OEBuyBtn",this.poBtnBorder="1px solid #2fc30d",this.bckgrndColor="oe_grad_green"):(this.OEOperation="selectOES",this.OEOperationDiv="OE-container bg8",this.MPOEOperation="selectOEB",this.MPOEOperationDiv="bg7",this.sellCSS="sellCSS",this.buyCSS="buynull",this.poBtnColor="OESellBtn",this.poBtnBorder="1px solid #f57272",this.bckgrndColor="oe_grad_red"),this.IsPopulatePrice=!0,this.CreateAndSendMultiTouchLineRequest(),this.SelBuySell=this.SelOperation,this.fn_CheckForMarginPlus(),this.isMarginDisplay&&!this.isfirstTime&&this.SelQty>0&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.isfirstTime=!0),this.onShowHideOCOCheckbox()}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelExchange.subscribe()","orderentry.component.ts","")}}onSelQtyUpdate(){try{n.xB.ExchManager.GetDiscQtyFillValue(this.MarketSegmentId,this.SelValidity,this.SelOrderTypes,this.dcOrderDetails)&&(this.SelDiscQty=n.xB.ExchManager.GetDetailsForDiscQty(this.SelExchange,this.SelInstrument,this.SelQty,this.MarketSegmentId))}catch(r){this.logService.WriteLog("Exception: "+r.message,"SelExchange.subscribe()","orderentry.component.ts","")}}onSelExchangeChange(){try{this.fn_ResetFields(),null!=this.SelExchange&&(this.SelInstrument="",this.PopulateInstrument(this.SelExchange),this.SelInstrument=this.ArrInstruments[0],this.onSelInstrumentChange())}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelExchange.subscribe()","orderentry.component.ts","")}}OnInstrumentChange(){try{this.SelSymbol=void 0,this.fn_ResetFields(),this.GetDetailsForInst(this.SelExchange,this.SelInstrument),this.SelValidity=this.ArrValidity[0],this.onSelValidityChange(),this.SelProduct=this.ArrProductTypes[0],this.SelOrderTypes=17!=this.PageSourceId||0!=this.RecoPrice&&""!=this.RecoPrice?this.ArrOrderTypes[0]:this.ArrOrderTypes[1],this.SelMargin=this.ArrMargin[0];var t=n.xB.ExchManager.GetQtyLotCaption(this.MarketSegmentId);this.QtyCaption=t,this.DiscQtyCaption="Disc "+t,this.isSymbolOnFocus=!0}catch(r){this.logService.WriteLog("Exception: "+r.message,"OnInstrumentChange()","orderentry.component.ts","")}}onSelInstrumentChange(){try{null!=this.SelInstrument&&this.OnInstrumentChange()}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelInstrument.subscribe()","orderentry.component.ts","")}}onSelOrderTypesChange(){try{null!=this.SelOrderTypes&&(this.GetDetailsForOrderType(this.SelExchange,this.SelOrderTypes,this.SelInstrument),this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(this.SelPrice="",this.hasPrice=!1,this.SetProtPerc()):(this.SelPrice=0,this.hasPrice=!1,this.SetProtPerc()):(this.ModifyFlag||(this.SelPrice=""),this.hasPrice=!0,this.SetProtPerc()),this.SelOrderTypes!=n.gT.C_S_ORDER_STOPLOSS_TEXT&&this.SelOrderTypes!=n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?(this.SelTriggerPrice=void 0,this.hasTriggerPrice=!1,n.xB.ExchManager.IsPrimaryValidation(this.SelExchange,this.SelInstrument,this.MarketSegmentId,this.SelValidity)?(this.ModifyFlag||(this.SelDiscQty=void 0),this.hasDiscQty=!0):this.SelDiscQty=void 0):(this.hasTriggerPrice=!0,n.xB.ExchManager.IsSecondaryValidation(this.MarketSegmentId,"2")&&(this.SelDiscQty=void 0,this.hasDiscQty=!0)),n.xB.ExchManager.GetDiscQtyFillValue(this.MarketSegmentId,this.SelValidity,this.SelOrderTypes)&&(this.SelDiscQty=this.SelQty),this.SelValidity==n.gT.C_S_VALUE_IOC&&(this.hasDiscQty=!1)),this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()&&this.fn_DisableFieldsForMW(),"GTD"==n.gT.C_S_VALUE_EQUITY_GTD&&n.xB.dcGTDProductAllowed.count()>0&&(this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()||this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString())&&this.allowedGTDProducts(),n.xB.dcGTTProductAllowed.count()>0&&this.SelExchange!=n.gT.C_S_MCX_EXCHANGE_TEXT&&this.SelExchange!=n.gT.C_S_ICEX_EXCHANGE_TEXT&&this.SelExchange!=n.gT.C_S_NCDEX_EXCHANGE_TEXT&&this.allowedGTTProducts(),this.onShowHideOCOCheckbox()}catch(r){this.logService.WriteLog("Exception: "+r.message,"SelOrderTypes.subscribe()","orderentry.component.ts","")}}onSelValidityChange(){try{if(null!=this.SelValidity){if(this.GetDetailsForValidity(this.SelExchange,this.SelValidity,this.SelInstrument),this.SelProduct!=n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT||this.SelExchange!=n.gT.C_S_NSE_EXCHANGE_TEXT&&this.SelExchange!=n.gT.C_S_BSE_EXCHANGE_TEXT||this.SelValidity!=n.gT.C_S_VALUE_GTD){if(this.hasGTDDay=!1,this.SelValidity==n.gT.C_S_VALUE_GTD){var r=n.vV.CalculateDays(new Date,new Date(this.SelExpire));this.SelDay=r}}else{var t=new Date;this.minDate=new Date,this.maxDate=new Date(t.setDate(t.getDate()+parseInt(n.gT.C_S_GTD_MAX_DAYS))),this.FillGTDDaysforEquitities(n.gT.C_S_GTD_DEFAULT_DAYS)}this.SelProduct!=n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT||this.SelExchange==n.gT.C_S_MCX_EXCHANGE_TEXT||this.SelExchange==n.gT.C_S_ICEX_EXCHANGE_TEXT||this.SelExchange==n.gT.C_S_NCDEX_EXCHANGE_TEXT||this.SelValidity!=n.gT.C_S_VALUE_GTT?(this.hasGTTDay=!1,this.SelValidity==n.gT.C_S_VALUE_GTT&&(r=n.vV.CalculateDays(new Date,new Date(this.SelExpire)),this.SelDay=r)):(t=new Date,this.minDate=new Date,this.maxDate=new Date(t.setDate(t.getDate()+parseInt(n.gT.C_S_GTT_MAX_DAYS))),this.FillGTTDaysforEquitities(n.gT.C_S_GTT_DEFAULT_DAYS)),this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(this.SelPrice="",this.hasPrice=!1,this.SetProtPerc()):(this.SelPrice=0,this.hasPrice=!1,this.SetProtPerc()):(this.hasPrice=!0,this.SetProtPerc())}this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT&&this.SelValidity==n.gT.C_S_VALUE_GTT?(this.hasTriggerPrice=!0,this.amoStatus.hasAMO=!1,this.amoStatus.isAMOEnabled=!1,this.amoStatus.isAMOChecked=!1,this.SLCaption="(in case GTT order)"):this.SLCaption="(in case Stoploss order)",this.onShowHideOCOCheckbox()}catch(s){this.logService.WriteLog("Exception: "+s.message,"SelValidity.subscribe()","orderentry.component.ts","")}}onShowHideOCOCheckbox(){this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT&&this.SelValidity==n.gT.C_S_VALUE_GTT?this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()||this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString()?this.SelBuySell==n.gT.C_S_ORDER_SELL_TEXT?this.isOCOEnabled=!0:(this.isOCOEnabled=!1,this.isOCOChecked=!1):this.isOCOEnabled=!0:(this.isOCOEnabled=!1,this.isOCOChecked=!1),this.SelValidity==n.gT.C_S_VALUE_GTT?(this.AvailableMargin="NA",this.ApproxMargin="NA",this.MarginShortfall="NA",this.isMarginBtnEnable=!1):(this.AvailableMargin="0.00",this.ApproxMargin="0.00",this.MarginShortfall="0.00",this.isMarginBtnEnable=!0)}OnOCOChecked(){1==this.isOCOChecked?(this.AvailableMargin="NA",this.ApproxMargin="NA",this.MarginShortfall="NA",this.amoStatus.hasAMO=!1,this.amoStatus.isAMOEnabled=!1,this.amoStatus.isAMOChecked=!1,this.isMarginBtnEnable=!1):(this.isOCOChecked=!1,this.AvailableMargin="0.00",this.ApproxMargin="0.00",this.MarginShortfall="0.00",this.isMarginBtnEnable=!0)}onisMPPriceOnFocusChange(t){this.SetProtPerc(),this.SelMPPriceOnLostFocus()}SelMPPriceOnLostFocus(){try{null!=this.SelMPPrice&&(this.SelMPPrice=this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&this.sBOPricePreference==n.gT.C_V_BO_PI_PRICE_PERCENT?parseFloat(this.SelMPPrice).toFixed(2):parseFloat(this.SelMPPrice).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.MPIsLimitPrEnteredFirst=!(void 0!==this.SelMPTriggerPrice&&!isNaN(this.SelMPTriggerPrice)&&0!=this.SelMPTriggerPrice))}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelPriceOnLostFocus()","orderentry.component.ts","")}}isPriceOnFocusChange(t){this.SetProtPerc()}SetProtPerc(){if(this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT){var t=n.xB.ExchManager.GetDetailsForMktProtPerc(this.SelExchange,this.Map
1MarketSegmentId,this.SelPrice,this.MarketSegmentId,this.SelMPPrice,this.SelProduct);if(this.dcEnableDisableFields=t[0],this.hasProdPer=this.dcEnableDisableFields.hasProdPer,this.hasProdPer&&""==this.SelProdPer&&this.dcEnableDisableFields.hasProdPer){var r=t[1];this.SelProdPer=null==t[2]?void 0:t[2],""!=r&&(this.ProtPercDisclaimer=n.xB.dMsgMaster.NNSL351+r+" %",this.showProtPercDisclaimer=!0)}this.hasProdPer||(this.SelProdPer="",this.ProtPercDisclaimer="",this.showProtPercDisclaimer=!1)}else this.SelProdPer="",this.showProtPercDisclaimer=!1,this.hasProdPer=!1}isMPTrigPriceOnFocusChange(t){this.SelMPTriggerPriceOnLostFocus()}isTargetPriceOnFocusChange(){try{null!=this.TargetPrice&&(this.TargetPrice=parseFloat(this.TargetPrice).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)))}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelPriceOnLostFocus()","orderentry.component.ts","")}}isTargetTriggerPriceOnFocusChange(){try{null!=this.TargetTriggerPrice&&(this.TargetTriggerPrice=parseFloat(this.TargetTriggerPrice).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)))}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelPriceOnLostFocus()","orderentry.component.ts","")}}SelMPTriggerPriceOnLostFocus(){try{null!=this.SelMPTriggerPrice&&(this.SelMPTriggerPrice=this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&this.sBOPricePreference==n.gT.C_V_BO_PI_PRICE_PERCENT?parseFloat(this.SelMPTriggerPrice).toFixed(2):parseFloat(this.SelMPTriggerPrice).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1))),this.MPIsLimitPrEnteredFirst=void 0!==this.SelMPPrice&&!isNaN(this.SelMPPrice)&&0!=this.SelMPPrice}catch(t){this.logService.WriteLog("Exception: "+t.message,"SelPriceOnLostFocus()","orderentry.component.ts","")}}onSelProductChange(t){try{this.sErrorMsg="",""!=t&&(this.SelProduct=this.dcProductType[t.index]),this.SelProduct!==n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.bIsCoverOrderValid=!0),null!=this.SelProduct&&(this.fn_OnProductTypeChange(),this.amoStatus=o.X.isAMOHideShow(this.hasAMO,this.PageSource,this.SelProduct,this.MarketSegmentId),this.IsPopulatePrice=!!this.hasPrice,this.CreateAndSendMultiTouchLineRequest(),this.getGSMBANSecurityInfo(),this.fn_CheckForMarginPlus(),n.xB.dcGTDProductAllowed.count()>0&&(this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()||this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString())&&this.allowedGTDProducts(),n.xB.dcGTTProductAllowed.count()>0&&this.MarketSegmentId!=n.gT.C_V_MCX_DERIVATIVES.toString()&&this.MarketSegmentId!=n.gT.C_V_MCX_SPOT.toString()&&this.MarketSegmentId!=n.gT.C_V_NCDEX_DERIVATIVES.toString()&&this.MarketSegmentId!=n.gT.C_V_NCDEX_SPOT.toString()&&this.MarketSegmentId!=n.gT.C_V_ICEX_DERIVATIVES.toString()&&this.allowedGTTProducts(),this.sBOPricePreference=this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?n.xB.User.OrderPrefDic[this.MarketSegmentId].sBOPricePreference:"")}catch(r){this.logService.WriteLog("Exception: "+r.message,"SelProduct.subscribe()","orderentry.component.ts","")}}allowedGTDProducts(){try{var t=this.ArrValidity.indexOf(n.gT.C_S_VALUE_EQUITY_GTD);n.xB.dcGTDProductAllowed.containsKey(o.X.GetProductTypeValue(this.SelProduct))?n.xB.dcGTDProductAllowed.getItem(o.X.GetProductTypeValue(this.SelProduct)).split("$").Contains(this.MapMarketSegmentId)&&(t<0&&this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT||t<0&&this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_TEXT||t<0&&this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?this.ArrValidity.push(n.gT.C_S_VALUE_EQUITY_GTD):(t>=0&&this.SelOrderTypes==n.gT.C_S_ORDER_CALLAUCTION_TEXT||t>=0&&this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT)&&this.ArrValidity.splice(t,1)):t>=0&&this.ArrValidity.splice(t,1),this.hasDay=!1,this.SelDay="",this.hasGTDDay=this.SelProduct==n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT&&this.SelValidity==n.gT.C_S_VALUE_GTD}catch(d){this.logService.WriteLog("Exception: "+d.message,"allowedGTDProducts","orderentry.component.ts","")}}onSelMPOrderTypeChange(){null!=this.SelMPOrderType&&(this.SelMPOrderType==n.gT.C_S_ORDER_STOPLOSS_TEXT?this.hasMPTriggerPrice=!0:(this.SelMPTriggerPrice(0),this.hasMPTriggerPrice=!1))}onSelTrailingSLChange(){null!=this.SelTrailingSL&&(this.SelTrailingSL?(this.hasSLJumpPrice=!0,n.xB.User.IsJumpBothLTPAndTrigPrice&&(this.hasLTPJumpPrice=!0)):(this.hasSLJumpPrice=!1,this.hasLTPJumpPrice=!1,this.SelSLJumpPrice=void 0,this.SelLTPJumpPrice=void 0))}fn_CheckForMarginPlus(){this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(this.showMPDisclaimer=!0,this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT?this.SelBuySell===n.gT.C_S_ORDER_BUY_TEXT?(this.MPDisclaimer=n.xB.dMsgMaster.OE103.replace("Margin Plus",n.gT.C_S_PRODUCTTYPE_MP_TEXT),this.MPOEOperationDiv="bg8 MPWidth",this.SelMPOrderSide=n.gT.C_S_ORDER_SELL_TEXT,this.isMPVisible=!0):(this.MPDisclaimer=n.xB.dMsgMaster.OE104.replace("Margin Plus",n.gT.C_S_PRODUCTTYPE_MP_TEXT),this.MPOEOperationDiv="bg7 MPWidth",this.SelMPOrderSide=n.gT.C_S_ORDER_BUY_TEXT,this.isMPVisible=!0):this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.SelBuySell===n.gT.C_S_ORDER_BUY_TEXT?(this.MPOEOperationDiv="bg8 BOWidth",this.SelMPOrderSide=n.gT.C_S_ORDER_SELL_TEXT,this.isMPVisible=!0):(this.isMPVisible=!0,this.MPOEOperationDiv="bg7 BOWidth",this.SelMPOrderSide=n.gT.C_S_ORDER_BUY_TEXT),this.MPDisclaimer=n.xB.dMsgMaster.NNSL367),this.hasValidity=!1):(this.isMPVisible=!1,this.showMPDisclaimer=!1,this.hasValidity=!0)}fn_OnProductTypeChange(){try{this.min=o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?"-9999999":"0",this.isBracketDetailsVisible=!1,this.hasDiscQty=this.dcEnableDisableFields.hasDiscQty,this.hasCOL=this.dcEnableDisableFields.hasCOL,this.SetProtPerc(),this.ArrOrderTypes=n.xB.ExchManager.PopulateOrderTypes(this.SelExchange,this.MarketSegmentId),this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(this.fn_SetDefaultMPFields(),this.ArrOrderTypes=this.ArrOrderTypes.slice(0,2),this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT?(this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT&&0!=this.SelPrice?this.hasPrice=!0:(this.hasPrice=!0,this.SelPrice=0),this.hasMPOrderType=!0,this.MPTableText="Stop Loss/Second Leg Order Details"):this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.SelDiscQty=void 0,this.hasDiscQty=!1,this.hasCOL=void 0,this.hasCOL=!1,this.hasPrice=17!=this.PageSourceId||0!=this.RecoPrice&&""!=this.RecoPrice,this.hasMPOrderType=!1,this.MPTableText=n.xB.applicationType==n.xB.DESKTOP?"Stop Loss Order Details":"Stop Loss/Profit Order Details",this.isBracketDetailsVisible=!0,this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString()&&(this.SelValidity=n.gT.C_S_VALUE_EOTODY,this.onSelValidityChange()))):(this.hasOrderType=this.SelInstrument!=n.gT.C_S_INSTRUMENT_NCDEXCOMDTY_TEXT,this.hasPrice=this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT&&this.SelOrderTypes!=n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT,this.EnbDisSubmit=!0,this.IsSubmitDisabled=!1),(this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT)&&(this.hasTriggerPrice=!1,this.SLCaption="(in case Stoploss order)"),this.bPhySetMsg=!1,this.hasGTDDay=!1,this.hasGTTDay=!1,this.isMarginDisplayPreference=1==n.xB.User.GeneralPrefDetails[0].nShowMarginOnOE,this.isMarginDisplay=!(!this.isMarginDisplayPreference||"True"!=this.isMarginDisplayServer)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT,this.isMarginDisplay&&this.SelProduct&&this.SelQty>0&&!this.isfirstTime&&(this.isfirstTime=!0),this.onShowHideOCOCheckbox()}catch(t){this.logService.WriteLog("Exception: "+t.message,"OnProductTypeChange()","orderentry.component.ts","")}}fn_SetDefaultMPFields(){this.bFormat=!0,this.SelOrderTypes=this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT&&0==this.SelPrice||17!=this.PageSourceId||0!=this.RecoPrice&&""!=this.RecoPrice?n.gT.C_S_ORDER_REGULARLOT_TEXT:n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT,this.SelMPOrderType=n.gT.C_S_ORDER_STOPLOSS_TEXT,this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&0!=this.SelMPPrice&&(this.SelMPPrice=""),this.SelMPPrice=this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT?this.MPLimitPriceHighRange:this.MPLimitPriceLowRange,this.SelValidity=this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString()?n.gT.C_S_VALUE_EOTODY:n.gT.C_S_VALUE_DAY,this.onSelValidityChange(),this.SelTriggerPrice=void 0,this.hasTriggerPrice=!1,this.SelMPTriggerPrice=void 0,this.isMPTrigPriceOnFocus=!0,this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.LegIndicator=n.gT.C_V_BRACKET_MAIN_LEG_INDICATOR.toString(),this.SelProfitOrderPrice=void 0,this.isProfitOrderPriceOnFocus=!0,this.SelSLJumpPrice=void 0,this.SelLTPJumpPrice=void 0),this.isMPPriceOnFocus=!0,this.onisMPPriceOnFocusChange(!0),this.SelProduct===n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.hasOrderType=!0),this.bFormat=!1}fn_ComputeMPOptionParams(){this.UnderlyingLTP>0?this.IsSubmitDisabled=!1:(this.validate.addError("OrderEntry",o.
1X.MPNotAllowedForUnderlyingLTPMsg(this.SelProduct)),this.IsSubmitDisabled=!0,this.MPSuccessFailure=!1)}fn_ComputeMPRange(){this.validate.removeError();var t;t=isNaN(this.SelPrice)||0==this.SelPrice?this.MPLTP:parseFloat(this.SelPrice),"0"==this.MPDPRFlag?this.MPSetPrice=this.MPClosePrice:"1"==this.MPDPRFlag?this.MPSetPrice=t:"2"==this.MPDPRFlag&&(this.MPSetPrice=this.MPBasePrice),this.MPVirtualHighPr=parseFloat(this.MPSetPrice.toString())+parseFloat(this.MPSetPrice.toString())*parseFloat(this.MPDPRRangePerc.toString()),this.MPVirtualLowPr=parseFloat(this.MPSetPrice.toString())-parseFloat(this.MPSetPrice.toString())*parseFloat(this.MPDPRRangePerc.toString()),this.MPActualHighPr=0!=this.MPHighPr?Math.min(parseFloat(this.MPHighPr),parseFloat(this.MPVirtualHighPr.toString())):parseFloat(this.MPVirtualHighPr.toString()),this.MPActualLowPr=0!=this.MPLowPr?Math.max(parseFloat(this.MPLowPr),parseFloat(this.MPVirtualLowPr)):parseFloat(this.MPVirtualLowPr),this.MPLowerLTPTrigger=t-t*this.MPLimitTrigPerc,this.MPLowerLTPTrigger<this.MPActualLowPr&&(this.MPLowerLTPTrigger=this.MPActualLowPr),this.MPSuccessFailure||(this.validate.addError("OrderEntry",o.X.MPNotAllowedForLTPMsg(this.SelProduct,this.SelPrice)),this.MPSuccessFailure=!1),!1===this.MPSuccessFailure&&this.validate.hasError()?(this.BOSuccessFailure=!1,this.EnbDisSubmit=!1,this.IsSubmitDisabled=!0,this.sErrorMsg=this.validate.getError()):(this.sErrorMsg="",this.BOSuccessFailure=!0,this.EnbDisSubmit=!0,this.IsSubmitDisabled=!1)}fn_ShowMPError(){!1===this.MPSuccessFailure&&this.validate.hasError()?(this.BOSuccessFailure=!1,this.EnbDisSubmit=!1,this.IsSubmitDisabled=!0,this.sErrorMsgCoverOrder=this.validate.getError(),this.bIsCoverOrderValid=!(this.sErrorMsgCoverOrder.length>0)):(this.BOSuccessFailure=!0,this.EnbDisSubmit=!0,this.IsSubmitDisabled=!1)}fn_PrimaryMarginPlusBuyValidation(){var t=isNaN(this.SelPrice)||0==this.SelPrice?this.MPLTP:parseFloat(this.SelPrice);this.MPSuccessFailure=!(t>parseFloat(this.MPActualHighPr)||this.MPActualLowPr>this.MPLowerLTPTrigger)}fn_PrimaryMarginPlusSellValidation(){var t=isNaN(this.SelPrice)||0==this.SelPrice?this.MPLTP:parseFloat(this.SelPrice);this.MPSuccessFailure=!(t<parseFloat(this.MPActualLowPr)||parseFloat(this.MPActualHighPr)<t+t*parseFloat(this.MPTrigLimitPerc.toString()))}fn_RoundUp(t,r){return 0==this.fn_GetDivFactor(t)%this.fn_GetDivFactor(r)?t:t+(r-t%r)}fn_RoundDown(t,r){return 0==this.fn_GetDivFactor(t)%this.fn_GetDivFactor(r)?t:t-t%r}fn_GetDivFactor(t){return Math.round(parseFloat(t)*this.MPDecLoc)}fn_RoundVal(t,r){return t<0?Math.ceil(t/r)*r:Math.floor(t/r)*r}fn_ComputeBuySideMPPriceRange(){try{var t=0;t=isNaN(this.SelPrice)||0==this.SelPrice?this.MPLTP:parseFloat(this.SelPrice);var M,r=Math.min(t-t*this.MPTrigLimitPerc,t-t*this.MPLimitTrigPercMin),s=Math.min(r,parseFloat(this.MPActualHighPr)),d=Math.max(s,parseFloat(this.MPActualLowPr)),I=0;I=isNaN(this.SelMPPrice)||0===this.SelMPPrice||this.SelMPPrice>d||this.SelMPPrice<this.MPActualLowPr?this.MPActualLowPr:this.SelMPPrice,M=Math.max(parseFloat(I.toString())+parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),this.MPLowerLTPTrigger),this.MPTriggerPriceLowRange=this.fn_RoundUp(M,this.MPPriceTick),this.MPTriggerPriceLowRange=parseFloat(this.MPTriggerPriceLowRange).toFixed(this.MPDecPrecision),this.MPTriggerPriceHighRange=this.fn_RoundDown(t,this.MPPriceTick),this.MPTriggerPriceHighRange=parseFloat(this.MPTriggerPriceHighRange).toFixed(this.MPDecPrecision),this.MPLimitPriceLowRange=this.fn_RoundUp(parseFloat(this.MPActualLowPr),this.MPPriceTick),this.MPLimitPriceLowRange=parseFloat(this.MPLimitPriceLowRange).toFixed(this.MPDecPrecision);var q,U=Math.max(parseFloat(this.MPActualLowPr)+parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),parseFloat(t.toString())-parseFloat(t.toString())*parseFloat(this.MPLimitTrigPerc.toString()));q=isNaN(this.SelMPTriggerPrice)||0===this.SelMPTriggerPrice||this.SelMPTriggerPrice>t||this.SelMPTriggerPrice<U?t:parseFloat(this.SelMPTriggerPrice);var j,Ie=Math.min(parseFloat(q)-parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),parseFloat(t.toString())-parseFloat(t.toString())*parseFloat(this.MPLimitTrigPercMin.toString()));j=Math.min(Ie,this.MPActualHighPr),this.MPLimitPriceHighRange=this.fn_RoundD
1own(Math.max(j,this.MPActualLowPr),this.MPPriceTick),this.MPLimitPriceHighRange=parseFloat(this.MPLimitPriceHighRange).toFixed(this.MPDecPrecision),this.ProfitPriceLowRange=this.fn_RoundUp(parseFloat(t.toString())+parseFloat(this.MPPriceTick.toString()),this.MPPriceTick).toFixed(this.MPDecPrecision),this.ProfitPriceHighRange=Math.min(parseFloat(this.MPActualHighPr),parseFloat(t.toString())+parseFloat(t.toString())*parseFloat(this.ProfitPricePerc.toString())),this.ProfitPriceHighRange=Math.max(this.ProfitPriceHighRange,this.ProfitPriceLowRange),this.ProfitPriceHighRange=this.fn_RoundDown(this.ProfitPriceHighRange,this.MPPriceTick).toFixed(this.MPDecPrecision);var pe=!0;this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(parseFloat(this.ProfitPriceLowRange)>this.MPActualHighPr||this.MPActualLowPr>Number(parseFloat(t.toString())-parseFloat(t.toString())*parseFloat(this.MPLimitTrigPercMin.toString())).toFixed(this.MPDecPrecision)||this.MPActualLowPr>this.MPLowerLTPTrigger||parseFloat(this.MPLimitPriceLowRange)>parseFloat(this.MPLimitPriceHighRange)||t>this.MPActualHighPr)&&(pe=!1):(parseFloat(this.MPTriggerPriceLowRange)>parseFloat(this.MPTriggerPriceHighRange)||parseFloat(this.MPLimitPriceLowRange)>parseFloat(this.MPLimitPriceHighRange))&&(pe=!1),pe?(this.MPSuccessFailure=!0,this.LPRVal="("+this.MPLimitPriceLowRange.toString()+" - "+this.MPLimitPriceHighRange.toString()+")",this.TPRVal="("+this.MPTriggerPriceLowRange.toString()+" - "+this.MPTriggerPriceHighRange.toString()+")",this.PPRVal="("+this.ProfitPriceLowRange.toString()+" - "+this.ProfitPriceHighRange.toString()+")"):(this.validate.addError("OrderEntry",o.X.MPNotAllowedForLTPMsg(this.SelProduct,this.SelPrice)),this.MPSuccessFailure=!1,this.MPLimitPriceLowRange=NaN,this.MPLimitPriceHighRange=NaN,this.MPTriggerPriceLowRange=NaN,this.MPTriggerPriceHighRange=NaN,this.ProfitPriceLowRange=NaN,this.ProfitPriceHighRange=NaN,this.LPRVal="",this.TPRVal="",this.PPRVal="")}catch(Ve){this.logService.WriteLog("Exception: "+Ve.message,"ComputeBuySideTrigPrFirst()","orderentry.component.ts","")}}fn_ComputeSellSideMPPriceRange(){try{var t=0,r=(t=isNaN(this.SelPrice)||0==this.SelPrice?parseFloat(this.MPLTP):parseFloat(this.SelPrice))+t*this.MPLimitTrigPerc;r>this.MPActualHighPr&&(r=this.MPActualHighPr);var M,U,s=Math.max(parseFloat(t.toString())+parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),parseFloat(t.toString())+parseFloat(t.toString())*parseFloat(this.MPLimitTrigPercMin.toString())),d=Math.max(parseFloat(s.toString()),parseFloat(this.MPActualLowPr)),I=Math.min(parseFloat(d.toString()),parseFloat(this.MPActualHighPr));M=isNaN(this.SelMPPrice)||0===this.SelMPPrice||this.SelMPPrice>this.MPActualHighPr||this.SelMPPrice<I?this.MPActualHighPr:this.SelMPPrice,U=Math.min(parseFloat(M)-parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),r),this.MPTriggerPriceHighRange=this.fn_RoundDown(U,this.MPPriceTick),this.MPTriggerPriceHighRange=parseFloat(this.MPTriggerPriceHighRange).toFixed(this.MPDecPrecision),this.MPTriggerPriceLowRange=this.fn_RoundUp(t,this.MPPriceTick),this.MPTriggerPriceLowRange=parseFloat(this.MPTriggerPriceLowRange).toFixed(this.MPDecPrecision),this.MPLimitPriceHighRange=this.fn_RoundDown(this.MPActualHighPr,this.MPPriceTick),this.MPLimitPriceHighRange=parseFloat(this.MPLimitPriceHighRange).toFixed(this.MPDecPrecision);var j,q=Math.min(parseFloat(this.MPActualHighPr)-parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),parseFloat(t.toString())+parseFloat(t.toString())*parseFloat(this.MPLimitTrigPerc.toString()));j=isNaN(this.SelMPTriggerPrice)||0===this.SelMPTriggerPrice||this.SelMPTriggerPrice>q||this.SelMPTriggerPrice<t?t:this.SelMPTriggerPrice;var Ie,pe=Math.max(parseFloat(j)+parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString()),parseFloat(t.toString())+parseFloat(t.toString())*parseFloat(this.MPLimitTrigPercMin.toString()));Ie=Math.max(pe,parseFloat(this.MPActualLowPr)),this.MPLimitPriceLowRange=this.fn_RoundUp(Math.min(Ie,this.MPActualHighPr),this.MPPriceTick),this.MPLimitPriceLowRange=parseFloat(this.MPLimitPriceLowRange).toFixed(this.MPDecPrecision),this.ProfitPriceHighRange=this.fn_RoundD
1own(parseFloat(t.toString())-parseFloat(this.MPPriceTick.toString()),parseFloat(this.MPPriceTick.toString())).toFixed(this.MPDecPrecision),this.ProfitPriceLowRange=Math.max(parseFloat(this.MPActualLowPr),parseFloat(t.toString())-parseFloat(t.toString())*parseFloat(this.ProfitPricePerc.toString())),this.ProfitPriceLowRange=Math.min(parseFloat(this.ProfitPriceLowRange),parseFloat(this.ProfitPriceHighRange)),this.ProfitPriceLowRange=this.fn_RoundUp(parseFloat(this.ProfitPriceLowRange),this.MPPriceTick).toFixed(this.MPDecPrecision);var Ve=!0;this.SelProduct===n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(parseFloat(this.ProfitPriceHighRange)<this.MPActualLowPr||this.MPActualHighPr<r||this.MPActualHighPr<parseFloat(t.toString())+parseFloat(t.toString())*parseFloat(this.MPTrigLimitPerc.toString())||parseFloat(this.MPLimitPriceLowRange)>parseFloat(this.MPLimitPriceHighRange)||t<this.MPActualLowPr)&&(Ve=!1):(parseFloat(this.MPTriggerPriceLowRange)>parseFloat(this.MPTriggerPriceHighRange)||parseFloat(this.MPLimitPriceLowRange)>parseFloat(this.MPLimitPriceHighRange))&&(Ve=!1),Ve?(this.MPSuccessFailure=!0,this.LPRVal="("+this.MPLimitPriceLowRange.toString()+" - "+this.MPLimitPriceHighRange.toString()+")",this.TPRVal="("+this.MPTriggerPriceLowRange.toString()+" - "+this.MPTriggerPriceHighRange.toString()+")",this.PPRVal="("+this.ProfitPriceLowRange.toString()+" - "+this.ProfitPriceHighRange.toString()+")"):(this.validate.addError("OrderEntry",o.X.MPNotAllowedForLTPMsg(this.SelProduct,this.SelPrice)),this.MPSuccessFailure=!1,this.MPLimitPriceLowRange=NaN,this.MPLimitPriceHighRange=NaN,this.MPTriggerPriceLowRange=NaN,this.MPTriggerPriceHighRange=NaN,this.LPRVal="",this.TPRVal="",this.PPRVal="")}catch(He){this.logService.WriteLog("Exception: "+He.message,"ComputeBuySideTrigPrFirst()","orderentry.component.ts","")}}fn_ValidateLimitPrMarginPlus(){try{this.validate.removeError()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ValidateLimitPrMarginPlus()","orderentry.component.ts","")}}fn_ValidateTrigPrMarginPlus(){}fn_ValidateProfitOrderPrice(){try{this.BOSuccessFailure&&(this.validate.removeError(),0==this.MPActualLowPr&&0==this.MPActualHighPr||(!1===this.MPSuccessFailure?(this.EnbDisSubmit=!1,this.dialogService.alert(this.validate.getError(),"Order Entry")):this.EnbDisSubmit=!0))}catch(t){this.logService.WriteLog("Exception: "+t.message,"fn_ValidateProfitOrderPrice()","orderentry.component.ts","")}}fn_ComputeProfitOrderPriceRange(){try{var t;t=isNaN(this.SelPrice)||0===this.SelPrice?this.MPLTP:parseFloat(this.SelPrice),this.SelBuySell===n.gT.C_S_ORDER_BUY_TEXT?(this.ProfitPriceLowRange=(t+this.MPPriceTick).toFixed(this.MPDecPrecision),this.ProfitPriceHighRange=Math.min(this.MPActualHighPr,t+t*this.ProfitPricePerc),this.ProfitPriceHighRange=this.fn_RoundDown(this.ProfitPriceHighRange,this.MPPriceTick).toFixed(this.MPDecPrecision)):(this.ProfitPriceLowRange=Math.max(this.MPActualLowPr,t-t*this.ProfitPricePerc),this.ProfitPriceLowRange=this.fn_RoundUp(this.ProfitPriceLowRange,this.MPPriceTick).toFixed(this.MPDecPrecision),this.ProfitPriceHighRange=(t-this.MPPriceTick).toFixed(this.MPDecPrecision))}catch(r){this.logService.WriteLog("Exception: "+r.message,"fn_ComputeProfitOrderPriceRange()","orderentry.component.ts","")}}GetOTSCutOffParams(){try{return this.httpService.postData(n.xB.tradingAPIUrl,"LoadOTSCutOffParams",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,MKtSegId:this.MarketSegmentId,ScripTkn:this.SelToken,UCCClientID:"",UCCGroupID:""})}catch(r){this.logService.WriteLog("Exception: "+r.message,"GetOTSCutOffParams()","orderentry.component.ts","")}}fn_GetOTSCutOffParams(t){try{if(null!=t&&t.ResponseStatus&&t.ResponseObject.length>0){var s=t.ResponseObject.split(n.gT.C_S_FIELD_DELIMITER);s.length>0&&(this.CapPrice=parseFloat(s[0]),this.FloorPrice=parseFloat(s[1]),this.SetPrice=parseFloat(s[2]),this.IsLastClosingPrice=parseInt(s[3]),this.IsCutOffAllowed=parseInt(s[4]),this.IsSetPrice=parseInt(s[5]))}this.hasCutOff=1==this.IsCutOffAllowed&&5!=n.xB.User.OdinCategory&&"IS"!=this.SelSeries}catch(d){this.logService.WriteLog("Exception: "+d.message,"fn_GetOTSCutOffParams","orderentry.component.ts","")}}onSelCutOffChange(){this.SelCutOff?(this.SelPrice=void 0,this.hasPrice=!1):this.hasPrice=!0}fn_FillScripDetails(t){try{var r=t.split(n.gT.C_S_FIELD_DELIMITER);this.SelToken=r[n.gT.ScripStoreToken],this.SelMarketLot=r[n.gT.ScripStoreRegularLot],"0"==this.SelMarketLot&&(this.SelMarketLot="1"),this.IncrementLot=n.xB.ExchManager.ExchInLOT.Contains(this.MarketSegmentId)?1:parseInt(this.SelMarketLot),null!=this.MarketSegmentId&&null!=this.SelMarketLot&&this.SelMarketLot.length>0&&!this.ValueAlertFlag&&(this.SelQty=n.xB.ExchManager.FillQuantity(this.MarketSegmentId,this.SelMarketLot)),this.SelDecimalloc=r[n.gT.ScripStoreDecimalLocator],0==this.SelDecimalloc&&(this.SelDecimalloc=100),this.SelPriceTick=r[n.gT.ScripStorePriceTick],this.IncrementPriceTick=parseFloat(this.SelPriceTick)/parseFloat(this.SelDecimalloc.toString()),"0"==this.SelPriceTick&&(this.SelPriceTick="1"),this.IsSpread=r[n.gT.ScripStoreSpread],this.FIILimit=r[n.gT.ScripStoreFIILimit],this.NRILimit=r[n.gT.ScripStoreNRILimit];var s=n.xB.ExchManager.GetQtyLotCaption(this.MarketSegmentId);this.QtyCaption=s,this.DiscQtyCaption="Disc "+s,this.isQtyOnFocus=!0,(this.MarketSegmentId==n.gT.C_V_MCX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_MSX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_NSX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_NSEL_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_MSX_CASH.toString()||this.MarketSegmentId==n.gT.C_V_MSX_FAO.toString()||this.MarketSegmentId==n.gT.C_V_DGCX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_NSECOMM_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_NCDEX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_BSECDX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_ICEX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_BSECOMM_DERIVATIVES.toString())&&
1(this.PriceNumerator=r[n.gT.ScripStorePriceNumerator],this.PriceDenominator=r[n.gT.ScripStorePriceDenominator],this.GenNumerator=r[n.gT.ScripStoreGenNumerator],this.GenDenominator=r[n.gT.ScripStoreGenDenominator]),this.MarketSegmentId==n.gT.C_V_BSECOMM_DERIVATIVES.toString()&&(this.IntrinsicValue=r[n.gT.ScripStoreIntrinsicValue]),this.SPOS=r[n.gT.ScripStoreSPOSType];var d=new m.u;d.ScripDet.Token=this.SelToken,d.ScripDet.MktSegId=parseInt(this.MarketSegmentId),d.ScripDet.MapMktSegId=parseInt(this.MapMarketSegmentId,10),this.ScripDetail.Token=parseInt(this.SelToken),this.ScripDetail.ScripDet.MktSegId=parseInt(this.MarketSegmentId),this.ScripDetail.MarketLot=this.SelMarketLot,this.ScripDetail.PriceTick=this.SelPriceTick,this.ScripDetail.ExchangeName=o.X.GetExchangeName(this.MarketSegmentId),d.ExchangeName=o.X.GetExchangeName(this.MarketSegmentId),this.ScripDetail.InstrumentName=r[6],this.SelSymbol=this.ScripDetail.Symbol=r[1],this.SelSeries=this.ScripDetail.Series="NA"==r[5]?"":r[5],this.SelExpire=this.ScripDetail.ExpiryDate="NA"==r[4]?"":r[4],this.SelStrikePrice=this.ScripDetail.StrikePrice="NA"==r[3]?"":r[3],this.SelOptionType=this.ScripDetail.OptionType="NA"==r[2]?"":r[2],this.ScripDetail.MWSecurityDesc=o.X.FormatScripDescForMW(this.ScripDetail),this.ScripSymbol=this.ScripDetail.MWSecurityDesc.substr(0,this.ScripDetail.MWSecurityDesc.indexOf(" ")),this.ScripData=this.ScripDetail.MWSecurityDesc.substr(this.ScripDetail.MWSecurityDesc.indexOf(" ")+1),d.MWSecurityDesc=o.X.FormatScripDescForMW(this.ScripDetail),this.CreateAndSendMultiTouchLineRequest(),this.getPivotPointData(d),this.objScrip=d}catch(I){this.logService.WriteLog("Exception: "+I.message,"FillScripDetails()","orderentry.component.ts","")}}Reset(){try{this.confirmOrder=!1,this.IsConfirmDisabled=!1,this.PageSource="MANUAL",this.SelExchange=void 0,this.ArrExchange=n.xB.ExchManager.PopulateExchanges(n.gT.C_V_ORDERENTRY_PAGE),this.SelExchange=this.ArrExchange[0],this.onSelExchangeChange(),this.onSelInstrumentChange(),this.onSelOrderTypesChange(),this.ArrProductTypes.Contains(this.defaultProduct)&&(this.SelProduct=this.defaultProduct,this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(this.defaultProduct)),this.objScrip=new m.u,this.bChangeScrip=!0,this.bShowChangeScrip=!0,this.AvailableMargin="",this.ApproxMargin="",this.MarginShortfall=""}catch(t){this.logService.WriteLog("Exception: "+t.message,"Reset()","orderentry.component.ts","")}}SetActiveTabIndexForDefaultProduct(t){for(var r=0,s=0;s<this.dcProductType.count();s++)if(t==this.dcProductType[s]){r=s;break}return r}ResetForBulkOrder(){try{this.SelExchange=void 0,this.ArrExchange=n.xB.ExchManager.PopulateExchanges(n.gT.C_V_ORDERENTRY_PAGE),this.SelExchange=this.ArrExchange[0],this.RowSequence="",this.PageSource="MANUAL"}catch(t){this.logService.WriteLog("Exception: "+t.message,"Reset()","orderentry.component.ts","")}}SubmitOrderInnerFunction(){n.xB.dConfigMaster[n.gT.C_S_HTML5_Enable_AutoHold_KEY]==n.gT.C_S_AUTO_HOLD_ALLOWED&&(this.IsConfirmDisabled=!1),n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE.toString()?(this.SendMktReqFlag=!0,this.pubsubService.publish("MKTSTATUSREQ",""),this.PlaceOrder()):this.PlaceOrder()}getGSMBANSecurityInfo(){try{0==this.ModifyFlag&&(this.getT2TSeriesWrnMsg(),this.httpService.postData(n.xB.tradingAPIUrl,"GSMBANSecurityInfo",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,ScripTkn:this.SelToken,MktSegId:this.MapMarketSegmentId,SITempID:n.xB.User.SITemplateId,UCCClientID:"",UCCGroupID:""}).subscribe(r=>{if(1==r.ResponseStatus){if("TRUE"==r.ResponseObject.bPhySetStatus.toUpperCase()){var s,d,I,M,q,j,Ie,pe,Ve,He,it=!1,ce=r.ResponseObject.sPhySet.split(n.gT.C_S_SETTLEMENTTYPE_DELIMITER);ce.length>1&&(pe=ce[0].toString(),Ve=ce[1].toString(),He=ce[2].toString(),s=n.xB.User.OdinMgrDate,d=(Ie=this.SelExpire).substring(0,2),I=n.vV.getNumericMonth(Ie.substring(2,5)),M=Ie.substring(5,9),q=new Date(M,I,d).getTime()-s.getTime(),j=Math.ceil(q/864e5),pe==n.gT.C_S_PHYSICAL_SETTLEMENT_VALUE&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT?it=Ve==n.gT.C_S_INVALIDPROFILEID||j<=parseInt(Ve):pe==n.gT.C_S_PHYSICAL_SETTLEMENT_VALUE&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_INTRADAY_TEXT&&(it=He==n.gT.C_S_INVALIDPROFILEID||j<=parseInt(He))),1==it&&(this.sPhySetMsg=n.xB.dMsgMaster.OE108,this.bPhySetMsg=!0)}"TRUE"==r.ResponseObject.bBanStatus.toUpperCase()&&(this.dialogService.confirm(n.xB.dMsgMaster.OE105,"Yes","No").subscribe(Je=>{!0===Je?this.SubmitOrderInnerFunction():!1===Je&&this.closeDialogRef()}),this.bBanScripMsg=!0)}}))}catch(r){this.logService.WriteLog("Exception: "+r.message,"getGSMBANSecurityInfo()","orderentry.component.ts","")}}getT2TSeriesWrnMsg(){try{if(null!=n.xB.dConfigMaster[n.gT.C_S_T2T_SERIES_LIST]&&""!=n.xB.dConfigMaster[n.gT.C_S_T2T_SERIES_LIST]){this.sT2TScripWrnMsg=null!=n.xB.dConfigMaster[n.gT.C_S_T2T_SCRIP_ERROR_MESSAGE]&&""!=n.xB.dConfigMaster[n.gT.C_S_T2T_SCRIP_ERROR_MESSAGE]?n.xB.dConfigMaster[n.gT.C_S_T2T_SCRIP_ERROR_MESSAGE].toString():n.gT.C_S_T2T_SCRIP_WARNING_MESSAGE,this.isT2TSeriesScrip=!1,this.T2TSeriesList=n.xB.dConfigMaster[n.gT.C_S_T2T_SERIES_LIST].split(n.gT.C_S_RECORD_DELIMITER);for(var t=0;t<this.T2TSeriesList.length;t++){var r=this.T2TSeriesList[t];
1if(r.split(n.gT.C_S_EXCH_DELIMITER)[0].toString()==this.MapMarketSegmentId){var s="";if(""!=(s=r.split(n.gT.C_S_EXCH_DELIMITER)[1].toString())&&s.split(n.gT.C_S_COMMA_DELIMITER).Contains(this.SelSeries)){this.isT2TSeriesScrip=!0;break}}}this.isT2TSeriesScrip||(this.sT2TScripWrnMsg="")}else this.logService.WriteLog("Exception: "+n.gT.C_S_T2T_SERIES_LIST+"Key Not found","getT2TSeriesWrnMsg()","orderentry.component.ts","")}catch(I){this.logService.WriteLog("Exception: "+I.message,"getT2TSeriesWrnMsg()","orderentry.component.ts","")}}SubmitOrder(){try{if(this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()||this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString())if(null!=this.ArrScripMaster.Table2&&this.ArrScripMaster.Table2.length>0&&"undefined"!=this.ArrScripMaster.Table2[0].sSurvMeasureDescription&&null!=this.ArrScripMaster.Table2[0].sSurvMeasureDescription)if(this.SelSeries==this.ArrScripMaster.Table2[0].sSeries?this.sSurvMeasureDescription=this.ArrScripMaster.Table2[0].sSurvMeasureDescription:this.ArrScripMaster.Table1.length>0&&null!=this.ArrScripMaster.Table1&&null!=this.ArrScripMaster.Table1[0].sSurvMeasureDescription&&"undefined"!=this.ArrScripMaster.Table1[0].sSurvMeasureDescription&&(this.sSurvMeasureDescription=this.ArrScripMaster.Table1[0].sSurvMeasureDescription),null!=this.sSurvMeasureDescription){let r=n.xB.dMsgMaster.OE216?n.xB.dMsgMaster.OE216:"Security is under {0}, would you like to continue?";r=r.replace("{0}",this.sSurvMeasureDescription);let s=`${r}`;(t={}).Tkn=this.SelToken,t.MktSegId=o.X.GetExchangeNameDesc(this.MarketSegmentId),t.Msg=this.sSurvMeasureDescription.trim(),t.BuySell="BUY"==this.SelBuySell?"1":"2",t.Symbol=this.SelSymbol+"-"+this.SelSeries,this.scripDetails.push(t),this.dialogService.confirm(s,"Yes","No").subscribe(d=>{this.tradingSharedService.insertScripSurveillanceDetails(d,this.scripDetails),!0===d?this.SubmitOrderInnerFunction():!1===d&&this.closeDialogRef()})}else this.SubmitOrderInnerFunction();else if(null!=this.ArrScripMaster.Table1&&this.ArrScripMaster.Table1.length>0&&"undefined"!=this.ArrScripMaster.Table1[0].sSurvMeasureDescription&&null!=this.ArrScripMaster.Table1[0].sSurvMeasureDescription)if(this.SelSeries==this.ArrScripMaster.Table1[0].sSeries?this.sSurvMeasureDescription=this.ArrScripMaster.Table1[0].sSurvMeasureDescription:this.ArrScripMaster.Table2.length>0&&null!=this.ArrScripMaster.Table2&&null!=this.ArrScripMaster.Table2[0].sSurvMeasureDescription&&"undefined"!=this.ArrScripMaster.Table2[0].sSurvMeasureDescription&&(this.sSurvMeasureDescription=this.ArrScripMaster.Table2[0].sSurvMeasureDescription),null!=this.sSurvMeasureDescription){let r=n.xB.dMsgMaster.OE216?n.xB.dMsgMaster.OE216:"Security is under {0}, would you like to continue?";r=r.replace("{0}",this.sSurvMeasureDescription);let s=`${r}`;var t;(t={}).Tkn=this.SelToken,t.MktSegId=o.X.GetExchangeNameDesc(this.MarketSegmentId),t.Msg=this.sSurvMeasureDescription.trim(),t.BuySell="BUY"==this.SelBuySell?"1":"2",t.Symbol=this.SelSymbol+"-"+this.SelSeries,this.scripDetails.push(t),this.dialogService.confirm(s,"Yes","No").subscribe(I=>{this.tradingSharedService.insertScripSurveillanceDetails(I,this.scripDetails),!0===I?this.SubmitOrderInnerFunction():!1===I&&this.closeDialogRef()})}else this.SubmitOrderInnerFunction();else this.SubmitOrderInnerFunction();else this.SubmitOrderInnerFunction()}catch(r){this.logService.WriteLog("Exception: "+r.message,"SubmitOrder()","orderentry.component.ts","")}}PlaceOrder(){try{this.MarketSegmentId!=n.gT.C_V_MSX_CASH.toString()||"SPOS OPEN"!=n.xB.ExchManager.sMCXSXEQSPOSStatus&&"PRE OPEN"!=n.xB.ExchManager.sMCXSXEQStatus?this.ValidateOrder(this.SelExchange):n.xB.ExchManager.FetchSPOSStatusForMCXSXEQ(this.MapMarketSegmentId,this.SelToken).subscribe(t=>{this.onFetchSPOSStatusForMCXSXEQ(t)})}catch(t){this.logService.WriteLog("Exception: "+t.message,"PlaceOrder()","orderentry.component.ts","")}}onFetchSPOSStatusForMCXSXEQ(t){try{t.ResponseStatus&&null!=t.ResponseString&&2==t.ResponseString.toString().split("|").length&&(this.SPOS=t.ResponseString.toString().split("|")[0],this.POSType=t.ResponseString.toString().split("|")[1]),this.ValidateOrder(this.SelExchange)}catch(r){this.logService.WriteLog("Exception: "+r.message,"_FetchSPOSStatusForMCXSXEQ()","orderentry.component.ts","")}}PopulateInstrument(t){try{this.ArrInstruments=n.xB.ExchManager.PopulateInstrument(t,n.gT.C_V_ORDERENTRY_PAGE)}
1catch(r){this.logService.WriteLog("Exception: "+r.message,"PopulateInstrument()","orderentry.component.ts","")}}GetDetailsForInst(t,r){try{if(this.MarketSegmentId=n.xB.ExchManager.GetMarketSegmentId(t,r),null!=this.MarketSegmentId&&(this.MapMarketSegmentId=n.xB.ExchManager.GetMapMarketSegmentId(t,this.MarketSegmentId)),null!=this.MarketSegmentId&&n.xB.ExchManager.LoginAllowed[this.MarketSegmentId]==n.gT.C_S_ON){this.SelDecimalloc=n.xB.ExchManager.GetDecimalLocator(t,this.MarketSegmentId),this.ArrValidity=n.xB.ExchManager.PopulateValidity(t,this.MarketSegmentId),this.ArrProductTypes=n.xB.ExchManager.PopulateProductTypes(t,this.MarketSegmentId,this.IsBulkOrderEntry),this.dcProductType=new n.aM;for(var s=0;s<this.ArrProductTypes.length;s++)this.dcProductType.add(s.toString(),this.ArrProductTypes[s]);this.ArrOrderTypes=n.xB.ExchManager.PopulateOrderTypes(t,this.MarketSegmentId),this.ArrMargin=n.xB.ExchManager.PopulateMarginDD(),this.dcEnableDisableFields=n.xB.ExchManager.EnableDisable(t,r),this.EnableDisable(),this.hasMargin=n.xB.ExchManager.DisplayMarginDD(t,r)}}catch(d){this.logService.WriteLog("Exception: "+d.message,"GetDetailsForInst()","orderentry.component.ts","")}}EnableDisable(){try{this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.PageSource!=n.gT.C_V_NETPOSITION_PAGENO.toString()&&this.PageSource!=n.gT.C_V_STOCKVIEW_PAGENO.toString()&&this.PageSource!=n.gT.C_V_GTDORDERBOOK_PAGENO.toString()&&(this.hasBuySell=this.dcEnableDisableFields.hasBuySell,this.hasExchange=this.dcEnableDisableFields.hasExchange,this.hasInstrument=this.dcEnableDisableFields.hasInstrument,this.hasSymbol=this.dcEnableDisableFields.hasSymbol,this.hasSeries=this.dcEnableDisableFields.hasSeries,this.hasExpire=this.dcEnableDisableFields.hasExpire,this.hasStrikePrice=this.dcEnableDisableFields.hasStrikePrice,this.hasOptionType=this.dcEnableDisableFields.hasOptionType,this.hasOrderType=this.dcEnableDisableFields.hasOrderType,this.hasProductType=this.dcEnableDisableFields.hasProductType,this.hasValidity=this.dcEnableDisableFields.hasValidity,this.hasTrailingSL=this.dcEnableDisableFields.hasTrailingSL,this.dcEnableDisableFields.hasQty||(this.SelQty=void 0),this.hasQty=this.dcEnableDisableFields.hasQty,this.dcEnableDisableFields.hasPrice||(this.SelPrice=void 0),this.hasPrice=this.dcEnableDisableFields.hasPrice,this.dcEnableDisableFields.hasDiscQty||(this.SelDiscQty=void 0),this.hasDiscQty=this.dcEnableDisableFields.hasDiscQty,this.dcEnableDisableFields.hasTriggerPrice||(this.SelTriggerPrice=void 0),this.hasTriggerPrice=this.dcEnableDisableFields.hasTriggerPrice,this.dcEnableDisableFields.hasDay||(this.SelDay=""),this.hasDay=this.dcEnableDisableFields.hasDay,this.dcEnableDisableFields.hasProdPer||(this.SelProdPer=""),this.hasProdPer=this.dcEnableDisableFields.hasProdPer,this.IsBulkOrderEntry?(this.hasCOL=!1,this.hasCOLEnabled=!1):(this.hasCOL=this.dcEnableDisableFields.hasCOL,this.hasCOLEnabled=this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.dcEnableDisableFields.hasCOLEnabled))}catch(t){this.logService.WriteLog("Exception: "+t.message,"EnableDisable()","orderentry.component.ts","")}}EnableDisableForModify(){try{this.dcEnableDisableFields.hasPrice||(this.SelPrice=void 0),this.hasPrice=this.dcEnableDisableFields.hasPrice,this.dcEnableDisableFields.hasDiscQty||(this.SelDiscQty=void 0),this.hasDiscQty=this.dcEnableDisableFields.hasDiscQty,this.dcEnableDisableFields.hasTriggerPrice||(this.SelTriggerPrice=void 0),this.hasTriggerPrice=this.dcEnableDisableFields.hasTriggerPrice,this.dcEnableDisableFields.hasDay||(this.SelDay=""),this.hasDay=this.dcEnableDisableFields.hasDay,this.hasCOL=this.dcEnableDisableFields.hasCOL,(this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT)&&(this.SelPrice=0,this.hasPrice=!1)}catch(t){this.logService.WriteLog("Exception: "+t.message,"EnableDisable()","orderentry.component.ts","")}}GetDetailsForOrderType(t,r,s){try{this.dcEnableDisableFields=n.xB.ExchManager.GetDetailsForOrderType(t,r,s),this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.PageSource!=n.gT.C_V_NETPOSITION_PAGENO.toString()&&this.PageSource!=n.gT.C_V_GTDORDERBOOK_PAGENO.toString()&&this.PageSource!=n.gT.C_V_STOCKVIEW_PAGENO.toString()?this.EnableDisable():this.EnableDisableForModify()}catch(d){this.logService.WriteLog("Exception: "+d.message,"GetDetailsForOrderType()","orderentry.component.ts","")}}GetDetailsForValidity(t,r,s){try{this.dcEnableDisableFields=n.xB.ExchManager.GetDetailsForValidity(t,r,s,this.SelOrderTypes),r==n.gT.C_S_VALUE_GTT&&(this.dcEnableDisableFields.hasDay=!0,this.dcEnableDisableFields.hasTriggerPrice=!0),this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.PageSource!=n.gT.C_V_NETPOSITION_PAGENO.toString()&&this.PageSource!=n.gT.C_V_STOCKVIEW_PAGENO.toString()&&this.PageSource!=n.gT.C_V_GTDORDERBOOK_PAGENO.toString()?(this.EnableDisable(),n.xB.ExchManager.GetDiscQtyFillValue(this.MarketSegmentId,r,this.SelOrderTypes)&&(this.SelDiscQty=this.SelQty)):this.EnableDisableForModify()}catch(I){this.logService.WriteLog("Exception: "+I.message,"GetDetailsForValidity()","orderentry.component.ts","")}}ValidateOrder(t){try{if(this.validate.removeError(),(this.PageSource==n.gT.C_V_ORDERBOOK_PAGENO.toString()||this.PageSource==n.gT.C_V_GTDORDERBOOK_PAGENO.toString())&&
1(this.ModifyFlag=!0),(this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT)&&(this.SelPrice=0),(this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()||this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString())&&this.SelValidity==n.gT.C_S_VALUE_EQUITY_GTD&&this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT&&0==this.SelPrice)return void alert("Market orders not allowed for Validity GTD");this.isGTD&&this.ModifyFlag&&this.SelValidity!=n.gT.C_S_VALUE_EQUITY_GTD&&(this.SelDay=0),(this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()||this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString())&&"GTD"==this.SelValidity&&!this.ModifyFlag&&(this.isGTD=!0,this.hasGTDDay=!0),null!=this.SelDate&&""!=this.SelDate&&(this.SelDay=n.vV.CalculateDays(new Date,new Date(this.SelDate))),t==n.gT.C_S_MCX_EXCHANGE_TEXT&&null==this.SelDiscQty&&(this.SelDiscQty=0),this.isGTT&&this.ModifyFlag&&this.SelValidity!=n.gT.C_S_VALUE_EQUITY_GTT&&(this.SelDay=0),this.MarketSegmentId!=n.gT.C_V_MCX_DERIVATIVES.toString()&&this.MarketSegmentId!=n.gT.C_V_MCX_SPOT.toString()&&this.MarketSegmentId!=n.gT.C_V_NCDEX_DERIVATIVES.toString()&&this.MarketSegmentId!=n.gT.C_V_NCDEX_SPOT.toString()&&this.MarketSegmentId!=n.gT.C_V_ICEX_DERIVATIVES.toString()&&this.SelValidity==n.gT.C_S_VALUE_EQUITY_GTT&&!this.ModifyFlag&&(this.isGTT=!0,this.hasGTTDay=!0),this.sErrorMsg="",this.dcOrderDetails.add("SelOperation",this.SelOperation),this.dcOrderDetails.add("SelExchange",this.SelExchange),this.dcOrderDetails.add("SelInstrument",this.SelInstrument),this.dcOrderDetails.add("MarketSegmentId",this.MarketSegmentId),this.dcOrderDetails.add("MapMarketSegmentId",this.MapMarketSegmentId),this.dcOrderDetails.add("SelSymbol",this.SelSymbol),this.dcOrderDetails.add("SelSeries",this.SelSeries),this.dcOrderDetails.add("SelExpire",this.SelExpire),"0"==this.SelStrikePrice&&(this.SelStrikePrice=""),this.dcOrderDetails.add("SelStrikePrice",this.SelStrikePrice),this.dcOrderDetails.add("SelOptionType",this.SelOptionType),this.dcOrderDetails.add("SelOrderTypes",this.SelOrderTypes),this.dcOrderDetails.add("SelProdPer",this.SelProdPer),this.dcOrderDetails.add("SelQty",this.SelQty),this.dcOrderDetails.add("SelPrice",this.SelPrice),this.dcOrderDetails.add("SelDiscQty",this.SelDiscQty),this.dcOrderDetails.add("SelTriggerPrice",this.SelTriggerPrice),this.dcOrderDetails.add("SelDay",this.SelDay),this.dcOrderDetails.add("SelValidity",this.SelValidity),this.dcOrderDetails.add("SelProduct",this.hasAMO?this.amoStatus.isAMOChecked&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_MARGIN_TEXT?n.gT.C_S_PRODUCTTYPE_AMO_MARGIN_TEXT:this.amoStatus.isAMOChecked&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT?n.gT.C_S_PRODUCTTYPE_AMO_DELIVERY_TEXT:this.amoStatus.isAMOChecked&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_INTRADAY_TEXT?n.gT.C_S_PRODUCTTYPE_AMO_INTRADAY_TEXT:this.amoStatus.isAMOChecked&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT?n.gT.C_S_PRODUCTTYPE_AMO_CARRYFORWARD_TEXT:this.SelProduct:this.SelProduct),this.dcOrderDetails.add("SelMarketLot",this.SelMarketLot),this.dcOrderDetails.add("SelDecimalloc",this.SelDecimalloc.toString()),this.dcOrderDetails.add("SelPriceTick",this.SelPriceTick),this.dcOrderDetails.add("SelToken",this.SelToken),this.dcOrderDetails.add("SelMPMFFlag",this.SelMPMFFlag),this.dcOrderDetails.add("IsSpread",this.IsSpread),this.dcOrderDetails.add("ModifyFlag",this.ModifyFlag),this.dcOrderDetails.add("FIILimit",this.FIILimit),this.dcOrderDetails.add("NRILimit",this.NRILimit),this.dcOrderDetails.add("AMOID",this.AMOID),this.dcOrderDetails.add("ExchangeOrderNo",this.ExchangeOrderNo),this.dcOrderDetails.add("ClientOrderNumber",this.ClientOrderNumber),this.dcOrderDetails.add("GatewayOrderNo",this.GatewayOrderNo),this.dcOrderDetails.add("OrderTime",this.OrderTime),this.dcOrderDetails.add("ParticipantID",this.ParticipantID),this.dcOrderDetails.add("MarketStatus",n.xB.ExchManager.GetMktStatus(this.MarketSegmentId)),this.dcOrderDetails.add("SPOS",this.SPOS),this.dcOrderDetails.add("POS",this.POSType),this.dcOrderDetails.add("MPLTP",this.MPLTP.toString()),this.dcOrderDetails.add("MPLowPr",this.MPLowPr.toString()),this.dcOrderDetails.add("MPHighPr",this.MPHighPr.toString()),this.dcOrderDetails.add("MPClosePrice",this.MPClosePrice.toString()),this.dcOrderDetails.add("MPOrderType",this.SelMPOrderType),this.dcOrderDetails.add("MPPrice",""==this.SelMPPrice||"NaN"==this.SelMPPrice?0:this.SelMPPrice),this.dcOrderDetails.add("MPTriggerPrice",this.SelMPTriggerPrice),this.dcOrderDetails.add("SelCOL",this.SelCOL),this.dcOrderDetails.add("TrailingSL",this.SelTrailingSL),this.dcOrderDetails.add("SLJumpPrice",this.SelSLJumpPrice),this.dcOrderDetails.add("LTPJumpPrice",this.SelLTPJumpPrice),this.dcOrderDetails.add("SLOrderPrice",this.SelMPPrice),this.dcOrderDetails.add("SLTriggerPrice",this.SelMPTriggerPrice),this.dcOrderDetails.add("ProfitOrderPrice",this.SelProfitOrderPrice),this.dcOrderDetails.add("BracketOrderId",this.BracketOrderId),this.dcOrderDetails.add("BOGatewayOrderNo",this.BOGatewayOrderNo),this.dcOrderDetails.add("LegIndicator",this.LegIndicator),this.dcOrderDetails.add("BOModifyTerms",this.GetBOModifyTerms()),this.dcOrderDetails.add("BuyPrice",this.BuyPrice.toString()),this.dcOrderDetails.add("SellPrice",this.SellPrice.toString()),this.dcOrderDetails.add("UnderlyingLTP",this.UnderlyingLTP.toString()),this.dcOrderDetails.add("ChkCutOff",this.SelCutOff),this.dcOrderDetails.add("IsCutOffAllowed",this.IsCutOffAllowed.toString()),this.dcOrderDetails.add("hasCutOff",this.hasCutOff),this.dcOrderDetails.add("CapPrice",this.CapPrice.toString()),this.dcOrderDetails.add("FloorPrice",this.FloorPrice.toString()),this.dcOrderDetails.add("SetPrice",this.SetPrice.toString()),this.dcOrderDetails.add("IsSetPrice",this.IsSetPrice.toString()),this.dcOrderDetails.add("SelMargin",this.SelMargin),this.dcOrderDetails.add("RecoId",this.RecommendationId),this.dcOrderDetails.add("AMO",this.SelAMO),this.dcOrderDetails.add("OriginalOrderType",this.SelOriginalOrderType),this.dcOrderDetails.add("LastPendingQty",this.LastPendingQty),this.dcOrderDetails.add("LastTradedQty",this.LastTradedQty),this.dcOrderDetails.add("BOPriceIndicator",this.sBOPricePreference),this.dcOrderDetails.add("OrderStatus",this.OrderStatus),this.dcOrderDetails.add("PageSource",this.PageSource),this.dcOrderDetails.add("isGTD",this.isGTD),this.dcOrderDetails.add("isGTT",this.isGTT),this.checkForOrderSlicing(this.SelQty)&&this.dcOrderDetails.add("MaxSingleTransactionQty",this.MaxSingleTransactionQty),this.SelProduct==n.gT.C_S_PRODUCTTYPE_MP_TEXT&&(""==this.SelMPPrice||"NaN"==this.SelMPPrice||null==this.SelMPPrice)&&(this.SelMPPrice=0),this.AMOSelected=1==this.amoStatus.isAMOChecked?"YES":"NO",this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&this.dcOrderDetails.add("BracketOrdModifyBit",this.BracketOrdModifyBit);var r=n.xB.ExchManager.ValidateOrder(t,this.dcOrderDetails);if(this.isOCOChecked){if(0==this.TargetPrice)r.push("Target Price cannot be zero");else if(null==this.TargetPrice||null==this.TargetPrice||""==this.TargetPrice)r.push("Target Price cannot be blank");else{var s=parseInt(Math.round(parseFloat((this.TargetPrice*this.SelDecimalloc).toString())).toString()),d=o.X.GetPriceFormatter(this.SelDecimalloc.toString(),this.MarketSegmentId,this.SelInstrument);this.PriceTickInRs=(parseFloat(this.SelPriceTick)/this.SelDecimalloc).toFixed(d),s%parseInt(this.SelPriceTick)!=0&&r.push("The entered Target Price value is not in multiple of price tick which is "+this.PriceTickInRs)}if(0==this.TargetTriggerPrice)r.push("Target Trigger Price cannot be zero");else if(null==this.TargetTriggerPrice||null==this.TargetTriggerPrice||""==this.TargetTriggerPrice)r.push("Target Trigger Price cannot be blank");else{var I=parseInt(Math.round(parseFloat((this.TargetTriggerPrice*this.SelDecimalloc).toString())).toString());d=o.X.GetPriceFormatter(this.SelDecimalloc.toString(),this.MarketSegmentId,this.SelInstrument),this.PriceTickInRs=(parseFloat(this.SelPriceTick)/this.SelDecimalloc).toFixed(d),I%parseInt(this.SelPriceTick)!=0&&r.push("The entered Target Trigger Price value is not in multiple of price tick which is "+this.PriceTickInRs)}this.SelBuySell==n.gT.C_S_ORDER_SELL_TEXT?(isNaN(this.SelTriggerPrice)||parseFloat(this.SelTriggerPrice)>parseFloat(this.LTP.toString())&&r.push("Stop Loss Trigger Price cannot be more than LTP"),!isNaN(this.TargetTriggerPrice)&&!isNaN(this.LTP)&&parseFloat(this.TargetTriggerPrice)<parseFloat(this.LTP.toString())&&r.push("Target Trigger Price cannot be less than LTP")):(!isNaN(this.SelTriggerPrice)&&!isNaN(this.LTP)&&parseFloat(this.SelTriggerPrice)<parseFloat(this.LTP.toString())&&r.push("Stop Loss Trigger Price cannot be less than LTP"),isNaN(this.TargetTriggerPrice)||((isNaN(this.LTP)||""==this.LTP.toString())&&
1(this.LTP=0),parseFloat(this.TargetTriggerPrice)>parseFloat(this.LTP.toString())&&r.push("Target Trigger Price cannot be more than LTP"))),!isNaN(this.SelTriggerPrice)&&!isNaN(this.LTP)&&parseFloat(this.SelTriggerPrice)==parseFloat(this.LTP.toString())&&r.push("Stop Loss Trigger Price shall not be equal to LTP"),!isNaN(this.TargetTriggerPrice)&&!isNaN(this.LTP)&&parseFloat(this.TargetTriggerPrice)==parseFloat(this.LTP.toString())&&r.push("Target Trigger Price shall not be equal to LTP"),!isNaN(this.SelTriggerPrice)&&!isNaN(this.TargetTriggerPrice)&&this.SelTriggerPrice==this.TargetTriggerPrice&&r.push("Stop Loss Trigger Price and Target Trigger Price cannot be same")}1==this.isOCOChecked&&""!=this.TargetPrice&&""!=this.TargetTriggerPrice?(this.dcOrderDetails.add("TargetPrice",this.TargetPrice),this.dcOrderDetails.add("TargetTriggerPrice",this.TargetTriggerPrice)):(this.dcOrderDetails.add("TargetPrice","0"),this.dcOrderDetails.add("TargetTriggerPrice","0"));const q=this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?this.getmarketorderprice():this.SelPrice,j=this.tradingSharedService.validateLTPPriceBand(this.MarketSegmentId,this.SelSymbol,this.scripDetail.nScripInstrument,this.SelInstrument,this.SelOrderTypes,this.SelBuySell,this.LTP,this.MPClosePrice,q,this.LTQ,this.SelDecimalloc,this.SelProduct,this.SelMPPrice);this.sPriceBandWarning="",j.valid||(j.isRestrictive?r.push(j.errorMsg):this.sPriceBandWarning=j.errorMsg);const Ie=!!n.xB.User.POAStatus&&n.xB.User.POAStatus;if(!isNaN(this.UnsettledQty)&&this.PageSource==n.gT.C_V_NETPOSITION_PAGENO.toString()&&!Ie&&this.SelProduct==n.gT.C_S_PRODUCTTYPE_MTF_TEXT&&n.xB.User.EDISForMTF&&this.SelOperation==n.gT.C_S_ORDER_SELL_TEXT&&this.SelQty>parseInt(this.sOriginalQty)-this.UnsettledQty&&r.push("Free Quantity is not available"),r.length>0){for(var M=0;M<r.length;M++)this.sErrorMsg+=r[M]+"<br/>";this.SendMktReqFlag=!1}else{var U=!0;this.PageSource==n.gT.C_V_NETPOSITION_PAGENO.toString()&&parseInt(this.SelQty)>parseInt(this.sOriginalQty)&&(this.sErrorMsg="Entered quantity is greater than the original quantity",U=!1),this.PageSource==n.gT.C_V_STOCKVIEW_PAGENO.toString()&&this.SelBuySell==n.gT.C_S_ORDER_SELL_TEXT&&parseInt(this.SelQty)>parseInt(this.sOriginalQty)&&(this.sErrorMsg="Entered quantity is greater than the original quantity",U=!1),U&&(this.PageSource==n.gT.C_V_ORDERBOOK_PAGENO.toString()&&t==n.gT.C_S_OTSTXT_EXCHANGE_TEXT&&(5==n.xB.User.OdinCategory||n.xB.User.NSEEQParticipantID.length>0)&&this.SelMargin==n.gT.C_S_FIXED_MARGIN&&(parseInt(this.SelQty)<parseInt(this.TempQty)&&(this.sErrorMsg="Entered quantity is less than the original quantity"),parseFloat(this.SelPrice)<parseFloat(this.TempPrice)&&(this.sErrorMsg="Entered price is less than the original price")),this.checkForEDISFlag()&&this.SelValidity!=n.gT.C_S_VALUE_GTT?this.checkforEDIS().then(()=>{this.multiscripRequestSubscription().then(pe=>{const Ve={eDISMode:this.eDISMode,exchange:this.SelExchange,scrip:this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE?{instrument:this.SelInstrument,securityDesc:this.eDISParams.SecurityDesc,isin:this.eDISParams.ISIN,quantity:this.ModifyFlag?parseInt(this.SelQty)-parseInt(this.LastPendingQty):this.eDISParams.eDISQty,ProductType:this.tradingSharedService.GetProductTypeForEDIS(this.SelProduct)}:null,amo:"YES"==this.AMOSelected?"Y":"N",settlmtCycle:"1"==this.settlmtCycle?"T1":"T2"};this.disableBackground=this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE,this.tradingSharedService.GoForEDISOnline(Ve,pe?pe.eDISReqDetails:[]).then(He=>{this.pubsubService.publish("eDISAuthComp",{msg:"CloseDialog"}),He&&(this.eDISParams.eDISTxnRefNo=He.refTxnNo,n.xB.User.Depository==n.gT.C_S_EDIS_MODE_CDSL?(this.eDISParams.ApprovedQuantity=He.ApprovedQuantity,this.eDISParams.TotalAvailableQty=He.TotalAvailableQty):n.xB.User.Depository==n.gT.C_S_EDIS_MODE_NSDL&&(this.eDISParams.ApprovedQuantity=this.eDISParams.eDISQty,this.eDISParams.TotalAvailableQty=He.TotalAvailableQty)),this.disableBackground=!1,this.ShowConfirm=!0,this.OETitle="Order Confirmation",(null==this.SelDiscQty||""==this.SelDiscQty)&&(this.SelDiscQty=0),this.OperationTrend=this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT?"tc5 tkr_up scripname":"tc5 tkr_dwn scripname",this.confirmOrder=!0,this.isDialog=!1,this.ShowPrefWarning()}).catch(He=>
1{this.disableBackground=!1,this.pubsubService.publish("eDISAuthComp",{msg:"CloseDialog"})})}).catch(pe=>{console.log(pe)})}).catch(pe=>{console.log(pe)}):this.SelProduct==n.gT.C_S_PRODUCTTYPE_MTF_TEXT&&this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT&&n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_PLEDGE)&&"ON"==this.MTFPrepledge?(this.strMTF_QTY=this.SelQty,this.ModifyFlag?this.SelQty>parseInt(this.LastPendingQty)?(this.strMTF_QTY=parseInt(this.SelQty)-parseInt(this.LastPendingQty),this.checkMTF()):(this.ShowConfirm=!0,this.OETitle="Order Confirmation",(null==this.SelDiscQty||""==this.SelDiscQty)&&(this.SelDiscQty=0),this.OperationTrend=this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT?"tc5 tkr_up scripname":"tc5 tkr_dwn scripname",this.confirmOrder=!0,this.isDialog=!1,this.ShowPrefWarning()):this.checkMTF()):(this.ShowConfirm=!0,this.OETitle="Order Confirmation",(null==this.SelDiscQty||""==this.SelDiscQty)&&(this.SelDiscQty=0),this.OperationTrend=this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT?"tc5 tkr_up scripname":"tc5 tkr_dwn scripname",this.confirmOrder=!0,this.isDialog=!1,this.ShowPrefWarning()),this.calcBOActualPrices())}0==r.length&&""==this.sErrorMsg&&this.isSlicingRequired&&null!=this.SliceQtyErrorMsg&&""!=this.SliceQtyErrorMsg&&(this.ShowConfirm=!1,this.dialogService.confirm(this.SliceQtyErrorMsg,"Yes","No").subscribe(pe=>{!0===pe&&(this.ShowConfirm=!0)}))}catch(q){this.logService.WriteLog("Exception: "+q.message,"ValidateOrder()","tr_OrderEntry.js","")}}checkMTF(){return new Promise((t,r)=>{if(this.SelProduct==n.gT.C_S_PRODUCTTYPE_MTF_TEXT){let q=n.xB.dConfigMaster.PLEDGE_REQUEST_NEWNETNET_URL,pe="LIGHT"==n.xB.CurrentTheme.Id?"L":"D",Ve="ODINAERO",He="Y",it=this.scripDetail.ISIN,ce="0.00",Je=this.ScripSymbol;var d=document.createElement("form"),I={UserId:n.xB.User.UserId.trim(),GroupId:n.xB.User.GroupId.trim(),Product:Ve,ManagerIP:n.xB.User.ManagerIP,DealerCode:n.xB.User.UserCode,GroupCode:n.xB.User.GroupCode,theme:pe,SessionId:n.xB.User.OCToken,strMTF:He,strMTF_ISIN:it,strMTF_COLValue:ce,strMTF_QTY:this.strMTF_QTY,strMTF_ScripName:Je};for(var M in d.setAttribute("name","MTFPledge"),d.setAttribute("method","post"),d.setAttribute("action",q),I)if(I.hasOwnProperty(M)){var U=document.createElement("input");U.type="hidden",U.name=M,U.value=I[M],d.appendChild(U)}let lt=null;lt=window.open("","_blank","width=1000,height=800,location=no,toolbar=no,menubar=no,resizable=no"),lt.document.body.appendChild(d),lt.document.forms[0].submit()}window.addEventListener("message",q=>{if("MTFResp"==q.data.messageCode){var j="",Ie="";try{const pe=JSON.parse(q.data.respdata);null!=pe[0].ISINStatus?j=pe[0].ISINStatus:null!=pe[0].sStatus&&(j=pe[0].sStatus,null!=pe[0].sISINPledgeErrorMsg&&(Ie=pe[0].sISINPledgeErrorMsg)),console.log("Pledge Status :"+j),"Success"==j||"Completed"==j?(this.ShowConfirm=!0,this.OETitle="Order Confirmation",(null==this.SelDiscQty||""==this.SelDiscQty)&&(this.SelDiscQty=0),this.OperationTrend=this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT?"tc5 tkr_up scripname":"tc5 tkr_dwn scripname",this.confirmOrder=!0,this.isDialog=!1,this.ShowPrefWarning()):(console.log("Pledge Status :"+j),this.sErrorMsg="Pledge Request Unsuccessful. Please try again. "+Ie,r("transaction failed"))}catch(pe){this.sErrorMsg="Pledge Request Unsuccessful. Please try again. "+Ie,r("transaction failed"),console.log(pe.message)}}},{once:!0})})}ConfirmClick(){this.IsBulkOrderEntry||this.validate.hasError()||0==this.sErrorMsg.length&&(this.ValueAlertFlag=!0,this.ProcessOrder()),"GTD"==this.SelValidity&&0==this.SelDay&&(this.SelValidity="DAY")}ShowPrefWarning(){if(this.strQtyMessgae="",null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic){var r=n.xB.User.OrderPrefDic[this.MarketSegmentId].sOrderConfMode.split("#"),s=null==this.dcOrderDetails.MarketStatus?"":this.dcOrderDetails.MarketStatus;if((r.Contains("All")||r.Contains("OM"))&&this.ModifyFlag?(this.bConfReq=!0,this.strQtyMessgae+=n.xB.dMsgMaster.NNSL248+"<br/>"):!r.Contains("All")&&!r.Contains("MO")||0!=parseFloat(this.SelPrice)&&0!=this.SelPrice.length?(r.Contains("All")||r.Contains("MC"))&&"CLOSE"==s.toString().toUpperCase()?(this.bConfReq=!0,this.strQtyMessgae+=n.xB.dMsgMaster.NNSL247+"<br/>"):(r.Contains("All")||r.Contains("FO"))&&!this.ModifyFlag||(this.bConfReq=!1):o.X.IsCommodityExchange(this.MapMarketSegmentId)||this.SelProduct==n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?
10==this.SelPrice.length&&(this.bConfReq=!0,this.strQtyMessgae+=n.xB.dMsgMaster.NNSL249+"<br/>"):(this.bConfReq=!0,this.strQtyMessgae+=n.xB.dMsgMaster.NNSL249+"<br/>"),this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString()||"MANUAL"==this.PageSource){this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTIDX_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTIVX_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTSTK_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTCOM_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTCUR_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTINT_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_EQUITIES_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTIRF_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTIRC_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTBLN_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTENR_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTMET_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_FUTBAS_TEXT?(this.QtyAlert=this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].nAlertQtyValue,this.PriceAlert=this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].nAlertQtyPricePercFut,this.ValueAlert=this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].nAlertValuePercFut):(this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTIDX_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTSTK_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTCUR_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTCOM_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTIRC_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTIRD_TEXT||this.SelInstrument==n.gT.C_S_INSTRUMENT_OPTBAS_TEXT)&&(this.QtyAlert=this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].nAlertQtyOptionValue,this.PriceAlert=this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].nAlertQtyPricePercOpt,this.ValueAlert=this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].nAlertValuePercOpt);var d="",I=this.SelQty;if(this.MarketSegmentId==n.gT.C_V_NSE_DERIVATIVES.toString()&&(I=parseInt(this.SelQty)/parseInt(this.SelMarketLot),d=" Lot(s)"),0!=this.QtyAlert&&(parseInt(I)>this.QtyAlert?(this.bAlertConfQty=!1,this.MarketSegmentId==n.gT.C_V_ICEX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_BSECOMM_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_NSECOMM_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_MCX_DERIVATIVES.toString()?this.strQtyMessgae+="Lot specified is greater than "+this.QtyAlert.toString()+"<br/>":this.strQtyMessgae+="Quantity specified is greater than "+this.QtyAlert.toString()+d+"<br/>"):this.bAlertConfQty=!0),0!=this.PriceAlert){var M=0;this.SelBuySell===n.gT.C_S_ORDER_BUY_TEXT?(M=(parseFloat(this.LTP.toString())+parseFloat(this.LTP.toString())*(parseFloat(this.PriceAlert.toString())/100)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),0!=this.SelPrice&&this.SelPrice>parseFloat(M.toString())?(this.bAlertConfPrice=!1,this.strQtyMessgae+="Price specified is greater than "+M.toString()+"<br/>"):this.bAlertConfPrice=!0):(M=(parseFloat(this.LTP.toString())-parseFloat(this.LTP.toString())*(parseFloat(this.PriceAlert.toString())/100)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),0!=this.SelPrice&&this.SelPrice<parseFloat(M)?(this.bAlertConfPrice=!1,this.strQtyMessgae+="Price specified is less than "+M.toString()+"<br/>"):this.bAlertConfPrice=!0)}0!=this.ValueAlert&&(this.GetOrderValuePref()>this.ValueAlert?(this.bAlertConfValue=!1,this.strQtyMessgae+="Order Value specified is greater than "+this.ValueAlert.toString()+"<br/>"):this.bAlertConfValue=!0)}this.amoStatus.isAMOChecked&&(this.strQtyMessgae+=this.AMODisclaimer+"<br/>")}this.sPriceBandWarning.length>0&&(this.strQtyMessgae+=this.sPriceBandWarning+"<br/>")}ProcessOrder(){this.ConfirmOrder()}onKeyDown(t){var r=t.which?t.which:t.keyCode;if(112===r||107===r||113===r||109===r||13===r){var d=!1;if(112==r||107==r)d=!0,0==this.confirmOrder&&this.hasBuySell&&!this.disableBackgroun
1d&&(this.SelOperation="BUY",this.onSelOperationChange());else if(113==r||109==r)d=!0,0==this.confirmOrder&&this.hasBuySell&&!this.disableBackground&&(this.SelOperation="SELL",this.onSelOperationChange());else{if(this.isDialog)return void(this.isDialog=!1);if(13==r&&0==this.confirmOrder){d=!0;var M={value:this.SelTriggerPrice},U={value:this.SelQty};this.transformValue("PRICE",{value:this.SelPrice},0),this.transformValue("TP",M,0),this.transformValue("QTY",U,0),(this.SelProduct==n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT)&&(this.transformValue("MPPrice",{value:this.SelMPPrice},0),this.transformValue("MPTriggerPrice",{value:this.SelMPTriggerPrice},0),this.transformValue("SLJumpPrice",{value:this.SelSLJumpPrice},0),this.transformValue("LTPJumpPrice",{value:this.SelLTPJumpPrice},0),this.transformValue("ProfitOrderPrice",{value:this.SelProfitOrderPrice},0)),this.SubmitOrder()}else 13==r&&1==this.confirmOrder&&0==this.confirmDialog&&"submit"==document.activeElement.getAttribute("type")&&(d=!0,this.ConfirmClick())}d&&(t.preventDefault(),t.stopImmediatePropagation())}}GetOrderValuePref(){var t=0,r=this.SelPrice;switch(o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?""==this.SelPrice&&(r=this.LTP):0==this.SelPrice&&(r=this.LTP),this.MarketSegmentId.toString()){case n.gT.C_V_NSE_CASH.toString():case n.gT.C_V_BSE_CASH.toString():case n.gT.C_V_BSE_DERIVATIVES.toString():case n.gT.C_V_NSE_DERIVATIVES.toString():case n.gT.C_V_MSX_CASH.toString():case n.gT.C_V_OFS_IPO_BONDS.toString():t=parseFloat(r)*this.SelQty;break;case n.gT.C_V_MCX_DERIVATIVES.toString():case n.gT.C_V_MSX_DERIVATIVES.toString():case n.gT.C_V_NSX_DERIVATIVES.toString():case n.gT.C_V_BSECDX_DERIVATIVES.toString():case n.gT.C_V_NSEL_DERIVATIVES.toString():case n.gT.C_V_NSECOMM_DERIVATIVES.toString():case n.gT.C_V_ICEX_DERIVATIVES.toString():t=parseFloat(r)*this.SelQty*(parseFloat(this.PriceNumerator.toString())/parseFloat(this.PriceDenominator.toString())*(parseFloat(this.GenNumerator.toString())/parseFloat(this.GenDenominator.toString())))*parseInt(this.SelMarketLot);break;case n.gT.C_V_MSX_FAO.toString():t=parseFloat(r)*this.SelQty*parseInt(this.SelMarketLot);break;case n.gT.C_V_BSECOMM_DERIVATIVES.toString():t=parseFloat(r)*this.SelQty*this.IntrinsicValue;break;case n.gT.C_V_NCDEX_DERIVATIVES.toString():t=parseFloat(r)*this.SelQty*(parseFloat(this.PriceNumerator.toString())/parseFloat(this.PriceDenominator.toString()))}return t}yesCallbackPrefferedQty(){if(0!=this.PriceAlert){this.bAlertConfQty=!0;var t=0;this.SelBuySell===n.gT.C_S_ORDER_BUY_TEXT?(t=(parseFloat(this.LTP.toString())+parseFloat(this.LTP.toString())*(parseFloat(this.PriceAlert.toString())/100)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelPrice>t?(t.toString(),this.bAlertConfPrice=!1,this.dialogService.confirm("Price specified is greater than "+t.toString()+", do you still want to submit the order").subscribe(d=>{d?this.yesCallbackPrefferedPrice():this.noCallbackPrefferedPrice()})):this.bAlertConfPrice=!0):(t=(parseFloat(this.LTP.toString())-parseFloat(this.LTP.toString())*(parseFloat(this.PriceAlert.toString())/100)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelPrice<t?(t.toString(),this.bAlertConfPrice=!1,this.dialogService.confirm("Price specified is less than "+t.toString()+", do you still want to submit the order").subscribe(I=>{I?this.yesCallbackPrefferedPrice():this.noCallbackPrefferedPrice()})):this.bAlertConfPrice=!0)}0!=this.ValueAlert&&1==this.bAlertConfQty&&1==this.bAlertConfPrice&&(this.GetOrderValuePref()>this.ValueAlert?(this.bAlertConfValue=!1,this.ValueAlert.toString(),this.dialogService.confirm("Order Value specified is greater than "+this.ValueAlert.toString()+", do you still want to submit the order").subscribe(I=>{I?this.yesCallbackPrefferedPrice():this.noCallbackPrefferedPrice()})):this.bAlertConfValue=!0),1==this.bAlertConfValue&&1==this.bAlertConfQty&&1==this.bAlertConfPrice&&(this.bConfReq?this.dialogService.confirm(this.strMessage).subscribe(d=>{d&&this.yesCallbackOrderEntry()}):n.xB.dConfigMaster.CONST_SECONDLEVEL_AUTH_STATUS===n.gT.C_S_ON&&n.xB.User.IsTransLevel?this.ShowHideAuthDiv(n.xB.User.IsTransLevel):this.ConfirmOrder())}noCallbackPrefferedQty(){this.bAlertConfQty=!1}yesCallbackPrefferedPrice(){this.bAlertConfValue=!0,this.bAlertConfPrice=!0,0!=this.ValueAlert&&(this.GetOrderValuePref()>this.ValueAlert?(this.bAlertConfValue=!1,this.ValueAlert.toString(),this.dialogService.confirm("Order Value specified is greater than "+this.ValueAlert.toString()+", do you still want to submit the order").subscribe(s=>{s&&this.yesCallbackPrefferedValue()})):this.bAlertConfValue=!0),1==this.bAlertConfValue&&1==this.bAlertConfQty&&1==this.bAlertConfPrice&&(this.bConfReq?this.dialogService.confirm(this.strMessage).subscribe(s=>{s&&this.yesCallbackOrderEntry()}):n.xB.dConfigMaster.CONST_SECONDLEVEL_AUTH_STATUS===n.gT.C_S_ON&&n.xB.User.IsTransLevel?this.ShowHideAuthDiv(n.xB.User.IsTransLevel):this.ConfirmOrder())}noCallbackPrefferedPrice(){this.bAlertConfPrice=!1}yesCallbackPrefferedValue(){this.bAlertConfValue=!0,1==this.bAlertConfValue&&1==this.bAlertConfQty&&1==this.bAlertConfPrice&&(this.bConfReq?this.dialogService.confirm(this.strMessage).subscribe(t=>{t&&this.yesCallbackOrderEntry()}):n.xB.dConfigMaster.CONST_SECONDLEVEL_AUTH_STATUS===n.gT.C_S_ON&&n.xB.User.IsTransLevel?this.ShowHideAuthDiv(n.xB.User.IsTransLevel):this.ConfirmOrder())}noCallbackPrefferedValue(){this.bAlertConfValue=!1}yesCallbackOrderEntry(){n.xB.dConfigMaster.CONST_SECONDLEVEL_AUTH_STATUS===n.gT.C_S_ON&&n.xB.User.IsTransLevel?this.ShowHideAuthDiv(n.xB.User.IsTransLevel):this.ConfirmOrder()}GetBOModifyTerms(){var t=0;if(this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&this.ModifyFlag){var r=this.OEJSONData;JSON.parse(r.OEPRICE)!=this.SelPrice&&(t+=2),"0"!=JSON.parse(r.OEQTY)&&JSON.parse(r.OEQTY)!=this.SelQty&&(t+=1);var s=JSON.parse(r.OESLOrderType)==n.gT.C_V_ORDER_STOPLOSS_MARKET?"0":JSON.parse(r.OESLORDERPRICE);(parseFloat(s)!=parseFloat(this.SelMPPrice)||JSON.parse(r.OESLTRIGGERPRICE)!=this.SelMPTriggerPrice)&&(t+=4),(JSON.parse(r.OESLJUMPPRICE)!=this.SelSLJumpPrice&&null!=this.SelSLJumpPrice||null!=this.SelLTPJumpPrice&&JSON.parse(r.OELTPJUMPPRICE)!=this.SelLTPJumpPrice)&&(t+=8),JSON.parse(r.OEPROFITORDERPRICE)!=this.SelProfitOrderPrice&&(t+=16);var d=!1;parseFloat(JSON.parse(r.OESLJUMPPRICE))>0&&(d=!0),d!=this.SelTrailingSL&&(t+=32)}return t}fn_DisableFieldsForModify(){this.hasBuySell=!1,this.hasExchange=!1,this.hasInstrument=!1,this.hasSymbol
1=!1,this.hasSeries=!1,this.hasExpire=!1,this.hasStrikePrice=!1,this.hasOptionType=!1,this.hasProductType=!1,this.hasDay=!1,this.hasGTDDay=this.SelValidity==n.gT.C_S_VALUE_GTD,this.hasGTTDay=this.SelValidity==n.gT.C_S_VALUE_GTT}fn_DisableFieldsForMW(){}PopulateOE(t,r=null){17==t.PageSource&&(0==t.RecoPrice||""==t.RecoPrice)&&(this.PageSourceId=17,this.RecoPrice=t.RecoPrice,this.SelOrderTypes=this.ArrOrderTypes[1]),this.bFormat=!0;var s=h.Q.PopulateSelectedOE(t);if(this.PageSource=JSON.parse(s.OEPAGESOURCE),this.bChangeScrip="MANUAL"==this.PageSource,this.SelOperation="SELL"==JSON.parse(s.OEBUYSELL)?"SELL":"BUY",this.onSelOperationChange(),this.PageSource==n.gT.C_V_ORDERBOOK_PAGENO.toString()&&(this.ModifyFlag=!0),"MANUAL"!=this.PageSource){var d=new m.u;if(this.ScripDetail.ScripDet.MktSegId=parseInt(JSON.parse(s.OEMKTSEGID)),this.SelExchange=JSON.parse(s.OEEXCH),this.onSelExchangeChange(),this.ScripDetail.ExchangeName=this.SelExchange,d.ExchangeName=this.SelExchange,this.SelInstrument=JSON.parse(s.OEINST),this.onSelInstrumentChange(),this.ScripDetail.InstrumentName=this.SelInstrument,this.SelSymbol=JSON.parse(s.OESYMBOL),this.ScripDetail.Symbol=this.SelSymbol,this.LTP=JSON.parse(s.OELTP),"NA"!=JSON.parse(s.OESERIES)){var I=JSON.parse(s.OESERIES);0==this.ArrSeries.length&&I.length>0&&this.ArrSeries.push(JSON.parse(s.OESERIES)),this.SelSeries=JSON.parse(s.OESERIES),this.ScripDetail.Series=this.SelSeries}else(JSON.parse(s.OEMKTSEGID)==n.gT.C_V_MAPPED_NSE_CASH||JSON.parse(s.OEMKTSEGID)==n.gT.C_V_MAPPED_BSE_CASH||JSON.parse(s.OEMKTSEGID)==n.gT.C_V_MAPPED_MSX_CASH||JSON.parse(s.OEMKTSEGID)==n.gT.C_V_MAPPED_DSE_CASH)&&("NA"==JSON.parse(s.OESERIES)&&this.ArrSeries.push(JSON.parse(s.OESERIES)),this.SelSeries=JSON.parse(s.OESERIES),this.ScripDetail.Series=this.SelSeries);"NA"!=JSON.parse(s.OEEXPDATE)&&(0==this.ArrExpire.length&&this.ArrExpire.push(JSON.parse(s.OEEXPDATE)),this.SelExpire=JSON.parse(s.OEEXPDATE),this.ScripDetail.ExpiryDate=this.SelExpire),"NA"!=JSON.parse(s.OESTKPRICE)&&"NaN"!=JSON.parse(s.OESTKPRICE)&&(0==this.ArrStrikePrice.length&&this.ArrStrikePrice.push(JSON.parse(s.OESTKPRICE)),this.SelStrikePrice=JSON.parse(s.OESTKPRICE),this.ScripDetail.StrikePrice=this.SelStrikePrice),"NA"!=JSON.parse(s.OEOPTIONTYPE)&&(0==this.ArrOptionType.length&&this.ArrOptionType.push(JSON.parse(s.OEOPTIONTYPE)),this.SelOptionType=JSON.parse(s.OEOPTIONTYPE),this.ScripDetail.OptionType=this.SelOptionType),JSON.parse(s.OEORDERTYPE).length>0&&(this.SelOrderTypes=JSON.parse(s.OEORDERTYPE)),d.InstrumentName=this.SelInstrument,d.Symbol=this.SelSymbol,d.Series=this.SelSeries,d.ExpiryDate=this.SelExpire,d.StrikePrice=this.SelStrikePrice,d.OptionType=this.SelOptionType,this.PriceNumerator=JSON.parse(s.OEPriceNumerator),this.PriceDenominator=JSON.parse(s.OEPriceDenominator),this.GenNumerator=JSON.parse(s.OEGenNumerator),this.GenDenominator=JSON.parse(s.OEGenDenominator),d.MWSecurityDesc=o.X.FormatScripDescForMW(d),this.onSelOrderTypesChange(),this.OEJSONData=s,(this.PageSource==n.gT.C_V_NETPOSITION_PAGENO.toString()||this.PageSource==n.gT.C_V_STOCKVIEW_PAGENO.toString())&&(this.sOriginalQty=JSON.parse(s.OEQTY),null!=t.UnsettledQty&&this.PageSource==n.gT.C_V_NETPOSITION_PAGENO.toString()&&(this.UnsettledQty=t.UnsettledQty),this.SelInstrument==n.gT.C_S_INSTRUMENT_NCDEXCOMDTY_TEXT&&(this.hasValidity=!1),this.hasPrice=!1,this.bShowChangeScrip=!1),this.SelToken=JSON.parse(s.OETOKEN),this.SelDecimalloc=JSON.parse(s.OEDECLOC),isNaN(this.SelDecimalloc)&&(this.SelDecimalloc=100),this.MarketSegmentId=JSON.parse(s.OEMKTSEGID),this.MapMarketSegmentId=JSON.parse(s.OEMAPMKTSEGID),this.SelMarketLot=JSON.parse(s.OEMKTLOT),this.ScripMarketLot="(Lot Size = "+this.SelMarketLot+")",(this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString())&&(this.ShowSwitch=this.MapMarketSegmentId==n.gT.C_V_MAPPED_NSE_CASH.toString()||this.Map
1MarketSegmentId==n.gT.C_V_MAPPED_BSE_CASH.toString()),this.IncrementLot=n.xB.ExchManager.ExchInLOT.Contains(this.MarketSegmentId)?1:parseInt(this.SelMarketLot);var M=isNaN(parseFloat(JSON.parse(s.OEPRICE)))?0:parseFloat(JSON.parse(s.OEPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1));this.SelPrice=M,this.SelPriceTick=JSON.parse(s.OEPRICETICK),this.IncrementPriceTick=parseFloat(this.SelPriceTick)/parseFloat(this.SelDecimalloc.toString()),d.ScripDet.Token=this.SelToken,d.ScripDet.MktSegId=parseInt(this.MarketSegmentId),d.ScripDet.MapMktSegId=parseInt(this.MapMarketSegmentId,10),this.ScripDetail.Token=parseInt(this.SelToken),this.ScripDetail.MarketLot=this.SelMarketLot,this.ScripDetail.PriceTick=this.SelPriceTick,this.ScripDetail.MWSecurityDesc=o.X.FormatScripDescForMW(this.ScripDetail),this.ScripSymbol=this.ScripDetail.MWSecurityDesc.substr(0,this.ScripDetail.MWSecurityDesc.indexOf(" ")),this.ScripData=this.ScripDetail.MWSecurityDesc.substr(this.ScripDetail.MWSecurityDesc.indexOf(" ")+1);var U=isNaN(parseFloat(JSON.parse(s.OETRIGPRICE)))?0:parseFloat(JSON.parse(s.OETRIGPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1));this.SelTriggerPrice=U,JSON.parse(s.OEPRODUCTTYPE).length>0&&"undefined"!=JSON.parse(s.OEPRODUCTTYPE)?this.hasAMO?this.SelProduct=parseInt(this.PageSource)==n.gT.C_V_ORDERBOOK_PAGENO||parseInt(this.PageSource)==n.gT.C_V_MARKETWATCH_PAGENO||parseInt(this.PageSource)==n.gT.C_V_GTDORDERBOOK_PAGENO?JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_MARGIN_TEXT?n.gT.C_S_PRODUCTTYPE_MARGIN_TEXT:JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_DELIVERY_TEXT?n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT:JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_INTRADAY_TEXT?n.gT.C_S_PRODUCTTYPE_INTRADAY_TEXT:JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_CARRYFORWARD_TEXT?n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT:JSON.parse(s.OEPRODUCTTYPE):JSON.parse(s.OEPRODUCTTYPE):(this.SelProduct=JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_MARGIN_TEXT?n.gT.C_S_PRODUCTTYPE_MARGIN_TEXT:JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_DELIVERY_TEXT?n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT:JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_INTRADAY_TEXT?n.gT.C_S_PRODUCTTYPE_INTRADAY_TEXT:JSON.parse(s.OEPRODUCTTYPE)==n.gT.C_S_PRODUCTTYPE_AMO_CARRYFORWARD_TEXT?n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT:JSON.parse(s.OEPRODUCTTYPE),this.hasAMO=!1):"undefined"!=JSON.parse(s.OEPRODUCTTYPE)&&""!=JSON.parse(s.OEPRODUCTTYPE)&&(this.SelProduct=JSON.parse(s.OEPRODUCTTYPE)),this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(this.SelProduct),this.onSelProductChange(""),JSON.parse(s.OEVALIDITY).length>0&&(this.SelValidity=JSON.parse(s.OEVALIDITY)),this.onSelValidityChange(),this.SelDay=JSON.parse(s.OEDAY),this.SelQty=JSON.parse(s.OEQTY),this.onSelQtyUpdate(),this.MarketSegmentId==n.gT.C_V_OFS_IPO_BONDS.toString()&&this.GetOTSCutOffParams().subscribe(mt=>{this.fn_GetOTSCutOffParams(mt)});var q=JSON.parse(s.OEVALIDITY);if(this.SelDay=JSON.parse(s.OEDAY),q!=n.gT.C_S_VALUE_EQUITY_GTD||"undefined"==q||""==q||JSON.parse(s.OEMKTSEGID)!=n.gT.C_V_NSE_CASH&&JSON.parse(s.OEMKTSEGID)!=n.gT.C_V_BSE_CASH?this.isGTD=!1:(this.isGTD=!0,""!=this.SelDay&&this.FillGTDDaysforEquitities(this.SelDay)),q==n.gT.C_S_VALUE_EQUITY_GTT&&"undefined"!=q&&""!=q?(this.isGTT=!0,""!=this.SelDay&&this.FillGTTDaysforEquitities(this.SelDay)):this.isGTT=!1,this.SelDay=JSON.parse(s.OEDAY),null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic&&n.xB.User.OrderPrefDic.count()>0&&(this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].sDefaultProductType,(this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString()||this.PageSource==n.gT.C_V_RECOMMENDATION_PAGE.toString())&&(n.xB.dcProductTypeOldNewName.containsKey(this.defaultProduct)&&this.ArrProductTypes.Contains(this.defaultProduct)&&(this.SelProduct=n.xB.dcProductTypeOldNewName.getItem(this.defaultProduct)),(this.SelProduct==n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT)&&(this.fn_OnProductTypeChange(),this.fn_CheckForMarginPlus()),this.activeTabIndex=this.SetA
1ctiveTabIndexForDefaultProduct(this.SelProduct))),this.focusOn=n.xB.User.OrderPrefDic[this.MarketSegmentId].nDefFocusOnPrice?"price":"qty",this.PageSource==n.gT.C_V_GTDORDERBOOK_PAGENO.toString()&&(this.fn_DisableFieldsForModify(),this.ModifyFlag=!0,this.hasValidity=!1,this.ExchangeOrderNo=JSON.parse(s.OEEXORNO),this.GatewayOrderNo=JSON.parse(s.OEGWORNO),this.ClientOrderNumber=JSON.parse(s.OECLORNO),this.OrderTime=JSON.parse(s.OEORDERTIME),this.SelDiscQty=void 0,this.SelDiscQty=JSON.parse(s.OEDISCQTY),JSON.parse(s.OESLOrderType)==n.gT.C_V_ORDER_STOPLOSS&&(pe=isNaN(parseFloat(JSON.parse(s.OESLORDERPRICE)))?0:parseFloat(JSON.parse(s.OESLORDERPRICE)),this.SelMPPrice=pe.toFixed(j),this.isMPPriceOnFocus=!0)),this.PageSource==n.gT.C_V_ORDERBOOK_PAGENO.toString()){if(this.fn_DisableFieldsForModify(),this.bShowChangeScrip=!1,this.ModifyFlag=!0,this.ExchangeOrderNo=JSON.parse(s.OEEXORNO),this.GatewayOrderNo=JSON.parse(s.OEGWORNO),this.ClientOrderNumber=JSON.parse(s.OECLORNO),this.OrderTime=JSON.parse(s.OEORDERTIME),this.SelDiscQty=void 0,this.SelDiscQty=JSON.parse(s.OEDISCQTY),this.SelOriginalOrderType=this.SelOrderTypes,this.LastPendingQty=JSON.parse(s.OELASTPENDINGQTY),this.LastTradedQty=JSON.parse(s.OELASTTRADEDQTY),this.SLOrderType=JSON.parse(s.OESLOrderType),this.IsFundShortFallRej=JSON.parse(null!=s.OEIsFundShortFallRej&&s.OEIsFundShortFallRej),1==this.IsFundShortFallRej&&(this.SelDiscQty=void 0,this.SelDiscQty=JSON.parse(s.OEDISCQTY)),(this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT)&&(this.hasPrice=!1),this.SelCOL=JSON.parse(s.OECOL)==n.gT.C_S_ON,(this.MarketSegmentId==n.gT.C_V_MCX_DERIVATIVES.toString()||this.MarketSegmentId==n.gT.C_V_MSX_CASH.toString()||this.MarketSegmentId==n.gT.C_V_MSX_FAO.toString())&&parseFloat(JSON.parse(s.OEProtPerc))>0&&(this.SelProdPer=parseFloat(JSON.parse(s.OEProtPerc))/100),this.MarketSegmentId==n.gT.C_V_OFS_IPO_BONDS.toString()&&((5==n.xB.User.OdinCategory||n.xB.User.NSEEQParticipantID.length>0)&&(this.SelMargin=JSON.parse(s.OEOFSMargin)),this.TempPrice=this.SelPrice,this.TempQty=JSON.parse(s.OEQTY)),this.SelProduct==n.gT.C_S_PRODUCTTYPE_MP_TEXT){if(this.SelOrderTypes=JSON.parse(s.OEORDERTYPE),"2"==JSON.parse(s.OELEGINDICATOR)&&"RL"==JSON.parse(s.OESLOrderType))this.hasPrice=this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT,this.SelMPOrderType=JSON.parse(s.OESLOrderType),this.SelMPOrderType==n.gT.C_S_ORDER_REGULARLOT_TEXT&&(this.hasMPOrderType=!1,this.hasMPTriggerPrice=!1),this.SelQty=this.LastPendingQty,this.hasQty=!1,this.hasDiscQty=!1,this.hasValidity=!1,this.hasOrderType=!1;else if(this.ModifyFlag){"1"!=JSON.parse(s.OELEGINDICATOR)||this.LastPendingQty!=JSON.parse(s.OEQTY)||this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_TEXT&&this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT?"1"==JSON.parse(s.OELEGINDICATOR)&&this.LastPendingQty!=JSON.parse(s.OEQTY)?(this.hasPrice=this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT,this.hasQty=!0,this.hasOrderType=!0,this.hasValidity=!0):(this.hasPrice=this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT,this.hasQty=!1,this.hasDiscQty=!1,this.hasOrderType=!1):(this.hasPrice=this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT,this.hasQty=!0,this.hasDiscQty=!0,this.hasValidity=!0,this.hasOrderType=!0),this.hasMPTriggerPrice=!0,this.hasMPPrice=!0;var j=n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1),Ie=isNaN(parseFloat(JSON.parse(s.OEPRICE)))?0:parseFloat(JSON.parse(s.OEPRICE));this.SelPrice=Ie.toFixed(j),Ie=isNaN(parseFloat(JSON.parse(s.OESLTRIGGERPRICE)))?0:parseFloat(JSON.parse(s.OESLTRIGGERPRICE)),this.SelMPTriggerPrice=Ie.toFixed(j),Ie=isNaN(parseFloat(JSON.parse(s.OESLORDERPRICE)))?0:parseFloat(JSON.parse(s.OESLORDERPRICE)),this.SelMPPrice=Ie.toFixed(j),this.SelQty=this.LastPendingQty,"2"==JSON.parse(s.OELEGINDICATOR)&&(this.SelQty=this.LastPendingQty),this.SelOrderTypes=JSON.parse(s.OEORDERTYPE)}j=n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1),Ie=isNaN(parseFloat(JSON.parse(s.OEPRICE)))?0:parseFloat(JSON.parse(s.OEPRICE)),this.SelPrice=Ie.toFixed(j),Ie=isNaN(parseFloat(JSON.parse(s.OESLORDERPRICE)))?0:parseFloat(JSON.parse(s.OESLORDERPRICE)),this.SelMPPrice=Ie.toFixed(j),this.LegIndicator=JSON.parse(s.OELEGINDICATOR),this.SelOperation=this.SelBuySell==n.gT.C_S_ORDER_BUY_TEXT?n.gT.C_S_ORDER_BUY_TEXT:n.gT.C_S_ORDER_SELL_TEXT,this.onSelOperationChange()}if(this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT){var pe;this.hasMPOrderType=!1,this.hasQty=!1,this.hasDiscQty=!1,this.hasValidity=!1,this.hasOrderType=!1,this.hasPrice=!1,this.hasMPPrice
1=!1,this.hasMPTriggerPrice=!1,this.hasProfitOrderPrice=!1,this.hasTrailingSL=!1,this.SelDiscQty=void 0,j=n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1),JSON.parse(s.OESLOrderType)==n.gT.C_V_ORDER_STOPLOSS&&(pe=isNaN(parseFloat(JSON.parse(s.OESLORDERPRICE)))?0:parseFloat(JSON.parse(s.OESLORDERPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelMPPrice=parseFloat(pe).toFixed(j)),pe=isNaN(parseFloat(JSON.parse(s.OESLTRIGGERPRICE)))?0:parseFloat(JSON.parse(s.OESLTRIGGERPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelMPTriggerPrice=pe,pe=isNaN(parseFloat(JSON.parse(s.OEPROFITORDERPRICE)))?0:parseFloat(JSON.parse(s.OEPROFITORDERPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelProfitOrderPrice=parseFloat(pe).toFixed(j),this.BracketOrderId=JSON.parse(s.OEBRACKETORDERID),this.LegIndicator=JSON.parse(s.OELEGINDICATOR),this.BOGatewayOrderNo=JSON.parse(s.OEBOGATEWAYORDERNO);var Ve=parseInt(JSON.parse(s.OEBRACKETORDERMODIFYBIT));this.isMPPriceOnFocus=!0,this.isProfitOrderPriceOnFocus=!0;var He=!1,it=!1,ce=!1;(Ve&n.gT.C_V_BRACKET_ORDER_MODIFY_LEG1_MASKBIT)==n.gT.C_V_BRACKET_ORDER_MODIFY_LEG1_MASKBIT&&(He=!0,it=!0,ce=!0),(Ve&n.gT.C_V_BRACKET_ORDER_MODIFY_LEG2_MASKBIT)==n.gT.C_V_BRACKET_ORDER_MODIFY_LEG2_MASKBIT&&(it=!0),(Ve&n.gT.C_V_BRACKET_ORDER_MODIFY_LEG3_MASKBIT)==n.gT.C_V_BRACKET_ORDER_MODIFY_LEG3_MASKBIT&&(ce=!0),it&&(this.hasMPPrice=!0,this.hasMPTriggerPrice=!0,this.isMPPriceOnFocus=!0,this.hasProfitOrderPrice=!0,this.isProfitOrderPriceOnFocus=!0,(pe=isNaN(parseFloat(JSON.parse(s.OESLJUMPPRICE)))?0:parseFloat(JSON.parse(s.OESLJUMPPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)))>0&&(this.SelTrailingSL=!0,this.SelSLJumpPrice=parseFloat(pe).toFixed(j),this.hasSLJumpPrice=!0,n.xB.User.IsJumpBothLTPAndTrigPrice&&(pe=isNaN(parseFloat(JSON.parse(s.OELTPJUMPPRICE)))?0:parseFloat(JSON.parse(s.OELTPJUMPPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelLTPJumpPrice=parseFloat(pe).toFixed(j),this.hasLTPJumpPrice=!0)),this.hasSLJumpPrice&&(this.hasTrailingSL=!0)),ce&&(this.hasProfitOrderPrice=!0,this.isProfitOrderPriceOnFocus=!0),He?(this.hasQty=!0,this.hasPrice=!0,this.isPriceOnFocus=!0):this.hasProdPer=!1,this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&"0"!=JSON.parse(s.OEQTY)&&(this.hasPrice=!0,this.hasOrderType=!0),this.SelTriggerPrice=void 0,this.hasTriggerPrice=!1,this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&parseInt(this.LastPendingQty)>0&&(Ve&n.gT.C_V_BRACKET_ORDER_MODIFY_LEG2_MASKBIT)==n.gT.C_V_BRACKET_ORDER_MODIFY_LEG2_MASKBIT&&(Ve&n.gT.C_V_BRACKET_ORDER_MODIFY_LEG3_MASKBIT)==n.gT.C_V_BRACKET_ORDER_MODIFY_LEG3_MASKBIT&&(this.SelQty=this.LastPendingQty,He&&(this.hasQty=!0,this.hasPrice=!0)),"9"==JSON.parse(s.OELEGINDICATOR)&&this.LastPendingQty>0?(this.hasPrice=!0,this.hasQty=!0):"9"!=JSON.parse(s.OELEGINDICATOR)&&(this.hasPrice=!1,this.hasQty=!1)}this.SelInstrument==n.gT.C_S_INSTRUMENT_NCDEXCOMDTY_TEXT&&(this.hasOrderType=!1,this.SelDiscQty=void 0,this.SelTriggerPrice=void 0),0==parseFloat(this.SelPrice)&&"RL"==this.SelOrderTypes&&(this.SelCutOff=!0)}(this.PageSource==n.gT.C_V_GTDORDERBOOK_PAGENO.toString()||this.PageSource==n.gT.C_V_STOCKVIEW_PAGENO.toString()||this.PageSource==n.gT.C_V_NETPOSITION_PAGENO.toString())&&this.fn_DisableFieldsForModify(),(this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString()||this.PageSource==n.gT.C_V_RECOMMENDATION_PAGE.toString())&&(this.fn_DisableFieldsForMW(),this.PageSource==n.gT.C_V_RECOMMENDATION_PAGE.toString()&&(this.bShowChangeScrip=!1,this.RecommendationId=JSON.parse(s.OERECOID),parseFloat(JSON.parse(s.OERECOSQPRICE))>0&&this.ArrProductTypes.Contains(n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT)?(this.SelProduct=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT,this.SelMPTriggerPrice=parseFloat(JSON.parse(s.OERECOSLPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.activeTabIndex=this.SetA
1ctiveTabIndexForDefaultProduct(this.SelProduct),this.onSelProductChange(""),this.SelProfitOrderPrice=parseFloat(JSON.parse(s.OERECOSQPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.SelMPPrice=parseFloat(JSON.parse(s.OERECOSLPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1))):parseFloat(JSON.parse(s.OERECOSLPRICE))>0&&this.ArrProductTypes.Contains(n.gT.C_S_PRODUCTTYPE_MP_TEXT)&&(this.SelProduct=n.gT.C_S_PRODUCTTYPE_MP_TEXT,this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(this.SelProduct),this.SelMPTriggerPrice=parseFloat(JSON.parse(s.OERECOSLPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.onSelProductChange(""),this.SelMPPrice=parseFloat(JSON.parse(s.OERECOSLPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1))))),this.PageSource==n.gT.C_V_BULKORDERENTRY_PAGE.toString()&&this.SelDiscQty(JSON.parse(s.OEDISCQTY)),this.SelInstrument.startsWith("AUC")&&(this.SetAuctionFields(),this.fn_DisableFieldsForMW(),this.SelInstrument==n.gT.C_S_INSTRUMENT_AUCBI_TEXT?(this.SelBuySell=n.gT.C_S_ORDER_SELL_TEXT,this.hasBuySell=!1):this.SelInstrument==n.gT.C_S_INSTRUMENT_AUCSO_TEXT&&(this.SelBuySell=n.gT.C_S_ORDER_BUY_TEXT,this.hasBuySell=!1)),this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString()?null==r&&this.getScripDetails():this.getScripDetails(),this.IsPopulatePrice=this.PageSource!=n.gT.C_V_NETPOSITION_PAGENO.toString(),this.CreateAndSendMultiTouchLineRequest(),this.getPivotPointData(d),this.objScrip=d}else this.Reset();if(this.bFormat=!1,this.PageSource==n.gT.C_V_BULKORDERENTRY_PAGE.toString()&&(this.ModifyFlag=!0,this.RowSequence=JSON.parse(s.OEORDERTIME),this.PageSource="MANUAL"),this.IsBulkOrderEntry?(this.hasCOL=!1,this.hasCOLEnabled=!1):(this.hasCOL=this.dcEnableDisableFields.hasCOL,this.hasCOLEnabled=this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.dcEnableDisableFields.hasCOLEnabled),this.PageSource==n.gT.C_V_STOCKVIEW_PAGENO.toString()){var Je="";this.SelProduct=Je=n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT,this.amoStatus=o.X.getAMOStatus(this.hasAMO,this.PageSource,this.MarketSegmentId,Je),this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(Je),this.onSelProductChange("")}""==this.SelProduct?(Je="",null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic&&n.xB.User.OrderPrefDic.count()>0&&(Je=n.xB.User.OrderPrefDic[this.MarketSegmentId].sDefaultProductType),this.ArrProductTypes.Contains(Je)?(this.SelProduct=Je,this.amoStatus=o.X.getAMOStatus(this.hasAMO,this.PageSource,this.MarketSegmentId,Je),this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(Je),this.onSelProductChange("")):this.ArrProductTypes.Count()>0&&(this.SelProduct=this.ArrProductTypes[0],this.amoStatus=o.X.getAMOStatus(this.hasAMO,this.PageSource,this.MarketSegmentId,Je),this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(Je),this.onSelProductChange(""))):this.amoStatus=JSON.parse(s.OEPRODUCTTYPE)?o.X.getAMOStatus(this.hasAMO,this.PageSource,this.MarketSegmentId,JSON.parse(s.OEPRODUCTTYPE)):o.X.getAMOStatus(this.hasAMO,this.PageSource,this.MarketSegmentId,this.SelProduct),this.SelProduct!=n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT&&this.allowedGTDProducts(),this.allowedGTTProducts(),this.PageSource==n.gT.C_V_GTDORDERBOOK_PAGENO.toString()&&(this.TargetPrice=parseFloat(JSON.parse(s.OETARGETPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.TargetTriggerPrice=parseFloat(JSON.parse(s.OETARGETTRIGGERPRICE)).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.TargetPrice>0&&this.TargetTriggerPrice>0&&(this.isOCOChecked=!0,this.isOCOEnabled=!0,this.OnOCOChecked(),this.hasOrderType=!1));const lt=JSON.parse(s.OEPriceIndicator);this.sBOPricePreference=""==lt||null==lt?n.xB.User.OrderPrefDic[this.MarketSegmentId].sBOPricePreference:lt,this.isMarginDisplayPreference=1==n.xB.User.GeneralPrefDetails[0].nShowMarginOnOE,this.isMarginDisplay=!(!this.isMarginDisplayPreference||"True"!=this.isMarginDisplayServer)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT,this.ModifyFlag&&(this.oldqty=JSON.parse(s.OEQTY),this.oldprice=this.SelPrice),this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT&&this.SelValidity==n.gT.C_S_VALUE_GTT&&(this.amoStatus.hasAMO=!1,this.amoStatus.isAMOEnabled=!1,this.amoStatus.isAMOChecked=!1)}SetAuctionFields(){try{this.hasExpire=!1,this.hasDiscQty=!1,this.SelValidity=n.gT.C_S_VALUE_EOS,this.onSelValidityChange(),this.hasValidity=!1,this.SelOrderTypes=this.ArrOrderTypes[0],this.hasOrderType=!1}catch(t){this.logService.WriteLog("Exception: "+t.message,"SetAuctionFields","orderentry.component.ts","")}}ConfirmOrder(){try{if(!this.IsConfirmDisabled){this.IsConfirmDisabled=!0,new h.Q;
1var r=n.xB.ExchManager.FillOrderRequest(this.dcOrderDetails,!1);this.CreateOrderScriptReq(r).subscribe(s=>{this.AfterValidateConfirmOrder(s)})}}catch(s){this.logService.WriteLog("Exception: "+s.message,"ConfirmOrder()","orderentry.component.ts","")}}AfterValidateConfirmOrder(t){try{if(t.ResponseStatus)if("1"==t.ResponseObject[0]){new h.Q;var I=n.xB.ExchManager.FillOrderRequest(this.dcOrderDetails,!0);const Ie=this.slicingRemQty>0?this.slicingMultiplier+1:this.slicingMultiplier;if(this.isSlicingRequired&&Ie>parseInt(n.xB.User.MaxOrdSlices)&&(I.Qty=this.MaxSingleTransactionQty*parseInt(n.xB.User.MaxOrdSlices)),I.EDISTransactionRefNo=this.eDISRequire&&this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE?this.eDISParams.eDISTxnRefNo:"",this.eDISRequire&&this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE){var M={Depository:n.xB.User.Depository,ISIN:this.eDISParams.ISIN,DPId:n.xB.User.BeneficiaryId.substring(0,n.xB.User.BeneficiaryId.indexOf("#")),TotalAvailableQuantity:this.eDISParams.TotalAvailableQty,ApprovedFree:this.eDISParams.ApprovedQuantity,RequestType:this.ModifyFlag?"Order Modify":"Order Entry",eDISReqId:this.eDISParams.eDISTxnRefNo,MktSegId:I.MarketSegID,Token:I.TokenNo,CliOrderNo:I.ClientOrderNumber,UserCode:n.xB.User.UserCode,ProductCode:n.gT.C_S_PRODUCTNAME_NETNET_HTML5_TABLET_SL,OrderQty:I.Qty,ProductType:I.ProductType};this.httpService.postData(n.xB.tradingAPIUrl,"InsertEDISReqResponse",M).subscribe(pe=>{})}if(this.pubsubService.publish("OEREQ",I),this.closeDialogRef(),this.dialogService.alert(this.sOrderAlert,"Order Entry").subscribe(()=>{this.pubsubService.publish("NPRFRSH",""),this.pubsubService.publish("OBRFRSH","")}),n.xB.dConfigMaster[n.gT.C_S_HTML5_Enable_AutoHold_KEY]==n.gT.C_S_AUTO_HOLD_ALLOWED){this.dcOrderDetails.add("PageSource",this.PageSource),this.dcOrderDetails.add("SLOrderType",I.SLOrderType),(""==I.CancelFlag||0==I.CancelFlag)&&!I.ModifyFlag&&(this.ClientRefNo=I.ClientOrderNumber),n.xB.User.LoginMode==n.gT.C_S_STREAMING_MODE?this.SubScribeMessages():n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE&&(I.ModifyFlag?this.GetFundTransferOEStatus("",I.GatewayOrderNo).subscribe(pe=>{this.ProcessAutoHoldOEData(pe)}):this.GetFundTransferOEStatus(this.ClientRefNo,"").subscribe(pe=>{this.ProcessAutoHoldOEData(pe)})),this.IsConfirmDisabled=!0;var U=isNaN(parseInt(n.xB.dConfigMaster[n.gT.C_S_HTML5_AUTOHOLD_SLEEP_INTERVAL_KEY]))?200:parseInt(n.xB.dConfigMaster[n.gT.C_S_HTML5_AUTOHOLD_SLEEP_INTERVAL_KEY]),q=isNaN(parseInt(n.xB.dConfigMaster[n.gT.HTML5_AUTOHOLD_DBPOLL_COUNT_KEY]))?10:parseInt(n.xB.dConfigMaster[n.gT.HTML5_AUTOHOLD_DBPOLL_COUNT_KEY]);n.xB.User.LoginMode==n.gT.C_S_STREAMING_MODE&&(this.CloseOELoaderTimer=setTimeout(()=>{},U*q))}n.xB.dConfigMaster[n.gT.C_S_HTML5_Enable_AutoHold_KEY]!=n.gT.C_S_AUTO_HOLD_ALLOWED&&setTimeout(()=>{this.Reset()},400),n.xB.dConfigMaster[n.gT.C_S_HTML5_Enable_AutoHold_KEY]!=n.gT.C_S_AUTO_HOLD_ALLOWED&&(this.dcOrderDetails=new n.aM,this.closeDialogRef(),this.PageSource="MANUAL",this.SelExchange=void 0,this.ArrExchange=n.xB.ExchManager.PopulateExchanges(n.gT.C_V_ORDERENTRY_PAGE),this.SelExchange=this.ArrExchange[0]),n.xB.dConfigMaster.CONST_SECONDLEVEL_AUTH_STATUS===n.gT.C_S_ON&&n.xB.User.IsTransLevel&&1==this.show2FA&&(this.show2FA=!1,this.showOEDiv=!0)}else this.dialogService.alert("Scrip details mismatch. Kindly try again","Order Entry");else this.dialogService.alert("Error occurred while placing order. Kindly retry","Order Entry")}catch(Ie){this.logService.WriteLog("Exception: "+Ie.message,"AfterValidateConfirmOrder()","orderentry.component.ts","")}finally{this.IsConfirmDisabled=n.xB.dConfigMaster[n.gT.C_S_HTML5_Enable_AutoHold_KEY]==n.gT.C_S_AUTO_HOLD_ALLOWED}}OrderCallback(){this.ConfirmOrder()}FillGTDDaysforEquitities(t){try{if(this.SelProduct==n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT&&this.SelValidity==n.gT.C_S_VALUE_EQUITY_GTD){this.hasGTDDay=!0;var r=new Date;this.SelDate=new Date(r.setDate(r.getDate()+parseInt(t))),this.SelDay=n.vV.CalculateDays(new Date,new Date(this.SelDate)),this.selDateDisplay=n.vV.formatDate(this.SelDate)}else this.SelDay="",this.hasGTDDay=!1;this.hasDay=!1}catch(s){this.logService.WriteLog("Exception: "+s.message,"FillGTDDaysforEquitities","orderentry.component.ts","")}}FillGTTDaysforEquitities(t){try{if(this.SelProduct!=n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT||this.SelValidity!=n.gT.C_S_VALUE_EQUITY_GTT)this.SelDay="",this.hasGTTDay=!1;else{this.hasGTTDay=!0;var r=new Date;this.SelDate=new Date(r.setDate(r.getDate()+parseInt(t))),this.SelDay=n.vV.CalculateDays(new Date,new Date(this.SelDate)),this.selDateDisplay=n.vV.formatDate(this.SelDate)}this.hasDay=!1}catch(s){this.logService.WriteLog("Exception: "+s.message,"FillGTTDaysforEquitities","orderentry.component.ts","")}}onDateChange(t){this.selDateDisplay=n.vV.formatDate(this.SelDate)}CreateOrderScriptReq(t){var r=parseInt(Math.round(parseFloat((t.StrikePrice*t.DecimalLocator).toString())).toString());return this.httpService.postData(n.xB.tradingAPIUrl,"ValidateOrderScript",{UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,MKtSegId:t.MarketSegID,ScripTkn:t.TokenNo,InstNm:t.Instrument,Symbol:t.Symbol,Series:t.Series,ExpDt:t.ExpDate,StrkPrc:r,OptType:t.OptionType,UCCClientID:"",UCCGroupID:""})}CreateScripSymbolsRequest(t){var r=new n.HT,s="";try{r.Append(n.gT.C_V_TAG_SI_TEMPLATEID+n.gT.C_S_NAMEVALUE_DELIMITER+n.xB.User.SITemplateId+n.gT.C_S_FIELD_DELIMITER),r.Append(n.gT.C_V_TAG_MKTSEGID+n.gT.C_S_NAMEVALUE_DELIMITER+this.MarketSegmentId+n.gT.C_S_FIELD_DELIMITER),r.Append(n.gT.C_V_TAG_INSTRUMENTID+n.gT.C_S_NAMEVALUE_DELIMITER+this.SelInstrument+n.gT.C_S_FIELD_DELIMITER),r.Append(n.gT.C_V_TAG_SYMBOL+n.gT.C_S_NAMEVALUE_DELIMITER+t),s=r.toString()}catch(d){this.logService.WriteLog("Exception: "+d.message,"CreateScripSymbolsRequest","orderentry.component.ts","")}return s}Load2FADiv(){}ShowHideAuthDiv(t){1==t?(this.show2FA=!0,this.showOEDiv=!1,this.Load2FADiv()):(this.show2FA=!1,this.ConfirmOrder())}ToggleLookup(t){}DestroyView(){this.tradingSharedService.sendTouchLineRequest(this.scripList,2),this.scripList=[],this.UnRegisterMWResponse(),this.UnSubscribeMessage(),this.UnRegisterOrdOnlineResponse()}RegisterMWResponse(){this.ArrSubTokens=[];var t=this.pubsubService.subscribe("MTLRES",(r,s)=>{this.zone.run(()=>{this.HandleMultiTouchResp(s)})});this.ArrSubTokens.push(t)}UnRegisterMWResponse(){for(var t=0;t<this.ArrSubTokens.length;t++)this.pubsubService.unsubscribe(this.ArrSubTokens[t]);this.ArrSubTokens=[]}UnSubscribeMessage(){for(var t=0;t<this.subTokens.length;t++)this.pubsubService.unsubscribe(this.subTokens[t]);this.subTokens=[]}HandleMultiTouchResp(t){try{if(this.MarketSegmentId==t.Scrip.MktSegId.toString()&&this.SelToken==t.Scrip.Token){var r=n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1);this.MPLTP=this.ScripLTP=""==t.LTP?0:parseFloat(t.LTP).toFixed(r),this.LTP=parseFloat(this.MPLTP),this.LTQ=""==t.LTQ?0:t.LTQ;var I,s=this.LTP,d=o.X.GetMappedMarketSegmentId(this.MarketSegmentId);o.X.IsCommodityExchange(d)?Number(t.Volume)>0&&""!=t.LTP&&(this.ScripNetChgInRs=t.NetChangeInRs,this.ScripPercChange=t.PercNetChange>0?"+"+t.PercNetChange+"%":t.PercNetChange+"%",this.ScripPercChange="("+this.ScripPercChange+")",this.isDataAvailable=!1):0!=Number(t.LTP)&&""!=t.LTP?(this.ScripNetChgInRs=t.NetChangeInRs,this.ScripPercChange=t.PercNetChange>0?"+"+t.PercNetChange+"%":t.PercNetChange+"%",this.ScripPercChange="("+this.ScripPercChange+")",this.isDataAvailable=!1):(this.ScripNetChgInRs=" ",this.ScripPercChange="",this.isDataAvailable=!0),this.NetChangeTrend=parseFloat(t.NetChangeInRs)<0?"left idx_dwn":parseFloat(t.NetChangeInRs)>0?"left idx_up":"left idx_nochg",this.ScripDPR=this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?"("+t.DPR+")":"",this.ScripMarketLot="(Lot Size= "+this.SelMarketLot+")",this.MPClosePrice=""==t.ClosePrice?0:parseFloat(t.ClosePrice),this.BuyPrice=""==t.BuyPrice?0:parseFloat(t.BuyPrice),this.SellPrice=""==t.SellPrice?0:parseFloat(t.SellPrice),this.LTPVal=parseFloat(this.MPLTP).toFixed(r),s>this.oldLTP?this.LTPTrend="left idx_up":s<this.oldLTP&&(this.LTPTrend="left idx_dwn"),0==this.oldLTP&&(0==parseFloat(t.NetChangeInRs)?this.LTPTrend="left idx_nochg":parseFloat(t.NetChangeInRs)>0?this.LTPTrend="left idx_up":parseFloat(t.NetChangeInRs)<0&&(this.LTPTrend="left idx_dwn")),this.oldLTP=this.LTP,""!=t.DPR&&(this.MPHighPr=t.DPR.split("-")[1],this.MPLowPr=t.DPR.split("-")[0],("-"==this.MPHighPr||""==this.MPHighPr)&&(this.MPHighPr=0),("-"==this.MPLowPr||""==this.MPLowPr)&&(this.MPLowPr=0)),this.MPHighPr=parseFloat(this.MPHighPr.toString()),this.MPLowPr=parseFloat(this.MPLowPr.toString()),this.IsPopulatePrice&&this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()&&this.PageSource!=n.gT.C_V_RECOMMENDATION_PAGE.toString()&&this.PageSource!=n.gT.C_V_GTDORDERBOOK_PAGENO.toString()&&(this.IsPopulatePrice=!1,"BUY"==this.SelOperation?(I=t.SellPrice,this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&(this.SelPrice=t.SellPrice.length>0?t.SellPrice:this.SelPrice,(this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString()||this.PageSource==n.gT.C_V_RECOMMENDATION_PAGE.toString()||this.PageSource=="MANUAL".toString())&&null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic&&n.xB.User.OrderPrefDic.count()>
10&&0!=n.xB.User.OrderPrefDic[this.MarketSegmentId].nPopulateQtyValue&&(this.SelQty=n.xB.ExchManager.SetPreferences(this.SelExchange,this.MarketSegmentId,this.SelMarketLot,this.SelSymbol,this.SelInstrument,this.SelSeries,this.SelExpire,this.SelOptionType,this.SelStrikePrice,t.LTP,t.ClosePrice,t.SellQty,t.BuyQty,this.SelOperation,n.xB.User.OrderPrefDic[this.MarketSegmentId].nPopulateQtyValue,this.PriceNumerator,this.PriceDenominator,this.GenNumerator,this.GenDenominator)))):(I=t.BuyPrice,this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&(this.SelPrice=t.BuyPrice.length>0?t.BuyPrice:this.SelPrice,(this.PageSource==n.gT.C_V_MARKETWATCH_PAGENO.toString()||this.PageSource==n.gT.C_V_BESTFIVE_PAGENO.toString()||this.PageSource==n.gT.C_V_RECOMMENDATION_PAGE.toString()||this.PageSource=="MANUAL".toString())&&null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic&&n.xB.User.OrderPrefDic.count()>0&&0!=n.xB.User.OrderPrefDic[this.MarketSegmentId].nPopulateQtyValue&&(this.SelQty=n.xB.ExchManager.SetPreferences(this.SelExchange,this.MarketSegmentId,this.SelMarketLot,this.SelSymbol,this.SelInstrument,this.SelSeries,this.SelExpire,this.SelOptionType,this.SelStrikePrice,t.LTP,t.ClosePrice,t.SellQty,t.BuyQty,this.SelOperation,n.xB.User.OrderPrefDic[this.MarketSegmentId].nPopulateQtyValue,this.PriceNumerator,this.PriceDenominator,this.GenNumerator,this.GenDenominator)))),I=isNaN(parseFloat(I))?0:parseFloat(I),this.isQtyOnFocus=!0,this.isPriceOnFocus=!0),this.IsComputeMPRange&&(this.IsComputeMPRange=!1),this.isMarginDisplay&&this.isfirstTime&&this.SelQty>0&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.isfirstTime=!1,o.X.IsCommodityExchange(this.MapMarketSegmentId)?null!=this.SelPrice&&(this.SelPrice>=0||this.SelPrice<=0)&&this.getMarginUtilization():this.SelPrice>0&&this.getMarginUtilization())}this.UnderlyingMktSegId==t.Scrip.MktSegId.toString()&&this.UnderlyingToken==t.Scrip.Token&&(this.IsComputeMPOptionParams&&(this.IsComputeMPOptionParams=!1,this.UnderlyingLTP=""==t.LTP?0:parseFloat(t.LTP),this.UnderlyingClosePrice=0,t.Scrip.MktSegId.toString()==n.gT.C_V_NSECOMM_SPOT&&(this.UnderlyingClosePrice=parseFloat(t.ClosePrice))),this.UnRegisterMWResponse())}catch(M){this.logService.WriteLog("Exception: "+M.message,"HandleMultiTouchResp","orderentry.component.ts","")}}CreateAndSendMultiTouchLineRequest(){try{null!==this.scripList&&this.scripList.length>0&&this.tradingSharedService.sendTouchLineRequest(this.scripList,2),this.scripList=[];var t=new he.A;t.MktSegId=parseInt(this.MarketSegmentId),t.Token=this.SelToken,t.MTM=0,null!=t.MktSegId&&""!=t.Token&&null!=t.Token&&(this.scripList.push(t),this.RegisterMWResponse(),this.tradingSharedService.sendTouchLineRequest(this.scripList,1))}catch(r){this.logService.WriteLog("Exception: "+r.message,"CreateAndSendMultiTouchLineRequest","orderentry.component.ts","")}}getPivotPointData(t){try{this.httpService.postData(n.xB.tradingAPIUrl,"GetPPDataForSpecifiedScrip",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:t.ScripDet.MktSegId,ScripTkn:t.ScripDet.Token}).subscribe(s=>{this.getPivotPointDataCompleted(s)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getPivotPointData()","orderentry.component.ts","")}}getPivotPointDataCompleted(t){try{if(1==t.ResponseStatus&&t.ResponseObject.Table.length>0){var r=t.ResponseObject.Table;null!=r&&(this.PrevDayOpen=r[0].PrevOpen,this.PrevDayHigh=r[0].PrevHigh,this.PrevDayLow=r[0].PrevLow,this.PrevDayClose=r[0].PrevClose,this.calculatePivotPoint())}}catch(s){this.logService.WriteLog("Exception: "+s.message,"getPivotPointDataCompleted()","orderentry.component.ts","")}}calculatePivotPoint(){this.SelectedPivotPointFormula=0!=n.xB.User.PivotPrefDetails.length&&null!=n.xB.User.PivotPrefDetails&&null!=n.xB.User.PivotPrefDetails?n.xB.User.PivotPrefDetails[0].sPivotPointFormula:this.arrPivotPointFormula[0],this.SelectedCalcMethod=0!=n.xB.User.PivotPrefDetails.length&&null!=n.xB.User.PivotPrefDetails&&null!=n.xB.User.PivotPrefDetails?n.xB.User.PivotPrefDetails[0].sCalculationMethod:this.arrCalcMethod[0],this.FBRatio1=0!=n.xB.User.PivotPrefDetails.length&&null!=n.xB.User.PivotPrefDetails&&null!=n.xB.User.PivotPrefDetails?n.xB.User.PivotPrefDetails[0].nRatio1:"0.0000",this.FBRatio2=0!=n.xB.User.PivotPrefDetails.length&&null!=n.xB.User.PivotPrefDetails&&null!=n.xB.User.PivotPrefDetails?n.xB.User.PivotPrefDetails[0].nRatio2:"0.0000",this.FBRatio3=0!=n.xB.User.PivotPrefDetails.length&&null!=n.xB.User.PivotPrefDetails&&null!=n.xB.User.PivotPrefDetails?n.xB.User.PivotPrefDetails[0].nRatio3:"0.0000",this.FBRatio4=0!=n.xB.User.PivotPrefDetails.length&&null!=n.xB.User.PivotPrefDetails&&null!=n.xB.User.PivotPrefDetails?n.xB.User.PivotPrefDetails[0].nRatio4:"0.0000",this.CalculationMethod=this.SelectedCalcMethod,this.PPFormula=this.SelectedPivotPointFormula,this.calculatePP()}calculatePP(){this.PivotPoint=o.X.calculatePP(this.PPFormula,this.PrevDayHigh,this.PrevDayLow,this.PrevDayClose,this.PrevDayOpen),this.Range=parseFloat(this.PrevDayHigh)-parseFloat(this.PrevDayLow);var t=o.X.calculateSupportResistance(this.CalculationMethod,this.PivotPoint,this.Range,this.PrevDayLow,this.PrevDayHigh,this.PrevDayClose,this.FBRatio4,this.FBRatio3,this.FBRatio2,this.FBRatio1);this.Resistance4=Number(t[2]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Resistance3=Number(t[3]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Resistance2=Number(t[4]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Resistance1=Number(t[5]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Support1=Number(t[6]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Support2=Number(t[7]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Support3=Number(t[8]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1)),this.Support4=Number(t[9]).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1))}ShowMore(){this.bShowMore?(this.ShowMoreBtnCaption="Show more",this.bShowMore=!1):(this.ShowMoreBtnCaption="Show less",this.bShowMore=!0),localStorage.setItem(this.ShowOEMarketDepth,String(this.bShowMore))}transformValue(t,r,s){this.current="",this.precision="QTY"==t||"DISCQTY"==t?0:"MKTPR"==t?2:n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1),"QTY"==t||"DISCQTY"==t?this.value=parseInt(r.value)>99999999?99999999:parseFloat(r.value):"MKTPR"==t?this.value=parseInt(r.value)>
1100?100:parseFloat(r.value):("PRICE"==t||"TP"==t||"MPPrice"==t||"MPTriggerPrice"==t||"SLJumpPrice"==t||"LTPJumpPrice"==t||"ProfitOrderPrice"==t)&&(this.value=parseFloat(r.value)>99999999?99999999:parseFloat(r.value));let d=Math.pow(10,this.precision),M=(isNaN(this.value)?parseFloat(this.current):this.value)*d/d;return 0==M||isNaN(M)?M=0:isNaN(M)&&(M=""),""==r.value?""!=M&&(this.current=M.toFixed(this.precision),r.value=M.toFixed(this.precision)):(this.current=M.toFixed(this.precision),r.value=M.toFixed(this.precision)),"QTY"==t&&(this.SelQty=r.value,this.onSelQtyUpdate()),"PRICE"==t&&(this.SelPrice=r.value),"DISCQTY"==t&&(this.SelDiscQty=r.value),("TPPRICE"==t||"TP"==t)&&(this.SelTriggerPrice=r.value),"MKTPR"==t&&(this.SelProdPer=r.value),"MPPrice"==t&&(this.SelMPPrice=r.value),"MPTriggerPrice"==t&&(this.SelMPTriggerPrice=r.value),"SLJumpPrice"==t&&(this.SelSLJumpPrice=r.value),"LTPJumpPrice"==t&&(this.SelLTPJumpPrice=r.value),"ProfitOrderPrice"==t&&(this.SelProfitOrderPrice=r.value),r.value}getMargin(t){let r=!1;this.isMarginDisplay&&!this.isfirstTime&&this.SelQty>0&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&"GTT"!=this.SelValidity?"PRICE"==t?this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT&&this.SelOrderTypes!=n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT&&(o.X.IsCommodityExchange(this.MapMarketSegmentId)?null!=this.SelPrice&&(this.SelPrice>=0||this.SelPrice<=0)?this.getMarginUtilization():r=!0:this.SelPrice>0?this.getMarginUtilization():r=!0):"TP"==t?o.X.IsCommodityExchange(this.MapMarketSegmentId)?null!=this.SelTriggerPrice&&(this.SelTriggerPrice>=0||this.SelTriggerPrice<=0)?this.getMarginUtilization():r=!0:this.SelTriggerPrice>0?this.getMarginUtilization():r=!0:o.X.IsCommodityExchange(this.MapMarketSegmentId)?null!=this.SelPrice&&(this.SelPrice>=0||this.SelPrice<=0)?this.getMarginUtilization():r=!0:this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT&&this.SelOrderTypes!=n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?this.SelPrice>0?this.getMarginUtilization():r=!0:this.getMarginUtilization():r=!0,r&&(this.ApproxMargin=parseFloat("0.00").toFixed(2),this.MarginShortfall=parseFloat("0.00").toFixed(2),this.SelValidity==n.gT.C_S_VALUE_GTT&&(this.AvailableMargin="NA",this.ApproxMargin="NA",this.MarginShortfall="NA"))}ChangeScrip(){this.bChangeScrip=!this.bChangeScrip}ShowAdvance(){this.bShowAdvance?(this.bShowAdvance=!1,this.AdvanceBtnCaption="Show advanced"):(this.bShowAdvance=!0,this.AdvanceBtnCaption="Hide advanced")}GoBack(){this.ShowConfirm=!1,this.OETitle="Order Entry",this.confirmOrder=!1,0==this.SelDiscQty&&(this.SelDiscQty="")}addScripCallBack(t){if(this.bIsCoverOrderValid=!0,n.xB.ExchManager.LoginAllowed[t.ScripDet.MktSegId]==n.gT.C_S_OFF||t.ScripDet.MktSegId==n.gT.C_V_MCX_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_NCDEX_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_NSEL_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_MSX_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_NSECOMM_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_BSECOMM_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_DGCX_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_BFX_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_NSX_SPOT.toString()||t.ScripDet.MktSegId==n.gT.C_V_BSECDX_SPOT.toString())this.Reset(),this.ShowSwitch=!1,this.dialogService.alert("You are currently not allowed to place order in this segment");else{this.SelExchange=t.ExchangeName,this.onSelExchangeChange(),this.SelInstrument=t.InstrumentName,this.onSelInstrumentChange();var r=new n.HT;r.Append(t.ScripDet.Token+n.gT.C_S_FIELD_DELIMITER+t.Symbol+n.gT.C_S_FIELD_DELIMITER+t.OptionType+n.gT.C_S_FIELD_DELIMITER+t.StrikePrice+n.gT.C_S_FIELD_DELIMITER),r.Append(t.ExpiryDate+n.gT.C_S_FIELD_DELIMITER+t.Series+n.gT.C_S_FIELD_DELIMITER+t.InstrumentName+n.gT.C_S_FIELD_DELIMITER+t.SecurityDesc+n.gT.C_S_FIELD_DELIMITER),r.Append(t.MarketLot+n.gT.C_S_FIELD_DELIMITER+t.PriceTick+n.gT.C_S_FIELD_DELIMITER+t.DecimalLocator+n.gT.C_S_FIELD_DELIMITER+t.ISIN+n.gT.C_S_FIELD_DELIMITER),r.Append(t.AssetToken+n.gT.C_S_FIELD_DELIMITER+t.SPOS+n.gT.C_S_FIELD_DELIMITER+t.IsGlobal+n.gT.C_S_FIELD_DELIMITER+t.Spread+n.gT.C_S_FIELD_DELIMITER),r.Append(t.FIILimit+n.gT.C_S_FIELD_DELIMITER+t.NRILimit+n.gT.C_S_FIELD_DELIMITER+t.POS+n.gT.C_S_FIELD_DELIMITER+t.FIIFlag+n.gT.C_S_FIELD_DELIMITER),r.Append(t.MarginTypeIndicator+n.gT.C_S_FIELD_DELIMITER+t.PriceNumerator+n.gT.C_S_FIELD_DELIMITER+t.PriceDenominator+n.gT.C_S_FIELD_DELIMITER+t.GenNumerator+n.gT.C_S_FIELD_DELIMITER),r.Append(t.GenDenominator+n.gT.C_S_FIELD_DELIMITER+t.IsAsset+n.gT.C_S_FIELD_DELIMITER+t.IntrinsicValue+n.gT.C_S_FIELD_DELIMITER+t.ExchangeName),this.IsPopulatePrice=!0,this.fn_FillScripDetails(r.toString()),this.get
1ScripDetails(),this.bChangeScrip=!1,this.ShowSwitch=this.MapMarketSegmentId==n.gT.C_V_MAPPED_NSE_CASH.toString()||this.MapMarketSegmentId==n.gT.C_V_MAPPED_BSE_CASH.toString(),null!=n.xB.User.OrderPrefDic&&null!=n.xB.User.OrderPrefDic&&n.xB.User.OrderPrefDic.count()>0&&(this.defaultProduct=n.xB.User.OrderPrefDic[this.MarketSegmentId].sDefaultProductType,this.SelProduct=this.ArrProductTypes.Contains(this.defaultProduct)?this.defaultProduct:this.ArrProductTypes[0],(this.SelProduct==n.gT.C_S_PRODUCTTYPE_MP_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT)&&(this.fn_OnProductTypeChange(),this.fn_CheckForMarginPlus()),this.activeTabIndex=this.SetActiveTabIndexForDefaultProduct(this.defaultProduct)),this.onSelOrderTypesChange(),this.oldLTP=0,this.getGSMBANSecurityInfo(),this.getOrderentryReco(),this.min=o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?"-9999999":"0",this.sBOPricePreference=n.xB.User.OrderPrefDic[this.MarketSegmentId].sBOPricePreference,this.MaxSingleTransactionQty=t.nMaxSingleTransactionQty?t.nMaxSingleTransactionQty:0}}closeLookup(t){setTimeout(()=>this.bChangeScrip=!1,300)}closeDialogRef(){this.closeDialog.emit(!0)}getScripDetails(){try{var t={RequireHeader:"0",UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:o.X.GetMappedMarketSegmentId(this.MarketSegmentId),ScripTkn:this.SelToken,pageSource:"T"};this.httpService.postData(n.xB.AnalyticUrl,"GetCMOTSScripDetails",t).subscribe(r=>{this.sendScripDetailRequest(r)})}catch(r){this.logService.WriteLog("scripInfo.component.ts","getScripDetails()",r.message)}}sendScripDetailRequest(t){try{if(t.ResponseStatus){this.scripInfo1=new m.u,this.scripInfo2=new m.u,this.scripDetail=new m.u,this.ArrScripMaster=t.ResponseObject;var I,M,U,r=[],s=[];null!=this.ArrScripMaster.Table1&&this.ArrScripMaster.Table1.length>0&&(I=this.ArrScripMaster.Table1[0].nCoCode,M=this.ArrScripMaster.Table1[0].sSector,U=this.ArrScripMaster.Table1[0].nFOExists,null!=(r=this.ArrScripMaster.Table1[0])&&null!=r&&(this.scripInfo1=this.parseScripResponse(r),this.scripInfo1.cmotsCode=I,this.scripInfo1.sectorName=M,this.scripInfo1.isFOExists=U,this.scripDetail=this.scripInfo1,this.deriMapMktSegId=o.X.getDerivativesMktSegId(this.scripDetail.ScripDet.MapMktSegId))),null!=this.ArrScripMaster.Table2&&this.ArrScripMaster.Table2.length>0&&null!=(s=this.ArrScripMaster.Table2[0])&&null!=s&&(n.xB.ExchManager.LoginAllowed[o.X.GetMarketSegmentID(s.nMarketSegmentId)]==n.gT.C_S_OFF?this.scripInfo2=new m.u:(this.scripInfo2=this.parseScripResponse(s),this.scripInfo2.cmotsCode=I,this.scripInfo2.sectorName=M,this.scripInfo2.isFOExists=U)),null!=this.ArrScripMaster.Table4&&this.ArrScripMaster.Table4.length>0&&(this.MaxSingleTransactionQty=this.ArrScripMaster.Table4[0].nMaxSingleTransactionQty?this.ArrScripMaster.Table4[0].nMaxSingleTransactionQty:0)}}catch(q){this.logService.WriteLog("orderentry.component.ts","sendScripDetailRequest()",q.message)}}parseScripResponse(t){var r=new m.u;return r.ScripDet.MktSegId=o.X.GetMarketSegmentID(t.nMarketSegmentId),r.ScripDet.Token=t.nToken,r.AssetToken=t.nAssetToken,r.Symbol=t.sSymbol,r.Series=t.sSeries,r.DecimalLocator=t.DecimalLocator,r.InstrumentName=t.sInstrumentName,r.ExchangeName=o.X.GetExchangeName(r.ScripDet.MktSegId),r.ExpiryDate=t.nExpiryDate1,r.OptionType=t.sOptionType,r.StrikePrice=t.nStrikePrice,r.PriceTick=t.nPriceTick,r.MWSecurityDesc=o.X.FormatScripDescForMW(r),r.IsGlobal=t.sGlobalNormalFlag,r.ISIN=t.sISINCode,r.SPOS=t.nSPOS,r.POS=t.nPOS,r.Spread=t.nSpread,r.FIILimit=t.nFIILimit,r.NRILimit=t.nNRILimit,r.MarketLot=t.nRegularLot,r.FIIFlag=t.nFIIFlag,r.MarginTypeIndicator=t.nMarginTypeIndicator,r.PriceNumerator=t.nPriceNum,r.PriceDenominator=t.nPriceDen,r.GenNumerator=t.nAVMBuyMargin,r.GenDenominator=t.nAVMSellMargin,r.IsAsset=t.nIsAsset,r.IntrinsicValue=t.nIntrinsicValue,r.IsIndex=t.nIsIndex,r.nScripInstrument=t.nScripInstrument,r.sSurvMeasureDescription=t.sSurvMeasureDescription,r}onSelExchChange(){"1"==this.selectedExchangeId?(this.scripDetail=this.scripInfo1,this.OEnseCSS="OEnseCSS",this.OEbseCSS="OEbsenull"):(this.scripDetail=this.scripInfo2,this.OEbseCSS="OEbseCSS",this.OEnseCSS="OEnsenull");var t=new h.Q(this.scripDetail);t.PageSource=n.gT.C_V_MARKETWATCH_PAGENO.toString(),t.BuySell=t.OrderSide=this.SelBuySell,t.SellPrice="",t.BuyPrice="",t.Price="",t.BuyQty=this.scripDetail.MarketLot,t.SellQty=this.scripDetail.MarketLot,this.PopulateOE(t,"SWITCH"),this.allowedGTDProducts(),this.allowedGTTProducts(),this.deriMapMktSegId=o.X.getDerivativesMktSegId(this.scripDetail.ScripDet.MapMktSegId)}isSLJumpPriceChange(){this.SelSLJumpPrice=isNaN(parseFloat(this.SelSLJumpPrice))?0:parseFloat(this.SelSLJumpPrice).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1))}isLTPJumpPriceChange(){this.SelLTPJumpPrice=isNaN(parseFloat(this.SelLTPJumpPrice))?0:parseFloat(this.SelLTPJumpPrice).toFixed(n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1))}isProfitOrderPriceChange(){let t=2;t=this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&this.sBOPricePreference==n.gT.C_V_BO_PI_PRICE_PERCENT?2:n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1),this.SelProfitOrderPrice=isNaN(parseFloat(this.SelProfitOrderPrice))?0:parseFloat(this.SelProfitOrderPrice).toFixed(t)}getOrderentryReco(){if(null!=this.SelToken&&""!=this.SelToken){var t={UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:o.X.GetMappedMarketSegmentId(this.MarketSegmentId),ScripTkn:this.SelToken};this.httpService.postData(n.xB.tradingAPIUrl,"GetScripWiseResearchCall",t).subscribe(r=>{this.getOrderentyRecoResponse(r)})}}getOrderentyRecoResponse(t){var r=t.ResponseObject;if(null!=r.Table&&r.Table.length>0){this.ArrResearchCall=r.Table;for(let s=0;s<this.ArrResearchCall.length;s++)this.BuySell=this.ArrResearchCall[0].nBuySell,this.BuySell=2==this.BuySell?"Sell":"Buy"}else this.BuySell="--"}onkeyup(t,r){if(this.precision="QTY"==t||"DISCQTY"==t?0:n.xB.ExchManager.ReturnPrecisionForPrice(this.MarketSegmentId,this.SelDecimalloc.toString().length-1),0==this.precision)r.target.value.toString().indexOf(".")>0?r.target.value=r.target.value.substring(r.target.value.toString().indexOf("."),0):r.target.value.length<=8||(r.target.value=r.target.value.substring(0,r.target.value.length-1));else{if(o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT)var s=/^[+-]?[0-9]{0,9}(?:\.[0-9]{0,9})?$/;else s=/^[0-9]+\.?[0-9]*$/;s.test(r.target.value)?8==r.target.value.toString().indexOf(".")?r.target.value.toString().indexOf(".")>0&&r.target.value.toString().length-1-r.target.value.toString().indexOf(".")>this.precision&&(r.target.value=r.target.value.substring(0,r.target.value.length-1)):r.target.value.toString().indexOf(".")>0?r.target.value.toString().length-1-r.target.value.toString().indexOf(".")>this.precision?r.target.value=r.target.value.substring(0,r.target.value.length-1):r.target.value.length<=8+this.precision+1||(r.target.value=r.target.value.replace(r.key,"")):r.target.value.length<=8||(r.target.value=r.target.value.substring(0,r.target.value.length-1)):r.target.value=r.target.value.substring(0,r.target.value.length-1)}("MPP"==t||"TP"==t||"POPrice"==t)&&this.sBOPricePreference==n.gT.C_V_BO_PI_PRICE_PERCENT&&r.target.value<.01&&r.target.value.length>4&&(r.target.value=.01)}checkForEDISFlag(){let t=!1;try{const r=!!n.xB.User.POAStatus&&n.xB.User.POAStatus;t=!(n.xB.User.DPAutoHold==n.gT.C_S_ON||r||this.SelOperation!=n.gT.C_S_ORDER_SELL_TEXT||""==n.xB.User.Depository||!(this.SelProduct==n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_AMO_DELIVERY_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_MTF_TEXT&&n.xB.User.EDISForMTF)),t&&this.ModifyFlag&&parseInt(this.LastPendingQty)>=parseInt(this.SelQty)&&(t=!1)}catch(r){this.logService.WriteLog("orderentry.component.ts","checkForEDISFlag()",r.message)}return t}multiscripRequestSubscription(){return new Promise((t,r)=>{try{let s;if(s=this.tradingSharedService.GetProductTypeForEDIS(this.SelProduct),this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE&&(n.xB.User.Depository==n.gT.C_S_EDIS_MODE_CDSL||n.xB.User.Depository==n.gT.C_S_EDIS_MODE_NSDL&&""!=n.xB.dConfigMaster.EDIS_NSDL_MULTI_ISIN_SERVICE_URL.toString())){this.menumangerService.invokeMenu(n.gT.C_S_MENU_EDIS,{type:n.xB.User.Depository==n.gT.C_S_EDIS_MODE_CDSL?n.gT.C_S_POPUP_EDIS_CDSL:n.gT.C_S_POPUP_EDIS_NSDL,eDISDetail
1s:{ISIN:this.eDISParams.ISIN,HoldQty:this.ModifyFlag?parseInt(this.SelQty)-parseInt(this.LastPendingQty):this.SelQty,mktsegid:this.MarketSegmentId,SecurityDesc:this.eDISParams.SecurityDesc,ProductType:s,Token:this.SelToken,SettlementCycle:this.settlmtCycle}});const I=this.pubsubService.subscribe("EDISOnlineRes",(M,U)=>{this.timer=setTimeout(()=>{this.zone.run(()=>{t(U)})},1e3)});this.subTokens.push(I)}else t(null)}catch(s){r()}})}checkforEDIS(){return new Promise((t,r)=>{try{this.checkForEDISFlag()?this.checkInterop().then(s=>{let I,d="";d=s?s.MarketSegmentId:this.MarketSegmentId,I=this.tradingSharedService.GetProductTypeForEDIS(this.SelProduct),this.tradingSharedService.FetchEDISQuantityDetails(d,this.SelToken,I).then(M=>{if(M.ResponseStatus){this.settlmtCycle=M.ResponseObject.Table.length>0?M.ResponseObject.Table[0].nSettlementType:0;var U;U=this.tradingSharedService.GetProductTypeForEDIS(this.SelProduct)==n.gT.C_S_PRODUCTTYPE_MTF_VALUE?this.SelQty:this.ModifyFlag?parseInt(this.SelQty)-parseInt(this.LastPendingQty):this.SelQty;var q=o.X.checkForEdisMode(U,M.ResponseObject,d,this.amoStatus.isAMOChecked);this.sErrorMsg=q.sErrorMsg,this.sErrorMsg.length>0&&(this.sErrorMsg=q.sErrorMsg,r());let Ie=M.ResponseObject.Table[0]?M.ResponseObject.Table[0].TotalFreeQty:0;if(this.tradingSharedService.GetProductTypeForEDIS(this.SelProduct)==n.gT.C_S_PRODUCTTYPE_MTF_VALUE&&this.SelQty>Ie)this.sErrorMsg="Free Quantity is not available",r();else{if(this.eDISMode=q.eDISMode,this.eDISMode==n.gT.C_S_EDIS_MODE_ONLINE){this.eDISRequire=!0;let Ve=0;Ve=this.amoStatus.isAMOChecked?this.SelQty:Math.abs(this.SelQty-M.ResponseObject.Table[0].eDISCheckQty),this.eDISParams={ISIN:M.ResponseObject.Table[0].sISINCode,SecurityDesc:M.ResponseObject.Table[0].sSecurityDesc,eDISQty:Ve,isAMOChecked:this.amoStatus.isAMOChecked}}t(null)}}else r()},M=>{r()})}):(this.eDISRequire=!1,t(null))}catch(s){r()}})}checkInterop(){return new Promise((t,r)=>{try{this.tradingSharedService.getInteropConfiguration().subscribe(s=>{let d="";s?(d=s.isInteropAllowed&&s.arrInteropConfig.some(I=>I.nCombinedSegmentId==n.gT.C_V_COMBINED_CASH)?n.gT.C_V_COMBINED_CASH.toString():this.MarketSegmentId,t({MarketSegmentId:d,SelToken:this.SelToken})):r()})}catch(s){r(s)}})}dragEnd(t){this.dialogService.dragEnd(t)}getMarginUtilization(){try{this.isMarginBtnEnable=!1;var r={UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",NoOfLegs:1,Mode:0==this.ModifyFlag?"N":"M",FETraceId:n.vV.generateTraceNo(),LegDetails:this.fn_LegDetailsObject(1)};this.httpService.postData(n.xB.tradingAPIUrl,"GetOrderMarginInfo",r).subscribe(d=>{if(1==d.ResponseStatus&&null!=d.ResponseObject&&null!=d.ResponseObject){this.AvailableMargin=d.ResponseObject.AvailableMargin?d.ResponseObject.AvailableMargin:"0.00";let I=d.ResponseObject.ApproxMargin?d.ResponseObject.ApproxMargin:"0.00";this.ApproxMargin=parseFloat(I)>0?I:"0.00";let M=d.ResponseObject.ShortFall?d.ResponseObject.ShortFall:"0.00";this.MarginShortfall=parseFloat(M)>0?M:"0.00",this.isMarginBtnEnable=!0,this.brokerageCost=d.ResponseObject.Brokerage?parseFloat(d.ResponseObject.Brokerage):0,this.SelValidity==n.gT.C_S_VALUE_GTT&&(this.AvailableMargin="NA",this.ApproxMargin="NA",this.MarginShortfall="NA",this.isMarginBtnEnable=!1)}else this.SelValidity==n.gT.C_S_VALUE_GTT?(this.AvailableMargin="NA",this.ApproxMargin="NA",this.MarginShortfall="NA",this.isMarginBtnEnable=!1):(this.AvailableMargin=parseFloat("0.00").toFixed(2),this.ApproxMargin=parseFloat("0.00").toFixed(2),this.MarginShortfall=parseFloat("0.00").toFixed(2),this.isMarginBtnEnable=!0)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getMarginUtilization()","orderentry.component.ts","")}}calcBOActualPrices(){try{if(this.SelProduct==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&(this.sBOPricePreference==n.gT.C_V_BO_PI_PRICE_PERCENT||this.sBOPricePreference==n.gT.C_V_BO_PI_PRICE_DIFFERENCE)){parseFloat(this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?this.ScripLTP:this.SelPrice);const r=parseFloat(this.SelMPPrice),s=parseFloat(this.SelMPTriggerPrice),d=parseFloat(this.SelProfitOrderPrice);
1this.calcSLPrice=r,this.calcSLTriggerPrice=s,this.calcPriceOrderPrice=d}}catch(t){this.logService.WriteLog("orderentry.component.ts","calcBOActualPrices()",t.message)}}fn_LegDetailsObject(t){try{for(var r=[],s=1;s<=t;s++){let M,U,q,j,Ie;if(1==s&&(M=this.SelBuySell===n.gT.C_S_ORDER_BUY_TEXT?1:2),1==s){var d=!1;if(o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(""==this.SelPrice&&this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT)&&(d=!0):(0==this.SelPrice&&this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT)&&(d=!0),d){let pe=this.getmarketorderprice();U=""==pe||null==pe||isNaN(pe)||"NaN"==pe||null==pe?0:parseInt((parseFloat(pe)*parseFloat(this.SelDecimalloc.toString())).toFixed(2))}else U=""!=this.SelPrice&&null!=this.SelPrice&&"NaN"!=this.SelPrice?parseInt((parseFloat(this.SelPrice)*parseFloat(this.SelDecimalloc.toString())).toFixed(2)):0;q=1==d?1:0,j=this.ModifyFlag&&null!=this.oldprice&&null!=this.oldprice?parseInt((parseFloat(this.oldprice.toString())*parseFloat(this.SelDecimalloc.toString())).toFixed(2)):0}Ie=0;var I={LegNo:s,BuyOrSell:M,MarketSegmentId:this.MarketSegmentId,Token:this.SelToken,Quantity:""!=this.SelQty&&null!=this.SelQty?this.SelQty:0,Price:U,MktFlag:q,OldQuantity:null!=this.oldqty&&null!=this.oldqty?this.oldqty:0,OldPrice:j,ProductType:o.X.GetProductTypeValue(this.SelProduct),LegIndicator:Ie,UserID:n.xB.User.UserId};r.push(I)}return r}catch(M){this.logService.WriteLog("Exception: "+M.message,"fn_LegDetailsObject()","orderentry.component.ts","")}}getmarketorderprice(){if(o.X.IsCommodityExchange(this.MapMarketSegmentId)&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT)var t=!0;else t=!1;var r=n.xB.ExchManager.GetOrderType(this.SelOrderTypes,this.SelPrice,this.SelInstrument,this.SelProduct,this.SelMPMFFlag,this.IsSpread,t);return n.xB.ExchManager.DerivePriceforMarketOrder(this.SelOperation,r,this.SelTriggerPrice,this.SelPriceTick,this.SelDecimalloc.toString(),this.SelProdPer,this.BuyPrice.toString(),this.SellPrice.toString(),this.MPLTP.toString(),this.MPClosePrice.toString(),this.MPLowPr.toString(),this.MPHighPr.toString(),t)}Refresh(){let t=!1;this.isMarginDisplay&&!this.isfirstTime&&this.SelQty>0&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT&&this.SelOrderTypes!=n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?o.X.IsCommodityExchange(this.MapMarketSegmentId)?""!=this.SelPrice&&null!=this.SelPrice&&(this.SelPrice>=0||this.SelPrice<=0)||""!=this.SelTriggerPrice&&null!=this.SelTriggerPrice&&(this.SelTriggerPrice>=0||this.SelTriggerPrice<=0)?this.getMarginUtilization():t=!0:this.SelPrice>0?this.getMarginUtilization():t=!0:this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?0==this.SelPrice?this.getMarginUtilization():t=!0:this.SelPrice>0?this.getMarginUtilization():t=!0:t=!0,t&&(this.ApproxMargin=parseFloat("0.00").toFixed(2),this.MarginShortfall=parseFloat("0.00").toFixed(2)),this.SelValidity==n.gT.C_S_VALUE_GTT&&(this.AvailableMargin="NA",this.ApproxMargin="NA",this.MarginShortfall="NA")}SubScribeMessages(){if(0==this.ArrOrdSubTokens.length){if(n.xB.User.LoginMode==n.gT.C_S_STREAMING_MODE){var t=this.pubsubService.subscribe("OLRES",(s,d)=>{this.zone.run(()=>{this.ReceiveOrdOnlineResponse(d)})});this.ArrOrdSubTokens.push(t)}t=this.pubsubService.subscribe("FundTransferRes",(r,s)=>{this.zone.run(()=>{this.FundTransferOECallBack(s)})}),this.ArrOrdSubTokens.push(t)}}ReceiveOrdOnlineResponse(t){if(null!=t)if(n.xB.tempPGOrdRes=!0,(this.dcOrderDetails.ModifyFlag&&this.dcOrderDetails.GatewayOrderNo==t.GwOrdNo||this.ClientRefNo==t.ClientRefNo)&&t.MsgCode!=n.gT.C_V_MSGCODES_ORDER_ACKNOWLEDGEMENT){if((t.MsgCode==n.gT.C_V_MSGCODES_ORDER_RESPONSE||t.MsgCode==n.gT.C_V_MSGCODES_SLTRIGGER_RESPONSE||t.MsgCode==n.gT.C_V_MSGCODES_BRACKETORDER_ORDER_RESPONSE)&&t.ExGiveUpFlag&&null!=t.ShortFallAmt){var r={ResponseStatus:!0};r.ShortFallAmt=t.ShortFallAmt,n.xB.tempPGOrdRes=!1,this.ProcessAutoHoldOEData(r)}}else{let d=t.MsgData.includes(n.gT.C_S_FULLY_EXECUTED);this.dcOrderDetails.ModifyFlag&&d?this.closeDialogRef():setTimeout(()=>{n.xB.User.LoginMode==n.gT.C_S_STREAMING_MODE&&n.xB.dConfigMaster[n.gT.C_S_HTML5_Enable_AutoHold_KEY]==n.gT.C_S_AUTO_HOLD_ALLOWED&&n.xB.tempPGOrdRes&&n.xB.tempPGTranRes&&(n.xB.tempPGOrdRes=!1,this.dialogService.alert(this.sOrderAlert,"Order Entry"),this.closeDialogRef())},1e3)}}GetFundTransferOEStatus(t,r){return this.httpService.postData(n.xB.tradingAPIUrl,"GetAutoHoldParams",{UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,GatewayOrdNo:r,ClientOrdNo:t})}ProcessAutoHoldOEData(t){try{if(n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE&&this.SubScribeMessages(),t.ResponseStatus){this.IsFundShortFallRej=!0,n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE?this.SetFundShortFallAmt=t.ResponseObject:n.xB.User.LoginMode==n.gT.C_S_STREAMING_MODE&&(this.SetFundShortFallAmt=t.ShortFallAmt),this.dcOrderDetails.add("IsFundShortFallRej",this.IsFundShortFallRej),this.dcOrderDetails.add("SetFundShortFallAmt",this.SetFundShortFallAmt);var r={};r.params=this.dcOrderDetails,this.menumangerService.invokeMenu(n.gT.C_S_MENU_FUND_TRANSFER,r,"MD")}else n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE&&this.closeDialogRef()}catch(s){this.logService.WriteLog("Exception: "+s.message,"ProcessAutoHoldOEData","tr_OrderEntry.js","")}}UnRegisterOrdOnlineResponse(){if(null!=this.ArrOrdSubTokens&&this.ArrOrdSubTokens.length>0)for(var t=0;t<this.ArrOrdSubTokens.length;t++)this.pubsubService.unsubscribe(this.ArrOrdSubTokens[t]);this.ArrOrdSubTokens=[]}FundTransferOECallBack(t){new h.Q;var s=n.xB.ExchManager.FillOrderRequest(t);this.pubsubService.publish("OEREQ",s),this.dcOrderDetails.add("IsFundShortFallRej",this.IsFundShortFallRej),this.dcOrderDetails.add("SetFundShortFallAmt",this.SetFundShortFallAmt),""!=s.CancelFlag&&0==s.CancelFlag||s.ModifyFlag?n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE&&(s.ModifyFlag?this.GetFundTransferOEStatus("",s.GatewayOrderNo).subscribe(d=>{this.ProcessAutoHoldOEData(d)}):this.GetFundTransferOEStatus(this.ClientRefNo,"").subscribe(d=>{this.ProcessAutoHoldOEData(d)})):this.ClientRefNo=s.ClientOrderNumber,this.closeDialogRef()}showOrderCharges(){try{const s=this.sURLOrderRegCharges.split("?"),d=(n.xB.ExchManager.ExchInLOT.Contains(this.MarketSegmentId)?parseInt(this.SelMarketLot):1)*parseInt(this.SelQty),I=this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT||this.SelOrderTypes==n.gT.C_S_ORDER_STOPLOSS_MARKET_TEXT?this.getmarketorderprice():this.SelPrice;var t={product:"AERO",theme:"DARK"==n.xB.CurrentTheme.Id?"D":"L",userId:n.xB.User.UserId,groupId:n.xB.User.GroupId,MarketSegmentId:this.MapMarketSegmentId,series:this.hasSeries||""!=this.SelSeries?this.SelSeries:"XX",ProductType:this.SelProduct,TransactionType:"BUY"==this.SelBuySell?"1":"2",Quantity:d.toString(),price:I.toString(),brokerage:this.brokerageCost.toString(),legIndicator:"1",Instrument:this.SelInstrument,PriceLocator:this.calculateCVF().toString()};this.menumangerService.invokeMenu(n.gT.C_S_MENU_BROKERAGE_CHARGES,{url:s[0],formData:t,method:n.gT.C_S_HTTP_METHOD_POST})}catch(r){this.logService.WriteLog("Exception: "+r.message,"showOrderCharges()","orderentry.component.ts","")}}calculateCVF(){let t=1;try{switch(this.MarketSegmentId.toString()){case n.gT.C_V_MCX_DERIVATIVES.toString():case n.gT.C_V_MSX_DERIVATIVES.toString():case n.gT.C_V_NSX_DERIVATIVES.toString():case n.gT.C_V_BSECDX_DERIVATIVES.toString():case n.gT.C_V_NSEL_DERIVATIVES.toString():case n.gT.C_V_NSECOMM_DERIVATIVES.toString():case n.gT.C_V_ICEX_DERIVATIVES.toString():t=parseFloat(this.PriceNumerator.toString())/parseFloat(this.PriceDenominator.toString())*(parseFloat(this.GenNumerator.toString())/parseFloat(this.GenDenominator.toString()));break;case n.gT.C_V_NCDEX_DERIVATIVES.toString():t=parseFloat(this.PriceNumerator.toString())/parseFloat(this.PriceDenominator.toString());break;default:t=1}}catch(r){t=1}return t}checkForOrderSlicing(t){try{this.isSlicingRequired=!1;const r=n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_ORDERSLICING),s=n.xB.User.OrderPrefDic.containsKey(this.MarketSegmentId)&&n.xB.User.OrderPrefDic[this.MarketSegmentId].nEnableSlicing;if(r&&s&&!this.ModifyFlag&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&this.SelProduct!=n.gT.C_S_PRODUCTTYPE_MP_TEXT){const d=parseInt(this.MaxSingleTransactionQty.toString()),I=Math.abs(parseInt(t));if(I>d){this.isSlicingRequired=!0,this.slicingMultiplier=Math.floor(I/d),this.slicingRemQty=I%d;const M=this.slicingRemQty>0?this.slicingMultiplier+1:this.slicingMultiplier,U=parseInt(n.xB.User.MaxOrdSlices);if(U>0&&M>U){let q=n.xB.dMsgMaster.OE215?n.xB.dMsgMaster.OE215:'Total "{0}" orders will be placed. In each order maximum {1} Lots({2} Qty) is allowed.';q=q.replace("{0}",U),q=q.replace("{1}",d/parseInt(this.SelMarketLot)),q=q.replace("{2}",d),this.SliceQtyErrorMsg=`${q} <br /><br /></n><b class=Disc_OE_MaxOrdSlice>Disclaimer : Maximum `+U+" orders can be placed due to system configuration.</b>",this.SelQtyAfterMaxOrdSlices=U*d,this.MaxOrderSlices=U}else this.SliceQtyErrorMsg=""}}}catch(r){this.logService.WriteLog("Exception: "+r.message,"checkForOrderSlicing()","orderentry.component.ts","")}return this.isSlicingRequired}allowedGTTProducts(){try{var t=this.ArrValidity.indexOf(n.gT.C_S_VALUE_GTT);if(this.SelExchange!=n.gT.C_S_MCX_EXCHANGE_TEXT&&this.SelExchange!=n.gT.C_S_ICEX_EXCHANGE_TEXT&&this.SelExchange!=n.gT.C_S_NCDEX_EXCHANGE_TEXT)if(n.xB.dcGTTProductAllowed.containsKey(o.X.GetProductTypeValue(this.SelProduct))){this.strGTTallowexch=n.xB.dcGTTProductAllowed[o.X.GetProductTypeValue(this.SelProduct)].split("$");for(var r=0;r<this.strGTTallowexch.Count();r++)if(o.X.GetMarketSegmentID(this.strGTTallowexch[r])==this.MarketSegmentId){this.bAllowGTT=!0;break}t<0&&this.SelOrderTypes==n.gT.C_S_ORDER_REGULARLOT_TEXT&&this.bAllowGTT&&this.PageSource!=n.gT.C_V_ORDERBOOK_PAGENO.toString()?this.MarketSegmentId==n.gT.C_V_NSE_CASH.toString()?"BO"!=this.SelSeries&&this.ArrValidity.push(n.gT.C_S_VALUE_EQUITY_GTT):this.MarketSegmentId==n.gT.C_V_BSE_CASH.toString()?"T"!=this.SelSeries&&this.ArrValidity.push(n.gT.C_S_VALUE_EQUITY_GTT):this.ArrValidity.push(n.gT.C_S_VALUE_EQUITY_GTT):t>=0&&(this.SelOrderTypes!=n.gT.C_S_ORDER_REGULARLOT_TEXT||!this.bAllowGTT||this.PageSource==n.gT.C_V_ORDERBOOK_PAGENO.toString())&&
1(this.ArrValidity.splice(t,1),this.SelValidity=this.ArrValidity[0],this.isOCOChecked=!1,this.isOCOEnabled=!1)}else t>=0&&(this.ArrValidity.splice(t,1),this.SelValidity=this.ArrValidity[0]),this.isOCOChecked=!1,this.isOCOEnabled=!1;this.hasDay=!1,this.SelDay="",this.hasGTTDay=(this.SelProduct==n.gT.C_S_PRODUCTTYPE_DELIVERY_TEXT||this.SelProduct==n.gT.C_S_PRODUCTTYPE_CARRYFORWARD_TEXT)&&this.SelValidity==n.gT.C_S_VALUE_GTT}catch(d){this.logService.WriteLog("Exception: "+d.message,"allowedGTTProducts","orderentry.component.ts","")}}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(i._),e.\u0275\u0275directiveInject(n.RJ),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(P.F))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["orderentry"]],hostBindings:function(t,r){1&t&&e.\u0275\u0275listener("keydown",function(d){return r.onKeyDown(d)},!1,e.\u0275\u0275resolveDocument)},outputs:{closeDialog:"closeDialog"},decls:10,vars:6,consts:[[1,"OrderEntry_Parent",3,"ngClass"],["cdkDrag","","cdkDragRootElement",".cdk-overlay-pane","cdkDragHandle","",1,"OrderEntryTitle",2,"cursor","move",3,"cdkDragEnded"],["width","30",1,"closeimg",3,"click"],[4,"ngIf"],["id","dvConfirm","class","Place_Order_btn",4,"ngIf"],["class","disable-background",4,"ngIf"],["id","div2FA",4,"ngIf"],["class","ChangeScript OE",4,"ngIf"],["class","flt-left searchscrip",4,"ngIf"],[1,"stock_reco","flt-right"],[1,"text-center","martop-5"],[1,"mar-rt5","greylabel"],[3,"color",4,"ngIf"],[1,"OEBuySell"],[1,"p0",3,"ngModel","ngStyle","disabled","ngModelChange","change"],["group","matButtonToggleGroup"],["value","BUY",3,"ngClass"],["value","SELL",3,"ngClass"],[1,"OrderEntry_Tab_menu"],[1,"demo-tab-group",3,"selectedIndex","selectedIndexChange","selectedTabChange"],[3,"disabled",4,"ngFor","ngForOf"],["class","min-hght",4,"ngIf"],[1,"ChangeScript","OE"],[1,"OE_Trend"],[1,"OE_NSEBSE"],["class","p0",3,"ngModel","ngModelChange","change",4,"ngIf"],[1,"font-18","textColor"],[1,"font-13","textColor"],["class","Toggle Globallink",4,"ngIf"],[1,"p0",3,"ngModel","ngModelChange","change"],["value","1",3,"ngClass",4,"ngIf"],["value","2",3,"ngClass",4,"ngIf"],["value","1",3,"ngClass"],["value","2",3,"ngClass"],[1,"font-16",3,"className"],[1,"Toggle","Globallink"],[3,"ngStyle","disabled","click"],[1,"Globallink"],[1,"flt-left","searchscrip"],["headerVisibile","false",3,"isFocus","addScripCallBack","closeLookup"],[3,"disabled"],["mat-tab-label",""],[3,"className"],[1,"grid_oe"],[1,"OE_Mat_Fields"],["disableOptionCentering","true","name","Order_Type","id","Order_Type",3,"ngModel","disabled","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["id","_txtQty","type","number","min","0","max","99999999","matInput","","maxlength","8",3,"appAutofocus","autofocusDelay","step","ngModel","disabled","ngModelChange","blur","keyup","change"],["f",""],["align","end"],["id","_txtPrice","matInput","","type","number","max","9999999",3,"appAutofocus","autofocusDelay","step","min","ngModel","disabled","ngModelChange","blur","keyup"],["p",""],["colspan","2",1,"OEShowMore"],[3,"click"],["class","col-99 font-14 text-center p5",4,"ngIf"],["class","advanced",4,"ngIf"],[1,"advanced"],["class","stop-loss",4,"ngIf"],["class","text-center pb5",4,"ngIf"],[1,"Place_btn"],[1,"col-90","text-center"],["id","img3","class","imgMPDisclaimer","matTooltipClass","tooltipBg",3,"matTooltip",4,"ngIf"],["mat-raised-button","","type","submit",1,"marginR-15","OrderE_BtnTxt",3,"disabled","className","click"],["mat-raised-button","","type","reset",1,"btn","btn-primary","button-gray-round",3,"click"],["class","orderChargesLink",3,"disabled","click",4,"ngIf"],[1,"col-10"],[1,"right",3,"click"],["class","PVT",4,"ngIf"],[3,"value"],["id","_txtTriggerPrice","maxlength","10","type","number","max","9999999","matInput","",3,"step","min","ngModel","disabled","ngModelChange","blur","keyup","change"],["t",""],[1,"col-99","font-14","text-center","p5"],["id","Price"],["id","_txtTargetPrice","matInput","","type","number","max","9999999",1,"ordPrcPrefPH",3,"appAutofocus","autofocusDelay","step","min","ngModel","blur","keyup","ngModelChange"],["id","TriggerPrice",1,"float-left"],["id","_txtTargetTriggerPrice","matInput","","type","number","max","9999999",1,"ordPrcPrefPH",3,"appAutofocus","autofocusDelay","step","min","ngModel","blur","keyup","ngModelChange"],[1,"padd-top"],[1,"textColor","font-15"],[1,"greylabel"],[1,"float-left"],[1,"btn-ref","Global_Filter",3,"matTooltip","disabled","click"],[1,"refresh-text"],["id","_txtDiscQty","type","number","min","0","max","9999999","matInput","","maxlength","8",3,"step","ngModel","disabled","ngModelChange","blur","keyup"],["d",""],["disableOptionCentering","true","id","_ddlValidity",3,"ngModel","disabled","ngModelChange","selectionChange"],["class","lh60",4,"ngIf"],["class","flt-left",4,"ngIf"],["class","flt-left lh60",4,"ngIf"],["id","_txtDay","matInput","","type","number","min","0",3,"ngModel","disabled","step","ngModelChange"],["matInput","","placeholder","Date",3,"matDatepicker","ngModel","min","max","readonly","ngModelChange","dateChange"],["matSuffix","",3,"for"],["Datepicker",""],[1,"lh60"],[3,"ngClass","ngModel","disabled","ngModelChange"],["id","imgMPDisclaimer","matTooltipClass","tooltipBg",1,"imgMPDisclaimer",3,"matTooltip"],[1,"flt-left"],["id","_txtProt","type","number","matInput","","min","0","max","100",3,"ngModel","disabled","step","ngModelChange","blur"],["m",""],["matTooltipClass","tooltipBg",3,"matTooltip",4,"ngIf"],["matTooltipClass","tooltipBg",3,"matTooltip"],["id","imgMPDisclaimer",1,"imgMPDisclaimer"],[1,"flt-left","lh60"],[3,"ngModel","disabled","ngModelChange"],["id","imgMPDisclaimer","class","imgMPDisclaimer","matTooltipClass","tooltipBg",3,"matTooltip",4,"ngIf"],[3,"ngModel","ngModelChange"],["disableOptionCentering","true","id","_ddlMargin","matInput","",3,"ngModel","ngModelChange"],["onchange","OnOCOChecked()",3,"ngClass","ngModel","disabled","ngModelChange"],[1,"stop-loss"],["class","font-14 text-center brd-btm",4,"ngIf"],[1,"font-14","text-center","brd-btm"],["id","_txtPriceMP","maxlength","10","type","number","matInput","",1,"ordPrcPrefPH",3,"step","placeholder","ngModel","disabled","ngModelChange","blur","keyup"],["id","TriggerPrice"],["id","_txtTrigPriceMP","maxlength","10","type","number","matInput","",1,"ordPrcPrefPH",3,"ngModel","step","disabled","placeholder","ngModelChange","blur","keyup"],[3,"ngModel","disabled","ngModelChange","change"],["id","_txtSLJumpPrice","maxlength","10","type","number","matInput","",3,"ngModel","disabled","step","ngModelChange","blur","keyup"],["id","_txtLTPJumpPrice","maxlength","10","type","number","matInput","",3,"ngModel","disabled","step","ngModelChange","blur","keyup"],["id","_txtProfitOrderPrice","maxlength","10","type","number","matInput","",1,"ordPrcPrefPH",3,"disabled","placeholder","ngModel","step","ngModelChange","blur","keyup"],[1,"text-center","pb5"],[1,"OEerror","lh20",3,"innerHTML"],["
1id","img3","matTooltipClass","tooltipBg",1,"imgMPDisclaimer",3,"matTooltip"],[1,"orderChargesLink",3,"disabled","click"],[1,"PVT"],[3,"PageSource","isExchNameVisible","isBuySellLinkVisible","isB5DataVisible","Scrip","orderEntry"],[1,"Pivot_point_Parent"],[1,"tbl-alt-row"],["width","100%"],[1,"Pvt_Data"],[1,"min-hght"],[1,"yellowtext","col","text-center","font-14",2,"margin","6% 0 0 0",3,"innerHTML"],["id","dvConfirm",1,"Place_Order_btn"],[1,"row","padbtm_15","text-center"],[1,"col-48","text-right"],[1,"text-italic","greytext","font-14","mt5"],[1,"bdr-btm-none","font-16","mt5",3,"ngClass"],[1,"col-48"],[1,"font-18","flt-left","mr5"],[1,"font-12","flt-left","mt5"],[1,"row"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["class","placeorder_list",4,"ngIf"],["class","text-center mt20",4,"ngIf"],[1,"row","padtop_20","text-center"],["mat-raised-button","","type","submit","autofocus","",1,"btn","btn-primary","mr10","ConfirmSubmitBtn",3,"disabled","click"],[1,"cancelOrder"],["mat-raised-button","","type","reset",1,"btn","btn-primary",3,"disabled","click"],[4,"ngIf","ngIfElse"],["defaultSLPrice",""],["defaultSLTriggerPrice",""],["defaultProfitPrice",""],[1,"placeorder_list"],[1,"text-center","mt20"],[1,"yellowtext","font-16",3,"innerHTML"],[1,"disable-background"],[3,"type"],["id","div2FA"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275listener("cdkDragEnded",function(d){return r.dragEnd(d)}),e.\u0275\u0275elementStart(2,"h1"),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",2),e.\u0275\u0275listener("click",function(){return r.closeDialogRef()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Be,23,16,"div",3),e.\u0275\u0275template(6,An,69,35,"div",4),e.\u0275\u0275template(7,Ln,2,1,"div",5),e.\u0275\u0275elementStart(8,"div"),e.\u0275\u0275template(9,bn,1,0,"div",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("ngClass","BUY"==r.SelOperation?"OrderEntry_Parent buy":"OrderEntry_Parent sell"),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(r.OETitle),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!r.ShowConfirm),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.ShowConfirm),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.disableBackground),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.show2FA))},directives:[W.mk,hi.Zt,hi.Bh,W.O5,pi.A9,a.JJ,a.On,W.PC,pi.Yi,zt.SP,W.sg,zi.e,zt.uX,zt.uD,_.KE,k.gD,a.qQ,a.Fd,a.wV,N.Nt,a.Fj,a.nD,Ji.h,_.bx,Q.lW,H.ey,ue.gM,nt.hl,nt.nW,_.R9,nt.Mq,qi.oG,Zi.N,V.R],pipes:[$i.B],encapsulation:2}),S})();var Fn=x(5197),kn=x(7479),Vn=x(8351);const Rn=["reportGrid"],Nn=["blockViewTmpl"];function wn(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",9),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Bn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",15),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onFilter()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Filter")}function Gn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).exportCSV()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function Un(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",17),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).openColumnView()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Edit Columns")}function Wn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10),e.\u0275\u0275elementStart(1,"ul"),e.\u0275\u0275elementStart(2,"li"),e.\u0275\u0275template(3,Bn,1,1,"button",11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"li"),e.\u0275\u0275elementStart(5,"button",12),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"li"),e.\u0275\u0275template(7,Gn,1,1,"button",13),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"li"),e.\u0275\u0275template(9,
1Un,1,1,"button",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isDataFound)}}function Hn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275elementStart(1,"div",18),e.\u0275\u0275elementStart(2,"div",19),e.\u0275\u0275elementStart(3,"div",20),e.\u0275\u0275element(4,"span",21),e.\u0275\u0275element(5,"span",22),e.\u0275\u0275element(6,"span",23),e.\u0275\u0275elementStart(7,"label",24),e.\u0275\u0275text(8,"Trade value:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(9,"span",21),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"br"),e.\u0275\u0275elementStart(11,"div"),e.\u0275\u0275elementStart(12,"label"),e.\u0275\u0275text(13,"Traded Qty :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(14,"span",21),e.\u0275\u0275elementStart(15,"label",25),e.\u0275\u0275text(16,"Traded Price :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(17,"span",21),e.\u0275\u0275elementStart(18,"label",26),e.\u0275\u0275text(19,"Traded Number :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(20,"span",21),e.\u0275\u0275elementStart(21,"label",27),e.\u0275\u0275text(22,"Order Number :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(23,"span",21),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"div"),e.\u0275\u0275elementStart(25,"label"),e.\u0275\u0275text(26,"Initiated By :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(27,"span",28),e.\u0275\u0275elementStart(28,"label",29),e.\u0275\u0275text(29,"Modified By :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(30,"span",21),e.\u0275\u0275elementStart(31,"label",30),e.\u0275\u0275text(32,"Traded Time :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(33,"span",21),e.\u0275\u0275elementStart(34,"label",31),e.\u0275\u0275text(35,"Order Type :"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(36,"span",21),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.row;e.\u0275\u0275advance(4),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML","B"==t.BuySell?"BUY":"SELL",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML",t.MWSecurityDesc,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.ProductType)("innerHTML",t.ProductType,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.TradeValue)("innerHTML",t.TradeValue,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngClass",t.Quantity)("innerHTML",t.Quantity,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.Price)("innerHTML",t.Price,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.TradeNo)("innerHTML",t.TradeNo,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.ExOrderNo)("innerHTML",t.ExOrderNo,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngClass",t.OrderInitiatedFrom)("innerHTML",t.OrderInitiatedFrom,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.OrderModifiedFrom)("innerHTML",t.OrderModifiedFrom,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.Time)("innerHTML",t.Time,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.OrderType)("innerHTML",t.OrderType,e.\u0275\u0275sanitizeHtml)}}let Wr=(()=>{class S{constructor(t,r,s,d,I,M){this.httpService=t,this.logService=r,this.dialogService=s,this.menuManager=d,this.pubsubService=I,this.zone=M,this.showProgressBar=!1,this.isDataFound=!0,this.showFilter=!1,this.showSort=!0,this.showPaging=!0,this.isToBeRefreshed=!1,this.isWCFReqInProgress=!1,this.sortvalues=["
1Scrip","Product","Trade Time","Buy/Sell"],this.dirvalues=["asc","desc"],this.exchArray=[],this.productArray=[],this.rowFilter=[],this.isFilterApp=!1,this.filterCss="btn-filter",this.sortCss="btn-sort",this.isFirstReq=!0,this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.noDataFoundMsg="Looks like you have no trades at this moment",this.TB_PageSize="6",this.TB_extendedPageSize="12"}onFilter(){this.showFilter=!this.showFilter}ngOnInit(){try{this.layoutMode=""!=n.xB.dConfigMaster.FINALYTICS_REPORTS_VIEWTYPE?n.xB.dConfigMaster.FINALYTICS_REPORTS_VIEWTYPE:"G",this.sortOption=this.sortvalues[2],this.direction=this.dirvalues[1],(0,fe.isNullOrUndefined)(n.xB.PageSizeDetails)||(this.TB_PageSize=n.xB.PageSizeDetails.TB_PageSize,this.TB_extendedPageSize=n.xB.PageSizeDetails.TB_extendedPageSize),this.pubsubService.subscribe("TBMAX",(t,r)=>{console.log("NetPosition loaded"),this.refresh()})}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","tradebook.component.ts","")}}refresh(){this.getTradeBook()}exportCSV(){this.reportGrid.exportCSV("TradeBook")}subscribeMessages(){null==this.ArrSubTokens&&(this.ArrSubTokens=this.pubsubService.subscribe("OLRES",(t,r)=>{(r.MsgCode==n.gT.C_V_MSGCODES_TRADE_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_TRADE_RESPONSE_TRADEBOOK)&&this.zone.run(()=>{this.isToBeRefreshed=!0,this.isWCFReqInProgress=!1,this.checkAndUpdateTradeBook()})})),this.getTradeBook()}
1checkAndUpdateTradeBook(){this.isToBeRefreshed&&!this.isWCFReqInProgress&&(this.getTradeBook(),this.isToBeRefreshed=!1,this.isWCFReqInProgress=!0)}getTradeBook(){try{this.showProgressBar=!0;var t=new n.HT;t.Append(n.gT.C_S_REQUIREHEADER+n.gT.C_S_NAMEVALUE_DELIMITER+(1==this.isFirstReq?"1":"0")+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_MKTSEGID+n.gT.C_S_NAMEVALUE_DELIMITER+"0"+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_USERCODE+n.gT.C_S_NAMEVALUE_DELIMITER+n.xB.User.UserCode+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_SCRIPTOKEN+n.gT.C_S_NAMEVALUE_DELIMITER+"0"+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_GATEWAYORDERNO+n.gT.C_S_NAMEVALUE_DELIMITER+""+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_SYMBOL+n.gT.C_S_NAMEVALUE_DELIMITER+""+n.gT.C_S_FIELD_DELIMITER),t.Append(n.xB.applicationType==n.xB.TABLET?n.gT.C_V_TAG_ISTABLETDEVICE+n.gT.C_S_NAMEVALUE_DELIMITER+n.gT.C_S_HTML_TABLET_DEVICE+n.gT.C_S_FIELD_DELIMITER:n.xB.applicationType==n.xB.MOBILE?n.gT.C_V_TAG_ISTABLETDEVICE+n.gT.C_S_NAMEVALUE_DELIMITER+n.gT.C_S_HTML_MOBILE_DEVICE+n.gT.C_S_FIELD_DELIMITER:n.gT.C_V_TAG_ISTABLETDEVICE+n.gT.C_S_NAMEVALUE_DELIMITER+"0"+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_MANAGERVERSION+n.gT.C_S_NAMEVALUE_DELIMITER+n.xB.User.ManagerVersion+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_ORDERTYPE+n.gT.C_S_NAMEVALUE_DELIMITER+"1"+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_SI_TEMPLATEID+n.gT.C_S_NAMEVALUE_DELIMITER+n.xB.User.SITemplateId),this.httpService.postData(n.xB.tradingAPIUrl,"GetTradeBook",{RequireHeader:1==this.isFirstReq?"1":"0",UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(s=>{this.callBackGetTradeBook(s)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getTradeBook()","tradebook.component.ts","")}}callBackGetTradeBook(t){if(this.showProgressBar=!1,t=t.ResponseObject,this.rows=[],this.rowFilter=[],void 0!==t.objJSONRows&&t.objJSONRows.length>0){this.isFirstReq&&(this.initHeaders(t.objJSONHeader),this.isFirstReq=!1);var r=new m.u,s=t.objJSONRows;if(void 0!==s&&s.length>0){for(var d=0;d<s.length;d++){var I=s[d].BuySell,M=s[d].BuySell;s[d].BuySell=M="B"==M?"BUY":"Sell";var U=n.xB.ExchManager.GetCurrentExchange(s[d].Exch).dcMarketSegementId[s[d].Inst];r.ScripDet.Token=s[d].ScripCode,r.ScripDet.MktSegId=U,r.ExchangeName=s[d].Exch,r.InstrumentName=s[d].Inst,r.Symbol=s[d].Sym,r.Series=s[d].Series,this.rows.push({Exch:s[d].Exch,TradeNo:s[d].TradeNo,Instru:s[d].Inst,Symbol
1:s[d].Sym,Series:s[d].Series,ExpDate:s[d].ExpDate,StrPrc:s[d].StrPrc,OptType:s[d].OptType,Time:s[d].Time,ExOrderNo:s[d].ExOrderNo,GatewayordNo:s[d].GatewayOrdNo,BuySell:s[d].BuySell,Quantity:s[d].Qty,Price:s[d].Prc,OrderInitiatedFrom:s[d].InitiatedFrm,OrderModifiedFrom:s[d].ModifiedFrm,Misc:s[d].Misc,SORID:s[d].SORID,ClientOrderNumber:s[d].ClientOrdNo,OrderFrom:s[d].OdrFrom,ScripCode:s[d].ScripCode,TradeValue:s[d].TradeValue,SpreadSymbol:s[d].SpreadSym,MappingId:s[d].MappingId,OrderType:s[d].OrderType,Spread:s[d].Spread,SpreadPrice:s[d].SpreadPrc,ProductType:s[d].ProdType,cellClassName:this.getRowCSS(I),rowTemplate:this.blockViewTmpl,MWSecurityDesc:o.X.FormatScripDescForMW(r),nTime:this.getDateSeconds(s[d].Time),Publisher:s[d].Publisher})}this.rowFilter=this.rows,this.applyFilter(""),this.sortData(),this.isDataFound=!1}else this.isDataFound=!0;this.isWCFReqInProgress=!0,this.checkAndUpdateTradeBook()}else this.isDataFound=!0}getDateSeconds(t){try{var r=0;null!=t&&(r=new Date("01/01 / 1980 "+t).getTime()/1e3)}catch(s){this.logService.WriteLog("Exception: "+s.message,"getDateSeconds()","tradebook.component.ts","")}return r}initHeaders(t){if(this.arrayheader=[],this.arrayheader[1]={value:"Exch",cType:"S"},this.arrayheader[25]={value:"TradeNo",cType:"N"},this.arrayheader[43]={value:"Instru",cType:"S"},this.arrayheader[31]={value:"Symbol",cType:"S"},this.arrayheader[32]={value:"Series",cType:"S"},this.arrayheader[33]={value:"ExpDate",cType:"S"},this.arrayheader[34]={value:"StrPrc",cType:"N"},this.arrayheader[35]={value:"OptType",cType:"S"},this.arrayheader[71]={value:"Time",cType:"S"},this.arrayheader[18]={value:"ExOrderNo",cType:"N"},this.arrayheader[28]={value:"GatewayordNo",cType:"S"},this.arrayheader[11]={value:"BuySell",cType:"S"},this.arrayheader[12]={value:"Quantity",cType:"N"},this.arrayheader[14]={value:"Price",cType:"N"},this.arrayheader[905]={value:"OrderInitiatedFrom",cType:"S"},this.arrayheader[906]={value:"OrderModifiedFrom",cType:"S"},this.arrayheader[5040]={value:"Misc",cType:"S"},this.arrayheader[424]={value:"SORID",cType:"N"},this.arrayheader[430]={value:"ClientOrderNumber",cType:"S"},this.arrayheader[5e3]={value:"OrderFrom",cType:"S"},this.arrayheader[7]={value:"ScripCode",cType:"N"},this.arrayheader[487]={value:"TradeValue",cType:"N"},this.arrayheader[474]={value:"SpreadSymbol",cType:"S"},this.arrayheader[494]={value:"MappingId",cType:"N"},this.arrayheader[72]={value:"OrderType",cType:"S"},this.arrayheader[471]={value:"Spread",cType:"S"},this.arrayheader[475]={value:"SpreadPrice",cType:"N"},this.arrayheader[368]={value:"ProductType",cType:"S"},this.arrayheader.Publisher={value:"Publisher",cType:"S"},this.columns=[],"B"==this.layoutMode){var d=["11","12","905","906","71","72","18","25","14","487","368","1","32","31"],I=[];for(let U=0;U<d.length;U++)I[d[U]]=d[U];if(void 0!==t){for(let U=0;U<t.length;U++)this.arrayheader.length>0&&((M=this.arrayheader[t[U].Id]).name=t[U].Nm,this.arrayheader[t[U].Id]=M);for(let U=0;U<t.length;U++)if(null!=(M=this.arrayheader[I[t[U].Id]]))for(let j=0;j<d.length;j++)if(t[U].Id==d[j]){this.columns.push(M);break}}}else if(void 0!==t)for(let U=0;U<t.length;U++)if(this.arrayheader.length>0){var M;(M=this.arrayheader[t[U].Id]).name=t[U].Nm,this.columns.push(M)}}getRowCSS(t){return"B"==t?"BuyCSS":"SellCSS"}openColumnView(){this.dialogService.openComponent("Edit Columns",u.V,{menuId:n.gT.C_S_MENU_TRADING_TRADEBOOK,reptId:n.gT.C_V_COLUMNTEMPLATE_TRADEBOOK}).afterClosed().subscribe(r=>{this.onColumnViewClose(r)})}onColumnViewClose(t){1==t&&(this.isFirstReq=!0,this.getTradeBook())}sortData(){let t=[];for(var r=this.sortOption,s=this.direction,d=0;d<this.rowFilter.length;d++)t[d]=this.rowFilter[d];switch(r){case"Scrip":t=n.vV.sort(t,"Symbol",s,!1);break;case"Product":t=n.vV.sort(t,"ProductType",s,!1);break;case"Trade Time":t=n.vV.sort(t,"nTime",s,!0);break;case"Buy/Sell":t=n.vV.sort(t,"BuySell",s,!1);break;default:t=this.rows}this.rowFilter=[],this.rowFilter=t}onFilterClick(){(null==this.exchange||null==this.productType)&&(this.getExchanges(this.rows),this.getProductType(this.rows),this.exchange=this.exchArray[0],this.productType=this.productArray[0])}onExchangeChange(t){this.exchange=t,this.isFilterApp=!0,this.applyFilter(this.exchange)}onProductChange(t){this.productType=t,this.isFilterApp=!0,this.applyFilter(this.productType)}getExchanges(t){let r;this.exchArray=[];let s=!1;this.exchArray.push({key:"Exch",value:"All"});for(var d=0;d<t.length;d++)if(r=t[d].Exch,this.exchArray.length>0){for(var I=0;I<this.exchArray.length;I++){if(I==this.exchArray.length-1){if(r!=this.exchArray[I].value){s=!0;break}s=!1;break}if(r==this.exchArray[I].value){s=!1;break}s=!0,s=!1}s&&this.exchArray.push({key:"Exch",value:r})}else this.exchArray.push({key:"Exch",value:r})}getProductType(t){this.productArray=[];let r,s=!1;this.productArray.push({key:"Product",value:"All"});for(var d=0;d<t.length;d++)if(r=t[d].ProductType,this.productArray.length>0){for(var I=0;I<this.productArray.length;I++){if(I==this.productArray.length-1){if(r!=this.productArray[I].value){s=!0;break}s=!1;break}if(r==this.productArray[I].value){s=!1;break}s=!0,s=!1}s&&this.productArray.push({key:"Product",value:r})}else this.productArray.push({key:"Product",value:r})}filterScrip(t){this.Symbol={key:"Scrip",value:t},this.Symbol1={key:"Scrip",value:t},this.isFilterApp=!0,this.applyFilter(this.Symbol1)}applyFilter(t){var r=this.rows;null!=this.Symbol1&&""!=this.Symbol1.value&&(r=r.filter(s=>s.Symbol.indexOf(this.Symbol1.value.toUpperCase())>=0)),null!=this.exchange&&"All"!=this.exchange.value&&(r=r.filter(s=>s.Exch.indexOf(this.exchange.value)>=0)),null!=this.exchange&&"All"!=this.productType.value&&(r=r.filter(s=>s.ProductType.indexOf(this.productType.value)>=0)),this.rowFilter=[],this.rowFilter=r}ngOnDestroy(){this.ArrSubTokens&&(this.pubsubService.unsubscribe(this.ArrSubTokens),this.ArrSubTokens=null)}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.O
1E),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(i._),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["trade-book"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(Rn,7),e.\u0275\u0275viewQuery(Nn,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.blockViewTmpl=s.first)}},decls:10,vars:15,consts:[[1,"TradeBook_Parent"],[1,"container-fluid"],[4,"ngIf"],[1,"TradeBook_Row1"],["class","Tradebook_Filtericons",4,"ngIf"],[3,"hidden"],[3,"layoutMode","fhTopHeight","showPaging","pageSize","blockViewTmpl","extendedPageSize","noDataFoundMsg","fixedHdrConfig","columns","rows","showFilter","showSort"],["reportGrid",""],["blockViewTmpl",""],[3,"type"],[1,"Tradebook_Filtericons"],["class","filtericon Global_Filter",3,"matTooltip","click",4,"ngIf"],[1,"btn-ref","Global_Filter",3,"matTooltip","click"],["class","btn-export Global_Filter",3,"matTooltip","click",4,"ngIf"],["class","ColumnsViewicon Global_Filter",3,"matTooltip","click",4,"ngIf"],[1,"filtericon","Global_Filter",3,"matTooltip","click"],[1,"btn-export","Global_Filter",3,"matTooltip","click"],[1,"ColumnsViewicon","Global_Filter",3,"matTooltip","click"],[1,"profile_scroll","BlockView"],[1,"rptgrid"],[1,"scripDetails"],[3,"ngClass","innerHTML"],[2,"margin-left","24px",3,"ngClass","innerHTML"],[2,"margin-left","306px",3,"ngClass","innerHTML"],[2,"margin-left","200px"],[2,"margin-left","93px"],[2,"margin-left","85px"],[2,"margin-left","199px"],["span","",3,"ngClass","innerHTML"],[2,"margin-left","90px"],[2,"margin-left","110px"],[2,"margin-left","184px"]],template:function(t,r){if(1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,wn,2,1,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275template(4,Wn,10,4,"div",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",5),e.\u0275\u0275element(6,"reportgrid",6,7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(8,Hn,37,24,"ng-template",null,8,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&t){const s=e.\u0275\u0275reference(9);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","G"==r.layoutMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",r.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("layoutMode",r.layoutMode)("fhTopHeight","35px")("showPaging",!0)("pageSize",r.TB_PageSize)("blockViewTmpl",s)("extendedPageSize",r.TB_extendedPageSize)("noDataFoundMsg",r.noDataFoundMsg)("fixedHdrConfig",r.fixedHdrConfig)("columns",r.columns)("rows",r.rowFilter)("showFilter",r.showFilter)("showSort",!0)}},directives:[W.O5,Me.i,V.R,ue.gM,W.mk],encapsulation:2}),S})();function Qn(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",5),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Yn(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"reportgrid",7),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("fhTopHeight","30px")("fixedHdrConfig",t.fixedHdrConfig)("noDataFoundMsg",t.noDataFoundMsg)("columns",t.columns)("rows",t.rows)}}let Hr=(()=>{class S{constructor(t,r,s){this.httpService=t,this.logService=r,this.datepipe=s,this.noDataFoundMsg="No records available",this.ProductId=0,this.showProgressBar=!1,this.isRowsAvailable=!1,this.isFirstReq=!0,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"},this.getFundsRptDataCompleted=function(d){this.showProgressBar=!1;try{var I=d.ResponseObject;this.rows=[],this.initHeaders(I.objJSONHeader);var M=I.objJSONRows;if(void 0!==M&&M.length>0){for(var U=0;U<M.length;U++)this.rows.push({Product:M[U].Product,Amount:M[U].Amount,TransRefNo:M[U].TransRefNo,Bank:M[U].Bank,TransType:M[U].TransType,Status:M[U].Status,TransDateTime:this.datepipe.transform(M[U].TransDateTime,"dd-MMM-yyyy HH:mm:ss"),HoldExpDate:M[U].HoldExpDate});this.isRowsAvailable=!0}else this.isRowsAvailable=!0}catch(q){this.logService.WriteLog("Exception: "+q.message,"getFundsReportDataCompleted()","fundsReport.component.ts","")}}}ngOnInit(){try{this.getFundsRptData()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","fundsReport.component.ts","")}}refresh(){this.getFundsRptData()}getFundsRptData(){try{this.showProgressBar=!0,this.isRowsAvailable=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetFundsReportData",{UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ProdId:this.ProductId}).subscribe(r=>{this.getFundsRptDataCompleted(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getFundsReportData()","fundsReport.component.ts","")}}initHeaders(t){this.columns=[],this.columns.push({value:"Product",name:"Product",cType:"S"}),this.columns.push({value:"Amount",name:"Amount",cType:"S"}),this.columns.push({value:"TransRefNo",name:"Trans Ref. No",cType:"N"}),this.columns.push({value:"Bank",name:"Bank",cType:"S"}),this.columns.push({value:"TransType",name:"Trans Type",cType:"S"}),this.columns.push({value:"Status",name:"Status",cType:"S"}),this.columns.push({value:"TransDateTime",name:"Trans Date Time",cType:"S"})}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(W.uU))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["funds-report"]],decls:5,vars:3,consts:[[1,"container-fluid"],[4,"ngIf"],[1,"pull-right","t-padd"],[1,"btn-ref","Global_Filter","marr0",3,"matTooltip","click"],["class","mwtable2",4,"ngIf"],[3,"type"],[1,"mwtable2"],[3,"fhTopHeight","fixedHdrConfig","noDataFoundMsg","columns","rows"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,Qn,2,1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"button",3),e.\u0275\u0275listener("click",function(){return r.refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Yn,2,5,"div",4),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.showProgressBar))},directives:[W.O5,ue.gM,V.R,Me.i],encapsulation:2}),S})();var ui=x(4471);const Xn=["reportGrid"];function Kn(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",18),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function zn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",19),e.\u0275\u0275elementStart(1,"mat-radio-button",20),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().DisablePeriodicities()}),e.\u0275\u0275elementStart(2,"span",21),e.\u0275\u0275text(3,"Exchange Wise Product..."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("checked",t.ReportTypeId),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip","Exchange Wise Product wise Scrip wise Utilized Margin")}}function Jn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",19),e.\u0275\u0275elementStart(1,"mat-radio-button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().EnablePerio
1dicities()}),e.\u0275\u0275elementStart(2,"span",23),e.\u0275\u0275text(3,"Available / Utilized..."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("checked",t.ReportTypeId),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip","Available / Utilized Margin Summary")}}function qn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",19),e.\u0275\u0275elementStart(1,"mat-radio-button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().DisablePeriodicities()}),e.\u0275\u0275elementStart(2,"span",21),e.\u0275\u0275text(3,"Exchange Wise Product"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("checked",t.ReportTypeId),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip","Exchange Wise Product wise Scrip wise Utilized Margin")}}function Zn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li",19),e.\u0275\u0275elementStart(1,"mat-radio-button",25),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().EnablePerio
1dicities()}),e.\u0275\u0275elementStart(2,"span",23),e.\u0275\u0275text(3,"Available / Utilized"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("checked",t.ReportTypeId),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip","Available / Utilized Margin Summary")}}function $n(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t.nPeriodicity),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.PeriodicityName)}}function jn(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",27),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportCSV()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function ea(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",28),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.noDataFoundMsg)}}function ta(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",29),e.\u0275\u0275element(1,"reportgrid",30,31),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("fhTopHeight","38px")("fixedHdrConfig",t.fixedHdrConfig)("columns",t.columns)("rows",t.rows)("showFooter",t.showFooter)("footerData",t.footerData)}}let kr=(()=>{class S{constructor(t,r,s){this.httpService=t,this.logService=r,this.tradingService=s,this.dialogRadio=!1,this.noDataFoundMsg="No records available",this.showProgressBar=!1,this.isRowsAvailable=!1,this.showFooter=!1,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"},this.IsPeriodicitiesEnabled=!0,this.ReportTypeId="2",this.Periodicities="",this.dcPeriodicities=[],this.SelPeriodicity="",this.PeriodictyCaption="Periodicity/ Exchange",this.bExchange=!1}ngOnInit(){try{null!=this.context?(this.dialogRadio=!0,this.Initialize(this.context.params)):(this.dialogRadio=!1,this.tradingService.fillPeriodicities().subscribe(r=>{this.fillPeriodicitesCallback(r)}))}catch(r){this.logService.WriteLog("Exception: "+r.message,"ngOnInit()","marginReport.component.ts","")}}exportCSV(){this.reportGrid.exportCSV("MARGINREPORT")}DisablePeriodicities(){this.IsPeriodicitiesEnabled=!1,this.temp=this.SelPeriodicity,this.ReportTypeId="1",this.bExchange=!0,this.getMarginReportData(this.temp)}EnablePeriodicities(){this.IsPeriodicitiesEnabled=!0,this.bExchange=!1,this.SelPeriodicity=this.temp,this.ReportTypeId="2",this.getMarginReportData(this.SelPeriodicity)}Initialize(t){try{null!=t&&(this.ReportType=t.ReportType,this.SelectedPeriodicityParams=t.Periodicities),this.tradingService.fillPeriodicities().subscribe(r=>{this.fillPeriodicitesCallback(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"Initialize()","marginReport.component.ts","")}}fillPeriodicitesCallback(t){this.showProgressBar=!1;try{null!=t&&null!=t.ResponseObject&&(this.dcPeriodicities=t.ResponseObject.dtPeriodicities),""!=this.SelectedPeriodicityParams&&null!=this.SelectedPeriodicityParams?(this.SelPeriodicity=this.SelectedPeriodicityParams,this.getMarginReportData(this.SelPeriodicity)):(this.SelPeriodicityParams=this.dcPeriodicities[0],this.SelPeriodicity=this.SelPeriodicityParams.nPeriodicity,this.getMarginReportData(this.SelPeriodicity))}catch(s){this.logService.WriteLog("Exception: "+s.message,"GetPeriodicitiesCompleted()","marginReport.component.ts","")}}getMarginReportData(t){try{this.showProgressBar=!0,this.isRowsAvailable=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetMarginReport",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MrRptTypId:this.ReportTypeId,MrRptTyp:this.ReportType,PeriodicityId:this.SelPeriodicity}).subscribe(s=>{this.getMarginReportDataCompleted(s)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getMarginReportData()","marginReport.component.ts","")}}getMarginReportDataCompleted(t){this.showProgressBar=!1,this.show
1Footer=!1;try{var r=t.ResponseObject;this.rows=[],this.initHeaders(r.objJSONRows);var s=0,d=0,I=0,M=0,U=0,q=r.objJSONRows;if(void 0!==q&&q.length>0){for(var j=0;j<q.length;j++)this.rows.push({Exchange:q[j].Exch,Producttype:q[j].ProdType,TotalLimit:q[j].TotLim,MarginUtilized:isNaN(Number(parseFloat(q[j].MarginUtilized).toFixed(2)))?0:Number(parseFloat(q[j].MarginUtilized)).toFixed(2),ExposureMargin:isNaN(Number(parseFloat(q[j].ExpoMargin).toFixed(2)))?0:Number(parseFloat(q[j].ExpoMargin)).toFixed(2),NetAvailable:isNaN(Number(parseFloat(q[j].NetAvab).toFixed(2)))?0:Number(parseFloat(q[j].NetAvab)).toFixed(2),BookedPL:isNaN(Number(parseFloat(q[j].BookedPL).toFixed(2)))?0:Number(parseFloat(q[j].BookedPL)).toFixed(2),MTMPL:isNaN(Number(parseFloat(q[j].MTMPL).toFixed(2)))?0:Number(parseFloat(q[j].MTMPL)).toFixed(2),Scrip:q[j].Scrip,cMarginUtilized:(isNaN(Number(parseFloat(q[j].MarginUtilized)))?0:parseFloat(q[j].MarginUtilized)).toFixed(2),cExpoMargin:(isNaN(Number(parseFloat(q[j].ExpoMargin)))?0:parseFloat(q[j].ExpoMargin)).toFixed(2),cBookedPL:(isNaN(Number(parseFloat(q[j].BookedPL)))?0:parseFloat(q[j].BookedPL)).toFixed(2),cMTMPL:(isNaN(Number(parseFloat(q[j].MTMPL)))?0:parseFloat(q[j].MTMPL)).toFixed(2),cNetAvailable:(isNaN(Number(parseFloat(q[j].NetAvab)))?0:parseFloat(q[j].NetAvab)).toFixed(2)}),s=(parseFloat(s)+Number(isNaN(parseFloat(q[j].MarginUtilized))?0:Number(parseFloat(q[j].MarginUtilized)))).toFixed(2),d=(parseFloat(d)+(isNaN(parseFloat(q[j].ExpoMargin))?0:Number(parseFloat(q[j].ExpoMargin)))).toFixed(2),I=(parseFloat(I)+(isNaN(parseFloat(q[j].BookedPL))?0:Number(parseFloat(q[j].BookedPL)))).toFixed(2),M=(parseFloat(M)+(isNaN(parseFloat(q[j].MTMPL))?0:Number(parseFloat(q[j].MTMPL)))).toFixed(2),U=(parseFloat(U)+(isNaN(parseFloat(q[j].NetAvab))?0:Number(parseFloat(q[j].NetAvab)))).toFixed(2);1==this.ReportTypeId&&(this.showFooter=!0,this.footerData={MarginUtilized:s,ExposureMargin:d,BookedPL:I,MTMPL:M,NetAvailable:U}),this.isRowsAvailable=!0}else this.isRowsAvailable=!1}catch(Ie){this.logService.WriteLog("Exception: "+Ie.message,"getMarginReportDataCompleted()","marginReport.component.ts","")}}initHeaders(t){this.columns=[],this.columns.push({value:"Exchange",name:"Exchange",cType:"S",width:20}),this.columns.push({value:"Producttype",name:"Product type",cType:"S",width:20}),this.bExchange?(this.columns.push({value:"Scrip",name:"Scrip",cType:"S",width:20}),("LU"==this.ReportType||null==this.ReportType)&&this.columns.push({footer:!0,value:"MarginUtilized",name:"Margin Utilized",cType:"N",width:20}),("LU"==this.ReportType||null==this.ReportType)&&this.columns.push({footer:!0,value:"ExposureMargin",name:"Exposure Margin",cType:"N",width:20}),("BPL"==this.ReportType||null==this.ReportType)&&this.columns.push({footer:!0,value:"BookedPL",name:"Booked P & L",cType:"N",width:20}),("MPL"==this.ReportType||null==this.ReportType)&&this.columns.push({footer:!0,value:"MTMPL",name:"MTM P & L",cType:"N",width:20})):(this.columns.push({value:"TotalLimit",name:"Total Limit",cType:"N",width:20}),""!=t[0].MarginUtilized&&this.columns.push({footer:!1,value:"MarginUtilized",name:"Margin Utilized",cType:"N",width:20}),""!=t[0].ExpoMargin&&this.columns.push({footer:!1,value:"ExposureMargin",name:"Exposure Margin",cType:"N",width:20}),""!=t[0].BookedPL&&this.columns.push({footer:!1,value:"BookedPL",name:"Booked P & L",cType:"N",width:20}),""!=t[0].MTMPL&&this.columns.push({footer:!1,value:"MTMPL",name:"MTM P & L",cType:"N",width:20}),this.columns.push({value:"NetAvailable",name:"Net Available",cType:"N",width:20}))}onSelPeriodicity(t){try{null!=t&&(this.SelectedPeriodicityParams=null),null!=this.SelPeriodicity&&(this.Periodicities=this.SelPeriodicity,this.getMarginReportData(this.Periodicities))}catch(r){this.logService.WriteLog("Exception: "+r.message,"SelPeriodicity-subscribe()","marginReport.component.ts","")}}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(ui.D))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["margin-report"]],viewQuery:function(t,r){if(1&t&&e.\u0275\u0275viewQuery(Xn,5),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first)}},inputs:{context:"context"},decls:27,vars:12,consts:[[1,"Margin_Report"],[4,"ngIf"],[1,"filterPanel"],[1,"zone1"],[1,"pagename"],[1,"zone2"],[1,"databox"],["class","pt3",4,"ngIf"],[1,"pt5"],[1,"marginL-20","dd-label"],["disableOptionCentering","true",3,"disabled","ngModel","selectionChange","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"zone3"],[1,"iconbox"],["class","icon-bdr Global_Filter btn-export",3,"matTooltip","click",4,"ngIf"],[1,"clear"],["class","nodatafou
1nd",4,"ngIf"],["class","nopadding col-80",4,"ngIf"],[3,"type"],[1,"pt3"],["type","radio","name","MRReportType","value","1",3,"checked","click"],["cp","Exchange Wise Product...",3,"matTooltip"],["id","PeriodicityWise","type","radio","name","MRReportType","value","2",3,"checked","click"],["cp","Available / Utilized...",3,"matTooltip"],["type","radio","name","MRReportType1","value","1",3,"checked","click"],["id","PeriodicityWise","type","radio","name","MRReportType1","value","2",3,"checked","click"],[3,"value"],[1,"icon-bdr","Global_Filter","btn-export",3,"matTooltip","click"],[1,"nodatafound"],[1,"nopadding","col-80"],[3,"fhTopHeight","fixedHdrConfig","columns","rows","showFooter","footerData"],["reportGrid",""]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,Kn,2,1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275element(4,"span",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",5),e.\u0275\u0275elementStart(6,"div",6),e.\u0275\u0275elementStart(7,"ul"),e.\u0275\u0275template(8,zn,4,2,"li",7),e.\u0275\u0275template(9,Jn,4,2,"li",7),e.\u0275\u0275template(10,qn,4,2,"li",7),e.\u0275\u0275template(11,Zn,4,2,"li",7),e.\u0275\u0275elementStart(12,"li",8),e.\u0275\u0275elementStart(13,"span",9),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"li"),e.\u0275\u0275elementStart(16,"mat-form-field"),e.\u0275\u0275elementStart(17,"mat-select",10),e.\u0275\u0275listener("selectionChange",function(){return r.onSelPeriodicity(r.SelPeriodicity)})("ngModelChange",function(d){return r.SelPeriodicity=d}),e.\u0275\u0275template(18,$n,2,2,"mat-option",11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",12),e.\u0275\u0275elementStart(20,"div",13),e.\u0275\u0275elementStart(21,"ul"),e.\u0275\u0275elementStart(22,"li"),e.\u0275\u0275template(23,jn,1,1,"button",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(24,"div",15),e.\u0275\u0275template(25,ea,3,1,"div",16),e.\u0275\u0275template(26,ta,3,6,"div",17),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngIf",!r.dialogRadio),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.dialogRadio),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.dialogRadio),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.dialogRadio),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(r.PeriodictyCaption),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",!r.IsPeriodicitiesEnabled)("ngModel",r.SelPeriodicity),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",r.dcPeriodicities),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",r.isRowsAvailable),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!r.showProgressBar&&!r.isRowsAvailable),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.showProgressBar&&r.isRowsAvailable))},directives:[W.O5,_.KE,k.gD,a.JJ,a.On,W.sg,V.R,ht.U0,ue.gM,H.ey,Me.i],encapsulation:2}),S})();var ia=x(2184),ra=x(7733),na=x(1739),aa=x(8906),sa=x(9873);const la=["reportGrid"],oa=["cellTmplSquareOff"],ca=["cellTmplPositionConv"],da=["cellTmpFooterValue"];function ha(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",16),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function pa(S,O){1&S&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Total MTM : "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd())}function ma(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li",17),e.\u0275\u0275elementStart(1,"h3"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngClass",t.mtmVal>0?"BuyCSS":0==t.mtmVal?"":"SellCSS"),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.dblSumMTM)}}function ua(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.sdisplayText)}}function Sa(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"label"),e.\u0275\u0275text(2,"Combined Segment:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"mat-form-field"),e.\u0275\u0275elementStart(4,"mat-select",18),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().selInteropConfiguration=s})("selectionChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onInteropChange(s)}),e.\u0275\u0275template(5,ua,2,2,"mat-option",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",t.selInteropConfiguration),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.arrInteropConfiguration)}}function _a(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",27),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onFilter()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Filter")}function ga(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",28),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).exportCSV()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function Ta(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",29),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).openColumnView()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Edit Columns")}function fa(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",21),e.\u0275\u0275elementStart(1,"ul"),e.\u0275\u0275elementStart(2,"li"),e.\u0275\u0275elementStart(3,"a",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().AllRowsSquareOff()}),e.\u0275\u0275text(4,"Square Off"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275template(6,_a,1,1,"button",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"li"),e.\u0275\u0275elementStart(8,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"li"),e.\u0275\u0275template(10,ga,1,1,"button",25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"li"),e.\u0275\u0275template(12,Ta,1,1,"button",26),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isDataFound),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isDataFound)}}function Ca(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"button",42),e.\u0275\u0275element(1,"span",43),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("className",t.sortCss)}}function va(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-radio-button",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t)}}function Pa(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-radio-button",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t)}}function Ea(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",44),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onFilterClick()}),e.\u0275\u0275element(1,"span",43),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("className",t.filterCss)}}function ya(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.value)}}function Ia(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.value)}}function Ma(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",45),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).exportCSV()}),e.\u0275\u0275elementEnd()}}function xa(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",30),e.\u0275\u0275elementStart(1,"mat-toolbar",31),e.\u0275\u0275text(2," Total MTM "),e.\u0275\u0275elementStart(3,"span",17),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",32),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",33),e.\u0275\u0275template(7,Ca,2,1,"button",34),e.\u0275\u0275elementStart(8,"ul",35),e.\u0275\u0275elementStart(9,"li",36),e.\u0275\u0275elementStart(10,"div"),e.\u0275\u0275elementStart(11,"div"),e.\u0275\u0275elementStart(12,"mat-radio-group",37),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().sortOption=s}),e.\u0275\u0275template(13,va,2,2,"mat-radio-button",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(14,"br"),e.\u0275\u0275elementStart(15,"div"),e.\u0275\u0275elementStart(16,"mat-radio-group",37),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().direction=s}),e.\u0275\u0275template(17,Pa,2,2,"mat-radio-button",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(18,"br"),e.\u0275\u0275elementStart(19,"button",38),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().sortData()}),e.\u0275\u0275text(20,"Submit"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"div",33),e.\u0275\u0275template(22,Ea,2,1,"button",39),e.\u0275\u0275elementStart(23,"ul",35),e.\u0275\u0275elementStart(24,"li",36),e.\u0275\u0275text(25," Symbol : "),e.\u0275\u0275elementStart(26,"input",40),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().filterScrip(s)})("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().Symbol=s}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(27,"br"),e.\u0275\u0275text(28," Exchange : "),e.\u0275\u0275elementStart(29,"mat-form-field"),e.\u0275\u0275elementStart(30,"mat-select",18),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exchange=s})("selectionChange",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext();return s.onExchangeChange(s.exchange)}),e.\u0275\u0275template(31,ya,2,2,"mat-option",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(32,"br"),e.\u0275\u0275text(33," Product : "),e.\u0275\u0275elementStart(34,"mat-form-field"),e.\u0275\u0275elementStart(35,"mat-select",18),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().productType=s})("selectionChange",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext();return s.onProductChange(s.productType)}),e.\u0275\u0275template(36,Ia,2,2,"mat-option",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(37,"br"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(38,Ma,1,0,"button",41),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.mtmVal>0?"BuyCSS":0==t.mtmVal?"":"SellCSS"),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.dblSumMTM),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isDataFound),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.sortOption),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.sortvalues),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",t.direction),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.dirvalues),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",t.isDataFound),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",t.Symbol),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",t.exchange),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.exchArray),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",t.productType),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.productArray),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isDataFound)}}
1function Oa(S,O){1&S&&(e.\u0275\u0275elementStart(0,"span",49),e.\u0275\u0275text(1,"|"),e.\u0275\u0275elementEnd())}function Da(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"a",46),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().openPositionConv(s)}),e.\u0275\u0275text(1,"Pos. Convert"),e.\u0275\u0275elementEnd()}}function Aa(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"a",46),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).row;return e.\u0275\u0275nextContext().SQPositionConversion(d)}),e.\u0275\u0275text(1,"Square Off"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(2,Oa,2,0,"span",47),e.\u0275\u0275template(3,Da,2,0,"a",48)}if(2&S){const t=O.row;e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",1==t.posConvFlag),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1==t.posConvFlag)}}function La(S,O){if(1&S&&e.\u0275\u0275element(0,"span",50),2&S){const t=O.column,r=e.\u0275\u0275nextContext();e.\u0275\u0275property("innerHTML",r.footerData[t.value].value1,e.\u0275\u0275sanitizeHtml)("className",r.footerData[t.value].value1css)}}function ba(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275elementStart(1,"input",57),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().SQPositionConversion(s)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}}function Fa(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275elementStart(1,"div",51),e.\u0275\u0275elementStart(2,"div",52),e.\u0275\u0275elementStart(3,"div",53),e.\u0275\u0275element(4,"span",54),e.\u0275\u0275elementStart(5,"div",55),e.\u0275\u0275template(6,ba,2,0,"span",2),e.\u0275\u0275elementStart(7,"span"),e.\u0275\u0275elementStart(8,"input",56),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).row;return e.\u0275\u0275nextContext().openPositionConv(d)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"div"),e.\u0275\u0275text(10," Net Qty : "),e.\u0275\u0275element(11,"span",54),e.\u0275\u0275text(12," Net Price : "),e.\u0275\u0275element(13,"span",54),e.\u0275\u0275text(14," Net Value : "),e.\u0275\u0275element(15,"span",54),e.\u0275\u0275text(16," MTM : "),e.\u0275\u0275element(17,"span",54),e.\u0275\u0275element(18,"span",54),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div"),e.\u0275\u0275text(20," Buy Qty : "),e.\u0275\u0275element(21,"span",54),e.\u0275\u0275text(22," Buy Price : "),e.\u0275\u0275element(23,"span",54),e.\u0275\u0275text(24," Buy Value : "),e.\u0275\u0275element(25,"span",54),e.\u0275\u0275text(26," LTP : "),e.\u0275\u0275element(27,"span",54),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"div"),e.\u0275\u0275text(29," Sell Qty : "),e.\u0275\u0275element(30,"span",54),e.\u0275\u0275text(31," Sell Price : "),e.\u0275\u0275element(32,"span",54),e.\u0275\u0275text(33," Sell Value : "),e.\u0275\u0275element(34,"span",54),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=O.row;e.\u0275\u0275advance(4),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML",t.MWSecurityDesc,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",0!=t.NetQty),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML",t.NetQty,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML",t.AvgNetPrice,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass","B"==t.BuySell?"BuyCSS":"SellCSS")("innerHTML",t.NetValue,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.MTM>0?"BuyCSS":0==t.MTM?"":"SellCSS")("innerHTML",t.MTM,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.ProductType)("innerHTML",t.ProductType,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.BuyQty)("innerHTML",t.BuyQty,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.AvgBuyPrice)("innerHTML",t.AvgBuyPrice,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.BuyValue)("innerHTML",t.BuyValue,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.LTP)("innerHTML",t.LTP,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",t.SellQty)("innerHTML",t.SellQty,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.AvgSellPrice)("innerHTML",t.AvgSellPrice,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",t.SellValue)("innerHTML",t.SellValue,e.\u0275\u0275sanitizeHtml)}}let Qr=(()=>{class S{constructor(t,r,s,d,I,M,U,q){this.httpService=t,this.logService=r,this.pubsubService=s,this.zone=d,this.dialogService=I,this.menuManager=M,this.tradingSharedService=U,this.toasterService=q,this.filterCss="btn-filter",this.sortCss="btn-sort",this.showProgressBar=!1,this.ArrSubTokens=[],this.scripList=[],this.isToBeRefreshed=!1,this.isWCFReqInProgress=!1,this.isFirstReq=!0,this.rows=[],this.show
1Filter=!1,this.isDataFound=!1,this.isNoDataFound=!1,this.dblSumMTMID=null,this.dblSumMTM=0,this.ProductTypeID="",this.ProductTypeName="",this.ArrSelPos=[],this.isReqSent=!1,this.successfulMsg="",this.showFooter=!0,this.mtmVal=0,this.netVal=0,this.buyVal=0,this.sellVal=0,this.Selectedrow="",this.sortvalues=["Scrip","NetQty","MTM"],this.dirvalues=["asc","desc"],this.productArray=[],this.exchArray=[],this.rowFilter=[],this.scripkey=new he.A,this.ooCss=n.gT.BTN_SELECTED_CLASS,this.noDataFoundMsg="Looks like you have no positions today",this.arrInteropConfiguration=[],this.selInteropConfiguration=this.arrInteropConfiguration[0],this.showInterop=!1,this.arrCombinedTokenDetails=[],this.objCombinedData=[],this.isReqInprocess=!1,this.ActualMTMPL=0,this.NP_PageSize="5",this.NP_extendedPageSize="12",this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"}}ngOnInit(){try{this.layoutMode=""!=n.xB.dConfigMaster.FINALYTICS_REPORTS_VIEWTYPE?n.xB.dConfigMaster.FINALYTICS_REPORTS_VIEWTYPE:"G",this.ArrSelPos=[{key:"Daily",value:"0"},{key:"Expiry",value:"1"}],this.SelPos=this.ArrSelPos[1],this.posType="1",this.currentMTMValue=0,this.dblSumMTM=0,this.sortOption=this.sortvalues[0],this.direction=this.dirvalues[0],(0,fe.isNullOrUndefined)(n.xB.PageSizeDetails)||(this.NP_PageSize=n.xB.PageSizeDetails.NP_PageSize,this.NP_extendedPageSize=n.xB.PageSizeDetails.NP_extendedPageSize),this.pubsubService.subscribe("NPRFRSH",()=>{this.refresh()}),this.pubsubService.subscribe("NPMAX",(r,s)=>{console.log("NetPosition loaded"),this.refresh()}),this.tradingSharedService.getInteropConfiguration().subscribe(r=>{null!=r&&r.arrInteropConfig.length>0&&r.isInteropAllowed&&(this.showInterop=r.isInteropAllowed,this.arrInteropConfiguration=r.arrInteropConfig,this.selInteropConfiguration=this.arrInteropConfiguration[1])},r=>{})}catch(r){this.logService.WriteLog("Exception: "+r.message,"ngOnInit()","netposition.component.ts","")}}onFilter(){this.showFilter=!this.showFilter}refresh(){this.getNetPositionData()}onInteropChange(t){this.getNetPositionData()}subscribeMessages(){try{if(0==this.ArrSubTokens.length){this.ArrSubTokens=[];let t=this.pubsubService.subscribe("MTLRES",(r,s)=>{this.zone.run(()=>{this.handleMultiTouchResp(r,s)})});this.ArrSubTokens.push(t),t=this.pubsubService.subscribe("OLRES",(r,s)=>{this.zone.run(()=>{this.fn_ProcessTradeResp(r,s)})}),this.ArrSubTokens.push(t)}this.getNetPositionData()}catch(t){this.logService.WriteLog("Exception: "+t.message,"subscribeMessages","netposition.component.ts","")}}getNetPositionData(){try{this.showProgressBar=!0,this.httpService.postData(n.xB.tradingAPIUrl,"GetNetPosition",{RequireHeader:1==this.isFirstReq?"1":"0",UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",PosType:this.posType,CombineSegment:this.showInterop?this.selInteropConfiguration.value:0}).subscribe(r=>{this.getNetPositionCompleted(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getNetPositionData","netposition.component.ts","")}}getNetPositionCompleted(t){this.showProgressBar=!1;try{t=t.ResponseObject,this.rows=[],this.rowFilter=[],this.isDataFound=!1,this.isFirstReq&&(this.initHeaders(t.objJSONHeader),this.isFirstReq=!1),this.mtmVal=0,this.netVal=0,this.buyVal=0,this.sellVal=0,this.ActualMTMPL=0;var r=t.objJSONRows;if(void 0!==r&&r.length>0){for(var s=0;s<r.length;s++)this.rows.push(this.setRowData(r[s])),this.rows[s].cellClassName=parseFloat(this.rows[s].MTM)<0?"D"==n.xB.dConfigMaster.NETPOSITION_COLOR?"NPRowPresenterRed":"CustomNPRowPresenterRed":parseFloat(this.rows[s].MTM)>0?"D"==n.xB.dConfigMaster.NETPOSITION_COLOR?"NPRowPresenterGreen":"CustomNPRowPresenterGreen":"D"==n.xB.dConfigMaster.NETPOSITION_COLOR?"NPRowPresenterEQ":"CustomNPRowPresenterEQ","1"==this.posType&&this.rows[s].Instru&&this.rows[s].Instru!=n.gT.C_S_INSTRUMENT_EQUITIES_TEXT?this.rows[s].ActualMTMPL=parseFloat("0.00").toFixed(2):(this.rows[s].ActualMTMPL="",this.rows[s].CFAvgPrice=""),this.mtmVal+=isNaN(parseFloat(r[s].MTM))?0:Number(parseFloat(r[s].MTM).toFixed(2)),this.netVal+=isNaN(parseFloat(r[s].NetValue))?0:Number(parseFloat(r[s].NetValue)),this.buyVal+=isNaN(parseFloat(r[s].BuyValue))?0:Number(parseFloat(r[s].BuyValue)),this.sellVal+=isNaN(parseFloat(r[s].SellValue))?0:Number(parseFloat(r[s].SellValue));this.applyFilter(""),this.sortData(),this.dblSumMTM=0,this.footerData={MTM:{value1:this.mtmVal,value1css:"taL"},NetValue:{value1:parseFloat(this.netVal).toFixed(2),value1css:"taL"},BuyValue:{value1:parseFloat(this.buyVal).toFixed(2),value1css:"taL"},SellValue:{value1:parseFloat(this.sellVal).toFixed(2),value1css:"taL"},ActualMTMPL:{value1:"1"==this.posType?parseFloat(this.ActualMTMPL).toFixed(2):"",value1css:"taL"}},this.isDataFound=!0}this.createNetPosTable(),this.isWCFReqInProgress=!1,this.checkAndUpdateNetPosition()}catch(d){this.logService.WriteLog("Exception: "+d.message,"GetNetPositionCompleted","netposition.component.ts","")}}initHeaders(t){this.arrayheader=[],this.arrayheader[1]={value:"Exch",cType:"S"},this.arrayheader[900900]={value:"SquareOff",sort:!1,filter:!1,cType:"S",export:!1,cellTemplate:this.cellTmplSquareOff},this.arrayheader[43]={value:"Instru",cType:"S"},this.arrayheader[31]={value:"Symbol",cType:"S"},this.arrayheader[32]={value:"Series",cType:"S"},this.arrayheader[33]={value:"ExpDate",cType:"S"},this.arrayheader[34]={value:"StrPrice",cType:"S"},this.arrayheader[35]={value:"OptType",cType:"S"},this.arrayheader[991]={footer:!0,footerTemplate:this.cellTmpFooterValue,value:"MTM",cType:"N"},this.arrayheader[999]={value:"NetQty",cType:"N"},this.arrayheader[997]={value:"AvgNetPrice",cType:"N"},this.arrayheader[998]={footer:!0,footerTemplate:this.cellTmpFooterValue,value:"NetValue",cType:"N"},this.arrayheader[2]={value:"BuyQty",cType:"N"},this.arrayheader[993]={footer:!0,footerTemplate:this.cellTmpFooterValue,value:"BuyValue",cType:"N"},this.arrayheader[994]={value:"AvgBuyPrice",cType:"N"},this.arrayheader[5]={value:"SellQty",name:"SellQty",cType:"N"},this.arrayheader[995]={footer:!0,footerTemplate:this.cellTmpFooterValue,value:"SellValue",cType:"N"},this.arrayheader[996]={value:"AvgSellPrice",cType:"N"},this.arrayheader[8]={value:"LTP",cType:"N"},this.arrayheader[368]={value:"ProductType",cType:"S"},this.arrayheader[1104]={value:"CFAvgPrice",cType:"N"},this.arrayheader[1105]={footer:!0,footerTemplate:this.cellTmpFooterValue,value:"ActualMTMPL",cType:"N"},this.arrayheader[1103]={value:"UnsettledQty",cType:"N"},this.arrayheader.BrokerageValue={value:"BrokerageValue",cType:"N"},this.columns=[];var r=[];if("B"==this.layoutMode){var d=["1","31","32","43","999","2","5","997","994","996","998","993","995"],I=[];for(let q=0;q<d.length;q++)I[d[q]]=d[q];if(void 0!==t){for(let q=0;q<t.length;q++)this.arrayheader.length>0&&((M=this.arrayheader[t[q].Id]).name=t[q].Nm,this.arrayheader[t[q].Id]=M);for(let q=0;q<t.length;q++)if(null!=(M=this.arrayheader[I[t[q].Id]]))for(let Ie=0;Ie<d.length;Ie++)if(r[q]==d[Ie]){M.expandcol=!1,this.columns.push(M);break}}}else if(void 0!==t)for(let U=0;U<t.length;U++)if(this.arrayheader.length>0){var M;(null!=(M=this.arrayheader[t[U].Id])||null!=M)&&(M.name=t[U].Nm,this.columns.push(M))}}createNetPosTable(){try{this.scripList=[];for(let s=0;s<this.rows.length;s++){var t=[],r=new he.A;r.MktSegId=parseInt(this.rows[s].prefMktSegId),r.Token=this.rows[s].prefToken,t.push(r),this.scripList.push.apply(this.scripList,t)}
1this.tradingSharedService.sendTouchLineRequest(this.scripList,1)}catch(s){this.logService.WriteLog("Exception: "+s.message,"createNetPosTable","netposition.component.ts","")}}onPositionChange(t){try{this.posType=t.value,this.SelPos=t,this.getNetPositionData()}catch(r){this.logService.WriteLog("Exception: "+r.message,"OnPositionChange","netposition.component.ts","")}}handleMultiTouchResp(t,r){try{var ce=null,Je=null,mt=!1;if(null!=r&&void 0!==this.rows)for(var Ne=0;Ne<this.rows.length;Ne++)if(this.rows[Ne].prefMktSegId==r.Scrip.MktSegId.toString()&&this.rows[Ne].prefToken==r.Scrip.Token){this.rows[Ne].LTP=r.LTP,Je=parseFloat(this.rows[Ne].MTM),ce=o.X.CalculateMTM(parseFloat(this.rows[Ne].SellValue),parseFloat(this.rows[Ne].NetQty),parseFloat(r.LTP),parseFloat(this.rows[Ne].RegularLot),parseFloat(this.rows[Ne].GenNum),parseFloat(this.rows[Ne].GenDen),parseFloat(this.rows[Ne].PriceNum),parseFloat(this.rows[Ne].PriceDen),parseFloat(this.rows[Ne].BuyValue),r.Scrip.MapMktSegId,parseFloat(this.rows[Ne].RefRate)),this.rows[Ne].MTM=parseFloat(ce).toFixed(2),this.rows[Ne].cellClassName=ce<0?"D"==n.xB.dConfigMaster.NETPOSITION_COLOR?"NPRowPresenterRed":"CustomNPRowPresenterRed":ce>0?"D"==n.xB.dConfigMaster.NETPOSITION_COLOR?"NPRowPresenterGreen":"CustomNPRowPresenterGreen":"D"==n.xB.dConfigMaster.NETPOSITION_COLOR?"NPRowPresenterEQ":"CustomNPRowPresenterEQ";var gt=0;if(null===Je||isNaN(Je)?gt=parseFloat(ce):ce!==Je?(gt=ce-Je,gt=Number(parseFloat(gt.toFixed(2)))):gt=0,this.dblSumMTM=parseFloat(this.dblSumMTM),this.dblSumMTM+=gt,this.rows[Ne].isFirstBcastRsp||(this.rows[Ne].isFirstBcastRsp=!0,this.reportGrid.reApplyFH()),mt=!0,"1"==this.posType&&this.rows[Ne].Instru&&this.rows[Ne].Instru!=n.gT.C_S_INSTRUMENT_EQUITIES_TEXT){var Pt,ft=null;Pt=parseFloat(this.rows[Ne].ActualMTMPL),this.rows[Ne].CFBuyValue>0||this.rows[Ne].CFSellValue>0?(ft=o.X.CalculateActualMTM(parseFloat(this.rows[Ne].CFSellValue),parseFloat(this.rows[Ne].NetQty),parseFloat(r.LTP),parseFloat(this.rows[Ne].RegularLot),parseFloat(this.rows[Ne].GenNum),parseFloat(this.rows[Ne].GenDen),parseFloat(this.rows[Ne].PriceNum),parseFloat(this.rows[Ne].PriceDen),parseFloat(this.rows[Ne].CFBuyValue),r.Scrip.MapMktSegId,parseFloat(this.rows[Ne].RefRate)),this.rows[Ne].ActualMTMPL=isNaN(ft)?0:parseFloat(ft).toFixed(2)):(this.rows[Ne].ActualMTMPL="",ft=parseFloat("0.00").toFixed(2));var yt,Et=0;yt=ft,null===Pt||isNaN(Pt)?Et=parseFloat(yt):yt!==Pt?(Et=yt-Pt,Et=Number(parseFloat(Et.toFixed(2)))):Et=0,this.ActualMTMPL=parseFloat(this.ActualMTMPL),this.ActualMTMPL+=Et}else this.rows[Ne].ActualMTMPL="",this.rows[Ne].CFAvgPrice=""}mt&&(this.dblSumMTM=parseFloat(this.dblSumMTM).toFixed(2),this.netVal=parseFloat(this.netVal).toFixed(2),this.footerData={MTM:{value1:this.dblSumMTM,value1css:"taL"},NetValue:{value1:this.netVal,value1css:"taL"},BuyValue:{value1:parseFloat(this.buyVal).toFixed(2),value1css:"taL"},SellValue:{value1:parseFloat(this.sellVal).toFixed(2),value1css:"taL"},ActualMTMPL:{value1:"1"==this.posType?parseFloat(this.ActualMTMPL).toFixed(2):"",value1css:"taL"}})}catch(Dt){this.logService.WriteLog("Exception: "+Dt.message,"HandleMultiTouchResp","netposition.component.ts","")}}fn_ProcessTradeResp(t,r){try{(r.MsgCode==n.gT.C_V_MSGCODES_TRADE_RESPONSE||r.MsgCode==n.gT.C_V_MSGCODES_POSITION_CONVERSION_RESPONSE)&&(this.isToBeRefreshed=!0,this.checkAndUpdateNetPosition())}catch(s){this.logService.WriteLog("Exception: "+s.message,"ProcessTradeResp","netposition.component.ts","")}}checkAndUpdateNetPosition(){try{this.isToBeRefreshed&&!this.isWCFReqInProgress&&(this.isToBeRefreshed=!1,this.isWCFReqInProgress=!0)}catch(t){this.logService.WriteLog("Exception: "+t.message,"checkAndUpdateNetPosition","netposition.component.ts","")}}openPositionConv(t){this.PositionConversion(t)&&("0"==t.NetQty?this.dialogService.alert("Cannot convert position as Net Qty is 0"):t.isCombined?this.getCombinedTokenDetails(t,"posConv"):this.dialogService.openComponent("Position Conversion",ne,{Selectedrow:t,CombineTokenDetails:null,isInteropAllowed:this.showInterop}))}onPositionConvClose(t){this.refresh()}exportCSV(){this.reportGrid.exportCSV("Net Position")}PositionConversion(t){try{var r=!0,s={OrderSide:"",NetQuantity:"",BuyQuantity:"",SellQuantity:"",MktSegId:"",Series:"",ProductType:""};n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_POSITIONCONVERSION)&&(s.OrderSide=n.gT.C_V_ORDER_BUY.toString(),s.NetQuantity=t.NetQty,s.BuyQuantity=t.BuyQty,s.SellQuantity=t.SellQty,s.MktSegId=t.SegmentId,s.Series=t.Series,s.ProductType=t.ProductType),n.xB.ExchManager.LoginAllowed[o.X.GetMarketSegmentID(parseInt(s.MktSegId,10))]==n.gT.C_S_ON||t.isCombined?s.ProductType==n.gT.C_S_PRODUCTTYPE_MP_TEXT||s.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?(r=!1,this.dialogService.alert("Position conversion not allowed for "+s.ProductType+" Product Type")):s.MktSegId==n.gT.C_V_NSEL_DERIVATIVES.toString()||s.MktSegId==n.gT.C_V_DGCX_DERIVATIVES.toString()||s.MktSegId==n.gT.C_V_BFX_DERIVATIVES.toString()?(r=!1,this.dialogService.alert("Position conversion not allowed")):s.ProductType==n.gT.C_S_PRODUCTTYPE_MTF_TEXT&&s.Series==n.gT.C_S_SERIES_SM?r=!1:(null!=s.NetQuantity||null!=s.BuyQuantity||null!=s.SellQuantity)&&0==parseInt(s.NetQuantity)&&(r=!1,this.dialogService.alert("No position available for conversion")):(r=!1,this.dialogService.alert("You are currently not allowed to convert the position for this Segment"))}catch(I){this.logService.WriteLog("Exception: "+I.message,"positionConversion","netposition.component.ts","")}return r}SQPositionConversion(t){try{var r=this.createOrderEntryRequest(t);t.ProductType==n.gT.C_S_PRODUCTTYPE_MP_TEXT?this.dialogService.alert("Square off not allowed for "+t.ProductType+" product type"):t.ProductType==n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT?"0"!=r.Qty?this.dialogService.confirm("Bracket Order will exit directly and SquareOff order will be generated at server level. Do you want to Proceed?","Yes","No").subscribe(s=>{s&&(t.isCombined?this.getCombinedTokenDetails(t,"sqOffBracketOrder"):this.squareOffForBracketOrder(t))}):this.dialogService.alert("No quantity available to square off"):"0"==r.Qty||r.Instrument.startsWith("AUC")?r.Instrument.startsWith("AUC")?this.dialogService.alert("Square off not allowed"):this.dialogService.alert("No quantity available to square off"):t.isCombined?this.getCombinedTokenDetails(t,"sqOff"):this.menuManager.invokeMenu(n.gT.C_S_MENU_OE_SPOT,{sourceId:n.gT.C_S_MENU_TRADING_NETPOSITION,data:r})}catch(s){this.logService.WriteLog("Exception: "+s.message,"SQPositionConversion","netposition.component.ts","")}}openColumnView(){this.dialogService.openComponent("Edit Columns",u.V,{menuId:n.gT.C_S_MENU_TRADING_NETPOSITION,reptId:n.gT.C_V_COLUMNTEMPLATE_NETPOSITION}).afterClosed().subscribe(r=>{this.onColumnViewClose(r)})}onColumnViewClose(t){1==t&&(this.isFirstReq=!0,this.getNetPositionData())}getDataNP(t){try{this.posType=t,this.rowFilter=this.rows,this.Symbol="",this.getNetPositionData(),this.isDataFound=!1,this.reportGrid.resetFilter(),"0"==t?(this.ooCss="",this.coCss=n.gT.BTN_SELECTED_CLASS,this.noDataFoundMsg="Looks like you have no positions today"):(this.ooCss=n.gT.BTN_SELECTED_CLASS,this.coCss="",this.noDataFoundMsg="Looks like you have no positions ")}catch(r){this.logService.WriteLog("Exception: "+r.message,"getDataNP()","netposition.component.ts","")}}sortData(){try{let d=[];for(var t=this.sortOption,r=this.direction,s=0;s<this.rowFilter.length;s++)d[s]=this.rowFilter[s];switch(t){case"Scrip":d=n.vV.sort(d,"Symbol",r,!1);break;case"NetQty":d=n.vV.sort(d,"NetQty",r,!0);break;case"MTM":d=n.vV.sort(d,"MTM",r,!0);break;default:d=this.rows}this.rowFilter=[],this.rowFilter=d}catch(d){this.logService.WriteLog("Exception: "+d.message,"sortData()","netposition.component.ts","")}}filterScrip(t){try{this.Symbol={key:"Scrip",value:t},this.Symbol1={key:"Scrip",value:t},this.applyFilter(this.Symbol1)}catch(r){this.logService.WriteLog("Exception: "+r.message,"filterScrip()","netposition.component.ts","")}}onExchangeChange(t){try{this.exchange=t,this.applyFilter(this.exchange)}catch(r){this.logService.WriteLog("Exception: "+r.message,"onExchangeChange()","netposition.component.ts","")}}onProductChange(t){try{this.productType=t,this.applyFilter(this.productType)}catch(r){this.logService.WriteLog("Exception: "+r.message,"onProductChange()","netposition.component.ts","")}}applyFilter(t){try{var r=this.rows;null!=this.Symbol1&&""!=this.Symbol1.value&&(r=r.filter(s=>s.Symbol.indexOf(this.Symbol1.value.toUpperCase())>=0)),null!=this.exchange&&"All"!=this.exchange.value&&(r=r.filter(s=>s.Exch.indexOf(this.exchange.value)>=0)),null!=this.productType&&"All"!=this.productType.value&&(r=r.filter(s=>s.ProductType.indexOf(this.productType.value)>=0)),this.rowFilter=[],this.rowFilter=r}catch(s){this.logService.WriteLog("Exception: "+s.message,"applyFilter()","netposition.component.ts","")}}onFilterClick(){try{(null==this.exchange||null==this.productType)&&(this.getExchanges(this.rows),this.getProductType(this.rows)),this.exchange=this.exchArray[0],this.productType=this.productArray[0]}catch(t){this.logService.WriteLog("Exception: "+t.message,"onFilterClick()","netposition.component.ts","")}}getExchanges(t){try{let d;this.exchArray=[];let I=!1;this.exchArray.push({key:"Exch",value:"All"});for(var r=0;r<t.length;r++)if(d=t[r].Exch,this.exchArray.length>0){for(var s=0;s<this.exchArray.length;s++){if(s==this.exchArray.length-1){if(d!=this.exchArray[s].value){I=!0;break}I=!1;break}if(d==this.exchArray[s].value){I=!1;break}I=!0,I=!1}I&&this.exchArray.push({key:"Exch",value:d})}else this.exchArray.push({key:"Exch",value:d})}catch(d){this.logService.WriteLog("Exception: "+d.message,"getExchanges()","netposition.component.ts","")}}getProductType(t){try{this.productArray=[];let d,I=!1;this.productArray.push({key:"Product",value:"All"});for(var r=0;r<t.length;r++)if(d=t[r].ProductType,this.productArray.length>0){for(var s=0;s<this.productArray.length;s++){if(s==this.productArray.length-1){if(d!=this.productArray[s].value){I=!0;break}I=!1;break}if(d==this.productArray[s].value){I=!1;break}I=!0,I=!1}I&&this.productArray.push({key:"Product",value:d})}else this.productArray.push({key:"Product",value:d})}catch(d){this.logService.WriteLog("Exception: "+d.message,"getExchanges()","netposition.component.ts","")}}getCombinedTokenDetails(t,r){try{if(t.reqType=r,1==this.isReqInprocess)return void this.toasterService.toastMessage("warning","Net Position","Previous Request is inprocess");this.isReqInprocess=!0;var s={RequireHeader:1==this.isFirstReq?"1":"0",UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",PosType:this.posType,CombineMktSegmentId:t.SegmentId,CombineToken:t.Token,ProductType:o.X.GetProductTypeValue(t.ProductType)};this.httpService.postData(n.xB.tradingAPIUrl,"CombinedTokenDetails",s).subscribe(d=>{this.getCombinedTokenDetailsCompleted(d,t)},()=>{this.isReqInprocess=!1})}catch(d){this.logService.WriteLog("Exception: "+d.message,"getCombinedTokenDetails","netposition.component.ts","")}}getCombinedTokenDetailsCompleted(t,r){try{let I=t.ResponseObject.objJSONRows;if(this.objCombinedData=[],void 0!==I&&I.length>0)for(var s=0;s<I.length;s++)if(0!=I[s].AllowedNetQty&&n.xB.ExchManager.LoginAllowed[parseInt(I[s].SegmentId,10)]==n.gT.C_S_ON){const M=this.getSlicedOrderRequest(I[s],r.reqType);for(let U=0;U<M.length;U++)this.objCombinedData.push(this.setRowData(M[U]))}this.objCombinedData.length>0?"sqOff"==r.reqType?this.menuManager.invokeMenu(n.gT.C_S_MENU_BULK_OE_SPOT,{sourceId:n.gT.C_S_MENU_TRADING_NETPOSITION,data:this.objCombinedData}):"posConv"==r.reqType?this.dialogService.openComponent("Position Conversion",ne,{Selectedrow:r,CombineTokenDetails:this.objCombinedData}):"sqOffBracketOrder"==r.reqType&&this.objCombinedData.forEach(M=>{this.squareOffForBracketOrder(M)}):"sqOff"==r.reqType?this.dialogService.alert("You are currently not allowed to place order in this segment"):"posConv"==r.reqType?this.dialogService.alert("You are currently not allowed to convert the position for this Segment"):"sqOffBracketOrder"==r.reqType&&this.dialogService.alert("You are currently not allowed to place order in this segment")}catch(I){this.logService.WriteLog("Exception: "+I.message,"getCombinedTokenDetailsCompleted","netposition.component.ts","")}finally{this.isReqInprocess=!1}}setRowData(t){let r;try{var s=new m.u;let d=o.X.isCombinedMktSegId(parseInt(t.SegmentId));s.ScripDet.Token=t.Token,s.ScripDet.MktSegId=parseInt(t.SegmentId),s.ExchangeName=t.Exch,s.InstrumentName=t.Inst,
1s.Symbol=t.Sym,s.Series=t.Series,s.ExpiryDate=t.ExpDate,s.StrikePrice=t.StrPrc,s.OptionType=t.OptType,s.DecimalLocator=t.DecLocator,r={Exch:t.Exch,SquareOff:t.Exch,Instru:t.Inst,Symbol:t.Sym,Series:t.Series,ExpDate:t.ExpDate,StrPrice:t.StrPrc,posConvFlag:n.xB.User.ClientfacilityDic.POSCONV,OptType:t.OptType,MTM:""==t.MTM?"0.00":parseFloat(t.MTM).toFixed(2),NetQty:t.NetQty,AvgNetPrice:t.AvgNetPrc,NetValue:t.NetValue,BuyQty:t.BuyQty,BuyValue:t.BuyValue,AvgBuyPrice:t.AvgBuyPrc,SellQty:t.SellQty,SellValue:t.SellValue,AvgSellPrice:t.AvgSellPrc,LTP:t.LTP,ProductType:t.ProdType,Token:t.Token,SegmentId:o.X.GetMappedMarketSegmentId(t.SegmentId),RegularLot:t.RegularLot,PriceNum:t.PriceNum,PriceDen:t.PriceDen,GenNum:t.GenNum,GenDen:t.GenDen,DecimalLocator:t.DecLocator,PriceTick:t.PrcTick,orderSide:"",cellClassName:"",MWSecurityDesc:o.X.FormatScripDescForMW(s),scrip:s,isCombined:d,prefMktSegId:d||t.PrefMktSegId>0?t.PrefMktSegId:t.SegmentId,prefToken:d||t.PrefToken>0?t.PrefToken:t.Token,allowedNetQty:t.AllowedNetQty,RefRate:t.RefRate,isFirstBcastRsp:!1,CFAvgPrice:t.CFAvgPrice,CFBuyValue:t.CFBuyValue,CFSellValue:t.CFSellValue,UnsettledQty:t.UnsettledQty,BrokerageValue:t.BrokerageValue,MaxSingleTransactionQty:t.MaxSingleTransactionQty},r.CFAvgPrice="1"==this.posType?""!=r.CFAvgPrice&&null!=r.CFAvgPrice?r.CFAvgPrice:parseFloat("0.00").toFixed(2):""}catch(d){this.logService.WriteLog("Exception: "+d.message,"setRowData","netposition.component.ts","")}return r}createOrderEntryRequest(t){var r;try{(r=new h.Q(t.scrip)).OrderSide=t.NetQty>0?n.gT.C_S_ORDER_SELL_TEXT:n.gT.C_S_ORDER_BUY_TEXT,r.MarketLot=t.RegularLot,r.PriceTick=t.PriceTick,r.Qty=Math.abs(t.NetQty).toString(),r.UnsettledQty=t.UnsettledQty,r.Price=0,r.IsSpread=!1,r.ProductType=t.ProductType,r.PageSource=n.gT.C_V_NETPOSITION_PAGENO.toString(),r.OrderType=n.gT.C_S_ORDER_REGULARLOT_MARKET_TEXT}catch(s){this.logService.WriteLog("Exception: "+s.message,"createOrderEntryRequest()","netposition.component.ts","")}return r}ngOnDestroy(){try{for(var t=0;t<this.ArrSubTokens.length;t++)this.pubsubService.unsubscribe(this.ArrSubTokens[t]);setTimeout(()=>{this.tradingSharedService.sendTouchLineRequest(this.scripList,2)},1e3),this.ArrSubTokens=[],this.dblSumMTM=0}catch(r){this.logService.WriteLog("Exception: "+r.message,"ngOnDestroy()","netposition.component.ts","")}}squareOffForBracketOrder(t){try{this.httpService.postData(n.xB.tradingAPIUrl,"SquareOffBracketOrder",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",MktSegId:t.scrip.ScripDet.MktSegId,ScripTkn:t.scrip.ScripDet.Token}).subscribe(s=>{},s=>{this.logService.WriteLog("Exception: "+s.message,"squareOffForBracketOrder()","netposition.component.ts","")})}catch(r){this.logService.WriteLog("Exception: "+r.message,"squareOffForBracketOrder()","netposition.component.ts","")}}AllRowsSquareOff(){try{this.SORequestList=[];for(var t=0;t<this.rows.length;t++){const s=Object.assign({},this.rows[t]);var r=this.createOrderEntryRequest(s);if(s.ProductType!=n.gT.C_S_PRODUCTTYPE_MP_TEXT&&s.ProductType!=n.gT.C_S_PRODUCTTYPE_BRACKET_ORDER_TXT&&"0"!=r.Qty&&!r.Instrument.startsWith("AUC")){if(s.isCombined){s.Token=s.prefToken,s.SegmentId=o.X.GetMappedMarketSegmentId(s.prefMktSegId);const I=o.X.GetExchangeName(s.prefMktSegId);s.Exch=I,s.SquareOff=I,s.allowedNetQty=parseInt(s.NetQty);const M=new m.u;M.ScripDet.Token=s.prefToken,M.ScripDet.MktSegId=parseInt(s.prefMktSegId),M._ExchangeName=I,M.ExchangeName=I,M.InstrumentName=s.Instru,M.Symbol=s.Symbol,M.Series=s.Series,M.ExpiryDate=s.ExpDate,M.StrikePrice=s.StrPrice,M.OptionType=s.OptType,M.DecimalLocator=s.DecimalLocator,s.MWSecurityDesc=o.X.FormatScripDescForMW(M),s.scrip=M}else s.allowedNetQty=parseInt(s.NetQty);const d=this.getSlicedOrderRequest(s);for(let I=0;I<d.length;I++)this.SORequestList.push(d[I])}}this.SORequestList.length>0?this.menuManager.invokeMenu(n.gT.C_S_MENU_BULK_OE_SPOT,{sourceId:n.gT.C_S_MENU_TRADING_NETPOSITION,data:this.SORequestList,SqOffAll:!0}):this.dialogService.alert("No quantity available to square off")}catch(s){this.logService.WriteLog("Exception: "+s.message,"AllRowsSquareOff()","netposition.component.ts","")}}
1getSlicedOrderRequest(t,r="sqOff"){let s=[];try{const d=t.hasOwnProperty("AllowedNetQty")?"AllowedNetQty":"allowedNetQty";if("sqOff"==r&&t.MaxSingleTransactionQty>0&&Math.abs(t[d])>t.MaxSingleTransactionQty&&n.xB.User.OrderPrefDic.containsKey(t.SegmentId)&&n.xB.User.OrderPrefDic[t.SegmentId].nEnableSlicing&&n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_ORDERSLICING)){const I=parseInt(t.MaxSingleTransactionQty),M=Math.abs(t[d]),U=Math.floor(M/I);for(let j=0;j<U;j++){const Ie=Object.assign({},t);Ie.NetQty=I,Ie[d]=I,s.push(Ie)}const q=M%I;if(q>0){const j=Object.assign({},t);j.NetQty=q,j[d]=q,s.push(j)}}else s.push(t)}catch(d){this.logService.WriteLog("Exception: "+d.message,"getSlicedOrderRequest()","netposition.component.ts","")}return s}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(i._),e.\u0275\u0275directiveInject(P.F),e.\u0275\u0275directiveInject(ia.M))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["netposition"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(la,7),e.\u0275\u0275viewQuery(oa,7),e.\u0275\u0275viewQuery(ca,5),e.\u0275\u0275viewQuery(da,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplSquareOff=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplPositionConv=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmpFooterValue=s.first)}},decls:27,vars:23,consts:[[1,"Net_position_parent"],[1,"container-fluid"],[4,"ngIf"],[1,"Select_orders"],["mat-raised-button","",1,"tab-button",3,"ngClass","click"],[3,"ngClass",4,"ngIf"],[1,"Net_position_Row1"],[1,"Net_position_Select_orders"],["class","Net_position_Filtericons",4,"ngIf"],["class","row reportHrd",4,"ngIf"],[3,"hidden"],[3,"layoutMode","showPaging","fhTopHeight","pageSize","blockViewTmpl","extendedPageSize","noDataFoundMsg","fixedHdrConfig","columns","rows","showFooter","footerData","showFilter","showSort"],["reportGrid",""],["cellTmplSquareOff",""],["cellTmpFooterValue",""],["blockViewTmpl",""],[3,"type"],[3,"ngClass"],["disableOptionCentering","true",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"Net_position_Filtericons"],["href","javascript:void(0);",1,"Holding_tab_menu","holding_tab",3,"click"],["class","filtericon Global_Filter",3,"matTooltip","click",4,"ngIf"],[1,"btn-ref","Global_Filter",3,"matTooltip","click"],["class","btn-export Global_Filter",3,"matTooltip","click",4,"ngIf"],["class","ColumnsViewicon Global_Filter",3,"matTooltip","click",4,"ngIf"],[1,"filtericon","Global_Filter",3,"matTooltip","click"],[1,"btn-export","Global_Filter",3,"matTooltip","click"],[1,"ColumnsViewicon","Global_Filter",3,"matTooltip","click"],[1,"row","reportHrd"],[1,"float-right","displayInFlex"],[1,"btn-ref","float-left",3,"matTooltip","click"],["dropdown",""],["href","javascript:void(0);","dropdown-open","","class","dropdown-toggle","data-toggle","dropdown",3,"className",4,"ngIf"],["dropdown-not-closable-zone","",1,"dropdown-userInfo"],[1,"dropdown"],[1,"",3,"ngModel","ngModelChange"],["title","Submit",3,"click"],["href","javascript:void(0);","dropdown-open","","class","dropdown-toggle","data-toggle","dropdown",3,"className","click",4,"ngIf"],["type","text","placeholder","Symbol","Uppercase","",3,"ngModel","ngModelChange"],["class","btn-export float-right",3,"click",4,"ngIf"],["href","javascript:void(0);","dropdown-open","","data-toggle","dropdown",1,"dropdown-toggle",3,"className"],[1,"caret"],["href","javascript:void(0);","dropdown-open","","data-toggle","dropdown",1,"dropdown-toggle",3,"className","click"],[1,"btn-export","float-right",3,"click"],["href","javascript:void(0);",1,"link-wrap",3,"click"],["class","seprator",4,"ngIf"],["href","javascript:void(0);","class","link-wrap",3,"click",4,"ngIf"],[1,"seprator"],[3,"innerHTML","className"],[1,"profile_scroll","BlockView"],[1,"rptgrid"],[1,"scripDetails"],[1,"marright-50",3,"ngClass","innerHTML"],[1,"float-right"],["type","button",1,"PosConvBtn",3,"click"],["type","button",1,"SqaureOffBtn",3,"click"]],template:function(t,r){if(1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,ha,2,1,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275elementStart(4,"ul"),e.\u0275\u0275elementStart(5,"li"),e.\u0275\u0275elementStart(6,"button",4),e.\u0275\u0275listener("click",function(){return r.getDataNP("0")}),e.\u0275\u0275text(7,"Today's Position"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"li"),e.\u0275\u0275elementStart(9,"button",4),e.\u0275\u0275listener("click",function(){return r.getDataNP("1")}),e.\u0275\u0275text(10,"Overall Position"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(11,pa,3,0,"li",2),e.\u0275\u0275template(12,ma,3,2,"li",5),e.\u0275\u0275template(13,Sa,6,2,"li",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",6),e.\u0275\u0275element(15,"div",7),e.\u0275\u0275template(16,fa,13,4,"div",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(17,xa,39,15,"div",9),e.\u0275\u0275elementStart(18,"div",10),e.\u0275\u0275element(19,"reportgrid",11,12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(21,Aa,4,2,"ng-template",null,13,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(23,La,1,2,"ng-template",null,14,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(25,Fa,35,27,"ng-template",null,15,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&t){const s=e.\u0275\u0275reference(26);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngClass",r.coCss),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",r.ooCss),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isDataFound),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.isDataFound),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showInterop),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","G"==r.layoutMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","B"==r.layoutMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",r.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("layoutMode",r.layoutMode)("showPaging",!0)("fhTopHeight","40px")("pageSize",r.NP_PageSize)("blockViewTmpl",s)("extendedPageSize",r.NP_extendedPageSize)("noDataFoundMsg",r.noDataFoundMsg)("fixedHdrConfig",r.fixedHdrConfig)("columns",r.columns)("rows",r.rowFilter)("showFooter",r.showFooter)("footerData",r.footerData)("showFilter",r.showFilter)("showSort",!0)}},directives:[W.O5,Q.lW,W.mk,Me.i,V.R,_.KE,k.gD,a.JJ,a.On,W.sg,H.ey,ue.gM,ra.Ye,na.w,aa.i,ht.VQ,a.Fj,sa.X,ht.U0],encapsulation:2}),S})();var ka=x(2533),Va=x(6340);
1function Ra(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",5),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Na(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"reportgrid",7),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("fhTopHeight","30px")("fixedHdrConfig",t.fixedHdrConfig)("noDataFoundMsg",t.noDataFoundMsg)("columns",t.columns)("rows",t.rows)}}let Yr=(()=>{class S{constructor(t,r,s){this.logService=t,this.httpService=r,this.datepipe=s,this.showProgressBar=!1,this.isRowsAvailable=!1,this.isFirstReq=!0,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"},this.ProductId="",this.noDataFoundMsg="No records available"}ngOnInit(){try{this.getFundAllocationData()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","fundAllocationReport.component.ts","")}}refresh(){this.getFundAllocationData()}getFundAllocationData(){try{this.showProgressBar=!0,this.isRowsAvailable=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetFundAllocationReportData",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",ProdId:this.ProductId}).subscribe(r=>{this.getFundAllocationDataCompleted(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getFundAllocationData()","fundAllocationReport.component.ts","")}}getFundAllocationDataCompleted(t){this.showProgressBar=!1;try{this.rows=[];var r=t.ResponseObject;this.isFirstReq&&(this.initHeaders(r.objJSONHeader),this.isFirstReq=!1);var s=r.objJSONRows;if(void 0!==s&&s.length>0){for(var d=0;d<s.length;d++)this.rows.push({TransactionType:s[d].TransactionType,MovedFromProduct:s[d].MovedFromProduct,MovedToProduct:s[d].MovedToProduct,Amount:s[d].Amount,TransactionRefNo:s[d].TransactionRefNo,TransactionDateTime:this.datepipe.transform(s[d].TransactionDateTime,"dd-MMM-yyyy HH:mm:ss")});this.isRowsAvailable=!0}else this.isRowsAvailable=!0}catch(I){this.logService.WriteLog("Exception: "+I.message,"getFundAllocationCompleted()","fundAllocationReport.component.ts","")}}initHeaders(t){this.columns=[],this.columns.push({value:"TransactionType",name:"Transaction Type",cType:"S"}),this.columns.push({value:"MovedFromProduct",name:"Moved From Product",cType:"S"}),this.columns.push({value:"MovedToProduct",name:"Moved To Product",cType:"S"}),this.columns.push({value:"Amount",name:"Amount",cType:"N"}),this.columns.push({value:"TransactionRefNo",name:"Transaction Ref. No",cType:"N"}),this.columns.push({value:"TransactionDateTime",name:"Transaction Date & Time",cType:"S"})}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(W.uU))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["fund-allocation-report"]],decls:5,vars:3,consts:[[1,"fundAllocationR"],[4,"ngIf"],[1,"pull-right","t-padd"],[1,"btn-ref","Global_Filter","marr0",3,"matTooltip","click"],["class","mwtable2",4,"ngIf"],[3,"type"],[1,"mwtable2"],[3,"fhTopHeight","fixedHdrConfig","noDataFoundMsg","columns","rows"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,Ra,2,1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"button",3),e.\u0275\u0275listener("click",function(){return r.refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Na,2,5,"div",4),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.showProgressBar))},directives:[W.O5,ue.gM,V.R,Me.i],encapsulation:2}),S})();function wa(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",5),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Ba(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"reportgrid",7),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("fhTopHeight","30px")("fixedHdrConfig",t.fixedHdrConfig)("noDataFoundMsg",t.noDataFoundMsg)("columns",t.columns)("rows",t.rows)}}
1let Xr=(()=>{class S{constructor(t,r){this.logService=t,this.httpService=r,this.showProgressBar=!1,this.isRowsAvailable=!1,this.isFirstReq=!0,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"},this.noDataFoundMsg="No records available"}ngOnInit(){try{this.Initialize(this.context.params)}catch(r){this.logService.WriteLog("Exception: "+r.message,"ngOnInit()","creditForSaleReport.component.ts","")}}refresh(){this.getCFSData()}Initialize(t){null!=t&&(this.Periodicity=t.Periodicities),this.getCFSData()}getCFSData(){try{this.showProgressBar=!0,this.isRowsAvailable=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetCreditForSaleReport",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",PeriodicityId:this.Periodicity}).subscribe(r=>{this.getCFSDataCompleted(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getCFSData()","creditForSaleReport.component.ts","")}}getCFSDataCompleted(t){this.showProgressBar=!1;try{this.rows=[];var r=t.ResponseObject;this.isFirstReq&&(this.initHeaders(r.objJSONHeader),this.isFirstReq=!1);var s=r.objJSONRows;if(void 0!==s&&s.length>0){for(var d=0;d<s.length;d++)this.rows.push({ScripName:s[d].ScripName,ISIN:s[d].ISIN,DPCFSQty:s[d].DPCFSQty,POOLCFSQty:s[d].POOLCFSQty,SARCFSQty:s[d].SARCFSQty,CFSValue:s[d].CFSValue});this.isRowsAvailable=!0}else this.isRowsAvailable=!0}catch(I){this.logService.WriteLog("Exception: "+I.message,"getCFSDataCompleted()","creditForSaleReport.component.ts","")}}initHeaders(t){this.columns=[],this.columns.push({value:"ScripName",name:"Scrip Name",cType:"S"}),this.columns.push({value:"ISIN",name:"ISIN",cType:"S"}),this.columns.push({value:"DPCFSQty",name:"DP CFS Qty",cType:"N"}),this.columns.push({value:"POOLCFSQty",name:"POOL CFS Qty",cType:"N"}),this.columns.push({value:"SARCFSQty",name:"SAR CFS Qty",cType:"N"}),this.columns.push({value:"CFSValue",name:"CFS Value",cType:"N"})}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.OE))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["credit-for-sale-report"]],inputs:{context:"context"},decls:5,vars:3,consts:[[1,"creaditForSaleR"],[4,"ngIf"],[1,"pull-right","t-padd"],[1,"btn-ref","Global_Filter","marr0",3,"matTooltip","click"],["class","mwtable2",4,"ngIf"],[3,"type"],[1,"mwtable2"],[3,"fhTopHeight","fixedHdrConfig","noDataFoundMsg","columns","rows"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,wa,2,1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"button",3),e.\u0275\u0275listener("click",function(){return r.refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Ba,2,5,"div",4),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.showProgressBar))},directives:[W.O5,ue.gM,V.R,Me.i],encapsulation:2}),S})();function Ga(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",5),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function Ua(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"reportgrid",7),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("fhTopHeight","30px")("fixedHdrConfig",t.fixedHdrConfig)("noDataFoundMsg",t.noDataFoundMsg)("columns",t.columns)("rows",t.rows)}}let Kr=(()=>{class S{constructor(t,r){this.logService=t,this.httpService=r,this.showProgressBar=!1,this.isRowsAvailable=!1,this.isFirstReq=!0,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"},this.noDataFoundMsg="No records available"}ngOnInit(){try{this.Initialize(this.context.params),this.getCBRData()}catch(r){this.logService.WriteLog("Exception: "+r.message,"ngOnInit()","collateralBenefitReoprt.component.ts","")}}Initialize(t){null!=t&&(this.Periodicity=t.Periodicities)}refresh(){this.getCBRData()}getCBRData(){try{this.showProgressBar=!0,this.isRowsAvailable=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetCollateralBenefitReport",{UserID:n.xB.User.
1UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",PeriodicityId:this.Periodicity}).subscribe(r=>{this.getCBRDataCompleted(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getCBRData()","collateralBenefitReoprt.component.ts","")}}getCBRDataCompleted(t){this.showProgressBar=!1;try{this.rows=[];var r=t.ResponseObject;if(this.isFirstReq&&(this.initHeaders(r.objJSONHeader),this.isFirstReq=!1),void 0!==(r=r.objJSONRows)&&r.length>0){for(var s=0;s<r.length;s++)this.rows.push({ScripName:r[s].ScripName,ISIN:r[s].ISIN,DPCollateralQty:r[s].DPCollateralQty,POOLCollateralQty:r[s].POOLCollateralQty,SARCollateralQty:r[s].SARCollateralQty,CollateralPrice:r[s].CollateralPrice,AvgHairCut:r[s].AvgHairCut,CollateralValue:r[s].CollateralValue});this.isRowsAvailable=!0}else this.isRowsAvailable=!0}catch(d){this.logService.WriteLog("Exception: "+d.message,"getCBRDataCompleted()","collateralBenefitReoprt.component.ts","")}}initHeaders(t){this.columns=[],this.columns.push({value:"ScripName",name:"Scrip Name",cType:"S"}),this.columns.push({value:"ISIN",name:"ISIN",cType:"S"}),this.columns.push({value:"DPCollateralQty",name:"DP Collateral Qty",cType:"N"}),this.columns.push({value:"POOLCollateralQty",name:"POOL Collateral Qty",cType:"N"}),this.columns.push({value:"SARCollateralQty",name:"SAR Collateral Qty",cType:"N"}),this.columns.push({value:"CollateralPrice",name:"Collateral Price",cType:"N"}),this.columns.push({value:"AvgHairCut",name:"Avg Hair Cut %",cType:"N"}),this.columns.push({value:"CollateralValue",name:"Collateral Value",cType:"N"})}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.OE))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["collateral-benefit-report"]],inputs:{context:"context"},decls:5,vars:3,consts:[[1,"collateralBenefitR"],[4,"ngIf"],[1,"pull-right","t-padd"],[1,"btn-ref","Global_Filter","marr0",3,"matTooltip","click"],["class","mwtable2",4,"ngIf"],[3,"type"],[1,"mwtable2"],[3,"fhTopHeight","fixedHdrConfig","noDataFoundMsg","columns","rows"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,Ga,2,1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"button",3),e.\u0275\u0275listener("click",function(){return r.refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Ua,2,5,"div",4),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.showProgressBar))},directives:[W.O5,ue.gM,V.R,Me.i],encapsulation:2}),S})();function Wa(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.errMsg)}}const Ha=function(S){return{color:S}};function Qa(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"li",46),e.\u0275\u0275elementStart(1,"span",47),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span",48),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(3,Ha,t.color)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.legNm),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.scripCnt)}}function Ya(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",44),e.\u0275\u0275elementStart(1,"ul"),e.\u0275\u0275template(2,Qa,6,5,"li",45),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.arrLegends)}}function Xa(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",41),e.\u0275\u0275element(1,"nvd3",42),e.\u0275\u0275template(2,Wa,3,1,"div",5),e.\u0275\u0275template(3,Ya,3,1,"div",43),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("options",t.options)("data",t.fundData),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.fundData),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.arrLegends)}}
1function Ka(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",49),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function za(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",52),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).OnSelPeriodicity(d,!0)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&S){const t=O.$implicit;e.\u0275\u0275property("ngClass",t.className),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.value)}}function Ja(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",50),e.\u0275\u0275template(1,za,2,2,"button",51),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.dcPeriodicities)}}function qa(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"mat-option",56),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.PeriodicityName)}}function Za(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",53),e.\u0275\u0275elementStart(1,"mat-form-field"),e.\u0275\u0275elementStart(2,"mat-select",54),e.\u0275\u0275listener("selectionChange",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext();return s.OnSelPeriodicity(s.SelPeriodicity,!0)})("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().SelPeriodicity=s}),e.\u0275\u0275template(3,qa,2,2,"mat-option",55),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.SelPeriodicity),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.dcPeriodicities)}}function $a(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tr"),e.\u0275\u0275elementStart(1,"td"),e.\u0275\u0275elementStart(2,"h1",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5HoldingCollateralLimit=s}),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td",17),e.\u0275\u0275elementStart(5,"span",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5HoldingCollateralLimitVal=s}),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5HoldingCollateralLimit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5CollateralLimitText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5HoldingCollateralLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5CollateralLimitVal)}}function ja(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tr"),e.\u0275\u0275elementStart(1,"td"),e.\u0275\u0275elementStart(2,"h1",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5HoldingHaircutLimit=s}),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td",17),e.\u0275\u0275elementStart(5,"span",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5HoldingHaircutLimitVal=s}),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5HoldingHaircutLimit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5HaircutLimitText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5HoldingHaircutLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5HaircutLimitVal)}}function es(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tr"),e.\u0275\u0275elementStart(1,"td"),e.\u0275\u0275elementStart(2,"h1",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5CFSText=s}),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td",17),e.\u0275\u0275elementStart(5,"span",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5CFSLimitVal=s}),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5CFSText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5CFSText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5CFSLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5CFSLimitVal)}}function ts(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tr"),e.\u0275\u0275elementStart(1,"td"),e.\u0275\u0275elementStart(2,"h1",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5HaircutCFSText=s}),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td",17),e.\u0275\u0275elementStart(5,"span",24),e.\u0275\u0275listener("ngModelChange",function(s){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().T5HaircutCFSVal=s}),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5HaircutCFSText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5HaircutCFSText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",t.T5HaircutCFSVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.T5HaircutCFSVal)}}let zr=(()=>{class S{constructor(t,r,s,d,I,M,U,q){this.menuManager=t,this.httpService=r,this.logService=s,this.pubsubService=d,this.dialogService=I,this.tradingService=M,this.ref=U,this.themeService=q,this.showProgressBar=!1,this.selfFundsVM=this,this.focusElement="ddlPeriodicities",this.PeriodicityLabel=n.xB.dConfigMaster.EXCHANGE_CAPTION+":",this.PeriodictyCaption=this.PeriodicityLabel,this.dcPeriodicities=[],this.dcSeqPerio
1dicities=[],this.dcTempPeriodicities=[],this.arrLegends=[],this.ContainerId="",this.ReportName="",this.FixedHeaderConfig={columnAlign:"center"},this.dtHeaders=[],this.dtRows=[],this.SelectedValue="",this.isDataLoaded=!1,this.isNoDataFound=!1,this.isDataFound=!1,this.isBackVisible=!1,this.isRefreshEnabled=!0,this.bShowDropDown=!0,this.ExpandTreeViewCSS=n.gT.CSS_ExpandCheckBoxTreeView,this.CollapseTreeViewCSS=n.gT.CSS_CollapseCheckBoxTreeView,this.HeadDesc="Description",this.HeadTrading="Trading",this.HeadIPO="IPO",this.HeadMF="MF",this.HeadTotal="Total",this.IsIPOVisible=!0,this.IsMFVisible=!0,this.IsTotalVisible=!0,this.IsNormalDepositHeadsVisible=!0,this.DepSummaryCss=this.ExpandTreeViewCSS,this.IsDepositSection_10004Visible=!1,this.IsDeposit_10004Visible=!1,this.CashDeposit="",this.IsAdHocDepositVisible=!0,this.AdhocDeposit="",this.AdhocDepositVal="",this.OverdraftLimit="",this.OverdraftLimitVal="",this.NotionalDeposit="",this.NotionalDepositVal="",this.MiscDeposit="",this.MiscDepositVal="",this.ManualCollateral="",this.ManualCollateralVal="",this.FTDText="",this.FTDTrading="",this.FTDIPO="",this.FTDMF="",this.FTDTotal="",this.FWText="",this.FWTrading="",this.FWIPO="",this.FWMF="",this.FWTotal="",this.AdDepositText="",this.AdDepositTrading="",this.AdDepositIPO="",this.AdDepositMF="",this.AdDepositTotal="",this.IsCBVisible=!1,this.CBSummaryCss=this.ExpandTreeViewCSS,this.CollBenText="",this.CollBenTrading="",this.CollBenIPO="",this.CollBenMF="",this.CollBenTotal="",this.CollBenDPText="",this.CollBenDPVal="",this.CollBenPoolText="",this.CollBenPoolVal="",this.CollBenSARText="",this.CollBenSARVal="",this.IsCollatDPPledged_10004Visible=!1,this.CollatDPPledged="",this.CollatDPPledgedVal="",this.IsCollatPoolPledged_10004Visible=!1,this.CollatPoolPledged="",this.CollatPoolPledgedVal="",this.IsCollatMaxLimit_10004Visible=!1,this.CollatMaxLimit="",this.CollatMaxLimitVal="",this.IsCFSVisible=!1,this.CFSSummaryCss=this.ExpandTreeViewCSS,this.CreditForSaleText="",this.CreditForSaleTrading="",this.CreditForSaleIPO="",this.CreditForSaleMF="",this.CreditForSaleTotal="",this.CreditForSaleDPText="",this.CreditForSaleDPVal="",this.CreditForSalePoolText="",this.CreditForSalePoolVal="",this.CreditForSaleSARText="",this.CreditForSaleSARVal="",this.IsCFSMaxLimit_10004=!1,this.CFSMaxLimit="",this.CFSMaxLimitVal="",this.IsOptionCFS_10004Visible=!1,this.OptionCFSTradingVal="",this.OptionCFSIPOVal="",this.OptionCFSMFVal="",this.OptionCFSTotalVal="",this.IsOptionCFSSection_10004Visible=!1,this.OptionCFSSec="",this.OptionCFSSecVal="",this.IsOptionCFSMax_10004Visible=!1,this.OptCFSSummaryCss=this.ExpandTreeViewCSS,this.OptionCFSText="",this.OptionCFSMax="",this.OptionCFSMaxVal="",this.IsMultiplier_10004Visible=!1,this.MultiplierVal="",this.MultiplierTradingVal="",this.MultiplierIPOVal="",this.MultiplierMFVal="",this.MultiplierTotalVal="",this.TradingLimitText="",this.TradingLimitVal="",this.TradingLimitIPOVal="",this.TradingLimitMFVal="",this.TradingLimitTotal="",this.IsLUVisible=!1,this.LUSummaryCss=this.ExpandTreeViewCSS,this.LimitUtilText="",this.LimitUtilTradingVal="",this.LimitUtilIPOVal="",this.LimitUtilMFVal="",this.LimitUtilTotalVal="",this.LimitUtilEqText="",this.LimitUtilEqVal="",this.LimitUtilDervText="",this.LimitUtilDervVal="",this.LimitUtilCommText="",this.LimitUtilCommVal="",this.LimitUtilCurrText="",this.LimitUtilCurrVal="",this.LimitUtilMFText="",this.LimitUtilMFValue="",this.IsBookedPLVisible=!1,this.BookPLSummaryCss=this.ExpandTreeViewCSS,this.BookedPLText="",this.BookedPLTradingVal="",this.BookedPLIPO="",this.BookedPLMF="",this.BookedPLTotalVal="",this.BookedPLEqText="",this.BookedPLEqVal="",this.BookedPLEqDervText="",this.BookedPLEqDervVal="",this.BookedPLCommText="",this.BookedPLCommVal="",this.BookedPLCurrText="",this.BookedPLCurrVal="",this.IsMTMVisible=!1,this.MTMSummaryCss=this.ExpandTreeViewCSS,this.MTMPLText="",this.MTMPLTradingVal="",this.MTMPLIPOVal="",this.MTMPLMFVal="",this.MTMPLTotalVal="",this.MTMPLEqText="",this.MTMPLEqVal="",this.MTMPLDervText="",this.MTMPLDervVal="",this.MTMPLCommText="",this.MTMPLCommVal="",this.MTMPLCurrText="",this.MTMPLCurrVal="",this.TotalUtilText="",this.TotalUtilTradVal="",this.TotalUtilIPOVal="",this.TotalUtilMFVal="",this.TotalUtilTotVal="",this.NetAvailText="",this.NetAvailTradVal="",this.NetAvailIPOVal="",this.NetAvailMFVal="",this.NetAvailTotalVal="",this.ForTradText="",this.ForTradVal="",this.ForTradIPOVal="",this.ForTradMFVal="",this.ForTradTotalVal="",this.ForAllocWdrwText="",this.ForAllocWdrwVal="",this.ForAllocWdrwIPOVal="",this.ForAllocWdrwMFVal="",this.ForAllocWdrwTotalVal="",this.obj="",this.dtCells=[],this.btnSelectedCss=n.gT.BTN_SELECTED_CLASS,this.fundData=[],this.FVPeriodicities={Periodicity:"0"},this.ShowFundsViewT5=!1,this.T5CollateralLimitText="",this.T5CollateralLimitVal="",this.T5HaircutLimitText="",this.T5HaircutLimitVal="",this.T5CFSText="",this.T5CFSLimitVal="",this.T5HaircutCFSText="",this.T5HaircutCFSVal="",this.OptionCFSCss="",this.DepositCss="",this.TradingLimitValCss="",this.CBValueCss="",this.CFSValueCss="",this.MTMValueCss="",this.MRValueCss="",this.NetAvailValueCss="",this.TradTotalValueCss="",this.AllocWdrwValueCss="",this.FWTradingCss=""}ngOnInit(){try{this.bShowDropDown=n.xB.dConfigMaster.FINALYTICS_FUNDSVIEW_SHOWDROPDOWN==n.gT.C_S_ON,this.ShowFundsViewT5=n.xB.dConfigMaster.FUNDSVIEW_NEW_T5==n.gT.C_S_ON,this.tradingService.fillPeriodicities().subscribe(t=>{this.GetPeriodicitiesCompleted(t)}),this.themeSub=this.themeService.themeChangeDetect.subscribe(t=>{this.refreshAdvFundsView()})}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","fundview.component.ts","")}}ngOnDestroy(){}getData(){this.DepositCss=this.getCss(this.DepositTrading),this.OptionCFSCss=this.getCss(this.OptionCFSTradingVal),this.TradingLimitValCss=this.getCss(this.TradingLimitVal),this.NetAvailValueCss=this.getCss(this.NetAvailTradVal),this.TradTotalValueCss=this.getCss(this.ForTradVal),this.AllocWdrwValueCss=this.getCss(this.ForAllocWdrwVal),this.CBValueCss=this.getCss(Number(this.CollBenTrading)),this.CFSValueCss=this.getCss(Number(this.CreditForSaleTrading)),this.MRValueCss=this.getCss(Number(this.BookedPLTradingVal)),this.MTMValueCss=this.getCss(Number(this.MTMPLTradingVal)),this.FWTradingCss=this.getCss(Number(this.FWTrading)),this.Deposit=Math.abs(this.TradingLimitVal),this.NetAvailTotalVal=Math.abs(this.NetAvailTradVal),this.TotalUtilization=Math.abs(this.TotalUtilTradVal),this.arrLegends=[{color:n.US.FUNDVIEW.UTILIZED_MARGIN,legNm:"Utilized Margin",scripCnt:parseFloat(this.TotalUtilization).toFixed(2)},{color:n.US.FUNDVIEW.NET_AVAILABLE,legNm:"Net Available ",scripCnt:parseFloat(this.ForTradVal).toFixed(2)}],this.options={chart:{type:"pieChart",height:200,width:200,donut:!0,donutRatio:.65,x:function(r){return r.key},y:function(r){return r.y},showLabels:!1,showLegend:!1,duration:500,tooltip:{valueFormatter:(r,s)=>r},noData:"No Data Found"}};var t=[{key:"Total Utilization",y:this.TotalUtilization.toFixed(2),color:n.US.FUNDVIEW.UTILIZED_MARGIN},{key:"Net Available Value",y:this.NetAvailTotalVal.toFixed(2),color:n.US.FUNDVIEW.NET_AVAILABLE}];this.fundData=t,"0.00"==this.NetAvailTradVal&&"0.00"==this.TotalUtilTradVal&&"0.00"==this.Deposit&&(this.fundData=[],this.arrLegends=[],this.errorMsg="No Data Found",this.Deposit="")}openDialog(t,r,s){var d,I;switch(t.stopImmediatePropagation(),I=this.bShowDropDown?this.SelPeriodicity.nPeriodicity:this.PeriodicityKey,r){case"FT":this.dialogService.openComponent("Funds Report",Hr,d={ProductId:s},"850px","450px",!0).afterClosed().subscribe(U=>{this.onOpenDialogClose(U)});break;case"FAW":this.dialogService.openComponent("Fund Allocation Report",Yr,d={ProductId:s},"900px","350px",!0).afterClosed().subscribe(U=>{this.onOpenDialogClose(U)});break;case"CB":this.dialogService.openComponent("Collateral Benefit Report",Kr,d={Periodicities:I},"900px","350px",!0).afterClosed().subscribe(U=>{this.onOpenDialogClose(U)});break;case"CFS":this.dialogService.openComponent("Credit For Sale Report",Xr,d={Periodicities:I},"900px","350px",!0).afterClosed().subscribe(U=>{this.onOpenDialogClose(U)});break;case"MR":d={ReportType:s,Periodicities:Number(I)},this.dialogService.openComponent("Margin Report",kr,d,"1000px","450px",!0).afterClosed().subscribe(U=>{this.onOpenDialogClose(U)})}}onOpenDialogClose(t){}GetPeriodicitiesCompleted(t){this.showProgressBar=!1;try{if(null!=t&&null!=t.ResponseObject){var r=t.ResponseObject.Table1,s=t.ResponseObject.dtPeriodicities,d=t.ResponseObject.dtPeriodictySeq,I=!1;if(n.xB.dConfigMaster.FINALYTICS_FUNDSVIEW_SHOWDROPDOWN==n.gT.C_S_ON){if(void 0!==d&&d.length>0){this.dcPeriodicities=s;for(var M=0;M<s.length;M++)if(s[M].nPeriodicity==d[0].Periodicity){this.SelPeriodicity=s[M],this.GetAdvFundsView(this.SelPeriodicity.nPeriodicity),I=!0;break}}I||(this.dcPeriodicities=s,this.SelPeriodicity=s[0],this.GetAdvFundsView(this.SelPeriodicity.nPeriodicity))}else if(r.length>0){for(r.length>3&&r.splice(0-(r.length-3),r.length-3),M=0;M<r.length;
1M++)this.dcPeriodicities.push({nPeriodicity:r[M].Periodicity,value:r[M].PeriodicityName,className:""});this.OnSelPeriodicity(this.dcPeriodicities[0],!1)}}this.ref.markForCheck()}catch(U){this.logService.WriteLog("Exception: "+U.message,"GetPeriodicitiesCompleted()","fundview.component.ts","")}}OnSelPeriodicity(t,r){try{this.showProgressBar=!0;for(var s=0;s<this.dcPeriodicities.length;s++)this.dcPeriodicities[s].className="";t.className=this.btnSelectedCss,this.bShowDropDown?null!=this.SelPeriodicity&&r&&this.GetAdvFundsView(this.SelPeriodicity.nPeriodicity):(this.PeriodicityKey=t.nPeriodicity,this.SelPeriodicity=t,r&&this.GetAdvFundsView(this.SelPeriodicity.nPeriodicity)),null!=this.SelPeriodicity.nPeriodicity&&""!=this.SelPeriodicity.nPeriodicity&&(this.FVPeriodicities.Periodicity=this.SelPeriodicity.nPeriodicity,this.pubsubService.publish("FundviewRefresh",this.FVPeriodicities))}catch(d){this.logService.WriteLog("Exception: "+d.message,"SelPeriodicity-subscribe()","fundview.component.ts","")}}GetAdvFundsView(t){this.showProgressBar=!0;try{this.isRefreshEnabled=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetAdvanceFundsView",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,IntPeriodicities:t,UCCClientID:"",UCCGroupID:"",ShowDropDown:this.bShowDropDown}).subscribe(s=>{this.GetAdvFundsViewCompleted(s)})}catch(s){this.isRefreshEnabled=!0,this.logService.WriteLog("Exception: "+s.message,"GetAdvFundsView()","fundview.component.ts","")}}refreshAdvFundsView(){try{null!=this.SelPeriodicity&&this.GetAdvFundsView(this.SelPeriodicity.nPeriodicity)}catch(t){this.logService.WriteLog("Exception: "+t.message,"RefreshAdvFundsView()","fundview.component.ts","")}}GetAdvFundsViewCompleted(t){this.showProgressBar=!1;try{this.isRefreshEnabled=!0,null!=t&&!0===t.ResponseStatus&&""!=t.ResponseObject&&(n.xB.applicationType===n.xB.MOBILE&&(this.IsIPOVisible=!1,this.IsMFVisible=!1,this.IsTotalVisible=!1,this.HeadTrading="Total"),this.CreateTable(t.ResponseObject),this.isDataLoaded=!0),this.showProgressBar=!1,this.ref.markForCheck()}catch(s){this.logService.WriteLog("Exception: "+s.message,"GetAdvFundsViewCompleted()","fundview.component.ts","")}}CreateTable(t){this.showProgressBar=!1;try{null!=t.dtAdvanceFundsView&&t.dtAdvanceFundsView.length>0?(this.dtRows=t.dtAdvanceFundsView,this.CreateFundsViewStruct(this.dtRows),this.dtRows=[],this.isNoDataFound=!1,this.isDataFound=!0):(this.isNoDataFound=!0,this.isDataFound=!1)}catch(d){this.logService.WriteLog("Exception: "+d.message,"CreateTable()","fundview.component.ts","")}}CreateFundsViewStruct(t){try{if(null!=t&&t.length>0)for(var r=0,s=0;s<t.length;s++){this.SetValueToTextBlocks(t[r],"Deposits",this.DepositText,this.DepositTrading,this.DepositIPO,this.DepositMF,this.DepositTotal,""),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)&&(this.IsNormalDepositHeadsVisible=!1,this.IsDeposit_10004Visible=!0),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)&&(r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Cash Deposit",this.CashDeposit,this.CashDepositVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Adhoc Deposit",this.AdhocDeposit,this.AdhocDepositVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Overdraft Limit",this.OverdraftLimit,this.OverdraftLimitVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Notional Deposit",this.NotionalDeposit,this.NotionalDepositVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Misc. Deposit",this.MiscDeposit,this.MiscDepositVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Manual Collateral",this.ManualCollateral,this.ManualCollateralVal)),r++,this.SetValueToLinks(t[r],"Funds Transferred Today",this.FTDText,this.FTDTrading,this.FTDIPO,this.FTDMF,this.FTDTotal,"NA"),r++,this.SetValueToLinks(t[r],"nFunds Transferred Today",this.FWText,this.FWTrading,this.FWIPO,this.FWMF,this.FWTotal,"NA"),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)?this.IsAdHocDepositVisible=!1:(this.IsAdHocDepositVisible=!0,r++,this.SetValueToTextBlocks(t[r],"Collateral",this.AdDepositText,this.AdDepositTrading,this.AdDepositIPO,this.AdDepositMF,this.AdDepositTotal,"NA")),r++,this.SetValueToLinks(t[r],"DP Collateral",this.CollBenText,this.CollBenTrading,this.CollBenIPO,this.CollBenMF,this.CollBenTotal,"NA"),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Pool Collateral",this.CollBenDPText,this.CollBenDPVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"SAR Collateral",this.CollBenPoolText,this.CollBenPoolVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"DP Pledged Collateral",this.CollBenSARText,this.CollBenSARVal),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)&&(this.IsCollatDPPledged_10004Visible=!0,this.IsCollatPoolPledged_10004Visible=!0,this.IsCollatMaxLimit_10004Visible=n.xB.dMsgMasterDisplay.WA333,r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Pool Pledged Collateral",this.CollatDPPledged,this.CollatDPPledgedVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Maximum Collateral Limit",this.CollatPoolPledged,this.CollatPoolPledgedVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Credit For Sale",this.CollatMaxLimit,this.CollatMaxLimitVal)),r++,this.SetValueToLinks(t[r],"DP CFS",this.CreditForSaleText,this.CreditForSaleTrading,this.CreditForSaleIPO,this.CreditForSaleMF,this.CreditForSaleTotal,"NA"),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Pool CFS",this.CreditForSaleDPText,this.CreditForSaleDPVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"SAR CFS",this.CreditForSalePoolText,this.CreditForSalePoolVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Maximum CFS Limit",this.CreditForSaleSARText,this.CreditForSaleSARVal),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)&&(this.IsCFSMaxLimit_10004=n.xB.dMsgMasterDisplay.WA337,r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Option CFS",this.CFSMaxLimit,this.CFSMaxLimitVal)),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)&&(this.IsOptionCFS_10004Visible=!0,this.IsOptionCFSMax_10004Visible=n.xB.dMsgMasterDisplay.WA339,r++,this.SetValueToTextBlocks(t[r],"nOption CFS",this.OptionCFSText,this.OptionCFSTradingVal,this.OptionCFSMFVal,this.OptionCFSIPOVal,this.OptionCFSTotalVal,""),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Maximum Option CFS",this.OptionCFSSec,this.OptionCFSSecVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"Total Trading Power Limit",this.OptionCFSMax,this.OptionCFSMaxVal)),r++,this.SetValueToTextBlocksWithConfigDesc(t[r],"nMultiplier",this.TradingLimitText,n.xB.dMsgMaster.WA340,this.TradingLimitVal,this.TradingLimitIPOVal,this.TradingLimitMFVal,this.TradingLimitTotal,"Y"),n.xB.MANAGER_VERSION_10XPLUSCRP_LIST.containsKey(n.xB.User.ManagerVersion)&&(this.IsMultiplier_10004Visible=!0,r++,this.SetValueToTextBlocks(t[r],"Limit Utilization",this.MultiplierVal,this.MultiplierTradingVal,this.MultiplierIPOVal,this.MultiplierMFVal,this.MultiplierTotalVal,"NA")),r++,this.SetValueToLinks(t[r],"Commodity Position",this.LimitUtilText,this.LimitUtilTradingVal,this.LimitUtilIPOVal,this.LimitUtilMFVal,this.LimitUtilTotalVal,"NA"),r++,this.SetValueToChildTextBlocks(t[r],"Currency Position",this.LimitUtilEqText,this.LimitUtilEqVal),r++,this.SetValueToChildTextBlocks(t[r],"Derivative Position",this.LimitUtilDervText,this.LimitUtilDervVal),r++,this.SetValueToChildTextBlocks(t[r],"Equity Position",this.LimitUtilCommText,this.LimitUtilCommVal),r++,this.SetValueToChildTextBlocks(t[r],"Booked Profit/Loss",this.LimitUtilCurrText,this.LimitUtilCurrVal),r++,this.SetValueToLinks(t[r],"nCommodity Position",this.BookedPLText,this.BookedPLTradingVal,this.BookedPLIPO,this.BookedPLMF,this.BookedPLTotalVal,"NA"),r++,this.SetValueToChildTextBlocks(t[r],"nCurrency Position",this.BookedPLEqText,this.BookedPLEqVal),r++,this.SetValueToChildTextBlocks(t[r],"nDerivative Position",this.BookedPLEqDervText,this.BookedPLEqDervVal),r++,this.SetValueToChildTextBlocks(t[r],"nEquity Position",this.BookedPLCommText,this.BookedPLCommVal),r++,this.SetValueToChildTextBlocks(t[r],"nMTM Profit/Loss",this.BookedPLCurrText,this.BookedPLCurrVal),r++,this.SetValueToLinks(t[r],"nnCommodity Position",this.MTMPLText,this.MTMPLTradingVal,this.MTMPLIPOVal,this.MTMPLMFVal,this.MTMPLTotalVal,"NA"),r++,this.SetValueToChildTextBlocks(t[r],"fCurrency Position",this.MTMPLEqText,this.MTMPLEqVal),r++,this.SetValueToChildTextBlocks(t[r],"fDerivative Position",this.MTMPLDervText,this.MTMPLDervVal),r++,this.SetValueToChildTextBlocks(t[r],"fquity Position",this.MTMPLCommText,this.MTMPLCommVal),r++,this.SetValueToChildTextBlocks(t[r],"Total Utilization",this.MTMPLCurrText,this.MTMPLCurrVal),r++,this.SetValueToTextBlocks(t[r],"
1Net Available Funds",this.TotalUtilText,this.TotalUtilTradVal,this.TotalUtilIPOVal,this.TotalUtilMFVal,this.TotalUtilTotVal,"NA"),r++,this.SetValueToTextBlocks(t[r],"For Trading",this.NetAvailText,this.NetAvailTradVal,this.NetAvailIPOVal,this.NetAvailMFVal,this.NetAvailTotalVal,"NA"),r++,this.SetValueToTextBlocks(t[r],"For Allocation/Withdrawal",this.ForTradText,this.ForTradVal,this.ForTradIPOVal,this.ForTradMFVal,this.ForTradTotalVal,"NA"),r++,this.SetValueToTextBlocks(t[r],"nAllocation/Withdrawal",this.ForAllocWdrwText,this.ForAllocWdrwVal,this.ForAllocWdrwIPOVal,this.ForAllocWdrwMFVal,this.ForAllocWdrwTotalVal,"NA"),this.getTradingReserveBalaceAmount(parseFloat(t[r].CellValue)),r++,this.SetValueToChildTextBlocks(t[r],"MF Position",this.LimitUtilCommText,this.LimitUtilCommVal),1==this.ShowFundsViewT5&&(r++,this.SetValueToTextBlockWithConfigDesc(t[r],"T+5 Holding Collateral",this.CollatDPPledged,this.CollatDPPledgedVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"T+5 Haircut Collateral",this.CollatDPPledged,this.CollatDPPledgedVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"T+5 CFS",this.CreditForSaleSARText,this.CreditForSaleSARVal),r++,this.SetValueToTextBlockWithConfigDesc(t[r],"T+5 Haircut CFS",this.CreditForSaleSARText,this.CreditForSaleSARVal));break}this.getData()}catch(M){this.logService.WriteLog("Exception: "+M.message,"CreateFundsViewStruct()","fundview.component.ts","")}}SetValueToLinks(t,r,s,d,I,M,U,q){try{null!=t&&("Funds Transferred Today"==r&&(this.FTDText=this.GetDynamicDisplayLabel(t),this.FTDTrading=t.nTrading.toFixed(2),this.FTDIPO=t.nIPO.toFixed(2),this.FTDMF=t.nMF.toFixed(2),this.FTDTotal=t.nTotal.toFixed(2)),"nFunds Transferred Today"==r&&(this.FWText=this.GetDynamicDisplayLabel(t),this.FWTrading=t.nTrading.toFixed(2),this.FWIPO=t.nIPO.toFixed(2),this.FWMF=t.nMF.toFixed(2),this.FWTotal=t.nTotal.toFixed(2)),"DP Collateral"==r&&(this.CollBenText=this.GetDynamicDisplayLabel(t),this.CollBenTrading=t.nTrading.toFixed(2),this.CollBenIPO="NA"!=q?t.nIPO.toFixed(2):"NA",this.CollBenMF="NA"!=q?t.nMF.toFixed(2):"NA",this.CollBenTotal=t.nTotal.toFixed(2)),"DP CFS"==r&&(this.CreditForSaleText=this.GetDynamicDisplayLabel(t),this.CreditForSaleTrading=t.nTrading.toFixed(2),this.CreditForSaleIPO="NA"!=q?t.nIPO.toFixed(2):"NA",this.CreditForSaleMF="NA"!=q?t.nMF.toFixed(2):"NA",this.CreditForSaleTotal=t.nTotal.toFixed(2)),"Commodity Position"==r&&(this.LimitUtilText=this.GetDynamicDisplayLabel(t),this.LimitUtilTradingVal=o.X.FormatNegativeValues(t.nTrading.toFixed(2)),this.LimitUtilIPOVal=o.X.FormatNegativeValues(t.nIPO.toFixed(2)),this.LimitUtilMFVal=o.X.FormatNegativeValues(t.nMF.toFixed(2)),this.LimitUtilTotalVal=o.X.FormatNegativeValues(t.nTotal.toFixed(2))),"nCommodity Position"==r&&(this.BookedPLText=this.GetDynamicDisplayLabel(t),this.BookedPLTradingVal=t.nTrading.toFixed(2),this.BookedPLIPO="NA"!=q?t.nIPO.toFixed(2):"NA",this.BookedPLMF="NA"!=q?t.nMF.toFixed(2):"NA",this.BookedPLTotalVal=t.nTotal.toFixed(2)),"nnCommodity Position"==r&&(this.MTMPLText=this.GetDynamicDisplayLabel(t),this.MTMPLTradingVal=t.nTrading.toFixed(2),this.MTMPLIPOVal="NA"!=q?t.nIPO.toFixed(2):"NA",this.MTMPLMFVal="NA"!=q?t.nMF.toFixed(2):"NA",this.MTMPLTotalVal=t.nTotal.toFixed(2)))}catch(j){this.logService.WriteLog("Exception: "+j.message,"SetValueToTextBlocks()","fundview.component.ts","")}}getCss(t){return t>=0?"tcgreen":"tcred"}SetValueToTextBlocks(t,r,s,d,I,M,U,q){try{null!=t&&("Deposits"==r?(this.DepositText=this.GetDynamicDisplayLabel(t),this.DepositTrading=t.nTrading.toFixed(2),this.DepositIPO=t.nIPO.toFixed(2),this.DepositMF=t.nMF.toFixed(2),this.DepositTotal=t.nTotal.toFixed(2)):"Collateral"==r?(this.AdDepositText=this.GetDynamicDisplayLabel(t),this.AdDepositTrading=t.nTrading.toFixed(2),this.AdDepositIPO=t.nIPO.toFixed(2),this.AdDepositMF=t.nMF.toFixed(2),this.AdDepositTotal=t.nTotal.toFixed(2)):"nOption CFS"==r?(this.OptionCFSText=this.GetDynamicDisplayLabel(t),this.OptionCFSTradingVal=t.nTrading.toFixed(2),this.OptionCFSIPOVal="NA"!=q?t.nIPO.toFixed(2):"NA",this.OptionCFSMFVal="NA"!=q?t.nMF.toFixed(2):"NA",this.OptionCFSTotalVal=t.nTotal.toFixed(2)):"Net Available Funds"==r?(this.TotalUtilText=this.GetDynamicDisplayLabel(t),this.TotalUtilTradVal=t.nTrading.toFixed(2),this.TotalUtilIPOVal=t.nIPO.toFixed(2),this.TotalUtilMFVal=t.nMF.toFixed(2),this.TotalUtilTotVal=t.nTotal.toFixed(2)):"For Trading"==r?(this.NetAvailText=this.GetDynamicDisplayLabel(t),this.NetAvailTradVal=t.nTrading.toFixed(2),this.NetAvailIPOVal=t.nIPO.toFixed(2),this.NetAvailMFVal=t.nMF.toFixed(2),this.NetAvailTotalVal=t.nTotal.toFixed(2)):"For Allocation/Withdrawal"==r?(this.ForTradText=this.GetDynamicDisplayLabel(t),this.ForTradVal=t.nTrading.toFixed(2),this.ForTradIPOVal=t.nIPO.toFixed(2),this.ForTradMFVal=t.nMF.toFixed(2),this.ForTradTotalVal=t.nTotal.toFixed(2)):"Limit Utilization"==r?(this.MultiplierVal=this.GetDynamicDisplayLabel(t),this.MultiplierTradingVal=t.nTrading.toFixed(2),this.MultiplierIPOVal="NA"!=q?t.nIPO.toFixed(2):"NA",this.MultiplierMFVal="NA"!=q?t.nMF.toFixed(2):"NA",this.MultiplierTotalVal=t.nTotal.toFixed(2)):"nAllocation/Withdrawal"==r&&(this.ForAllocWdrwText=this.GetDynamicDisplayLabel(t),this.ForAllocWdrwVal=t.nTrading.toFixed(2),this.ForAllocWdrwIPOVal="NA"!=q?t.nIPO.toFixed(2):"NA",this.ForAllocWdrwMFVal="NA"!=q?t.nMF.toFixed(2):"NA",this.ForAllocWdrwTotalVal=t.nTotal.toFixed(2)))}catch(j){this.logService.WriteLog("Exception: "+j.message,"SetValueToTextBlocks()","fundview.component.ts","")}}SetValueToChildTextBlocks(t,r,s,d){try{null!=t&&("Currency Position"==r?(this.LimitUtilEqText=this.GetDynamicDisplayLabel(t),this.LimitUtilEqVal=t.nTrading.toFixed(2)):"Derivative Position"==r?(this.LimitUtilDervText=this.GetDynamicDisplayLabel(t),this.LimitUtilDervVal=t.nTrading.toFixed(2)):"Equity Position"==r?(this.LimitUtilCommText=this.GetDynamicDisplayLabel(t),this.LimitUtilCommVal=t.nTrading.toFixed(2)):"MF Position"==r?(this.LimitUtilMFText=this.GetDynamicDisplayLabel(t),this.LimitUtilMFValue=t.
1nTrading.toFixed(2)):"Booked Profit/Loss"==r?(this.LimitUtilCurrText=this.GetDynamicDisplayLabel(t),this.LimitUtilCurrVal=t.nTrading.toFixed(2)):"nCurrency Position"==r?(this.BookedPLEqText=this.GetDynamicDisplayLabel(t),this.BookedPLEqVal=t.nTrading.toFixed(2)):"nDerivative Position"==r?(this.BookedPLEqDervText=this.GetDynamicDisplayLabel(t),this.BookedPLEqDervVal=t.nTrading.toFixed(2)):"nDerivative Position"==r||"nDerivative Position"==r?(this.BookedPLEqText=this.GetDynamicDisplayLabel(t),this.BookedPLEqVal=t.nTrading.toFixed(2)):"nEquity Position"==r?(this.BookedPLCommText=this.GetDynamicDisplayLabel(t),this.BookedPLCommVal=t.nTrading.toFixed(2)):"nMTM Profit/Loss"==r?(this.BookedPLCurrText=this.GetDynamicDisplayLabel(t),this.BookedPLCurrVal=t.nTrading.toFixed(2)):"fCurrency Position"==r?(this.MTMPLEqText=this.GetDynamicDisplayLabel(t),this.MTMPLEqVal=t.nTrading.toFixed(2)):"fDerivative Position"==r?(this.MTMPLDervText=this.GetDynamicDisplayLabel(t),this.MTMPLDervVal=t.nTrading.toFixed(2)):"fquity Position"==r?(this.MTMPLCommText=this.GetDynamicDisplayLabel(t),this.MTMPLCommVal=t.nTrading.toFixed(2)):"Total Utilization"==r&&(this.MTMPLCurrText=this.GetDynamicDisplayLabel(t),this.MTMPLCurrVal=t.nTrading.toFixed(2)))}catch(I){this.logService.WriteLog("Exception: "+I.message,"SetValueToTextBlocks()","fundview.component.ts","")}}SetValueToTextBlockWithConfigDesc(t,r,s,d){try{null!=t&&("Cash Deposit"==r?(this.CashDeposit=this.GetDynamicDisplayLabel(t),this.CashDepositVal=t.nTrading.toFixed(2)):"Adhoc Deposit"==r?(this.AdhocDeposit=this.GetDynamicDisplayLabel(t),this.AdhocDepositVal=t.nTrading.toFixed(2)):"Overdraft Limit"==r?(this.OverdraftLimit=this.GetDynamicDisplayLabel(t),this.OverdraftLimitVal=t.nTrading.toFixed(2)):"Notional Deposit"==r?(this.NotionalDeposit=this.GetDynamicDisplayLabel(t),this.NotionalDepositVal=t.nTrading.toFixed(2)):"Misc. Deposit"==r?(this.MiscDeposit=this.GetDynamicDisplayLabel(t),this.MiscDepositVal=t.nTrading.toFixed(2)):"Manual Collateral"==r?(this.ManualCollateral=this.GetDynamicDisplayLabel(t),this.ManualCollateralVal=t.nTrading.toFixed(2)):"Pool Collateral"==r?(this.CollBenDPText=this.GetDynamicDisplayLabel(t),this.CollBenDPVal=t.nTrading.toFixed(2)):"SAR Collateral"==r?(this.CollBenPoolText=this.GetDynamicDisplayLabel(t),this.CollBenPoolVal=t.nTrading.toFixed(2)):"DP Pledged Collateral"==r?(this.CollBenSARText=this.GetDynamicDisplayLabel(t),this.CollBenSARVal=t.nTrading.toFixed(2)):"Pool Pledged Collateral"==r?(this.CollatDPPledged=this.GetDynamicDisplayLabel(t),this.CollatDPPledgedVal=t.nTrading.toFixed(2)):"Maximum Collateral Limit"==r?(this.CollatPoolPledged=this.GetDynamicDisplayLabel(t),this.CollatPoolPledgedVal=t.nTrading.toFixed(2)):"Credit For Sale"==r?(this.CollatMaxLimit=this.GetDynamicDisplayLabel(t),this.CollatMaxLimitVal=t.nTrading.toFixed(2)):"Pool CFS"==r?(this.CreditForSaleDPText=this.GetDynamicDisplayLabel(t),this.CreditForSaleDPVal=t.nTrading.toFixed(2)):"SAR CFS"==r?(this.CreditForSalePoolText=this.GetDynamicDisplayLabel(t),this.CreditForSalePoolVal=t.nTrading.toFixed(2)):"Maximum CFS Limit"==r?(this.CreditForSaleSARText=this.GetDynamicDisplayLabel(t),this.CreditForSaleSARVal=t.nTrading.toFixed(2)):"Option CFS"==r?(this.CFSMaxLimit=this.GetDynamicDisplayLabel(t),this.CFSMaxLimitVal=t.nTrading.toFixed(2)):"Maximum Option CFS"==r?(this.OptionCFSSec=this.GetDynamicDisplayLabel(t),this.OptionCFSSecVal=t.nTrading.toFixed(2)):"Total Trading Power Limit"==r?(this.OptionCFSMax=this.GetDynamicDisplayLabel(t),this.OptionCFSMaxVal=t.nTrading.toFixed(2)):"T+5 Holding Collateral"==r?(this.T5CollateralLimitText=this.GetDynamicDisplayLabel(t),this.T5CollateralLimitVal=t.nTrading.toFixed(2)):"T+5 Haircut Collateral"==r?(this.T5HaircutLimitText=this.GetDynamicDisplayLabel(t),this.T5HaircutLimitVal=t.nTrading.toFixed(2)):"T+5 CFS"==r?(this.T5CFSText=this.GetDynamicDisplayLabel(t),this.T5CFSLimitVal=t.nTrading.toFixed(2)):"T+5 Haircut CFS"==r&&(this.T5HaircutCFSText=this.GetDynamicDisplayLabel(t),this.T5HaircutCFSVal=t.nTrading.toFixed(2)))}catch(I){this.logService.WriteLog("Exception: "+I.message,"SetValueToTextBlocks()","fundview.component.ts","")}}SetValueToTextBlocksWithConfigDesc(t,r,s,d,I,M,U,q,j){try{null!=t&&"nMultiplier"==r&&(this.TradingLimitText=this.GetDynamicDisplayLabel(t),this.TradingLimitVal=t.nTrading.toFixed(2),this.TradingLimitIPOVal=t.nIPO.toFixed(2),this.TradingLimitMFVal=t.nMF.toFixed(2),this.TradingLimitTotal=t.nTotal.toFixed(2))}catch(Ie){this.logService.WriteLog("Exception: "+Ie.message,"SetValueToTextBlocksWithConfigDesc()","fundview.component.ts","")}}getTradingReserveBalaceAmount(t){var r=n.xB.dConfigMaster.RESERVE_BLOCK_FROM_ALLOCATION_FUND_SETTINGS_PERCENTAGE,s=n.xB.dConfigMaster.RESERVE_BLOCK_FROM_ALLOCATION_FUND_SETTINGS_ABSOLUTE,I=0,M=0,U=parseFloat(t.toString().Trim());return 0!=r.length&&(M=parseFloat(r)*U/100),0!=s.length&&(I=parseInt(s)),(U-=M>I?M:I)<0&&(U=0),U}ShowHide(t){switch(t){case"CB":this.IsCBVisible=!0!==this.IsCBVisible,this.CBSummaryCss=this.CBSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS;break;case"CFS":this.IsCFSVisible=!0!==this.IsCFSVisible,this.CFSSummaryCss=this.CFSSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS;break;case"LU":this.IsLUVisible=!0!==this.IsLUVisible,this.LUSummaryCss=this.LUSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS;break;case"BPL":this.IsBookedPLVisible=!0!==this.IsBookedPLVisible,this.BookPLSummaryCss=this.BookPLSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS;break;case"MTM":this.IsMTMVisible=!0!==this.IsMTMVisible,this.MTMSummaryCss=this.MTMSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS;break;case"DEP":this.IsDepositSection_10004Visible=!0!==this.IsDepositSection_10004Visible,this.DepSummaryCss=this.DepSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS;break;case"OptCFS":this.IsOptionCFSSection_10004Visible=!0!==this.IsOptionCFSSection_10004Visible,this.OptCFSSummaryCss=this.OptCFSSummaryCss===this.ExpandTreeViewCSS?this.CollapseTreeViewCSS:this.ExpandTreeViewCSS}}navigateToFundTransfer(){this.menuManager.invokeMenu(n.gT.C_S_MENU_FUND_TRANSFER,{params:"TBA"},"MD")}subscribeMessages(){this.refreshAdvFundsView()}GetDynamicDisplayLabel(t){var r="";try{r=t.hasOwnProperty("sDisplayLable")?t.sDisplayLable:t.sDescription}catch(s){r="",this.logService.WriteLog("Exception: "+s.message,"GetDynamicDisplayLabel()","fundview.component.ts","")}return r}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(i._),e.\u0275\u0275directiveInject(n.O
1E),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(ui.D),e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(n.fY))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["fundview"]],decls:564,vars:362,consts:[[1,"FundView"],[1,"Fundview-piechart"],["style","display: inline-block;margin: 0 5% auto;","class","shareHolding",4,"ngIf"],[1,"Fundview-data"],[1,"Select_orders","FundsView_Parent"],[4,"ngIf"],[1,"Funds_Select"],["class","Funds_Btn",4,"ngIf"],["class","Funds_Select_Periodicity",4,"ngIf"],["ngDefaultControl","",1,"btn-ref","Global_Filter",3,"matTooltip","click"],["href","javascript:void(0);",3,"click"],[1,"Funds_View"],[1,"col-49"],["border","0","cellspacing","0","cellpadding","0",1,"card"],[3,"click"],[1,"no-bg-wrap"],[3,"className"],[1,"taL"],["ngDefaultControl","",3,"ngModel","className","ngModelChange"],["ngDefaultControl","",3,"ngModel","hidden","ngModelChange"],[1,"Funds_Selected_row",3,"hidden"],["colspan","2"],[1,"Fund_collapse"],["border","0","cellspacing","0","cellpadding","0"],["ngDefaultControl","",3,"ngModel","ngModelChange"],["border","0","cellspacing","0","cellpadding","0",1,"brd-left"],[1,"taL","tcgreen"],["href","javascript:void(0)",3,"click"],["ngDefaultControl","",1,"tcgreen",3,"ngModel","ngModelChange"],[1,"report-img"],[3,"hidden"],["ngDefaultControl","",3,"click"],[1,"taL","tcred"],["ngDefaultContro","",1,"tcgreen",3,"ngModel","ngModelChange"],[1,"funds_total"],[1,"text-right"],[1,"taL","font-16"],["ngDefaultControl","",1,"tcred",3,"ngModel","ngModelChange"],[1,"taL","font-16","tcred"],[1,"Funds_View_secondtbl"],[1,"font-16","text-center"],[1,"shareHolding",2,"display","inline-block","margin","0 5% auto"],[3,"options","data"],["class","col",4,"ngIf"],[1,"col"],["class","marginBtm5 text-center",4,"ngFor","ngForOf"],[1,"marginBtm5","text-center"],[3,"ngStyle"],[1,"chat-num","font-16","textColor"],[3,"type"],[1,"Funds_Btn"],["class","tab-button","mat-raised-button","","href","javascript:void(0);",3,"ngClass","click",4,"ngFor","ngForOf"],["mat-raised-button","","href","javascript:void(0);",1,"tab-button",3,"ngClass","click"],[1,"Funds_Select_Periodicity"],["disableOptionCentering","true","placeholder","Periodicity/Exchange",3,"ngModel","selectionChange","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,Xa,4,4,"div",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275elementStart(4,"div",4),e.\u0275\u0275template(5,Ka,2,1,"div",5),e.\u0275\u0275elementStart(6,"div",6),e.\u0275\u0275template(7,Ja,2,1,"div",7),e.\u0275\u0275template(8,Za,4,2,"div",8),e.\u0275\u0275elementStart(9,"button",9),e.\u0275\u0275listener("click",function(){return r.refreshAdvFundsView()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"a",10),e.\u0275\u0275listener("click",function(){return r.navigateToFundTransfer()}),e.\u0275\u0275text(11,"Add Funds"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div",11),e.\u0275\u0275elementStart(13,"div",12),e.\u0275\u0275elementStart(14,"table",13),e.\u0275\u0275elementStart(15,"thead"),e.\u0275\u0275element(16,"tr"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"tbody"),e.\u0275\u0275elementStart(18,"tr",14),e.\u0275\u0275listener("click",function(){return r.ShowHide("DEP")}),e.\u0275\u0275elementStart(19,"td",15),e.\u0275\u0275element(20,"button",16),e.\u0275\u0275elementStart(21,"label"),e.\u0275\u0275text(22),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"td",17),e.\u0275\u0275elementStart(24,"span",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.DepositTrading=d}),e.\u0275\u0275text(25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"td",17),e.\u0275\u0275elementStart(27,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.DepositIPO=d}),e.\u0275\u0275text(28),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(29,"td",17),e.\u0275\u0275elementStart(30,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.DepositMF=d}),e.\u0275\u0275text(31),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"td",17),e.\u0275\u0275elementStart(33,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.DepositTotal=d}),e.\u0275\u0275text(34),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"tr",20),e.\u0275\u0275elementStart(36,"td",21),e.\u0275\u0275elementStart(37,"div",22),e.\u0275\u0275elementStart(38,"table",23),e.\u0275\u0275elementStart(39,"tr"),e.\u0275\u0275elementStart(40,"td"),e.\u0275\u0275elementStart(41,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CashDeposit=d}),e.\u0275\u0275text(42),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(43,"td",17),e.\u0275\u0275elementStart(44,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CashDepositVal=d}),e.\u0275\u0275text(45),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(46,"tr"),e.\u0275\u0275elementStart(47,"td"),e.\u0275\u0275elementStart(48,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdhocDeposit=d}),e.\u0275\u0275text(49),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(50,"td",17),e.\u0275\u0275elementStart(51,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdhocDepositVal=d}),e.\u0275\u0275text(52),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(53,"tr"),e.\u0275\u0275elementStart(54,"td"),e.\u0275\u0275elementStart(55,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.OverdraftLimit=d}),e.\u0275\u0275text(56),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(57,"td",17),e.\u0275\u0275elementStart(58,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.OverdraftLimitVal=d}),e.\u0275\u0275text(59),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(60,"table",25),e.\u0275\u0275elementStart(61,"tr"),e.\u0275\u0275elementStart(62,"td"),e.\u0275\u0275elementStart(63,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.
1NotionalDeposit=d}),e.\u0275\u0275text(64),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(65,"td",17),e.\u0275\u0275elementStart(66,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.NotionalDepositVal=d}),e.\u0275\u0275text(67),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(68,"tr"),e.\u0275\u0275elementStart(69,"td"),e.\u0275\u0275elementStart(70,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MiscDeposit=d}),e.\u0275\u0275text(71),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(72,"td",17),e.\u0275\u0275elementStart(73,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MiscDepositVal=d}),e.\u0275\u0275text(74),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(75,"tr"),e.\u0275\u0275elementStart(76,"td"),e.\u0275\u0275elementStart(77,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.ManualCollateral=d}),e.\u0275\u0275text(78),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(79,"td",17),e.\u0275\u0275elementStart(80,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.ManualCollateralVal=d}),e.\u0275\u0275text(81),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(82,"tr"),e.\u0275\u0275elementStart(83,"td"),e.\u0275\u0275elementStart(84,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.FTDText=d}),e.\u0275\u0275text(85),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(86,"td",26),e.\u0275\u0275elementStart(87,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"FT",100)}),e.\u0275\u0275elementStart(88,"label",28),e.\u0275\u0275listener("ngModelChange",function(d){return r.FTDTrading=d}),e.\u0275\u0275text(89),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(90,"td",17),e.\u0275\u0275elementStart(91,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.FTDIPO=d}),e.\u0275\u0275text(92),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(93,"td",17),e.\u0275\u0275elementStart(94,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.FTDMF=d}),e.\u0275\u0275text(95),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(96,"td",17),e.\u0275\u0275elementStart(97,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.FTDTotal=d}),e.\u0275\u0275text(98),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(99,"tr"),e.\u0275\u0275elementStart(100,"td"),e.\u0275\u0275elementStart(101,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.FWText=d}),e.\u0275\u0275text(102),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(103,"td",17),e.\u0275\u0275elementStart(104,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"FAW",100)}),e.\u0275\u0275elementStart(105,"span",29),e.\u0275\u0275text(106,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(107,"label",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.FWTrading=d}),e.\u0275\u0275text(108),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(109,"td",17),e.\u0275\u0275elementStart(110,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.FWIPO=d}),e.\u0275\u0275text(111),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(112,"td",17),e.\u0275\u0275elementStart(113,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.FWMF=d}),e.\u0275\u0275text(114),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(115,"td",17),e.\u0275\u0275elementStart(116,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.FWTotal=d}),e.\u0275\u0275text(117),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(118,"tr",30),e.\u0275\u0275elementStart(119,"td"),e.\u0275\u0275elementStart(120,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdDepositText=d}),e.\u0275\u0275text(121),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(122,"td",17),e.\u0275\u0275elementStart(123,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdDepositTrading=d}),e.\u0275\u0275text(124),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(125,"td",17),e.\u0275\u0275elementStart(126,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdDepositIPO=d}),e.\u0275\u0275text(127),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(128,"td",17),e.\u0275\u0275elementStart(129,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdDepositMF=d}),e.\u0275\u0275text(130),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(131,"td",17),e.\u0275\u0275elementStart(132,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.AdDepositTotal=d}),e.\u0275\u0275text(133),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(134,"tr",3
11),e.\u0275\u0275listener("click",function(){return r.ShowHide("CB")}),e.\u0275\u0275elementStart(135,"td",15),e.\u0275\u0275element(136,"button",16),e.\u0275\u0275elementStart(137,"label"),e.\u0275\u0275text(138),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(139,"td",17),e.\u0275\u0275elementStart(140,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"CB",8)}),e.\u0275\u0275elementStart(141,"span",29),e.\u0275\u0275text(142,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(143,"label",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenTrading=d}),e.\u0275\u0275text(144),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(145,"td",17),e.\u0275\u0275elementStart(146,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenIPO=d}),e.\u0275\u0275text(147),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(148,"td",17),e.\u0275\u0275elementStart(149,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenMF=d}),e.\u0275\u0275text(150),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(151,"td",32),e.\u0275\u0275elementStart(152,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenTotal=d}),e.\u0275\u0275text(153),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(154,"tr",20),e.\u0275\u0275elementStart(155,"td",21),e.\u0275\u0275elementStart(156,"div",22),e.\u0275\u0275elementStart(157,"table",23),e.\u0275\u0275elementStart(158,"tr"),e.\u0275\u0275elementStart(159,"td"),e.\u0275\u0275elementStart(160,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenDPText=d}),e.\u0275\u0275text(161),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(162,"td",17),e.\u0275\u0275elementStart(163,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenDPVal=d}),e.\u0275\u0275text(164),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(165,"tr"),e.\u0275\u0275elementStart(166,"td"),e.\u0275\u0275elementStart(167,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenDPVal=d}),e.\u0275\u0275text(168),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(169,"td",17),e.\u0275\u0275elementStart(170,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenPoolVal=d}),e.\u0275\u0275text(171),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(172,"tr"),e.\u0275\u0275elementStart(173,"td"),e.\u0275\u0275elementStart(174,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenSARText=d}),e.\u0275\u0275text(175),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(176,"td",17),e.\u0275\u0275elementStart(177,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollBenSARVal=d}),e.\u0275\u0275text(178),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(179,$a,7,4,"tr",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(180,"table",25),e.\u0275\u0275elementStart(181,"tr"),e.\u0275\u0275elementStart(182,"td"),e.\u0275\u0275elementStart(183,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollatDPPledged=d}),e.\u0275\u0275text(184),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(185,"td",17),e.\u0275\u0275elementStart(186,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollatDPPledgedVal=d}),e.\u0275\u0275text(187),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(188,"tr"),e.\u0275\u0275elementStart(189,"td"),e.\u0275\u0275elementStart(190,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollatPoolPledged=d}),e.\u0275\u0275text(191),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(192,"td",17),e.\u0275\u0275elementStart(193,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollatPoolPledgedVal=d}),e.\u0275\u0275text(194),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(195,"tr"),e.\u0275\u0275elementStart(196,"td"),e.\u0275\u0275elementStart(197,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollatMaxLimit=d}),e.\u0275\u0275text(198),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(199,"td",17),e.\u0275\u0275elementStart(200,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CollatMaxLimitVal=d}),e.\u0275\u0275text(201),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(202,ja,7,4,"tr",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(203,"tr",14),e.\u0275\u0275listener("click",function(){return r.ShowHide("CFS")}),e.\u0275\u0275elementStart(204,"td",15),e.\u0275\u0275element(2
105,"button",16),e.\u0275\u0275elementStart(206,"label"),e.\u0275\u0275text(207),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(208,"td",17),e.\u0275\u0275elementStart(209,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"CFS",8)}),e.\u0275\u0275elementStart(210,"span",29),e.\u0275\u0275text(211,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(212,"label",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleTrading=d}),e.\u0275\u0275text(213),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(214,"td",17),e.\u0275\u0275elementStart(215,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleIPO=d}),e.\u0275\u0275text(216),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(217,"td",17),e.\u0275\u0275elementStart(218,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleMF=d}),e.\u0275\u0275text(219),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(220,"td",32),e.\u0275\u0275elementStart(221,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleTotal=d}),e.\u0275\u0275text(222),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(223,"tr",20),e.\u0275\u0275elementStart(224,"td",21),e.\u0275\u0275elementStart(225,"div",22),e.\u0275\u0275elementStart(226,"table",23),e.\u0275\u0275elementStart(227,"tr"),e.\u0275\u0275elementStart(228,"td"),e.\u0275\u0275elementStart(229,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleDPText=d}),e.\u0275\u0275text(230),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(231,"td",17),e.\u0275\u0275elementStart(232,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleDPVal=d}),e.\u0275\u0275text(233),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(234,"tr"),e.\u0275\u0275elementStart(235,"td"),e.\u0275\u0275elementStart(236,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSalePoolText=d}),e.\u0275\u0275text(237),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(238,"td",17),e.\u0275\u0275elementStart(239,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSalePoolVal=d}),e.\u0275\u0275text(240),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(241,es,7,4,"tr",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(242,"table",25),e.\u0275\u0275elementStart(243,"tr"),e.\u0275\u0275elementStart(244,"td"),e.\u0275\u0275elementStart(245,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleSARText=d}),e.\u0275\u0275text(246),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(247,"td",17),e.\u0275\u0275elementStart(248,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CreditForSaleSARVal=d}),e.\u0275\u0275text(249),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(250,"tr",30),e.\u0275\u0275elementStart(251,"td"),e.\u0275\u0275elementStart(252,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CFSMaxLimit=d}),e.\u0275\u0275text(253),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(254,"td",17),e.\u0275\u0275elementStart(255,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.CFSMaxLimitVal=d}),e.\u0275\u0275text(256),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(257,ts,7,4,"tr",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(258,"tr",14),e.\u0275\u0275listener("click",function(){return r.ShowHide("OptCFS")}),e.\u0275\u0275elementStart(259,"td",15),e.\u0275\u0275element(260,"button",16),e.\u0275\u0275elementStart(261,"label"),e.\u0275\u0275text(262),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(263,"td",17),e.\u0275\u0275elementStart(264,"span",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSTradingVal=d}),e.\u0275\u0275text(265),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(266,"td",17),e.\u0275\u0275elementStart(267,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSIPOVal=d}),e.\u0275\u0275text(268),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(269,"td",17),e.\u0275\u0275elementStart(270,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSMFVal=d}),e.\u0275\u0275text(271),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(272,"td",17),e.\u0275\u0275elementStart(273,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSTotalVal=d}),e.\u0275\u0275text(274),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(275,"tr",20),e.\u0275\u0275elementStart(276,"td",21),e.\u0275\u0275elementStart(277,"div",22),e.\u0275\u0275elementStart(278,"table",23),e.\u0275\u0275elementStart(279,"tr"),e.\u0275\u0275elementStart(280,"td"),e.\u0275\u0275elementStart(281,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSSec=d}),e.\u0275\u0275text(282),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(283,"td",17),e.\u0275\u0275elementStart(284,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSSecVal=d}),e.\u0275\u0275text(285),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(286,"table",25),e.\u0275\u0275elementStart(287,"tr",30),e.\u0275\u0275elementStart(288,"td"),e.\u0275\u0275elementStart(289,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSMax=d}),e.\u0275\u0275text(290),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(291,"td",17),e.\u0275\u0275elementStart(292,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.OptionCFSMaxVal=d}),e.\u0275\u0275text(293),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(294,"tr"),e.\u0275\u0275elementStart(295,"td"),e.\u0275\u0275elementStart(296,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MultiplierVal=d}),e.\u0275\u0275text(297),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(298,"td",26),e.\u0275\u0275elementStart(299,"span",33),e.\u0275\u0275listener("ngModelChange",function(d){return r.MultiplierTradingVal=d}),e.\u0275\u0275text(300),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(301,"td",17),e.\u0275\u0275elementStart(302,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.MultiplierIPOVal=d}),e.\u0275\u0275text(303),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(304,"td",17),e.\u0275\u0275elementStart(305,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.MultiplierMFVal=d}),e.\u0275\u0275text(306),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(307,"td",17),e.\u0275\u0275elementStart(308,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.MultiplierTotalVal=d}),e.\u0275\u0275text(309),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(310,"tr",34),e.\u0275\u0275elementStart(311,"td",35),e.\u0275\u0275elementStart(312,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.TradingLimitText=d}),e.\u0275\u0275text(313),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(314,"td",36),e.\u0275\u0275elementStart(315,"span",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.TradingLimitVal=d}),e.\u0275\u0275text(316),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(317,"td",17),e.\u0275\u0275elementStart(318,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.TradingLimitIPOVal=d}),e.\u0275\u0275text(319),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(320,"td",17),e.\u0275\u0275elementStart(321,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.TradingLimitMFVal=d}),e.\u0275\u0275text(322),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(323,"td",17),e.\u0275\u0275elementStart(324,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.TradingLimitTotal=d}),e.\u0275\u0275text(325),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(326,"div",12),e.\u0275\u0275elementStart(327,"table",13),e.\u0275\u0275elementStart(328,"tbody"),e.\u0275\u0275elementStart(329,"tr",14),e.\u0275\u0275listener("click",function(){return r.ShowHide("LU")}),e.\u0275\u0275elementStart(330,"td",15),e.\u0275\u0275element(331,"button",16),e.\u0275\u0275elementStart(332,"label"),e.\u0275\u0275text(333),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(334,"td",32),e.\u0275\u0275elementStart(335,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"MR","LU")}),e.\u0275\u0275elementStart(336,"span",29),e.\u0275\u0275text(337,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(338,"label",37),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilTradingVal=d}),e.\u0275\u0275text(339),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(340,"td",17),e.\u0275\u0275elementStart(341,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilIPOVal=d}),e.\u0275\u0275text(342),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(343,"td",17),e.\u0275\u0275elementStart(344,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilMFVal=d}),e.\u0275\u0275text(345),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(346,"td",32),e.\u0275\u0275elementStart(347,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilTotalVal=d}),e.\u0275\u0275text(348),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(349,"tr",20),e.\u0275\u0275elementStart(350,"td",21),e.\u0275\u0275elementStart(351,"div",22),e.\u0275\u0275elementStart(352,"table",23),e.\u0275\u0275elementStart(353,"tr"),e.\u0275\u0275elementStart(354,"td"),e.\u0275\u0275elementStart(355,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilCommText=d}),e.\u0275\u0275text(356),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(357,"td",17),e.\u0275\u0275elementStart(358,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilCommVal=d}),e.\u0275\u0275text(359),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(360,"tr"),e.\u0275\u0275elementStart(361,"td"),e.\u0275\u0275elementStart(362,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilMFText=d}),e.\u0275\u0275text(363),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(364,"td",17),e.\u0275\u0275elementStart(365,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilMFValue=d}),e.\u0275\u0275text(366),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(367,"tr"),e.\u0275\u0275elementStart(368,"td"),e.\u0275\u0275elementStart(369,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilCurrText=d}),e.\u0275\u0275text(370),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(371,"td",17),e.\u0275\u0275elementStart(372,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilCurrVal=d}),e.\u0275\u0275text(373),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(374,"table",25),e.\u0275\u0275elementStart(375,"tr"),e.\u0275\u0275elementStart(376,"td"),e.\u0275\u0275elementStart(377,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilDervText=d}),e.\u0275\u0275text(378),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(379,"td",17),e.\u0275\u0275elementStart(380,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilDervVal=d}),e.\u0275\u0275text(381),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(382,"tr"),e.\u0275\u0275elementStart(383,"td"),e.\u0275\u0275elementStart(384,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilEqText=d}),e.\u0275\u0275text(385),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(386,"td",17),e.\u0275\u0275elementStart(387,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.LimitUtilEqVal=d}),e.\u0275\u0275text(388),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(389,"tr",14),e.\u0275\u0275listener("click",function(){return r.ShowHide("BPL")}
1),e.\u0275\u0275elementStart(390,"td",15),e.\u0275\u0275element(391,"button",16),e.\u0275\u0275elementStart(392,"label"),e.\u0275\u0275text(393),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(394,"td",17),e.\u0275\u0275elementStart(395,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"MR","BPL")}),e.\u0275\u0275elementStart(396,"span",29),e.\u0275\u0275text(397,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(398,"label",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLTradingVal=d}),e.\u0275\u0275text(399),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(400,"td",17),e.\u0275\u0275elementStart(401,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLIPO=d}),e.\u0275\u0275text(402),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(403,"td",17),e.\u0275\u0275elementStart(404,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLMF=d}),e.\u0275\u0275text(405),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(406,"td",32),e.\u0275\u0275elementStart(407,"label",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLTotalVal=d}),e.\u0275\u0275text(408),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(409,"tr",20),e.\u0275\u0275elementStart(410,"td",21),e.\u0275\u0275elementStart(411,"div",22),e.\u0275\u0275elementStart(412,"table",23),e.\u0275\u0275elementStart(413,"tr"),e.\u0275\u0275elementStart(414,"td"),e.\u0275\u0275elementStart(415,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLCommText=d}),e.\u0275\u0275text(416),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(417,"td",17),e.\u0275\u0275elementStart(418,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLCommVal=d}),e.\u0275\u0275text(419),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(420,"tr"),e.\u0275\u0275elementStart(421,"td"),e.\u0275\u0275elementStart(422,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLCurrText=d}),e.\u0275\u0275text(423),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(424,"td",17),e.\u0275\u0275elementStart(425,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLCurrVal=d}),e.\u0275\u0275text(426),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(427,"table",25),e.\u0275\u0275elementStart(428,"tr"),e.\u0275\u0275elementStart(429,"td"),e.\u0275\u0275elementStart(430,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLEqDervText=d}),e.\u0275\u0275text(431),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(432,"td",17),e.\u0275\u0275elementStart(433,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLEqDervVal=d}),e.\u0275\u0275text(434),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(435,"tr"),e.\u0275\u0275elementStart(436,"td"),e.\u0275\u0275elementStart(437,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLEqText=d}),e.\u0275\u0275text(438),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(439,"td",17),e.\u0275\u0275elementStart(440,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.BookedPLEqVal=d}),e.\u0275\u0275text(441),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(442,"tr",14),e.\u0275\u0275listener("click",function(){return r.ShowHide("MTM")}),e.\u0275\u0275elementStart(443,"td",15),e.\u0275\u0275element(444,"button",16),e.\u0275\u0275elementStart(445,"label"),e.\u0275\u0275text(446),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(447,"td",17),e.\u0275\u0275elementStart(448,"a",27),e.\u0275\u0275listener("click",function(d){return r.openDialog(d,"MR","MPL")}),e.\u0275\u0275elementStart(449,"span",29),e.\u0275\u0275text(450,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(451,"label",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLTradingVal=d}),e.\u0275\u0275text(452),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(453,"td",17),e.\u0275\u0275elementStart(454,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLIPOVal=d}),e.\u0275\u0275text(455),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(456,"td",17),e.\u0275\u0275elementStart(457,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLMFVal=d}),e.\u0275\u0275text(458),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(459,"td",32),e.\u0275\u0275elementStart(460,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLTotalVal=d}),e.\u0275\u0275text(461),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(462,"tr",20),e.\u0275\u0275elementStart(463,"td",21),e.\u0275\u0275elementStart(464,"div",22),e.\u0275\u0275elementStart(465,"table",23),e.\u0275\u0275elementStart(466,"tr"),e.\u0275\u0275elementStart(467,"td"),e.\u0275\u0275elementStart(468,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLCommText=d}),e.\u0275\u0275text(469),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(470,"td",17),e.\u0275\u0275elementStart(471,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLCommVal=d}),e.\u0275\u0275text(472),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(473,"tr"),e.\u0275\u0275elementStart(474,"td"),e.\u0275\u0275elementStart(475,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLCurrText=d}),e.\u0275\u0275text(476),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(477,"td",17),e.\u0275\u0275elementStart(478,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLCurrVal=d}),e.\u0275\u0275text(479),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(480,"table",25),e.\u0275\u0275elementStart(481,"tr"),e.\u0275\u0275elementStart(482,"td"),e.\u0275\u0275elementStart(483,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLDervText=d}),e.\u0275\u0275text(484),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(485,"td",17),e.\u0275\u0275elementStart(486,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLDervVal=d}),e.\u0275\u0275text(487),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(488,"tr"),e.\u0275\u0275elementStart(489,"td"),e.\u0275\u0275elementStart(490,"h1",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLEqText=d}),e.\u0275\u0275text(491),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(492,"td",17),e.\u0275\u0275elementStart(493,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.MTMPLEqVal=d}),e.\u0275\u0275text(494),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(495,"tr",34),e.\u0275\u0275elementStart(496,"td",35),e.\u0275\u0275elementStart(497,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.TotalUtilText=d}),e.\u0275\u0275text(498),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(499,"td",38),e.\u0275\u0275elementStart(500,"span",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.TotalUtilTradVal=d}),e.\u0275\u0275text(501),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(502,"td",17),e.\u0275\u0275elementStart(503,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.TotalUtilIPOVal=d}),e.\u0275\u0275text(504),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(505,"td",17),e.\u0275\u0275elementStart(506,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.TotalUtilMFVal=d}),e.\u0275\u0275text(507),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(508,"td",17),e.\u0275\u0275elementStart(509,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.TotalUtilTotVal=d}),e.\u0275\u0275text(510),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(511,"div",39),e.\u0275\u0275elementStart(512,"table",23),e.\u0275\u0275elementStart(513,"tbody"),e.\u0275\u0275elementStart(514,"tr"),e.\u0275\u0275elementStart(515,"td"),e.\u0275\u0275elementStart(516,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.
1NetAvailText=d}),e.\u0275\u0275text(517),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(518,"td"),e.\u0275\u0275elementStart(519,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForTradText=d}),e.\u0275\u0275text(520),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(521,"td"),e.\u0275\u0275elementStart(522,"label",24),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForAllocWdrwText=d}),e.\u0275\u0275text(523),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(524,"tr"),e.\u0275\u0275elementStart(525,"td",40),e.\u0275\u0275elementStart(526,"span",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.NetAvailTradVal=d}),e.\u0275\u0275text(527),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(528,"td",40),e.\u0275\u0275elementStart(529,"span",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForTradVal=d}),e.\u0275\u0275text(530),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(531,"td",40),e.\u0275\u0275elementStart(532,"span",18),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForAllocWdrwVal=d}),e.\u0275\u0275text(533),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(534,"tr"),e.\u0275\u0275elementStart(535,"td",17),e.\u0275\u0275elementStart(536,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.NetAvailIPOVal=d}),e.\u0275\u0275text(537),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(538,"td",17),e.\u0275\u0275elementStart(539,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForTradIPOVal=d}),e.\u0275\u0275text(540),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(541,"td",17),e.\u0275\u0275elementStart(542,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForAllocWdrwIPOVal=d}),e.\u0275\u0275text(543),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(544,"tr"),e.\u0275\u0275elementStart(545,"td",17),e.\u0275\u0275elementStart(546,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.NetAvailMFVal=d}),e.\u0275\u0275text(547),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(548,"td",17),e.\u0275\u0275elementStart(549,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForTradMFVal=d}),e.\u0275\u0275text(550),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(551,"td",17),e.\u0275\u0275elementStart(552,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForAllocWdrwMFVal=d}),e.\u0275\u0275text(553),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(554,"tr"),e.\u0275\u0275elementStart(555,"td",17),e.\u0275\u0275elementStart(556,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.NetAvailTotalVal=d}),e.\u0275\u0275text(557),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(558,"td",17),e.\u0275\u0275elementStart(559,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForTradTotalVal=d}),e.\u0275\u0275text(560),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(561,"td",17),e.\u0275\u0275elementStart(562,"span",19),e.\u0275\u0275listener("ngModelChange",function(d){return r.ForAllocWdrwTotalVal=d}),e.\u0275\u0275text(563),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.fundData),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!r.bShowDropDown),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.bShowDropDown),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(11),e.\u0275\u0275property("className",r.DepSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.DepositText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.DepositTrading)("className",r.DepositCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.DepositTrading),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.DepositIPO)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.DepositIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.DepositMF)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.DepositMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.DepositTotal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.DepositTotal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsDepositSection_10004Visible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.CashDeposit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CashDeposit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CashDepositVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CashDepositVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.AdhocDeposit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdhocDeposit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.AdhocDepositVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdhocDepositVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.OverdraftLimit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OverdraftLimit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OverdraftLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OverdraftLimitVal),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",r.NotionalDeposit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NotionalDeposit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.NotionalDepositVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NotionalDepositVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.MiscDeposit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MiscDeposit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MiscDepositVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MiscDepositVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.ManualCollateral),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ManualCollateral),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ManualCollateralVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ManualCollateralVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.FTDText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FTDText),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.FTDTrading),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FTDTrading),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.FTDIPO)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FTDIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.FTDMF)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FTDMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.FTDTotal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FTDMF),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.FWText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FWText),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.FWTrading)("className",r.FWTradingCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FWTrading),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.FWIPO)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FWIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.FWMF)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FWMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.FWTotal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.FWTotal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsAdHocDepositVisible),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.AdDepositText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdDepositText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.AdDepositTrading),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdDepositTrading),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.AdDepositIPO)("hidden",!r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdDepositIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.AdDepositMF)("hidden",!r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdDepositMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.AdDepositTotal)("hidden",!r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.AdDepositTotal),e.\u0275\u0275advance(3),e.\u0275\u0275property("className",r.CBSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.CollBenText),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.CollBenTrading)("className",r.CBValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenTrading),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollBenIPO)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollBenMF)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollBenTotal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenTotal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsCBVisible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.CollBenDPText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenDPText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollBenDPVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenDPVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.CollBenDPVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenPoolText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollBenPoolVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenPoolVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.CollBenSARText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenSARText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollBenSARVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollBenSARVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.ShowFundsViewT5),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",r.CollatDPPledged),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollatDPPledged),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollatDPPledgedVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollatDPPledgedVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.CollatPoolPledged),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollatPoolPledged),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollatPoolPledgedVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollatPoolPledgedVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.CollatMaxLimit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollatMaxLimit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CollatMaxLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CollatMaxLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.ShowFundsViewT5),e.\u0275\u0275advance(3),e.\u0275\u0275property("className",r.CFSSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.CreditForSaleText),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.CreditForSaleTrading)("className",r.CFSValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleTrading),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CreditForSaleIPO)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CreditForSaleMF)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CreditForSaleTotal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleTotal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsCFSVisible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.CreditForSaleDPText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleDPText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CreditForSaleDPVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleDPVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.CreditForSalePoolText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSalePoolText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CreditForSalePoolVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSalePoolVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.ShowFundsViewT5),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",r.CreditForSaleSARText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleSARText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CreditForSaleSARVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CreditForSaleSARVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsCFSMaxLimit_10004),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CFSMaxLimit),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CFSMaxLimit),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.CFSMaxLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.CFSMaxLimitVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.ShowFundsViewT5),e.\u0275\u0275advance(3),e.\u0275\u0275property("className",r.OptCFSSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.OptionCFSText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSTradingVal)("className",r.OptionCFSCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSTradingVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSTotalVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsOptionCFSSection_10004Visible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.OptionCFSSec),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSSec),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSSecVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSSecVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("hidden",!r.IsOptionCFSMax_10004Visible),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSMax),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSMax),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.OptionCFSMaxVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.OptionCFSMaxVal),e.
1\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.MultiplierVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MultiplierVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MultiplierTradingVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MultiplierTradingVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MultiplierIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MultiplierIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MultiplierMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MultiplierMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MultiplierTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MultiplierTotalVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.TradingLimitText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TradingLimitText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TradingLimitVal)("className",r.TradingLimitValCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TradingLimitVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TradingLimitIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TradingLimitIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TradingLimitMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TradingLimitMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TradingLimitTotal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TradingLimitTotal),e.\u0275\u0275advance(6),e.\u0275\u0275property("className",r.LUSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.LimitUtilText),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.LimitUtilTradingVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilTradingVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilTotalVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsLUVisible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.LimitUtilCommText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilCommText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilCommVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilCommVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.LimitUtilMFText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilMFText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilMFValue),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilMFValue),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.LimitUtilCurrText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilCurrText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilCurrVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilCurrVal),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",r.LimitUtilDervText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilDervText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilDervVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilDervVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.LimitUtilEqText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilEqText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.LimitUtilEqVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.LimitUtilEqVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("className",r.BookPLSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.BookedPLText),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.BookedPLTradingVal)("className",r.MRValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLTradingVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLIPO)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLIPO),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLMF)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLMF),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLTotalVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsBookedPLVisible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.BookedPLCommText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLCommText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLCommVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLCommVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.BookedPLCurrText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLCurrText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLCurrVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLCurrVal),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",r.BookedPLEqDervText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLEqDervText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLEqDervVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLEqDervVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.BookedPLEqText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLEqText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.BookedPLEqVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.BookedPLEqVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("className",r.MTMSummaryCss),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(r.MTMPLText),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",r.MTMPLTradingVal)("className",r.MTMValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLTradingVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLTotalVal),e.\u0275\u0275advance(1),e.\u0275\u0275property("hidden",!r.IsMTMVisible),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.MTMPLCommText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLCommText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLCommVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLCommVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.MTMPLCurrText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLCurrText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLCurrVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLCurrVal),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",r.MTMPLDervText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLDervText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLDervVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLDervVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.MTMPLEqText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLEqText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.MTMPLEqVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.MTMPLEqVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.TotalUtilText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TotalUtilText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TotalUtilTradVal),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TotalUtilTradVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TotalUtilIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TotalUtilTradVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TotalUtilMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TotalUtilMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.TotalUtilTotVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.TotalUtilTotVal),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",r.NetAvailText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NetAvailText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForTradText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForTradText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForAllocWdrwText),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForAllocWdrwText),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.NetAvailTradVal)("className",r.NetAvailValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NetAvailTradVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForTradVal)("className",r.TradTotalValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForTradVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForAllocWdrwVal)("className",r.AllocWdrwValueCss),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForAllocWdrwVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.NetAvailIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NetAvailIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForTradIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForTradIPOVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForAllocWdrwIPOVal)("hidden",r.IsIPOVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForAllocWdrwIPOVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.NetAvailMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NetAvailMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForTradMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForTradMFVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForAllocWdrwMFVal)("hidden",r.IsMFVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForAllocWdrwMFVal),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",r.NetAvailTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.NetAvailTotalVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForTradTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForTradTotalVal),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",r.ForAllocWdrwTotalVal)("hidden",r.IsTotalVisible),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.ForAllocWdrwTotalVal))},directives:[W.O5,a.Fj,ue.gM,a.JJ,a.On,T.ZV,W.sg,W.PC,V.R,Q.lW,W.mk,_.KE,k.gD,H.ey],encapsulation:2,changeDetection:0}),S})();var Jr=x(1330),is=x(8732);const rs=["reportGrid"],ns=["cellTmpCurrentValue"],as=["cellTmplLTP"],ss=["cellTmplExpand"],ls=["cellTmplSelloff"];
1function os(S,O){1&S&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"nn-progressbar",13),e.\u0275\u0275elementEnd()),2&S&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("type","PS"))}function cs(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275elementStart(1,"span",14),e.\u0275\u0275elementStart(2,"button",15),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().DPAutoHold()}),e.\u0275\u0275text(3,"HOLD STOCKS"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",!t.DPAutoHoldBtnEnable)}}function ds(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportCSV()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function hs(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",17),e.\u0275\u0275element(1,"reportgrid",18,19),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("hidden",t.showProgressBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("fixedHdrConfig",t.fixedHdrConfig)("showPaging",!0)("pageSize",t.SV_PageSize)("fhTopHeight","35px")("extendedPageSize",t.SV_extendedPageSize)("reportName","StockView")("noDataFoundMsg",t.noDataFoundMsg)("columns",t.columns)("rows",t.rows)("showFooter",t.showFooter)("footerData",t.footerData)}}function ps(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",21),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().getRowCSS(s)}),e.\u0275\u0275elementEnd()}if(2&S){const t=e.\u0275\u0275nextContext().row;e.\u0275\u0275property("className",t.rowExpandCSS)}}function ms(S,O){1&S&&e.\u0275\u0275template(0,ps,1,1,"input",20),2&S&&e.\u0275\u0275property("ngIf",1==O.row.cell)}function us(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateOEFromSV(s,"BUY")}),e.\u0275\u0275text(1,"BUY"),e.\u0275\u0275elementEnd()}}function Ss(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateOEFromSV(s,"SELL")}),e.\u0275\u0275text(1,"SELL"),e.\u0275\u0275elementEnd()}}function _s(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",27),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext().PopulateOEFromSV(s,"SIP")}),e.\u0275\u0275text(1,"SIP"),e.\u0275\u0275elementEnd()}}function gs(S,O){if(1&S&&(e.\u0275\u0275template(0,us,2,0,"button",22),e.\u0275\u0275template(1,Ss,2,0,"button",23),e.\u0275\u0275template(2,_s,2,0,"button",24)),2&S){const t=O.row,r=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngIf",2==t.cell),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",2==t.cell),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",2==t.cell&&r.enableEQSIPHyperLink)}}function Ts(S,O){if(1&S&&e.\u0275\u0275element(0,"span",28),2&S){const t=O.column,r=e.\u0275\u0275nextContext();e.\u0275\u0275property("innerHTML",r.footerData[t.value].value1,e.\u0275\u0275sanitizeHtml)}}let qr=(()=>{class S{constructor(t,r,s,d,I,M,U,q){this.httpService=t,this.logService=r,this.dialogService=s,this.menuManager=d,this.pubsubService=I,this.zone=M,this.tradingSharedService=U,this.cdRef=q,this.enableEQSIPHyperLink=!1,this.showProgressBar=!1,this.isRowsAvailable=!1,this.showFilter=!1,this.enableSort=!1,this.showFooter=!0,this.rowCombined=[],this.totalval=0,this.dpAvail=0,this.dpBlock=0,this.dpFree=0,this.dpValue=0,this.availablewithPOOL=0,this.isFirstReq=!0,this.blockedwithPOOL=0,this.freewithPOOL=0,this.valuewithPOOL=0,this.recvAvail=0,this.recvBlock=0,this.recvFree=0,this.recvValue=0,this.todayAvail=0,this.todayBlock=0,this.todayFree=0,this.todayValue=0,this.totalBlock=0,this.totalFree=0,this.totalValue=0,this.totalAvail=0,this.collateralPrice=0,this.dpCollateralQty=0,this.dpCollateralHairCut
1=0,this.dpSecurityCollateral=0,this.poolCollateralQty=0,this.poolCollateralHaircut=0,this.poolSecurityCollateral=0,this.sarCollateralQty=0,this.sarCollateralHaircut=0,this.sarSecurityCollateral=0,this.totalSecurityCollateral=0,this.CFSHaircut=0,this.CreditForSale=0,this.ShortSellQty=0,this.BuyAvgPrice=0,this.Indicator=0,this.MarketValue=0,this.GainLoss=0,this.DPPledgedQty=0,this.DPPledgedCollateral=0,this.POOLPledgedQty=0,this.POOLPledgedCollateral=0,this.TotalValue=0,this.Selectedrow="",this.TotalCollateralQty=0,this.PoolsarHolding=0,this.nNormal_MarketAllowed=0,this.ArrSubTokens=[],this.scripList=[],this.fixedHdrConfig={minCellWidth:46,columnAlign:"left"},this.noDataFoundMsg="No records available",this.SV_PageSize="6",this.SV_extendedPageSize="12",this.DPAutoHoldOnLogin=!(!n.xB.User.ThreeInOneAccount||n.xB.dConfigMaster.DP_AUTO_HOLD_MODE!=n.gT.C_S_DP_AUTO_HOLD_MODE),this.DPAutoHoldBtnEnable=!0}ngOnInit(){try{(0,fe.isNullOrUndefined)(n.xB.PageSizeDetails)||(this.SV_PageSize=n.xB.PageSizeDetails.SV_PageSize,this.SV_extendedPageSize=n.xB.PageSizeDetails.SV_extendedPageSize),this.enableEQSIPHyperLink=!!n.vV.IsAllowedClientFacility(n.gT.C_S_FACILITY_EQSIP)}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","stockview.component.ts","")}}subscribeMessages(){try{if(0==this.ArrSubTokens.length){this.ArrSubTokens=[];let t=this.pubsubService.subscribe("MTLRES",(r,s)=>{this.zone.run(()=>{this.handleMultiTouchResp(r,s)})});this.ArrSubTokens.push(t),this.ArrSubTokens.push(t)}this.GetStockView(),this.pubsubService.subscribe("SVMAX",(t,r)=>{console.log("Stockview loaded"),this.refresh()})}catch(t){this.logService.WriteLog("Exception: "+t.message,"subscribeMessages","stockview.component.ts","")}}refresh(){this.GetStockView()}exportCSV(){this.reportGrid.exportCSV("StockView")}createMarketWatchProfile(){try{this.pubsubService.publish("STOCKVIEWMW",{})}catch(t){this.logService.WriteLog("Exception: "+t.message,"createMarketWatchProfile()","stockview.component.ts","")}}GetStockView(){try{this.showProgressBar=!0,this.isRowsAvailable=!1,this.httpService.postData(n.xB.tradingAPIUrl,"GetStockView",{RequireHeader:1==this.isFirstReq?"1":"0",UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(r=>{this.CallBackGetStockView(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"GetStockView()","stockview.component.ts","")}}CallBackGetStockView(t){this.showProgressBar=!1;try{this.dpAvail=0,this.totalval=0,this.dpBlock=0,this.dpFree=0,this.dpValue=0,this.blockedwithPOOL=0,this.availablewithPOOL=0,this.freewithPOOL=0,this.valuewithPOOL=0,this.recvAvail=0,this.recvBlock=0,this.recvFree=0,this.recvValue=0,this.todayAvail=0,this.todayBlock=0,this.todayFree=0,this.todayValue=0,this.totalAvail=0,this.totalBlock=0,this.totalFree=0,this.dpCollateralQty=0,this.dpSecurityCollateral=0,this.poolCollateralQty=0,this.poolSecurityCollateral=0,this.sarCollateralQty=0,this.sarSecurityCollateral=0,this.totalSecurityCollateral=0,this.CFSHaircut=0,this.CreditForSale=0,this.ShortSellQty=0,this.TotalCollateralQty=0,this.BuyAvgPrice=0,this.Indicator=0,this.MarketValue=0,this.GainLoss=0,this.DPPledgedQty=0,this.DPPledgedCollateral=0,this.POOLPledgedQty=0,this.POOLPledgedCollateral=0,this.PoolsarHolding=0,t=t.ResponseObject,this.rows=[],this.isFirstReq&&(this.initHeaders(t.objJSONHeader),this.isFirstReq=!1);var r=t.objJSONRows;if(void 0!==r&&r.length>0){for(var s=r,I=[],M=0;M<s.length;M++){var U=s[M];"COMBINED"==U.Combined?(I.length>0&&(U.Token=I.length>1?1==U.PrefMTMMKtSegId?I[0].Token:8==U.PrefMTMMKtSegId?I[1].Token:I[0].Token:I[0].Token),this.insertRow(U,null),I.forEach(Ie=>{this.insertRow(Ie,U)}),I=[]):I.push(U)}this.scripList.length>0&&this.tradingSharedService.sendTouchLineRequest(this.scripList,1),this.footerData={ScripName:{value1:"(ALL)"},ISIN:{value1:"(ALL)"},Total_Value:{value1:isNaN(this.totalval)?"0.00":parseFloat(this.totalval).toFixed(2)},DP_Avail:{value1:isNaN(this.dpAvail)?"0":this.dpAvail},DP_Block:{value1:isNaN(this.dpBlock)?"0":this.dpBlock},DP_Free:{value1:isNaN(this.dpFree)?"0":this.dpFree},DP_Value:{value1:isNaN(this.dpValue)?"0.00":parseFloat(this.dpValue).toFixed(2)},AvailablewithPOOL:{value1:isNaN(this.availablewithPOOL)?"0":this.availablewithPOOL},Blocked_with_POOL:{value1:isNaN(this.blockedwithPOOL)?"0":this.blockedwithPOOL},Free_with_POOL:{value1:isNaN(this.freewithPOOL)?"0":this.freewithPOOL},Value_with_POOL:{value1:isNaN(this.valuewithPOOL)?"0.00":parseFloat(this.valuewithPOOL).toFixed(2)},Recv_Avail:{value1:isNaN(this.recvAvail)?"0":this.recvAvail},Recv_Block:{value1:isNaN(this.recvBlock)?"0":this.recvBlock},Recv_Free:{value1:isNaN(this.recvFree)?"0":this.recvFree},Recv_Value:{value1:isNaN(this.recvValue)?"0.00":parseFloat(this.recvValue).toFixed(2)},Today_Avail:{value1:isNaN(this.todayAvail)?"0":this.todayAvail},Today_Block:{value1:isNaN(this.todayBlock)?"0":this.todayBlock},Today_Free:{value1:isNaN(this.todayFree)?"0":this.todayFree},Today_Value:{value1:isNaN(this.todayValue)?"0.00":parseFloat(this.todayValue).toFixed(2)},Total_Avail:{value1:isNaN(this.totalAvail)?"0":this.totalAvail},Total_Block:{value1:isNaN(this.totalBlock)?"0":this.totalBlock},Total_Free:{value1:isNaN(this.totalFree)?"0":this.totalFree},Collateral_Price:{value1:"(ALL)"},DP_Collateral_Qty:{value1:isNaN(this.dpCollateralQty)?"0":this.dpCollateralQty},DP_Collateral_HairCut:{value1:"(ALL)"},DP_Security_Collateral:{value1:isNaN(this.dpSecurityCollateral)?"0":parseFloat(this.dpSecurityCollateral).toFixed(2)},POOL_Collateral_Qty:{value1:isNaN(this.poolCollateralQty)?"0":this.poolCollateralQty},POOL_Collateral_Haircut:{value1:"(ALL)"},POOL_Security_Collateral:{value1:isNaN(this.poolSecurityCollateral)?"0":parseFloat(this.poolSecurityCollateral).toFixed(2)},SAR_Collateral_Qty:{value1:isNaN(this.sarCollateralQty)?"0":this.sarCollateralQty},SAR_Collateral_Haircut:{value1:"(ALL)"},SAR_Security_Collateral:{value1:isNaN(this.sarSecurityCollateral)?"0.00":parseFloat(this.sarSecurityCollateral).toFixed(2)},Total_Security_Collateral:{value1:parseFloat(this.totalSecurityCollateral).toFixed(2)}
1,CFS_Haircut:{value1:isNaN(this.CFSHaircut)?"0":parseFloat(this.CFSHaircut).toFixed(2)},Credit_For_Sale:{value1:isNaN(this.CreditForSale)?"0.00":parseFloat(this.CreditForSale).toFixed(2)},Short_Sell_Qty:{value1:isNaN(this.ShortSellQty)?"0":this.ShortSellQty},Buy_Avg_Price:{value1:isNaN(this.BuyAvgPrice)?"0":parseFloat(this.BuyAvgPrice).toFixed(2)},MarketValue:{value1:isNaN(this.MarketValue)?"0.00":parseFloat(this.MarketValue).toFixed(2)},GainLoss:{value1:isNaN(this.GainLoss)?"0.00":parseFloat(this.GainLoss).toFixed(2)},DP_Pledged_Qty:{value1:isNaN(this.DPPledgedQty)?"0":this.DPPledgedQty},DP_Pledged_Collateral:{value1:isNaN(this.DPPledgedCollateral)?"0.00":this.DPPledgedCollateral},POOL_Pledged_Qty:{value1:isNaN(this.POOLPledgedQty)?"0":this.POOLPledgedQty},POOL_Pledged_Collateral:{value1:isNaN(this.POOLPledgedCollateral)?"0":this.POOLPledgedCollateral},Total_Collateral_Qty:{value1:isNaN(this.TotalCollateralQty)?"0":this.TotalCollateralQty},Pool_SAR_Holding:{value1:isNaN(this.PoolsarHolding)?"0":this.PoolsarHolding}},this.isRowsAvailable=!0}else this.isRowsAvailable=!0;this.cdRef.markForCheck()}catch(j){this.logService.WriteLog("Exception: "+j.message,"CallBackGetStockView","stockview.component.ts","")}}initHeaders(t){if(this.arrayheader=[],this.arrayheader.Modify={footer:!0,value:"Modify",cellTemplate:this.cellTmplExpand},this.arrayheader.Action={footer:!0,value:"Action",cellTemplate:this.cellTmplSelloff},this.arrayheader[1]={value:"Exch",cType:"S"},this.arrayheader[31]={value:"Symbol",cType:"S"},this.arrayheader[32]={value:"Series",cType:"N"},this.arrayheader[5001]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"ScripName",cType:"S"},this.arrayheader[5002]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"ISIN",cType:"N"},this.arrayheader[5003]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Avail",cType:"N"},this.arrayheader[5004]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Block",cType:"N"},this.arrayheader[5005]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Free",cType:"N"},this.arrayheader[5006]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Value",cType:"N"},this.arrayheader[5007]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Recv_Avail",cType:"N"},this.arrayheader[5008]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Recv_Block",cType:"N"},this.arrayheader[5009]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Recv_Free",cType:"N"},this.arrayheader[5010]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Recv_Value",cType:"N"},this.arrayheader[5011]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Today_Avail",cType:"N"},this.arrayheader[5012]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Today_Block",cType:"N"},this.arrayheader[5013]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Today_Free",cType:"N"},this.arrayheader[5014]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Today_Value",cType:"N"},this.arrayheader[5015]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Total_Avail",cType:"N"},this.arrayheader[5016]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Total_Block",cType:"N"},this.arrayheader[5017]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Total_Free",cType:"N"},this.arrayheader[5018]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Total_Value",cType:"N"},this.arrayheader[5019]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Collateral_Qty",cType:"N"},this.arrayheader[5020]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Collateral_Price",cType:"N"},this.arrayheader[5021]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Collateral_HairCut",cType:"N, numeric: true"},this.arrayheader[5022]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Security_Collateral",cType:"N"},this.arrayheader[5023]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Credit_For_Sale",cType:"N"},this.arrayheader[5024]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"SAR_Collateral_Qty",cType:"N"},this.arrayheader[5025]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"SAR_Security_Collateral",cType:"N"},this.arrayheader[5026]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Total_Security_Collateral",cType:"N"},this.arrayheader[5030]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"AvailablewithPOOL",cType:"N"},this.arrayheader[5031]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Blocked_with_POOL",cType:"N"},this.arrayheader[5032]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Free_with_POOL",cType:"N"},this.arrayheader[5033]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Value_with_POOL",cType:"N"},this.arrayheader[5034]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"POOL_Collateral_Qty",cType:"N"},this.arrayheader[5035]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"POOL_Security_Collateral",cType:"N"},this.arrayheader[5036]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"POOL_Collateral_Haircut",cType:"N"},this.arrayheader[5037]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"SAR_Collateral_Haircut",cType:"N"},this.arrayheader[5038]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"CFS_Hair
1cut",cType:"N"},this.arrayheader[5039]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Short_Sell_Qty",cType:"N"},this.arrayheader[5042]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Total_Collateral_Qty",cType:"N"},this.arrayheader[5041]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Pool_SAR_Holding",cType:"N"},this.arrayheader[5043]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"Buy_Avg_Price",cType:"N"},this.arrayheader[5044]={value:"Indicator",cType:"N"},this.arrayheader[5045]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"MarketValue",cType:"N"},this.arrayheader[5046]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"GainLoss",cType:"N"},this.arrayheader[5082]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Pledged_Qty",cType:"N"},this.arrayheader[5083]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"DP_Pledged_Collateral",cType:"N"},this.arrayheader[5084]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"POOL_Pledged_Qty",cType:"N"},this.arrayheader[5085]={footer:!0,footerTemplate:this.cellTmpCurrentValue,value:"POOL_Pledged_Collateral",cType:"N"},this.arrayheader[7]={value:"ScripCode",cType:"N"},this.arrayheader[76]={value:"ClosePrc",cType:"N"},this.arrayheader[8]={value:"LTP",cType:"N",cellTemplate:this.cellTmplLTP},this.columns=[],void 0!==t)for(let I=0;I<t.length;I++)if(this.arrayheader.length>0){var d=this.arrayheader[t[I].Id];d.name="Modify"==t[I].Id?" ":t[I].Nm,this.arrayheader[t[I].Id]=d,this.columns.push(d)}}getRowCSS(t){this.rows.forEach(r=>{r!==t&&(r.rowExpanded=!1),r.rowExpandCSS="expand_icon"}),t.rowExpanded?(t.rowExpanded=!1,t.rowExpandCSS="expand_icon"):(t.rowExpanded=!0,t.rowExpandCSS="collapse_icon");for(let r=0;r<this.rows.length;
1r++)t.ISIN==this.rows[r].ISIN&&"COMBINED"!=this.rows[r].Combined?this.rows[r].cellClassName="svShow"==this.rows[r].cellClassName||"svShowChild"==this.rows[r].cellClassName?"svhide":"svShowChild":"COMBINED"!=this.rows[r].Combined&&(this.rows[r].cellClassName="svhide");this.reportGrid.reApplyFH()}insertRow(t,r){if(this.rows.push({ScripName:"COMBINED"==t.Combined?t.ScripName:t.Combined+" "+t.ScripName+" "+t.Series,ISIN:t.ISIN,ClosePrc:""==t.ClosePrc?"0.00":(parseFloat(t.ClosePrc)/100).toFixed(2),LTP:t.LTP,DP_Avail:t.DPAvail,DP_Block:t.DPBlock,DP_Free:t.DPFree,DP_Value:t.DPValue,AvailablewithPOOL:t.AvailwithPOOL,Blocked_with_POOL:t.BlockwithPOOL,Free_with_POOL:t.FreewithPOOL,Value_with_POOL:t.ValuewithPOOL,Recv_Avail:t.RecvAvail,Recv_Block:t.RecvBlock,Recv_Free:t.RecvFree,Recv_Value:""==t.RecvValue?"0.00":parseFloat(t.RecvValue).toFixed(2),Today_Avail:t.TodayAvail,Today_Block:t.TodayBlock,Today_Free:t.TodayFree,Today_Value:""==t.TodayValue?"0.00":parseFloat(t.TodayValue).toFixed(2),Total_Avail:t.TotalA,Total_Block:t.TotalB,Total_Free:t.TotalF,Total_Value:""==t.TotalV?"0.00":parseFloat(t.TotalV).toFixed(2),Collateral_Price:t.ColPrice,DP_Collateral_Qty:t.DPColQty,DP_Collateral_HairCut:t.DPColHairCut,DP_Security_Collateral:t.DPSecCol,POOL_Collateral_Qty:t.POOLColQty,POOL_Collateral_Haircut:t.POOLColHaircut,POOL_Security_Collateral:t.POOLSecCol,SAR_Collateral_Qty:t.SARColQty,SAR_Collateral_Haircut:t.SARColHaircut,SAR_Security_Collateral:""==t.SARSecCol?"0.00":parseFloat(t.SARSecCol).toFixed(2),Total_Security_Collateral:t.TotalSecCol,CFS_Hair
1cut:t.CFSHaircut,Credit_For_Sale:""==t.CreditForSale?"0.00":parseFloat(t.CreditForSale).toFixed(2),Short_Sell_Qty:t.ShortSellQty,Total_Collateral_Qty:t.TotalColQty,Pool_SAR_Holding:t.PoolSARHold,Buy_Avg_Price:isNaN(t.BuyAvgP)?"0.00":parseFloat(t.BuyAvgP).toFixed(2),Indicator:t.Indicator,MarketValue:""==t.MarketValue?"0.00":parseFloat(t.MarketValue).toFixed(2),GainLoss:""==t.GainLoss?"0.00":parseFloat(t.GainLoss).toFixed(2),DP_Pledged_Qty:t.DPPQty,DP_Pledged_Collateral:t.DPPCol,POOL_Pledged_Qty:t.POOLPQty,POOL_Pledged_Collateral:t.POOLPCol,cellClassName:"COMBINED"==t.Combined?"svShow":"svhide",Combined:t.Combined,cell:"COMBINED"==t.Combined?1:2,Token:t.Token,Symbol:t.Symbol,Series:t.Series,nSellOfToday:t.nSellOfToday,nSellOfReceivables:t.nSellOfReceivables,nSellOfDemat:t.nSellOfDemat,nSellOfPOOL:t.nSellOfPOOL,DPPOOLFree:t.DPPOOLFree,rowExpandCSS:"expand_icon",isCombRecord:null!=r&&-1!=r.PrefMTMMKtSegId&&""!=r.PrefMTMMKtSegId,combTotalFree:null!=r&&-1!=r.PrefMTMMKtSegId&&""!=r.PrefMTMMKtSegId?r.TotalF:"0",isFirstBcastRsp:!1,marketsegmentId:"NSE"==t.Combined?1:"BSE"==t.Comb
1ined?3:-1,nNormal_MarketAllowed:t.nNormal_MarketAllowed}),"COMBINED"==t.Combined)this.totalval+=isNaN(parseFloat(t.TotalV))?0:parseFloat(t.TotalV),this.dpAvail+=isNaN(parseFloat(t.DPAvail))?0:parseFloat(t.DPAvail),this.dpBlock+=isNaN(parseFloat(t.DPBlock))?0:parseFloat(t.DPBlock),this.dpFree+=isNaN(parseFloat(t.DPFree))?0:parseFloat(t.DPFree),this.dpValue+=isNaN(parseFloat(t.DPValue))?0:parseFloat(t.DPValue),this.availablewithPOOL+=isNaN(parseFloat(t.AvailwithPOOL))?0:parseFloat(t.AvailwithPOOL),this.blockedwithPOOL+=isNaN(parseFloat(t.BlockwithPOOL))?0:parseFloat(t.BlockwithPOOL),this.freewithPOOL+=isNaN(parseFloat(t.FreewithPOOL))?0:parseFloat(t.FreewithPOOL),this.valuewithPOOL+=isNaN(parseFloat(t.ValuewithPOOL))?0:parseFloat(t.ValuewithPOOL),this.recvAvail+=isNaN(parseFloat(t.RecvAvail))?0:parseFloat(t.RecvAvail),this.recvBlock+=isNaN(parseFloat(t.RecvBlock))?0:parseFloat(t.RecvBlock),this.recvFree+=isNaN(parseFloat(t.RecvFree))?0:parseFloat(t.RecvFree),this.recvValue+=isNaN(parseFloat(t.RecvValue))?0:parseFloat(t.RecvValue),this.todayAvail+=isNaN(parseFloat(t.TodayAvail))?0:parseFloat(t.TodayAvail),this.todayBlock+=isNaN(parseFloat(t.TodayBlock))?0:parseFloat(t.TodayBlock),this.todayFree+=isNaN(parseFloat(t.TodayFree))?0:parseFloat(t.TodayFree),this.todayValue+=isNaN(parseFloat(t.TodayValue))?0:parseFloat(t.TodayValue),this.totalAvail+=isNaN(parseFloat(t.TotalA))?0:parseFloat(t.TotalA),this.totalBlock+=isNaN(parseFloat(t.TotalB))?0:parseFloat(t.TotalB),this.totalFree+=isNaN(parseFloat(t.TotalF))?0:parseFloat(t.TotalF),this.dpCollateralQty+=isNaN(parseFloat(t.DPColQty))?0:parseFloat(t.DPColQty),this.dpSecurityCollateral+=isNaN(parseFloat(t.DPSecCol))?0:parseFloat(t.DPSecCol),this.poolCollateralQty+=isNaN(parseFloat(t.POOLColQty))?0:parseFloat(t.POOLColQty),this.poolSecurityCollateral+=isNaN(parseFloat(t.POOLSecCol))?0:parseFloat(t.POOLSecCol),this.sarCollateralQty+=isNaN(parseFloat(t.SARColQty))?0:parseFloat(t.SARColQty),this.sarSecurityCollateral+=isNaN(parseFloat(t.SARSecCol))?0:parseFloat(t.SARSecCol),this.totalSecurityCollateral+=isNaN(parseFloat(t.TotalSecCol))?0:parseFloat(t.TotalSecCol),this.CFSHaircut+=isNaN(parseFloat(t.CFSHaircut))?0:parseFloat(t.CFSHaircut),this.CreditForSale+=isNaN(parseFloat(t.CreditForSale))?0:parseFloat(t.CreditForSale),this.ShortSellQty+=isNaN(parseFloat(t.ShortSellQty))?0:parseFloat(t.ShortSellQty),this.TotalCollateralQty+=isNaN(parseFloat(t.TotalColQty))?0:parseFloat(t.TotalColQty),this.PoolsarHolding+=isNaN(parseFloat(t.PoolSARHold))?0:parseFloat(t.PoolSARHold),this.BuyAvgPrice+=isNaN(parseFloat(t.BuyAvgP))?0:parseFloat(t.BuyAvgP),this.MarketValue+=isNaN(parseFloat(t.MarketValue))?0:parseFloat(t.MarketValue),this.GainLoss+=isNaN(parseFloat(t.GainLoss))?0:parseFloat(t.GainLoss),this.DPPledgedQty+=isNaN(parseFloat(t.DPPQty))?0:parseFloat(t.DPPQty),this.DPPledgedCollateral+=isNaN(parseFloat(t.DPPCol))?0:parseFloat(t.DPPCol),this.POOLPledgedQty+=isNaN(parseFloat(t.POOLPQty))?0:parseFloat(t.POOLPQty),this.POOLPledgedCollateral+=isNaN(parseFloat(t.POOLPCol))?0:parseFloat(t.POOLPCol);else{var s=new he.A;
1s.MktSegId="NSE"==t.Combined?1:"BSE"==t.Combined?3:-1,s.Token=t.Token,this.scripList.push(s)}}openColumnView(){this.dialogService.openComponent("Edit Columns",u.V,{menuId:n.gT.C_S_MENU_TRADING_STOCKVIEW,reptId:n.gT.C_V_COLUMNTEMPLATE_STOCKVIEW}).afterClosed().subscribe(r=>{this.onColumnViewClose(r)})}onColumnViewClose(t){1==t&&(this.isFirstReq=!0,this.GetStockView())}PopulateOEFromSV(t,r){try{this.tradingSharedService.getScripDetails(t.marketsegmentId,t.Token,!1,"","").subscribe(s=>{var d=s;if(null!=d&&null!=d)if("SIP"==r){var I=new Tt.u(d);I.OrderSide=n.gT.C_S_ORDER_SIP_TEXT,this.menuManager.invokeMenu(n.gT.C_S_MENU_EQSIP_OE,{sourceId:n.gT.C_S_MENU_TRADING_MKTWATCH,data:I})}else{var M=new is.N;M.ScripDetail=d;var U=new h.Q;U.Exchange=t.Combined.trim(),U.OrderSide=r.trim(),U.Instrument="EQUITIES",U.Symbol=t.Symbol.trim(),U.Series=t.Series.trim(),U.MarketLot="1",U.PriceTick="5",U.DecimalLocator="100",!(0,fe.isNullOrUndefined)(M.ScripDetail.MarketLot)&&""!=M.ScripDetail.MarketLot&&(U.MarketLot=M.ScripDetail.MarketLot),!(0,fe.isNullOrUndefined)(M.ScripDetail.PriceTick)&&""!=M.ScripDetail.MarketLot&&(U.PriceTick=M.ScripDetail.PriceTick),!(0,fe.isNullOrUndefined)(M.ScripDetail.DecimalLocator)&&""!=M.ScripDetail.MarketLot&&(U.DecimalLocator=M.ScripDetail.DecimalLocator),U.TokenNo=t.Token.trim(),U.Qty=r==n.gT.C_S_ORDER_SELL_TEXT?t.isCombRecord?parseInt(t.combTotalFree.trim()):Math.max(parseInt(t.nSellOfPOOL.trim()),parseInt(t.nSellOfDemat.trim())):"1",U.Exchange==n.gT.C_S_NSE_EXCHANGE_TEXT?U.MarketSegID=n.gT.C_V_NSE_CASH:U.Exchange==n.gT.C_S_BSE_EXCHANGE_TEXT?U.MarketSegID=n.gT.C_V_BSE_CASH:U.Exchange==n.gT.C_S_MSX_EXCHANGE_TEXT&&(U.MarketSegID=n.gT.C_V_MSX_CASH),null!=U.Qty&&""!=U.Qty&&0!=U.Qty&&U.Qty>0?(U.PageSource=n.gT.C_V_STOCKVIEW_PAGENO.toString(),this.menuManager.invokeMenu(n.gT.C_S_MENU_OE_SPOT,{sourceId:n.gT.C_S_MENU_TRADING_STOCKVIEW,data:U})):this.dialogService.alert("There is no Sell of Stock available")}})}catch(s){this.logService.WriteLog("Exception: "+s.message,"PopulateOE()","stockview.component.ts","")}}handleMultiTouchResp(t,r){try{var I=0,M=0,U=0;let xt=0;var q=null,He=null,it=null,ce=null,Je=null,lt=null,mt=null,Ne=null,gt=null,ft=null,Pt=null,Et=null,yt=null,Dt=null,At=null,Zt=null;if(null!=r&&void 0!==this.rows)for(var Ge=0;Ge<this.rows.length;Ge++)if((-1==this.rows[Ge].marketsegmentId||this.rows[Ge].marketsegmentId==r.Scrip.MktSegId.toString())&&this.rows[Ge].Token==r.Scrip.Token){He=parseFloat(r.LTP),He=isNaN(He)?0:He,this.rows[Ge].LTP=He,-1==this.rows[Ge].DP_Free.indexOf("NA")&&(gt=parseFloat(this.rows[Ge].DP_Value),ce=this.rows[Ge].DP_Value=(parseFloat(this.rows[Ge].DP_Free)*He).toFixed(2)),-1==this.rows[Ge].Recv_Free.indexOf("NA")&&(ft=parseFloat(this.rows[Ge].Recv_Value),Je=this.rows[Ge].Recv_Value=(parseFloat(this.rows[Ge].Recv_Free)*He).toFixed(2)),-1==this.rows[Ge].Total_Free.indexOf("NA")&&(Pt=parseFloat(this.rows[Ge].Total_Value),lt=this.rows[Ge].Total_Value=(parseFloat(this.rows[Ge].Total_Free)*He).toFixed(2)),-1==this.rows[Ge].Free_with_POOL.indexOf("NA")&&""!=this.rows[Ge].Free_with_POOL&&(Et=parseFloat(this.rows[Ge].Value_with_POOL),mt=this.rows[Ge].Value_with_POOL=(parseFloat(this.rows[Ge].Free_with_POOL)*He).toFixed(2)),-1==this.rows[Ge].Today_Free.indexOf("NA")&&(yt=parseFloat(this.rows[Ge].Today_Value),Ne=this.rows[Ge].Today_Value=(parseFloat(this.rows[Ge].Today_Free)*He).toFixed(2)),I=-1==this.rows[Ge].DP_Avail.indexOf("NA")?parseInt(this.rows[Ge].DP_Avail):0,M=-1==this.rows[Ge].AvailablewithPOOL.indexOf("NA")?parseInt(this.rows[Ge].AvailablewithPOOL):0,U=-1==this.rows[Ge].Recv_Avail.indexOf("NA")?parseInt(this.rows[Ge].Recv_Avail):0,q=-1==this.rows[Ge].Buy_Avg_Price.indexOf("NA")?parseFloat(this.rows[Ge].Buy_Avg_Price):0,xt=-1==this.rows[Ge].Today_Avail.indexOf("NA")?parseFloat(this.rows[Ge].Today_Avail):0,it=He*(I+M+U+xt),Dt=(He-q)*(I+M+U+xt),At=parseFloat(this.rows[Ge].GainLoss),Zt=parseFloat(this.rows[Ge].MarketValue),this.rows[Ge].GainLoss=parseFloat(Dt).toFixed(2),this.rows[Ge].MarketValue=parseFloat(it).toFixed(2);var Vt=this.calculateOldNewValueDiff(gt,ce);isNaN(Vt)||(this.dpValue=parseFloat(this.dpValue),this.dpValue+=Vt,this.footerData.DP_Value.value1=parseFloat(this.dpValue).toFixed(2));var ri=this.calculateOldNewValueDiff(ft,Je);isNaN(ri)||(this.recvValue=parseFloat(this.recvValue),this.recvValue+=ri,this.footerData.Recv_Value.value1=parseFloat(this.recvValue).toFixed(2));var $t=this.calculateOldNewValueDiff(Pt,lt);isNaN($t)||(this.totalval=parseFloat(this.totalval),this.totalval+=$t,this.footerData.Total_Value.value1=parseFloat(this.totalval).toFixed(2));var jt=this.calculateOldNewValueDiff(Et,mt);isNaN(jt)||(this.valuewithPOOL=parseFloat(this.valuewithPOOL),this.valuewithPOOL+=jt,this.footerData.Value_with_POOL.value1=parseFloat(this.valuewithPOOL).toFixed(2));var ei=this.calculateOldNewValueDiff(yt,Ne);isNaN(ei)||(this.todayValue=parseFloat(this.todayValue),this.todayValue+=ei,this.footerData.Today_Value.value1=parseFloat(this.todayValue).toFixed(2));var ti=this.calculateOldNewValueDiff(At,Dt);isNaN(ti)||(this.GainLoss=parseFloat(this.GainLoss),this.GainLoss+=ti,this.footerData.GainLoss.value1=parseFloat(this.GainLoss).toFixed(2));var ii=this.calculateOldNewValueDiff(Zt,it);isNaN(ii)||(this.MarketValue=parseFloat(this.MarketValue),this.MarketValue+=ii,this.footerData.MarketValue.value1=parseFloat(this.MarketValue).toFixed(2)),!this.rows[Ge].isFirstBcastRsp&&null!=this.reportGrid&&(this.rows[Ge].isFirstBcastRsp=!0,this.reportGrid.reApplyFH()),this.reportGrid.detectChange()}}catch(xt){this.logService.WriteLog("Exception: "+xt.message,"HandleMultiTouchResp","netposition.component.ts","")}}ngOnDestroy(){try{for(var t=0;t<this.ArrSubTokens.length;t++)this.pubsubService.unsubscribe(this.ArrSubTokens[t]);setTimeout(()=>
1{this.tradingSharedService.sendTouchLineRequest(this.scripList,2)},1e3),this.ArrSubTokens=[]}catch(r){this.logService.WriteLog("Exception: "+r.message,"ngOnDestroy()","stockview.component.ts","")}}calculateOldNewValueDiff(t,r){try{var s=0;return null==t||isNaN(t)?s=parseFloat(r):r!=t?(s=r-t,s=Number(parseFloat(s.toFixed(2)))):s=0,s}catch(d){this.logService.WriteLog("Exception: "+d.message,"calculateOldNewValueDiff()","stockview.component.ts","")}}DPAutoHold(){try{this.dialogService.confirm("Do you want to send Hold Request?","Confirm").subscribe(r=>{if(r){this.DPAutoHoldBtnEnable=!1;var s={UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:"",TraceId:n.vV.generateTraceNo(),Source:n.gT.C_S_DP_AUTO_HOLD_SOURCE_STOCK_VIEW};this.httpService.postData(n.xB.PGDPAPIUrl,"DPAutoHold",s).subscribe(d=>{null!=d?1==d.ResponseStatus?(this.dialogService.alert(n.xB.dMsgMaster.PG53),this.DPAutoHoldBtnEnable=!0):(this.dialogService.alert(d.ErrorMessages&&d.ErrorMessages.length>0?d.ErrorMessages[0]:"Failed"),this.DPAutoHoldBtnEnable=!0):this.DPAutoHoldBtnEnable=!0})}})}catch(r){this.logService.WriteLog("Exception: "+r.message,"DPAutoHold()","stockview.component.ts","")}}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(i._),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(P.F),e.\u0275\u0275directiveInject(e.ChangeDetectorRef))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["stock-view"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(rs,5),e.\u0275\u0275viewQuery(ns,7),e.\u0275\u0275viewQuery(as,7),e.\u0275\u0275viewQuery(ss,7),e.\u0275\u0275viewQuery(ls,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmpCurrentValue=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplLTP=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplExpand=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplSelloff=s.first)}},decls:21,vars:6,consts:[[1,"StockView_Parent"],[1,"container-fluid"],[4,"ngIf"],[1,"row","reportHrd"],[1,"Stockview_Row1"],[1,"Stockview_Filtericons","stock-holds"],[1,"btn-ref","Global_Filter",3,"matTooltip","click"],[1,"ColumnsViewicon","Global_Filter",3,"matTooltip","click"],["class","btn-export Global_Filter",3,"matTooltip","click",4,"ngIf"],[3,"hidden",4,"ngIf"],["cellTmplExpand",""],["cellTmplSelloff",""],["cellTmpCurrentValue",""],[3,"type"],[1,"hold-btn"],["mat-raised-button","",3,"disabled","click"],[1,"btn-export","Global_Filter",3,"matTooltip","click"],[3,"hidden"],[3,"fixedHdrConfig","showPaging","pageSize","fhTopHeight","extendedPageSize","reportName","noDataFoundMsg","columns","rows","showFooter","footerData"],["reportGrid",""],[3,"className","click",4,"ngIf"],[3,"className","click"],["class","Market_up_Collapse_Menu btn btn-primary","value","BUY",3,"click",4,"ngIf"],["class","Market_down_Collapse_Menu btn btn-primary","value","SELL",3,"click",4,"ngIf"],["class","sip_btn btn btn-primary","value","SIP",3,"click",4,"ngIf"],["value","BUY",1,"Market_up_Collapse_Menu","btn","btn-primary",3,"click"],["value","SELL",1,"Market_down_Collapse_Menu","btn","btn-primary",3,"click"],["value","SIP",1,"sip_btn","btn","btn-primary",3,"click"],[3,"innerHTML"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275template(2,os,2,1,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275elementStart(4,"div",4),e.\u0275\u0275elementStart(5,"div",5),e.\u0275\u0275elementStart(6,"ul"),e.\u0275\u0275template(7,cs,4,1,"li",2),e.\u0275\u0275elementStart(8,"li"),e.\u0275\u0275elementStart(9,"button",6),e.\u0275\u0275listener("click",function(){return r.refresh()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"li"),e.\u0275\u0275elementStart(11,"button",7),e.\u0275\u0275listener("click",function(){return r.openColumnView()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"li"),e.\u0275\u0275template(13,ds,1,1,"button",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(14,hs,3,12,"div",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(15,ms,1,1,"ng-template",null,10,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(17,gs,3,3,"ng-template",null,11,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(19,Ts,1,1,"ng-template",null,12,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.showProgressBar),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",r.DPAutoHoldOnLogin),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Edit Columns"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isRowsAvailable),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.rows))},directives:[W.O5,ue.gM,V.R,Q.lW,Me.i],encapsulation:2,changeDetection:0}),S})();var li=x(478),fs=x(2552),Zr=x(7689),Cs=x(3094);const vs=["reportGrid"],Ps=["reportGridCompleted"],Es=["cellAlertModes"],ys=["cellTmplAltModify"],Is=["tabgroup"];function Ms(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",28),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportCSVPendingAlerts()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function xs(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",29),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().removeAlerts()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Remove")}function Os(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",30),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onFilterPA()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Filter")}function Ds(S,O){1&S&&e.\u0275\u0275element(0,"span",36)}function As(S,O){1&S&&e.\u0275\u0275element(0,"span",37)}function Ls(S,O){1&S&&e.\u0275\u0275element(0,"span",38)}function bs(S,O){1&S&&e.\u0275\u0275element(0,"span",39)}function Fs(S,O){1&S&&e.\u0275\u0275element(0,"span",40)}function ks(S,O){if(1&S&&(e.\u0275\u0275template(0,Ds,1,0,"span",31),e.\u0275\u0275template(1,As,1,0,"span",32),e.\u0275\u0275template(2,Ls,1,0,"span",33),e.\u0275\u0275template(3,bs,1,0,"span",34),e.\u0275\u0275template(4,Fs,1,0,"span",35)),2&S){const t=O.row;e.\u0275\u0275property("ngIf",t.IsMsgBox),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.IsMsgBar),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.IsSMS),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.IsEmail),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.IsBalloon)}}function Vs(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",41),e.\u0275\u0275listener("click",function(){const d=e.\u0275\u0275restoreView(t).row;return e.\u0275\u0275nextContext().updateAlert(d)}),e.\u0275\u0275elementEnd()}}function Rs(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",28),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportCSVCompletedAlerts()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Export")}function Ns(S,O){if(1&S){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",42),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onFilterCA()}),e.\u0275\u0275elementEnd()}2&S&&e.\u0275\u0275property("matTooltip","Filter")}function ws(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"div",43),e.\u0275\u0275element(1,"reportgrid",44,45),e.\u0275\u0275elementEnd()),2&S){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("showFilter",t.showFilter1)("showSort",!0)("showPaging",!0)("pageSize",10)("fhTopHeight","38px")("fixedHdrConfig",t.fixedHdrConfig)("columns",t.columns)("rows",t.rows)("isFixedHeader",!1)}}let Bs=(()=>{class S{constructor(t,r,s,d,I,M,U,q,j){this.global=t,this.zone=r,this.httpService=s,this.logService=d,this.menuManager=I,this.dialogService=M,this.Alerts=U,this.pubsubService=q,this.route=j,this.isRowsAvailable=!1,this.isRowsForPendingAlerts=!1,this.isRowsForCompletedAlerts=!1,this.show
1Filter=!1,this.showFilter1=!1,this.isFirstReq=!0,this.onToggle=!0,this.tabs=[],this.activeTabIndex=0,this.fixedHdrConfig={minCellWidth:75,columnAlign:"left"}}ngOnInit(){try{this.sub=this.route.params.subscribe(t=>{this.subScribeMessages(),this.load(),"sa"==t.type?(this.dialogService.openComponent("Alert",li.z,t).afterClosed().subscribe(s=>{this.onAlertUIClose(s)}),t=null,this.activeTabIndex=0,this.tabgroup.selectedIndex=0):"AL"==t.type&&(this.getAlertsLogData(),this.activeTabIndex=1,this.tabgroup.selectedIndex=1)})}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit","setalerts.component.ts","")}}subScribeMessages(){var r=this.pubsubService.subscribe("ALERTRES",s=>{this.zone.run(()=>{this.handleAlertRespForReport(s)})});[].push(r)}handleAlertRespForReport(t){this.getAlertData("")}load(){this.getAlertData("")}getAlertData(t){try{this.httpService.postData(n.xB.tradingAPIUrl,"GetAlertData",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(s=>{this.getAlertDataCompleted(s)})}catch(s){this.logService.WriteLog("Exception: "+s.message,"getAlertData","setalerts.component.ts","")}}onFilterCA(){this.showFilter1=!this.showFilter1}onFilterPA(){this.showFilter=!this.showFilter}exportCSVCompletedAlerts(){this.reportGridCompleted.exportCSV("AlertsLog")}exportCSVPendingAlerts(){this.reportGrid.exportCSV("AlertsView")}getAlertDataCompleted(t){try{this.rows1=[],this.isRowsForPendingAlerts=!1,this.IsMsgBox=!1,this.IsMsgBar=!1,this.IsSMS=!1,this.IsEmail=!1;var s=t.ResponseObject;if(this.initHeaders1("",""),!0===t.ResponseStatus){for(var d=0;d<s.objJSONRows.length;d++)this.rows1.push({ScripDescription:s.objJSONRows[d].ScripDesc,AlertCondition:s.objJSONRows[d].AlertCondition,fDecimals:s.objJSONRows[d].Decimals,nMarketSegmentId:s.objJSONRows[d].MarketSegmentId,nToken:s.objJSONRows[d].Token,bParam1:s.objJSONRows[d].Param1,bParam2:s.objJSONRows[d].Param2,bOperator:s.objJSONRows[d].Operator,fVal1:s.objJSONRows[d].Val1,nTriggered:s.objJSONRows[d].Triggered,SetTime:s.objJSONRows[d].SetTime,pRemarks:s.objJSONRows[d].Remarks,nMessageBox:s.objJSONRows[d].MessageBox,GTC:s.objJSONRows[d].GTC,pInstrumentName:s.objJSONRows[d].InstNm,pSymbol:s.objJSONRows[d].Symbol,QueryStampId:s.objJSONRows[d].QueryStampId,PredefinedId:s.objJSONRows[d].PredefinedId,_MsgModeCell:s.objJSONRows[d].MessageBox,AlertsMode:"",isCheckSelected:!1,pSeries:s.objJSONRows[d].Series,IsMsgBox:(s.objJSONRows[d].MessageBox&n.gT.C_V_TAG_SCA_MSGBOX)==n.gT.C_V_TAG_SCA_MSGBOX,IsMsgBar:(s.objJSONRows[d].MessageBox&n.gT.C_V_TAG_SCA_MSGBAR)==n.gT.C_V_TAG_SCA_MSGBAR,IsSMS:(s.objJSONRows[d].MessageBox&n.gT.C_V_TAG_SCA_SMS)==n.gT.C_V_TAG_SCA_SMS,IsEmail:(s.objJSONRows[d].MessageBox&n.gT.C_V_TAG_SCA_EMAIL)==n.gT.C_V_TAG_SCA_EMAIL,IsBalloon:(s.objJSONRows[d].MessageBox&n.gT.C_V_TAG_SCA_BALLOON)==n.gT.C_V_TAG_SCA_BALLOON});this.isRowsForPendingAlerts=!0}}catch(I){this.logService.WriteLog("Exception: "+I.message,"getAlertDataCompleted","setalerts.component.ts","")}}initHeaders1(t,r){this.columns1=[],this.columns1.push({value:"Cancel",name:"Cancel",sort:!1,filter:!1,cType:"S",export:!1,isCheckboxable:!0}),this.columns1.push({value:"Modify",name:"Modify",cType:"S",export:!1,cellTemplate:this.cellTmplAltModify,filter:!1}),this.columns1.push({value:"ScripDescription",name:"Scrip Description",cType:"S"}),this.columns1.push({value:"AlertCondition",name:"Alert Condition",cType:"S"}),this.columns1.push({value:"SetTime",name:"SetTime",cType:"N"}),this.columns1.push({value:"pRemarks",name:"Remarks",cType:"S"}),this.columns1.push({value:"AlertsMode",name:"Alert Modes",cType:"N",cellTemplate:this.cellAlertModes,export:!1,filter:!1}),this.columns1.push({value:"GTC",name:"GTC",cType:"S"})}updateAlert(t){var d,s=t,I={},M=new m.u;M.ScripDet.Token=s.nToken,M.ScripDet.MktSegId=o.X.GetMarketSegmentID(parseInt(s.nMarketSegmentId)),M.ExchangeName=o.X.GetExchangeName(parseInt(s.nMarketSegmentId)),M.InstrumentName=s.pInstrumentName,M.Symbol=s.pSymbol,M.Series=s.pSeries,M.MWSecurityDesc=t.ScripDescription;try{var U=parseInt(s.nMessageBox);if(I.SelParam1=o.X.GetAlertParamString(parseInt(s.bParam1)),I.SelSign=o.X.GetOperatorString(parseInt(s.bOperator)),I.SelParam2=o.X.GetAlertParamString(parseInt(s.bParam2)),I.GTC="GTC"==s.GTC,d=parseFloat(s.fVal1),I.Remark=s.pRemarks,I.MsgMode=U,I.SetSelectedMsgMode=U,I.scpKey={MktSegId:o.X.GetMarketSegmentID(parseInt(s.nMarketSegmentId)).toString(),Token:s.nToken},I.InstName=s.pInstrumentName,I.Decimals=s.fDecimals,I.QueryStampId=parseInt(s.QueryStampId),I.Symbol=s.pSymbol,I.PredefinedId=p
1arseInt(s.PredefinedId),I.ScripData={MktSegId:I.scpKey.MktSegId,Token:I.scpKey.Token},I.ScripDetail={MWSecurityDesc:M.MWSecurityDesc},I.UseValue=o.X.ReturnFromattedUseValue(parseInt(s.bParam1),I.scpKey.MktSegId,d,s.fDecimals),!(this.Alerts.ScripAlertList.Count()>0))return void this.dialogService.alert("Currently option not available");for(var q=null,j=0;j<this.Alerts.ScripAlertList.length;j++)if(this.Alerts.ScripAlertList[j].ScripData.MktSegId.toString()===I.scpKey.MktSegId&&this.Alerts.ScripAlertList[j].ScripData.Token.toString()===I.scpKey.Token){q=this.Alerts.ScripAlertList[j];break}if(null==q)return void this.dialogService.alert("Currently option not available");var Ie=[];Ie.push(!0),Ie.push(I),this.dialogService.openComponent("Alert",li.z,Ie).afterClosed().subscribe(Ve=>{this.onAlertUIClose(Ve)}),Ie=null}catch(pe){this.logService.WriteLog("Exception: "+pe.message,"updateAlert","setalerts.component.ts","")}}refreshPending(){this.rows1=[],this.load()}refreshCompleted(){this.rows=[],this.getAlertsLogData()}setAlert(){var t=[];t.push(!1),t.push(null),this.dialogService.openComponent("Alert",li.z,t).afterClosed().subscribe(s=>{this.onAlertUIClose(s)}),t=null}onAlertUIClose(t){}getAlertsLogData(){try{this.httpService.postData(n.xB.tradingAPIUrl,"GetAlertsLog",{UserID:n.xB.User.UserId,GroupID:n.xB.User.GroupId,UCCClientID:"",UCCGroupID:""}).subscribe(r=>{this.getAlertsLogCompleted(r)})}catch(r){this.logService.WriteLog("Exception: "+r.message,"getAlertsLogData","setalerts.component.ts","")}}getAlertsLogCompleted(t){try{this.rows=[],this.isRowsForCompletedAlerts=!1;var r=t.ResponseObject;if(this.isFirstReq&&(this.initHeaders(""),this.isFirstReq=!1),r.objJSONRows.length>0){for(var s=0;s<r.objJSONRows.length;s++)this.rows.push({ScripDescription:r.objJSONRows[s].ScripDesc,AlertCondition:r.objJSONRows[s].AlertCondition,TriggeredTime:r.objJSONRows[s].TriggeredTime,SetTime:r.objJSONRows[s].SetTime,Remarks:r.objJSONRows[s].Remarks});this.isRowsForCompletedAlerts=!0}}catch(d){this.logService.WriteLog("Exception: "+d.message,"getAlertsLogCompleted","alertslog.component.ts","")}}initHeaders(t){this.columns=[],this.columns.push({value:"ScripDescription",name:"Scrip Description",cType:"S"}),this.columns.push({value:"AlertCondition",name:"Alert Condition",cType:"S"}),this.columns.push({value:"TriggeredTime",name:"Triggered Time",cType:"S"}),this.columns.push({value:"SetTime",name:"Set Time",cType:"S"}),this.columns.push({value:"Remarks",name:"Remarks",cType:"S"})}removeAlerts(){for(var t=!1,r=0;r<this.rows1.length;r++)if(1==this.rows1[r].isCheckSelected){t=!0;break}t?this.dialogService.confirm("Are you sure?","Yes","No").subscribe(d=>{d?this.AlertDeletion():this.CancelAlertDeeletion()}):this.dialogService.alert("Kindly select atleast one alert to cancel")}AlertDeletion(){try{for(var t=new n.HT,s=(new li.z(this.global,this.zone,this.httpService,this.logService,this.pubsubService,this.Alerts),0);s<this.rows1.length;s++){if(1==this.rows1[s].isCheckSelected){var d=this.rows1[s];t.Append(n.gT.C_V_TAG_MKTSEGID+n.gT.C_S_NAMEVALUE_DELIMITER+d.nMarketSegmentId+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_V_TAG_SCRIPTOKEN+n.gT.C_S_NAMEVALUE_DELIMITER+d.nToken+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_S_SETALERTS_QUERYSTAMPID+n.gT.C_S_NAMEVALUE_DELIMITER+d.QueryStampId+n.gT.C_S_FIELD_DELIMITER),t.Append(n.gT.C_S_SETALERTS_PREDEFINEDID+n.gT.C_S_NAMEVALUE_DELIMITER+d.PredefinedId+n.gT.C_S_FIELD_DELIMITER)}t.Append(n.gT.C_S_RECORD_DELIMITER)}this.Alerts.RemoveAlerts(t.toString())}catch(I){this.logService.WriteLog("Exception: "+I.message,"AlertDeletion","setalerts.component.ts","")}}CancelAlertDeeletion(){}onSelectChange(t){0==t.index?(this.load(),this.activeTabIndex=0):(this.getAlertsLogData(),this.activeTabIndex=1)}ngOnDestroy(){null!=this.sub&&this.sub.unsubscribe()}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.Uh),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(n.OE),e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n._V),e.\u0275\u0275directiveInject(f.Hr),e.\u0275\u0275directiveInject(Zr.m),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(p.gz))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["set-alerts"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(v
1s,7),e.\u0275\u0275viewQuery(Ps,5),e.\u0275\u0275viewQuery(Es,7),e.\u0275\u0275viewQuery(ys,7),e.\u0275\u0275viewQuery(Is,7)),2&t){let s;e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGrid=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.reportGridCompleted=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellAlertModes=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.cellTmplAltModify=s.first),e.\u0275\u0275queryRefresh(s=e.\u0275\u0275loadQuery())&&(r.tabgroup=s.first)}},decls:63,vars:19,consts:[[1,"container-fluid","set-alert"],[3,"selectedTabChange"],["tabgroup",""],["label","Pending"],["id","PendingAlerts"],[1,"filterPanel"],[1,"zone1"],[1,"userbox"],[1,"zone2"],[1,"databox"],[1,"pt5"],["mat-raised-button","",3,"click"],[1,"zone3"],[1,"iconbox"],["title","Refresh",1,"icon-bdr","Global_Filter","btn-ref",3,"matTooltip","click"],["class","icon-bdr Global_Filter btn-export","title","Export",3,"matTooltip","click",4,"ngIf"],["class","icon-bdr Global_Filter btn-cancel-ord","title","Remove",3,"matTooltip","click",4,"ngIf"],["class","icon-bdr Global_Filter filtericon martop-8","title","Filter",3,"matTooltip","click",4,"ngIf"],[1,"clear"],["nn-dynamic-height","",1,"alertlog"],[3,"fhTopHeight","showFilter","fixedHdrConfig","showSort","showPaging","pageSize","columns","rows","isFixedHeader"],["reportGrid",""],["cellAlertModes",""],["cellTmplAltModify",""],["label","Completed"],["id","CompletedAlerts"],["class","icon-bdr Global_Filter btn-filter","title","Filter",3,"matTooltip","click",4,"ngIf"],["nn-dynamic-height","",4,"ngIf"],["title","Export",1,"icon-bdr","Global_Filter","btn-export",3,"matTooltip","click"],["title","Remove",1,"icon-bdr","Global_Filter","btn-cancel-ord",3,"matTooltip","click"],["title","Filter",1,"icon-bdr","Global_Filter","filtericon","martop-8",3,"matTooltip","click"],["class","MsgBoxAlertMode","title","Message Box",4,"ngIf"],["class","MsgBarAlertMode","title","Message Bar",4,"ngIf"],["class","SMSAlertMode","title","SMS",4,"ngIf"],["class","EmailAlertMode","title","Email",4,"ngIf"],["class","BalloonAlertMode","title","Balloon",4,"ngIf"],["title","Message Box",1,"MsgBoxAlertMode"],["title","Message Bar",1,"MsgBarAlertMode"],["title","SMS",1,"SMSAlertMode"],["title","Email",1,"EmailAlertMode"],["title","Balloon",1,"BalloonAlertMode"],["type","button","title","Modify",1,"button","modify-btn",3,"click"],["title","Filter",1,"icon-bdr","Global_Filter","btn-filter",3,"matTooltip","click"],["nn-dynamic-height",""],[3,"showFilter","showSort","showPaging","pageSize","fhTopHeight","fixedHdrConfig","columns","rows","isFixedHeader"],["reportGridCompleted",""]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div"),e.\u0275\u0275elementStart(2,"mat-tab-group",1,2),e.\u0275\u0275listener("selectedTabChange",function(d){return r.onSelectChange(d)}),e.\u0275\u0275elementStart(4,"mat-tab",3),e.\u0275\u0275elementStart(5,"div"),e.\u0275\u0275elementStart(6,"div",4),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275elementStart(8,"div",6),e.\u0275\u0275elementStart(9,"div",7),e.\u0275\u0275elementStart(10,"ul"),e.\u0275\u0275elementStart(11,"li"),e.\u0275\u0275text(12,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",8),e.\u0275\u0275elementStart(14,"div",9),e.\u0275\u0275elementStart(15,"ul"),e.\u0275\u0275elementStart(16,"li",10),e.\u0275\u0275elementStart(17,"button",11),e.\u0275\u0275listener("click",function(){return r.setAlert()}),e.\u0275\u0275text(18,"Set Alert"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",12),e.\u0275\u0275elementStart(20,"div",13),e.\u0275\u0275elementStart(21,"ul"),e.\u0275\u0275elementStart(22,"li"),e.\u0275\u0275elementStart(23,"button",14),e.\u0275\u0275listener("click",function(){return r.refreshPending()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"li"),e.\u0275\u0275template(25,Ms,1,1,"button",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"li"),e.\u0275\u0275template(27,xs,1,1,"button",16),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"li"),e.\u0275\u0275template(29,Os,1,1,"button",17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(30,"div",18),e.\u0275\u0275elementStart(31,"div",19),e.\u0275\u0275element(32,"reportgrid",20,21),e.\u0275\u0275template(34,ks,5,5,"ng-template",null,22,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(36,Vs,1,0,"ng-template",null,23,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(38,"mat-tab",24),e.\u0275\u0275elementStart(39,"div",25),e.\u0275\u0275elementStart(40,"div",5),e.\u0275\u0275elementStart(41,"div",6),e.\u0275\u0275elementStart(42,"div",7),e.\u0275\u0275elementStart(43,"ul"),e.\u0275\u0275elementStart(44,"li"),e.\u0275\u0275text(45,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(46,"div",8),e.\u0275\u0275elementStart(47,"div",9),e.\u0275\u0275elementStart(48,"ul"),e.\u0275\u0275elementStart(49,"li",10),e.\u0275\u0275elementStart(50,"button",11),e.\u0275\u0275listener("click",function(){return r.setAlert()}),e.\u0275\u0275text(51,"Set Alert"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(52,"div",12),e.\u0275\u0275elementStart(53,"div",13),e.\u0275\u0275elementStart(54,"ul"),e.\u0275\u0275elementStart(55,"li"),e.\u0275\u0275elementStart(56,"button",14),e.\u0275\u0275listener("click",function(){return r.refreshCompleted()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(57,"li"),e.\u0275\u0275template(58,Rs,1,1,"button",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(59,"li"),e.\u0275\u0275template(60,Ns,1,1,"button",26),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(61,"div",18),e.\u0275\u0275template(62,ws,3,9,"div",27),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("@.disabled","true"),e.\u0275\u0275advance(22),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isRowsForPendingAlerts),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isRowsForPendingAlerts),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isRowsForPendingAlerts),e.\u0275\u0275advance(3),e.\u0275\u0275property("fhTopHeight","38px")("showFilter",r.showFilter)("fixedHdrConfig",r.fixedHdrConfig)("fhTopHeight","65px")("showSort",!0)("showPaging",!0)("pageSize",10)("columns",r.columns1)("rows",r.rows1)("isFixedHeader",!1),e.\u0275\u0275advance(24),e.\u0275\u0275property("matTooltip","Refresh"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isRowsForCompletedAlerts),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isRowsForCompletedAlerts),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",1==r.activeTabIndex))},directives:[zt.SP,zt.uX,Q.lW,ue.gM,W.O5,Cs.N,Me.i],encapsulation:2}),S})();var Gs=x(7885);function Us(S,O){if(1&S&&(e.\u0275\u0275elementStart(0,"tr"),e.\u0275\u0275elementStart(1,"td",10),e.\u0275\u0275elementStart(2,"span"),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"td"),e.\u0275\u0275elementStart(5,"span",11),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&S){const t=O.$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.Exchange),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.Status)}}let $r=(()=>{class S{constructor(t,r,s,d){this.logService=t,this.pubsubService=r,this.zone=s,this.tradingService=d,this.notifications=new Array,this.ArrMktStatusList=[],this.isAvailable=!1,this.MktStatusList="",this.MktStatusTitle="",this.count=1,this.MsgTitleCSS="",this.IsViewOpen=!1,this.CompareArray=[],this.ArrSubTokens=[],this.strMktStatusResponse=new Gs.a}
1ngOnInit(){try{this.notificationSub=this.tradingService.notifications$.subscribe(t=>{this.notifications.insert(0,t),this.ArrMktStatusList=n.xB.ExchManager.ArrMktStatus,this.updateBindedObj()}),this.ArrMktStatusList=n.xB.ExchManager.ArrMktStatus,(null!=typeof this.ArrMktStatusList||0!=this.ArrMktStatusList.length)&&(this.IsViewOpen=!0,this.updateBindedObj()),n.xB.applicationType==n.xB.MOBILE&&(this.IsViewOpen=!0),this.marketStatusReq()}catch(t){this.logService.WriteLog("Exception: "+t.message,"ngOnInit()","marketStatus.component.ts","")}}marketStatusReq(){n.xB.User.LoginMode==n.gT.C_S_REFRESH_MODE&&this.pubsubService.publish("MKTSTATUSREQ","")}onCount(){this.count>0?(this.MktStatusTitle=this.count,this.MsgTitleCSS="MessageTitle"):(this.MktStatusTitle="",this.MsgTitleCSS="")}updateBindedObj(){this.IsViewOpen&&(this.MktStatusList=this.ArrMktStatusList)}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275directiveInject(n.mQ),e.\u0275\u0275directiveInject(n.hC),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(ui.D))},S.\u0275cmp=e.\u0275\u0275defineComponent({type:S,selectors:[["market-status"]],decls:14,vars:1,consts:[[1,"filterPanel"],[1,"zone1"],[1,"zone2","text-center"],[1,"pagename"],[1,"zone3"],[1,"Mkt_Status"],[1,"Global_Bg","pad-10","mt40"],[1,"mwtable"],["border","0","cellspacing","0","cellpadding","2",1,"w50"],[4,"ngFor","ngForOf"],[1,"taL"],[1,"Mkt_val_size"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275text(2,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",2),e.\u0275\u0275elementStart(4,"span",3),e.\u0275\u0275text(5,"Market Status"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",4),e.\u0275\u0275text(7,"\xa0"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",5),e.\u0275\u0275elementStart(9,"div",6),e.\u0275\u0275elementStart(10,"div",7),e.\u0275\u0275elementStart(11,"table",8),e.\u0275\u0275elementStart(12,"tbody"),e.\u0275\u0275template(13,Us,7,2,"tr",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(13),e.\u0275\u0275property("ngForOf",r.ArrMktStatusList))},directives:[W.sg],encapsulation:2}),S})();var jr=x(6416),en=x(8327),Ws=x(6413),Hs=x(1186),tn=x(1282);let Qs=(()=>{class S{}return S.\u0275fac=function(t){return new(t||S)},S.\u0275mod=e.\u0275\u0275defineNgModule({type:S}),S.\u0275inj=e.\u0275\u0275defineInjector({imports:[[p.Bz.forChild([{path:"orderbook",component:di},{path:"eqsiporderbook",component:J},{path:"tradebook",component:Wr},{path:"gtdorderbook",component:ee},{path:"mlorderbook",component:we},{path:"marginRpt",component:kr},{path:"fundsReport",component:Hr},{path:"marketwatch/:type",component:Fn.Q,canDeactivate:[en.F]},{path:"orderentry",component:Ur},{path:"indexLookUp",component:kn.U},{path:"SecurityInfoComponent",component:Vn.t},{path:"netposition",component:Qr},{path:"fundssummary",component:ka.h},{path:"positionconversion",component:ne},{path:"ticker",component:Va.d},{path:"onlinemessage",component:jr.O},{path:"fundsallocationreport",component:Yr},{path:"creditforsalereport",component:Xr},{path:"collateralbenefitreport",component:Kr},{path:"fundview",component:zr},{path:"news",component:Jr.Q},{path:"stockview",component:qr},{path:"marketstatus",component:$r},{path:"alert",component:li.z},{path:"mwalertviewer",component:fs.Y},{path:"setalerts/:type",component:Bs},{path:"saveAsProfile",component:Ws.f},{path:"alertlog",component:Hs.R},{path:"edis",component:tn.s}])],p.Bz]}),S})();var Ys=x(1545),Xs=x(9877);let Ks=(()=>{class S{constructor(t){this.menuservice=t,this.routes=new Map,this.routes.set(n.gT.C_S_MENU_TRADING_ORDERBOOK,di),this.routes.set(n.gT.C_S_MENU_TRADING_TRADEBOOK,Wr),this.routes.set(n.gT.C_S_MENU_TRADING_STOCKVIEW,qr),this.routes.set(n.gT.C_S_MENU_MKTINQUIRY_ONLINEMSG,jr.O),this.routes.set(n.gT.C_S_MENU_TRADING_NETPOSITION,Qr),this.routes.set(n.gT.C_S_MENU_TRADING_FUNDSVIEW,zr),this.routes.set("marketstatus",$r),this.routes.set(n.gT.C_S_MENU_OE_SPOT,Ur),this.routes.set(n.gT.C_S_MENU_MARGINREPORT,kr),this.routes.set(n.gT.C_S_NEWSFEEDER_ID,Jr.Q),this.routes.set(n.gT.C_S_MENU_EDIS,tn.s),this.menuservice.addRoutes(this.routes)}static forRoot(){return{ngModule:S,providers:[Zr.m,ui.D]}}}return S.\u0275fac=function(t){return new(t||S)(e.\u0275\u0275inject(n._V))},S.\u0275mod=e.\u0275\u0275defineNgModule({type:S}),S.\u0275inj=e.\u0275\u0275defineInjector({providers:[Xs.D,n.RJ,en.F],imports:[[Qs,b.m,a.u5,a.UX,Ys.l.forRoot(),l.ChartModule,g.S,T.PW,G.XE]]}),S})()},4549:(je,ke,x)=>{x.d(ke,{X:()=>l});var a=x(8022),T=x(6371),G=x(1705),n=x(2741);let l=(()=>{class g{constructor(p,h,o){this.httpService=p,this.logService=h,this.pubsubService=o,this.objEQSIPConfiguration={status:!1,arrEQSIPConfig:[]}}getEQSIPConfiguration(){try{return 0==this.objEQSIPConfiguration.arrEQSIPConfig.length?a.y.create(p=>{this.httpService.postData(G.xB.eqsipAPIUrl,"EQSIPConfiguration").subscribe(h=>{this.objEQSIPConfiguration.status=h.ResponseStatus,h.ResponseStatus&&(this.objEQSIPConfiguration.arrEQSIPConfig=h.ResponseObject),p.next(this.objEQSIPConfiguration),p.complete()},h=>{p.next(!1),p.complete()})}):(0,T.of)(this.objEQSIPConfiguration)}catch(p){this.logService.WriteLog("Exception: "+p.message,"getInteropConfiguration()","eqsip.service.ts","")}}placeSIPOrder(p){try{return a.y.create(h=>{this.httpService.postData(G.xB.eqsipAPIUrl,"PlaceEQSIPOrder",p).subscribe(o=>{h.next(o),h.complete()},o=>{h.next(!1),h.complete()})})}catch(h){this.logService.WriteLog("Exception: "+h.message,"placeSIPOrder()","eqsip.service.ts","")}}getEqsipOrderBookDetail(p){try{return a.y.create(h=>{this.httpService.postData(G.xB.eqsipAPIUrl,"FetchSystematicOrderBookDetail",p).subscribe(o=>{this.orderBookDetailData=o.ResponseObject,h.next(this.orderBookDetailData),h.complete()},o=>{h.next(null),h.complete()})})}catch(h){this.logService.WriteLog("Exception: "+h.message,"getEqsipOrderBookDetail()","eqsip.service.ts","")}}}return g.\u0275fac=function(p){return new(p||g)(n.\u0275\u0275inject(G.OE),n.\u0275\u0275inject(G.mQ),n.\u0275\u0275inject(G.hC))},g.\u0275prov=n.\u0275\u0275defineInjectable({token:g,factory:g.\u0275fac,providedIn:"root"}),g})()},3493:(je,ke,x)=>{x.d(ke,{t:()=>V});var a=x(1705),T=x(8497),G=x(8407),n=x(5607),l=x(2282),g=x(2741),b=x(7789),p=x(6345),h=x(6274),o=x(7617),u=x(2150);function m(w,Z){if(1&w){const F=g.\u0275\u0275getCurrentView();g.\u0275\u0275elementStart(0,"div"),g.\u0275\u0275elementStart(1,"universalLookup",14),g.\u0275\u0275listener("addScripCallBack",function(X){return g.\u0275\u0275restoreView(F),g.\u0275\u0275nextContext(2).addScripCallBack(X)}),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()}}function e(w,Z){if(1&w){const F=g.\u0275\u0275getCurrentView();g.\u0275\u0275elementStart(0,"div"),g.\u0275\u0275elementStart(1,"button",13),g.\u0275\u0275listener("click",function(){g.\u0275\u0275restoreView(F);const X=g.\u0275\u0275nextContext();return X.open(X)}),g.\u0275\u0275text(2,"LookUp"),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(3,m,2,0,"div",0),g.\u0275\u0275elementEnd()}if(2&w){const F=g.\u0275\u0275nextContext();g.\u0275\u0275advance(3),g.\u0275\u0275property("ngIf",F.isAvailable)}}function f(w,Z){if(1&w&&(g.\u0275\u0275elementStart(0,"div"),g.\u0275\u0275elementStart(1,"div"),g.\u0275\u0275elementStart(2,"span"),g.\u0275\u0275elementStart(3,"h2",15),g.\u0275\u0275text(4),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(5,"h1",16),g.\u0275\u0275text(6),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(7,"span"),g.\u0275\u0275text(8),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(9,"span"),g.\u0275\u0275text(10),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()),2&w){const F=g.\u0275\u0275nextContext();g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate1(" ",F.Scripobject.DescPart1,""),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.Scripobject.DescPart2),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.ScripLTP),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.ScripPercChange)}}function i(w,Z){if(1&w&&(g.\u0275\u0275elementStart(0,"td"),g.\u0275\u0275elementStart(1,"span"),g.\u0275\u0275elementStart(2,"h2",15),g.\u0275\u0275text(3),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(4,"h1",16),g.\u0275\u0275text(5),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()),2&w){const F=g.\u0275\u0275nextContext(2);g.\u0275\u0275advance(3),g.\u0275\u0275textInterpolate(F.Scripobject.DescPart1),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.Scripobject.DescPart2)}}function P(w,Z){if(1&w){const F=g.\u0275\u0275getCurrentView();g.\u0275\u0275elementStart(0,"td"),g.\u0275\u0275elementStart(1,"button",18),g.\u0275\u0275listener("click",function(){return g.\u0275\u0275restoreView(F),g.\u0275\u0275nextContext(2).populateOEFromB5("BUY")}),g.\u0275\u0275text(2,"BUY"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(3,"button",19),g.\u0275\u0275listener("click",function(){return g.\u0275\u0275restoreView(F),g.\u0275\u0275nextContext(2).populateOEFromB5("SELL")}),g.\u0275\u0275text(4,"SELL"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()}}function _(w,Z){if(1&w&&(g.\u0275\u0275elementStart(0,"table",17),g.\u0275\u0275elementStart(1,"tr"),g.\u0275\u0275template(2,i,6,2,"td",0),g.\u0275\u0275template(3,P,5,0,"td",0),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()),2&w){const F=g.\u0275\u0275nextContext();g.\u0275\u0275advance(2),g.\u0275\u0275property("ngIf",F.isExchNameVisible),g.\u0275\u0275advance(1),g.\u0275\u0275property("ngIf",F.isBuySellLinkVisible)}}function k(w,Z){if(1&w){const F=g.\u0275\u0275getCurrentView();g.\u0275\u0275elementStart(0,"tbody"),g.\u0275\u0275elementStart(1,"tr",20),g.\u0275\u0275listener("click",function(X){const he=g.\u0275\u0275restoreView(F).$implicit;return g.\u0275\u0275nextContext().processOEfromB5(he,X,"Buy")}),g.\u0275\u0275elementStart(2,"td"),g.\u0275\u0275text(3),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(4,"td"),g.\u0275\u0275text(5),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(6,"td"),g.\u0275\u0275text(7),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()}if(2&w){const F=Z.$implicit;g.\u0275\u0275advance(3),g.\u0275\u0275textInterpolate(F.sBuyers),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.sBidQty),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.sBid)}}function W(w,Z){if(1&w){const F=g.\u0275\u0275getCurrentView();g.\u0275\u0275elementStart(0,"tbody"),g.\u0275\u0275elementStart(1,"tr",20),g.\u0275\u0275listener("click",function(X){const he=g.\u0275\u0275restoreView(F).$implicit;return g.\u0275\u0275nextContext().processOEfromB5(he,X,"Sell")}),g.\u0275\u0275elementStart(2,"td"),g.\u0275\u0275text(3),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(4,"td"),g.\u0275\u0275text(5),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(6,"td"),g.\u0275\u0275text(7),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()}if(2&w){const F=Z.$implicit;g.\u0275\u0275advance(3),g.\u0275\u0275textInterpolate(F.sAsk),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.sAskQty),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.sSellers)}}function N(w,Z){if(1&w&&(g.\u0275\u0275elementStart(0,"div",28),g.\u0275\u0275elementStart(1,"ul",25),g.\u0275\u0275elementStart(2,"li"),g.\u0275\u0275elementStart(3,"label"),g.\u0275\u0275text(4,"Open"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(5,"span"),g.\u0275\u0275text(6),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(7,"li"),g.\u0275\u0275elementStart(8,"label"),g.\u0275\u0275text(9,"Low"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(10,"span"),g.\u0275\u0275text(11),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(12,"li"),g.\u0275\u0275elementStart(13,"label"),g.\u0275\u0275text(14,"LTP"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(15,"span"),g.\u0275\u0275text(16),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(17,"li"),g.\u0275\u0275elementStart(18,"label"),g.\u0275\u0275text(19,"LTQ"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(20,"span"),g.\u0275\u0275text(2
11),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(22,"li"),g.\u0275\u0275elementStart(23,"label"),g.\u0275\u0275text(24),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(25,"span"),g.\u0275\u0275text(26),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(27,"li"),g.\u0275\u0275elementStart(28,"label"),g.\u0275\u0275text(29,"Volume"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(30,"span"),g.\u0275\u0275text(31),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(32,"li"),g.\u0275\u0275elementStart(33,"label"),g.\u0275\u0275text(34,"DPR"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(35,"span"),g.\u0275\u0275text(36),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()),2&w){const F=g.\u0275\u0275nextContext(3);g.\u0275\u0275advance(6),g.\u0275\u0275textInterpolate(F.OpenPrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.LowPrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.ScripLTP),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.LTQ),g.\u0275\u0275advance(3),g.\u0275\u0275textInterpolate(F.LifeTimeLowCaption),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.LifeTimeLowPrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.Volume),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.DPR)}}function Q(w,Z){if(1&w&&(g.\u0275\u0275elementStart(0,"div"),g.\u0275\u0275elementStart(1,"div",22),g.\u0275\u0275template(2,N,37,8,"div",23),g.\u0275\u0275elementStart(3,"div",24),g.\u0275\u0275elementStart(4,"ul",25),g.\u0275\u0275elementStart(5,"li"),g.\u0275\u0275elementStart(6,"label"),g.\u0275\u0275text(7,"Close"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(8,"span"),g.\u0275\u0275text(9),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(10,"li"),g.\u0275\u0275elementStart(11,"label"),g.\u0275\u0275text(12,"High"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(13,"span"),g.\u0275\u0275text(14),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(15,"li"),g.\u0275\u0275elementStart(16,"label"),g.\u0275\u0275text(17,"Spot"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(18,"span"),g.\u0275\u0275text(19),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(20,"li"),g.\u0275\u0275elementStart(21,"label"),g.\u0275\u0275text(22,"ATP"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(23,"span"),g.\u0275\u0275text(24),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(25,"li"),g.\u0275\u0275elementStart(26,"label"),g.\u0275\u0275text(27),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(28,"span"),g.\u0275\u0275text(29),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(30,"li"),g.\u0275\u0275elementStart(31,"label"),g.\u0275\u0275text(32,"Value"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(33,"span"),g.\u0275\u0275text(34),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(35,"li"),g.\u0275\u0275elementStart(36,"div",26),g.\u0275\u0275elementStart(37,"label"),g.\u0275\u0275text(38,"LPPR"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(39,"span"),g.\u0275\u0275text(40),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(41,"div",27),g.\u0275\u0275elementStart(42,"ul",25),g.\u0275\u0275elementStart(43,"li"),g.\u0275\u0275elementStart(44,"label"),g.\u0275\u0275text(45,"LUT"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(46,"span"),g.\u0275\u0275text(47),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(48,"li"),g.\u0275\u0275elementStart(49,"label"),g.\u0275\u0275text(50,"LTT"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(51,"span"),g.\u0275\u0275text(52),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()),2&w){const F=g.\u0275\u0275nextContext(2);g.\u0275\u0275advance(2),g.\u0275\u0275property("ngIf",F.isB5DataVisible),g.\u0275\u0275advance(7),g.\u0275\u0275textInterpolate(F.ClosePrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.HighPrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.UnderlyingPrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.ATP),g.\u0275\u0275advance(3),g.\u0275\u0275textInterpolate(F.LifeTimeHighCaption),g.\u0275\u0275advance(2),g.\u0275\u0275textInterpolate(F.LifeTimeHighPrice),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.Value),g.\u0275\u0275advance(2),g.\u0275\u0275property("ngClass",F.isLPPR?""
1:"visibilityHidden"),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(F.TER),g.\u0275\u0275advance(7),g.\u0275\u0275textInterpolate(F.LUT),g.\u0275\u0275advance(5),g.\u0275\u0275textInterpolate(F.LTT)}}function H(w,Z){if(1&w&&(g.\u0275\u0275elementStart(0,"div",21),g.\u0275\u0275template(1,Q,53,12,"div",0),g.\u0275\u0275elementEnd()),2&w){const F=g.\u0275\u0275nextContext();g.\u0275\u0275advance(1),g.\u0275\u0275property("ngIf",F.isB5Visible)}}let V=(()=>{class w{constructor(F,re,X,ne,he,fe){this.logService=F,this.dialogService=re,this.pubsubService=X,this.zone=ne,this.menuManager=he,this.tradingSharedService=fe,this.bOrigB5=!0,this.Scripobject=new n.u,this.ScripSymbol="",this.ExchaName="",this.ScripLTP="",this.ScripMktSegmentId="",this.ScripToken="",this.ScripPercChange="",this.B5Data=[],this.ReportName="",this._objMWDataArr=[],this.TotalBidQty="",this.TotalAskQty="",this.LUT="",this.LTT="",this.LTQ="",this.ATP="",this.OpenPrice="",this.HighPrice="",this.LowPrice="",this.ClosePrice="",this.DPR="",this.TER="",this.TERLabel="",this.Value="",this.LifeTimeHighCaption="52W H",this.LifeTimeLowCaption="52W L",this.LifeTimeHighPrice="",this.LifeTimeLowPrice="",this.Volume="",this.isBackVisible=!1,this.MarketSegmentId="",this.Token="",this.SelBidQty="",this.SelBidPrice="",this.SelAskQty="",this.SelAskPrice="",this.SelectedB5Data=null,this.ScripChangeCssClass="",this.oldMWRowSelectedClass=null,this.newMWRowSelectedClass=null,this.oldMWRowSelected=null,this.newMWRowSelected=null,this.oldCounterRowSelected=null,this.ContainerId="",this.context="",this.EmptyBestFiveData=null,this.IsLookUpScrip=!1,this.ArrSubTokens=[],this.isAvailable=!1,this.isLookUpVisible=!0,this.isLPPR=!1,this.underlyingObj=new l.A,this.UnderlyingPrice="-",this.isB5HdrVisible=!0,this.isLookUp=!0,this.isExchNameVisible=!0,this.isBuySellLinkVisible=!0,this.isB5DataVisible=!0,this.isB5Visible=!0}ngOnDestroy(){this.DestroyView()}addScripCallBack(F){this.populateScripDetails(F)}open(F){0==F.isAvailable?(F.isAvailable=!0,this.subScribeMessages()):F.isAvailable=!1}ngOnInit(){try{this.subScribeMessages(),void 0!==this.Scrip&&null!=this.Scrip&&this.populateScripDetails(this.Scrip)}catch(F){this.logService.WriteLog("Exception: "+F.message,"ngOnInit()","bestFive.component.ts","")}}DestroyView(){null!=this.Scripobject&&null!=this.Scripobject&&this.tradingSharedService.sendBest5Request(this.Scripobject,2),null!=this.underlyingObj&&null!=this.underlyingObj&&this.tradingSharedService.sendTouchLineRequest(this.underlyingObj,2);for(var F=0;F<this.ArrSubTokens.length;F++)this.pubsubService.unsubscribe(this.ArrSubTokens[F])}subScribeMessages(){this.ArrSubTokens=[];let F=this.pubsubService.subscribe("B5RES",(re,X)=>{this.zone.run(()=>{this.handleBestFiveResponse(X)})});this.ArrSubTokens.push(F),F=this.pubsubService.subscribe("TERRES",(re,X)=>{this.receiveTERResponse(X)}),this.ArrSubTokens.push(F)}receiveTouchlineResponse(F){try{F.Scrip.Token==this.underlyingObj.Token&&F.Scrip.MktSegId==this.underlyingObj.MktSegId&&(this.UnderlyingPrice=F.LTP)}catch(re){this.logService.WriteLog("Exception: "+re.message,"receiveTouchlineResponse()","bestFive.component.ts","")}}receiveTERResponse(F){try{null!=F.Scrip&&this.Scripobject.ScripDet.Token==F.Scrip.Token&&this.Scripobject.ScripDet.MktSegId==F.Scrip.MktSegId&&(this.TER=F.TER)}catch(re){this.logService.WriteLog("Exception: "+re.message,"receiveTERResponse()","bestFive.component.ts","")}}Initialize(F){try{var re="lookUpB5";a.xB.applicationType==a.xB.MOBILE&&(re="lookUpMobB5"),this.isLookUpVisible&&this.pubsubService.subscribe("ADDSCRIP_"+re+"_"+this.ContainerId,(X,ne)=>{this.populateScripDetails(ne)}),this.subScribeMessages(),null!=F&&""!=F&&this.populateScripDetails(F.ScripDetail)}catch(X){this.logService.WriteLog("Exception: "+X.message,"Intialize()","bestFive.component.ts","")}}handleBestFiveResponse(F){try{(null==this.Scripobject||null==this.Scripobject||null!=F.Scrip&&this.Scripobject.ScripDet.MktSegId==F.Scrip.ScripDet.MktSegId&&this.Scripobject.ScripDet.Token==F.Scrip.ScripDet.Token)&&this.nn_processBestFiveResponse(F)}catch(re){this.logService.WriteLog("Exception: "+re.message,"handleBestFiveResponse()","bestFive.component.ts","")}}handleMWSynchResponse(F){try{this.IsLookUpScrip=!1,this.IsMWScripInSync&&(this.clearFields(),null!=this.Scripobject&&null!=this.Scripobject&&this.tradingSharedService.sendBest5Request(this.Scripobject,2),this.Scripobject=F,this.tradingSharedService.sendBest5Request(this.Scripobject,1),this.ScripSymbol=null!=this.Scripobject?this.Scripobject.MWSecurityDesc:"",this.bOrigB5&&this.IsMWScripInSync&&this.changeBestFiveTitle())}catch(re){this.logService.WriteLog("Exception: "+re.message,"handleMWSynchResponse()","bestFive.component.ts","")}}populateScripDetails(F){try{if(this.IsLookUpScrip=!0,this.clearFields(),null!=this.Scripobject&&null!=this.Scripobject&&0!=this.Scripobject.Token&&this.tradingSharedService.sendBest5Request(this.Scripobject,2),""!=F&&null!=F){if(this.Scripobject=F,this.tradingSharedService.sendBest5Request(this.Scripobject,1),this.ExchaName=this.Scripobject._ExchangeName,this.ScripSymbol=null!=this.Scripobject?this.Scripobject.MWSecurityDesc:"",this.bOrigB5&&this.changeBestFiveTitle(),F._InstrumentName.startsWith("OPT")||F._InstrumentName.startsWith("FUT")){this.underlyingObj=new l.A;var re=!isNaN(this.Scripobject.UnderlyingMktSegId)&&this.Scripobject.UnderlyingMktSegId>0?this.Scripobject.UnderlyingMktSegId:G.X.getUnderlyingMktSegId(this.Scripobject.ScripDet.MktSegId);this.underlyingObj.Token=this.Scripobject.AssetToken,this.underlyingObj.MktSegId=re,this.underlyingObj.MapMktSegId=G.X.GetMappedMarketSegmentId(re);const X=[];X.push(this.underlyingObj),this.tradingSharedService.sendTouchLineRequest
1(X,1);let ne=this.pubsubService.subscribe("MTLRES",(he,fe)=>{this.zone.run(()=>{this.receiveTouchlineResponse(fe)})});this.ArrSubTokens.push(ne)}this.isLPPR=!(!this.Scripobject._ExchangeName.startsWith("BSE")&&!this.Scripobject._ExchangeName.startsWith("NSE")||!this.Scripobject._InstrumentName.startsWith("OPT")&&!F._InstrumentName.startsWith("FUT"))}}catch(X){this.logService.WriteLog("Exception: "+X.message,"populateScripDetails()","bestFive.component.ts","")}}nn_processBestFiveResponse(F){try{for(var re=0,X=this.B5Data.length;re<X;re++)this.B5Data[re].RowIndex==F.BestFiveData[re].RowIndex&&(this.B5Data[re].sBuyers=F.BestFiveData[re].sBuyers,this.B5Data[re].sBidQty=F.BestFiveData[re].sBidQty,this.B5Data[re].sBid=F.BestFiveData[re].sBid,this.B5Data[re].sSellers=F.BestFiveData[re].sSellers,this.B5Data[re].sAskQty=F.BestFiveData[re].sAskQty,this.B5Data[re].sAsk=F.BestFiveData[re].sAsk);this.TotalBidQty=F.TotBuyQty,this.TotalAskQty=F.TotSellQty,this.LUT=F.LUT,this.LTT=F.LTT,this.LTQ=F.LTQ,this.ATP=F.ATPPrc,this.OpenPrice=F.OpenPrc,this.HighPrice=F.HighPrc,this.LowPrice=F.LowPrc,this.ClosePrice=F.ClosePrc,this.LifeTimeHighCaption=a.xB.ExchManager.GetLifeTimeHighCaption(this.Scripobject.ScripDet.MktSegId),this.LifeTimeLowCaption=a.xB.ExchManager.GetLifeTimeLowCaption(this.Scripobject.ScripDet.MktSegId),this.LifeTimeHighPrice=F.YrHighPrc,this.LifeTimeLowPrice=F.YrLowPrc,this.Volume=F.Volume,this.ScripLTP=F.LTP,this.ScripPercChange=""!=F.PercNetChg?"("+F.PercNetChg+"%)":"";var ne=""!=F.PercNetChg?F.PercNetChg:0;if(parseFloat(ne)>0?this.ScripChangeCssClass="tcgreen":parseFloat(ne)<0&&(this.ScripChangeCssClass="tcred"),this.DPR=F.DPR,parseInt(this.Volume)>0){parseInt(this.Volume);let fe=G.X.calculateValue(this.Volume,this.ATP,this.Scrip);this.Value=parseFloat(fe)>0?fe:""}this.TER=""!=F.TER?F.TER:"0.00-0.00"}catch(he){this.logService.WriteLog("Exception: "+he.message,"populateScripDetails()","bestFive.component.ts","")}}populateOEFromB5(F){try{if(null!=this.Scripobject&&null!=this.Scripobject){var re="";if(null!=this.B5Data&&this.B5Data.length>0){if(a.xB.dConfigMaster.ORDERENTRY_BESTFIVE===a.gT.C_S_OFF||null===this.SelectedB5Data)this.SelectedB5Data=this.B5Data[0],this.SelBidQty="-"!=this.SelectedB5Data.sBidQty?this.SelectedB5Data.sBidQty:0,this.SelAskQty="-"!=this.SelectedB5Data.sAskQty?this.SelectedB5Data.sAskQty:0;else if(a.xB.dConfigMaster.ORDERENTRY_BESTFIVE===a.gT.C_S_ON&&null!=this.SelectedB5Data){for(var X=0,ne=0,he=this.SelectedB5Data.RowIndex,fe=0;fe<=this.B5Data.length&&(X=parseInt(X)+parseInt("-"!=this.B5Data[fe].sBidQty?this.B5Data[fe].sBidQty:"0"),ne=parseInt(ne)+parseInt("-"!=this.B5Data[fe].sAskQty?this.B5Data[fe].sAskQty:"0"),fe!==he);fe++);this.SelBidQty=X>0?X:0,this.SelAskQty=ne>0?ne:0}re="BUY"==F?this.SelAskQty:this.SelBidQty,parseInt(re)<=0&&(re=a.xB.ExchManager.GetQtyIncVal(this.Scripobject.ScripDet.MktSegId,this.Scripobject.MarketLot))}if(null!=this.SelectedB5Data){this.SelBidPrice="-"!=this.SelectedB5Data.sBid?this.SelectedB5Data.sBid:"",this.SelAskPrice="-"!=this.SelectedB5Data.sAsk?this.SelectedB5Data.sAsk:"";var Te=new T.Q(this.Scripobject);Te.OrderSide=F,Te.Qty=re,Te.Price=this.SelAskPrice,Te.SellPrice=this.SelAskPrice,Te.BuyPrice=this.SelBidPrice,Te.PageSource=a.gT.C_V_BESTFIVE_PAGENO.toString(),G.X.FormOEPopulationString(Te),this.menuManager.invokeMenu(a.gT.C_S_MENU_OE_SPOT,{sourceId:a.gT.C_S_MENU_BESTFIVE,data:Te})}}}catch(be){this.logService.WriteLog("Exception: "+be.message,"PopulateOE()","bestFive.component.ts","")}}processOEfromB5(F,re,X){try{for(var ne=0;ne<this.B5Data.length;ne++)this.B5Data[ne].SelectedB5Class=F.RowIndex==this.B5Data[ne].RowIndex?"ht03 odd mdetail mwgrid_selected":"ht03";this.SelectedB5Data=F}catch(he){this.logService.WriteLog("Exception: "+he.message,"processOEfromB5()","bestFive.component.ts","")}}getEmptyBestFiveData(){return this.EmptyBestFiveData=null,this.EmptyBestFiveData=[],this.EmptyBestFiveData.push({sBuyers:"-",sBidQty:"-",sBid:"-",sSellers:"-",sAskQty:"-",sAsk:"-",RowIndex:0,SelectedB5Class:"ht03"}),this.EmptyBestFiveData.push({sBuyers:"-",sBidQty:"-",sBid:"-",sSellers:"-",sAskQty:"-",sAsk:"-",RowIndex:1,SelectedB5Class:"ht03"}),this.EmptyBestFiveData.push({sBuyers:"-",sBidQty:"-",sBid:"-",sSellers:"-",sAskQty:"-",sAsk:"-",RowIndex:2,SelectedB5Class:"ht03"}),this.EmptyBestFiveData.push({sBuyers:"-",sBidQty:"-",sBid:"-",sSellers:"-",sAskQty:"-",sAsk:"-",RowIndex:3,SelectedB5Class:"ht03"}),this.EmptyBestFiveData.push({sBuyers:"-",sBidQty:"-",sBid:"-",sSellers:"-",sAskQty:"-",sAsk:"-",RowIndex:4,bSelectedB5Class:"ht03"}),this.EmptyBestFiveData}changeBestFiveTitle(){}ngOnChanges(F){null!=F.Scrip.currentValue&&null!=F.Scrip.currentValue&&(this.Scrip=F.Scrip.currentValue,this.populateScripDetails(this.Scrip))}clearFields(){try{this.B5Data=this.getEmptyBestFiveData(),this.TotalBidQty="",this.TotalAskQty="",this.LUT="",this.LTT="",this.LTQ="",this.ATP="",this.OpenPrice="",this.HighPrice="",this.LowPrice="",this.ClosePrice="",this.LifeTimeHighCaption="52W H",this.LifeTimeLowCaption="52W L",this.LifeTimeHighPrice="",this.LifeTimeLowPrice="",this.Volume="",this.ScripLTP="",this.ScripPercChange="",this.DPR="",this.Value="",this.SelBidQty="",this.SelBidPrice="",this.SelAskQty="",this.SelAskPrice="",this.SelectedB5Data=null,this.TER=""}catch(re){this.logService.WriteLog("Exception: "+re.message,"clearFields()","bestFive.component.ts","")}}}return w.\u0275fac=function(F){return new(F||w)(g.\u0275\u0275directiveInject(a.mQ),g.\u0275\u0275directiveInject(b.H),g.\u0275\u0275directiveInject(a.hC),g.\u0275\u0275directiveInject(g.NgZone),g.\u0275\u0275directiveInject(a._V),g.\u0275\u0275directiveInject(p.F))},w.\u0275cmp=g.\u0275\u0275defineComponent({type:w,selectors:[["best-of-five"]],inputs:{PageSource:"PageSource",orderEntry:"orderEntry",Scrip:"Scrip",isB5HdrVisible:"isB5HdrVisible",isLookUp:"isLookUp",isExchNameVisible:"isExchNameVisible",isBuySellLinkVisible:"isBuySellLinkVisible",isB5DataVisible:"isB5DataVisible",isB5Visible:"isB5Visible"},features:[g.\u0275\u0275NgOnChangesFeature],decls:42,vars:8,consts:[[4,"ngIf"],["class","OEB5Scr",4,"ngIf"],[1,"tbl-alt-row"],[1,"b5"],[1,"BestFive_table"],[1,"B5_left"],[1,"buy-border"],[4,"ngFor","ngForOf"],["colspan","2",1,"
1yellowtext","bdr-btm-none"],[1,"greentext","bdr-btm-none"],[1,"sell-border"],["colspan","3",1,"redtext","bdr-btm-none"],["class","BestFive_table2",4,"ngIf"],["mat-raised-button","",3,"click"],[3,"addScripCallBack"],[1,"font-18","flt-left","mr5"],[1,"font-14","mt5","flt-left"],[1,"OEB5Scr"],["value","BUY",1,"Market_up_Collapse_Menu","btn","btn-primary",3,"click"],["value","SELL",1,"Market_down_Collapse_Menu","btn","btn-primary",3,"click"],[3,"click"],[1,"BestFive_table2"],[1,"BestFive"],["class","BestFive_Col1",4,"ngIf"],[1,"BestFive_Col2"],[1,"list-style-none"],[3,"ngClass"],[1,"BestFive_Col3"],[1,"BestFive_Col1"]],template:function(F,re){1&F&&(g.\u0275\u0275template(0,e,4,1,"div",0),g.\u0275\u0275template(1,f,11,4,"div",0),g.\u0275\u0275elementStart(2,"div"),g.\u0275\u0275template(3,_,4,2,"table",1),g.\u0275\u0275elementStart(4,"table",2),g.\u0275\u0275elementStart(5,"tbody"),g.\u0275\u0275elementStart(6,"tr"),g.\u0275\u0275elementStart(7,"td",3),g.\u0275\u0275elementStart(8,"div",4),g.\u0275\u0275elementStart(9,"div",5),g.\u0275\u0275elementStart(10,"table"),g.\u0275\u0275elementStart(11,"thead"),g.\u0275\u0275elementStart(12,"tr",6),g.\u0275\u0275elementStart(13,"th"),g.\u0275\u0275text(14,"Buyers"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(15,"th"),g.\u0275\u0275text(16,"Bid Size"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(17,"th"),g.\u0275\u0275text(18,"Bid"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(19,k,8,3,"tbody",7),g.\u0275\u0275elementStart(20,"tfoot"),g.\u0275\u0275elementStart(21,"tr"),g.\u0275\u0275elementStart(22,"td",8),g.\u0275\u0275text(23,"TOTAL"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(24,"td",9),g.\u0275\u0275text(25),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(26,"div",5),g.\u0275\u0275elementStart(27,"table"),g.\u0275\u0275elementStart(28,"thead"),g.\u0275\u0275elementStart(29,"tr",10),g.\u0275\u0275elementStart(30,"th"),g.\u0275\u0275text(31,"Ask"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(32,"th"),g.\u0275\u0275text(33,"Ask Size"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementStart(34,"th"),g.\u0275\u0275text(35,"Sellers"),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(36,W,8,3,"tbody",7),g.\u0275\u0275elementStart(37,"tfoot"),g.\u0275\u0275elementStart(38,"tr"),g.\u0275\u0275elementStart(39,"td",11),g.\u0275\u0275text(40),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275template(41,H,2,1,"div",12),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd(),g.\u0275\u0275elementEnd()),2&F&&(g.\u0275\u0275property("ngIf",re.isLookUp),g.\u0275\u0275advance(1),g.\u0275\u0275property("ngIf",re.isB5HdrVisible),g.\u0275\u0275advance(2),g.\u0275\u0275property("ngIf",re.isExchNameVisible),g.\u0275\u0275advance(16),g.\u0275\u0275property("ngForOf",re.B5Data),g.\u0275\u0275advance(6),g.\u0275\u0275textInterpolate(re.TotalBidQty),g.\u0275\u0275advance(11),g.\u0275\u0275property("ngForOf",re.B5Data),g.\u0275\u0275advance(4),g.\u0275\u0275textInterpolate(re.TotalAskQty),g.\u0275\u0275advance(1),g.\u0275\u0275property("ngIf",!re.orderEntry&&re.isB5Visible))},directives:[h.O5,h.sg,o.lW,u.e,h.mk],encapsulation:2}),w})()},582:(je,ke,x)=>{x.d(ke,{H:()=>xe});var a=x(2741),T=x(4033),G=x(2232),n=x(1705),l=x(1531),g=x(8638),b=x(7637),p=x(6274),h=x(6167),o=x(3324),u=x(4699),m=x(328);const e=["divMainTable"],f=["cdkvirtualsvp"];function i(oe,me){1&oe&&(a.\u0275\u0275elementStart(0,"div",2),a.\u0275\u0275elementStart(1,"span"),a.\u0275\u0275text(2,"No Scrips Available"),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd())}function P(oe,me){if(1&oe&&(a.\u0275\u0275element(0,"span",19),a.\u0275\u0275pipe(1,"translate")),2&oe){const L=a.\u0275\u0275nextContext().$implicit;
1a.\u0275\u0275property("innerHTML",a.\u0275\u0275pipeBind1(1,1,L.name),a.\u0275\u0275sanitizeHtml)}}function _(oe,me){if(1&oe&&(a.\u0275\u0275element(0,"span",19),a.\u0275\u0275pipe(1,"translate")),2&oe){const L=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275property("innerHTML",a.\u0275\u0275pipeBind1(1,1,L.name),a.\u0275\u0275sanitizeHtml)}}function k(oe,me){}const W=function(oe,me,L){return{value:oe,row:me,column:L}};function N(oe,me){if(1&oe&&a.\u0275\u0275template(0,k,0,0,"ng-template",20),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext(4);a.\u0275\u0275property("ngTemplateOutlet",L.cellHeaderTemplate)("ngTemplateOutletContext",a.\u0275\u0275pureFunction3(2,W,te.value,te.row,L))}}function Q(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"th",17),a.\u0275\u0275listener("click",function(){const De=a.\u0275\u0275restoreView(L).$implicit;return a.\u0275\u0275nextContext(4).sortHeaderClick(De)})("onDropSuccess",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(4).onColDropSuccess(J)}),a.\u0275\u0275template(1,P,2,3,"span",18),a.\u0275\u0275template(2,_,2,3,"span",18),a.\u0275\u0275template(3,N,1,6,void 0,4),a.\u0275\u0275elementEnd()}if(2&oe){const L=me.$implicit;a.\u0275\u0275property("sortableIndex",me.index)("ngClass",L.headerClass),a.\u0275\u0275attribute("data-colId",L.value),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.cellHeaderTemplate&&L.isSortable),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.cellHeaderTemplate&&!L.isSortable),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.cellHeaderTemplate)}}function H(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"span",22),a.\u0275\u0275elementStart(1,"input",23),a.\u0275\u0275listener("ngModelChange",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext().$implicit.filterText=J})("ngModelChange",function(){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(5).searchText()}),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(2,"span",24),a.\u0275\u0275elementStart(3,"span",25),a.\u0275\u0275text(4,'Only numbers are allowed with preceding characters like ">", "<" comparison operators'),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&oe){const L=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275propertyInterpolate("title",L.placeholdername),a.\u0275\u0275advance(1),a.\u0275\u0275propertyInterpolate("placeholder",L.placeholdername),a.\u0275\u0275propertyInterpolate("id",L.name),a.\u0275\u0275property("ngModel",L.filterText),a.\u0275\u0275advance(2),a.\u0275\u0275propertyInterpolate("id",L.id)}}function V(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"th"),a.\u0275\u0275template(1,H,5,5,"span",21),a.\u0275\u0275elementEnd()),2&oe){const L=me.$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.enableFilter)}}function w(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275element(1,"span",26),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("innerHTML",L.name,a.\u0275\u0275sanitizeHtml)}}function Z(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275element(1,"span",26),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("innerHTML",L.name,a.\u0275\u0275sanitizeHtml)}}function F(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"th"),a.\u0275\u0275template(1,w,2,1,"span",4),a.\u0275\u0275template(2,Z,2,1,"span",4),a.\u0275\u0275elementEnd()),2&oe){const L=me.$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.isSortable),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.isSortable)}}function re(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"mat-checkbox",31),a.\u0275\u0275listener("ngModelChange",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(2).$implicit.isCheckSelected=J}
1)("click",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(6).onCheckboxChange(J)}),a.\u0275\u0275elementEnd()}if(2&oe){const L=a.\u0275\u0275nextContext(2).$implicit;a.\u0275\u0275property("ngModel",L.isCheckSelected)("checked",L.isCheckSelected)}}function X(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1(" ",te[L.value]," ")}}function ne(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext().$implicit,J=a.\u0275\u0275nextContext(4);a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1(" ",J.getCellValue(te,L)," ")}}function he(oe,me){}function fe(oe,me){if(1&oe&&a.\u0275\u0275template(0,he,0,0,"ng-template",20),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext().$implicit,J=a.\u0275\u0275nextContext(4);a.\u0275\u0275property("ngTemplateOutlet",L.cellTemplate)("ngTemplateOutletContext",a.\u0275\u0275pureFunction3(2,W,J.value,te,L))}}function Te(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"td",29),a.\u0275\u0275template(1,re,1,2,"mat-checkbox",30),a.\u0275\u0275template(2,X,2,1,"span",4),a.\u0275\u0275template(3,ne,2,1,"span",4),a.\u0275\u0275template(4,fe,1,6,void 0,4),a.\u0275\u0275elementEnd()),2&oe){const L=me.$implicit,te=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275property("ngClass",L.isComputedClass?te[L.class]:L.cssClass),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.isCheckboxable),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.cellTemplate&&!L.deep),a.\u
10275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.cellTemplate&&L.deep),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.cellTemplate)}}function Ce(oe,me){}function be(oe,me){if(1&oe&&a.\u0275\u0275template(0,Ce,0,0,"ng-template",20),2&oe){const L=a.\u0275\u0275nextContext(2).$implicit,te=a.\u0275\u0275nextContext(4);a.\u0275\u0275property("ngTemplateOutlet",te.rowExpandTempl)("ngTemplateOutletContext",a.\u0275\u0275pureFunction3(2,W,te.value,L,te.column))}}function Me(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"tr"),a.\u0275\u0275elementStart(1,"td"),a.\u0275\u0275template(2,be,1,6,void 0,4),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext(4);a.\u0275\u0275property("@showExpandedView",L.rowExpandTransitionState),a.\u0275\u0275advance(1),a.\u0275\u0275attribute("colspan",te.__columns.length),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",te.rowExpandTempl)}}function ue(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"tr",27),a.\u0275\u0275listener("click",function(J){const Ke=a.\u0275\u0275restoreView(L).$implicit;return a.\u0275\u0275nextContext(4).RowClick(Ke,J)})("onDropSuccess",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(4).onDropSuccess(J)}),a.\u0275\u0275template(1,Te,5,5,"td",28),a.\u0275\u0275elementEnd(),a.\u0275\u0275template(2,Me,3,3,"tr",4)}if(2&oe){const L=me.$implicit,te=me.index,J=a.\u0275\u0275nextContext(4);a.\u0275\u0275property("dragEnabled",J.dragEnabled)("sortableIndex",te)("ngClass",L.SelectedMWDataClass),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",J.__columns),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.rowExpanded)}}const Re=function(){return["Zone1"]};function K(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275elementStart(1,"div",6),a.\u0275\u0275elementStart(2,"table",7),a.\u0275\u0275elementStart(3,"thead",8),a.\u0275\u0275elementStart(4,"tr"),a.\u0275\u0275template(5,Q,4,6,"th",9),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(6,"tr",10),a.\u0275\u0275template(7,V,2,1,"th",11),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(8,"cdk-virtual-scroll-viewport",12,13),a.\u0275\u0275listener("scroll",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(3).onMainDivScroll(J)}),a.\u0275\u0275elementStart(11,"table",14),a.\u0275\u0275elementStart(12,"thead",10),a.\u0275\u0275elementStart(13,"tr"),a.\u0275\u0275template(14,F,3,2,"th",11),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(15,"tbody",15),a.\u0275\u0275template(16,ue,3,5,"ng-template",16),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&oe){const L=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("top",L.fhTopHeight)("position",L.absolute),a.\u0275\u0275advance(2),a.\u0275\u0275property("sortableData",L.__columns),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngForOf",L.__columns),a.\u0275\u0275advance(1),a.\u0275\u0275property("hidden",!L.showFilter)("@showSortFilter",L.showSortFilterState),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",L.__columns),a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("top",L.fhTopHeight)("position",L.isFixedHeader?"absolute":"unset")("height",L.viewPortHeight,"px"),a.\u0275\u0275property("itemSize",30)("minBufferPx",90)("maxBufferPx",150),a.\u0275\u0275advance(4),a.\u0275\u0275property("hidden",L.isFixedHeader),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngForOf",L.__columns),a.\u0275\u0275advance(1),a.\u0275\u0275property("dropZones",a.\u0275\u0275pureFunction0(24,Re))("sortableData",L.rowsFiltered),a.\u0275\u0275advance(1),a.\u0275\u0275property("cdkVirtualForOf",L.rowsFiltered)("cdkVirtualForTrackBy",
1L.trackById)}}function de(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275element(1,"span",26),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("innerHTML",L.name,a.\u0275\u0275sanitizeHtml)}}function Ee(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275element(1,"span",26),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("innerHTML",L.name,a.\u0275\u0275sanitizeHtml)}}function Ue(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"th"),a.\u0275\u0275template(1,de,2,1,"span",4),a.\u0275\u0275template(2,Ee,2,1,"span",4),a.\u0275\u0275elementEnd()),2&oe){const L=me.$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.isSortable),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.isSortable)}}function Ze(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"mat-checkbox",31),a.\u0275\u0275listener("ngModelChange",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(2).$implicit.isCheckSelected=J})("click",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(6).onCheckboxChange(J)}),a.\u0275\u0275elementEnd()}if(2&oe){const L=a.\u0275\u0275nextContext(2).$implicit;a.\u0275\u0275property("ngModel",L.isCheckSelected)("checked",L.isCheckSelected)}}function Tt(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1(" ",te[L.value]," ")}}function ot(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"span"),a.\u0275\u0275text(1),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext().$implicit,J=a.\u0275\u0275nextContext(4);a.\u0275\u0275advance(1),a.\u0275\u0275textInterpolate1(" ",J.getCellValue(te,L)," ")}}function ht(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"td",29),a.\u0275\u0275template(1,Ze,1,2,"mat-checkbox",30),a.\u0275\u0275template(2,Tt,2,1,"span",4),a.\u0275\u0275template(3,ot,2,1,"span",4),a.\u0275\u0275elementEnd()),2&oe){const L=me.$implicit,te=a.\u0275\u0275nextContext().$implicit;a.\u0275\u0275property("ngClass",L.isComputedClass?te[L.class]:L.cssClass),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.isCheckboxable),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.cellTemplate&&!L.deep),a.\u
10275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.cellTemplate&&L.deep)}}function nt(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"tr",27),a.\u0275\u0275listener("click",function(J){const Ke=a.\u0275\u0275restoreView(L).$implicit;return a.\u0275\u0275nextContext(4).RowClick(Ke,J)})("onDropSuccess",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(4).onDropSuccess(J)}),a.\u0275\u0275template(1,ht,4,4,"td",28),a.\u0275\u0275elementEnd()}if(2&oe){const L=me.$implicit,te=me.index,J=a.\u0275\u0275nextContext(4);a.\u0275\u0275property("dragEnabled",J.dragEnabled)("sortableIndex",te)("ngClass",L.SelectedMWDataClass),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",J.__columns)}}function ut(oe,me){if(1&oe){const L=a.\u0275\u0275getCurrentView();a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275elementStart(1,"div",32,33),a.\u0275\u0275listener("scroll",function(J){return a.\u0275\u0275restoreView(L),a.\u0275\u0275nextContext(3).onMainDivScroll(J)}),a.\u0275\u0275elementStart(3,"table",14),a.\u0275\u0275elementStart(4,"thead",10),a.\u0275\u0275elementStart(5,"tr"),a.\u0275\u0275template(6,Ue,3,2,"th",11),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementStart(7,"tbody",15),a.\u0275\u0275template(8,nt,2,4,"ng-template",34),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()}if(2&oe){const L=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("top",L.fhTopHeight)("position",L.unset),a.\u0275\u0275advance(3),a.\u0275\u0275property("hidden",L.isFixedHeader),a.\u0275\u0275advance(2),a.\u0275\u0275property("ngForOf",L.__columns),a.\u0275\u0275advance(1),a.\u0275\u0275property("dropZones",a.\u0275\u0275pureFunction0(10,Re))("sortableData",L.rowsFiltered),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngForOf",L.rowsFiltered)("ngForTrackBy",
1L.trackById)}}function ae(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275template(1,K,17,25,"div",4),a.\u0275\u0275template(2,ut,9,11,"div",4),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.isFixedHeader),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",!L.isFixedHeader)}}function Pe(oe,me){}const E=function(oe,me){return{value:oe,row:me}};function R(oe,me){if(1&oe&&a.\u0275\u0275template(0,Pe,0,0,"ng-template",20),2&oe){const L=a.\u0275\u0275nextContext().$implicit,te=a.\u0275\u0275nextContext(3);a.\u0275\u0275property("ngTemplateOutlet",te.blockViewTempl)("ngTemplateOutletContext",a.\u0275\u0275pureFunction2(2,E,te.value,L))}}function Y(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"div"),a.\u0275\u0275template(1,R,1,5,void 0,4),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext(3);a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf",L.blockViewTempl)}}function ie(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"div",35),a.\u0275\u0275elementStart(1,"cdk-virtual-scroll-viewport",36,37),a.\u0275\u0275template(3,Y,2,1,"div",38),a.\u0275\u0275elementEnd(),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext(2);a.\u0275\u0275advance(1),a.\u0275\u0275styleProp("height",L.viewPortHeight,"px"),a.\u0275\u0275property("itemSize",134)("minBufferPx",134)("maxBufferPx",402),a.\u0275\u0275advance(2),a.\u0275\u0275property("cdkVirtualForOf",L.rowsFiltered)("cdkVirtualForTrackBy",
1L.trackById)}}function ge(oe,me){if(1&oe&&(a.\u0275\u0275elementStart(0,"div",3),a.\u0275\u0275template(1,ae,3,2,"div",4),a.\u0275\u0275template(2,ie,4,7,"div",5),a.\u0275\u0275elementEnd()),2&oe){const L=a.\u0275\u0275nextContext();a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf","Grid"==L.layoutMode),a.\u0275\u0275advance(1),a.\u0275\u0275property("ngIf","Block"==L.layoutMode)}}let xe=(()=>{class oe{constructor(L,te,J,De){this.eleRef=L,this.cdRef=te,this.logService=J,this.uiManager=De,this.modelChanged=new T.x,this.filteringData=!1,this.prevrcd=0,this.isRowsAvailable=!1,this.filterCoulmns=[],this.dragSuccess=new a.EventEmitter,this.colDragSuccess=new a.EventEmitter,this.layoutMode="Grid",this.onScroll=new a.EventEmitter,this.isFixedHeader=!0,this.onChecked=new a.EventEmitter,this.dragEnabled=!0,this.showSortFilterState="",this.onViewPortChange=new a.EventEmitter,this.viewPortScripKeys=[],this.subscriptions=[],this.rowHeight=30,this.sortDirection="asc",this._isSorting=!1,this.fhTopHeight="75px",this.celminWidthsAssigned=[],this.showFilter=!1,this.enableSort=!0,this.ProcessOEandB5=new a.EventEmitter,this.applyFH=!1}detectChange(){this.cdRef.markForCheck()}ngOnInit(){try{this.subscriptions.push(this.modelChanged.pipe((0,l.b)(500)).subscribe(te=>this.filterText())),this.isFixedHeader&&(this.fixedHeader=new G.NB("dvReportGrid","ReportContainer",this.fixedHdrConfig,this.eleRef.nativeElement,!1)),this.setViewPortHeight();var L=this.uiManager.layoutChangeDetect.subscribe(te=>{this.setViewPortHeight()});this.subscriptions.push(L)}catch(te){this.logService.WriteLog("mwTable.component.ts","ngOnInit()",te.message)}}ngAfterViewInit(){try{this.subscribeToCDKVirtualEvents()}catch(L){this.logService.WriteLog("mwTable.component.ts","ngAfterViewInit()",L.message)}}subscribeToCDKVirtualEvents(){if(this.cdkvirtualsvp){var L=this.cdkvirtualsvp.renderedRangeStream.subscribe(J=>{this.findviewPortScripKeys(J)});this.subscriptions.push(L)}if(this.cdkvirtualforof){var te=this.cdkvirtualforof.dataStream.subscribe(J=>{this.findviewPortScripKeys(this.cdkvirtualsvp.getRenderedRange())});this.subscriptions.push(te)}}searchText(){this.modelChanged.next("")}filterText(){let L=this.rows;for(const te of this.__columns)te.filter&&null!=te.filterText&&te.filterText.length>0&&(L=this.rowFilterProcess(L,te.filterText,te));this.rowsFiltered=L,this.filteringData=!0,this.detectChange()}filter_by(L,te,J){var De=J.value;let Ke=["<",">","=","<>","<=",">=","BET"],Xe=[];var tt,et=te.toUpperCase(),ct=-1;-1!=Ke.indexOf(et.slice(0,3))?(ct=Ke.indexOf(et.slice(0,3)),tt=et.slice(3)):-1!=Ke.indexOf(et.slice(0,2))?(ct=Ke.indexOf(et.slice(0,2)),tt=et.slice(2)):-1!=Ke.indexOf(et.slice(0,1))&&(ct=Ke.indexOf(et.slice(0,1)),tt=et.slice(1));var Ct=document.getElementById(J.id);if(Ct.classList.remove("show"),""!=J.popUpTimeOut&&clearTimeout(J.popUpTimeOut),-1==ct||isNaN(tt)||""==tt)return Ct.classList.add("show"),J.popUpTimeOut=setTimeout(()=>{Ct.classList.remove("show")},2500),L;switch(J.deep&&(L=L.filter(ze=>!isNaN(parseFloat(this.getCellValue(ze,J))))),""==tt&&(tt=0),ct){case 0:Xe=L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))<parseFloat(tt));break;case 1:Xe=L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))>parseFloat(tt));break;case 2:Xe=L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))==parseFloat(tt));break;case 3:Xe=L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))!=parseFloat(tt));break;case 4:Xe=L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))<=parseFloat(tt));break;case 5:Xe=L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))>=parseFloat(tt));break;case 6:var vt=tt.replace(" ","").split(",");Xe=2==tt.replace(" ","").split(",").length?L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))>=parseFloat(vt[0])&&(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))<=parseFloat(vt[1])):L.filter(ze=>(J.deep?parseFloat(this.getCellValue(ze,J)):parseFloat(ze[De]))>=parseFloat(vt[0]));break;
1default:Xe=L}return Xe}rowFilterProcess(L,te,J){let De=[];return De="N"==J.cType?this.filter_by(L,te,J):L.filter(J.deep?Ke=>this.getCellValue(Ke,J).toUpperCase().indexOf(te.toUpperCase())>=0:Ke=>Ke[J.value].toUpperCase().indexOf(te)>=0),De}setDefaultColProp(L){var te=0;this.fixedHdrConfig.customWidths={};for(const J of L)J.hasOwnProperty("width")&&(this.fixedHdrConfig.customWidths[J.value]=J.width),J.popUpTimeOut="",J.id=te+=1,J.hasOwnProperty("isSortable")&&J.isSortable&&(J.hasOwnProperty("sort")||(J.sort=""),J.headerClass="sorting "),J.hasOwnProperty("filter")||(J.filter=!0,J.filterText="",J.placeholdername="S"==J.cType?"filter by "+J.name:"eg. >500 or <500"),J.hasOwnProperty("headerClass")||(J.headerClass=""),J.hasOwnProperty("headerType")||(J.headerType=""),"LTP"==J.value?J.headerClass+=J.headerType:"N"==J.cType?J.headerClass+="taR":J.headerClass=J.headerClass,J.hasOwnProperty("isComputedClass")||(J.isComputedClass=!1),J.hasOwnProperty("cssClass")||(J.cssClass=""),J.isComputedClass||(J.cssClass="N"==J.cType?"taR":"taL")}sortHeaderClick(L){null!=L.sort&&(L.headerClass="LTP"==L.value?L.headerType:"N"==L.cType?"taR":"taL",this.enableSort&&(L.sort="asc"===L.sort?"desc":"asc",this.rowsFiltered=n.vV.sort(this.rowsFiltered,L.value,L.sort,"S"!=L.cType),this.rowsFiltered=[...this.rowsFiltered],this.__columns.forEach(te=>{te.hasOwnProperty("sort")&&(te.value!=L.value?(te.sort="",te.headerClass="LTP"==te.value?"sorting "+L.headerType:"N"==te.cType?"sorting taR":"sorting taL"):te.headerClass="asc"===L.sort?L.headerClass+" sorting_asc":L.headerClass+" sorting_desc")})))}isSorting(L){return L}onKeyDown(L){if(this.eleRef.nativeElement.contains(L.target)){var J=L.which?L.which:L.keyCode;(38===J||40===J)&&(38==J?this.SelectMWData(-1):40===J&&this.SelectMWData(1),L.preventDefault())}}SelectMWData(L){var te,De,J,Ke=this.rows.filter(vt=>"ht03 odd mdetail mwgrid_selected"==vt.SelectedMWDataClass);te=this.rows.indexOf(Ke[0]),De=this.rows[J=0==te&&-1==L?0:te==this.rows.length-1&&1==L?this.rows.length-1:te+L];var Xe=this.cdkvirtualsvp.elementRef.nativeElement.scrollTop,ct="Grid"==this.layoutMode?this.rowHeight:134,tt=ct*J;(tt<Xe||tt+ct>Xe+this.cdkvirtualsvp.elementRef.nativeElement.offsetHeight)&&(this.cdkvirtualsvp.elementRef.nativeElement.scrollTop=tt),this.ProcessOEandB5.emit({Row:De,isExpand:!1,rowRef:null})}RowClick(L,te){this.rows.forEach(De=>{De!==L&&(De.rowExpandTransitionState="hidden")}),L.rowExpandTransitionState="shown"==L.rowExpandTransitionState?"hidden":"shown",this.ProcessOEandB5.emit({Row:L,isExpand:!0,rowRef:te.currentTarget})}addNewRow(L){this.rowsFiltered.splice(0,0,L)}removerow(L){this.rowsFiltered.splice(0,1,L)}clearFiter(L){L.hasOwnProperty("filterText")&&(L.filterText="")}resetFilter(){null!=this.__columns&&this.__columns.length>0&&this.__columns.forEach(L=>this.clearFiter(L))}set rows(L){try{if(this._rows=L,void 0!==this._rows&&this._rows.length>0){this.rowsFiltered=[],this.__columns=this._columns;let te=this._rows;if(null!=this.__columns&&this.__columns.length>0)for(const J of this.__columns)J.filter&&null!=J.filterText&&J.filterText.length>0&&(te=this.rowFilterProcess(te,J.filterText,J));this.rowsFiltered=te,this.cdkvirtualsvp||setTimeout(()=>{this.subscribeToCDKVirtualEvents()},0),this.isRowsAvailable=!0,"Grid"==this.layoutMode&&(setTimeout(()=>{this.isFixedHeader&&this.fixedHeader.applyFixedHeader()},0),0==this.rowsFiltered.length&&(this.resetFilter(),this.rowsFiltered=this._rows)),this.cdkvirtualsvp&&(this.cdkvirtualsvp.elementRef.nativeElement.scrollTop=0)}else this.rowsFiltered=[],this.isRowsAvailable=!1}catch(te){this.logService.WriteLog("mwTable.component.ts","rows()",te.message)}}get rows(){return this._rows}set columns(L){void 0!==L&&L.length>0&&this.setDefaultColProp(L),this.__columns=L,this._columns=L}get columns(){return this._columns}getCellValue(L,te){return te.isComputed?new Function("r","return "+te.binding)(L):te.value.split(".").reduce((J,De)=>J[De],L)}reApplyFH(){this.applyFH=!0}reAlignFH(){this.filteringData=!0}ngOnChanges(L){L.showFilter&&!L.showFilter.firstChange&&(L.showFilter.currentValue?(this.showSortFilterState="shown",this.setViewPortHeight()):(this.showSortFilterState="hidden",this.setViewPortHeight()),"Grid"==this.layoutMode&&setTimeout(()=>{this.isFixedHeader&&this.fixedHeader.onFilterClick()},0),L.showFilter.currentValue||(this.rowsFiltered=this._rows,null!=this.__columns&&this.__columns.length>0&&this.__columns.forEach(te=>this.clearFiter(te)))),L.layoutMode&&!L.layoutMode.firstChange&&(this.setViewPortHeight(),setTimeout(()=>{this.subscribeToCDKVirtualEvents()},0))}ngAfterViewChecked(){if(this.filteringData&&(this.filteringData=!1,"Grid"==this.layoutMode&&setTimeout(()=>{this.isFixedHeader&&this.fixedHeader.OnDataFilter()},0)),"Grid"==this.layoutMode){if(this.applyFH){this.applyFH=!1,this.isFixedHeader&&this.fixedHeader.applyFixedHeader();let L=this.eleRef.nativeElement.querySelector("tbody");null!=L&&L.focus()}}else if(this.applyFH){this.applyFH=!1;let L=this.eleRef.nativeElement.querySelector("#divBlock");null!=L&&L.focus()}}sortColumn(L){let te=L.value.split(".");this.rowsFiltered.sort(te.length>-1?(J,De)=>De[te[0][1]]-J[te[0][1]]:(J,De)=>De[this.rowsFiltered[0][te[0]].Symbol]-J[this.rowsFiltered[0][te[0]].Symbol])}trackById(L,te){return te.ScripDetail?te.ScripDetail.Token:te.Token}onDropSuccess(L){this.dragSuccess.emit(!0)}onColDropSuccess(L){this.colDragSuccess.emit(!0)}onMainDivScroll(L){this.isScrollEmit&&this.onScroll.emit(L.target.scrollTop)}setScroll(L){this.divMainTable.nativeElement.scrollTop=L}setScrollToRight(){this.isFixedHeader&&this.fixedHeader.setScrollToRight()}setScrollOfExpandRow(L){var te;te=this.cdkvirtualsvp.elementRef.nativeElement;var J,De=(J=L.getBoundingClientRect().top-te.getBoundingClientRect().top)+L.offsetHeight+this.rowHeight;De+268>
1te.offsetHeight&&(te.scrollTop=te.scrollTop+(De+268-te.offsetHeight)),J<0&&(te.scrollTop=te.scrollTop-Math.abs(J))}onCheckboxChange(L){setTimeout(()=>{this.emitCheckBoxClicked()},0),L.stopImmediatePropagation()}emitCheckBoxClicked(){var L=this._rows.filter(te=>te.isCheckSelected);this.onChecked.emit(L.length>0)}ngOnDestroy(){try{this.subscriptions.forEach(L=>L.unsubscribe())}catch(L){}}findviewPortScripKeys(L){try{if(0==L.start&&0==L.end)return;this.applyFH=!0;var te=[];for(let Xe=L.start;Xe<L.end;Xe++)Xe<this.rowsFiltered.length&&te.push(this.rowsFiltered[Xe].ScripDetail.ScripDet);var J=[],De=[];this.viewPortScripKeys.length>0&&(J=te.filter(Xe=>!this.viewPortScripKeys.some(et=>Xe.MktSegId==et.MktSegId&&Xe.Token==et.Token)),De=this.viewPortScripKeys.filter(Xe=>!te.some(et=>Xe.MktSegId==et.MktSegId&&Xe.Token==et.Token))),this.viewPortScripKeys=te,this.onViewPortChange.emit({scripKeys:te,addedScripKeys:J,removedScripKeys:De})}catch(Xe){this.logService.WriteLog("mwTable.component.ts","findviewPortScripKeys()",Xe.message)}}setViewPortHeight(){var te="Grid"==this.layoutMode?30:35;this.viewPortHeight=this.eleRef.nativeElement.offsetParent.offsetHeight-(1==this.showFilter?33:0)-(parseInt(this.fhTopHeight)+te)}}return oe.\u0275fac=function(L){return new(L||oe)(a.\u0275\u0275directiveInject(a.ElementRef),a.\u0275\u0275directiveInject(a.ChangeDetectorRef),a.\u0275\u0275directiveInject(n.mQ),a.\u0275\u0275directiveInject(n.wW))},oe.\u0275cmp=a.\u0275\u0275defineComponent({type:oe,selectors:[["mwTable"]],viewQuery:function(L,te){if(1&L&&(a.\u0275\u0275viewQuery(e,5),a.\u0275\u0275viewQuery(f,5),a.\u0275\u0275viewQuery(b.x0,5)),2&L){let J;a.\u0275\u0275queryRefresh(J=a.\u0275\u0275loadQuery())&&(te.divMainTable=J.first),a.\u0275\u0275queryRefresh(J=a.\u0275\u0275loadQuery())&&(te.cdkvirtualsvp=J.first),a.\u0275\u0275queryRefresh(J=a.\u0275\u0275loadQuery())&&(te.cdkvirtualforof=J.first)}},hostBindings:function(L,te){1&L&&a.\u0275\u0275listener("keydown",function(De){return te.onKeyDown(De)},!1,a.\u0275\u0275resolveWindow)},inputs:{layoutMode:"layoutMode",blockViewTempl:"blockViewTempl",rowExpandTempl:"rowExpandTempl",isScrollEmit:"isScrollEmit",isFixedHeader:"isFixedHeader",dragEnabled:"dragEnabled",fhTopHeight:"fhTopHeight",showFilter:"showFilter",enableSort:"enableSort",fixedHdrConfig:"fixedHdrConfig",rows:"rows",columns:"columns"},outputs:{dragSuccess:"dragSuccess",colDragSuccess:"colDragSuccess",onScroll:"onScroll",onChecked:"onChecked",onViewPortChange:"onViewPortChange",viewPortScripKeys:"viewPortScripKeys",ProcessOEandB5:"ProcessOEandB5"},features:[a.\u0275\u0275NgOnChangesFeature],decls:2,vars:2,consts:[["class","no_records",4,"ngIf"],["id","dvReportGrid",4,"ngIf"],[1,"no_records"],["id","dvReportGrid"],[4,"ngIf"],["class","clear","tabindex","1","id","divBlock",4,"ngIf"],["id","fh_ReportContainer",1,"mwtable"],["cellpadding","0","cellspacing","0",1,"w100"],["dnd-sortable-container","",3,"sortableData"],["dnd-sortable","",3,"sortableIndex","ngClass","click","onDropSuccess",4,"ngFor","ngForOf"],[3,"hidden"],[4,"ngFor","ngForOf"],["id","ReportContainer",1,"mwtable","box-sizing","nicescroll",3,"itemSize","minBufferPx","maxBufferPx","scroll"],["divMainTable","","cdkvirtualsvp",""],["id","204_TradeBook","cellpadding","0","cellspacing","0",1,"w100"],["dnd-sortable-container","","tabindex","1","id","table1",3,"dropZones","sortableData"],["cdkVirtualFor","",3,"cdkVirtualForOf","cdkVirtualForTrackBy"],["dnd-sortable","",3,"sortableIndex","ngClass","click","onDropSuccess"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","Mkt_place",3,"title",4,"ngIf"],[1,"Mkt_place",3,"title"],["name","marketFilter","type","text","maxlength","50",1,"Filter_panel",3,"placeholder","id","ngModel","ngModelChange"],[1,"filterPopup"],[1,"filterPopupText",3,"id"],[1,"txt-white",3,"innerHTML"],["dnd-sortable","",3,"dragEnabled","sortableIndex","ngClass","click","onDropSuccess"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],["input","","type","checkbox",3,"ngModel","checked","ngModelChange","click",4,"ngIf"],["input","","type","checkbox",3,"ngModel","checked","ngModelChange","click"],["id","ReportContainer",1,"mwtable","box-sizing","nicescroll",3,"scroll"],["divMainTable",""],["ngFor","",3,"ngForOf","ngForTrackBy"],["tabindex","1","id","divBlock",1,"clear"],[3,"itemSize","minBufferPx","maxBufferPx"],["cdkvirtualsvp",""],[4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTrackBy"]],template:function(L,te){1&L&&(a.\u0275\u0275template(0,i,3,0,"div",0),a.\u0275\u0275template(1,ge,3,2,"div",1)),2&L&&(a.\u0275\u0275property("ngIf",!te.isRowsAvailable),a.\u0275\u0275advance(1),a.\u
10275\u0275property("ngIf",te.isRowsAvailable))},directives:[p.O5,h.JN,p.sg,b.N7,b.xd,b.x0,h.Ts,p.mk,p.tP,o.Fj,o.nD,o.JJ,o.On,u.oG],pipes:[m.B],encapsulation:2,data:{animation:[(0,g.X$)("showSortFilter",[(0,g.SB)("shown",(0,g.oB)({opacity:1,visibility:"visible",animation:"fadeIn 1s"})),(0,g.SB)("hidden",(0,g.oB)({opacity:0,visibility:"hidden",animation:"fadeOut 1s"})),(0,g.eR)("shown => hidden",(0,g.jt)(".1000ms",(0,g.oB)({opacity:0,height:0}))),(0,g.eR)("* => shown",(0,g.jt)(".1000ms",(0,g.oB)({opacity:1,height:"*"})))]),(0,g.X$)("showExpandedView",[(0,g.SB)("shown",(0,g.oB)({opacity:1,visibility:"visible",animation:"fadeIn 1s"})),(0,g.SB)("hidden",(0,g.oB)({opacity:0,visibility:"hidden",animation:"fadeOut 1s"})),(0,g.eR)("shown => hidden",(0,g.jt)(".1000ms",(0,g.oB)({opacity:0,height:0}))),(0,g.eR)("* => shown",(0,g.jt)(".1000ms",(0,g.oB)({opacity:1,height:"*"})))])]},changeDetection:0}),oe})()},2765:(je,ke,x)=>{x.d(ke,{P:()=>G});var a=x(1705),T=x(2282);class G{constructor(){this.ScripDet=new T.A,this.Symbol="",this.Series="",this.InstrumentName="",this.ExchangeName="",this.ExpiryDate="",this.OptionType="",this.MarketLot="",this.PriceTick="",this.SecurityDesc="",this.MWSecurityDesc="",this.MWSecurityDescShort="",this.StrikePrice="",this.OrderType="",this.DecimalLocator="",this.PriceFormat="",this.ProductType=a.gT.C_S_PRODUCTTYPE_DELIVERY_CARRYFORWARD_VALUE,this.AssetToken="",this.Spread="",this.FIILimit="",this.NRILimit="",this.Token=0,this.MarginTypeIndicator="",this.DisplaySymbol="",this.DisplaySeries="",this.DisplayExchange="",this.DisplayInstrument="",this.DisplayExpiryDate="",this.DisplayStrikePrice="",this.DisplayOptionType="",this.ExchangeColorCss="",this.isIndex=!1,this.NetChangeInRs="",this.PercNetChange="",this.LTPTrend="",this.LTPVal="",this.ClientOrderNumber="",this.ExchangeOrderNo=0,this.LTP=0,this.HighPr=0,this.LowPr=0,this.ClosePrice=0,this.QtyCaption="Lot",this.decPlaces=2,this.sDerivitiveDesc="",this.nSPOS=0,this.nPOS=0,this.sGlobalNormalFlag="",this.nExpiryDate1="",this.nStrikePrice1="",this.nExpiryDate2="",this.nFIIFlag=0,this.nIsAsset=0,this.nIsIndex=0,this.nCoCode=0,this.nSectorCode=0,this.nOtherExchToken=0,this.sSector="",this._InstrumentName="",this._ExpiryDate="",this._OptionType="",this._StrikePrice="",this._Series="",this._ExchangeName=""}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.