1(self.webpackChunk_aqx_member_web=self.webpackChunk_aqx_member_web||[]).push([["3846"],{77023:function(e,r,t){var n=t(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},35192:function(e,r,t){t(82109)({target:"Number",stat:!0},{isFinite:t(77023)})},98900:function(e,r,t){"use strict";t.d(r,{Bu:()=>c,DQ:()=>a}),t(48881),t(43545);var n=t(70452),o=t(6807);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var c=function(e){var r;return e?(i(r={},n.U.ALL,{cancel:o.Of.BULK_CLOSE_MODAL_BUTTON_CANCEL_ALL,submit:o.Of.BULK_CLOSE_MODAL_BUTTON_SUBMIT_ALL}),i(r,n.U.PROFIT,{cancel:o.Of.BULK_CLOSE_MODAL_BUTTON_CANCEL_PROFIT,submit:o.Of.BULK_CLOSE_MODAL_BUTTON_SUBMIT_PROFIT}),i(r,n.U.LOSS,{cancel:o.Of.BULK_CLOSE_MODAL_BUTTON_CANCEL_LOSS,submit:o.Of.BULK_CLOSE_MODAL_BUTTON_SUBMIT_LOSS}),r)[e]:{cancel:o.Of.BULK_DELETE_MODAL_BUTTON_CANCEL,submit:o.Of.BULK_DELETE_MODAL_BUTTON_SUBMIT}},a=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?o.m_.CONTEXT_MENU_CHART_SETTING:o.m_.DROPDOWN_CHART_SETTING}},31305:function(e,r,t){"use strict";t.d(r,{K2:()=>E,Q8:()=>O,XR:()=>T});var n,o=t(81993);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){i(e,r,t[r])})}return e}function s(e,r){return(s=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var d={activeRowMap:{}},u=new(function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=c(t=r),i(e=function(e,r){var t;if(r&&("object"==((t=r)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)||"function"==typeof r))return r;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,l()?Reflect.construct(t,[],c(this).constructor):t.apply(this,n)),"addActiveRow",function(r,t){var n,o;e.context.activeRowMap=(n=a({},e.context.activeRowMap),o=null!=(o=i({},r,t))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n)}),i(e,"removeActiveRow",function(r,t){var n=a({},e.context.activeRowMap);n[r]===t&&delete n[r],e.context.activeRowMap=a({},n)}),i(e,"reset",function(){e.context=a({},d)}),e.context=d,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&s(r,e),r}(o.default));function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var T=new function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");f(this,"reset",u.reset),f(this,"addActiveRow",u.addActiveRow),f(this,"removeActiveRow",u.removeActiveRow),f(this,"getActiveRowMap",function(){return u.context.activeRowMap})},O=function(e,r){return(0,o.useService)(u,function(t){return t.activeRowMap[e]===r})},E=((n={}).TRACK="TRACK",n.CLOSE="CLOSE",n.DELETE="DELETE",n.EDIT="EDIT",n)},28085:function(e,r,t){"use strict";t.d(r,{Z:()=>p}),t(92222),t(21249);var n=t(74512),o=t(32735),i=t(10281),c=t(62715),a=t(71225),s=t(38074),l=t(86653),d=t(46645),u=t(6807),f=t(1403),T=t(63913),O=t(92963),E=t(86969),y=function(e){var r=e.label,t=e.value,o=e.testID;return(0,n.jsxs)(N,{children:[(0,n.jsx)(h,{dataTestId:"".concat(o,"-label"),children:r}),(0,n.jsx)(C,{dataTestId:"".concat(o,"-value"),children:t})]})};let p=function(e){var r=e.orderType,t=e.symbol,i=e.orderId,a=e.symbolType,s=e.metadata,p=(0,f.$X)(),N=p===l.wS.CENTROID,h=(0,d.l7)(r),C=!N||N&&!h,g=(0,o.useMemo)(function(){var e=h?O.tM.MARKET_ORDER_NO:O.tM.PENDING_ORDER_NO;return(0,O.r9)(e,p)},[h,p]);return(0,n.jsxs)(I,{children:[(0,n.jsxs)(_,{children:[(0,n.jsx)(S,{typography:c.wZ.TEXT_L_MEDIUM,dataTestId:u.Of.EDIT_SYMBOL_VALUE,children:(0,T.g8)(t,a)}),C&&(0,n.jsx)(b,{"data-testid":u.Of.EDIT_ORDER_TYPE_VALUE,children:void 0!==r&&(0,n.jsx)(E.Z,{orderType:r})})]}),(0,n.jsxs)(_,{children:[(0,n.jsx)(P,{typography:c.wZ.TEXT_M_REGULAR,dataTestId:u.Of.EDIT_ORDER_ID_LABEL,children:g}),(0,n.jsx)(m,{typography:c.wZ.TEXT_M_REGULAR,dataTestId:u.Of.EDIT_ORDER_ID_VALUE,children:i})]}),(null==s?void 0:s.length)>0&&(0,n.jsx)(v,{children:s.map(function(e){var r=e.label,t=e.value,o=e.testID;return(0,n.jsx)(y,{label:r,value:t,testID:o},r)})})]})};var I=i.ZP.div.withConfig({componentId:"sc-59b112b8-0"})(["display:flex;flex-direction:column;row-gap:","px;padding-bottom:20px;border-bottom:1px solid ",";"],a.A.XXS,function(e){return e.theme.themeColors.border.default}),_=i.ZP.div.withConfig({componentId:"sc-59b112b8-1"})(["display:flex;flex-direction:row;column-gap:","px;"],a.A.M),S=(0,i.ZP)(s.ZP).withConfig({componentId:"sc-59b112b8-2"})(["flex:1;flex-grow:1;color:",";"],function(e){return e.theme.themeColors.text.strong}),P=(0,i.ZP)(s.ZP).withConfig({componentId:"sc-59b112b8-3"})(["flex:1;flex-grow:1;color:",";"],function(e){return e.theme.themeColors.text.subtle}),m=(0,i.ZP)(s.ZP).withConfig({componentId:"sc-59b112b8-4"})(["color:",";"],function(e){return e.theme.themeColors.text.subtle}),b=i.ZP.div.withConfig({componentId:"sc-59b112b8-5"})(["align-content:center;"]),v=i.ZP.div.withConfig({componentId:"sc-59b112b8-6"})(["display:grid;grid-template-columns:repeat(2,1fr);row-gap:","px;column-gap:","px;margin-top:","px;"],a.A.XS,a.A.M,a.A.M),N=i.ZP.div.withConfig({componentId:"sc-59b112b8-7"})(["display:flex;justify-content:space-between;"]),h=(0,i.ZP)(s.ZP).withConfig({componentId:"sc-59b112b8-8"})(["color:",";"],function(e){return e.theme.themeColors.text.subtle}),C=(0,i.ZP)(s.ZP).withConfig({componentId:"sc-59b112b8-9"})(["color:",";"],function(e){return e.theme.themeColors.text.default})},57475:function(e,r,t){"use strict";t.d(r,{B:()=>el}),t(41539),t(39714),t(92222);var n=t(74512),o=t(32735),i=t(10281),c=t(81182),a=t(82647),s=t(71225),l=t(45954),d=t(97186),u=t(88651),f=t(16689),T=t(8239
11),O=t(6807);t(42295),t(96752),t(36364),t(92274),t(75654),t(48868),t(54861);var E=t(99773),y=t(84823),p=t(48881),I=t(36333),_=t(479),S=t(19554),P=t(1403),m=t(3082),b=t(13266),v=t(48260),N=t(61856),h=t(37402),C=t(18699),g=t(16672),L=t(19367),x=t(92963),j=t(64989),R=t(3827),D=t(59395);function A(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function M(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(t=o.next()).done)&&(i.push(t.value),!r||i.length!==r);c=!0);}catch(e){a=!0,n=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return A(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w=y.Ry().shape({orderId:y.Z_(),symbol:y.Z_(),lotSize:(0,D.sT)(y.Z_()
1),fillPolicy:(0,D.Ke)(y.nK()),price:y.Z_().test("test-price",j.UF,function(e){return(0,j.FY)(e)}).when(["$orderTypeLabel","$priceLabel"],function(e,r){var t=M(e,2),n=t[0],o=t[1];return n!==C.Zk.MARKET_TO_LIMIT&&n!==C.Zk.MARKET?r.required((0,j.$A)({label:o||""})):r}),priceTrigger:y.Z_().test("test-price-trigger",j.UF,function(e){return(0,j.FY)(e)}).when(["$orderTypeLabel","$priceTriggerLabel"],function(e,r){var t=M(e,2),n=t[0],o=t[1];return n===C.Zk.STOP_LIMIT?r.required((0,j.$A)({label:o||""})):r}),stopLoss:y.Z_().test("test-stop-loss",j.UF,function(e){return(0,j.FY)(e)}).test("test-stop-loss-positive",function(){return _.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,D.wQ)(h.Qr.STOP_LOSS)),takeProfit:y.Z_().test("test-take-profit",j.UF,function(e){return(0,j.FY)(e)}).test("test-take-profit-positive",function(){return _.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,D.wQ)(h.Qr.TAKE_PROFIT)),expiration:y.hT().transform(j.mf).when(["fillPolicy","$expirationLabel"],function(e,r){var t=M(e,2),n=t[0],o=t[1];return n===p.T3.GTD?r.required((0,j.$A)({label:o||""})):r})}),U=function(e,r,t){return t?null==e?void 0:e.toFixed(r):void 0},K=function(e){var r=e.pendingOrder,t=e.stopLoss,n=e.takeProfit,i=e.price,c=e.priceTrigger,a=e.onSuccess,s=e.onError,l=e.allowSavingUnchangedValues,d=e.isConfirmationRequired,u=e.showTradeConfirmationModal,f=(0,P.jO)().isMT4,T=(0,P.$X)(),O=r||{},y=O.expiration,p=O.fillPolicy,_=O.lotSize,C=O.orderId,j=O.orderType,D=O.price,A=O.stopLoss,M=O.symbol,K=O.takeProfit,k=O.lotSizeStep,Z=O.minContractLotSize,G=O.decimal,F=O.tradeExpiry,z=O.priceTrigger,V=O.units,B=(0,S.Q9)(),Y=(0,b.MN)(),X=null!=Y?Y:{},Q=X.maxContractLotSize,$=X.contractSize,W=(0,h.zs)(j,Y),H=(0,R.h)(),q=(0,N.GM)().lotSizeMode,J=(0,o.useMemo)(function(){return v._.mapOrderTypeLabelFromOrderType(j)},[j]),ee=(0,o.useMemo)(function(){return(0,x.qn)(x.tV.PRICE,T)},[T]),er=(0,o.useMemo)(function(){return(0,x.qn)(x.tV.PRICE_TRIGGER,T)},[T]),et=(0,o.useMemo)(function(){return(0,x.qn)(x.tV.EXPIRATION,T)},[T]),en=y?m._.convertToDayjsWithOffset({input:y,baseFromOffset:!0}).toDate():void 0,eo=(0,o.useMemo)(function(){return(0,E.X)(w)},[]),ei=null!=c?c:z,ec=null!=i?i:D,ea=null!=t?t:A,es=null!=n?n:K,el=(0,L.cj)(j),ed=(0,I.w)({resolver:eo,mode:"onBlur",context:{orderTypeLabel:J,lotSizeStep:k,maxContractLotSize:Q,minContractLotSize:Z,contractSize:$,sizeLabel:H,lotSizeMode:q,isFillPolicyRequired:!f,priceLabel:ee,priceTriggerLabel:er,expirationLabel:et,buySellType:el},shouldFocusError:!1,defaultValues:{orderId:C,symbol:M,orderType:j,units:null==V?void 0:V.toString(),lotSize:null==_?void 0:_.toString(),fillPolicy:f?void 0:p,tradeExpiry:F,priceTrigger:U(ei,G,!!ei),price:U(ec,G,!!ec),stopLoss:U(ea,G,!!ea),takeProfit:U(es,G,!!es),expiration:en}}),eu=ed.handleSubmit,ef=ed.reset,eT=(0,o.useCallback)(function(e){var t,n=e.values,o=e.onEditModalCancel,i=(0,g.Gt)(A),c=(0,g.Gt)(K),f=(0,g.Gt)(D),T=(0,g.Gt)(z),O=n.lotSize?(0,g.Gt)(Number(n.lotSize)):void 0,E=(0,g.Gt)(Number(n.stopLoss)),y=(0,g.Gt)(Number(n.takeProfit)),p=(0,g.Gt)(Number(n.price)),I=(0,g.Gt)(Number(n.priceTrigger)),S=n.tradeExpiry!==F,P=(null==(t=n.expiration)?void 0:t.getTime())!==(null==en?void 0:en.getTime()),m=void 0!==O&&O!==_;if(!(E!==i||y!==c||m||S||P||p!==f||I!==T)&&!l){null==o||o();return}var b=function(){return v._.editPendingOrder({formData:n,pendingOrder:r,mixpanelProperties:{livePrice:W},onSuccess:function(){a(),null==o||o(),ef()},onError:s})};B&&!d?b():u({formValues:n,orderType:j,formMethods:ed,pendingOrder:r,symbolDetail:Y,onConfirm:function(e){null==e||e(),b()}})},[A,K,D,z,F,en,l,B,d,r,Y,W,s,a,ef,j,ed,_,u]);return{formMethods:ed,onSubmit:(0,o.useCallback)(function(e){var r=e.event,t=e.onEditModalCancel;eu(function(e){eT({values:e,onEditModalCancel:t})})(r)},[eu,eT])}},k=t(18551),Z=t(71028),G=t(57753),F=t(51015),z=t(56740),V=t(59440),B=t(58822),Y=t(70469),X=t(55869),Q=t(65528),$=t(26448),W=t(58118),H=t(31111),q=t(85029),J=t(62772),ee=t(6904),er=t(28085);function et(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function en(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
1))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}function eo(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ei(e){return function(e){if(Array.isArray(e))return et(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return et(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return et(e,r)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ec=function(e){var r=e.orderId,t=e.onCancel,i=e.stopLoss,s=e.takeProfit,u=e.entryPrices,f=e.skipConfirmation,E=void 0!==f&&f,y=(0,c.$G)().t,p=(0,F.ES)(r),I=(0,P.jO)(),_=I.isCentroid,S=I.isHorizon,m=(0,b.GG)(),N=(0,o.useRef)(p),h=(0,o.useRef)(!1);(0,o.useEffect)(function(){(null==p?void 0:p.symbol)&&(N.current=p)},[p]);var C=N.current||{},g=C.expiration,L=C.symbolType,x=C.orderType,j=C.symbol,R=(0,B.Kg)(),D=ea(N.current),A=es(e,N.current),M=A.formMethods,w=A.onSubmit,U=(0,o.useCallback)(function(e){w({onEditModalCancel:e.onCancel})},[w]);(0,o.useEffect)(function(){v._.setOrderTypeLabelFromOrderType(x)},[x]),(0,o.useEffect)(function(){return j&&V.N.initEditView(j),function(){V.N.resetEditView()}},[j]),(0,o.useEffect)(function(){E&&(void 0!==i||void 0!==s||void 0!==u)&&!h.current&&(h.current=!0,w({onEditModalCancel:t}))},[E,i,s,u,w,t]);var K=(0,o.useCallback)(function(){Z.q.page.actionClick({action:G.pW.EDIT_ORDER_MODAL_CANCEL_CLICKED,symbol:j}),null==t||t()},[t,j]);return E?(0,n.jsx)(T.q,{methods:M,pendingOrder:N.current,children:(0,n.jsx)(ed,{})}):(0,n.jsx)(T.q,{modalType:G.XV.EDIT_MODAL,methods:M,pendingOrder:N.current,children:(0,n.jsxs)(d.ZP,{variant:d.KH.CONFIRMATION,okText:y("Confirm"),okButtonDataTestId:O.Of.EDIT_BUTTON_ORDER,cancelText:y("Cancel"),cancelButtonDataTestId:O.Of.EDIT_BUTTON_CANCEL,onCancel:K,onOk:U,modalTitle:y("Edit Order"),loading:R,children:[(0,n.jsxs)(eu,{children:[(0,n.jsx)(er.Z,{orderType:x,symbol:j,orderId:r,symbolType:L,metadata:D}),(0,n.jsxs)(ef,{children:[_&&(0,n.jsx)(W.Z,{}),!_&&(0,n.jsx)(H.Z,{}),(0,n.jsx)(q.Z,{}),!S&&!_&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J.default,{}),(0,n.jsx)(ee.default,{})]}),!_&&(0,n.jsx)($.Z,{dropdownPlacement:a.s1.TOP_END,symbolMaturityDate:S?g:void 0,isInModal:!0,isEdit:!0})]})]}),m&&(0,n.jsx)(l.ZP,{absolute:!0})]})})},ea=function(e){var r=(0,c.$G)().t,t=(0,P.$X)(),n=(0,P.jO)(),i=n.isCentroid,a=n.isMT4,s=e||{},l=s.lotSize,d=s.units,u=s.fillPolicy;return(0,o.useMemo)(function(){return ei(i?[]:[{label:(0,x.r9)(x.tM.SIZE,t),value:null!=l?l:"--",testID:O.Of.EDIT_VOLUME},{label:r("Units"),value:d?(0,Y._)(d.toString()):"--",testID:O.Of.EDIT_UNITS}]).concat(ei(!a&&u?[{label:(0,x.r9)(x.tM.FILL_POLICY,t),value:(0,X.JE)(u),testID:O.Of.EDIT_FILL_POLICY}]:[]))},[u,t,i,a,l,r,d])}
1,es=function(e,r){var t=e.onCancel,n=e.skipConfirmation,i=e.stopLoss,a=e.takeProfit,s=e.entryPrices,l=(0,c.$G)().t,d=(0,P.Cl)(),u=(0,k.j)().getErrorSnackbarProps,T=K(eo(en({pendingOrder:r,stopLoss:i,takeProfit:a},(0,o.useCallback)(function(){return s&&0!==s.length?(null==s?void 0:s.length)===2?{priceTrigger:s[0],price:s[1]}:{price:s[0]}:{}},[s])()),{allowSavingUnchangedValues:n&&(void 0!==i||void 0!==a||void 0!==s),onSuccess:function(){d&&(0,f.ur)({message:l("Order has been updated."),messageType:z.KK.SUCCESS})},onError:function(e){var r=u(e),o=r.message,i=r.messageType;n&&(null==t||t()),(0,f.ur)({message:o,messageType:i,zIndex:1002})},showTradeConfirmationModal:Q.d}));return{onSubmit:T.onSubmit,formMethods:T.formMethods}};let el=function(e){var r=(e||{}).onCancel,t=function(e){null==r||r(),e()};(0,u.ZP)(function(r){return(0,n.jsx)(ec,eo(en({},e),{onCancel:function(){return t(r)}}))})};var ed=i.ZP.div.withConfig({componentId:"sc-79606235-0"})(["display:none;"]),eu=i.ZP.div.withConfig({componentId:"sc-79606235-1"})(["display:flex;flex-direction:column;width:488px;padding:","px ","px;padding-bottom:","px;box-sizing:border-box;"],s.A.XL,s.A.L,s.A.XXS),ef=i.ZP.div.withConfig({componentId:"sc-79606235-2"})(["display:flex;flex-direction:column;row-gap:","px;padding-top:","px;"],s.A.REGULAR,s.A.L)},76991:function(e,r,t){"use strict";t.d(r,{Z:()=>eE}),t(41539),t(39714);var n=t(74512),o=t(32735),i=t(10281),c=t(81182),a=t(71225),s=t(45954),l=t(97186),d=t(88651),u=t(16689),f=t(82391),T=t(6807);t(42295),t(96752),t(48868),t(54861),t(92274),t(75654);var O=t(99773),E=t(84823),y=t(82337),p=t(36333),I=t(479),_=t(19554),S=t(1403),P=t(13266),m=t(48260),b=t(61856),v=t(37402),N=t(18699),h=t(16672),C=t(30519),g=t(64989),L=t(3827),x=t(59395),j=E.Ry().shape({lotSize:(0,x.sT)(E.Z_()),fillPolicy:(0,x.Ke)(E.nK()),orderType:E.nK(),stopLoss:E.Z_().test("test-stop-loss",g.UF,function(e){return(0,g.FY)(e)}).test("test-stop-loss-positive",function(){return I.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,x.wQ)(v.Qr.STOP_LOSS)).test((0,x._o)(v.Qr.STOP_LOSS)),takeProfit:E.Z_().test("test-take-profit",g.UF,function(e){return(0,g.FY)(e)}).test("test-take-profit-positive",function(){return I.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,x.wQ)(v.Qr.TAKE_PROFIT)).test((0,x._o)(v.Qr.TAKE_PROFIT))}),R=function(e){var r,t,n=e.marketOrder,i=e.stopLoss,c=e.takeProfit,a=e.allowSavingUnchangedValues,s=e.isConfirmationRequired,l=e.onError,d=e.onSuccess,u=e.showTradeConfirmationModal,f=n||{},T=f.orderType,O=f.stopLoss,E=f.takeProfit,y=(0,_.Q9)(),p=(0,P.MN)(),I=(0,v.zs)(T,p),S=D((r=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},n),t=t={stopLoss:null!=i?i:n.stopLoss,takeProfit:null!=c?c:n.takeProfit},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r)),b=S.handleSubmit,N=S.reset,C=(0,o.useCallback)(function(e){var r=e.values,t=e.onEditModalCancel,o=(0,h.Gt)(O),i=(0,h.Gt)(E),c=(0,h.Gt)(Number(r.stopLoss)),f=(0,h.Gt)(Number(r.takeProfit));if(o===c&&i===f&&!0!==a){null==t||t();return}var _=function(){return m._.editMarketOrder({formData:r,order:n,mixpanelProperties:{livePrice:I},onSuccess:function(){d(),null==t||t(),N()},onError:l})};y&&!s?_():u({formValues:r,orderType:T,formMethods:S,marketOrder:n,symbolDetail:p,isCopyTradeOrder:!!n.copyTradeInfo,onConfirm:function(e){null==e||e(),_()}})},[O,E,y,T,S,I,a,s,n,p,l,d,N,u]),g=(0,o.useCallback)(function(e){var r=e.event,t=e.onEditModalCancel;b(function(e){C({values:e,onEditModalCancel:t})},function(){var e=S.getValues(),r=(0,h.Gt)(O),n=(0,h.Gt)(E);r===(0,h.Gt)(Number(e.stopLoss))&&n===(0,h.Gt)(Number(e.takeProfit))&&!0!==a&&(null==t||t())})(r)},[b,C,S,O,E,a]);return{formMethods:S,onSubmit:g}},D=function(e){var r,t,n=(0,S.jO)(),i=n.isMT4,c=n.isCentroid,a=e||{},s=a.expiration,l=a.fillPolicy,d=a.orderId,u=a.orderType,f=a.stopLoss,T=a.symbol,E=a.takeProfit,_=a.minContractLotSize,m=(0,h.vh)(e,["decimal","lotSize","lotSizeStep","contractSize","units"]),v=m.contractSize,g=m.decimal,R=m.lotSize,D=m.lotSizeStep,A=m.units,M=(0,P.MN)(),w=null!=M?M:{},U=w.maxContractLotSize,K=w.bid,k=w.ask,Z=(0,L.h)(),G=(0,b.GM)().lotSizeMode,F=(0,o.useMemo)(function(){return(0,O.X)(j)},[]),z=!!e.copyTradeInfo,V=(0,x.jB)({orderType:u,lotSize:R}),B=V===N.B9.BUY?K:k;return(0,p.w)({resolver:F,mode:"all",context:{lotSizeStep:D,maxContractLotSize:U,minContractLotSize:_,contractSize:v,sizeLabel:Z,lotSizeMode:G,isFillPolicyRequired:!i,isCopyTrade:z,entryPrice:B,isCentroid:c,buySellType:V,priceLabel:V===N.B9.BUY?I.ag.t("Sell Price"):I.ag.t("Buy Price")},shouldFocusError:!1,defaultValues:{orderId:d,orderType:u,symbol
1:T,fillPolicy:l,units:null==A?void 0:A.toString(),lotSize:null==R?void 0:R.toString(),stopLoss:f?null==(r=(0,C.r)(f,g))?void 0:r.toString():void 0,takeProfit:E?null==(t=(0,C.r)(E,g))?void 0:t.toString():void 0,expiration:s?(0,y.GN)({input:s}).toDate():void 0}})},A=t(18551),M=t(71028),w=t(57753),U=t(51015),K=t(59440),k=t(74370),Z=t(58822),G=t(33481),F=t(70469),z=t(92963),V=t(55869),B=t(65528),Y=t(28085),X=t(31111);t(88674);var Q=(0,o.lazy)(function(){return t.e("7612").then(t.bind(t,14879))}),$=(0,o.lazy)(function(){return Promise.resolve().then(t.bind(t,62772))});let W=function(){var e=(0,S._9)(),r=(0,S.jO)().isHorizon;return e?null:(0,n.jsx)(o.Suspense,{children:r?(0,n.jsx)(Q,{}):(0,n.jsx)($,{})})};var H=(0,o.lazy)(function(){return t.e("5877").then(t.bind(t,82911))}),q=(0,o.lazy)(function(){return Promise.resolve().then(t.bind(t,6904))});let J=function(){var e=(0,S._9)(),r=(0,S.jO)().isHorizon;return e?null:(0,n.jsx)(o.Suspense,{children:r?(0,n.jsx)(H,{}):(0,n.jsx)(q,{})})};t(56977);var ee=t(66698),er=t(18354),et=t(62715),en=t(18909),eo=t(38074);let ei=function(e){var r=e.decimal,t=(0,c.$G)().t,o=(0,f.g)(),i=o.formState,a=o.watch,s=o.setValue,l=a("stopLoss"),d=i.errors.stopLoss;return(0,n.jsxs)(ec,{children:[(0,n.jsx)(ea,{children:(0,n.jsx)(eo.ZP,{typography:et.wZ.TEXT_M_MEDIUM,children:t("Stop Loss")})}),(0,n.jsx)(er.ZP,{variant:er.vI.ITEM_WITH_FIELD_LABEL,label:t("Price"),children:(0,n.jsx)(en.ZP,{variant:en.Bv.BORDERED_NUMERIC,placeholder:"$",value:l,error:null==d?void 0:d.message,onChange:function(e){s("stopLoss",e.target.value,{shouldValidate:!0,shouldDirty:!0})},onBlur:function(){if(l&&""!==l){var e=new ee.BigNumber(l);e.isFinite()&&e.gt(0)&&s("stopLoss",e.toFixed(r),{shouldValidate:!0,shouldDirty:!0})}}})})]})};var ec=i.ZP.div.withConfig({componentId:"sc-ddae0c33-0"})(["display:flex;flex-direction:column;margin-top:","px;"],a.A.XS),ea=i.ZP.div.withConfig({componentId:"sc-ddae0c33-1"})(["margin-bottom:","px;"],a.A.REGULAR);let es=function(e){var r=e.decimal,t=(0,c.$G)().t,o=(0,f.g)(),i=o.formState,a=o.watch,s=o.setValue,l=a("takeProfit"),d=i.errors.takeProfit;return(0,n.jsxs)(el,{children:[(0,n.jsx)(ed,{children:(0,n.jsx)(eo.ZP,{typography:et.wZ.TEXT_M_MEDIUM,children:t("Take Profit")})}),(0,n.jsx)(er.ZP,{variant:er.vI.ITEM_WITH_FIELD_LABEL,label:t("Price"),children:(0,n.jsx)(en.ZP,{variant:en.Bv.BORDERED_NUMERIC,placeholder:"$",value:l,error:null==d?void 0:d.message,onChange:function(e){s("takeProfit",e.target.value,{shouldValidate:!0,shouldDirty:!0})},onBlur:function(){if(l&&""!==l){var e=new ee.BigNumber(l);e.isFinite()&&e.gt(0)&&s("takeProfit",e.toFixed(r),{shouldValidate:!0,shouldDirty:!0})}}})})]})};var el=i.ZP.div.withConfig({componentId:"sc-dbd9ab35-0"})(["display:flex;flex-direction:column;margin-top:","px;"],a.A.XS),ed=i.ZP.div.withConfig({componentId:"sc-dbd9ab35-1"})(["margin-bottom:","px;"],a.A.REGULAR),eu=i.ZP.div.withConfig({componentId:"sc-f6eac929-0"})(["display:flex;flex-direction:column;row-gap:","px;padding-top:","px;"],a.A.REGULAR,a.A.L);let ef=function(e){var r=e.decimal,t=(0,S.jO)().isCentroid,o=(0,f.g)().isEditing,i=((0,P.LH)(o,["symbol"])||{}).symbol;return(0,n.jsx)(eu,{children:i?(0,n.jsxs)(n.Fragment,{children:[!t&&(0,n.jsx)(X.Z,{}),(0,n.jsx)(W,{}),(0,n.jsx)(J,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ei,{decimal:r}),(0,n.jsx)(es,{decimal:r})]})})};var eT=function(e){var r,t=e.orderId,i=e.onCancel,a=e.stopLoss,d=e.takeProfit,O=e.skipConfirmation,E=void 0!==O&&O,y=(0,c.$G)().t,p=(0,U.Zb)(t),I=(0,S.Cl)(),_=(0,A.j)().getErrorSnackbarProps,b=(0,P.GG)(),v=(0,Z.Kg)(),N=(0,o.useRef)(p),h=(0,o.useRef)(!1);(0,o.useEffect)(function(){(null==p?void 0:p.symbol)&&(N.current=p)},[p]);var C=N.current||{},g=C.symbolType,L=C.orderType,x=C.symbol,j=eO(N.current),D=R({marketOrder:N.current,stopLoss:a,takeProfit:d,allowSavingUnchangedValues:E&&(void 0!==a||void 0!==d),onSuccess:function(){I&&(0,u.ur)({message:y("Position has been updated."),messageType:u.KK.SUCCESS})},onError:function(e){var r=_(e),n=r.message,o=r.messageType;E&&(k._.revertEditTrackOrderPrice({orderId:t,isPendingOrder:!1}
1),null==i||i()),(0,u.ur)({message:n,messageType:o,zIndex:1002})},showTradeConfirmationModal:B.d}),G=D.onSubmit,F=D.formMethods,z=(0,o.useCallback)(function(e){G({onEditModalCancel:e.onCancel})},[G]);(0,o.useEffect)(function(){m._.setOrderTypeLabelFromOrderType(L)},[L]),(0,o.useEffect)(function(){return x&&K.N.initEditView(x),function(){K.N.resetEditView()}},[x]),(0,o.useEffect)(function(){E&&(void 0!==a||void 0!==d)&&!h.current&&(h.current=!0,G({onEditModalCancel:i}))},[E,a,d,G,i]);var V=(0,o.useCallback)(function(){M.q.page.actionClick({action:w.pW.EDIT_ORDER_MODAL_CANCEL_CLICKED,symbol:x}),null==i||i()},[i,x]);return E?(0,n.jsx)(f.q,{methods:F,marketOrder:N.current,children:(0,n.jsx)(ey,{})}):(0,n.jsx)(f.q,{modalType:w.XV.EDIT_MODAL,methods:F,marketOrder:N.current,children:(0,n.jsxs)(l.ZP,{variant:l.KH.CONFIRMATION,okText:(null==p?void 0:p.copyTradeInfo)?y("Update Order"):y("Update Position"),okButtonDataTestId:T.Of.EDIT_BUTTON_ORDER,cancelText:y("Cancel"),cancelButtonDataTestId:T.Of.EDIT_BUTTON_CANCEL,onCancel:V,onOk:z,modalTitle:(null==p?void 0:p.copyTradeInfo)?y("Edit Copy Trade Order"):y("Edit Position"),loading:v,dataTestId:T.Of.EDIT_CONFIRMATION_MODAL,children:[(0,n.jsxs)(ep,{children:[(0,n.jsx)(Y.Z,{orderType:L,symbol:x,orderId:t,symbolType:g,metadata:j}),(0,n.jsx)(ef,{decimal:null==(r=N.current)?void 0:r.decimal})]}),b&&(0,n.jsx)(s.ZP,{absolute:!0})]})})},eO=function(e){var r=(0,c.$G)().t,t=(0,Z.XT)(),n=(0,S.$X)(),i=(0,S.jO)(),a=i.isCentroid,s=i.isMT4,l=e||{},d=l.notional,u=l.openPrice,f=l.units,O=l.lotSize,E=l.decimal,y=l.fillPolicy;return(0,o.useMemo)(function(){var e,o,i=[{label:t===N.Zk.MARKET?(0,z.r9)(z.tM.ENTRY_PRICE,n):r("Price"),value:(0,G.Wi)(u,E),testID:T.Of.EDIT_ENTRY_PRICE},{label:a?r("Net Volume"):(0,z.r9)(z.tM.SIZE,n),value:null!=O?O:"-",testID:T.Of.EDIT_VOLUME}];return a&&d?i.push({label:r("Notional"),value:(0,G.Wi)(d,E),testID:T.Of.EDIT_UNITS}):a||i.push({label:r("Units"),value:(0,F._)(null!=(o=null==f||null==(e=f.toString)?void 0:e.call(f))?o:""),testID:T.Of.EDIT_UNITS}),!s&&y&&i.push({label:(0,z.r9)(z.tM.FILL_POLICY,n),value:(0,V.JE)(y),testID:T.Of.EDIT_FILL_POLICY}),i},[t,n,r,d,u,E,O,f,a,s,y])};let eE=function(e){var r=(e||{}).onCancel,t=function(e){null==r||r(),e()};(0,d.ZP)(function(r){var o,i;return(0,n.jsx)(eT,(o=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},e),i=i={onCancel:function(){return t(r)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})};var ey=i.ZP.div.withConfig({componentId:"sc-b74ed286-0"})(["display:none;"]),ep=i.ZP.div.withConfig({componentId:"sc-b74ed286-1"})(["display:flex;flex-direction:column;width:488px;padding:","px ","px;padding-bottom:","px;box-sizing:border-box;"],a.A.XL,a.A.L,a.A.XXS)},4638:function(e,r,t){"use strict";t.d(r,{wD:()=>Q,iu:()=>ec,Y1:()=>es,Hp:()=>en,yQ:()=>J,Jr:()=>W,Sg:()=>ei,Io:()=>ee,K3:()=>ed,vM:()=>H,DF:()=>et,Dc:()=>q}),t(9653),t(35192);var n=t(74512),o=t(10281),i=t(62715),c=t(63450),a=t(38074),s=t(86653),l=t(6807),d=t(32972),u=t(95986),f=t(3082),T=t
1(31305),O=t(19367),E=t(33481),y=t(63913),p=t(88399),I=t(96838),_=t(80199);t(92222);var S=o.ZP.div.withConfig({componentId:"sc-c49bc9b4-0"})(["cursor:pointer;min-height:30px;display:flex;align-items:center;justify-content:center;"]),P=(0,o.ZP)(I.ZP).withConfig({componentId:"sc-c49bc9b4-1"})(["cursor:pointer;display:flex;justify-content:center;& svg{","}"],function(e){var r=e.$isActive,t=e.theme;return r?"color: ".concat(t.themeColors.icon.active,";"):""});function m(e){var r,t=e.cell,o=e.disabled,i=e.dataTestId,c=e.onClick,a=(0,T.Q8)(null!=(r=t.row.original.orderId)?r:"",T.K2.DELETE);return(0,n.jsx)(S,{className:a?"button-activated":"",onClick:function(){o||null==c||c(t.row.original)},children:(0,n.jsx)(P,{variant:I.eF.ICON_ONLY,icon:_.Ro.BULK_CLOSE_DELETE,disabled:o,dataTestId:i,$isActive:a})})}function b(e){var r,t=e.cell,o=e.disabled,i=e.dataTestId,c=e.onClick,a=(0,T.Q8)(null!=(r=t.row.original.orderId)?r:"",T.K2.EDIT);return(0,n.jsx)(S,{className:a?"button-activated":"",onClick:function(){o||null==c||c(t.row.original)},children:(0,n.jsx)(P,{variant:I.eF.ICON_ONLY,icon:_.Ro.EDIT,disabled:o,dataTestId:i,$isActive:a})})}t(41539);var v=t(32735),N=t(6454);function h(e){var r=e.cell,t=e.disabled,o=e.dataTestId,i=e.onClick,c=(0,N.bp)(),a=(0,v.useMemo)(function(){return c.some(function(e){return e.orderId===r.row.original.orderId})},[c,r.row.original.orderId]);return(0,n.jsx)(S,{className:a?"button-activated":"",onClick:function(){t||null==i||i(r.row.original)},children:(0,n.jsx)(P,{variant:I.eF.ICON_ONLY,icon:_.Ro.TRACK_ORDER,disabled:t,dataTestId:o,$isActive:a})})}function C(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}function g(e){var r=e.type,t=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,["type"]);return r===T.K2.TRACK?(0,n.jsx)(h,C({},t)):r===T.K2.CLOSE||r===T.K2.DELETE?(0,n.jsx)(m,C({},t)):r===T.K2.EDIT?(0,n.jsx)(b,C({},t)):null}t(88674);var L=t(1403);function x(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}var j=(0,v.lazy)(function(){return t.e("4240").then(t.bind(t,61882))}),R=(0,v.lazy)(function(){return t.e("759").then(t.bind(t,6091))}),D=(0,v.lazy)(function(){return t.e("7622").then(t.bind(t,4837))});let A=function(e){var r=(0,L.jO)(),t=r.isHorizon,o=r.isCentroid,i=(0,L._9)(),c=(0,v.useMemo)(function(){return o?(0,n.jsx)(D,x({},e)):t?(0,n.jsx)(j,x({},e)):(0,n.jsx)(R,x({},e))},[o,t,e]);return i?null:(0,n.jsx)(v.Suspense,{children:c})};var M=t(17609);let w=function(e){var r=e.order,t=e.dataTestId,o=(0,L.jO)().isCentroid,i=(0,M.MO)(["leverage"]).leverage,c=(0,v.useMemo)(function(){return(0,O.XC)(r,o,i)},[r,o,i]);return(0,n.jsx)(a.ZP,{dataTestId:t,children:(0,E.Wi)(c,2,!0)})};var U=t(51015);let K=function(e){var r=e.symbol,t=e.dataTestId,o=(0,U.Zb)(r).marketValue;return(0,n.jsx)(a.ZP,{dataTestId:t,children:(0,E.Wi)(Number(o),2)})};function k(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
1))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}var Z=(0,v.lazy)(function(){return t.e("7655").then(t.bind(t,70239))}),G=(0,v.lazy)(function(){return t.e("8540").then(t.bind(t,13065))}),F=(0,v.lazy)(function(){return t.e("8034").then(t.bind(t,61706))});let z=function(e){var r=e.isStatic,t=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,["isStatic"]),o=(0,L.jO)().isHorizon;return(0,n.jsx)(v.Suspense,{children:o?(0,n.jsx)(F,k({},t)):(0,n.jsx)(n.Fragment,{children:r?(0,n.jsx)(Z,k({},t)):(0,n.jsx)(G,k({},t))})})};function V(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}var B=(0,v.lazy)(function(){return t.e("2153").then(t.bind(t,69370))}),Y=(0,v.lazy)(function(){return t.e("5786").then(t.bind(t,63404))});let X=function(e){var r=(0,L.jO)().isHorizon;return(0,n.jsx)(v.Suspense,{children:r?(0,n.jsx)(B,V({},e)):(0,n.jsx)(Y,V({},e))})};function Q(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,c=e.formatter,s=e.cellTestId;return{accessorKey:r,size:o,sortDescFirst:void 0!==i&&i,meta:e.meta,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=e.getValue(),o=null==(r=e.row)?void 0:r.original;return"function"==typeof c&&("number"==typeof t||"string"==typeof t)&&(t=c(t,o)),(0,n.jsx)(a.ZP,{dataTestId:s,children:null!=t?t:"--"})}}}var $=o.ZP.div.withConfig({componentId:"sc-32cbe7b9-0"})(["width:fit-content;"]);function W(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,s=e.formatter,l=e.getVariant,d=e.cellTestId;return{accessorKey:r,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=e.getValue(),o=null==(r=e.row)?void 0:r.original;return t?(0,n.jsx)($,{children:(0,n.jsx)(c.ZP,{dataTestId:d,variant:l(t),children:null==s?void 0:s(t,o)})}):(0,n.jsx)(a.ZP,{children:"--"})}}}function H(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,c=e.cellTestId;return{accessorKey:r,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=Number(e.getValue());return Number.isFinite(t)&&(r=(0,E.Wi)(t,(0,d.N)(t))),(0,n.jsx)(a.ZP,{dataTestId:c,children:null!=r?r:"--"})}}}function q(e){var r=e.accessorKey,t=e.headerText,o=e.size,c=e.sortDescFirst,s=e.cellTestId;return{accessorKey:r,size:o,sortDescFirst:void 0!==c&&c,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t,o=e.getValue(),c=null==(t=e.row)||null==(r=t.original)?void 0:r.symbolType,a=c?(0,y.g8)(o,c):o;return(0,n.jsx)(eu,{typography:i.wZ.TEXT_M_REGULAR,dataTestId:s,children:a||"--"})}}}function J(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,c=e.cellTestId;return{accessorKey:r,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t,o,i,s,l,d,u=e.getValue(),f=(null==(t=e.row)||null==(r=t.original)?void 0:r.tickRulesGroup)||[],T=null!=(d=null==(i=e.row)||null==(o=i.original)?void 0:o.decimal)?d:null==(l=e.row.getParentRow())||null==(s=l.original)?void 0:s.decimal;return(0,n.jsx)(a.ZP,{dataTestId:c,children:(0,E.Wi)(u,(0,E.os)(u,f,T),!0)})}}}function ee(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.columnPreferenceOrderType,c=e.cellTestId;return{accessorKey:r,id:"lastPrice",size:o,enableSorting:!1,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=null==(r=e.row)?void 0:r.original;if(!(null==t?void 0:t.symbol))return(0,n.jsx)(a.ZP,{dataTestId:c,children:"--"});if(t.copyTradeInfo){var o=e.getValue();return(0,n.jsx)(a.ZP,{dataTestId:c,children:(0,E.Wi)(o,t.decimal)})}return(0,n.jsx)(A,{order:t,columnPreferenceOrderType:i,dataTestId:c})}}}var er=function(e,r,t){return(Number(e.getValue(t))||0)-(Number(r.getValue(t))||0)};function et(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,c=e.isStatic,s=void 0===c||c,l=e.cellTestId;return{accessorKey:r,id:"pnlGross",size:o,sortDescFirst:void 0!==i&&i,sortingFn:er,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=null==(r=e.row)?void 0:r.original;
1return(0,n.jsx)(z,{dataTestId:l,symbol:t.symbol,order:t,isStatic:s})}}}function en(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.cellTestId;return{accessorKey:r,id:"roi",size:o,enableSorting:!1,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=null==(r=e.row)?void 0:r.original;return(0,n.jsx)(X,{dataTestId:i,order:t})}}}var eo=function(e,r){var t=e.original,n=r.original,o=u.k.getAccountLeverage(),i=f._.getCompanyIntegration()===s.wS.CENTROID;return(0,O.XC)(t,i,o)-(0,O.XC)(n,i,o)};function ei(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,c=e.cellTestId;return{accessorKey:r,id:"marginUsed",size:o,sortDescFirst:void 0!==i&&i,sortingFn:eo,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r,t=null==(r=e.row)?void 0:r.original;return(0,n.jsx)(w,{dataTestId:c,order:t})}}}function ec(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.cellTestId;return{accessorKey:r,id:"marketValue",size:o,enableSorting:!1,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r=e.getValue();return(0,n.jsx)(K,{dataTestId:i,symbol:r})}}}var ea=function(e,r,t){return(0,O.Lx)(e.getValue(t)).localeCompare((0,O.Lx)(r.getValue(t)))};function es(e){var r=e.accessorKey,t=e.headerText,o=e.size,i=e.sortDescFirst,c=e.cellTestId;return{accessorKey:r,size:o,sortDescFirst:void 0!==i&&i,sortingFn:ea,header:function(){return(0,n.jsx)(a.ZP,{children:t})},cell:function(e){var r=e.getValue();return(0,n.jsx)(a.ZP,{children:(0,n.jsx)(p.Z,{orderType:r,dataTestId:c})})}}}var el=function(e,r){var t,n,o,i,c,a,s,d;switch(e){case T.K2.CLOSE:case T.K2.DELETE:return{isEnable:null==r||null==(n=r.row)||null==(t=n.original)?void 0:t.closable,testId:l.Of.ASSET_OPEN_BUTTON_CLOSE};case T.K2.EDIT:return{isEnable:null==r||null==(i=r.row)||null==(o=i.original)?void 0:o.editable,testId:l.Of.ASSET_OPEN_BUTTON_EDIT};case T.K2.TRACK:return{isEnable:(null==r||null==(a=r.row)||null==(c=a.original)?void 0:c.trackable)&&!(null==r||null==(d=r.row)||null==(s=d.original)?void 0:s.copyTradeInfo),testId:l.Of.ASSET_OPEN_BUTTON_TRACK};default:return{isEnable:!1,testId:void 0}}};function ed(e){var r=e.id,t=e.accessorKey,o=e.headerText,i=e.actionButtonType,c=e.size,a=e.onClick,s=e.headerAlignment,l=void 0===s?"left":s,d=e.disabled;return{id:r,accessorKey:t,size:c,enableSorting:!1,header:function(){return(0,n.jsx)(ef,{$alignment:l,children:o})},cell:function(e){var r=el(i,e),t=r.isEnable,o=r.testId;return(0,n.jsx)(g,{type:i,cell:e,onClick:function(){return null==a?void 0:a(e.row.original)},disabled:d||!t,dataTestId:o})},meta:{styles:{padding:"inherit"}},accessorFn:function(e){return e.orderId}}}var eu=(0,o.ZP)(a.ZP).attrs({variant:a.fD.TRUNCATED}).withConfig({componentId:"sc-32cbe7b9-1"})(["color:",";"],function(e){return e.theme.themeColors.text.strong}),ef=(0,o.ZP)(a.ZP).withConfig({componentId:"sc-32cbe7b9-2"})(["display:flex;width:100%;justify-content:",";"],function(e){switch(e.$alignment){case"center":return"center";case"right":return"flex-end";default:return"flex-start"}})},30216:function(e,r,t){"use strict";t.d(r,{w:()=>ei,b:()=>el}),t(41539),t(57327),t(21249),t(26833);var n=t(32735),o=t(81182),i=t(11750),c=t(16689),a=t(86653),s=t(43545),l=t(907),d=t(479),u=t(30418),f=t(20787),T=t(17609),O=t(1403),E=t(71028),y=t(57753),p=t(41174),I=t(78562),_=t(37528),S=t(56740),P=t(31305),m=t(74370),b=t(48260),v=t(19367),N=t(92963);t(66992),t(33948);var h=t(74512),C=t(10281),g=t(62715),L=t(71225),x=t(97186),j=t(88651),R=t(38074),D=t(73407),A=t(38416),M=t(63913),w=function(e){var r=e.orderId,t=e.values,c=e.onCancel,a=(0,o.$G)().t,d=(0,i.s0)(),u=t.copierId,f=t.copiedSignalId,T=t.symbol,E=t.symbolType,y=(0,A.iw)(),I=(0,O.$X)(),_=(0,n.useCallback)(function(){A.bD.closeCopyTradeOrder({values:{copierId:u,copiedSignalId:f},onSuccess:function(){null==c||c()},onError:function(e){switch(e){case D.c4.PW_1005:p.$.onOrderSelectedTabChanged(s.ZV.COPY_TRADE_PROFILE);break;case D.c4.PW_1003:d(l.oI.COPY_TRADE)}null==c||c()}})},[u,f,c,d]);return(0,h.jsx)(x.ZP,{variant:x.KH.CONFIRMATION,modalTitle:a("Confirm Close Copy Trade Position"),okText:a("Confirm"),onOk:_,cancelText:a("Cancel"),onCancel:c,loading:y,children:(0,h.jsxs)(U,{children:[(0,h.jsx)(k,{typography:g.wZ.TEXT_L_MEDIUM,children:(0,M.g8)(T,E)}),r&&(0,h.jsxs)(K,{children:[(0,h.jsx)(Z,{typography:g.wZ.TEXT_M_REGULAR,children:(0,N.r9)(N.tM.MARKET_ORDER_NO,I)}),(0,h.jsx)(G,{typography:g.wZ.TEXT_M_REGULAR,children:r})]})]})})},U=C.ZP.div.withConfig({componentId:"sc-ce057d1c-0"})(["width:100%;box-sizing:border-box;display:flex;flex-direction:column;padding:","px ","px ","px;gap:","px;"],L.A.L,L.A.L,L.A.XXS,L.A.XXS),K=C.ZP.div.withConfig({componentId:"sc-ce057d1c-1"})(["display:flex;flex-direction:row;justify-content:space-between;"]),k=(0,C.ZP)(R.ZP).withConfig({componentId:"sc-ce057d1c-2"})(["flex:1;color:",";"],function(e){return e.theme.themeColors.text.strong}),Z=(0,C.ZP)(R.ZP).withConfig({componentId:"sc-ce057d1c-3"})(["color:",";"],function(e){return e.theme.themeColors.text.strong}),G=(0,C.ZP)(R.ZP).withConfig({componentId:"sc-ce057d1c-4"})(["color:",";"],function(e){return e.theme.themeColors.text.strong});let F=function(e){var r=(e||{}).onCancel,t=function(e){null==r||r(),e()};(0,j.ZP)(function(r){var n,o;return(0,h.jsx)(w,(n=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
1))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},e),o=o={onCancel:function(){return t(r)}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))})};var z=t(82100),V=t(76991),B=t(4638),Y=t(99684);t(9653);var X=t(6807),Q=t(82337),$=t(3082),W=t(33481);function H(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var q=function(e){var r;return H(r={},s.j7.OPEN_TIME,(0,B.wD)({cellTestId:X.Of.ASSET_OPEN_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Open Date"),size:160,formatter:function(e){return $._.convertToDayjsWithOffset({input:Number(e)}).format(Q.ju)}})),H(r,s.j7.ORDER_NO,(0,B.wD)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order No.")})),H(r,s.j7.SYMBOL,(0,B.Dc)({cellTestId:X.Of.ASSET_OPEN_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),r},J=function(e){var r;return H(r={},s.j7.TYPE,(0,B.Y1)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Type")})),H(r,s.j7.PROFIT_LOSS,(0,B.DF)({cellTestId:X.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"profit",headerText:e("Profit/Loss"),isStatic:!1})),H(r,s.j7.ROI_PERCENT,(0,B.Hp)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"profit",headerText:e("ROI%")})),H(r,s.j7.VOLUME,(0,B.vM)({accessorKey:"lotSize",headerText:e("Volume"),cellTestId:X.Of.ASSET_OPEN_COLUMN_VOLUME})),H(r,s.j7.UNITS,(0,B.vM)({accessorKey:"units",headerText:e("Units"),cellTestId:X.Of.ASSET_OPEN_COLUMN_UNITS})),H(r,s.j7.MARGIN_USED,(0,B.Sg)({accessorKey:"marginRate",headerText:e("Margin Used"),cellTestId:X.Of.ASSET_OPEN_COLUMN_MARGIN_USED})),H(r,s.j7.ENTRY_PRICE,(0,B.yQ)({accessorKey:"openPrice",headerText:e("Entry Price"),cellTestId:X.Of.ASSET_OPEN_COLUMN_ENTRY_PRICE})),H(r,s.j7.CURRENT_PRICE,(0,B.Io)({accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:s.ZV.OPEN_POSITION,cellTestId:X.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE})),H(r,s.j7.TAKE_PROFIT,(0,B.yQ)({accessorKey:"takeProfit",headerText:e("Take Profit"),cellTestId:X.Of.ASSET_OPEN_COLUMN_TAKE_PROFIT})),H(r,s.j7.STOP_LOSS,(0,B.yQ)({accessorKey:"stopLoss",headerText:e("Stop Loss"),cellTestId:X.Of.ASSET_OPEN_COLUMN_STOP_LOSS})),H(r,s.j7.SWAP,(0,B.wD)({accessorKey:"swap",headerText:e("Swap"),formatter:function(e){return(0,W.Wi)(Number(e),2)},cellTestId:X.Of.ASSET_OPEN_COLUMN_SWAP})),H(r,s.j7.COMMENT,(0,B.wD)({accessorKey:"comment",headerText:e("Comment"),cellTestId:X.Of.ASSET_OPEN_COLUMN_COMMENT})),r},ee=function(e){var r;return H(r={},s.j7.TYPE,(0,B.Y1)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Type")})),H(r,s.j7.PROFIT_LOSS,(0,B.DF)({cellTestId:X.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"profit",headerText:e("Profit/Loss"),isStatic:!1})),H(r,s.j7.ROI_PERCENT,(0,B.Hp)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"profit",headerText:e("ROI%")})),H(r,s.j7.SIZE,(0,B.vM)({accessorKey:"lotSize",headerText:e("Size"),cellTestId:X.Of.ASSET_OPEN_COLUMN_VOLUME})),H(r,s.j7.UNITS,(0,B.vM)({accessorKey:"units",headerText:e("Units"),cellTestId:X.Of.ASSET_OPEN_COLUMN_UNITS})),H(r,s.j7.MARGIN_USED,(0,B.Sg)({accessorKey:"marginRate",headerText:e("Margin Used"),cellTestId:X.Of.ASSET_OPEN_COLUMN_MARGIN_USED})),H(r,s.j7.ENTRY_PRICE,(0,B.yQ)({accessorKey:"openPrice",headerText:e("Entry Price"),cellTestId:X.Of.ASSET_OPEN_COLUMN_ENTRY_PRICE})),H(r,s.j7.CURRENT_PRICE,(0,B.Io)({accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:s.ZV.OPEN_POSITION,cellTestId:X.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE})),H(r,s.j7.TAKE_PROFIT,(0,B.yQ)({accessorKey:"takeProfit",headerText:e("Take Profit"),cellTestId:X.Of.ASSET_OPEN_COLUMN_TAKE_PROFIT})),H(r,s.j7.STOP_LOSS,(0,B.yQ)({accessorKey:"stopLoss",headerText:e("Stop Loss"),cellTestId:X.Of.ASSET_OPEN_COLUMN_STOP_LOSS})),H(r,s.j7.SWAP,(0,B.wD)({accessorKey:"swap",headerText:e("Swap"),formatter:function(e){return(0,W.Wi)(Number(e),2)},cellTestId:X.Of.ASSET_OPEN_COLUMN_SWAP})),H(r,s.j7.COMMISSION,(0,B.yQ)({accessorKey:"commission",headerText:e("Commission"),
1cellTestId:X.Of.ASSET_OPEN_COLUMN_COMMISSION})),H(r,s.j7.COMMENT,(0,B.wD)({accessorKey:"comment",headerText:e("Comment"),cellTestId:X.Of.ASSET_OPEN_COLUMN_COMMENT})),r},er=function(e){var r;return H(r={},s.j7.ORDER_NO,(0,B.wD)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Position ID")})),H(r,s.j7.SYMBOL,(0,B.Dc)({cellTestId:X.Of.ASSET_OPEN_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),H(r,s.j7.VOLUME,(0,B.vM)({accessorKey:"lotSize",headerText:e("Net Volume"),cellTestId:X.Of.ASSET_OPEN_COLUMN_VOLUME})),r},et=function(e){var r;return H(r={},s.j7.MARGIN_USED,(0,B.Sg)({accessorKey:"marginRate",headerText:e("Margin Used"),cellTestId:X.Of.ASSET_OPEN_COLUMN_MARGIN_USED})),H(r,s.j7.PROFIT_LOSS,(0,B.DF)({cellTestId:X.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"profit",headerText:e("Profit/Loss"),isStatic:!1})),H(r,s.j7.ROI_PERCENT,(0,B.Hp)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"profit",headerText:e("ROI%")})),H(r,s.j7.ENTRY_PRICE,(0,B.yQ)({accessorKey:"openPrice",headerText:e("Avg Entry Price"),cellTestId:X.Of.ASSET_OPEN_COLUMN_ENTRY_PRICE})),H(r,s.j7.CURRENT_PRICE,(0,B.Io)({accessorKey:"currentPrice",headerText:e("Market Price"),cellTestId:X.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE,columnPreferenceOrderType:s.ZV.OPEN_POSITION})),H(r,s.j7.NOTIONAL,(0,B.wD)({accessorKey:"notional",headerText:e("Notional"),cellTestId:X.Of.ASSET_OPEN_COLUMN_NOTIONAL,formatter:function(e){return(0,W.Wi)(Number(e),2)}})),H(r,s.j7.TAKE_PROFIT,(0,B.yQ)({accessorKey:"takeProfit",headerText:e("Take Profit"),cellTestId:X.Of.ASSET_OPEN_COLUMN_TAKE_PROFIT})),H(r,s.j7.STOP_LOSS,(0,B.yQ)({accessorKey:"stopLoss",headerText:e("Stop Loss"),cellTestId:X.Of.ASSET_OPEN_COLUMN_STOP_LOSS})),H(r,s.j7.SWAP,(0,B.wD)({accessorKey:"swap",headerText:e("Swap"),cellTestId:X.Of.ASSET_OPEN_COLUMN_SWAP,formatter:function(e){return(0,W.Wi)(Number(e),2)}})),H(r,s.j7.COMMISSION,(0,B.yQ)({accessorKey:"commission",headerText:e("Commission"),cellTestId:X.Of.ASSET_OPEN_COLUMN_COMMISSION})),r},en=function(e){var r;return H(r={},s.j7.SYMBOL,(0,B.Dc)({cellTestId:X.Of.ASSET_OPEN_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol Name"),size:200})),H(r,s.j7.SIZE,(0,B.vM)({cellTestId:X.Of.ASSET_OPEN_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Quantity")})),r},eo=function(e){var r;return H(r={},s.j7.PROFIT_AND_LOSS,(0,B.DF)({cellTestId:X.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"symbol",headerText:e("Profit/Loss(%)")})),H(r,s.j7.ROI_PERCENT,(0,B.Hp)({cellTestId:X.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"symbol",headerText:e("ROI%")})),H(r,s.j7.LAST_PRICE,(0,B.Io)({cellTestId:X.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE,accessorKey:"lastPrice",headerText:e("Last Price"),columnPreferenceOrderType:s.ZV.OPEN_POSITION})),H(r,s.j7.AVG_BOUGHT_PRICE,(0,B.yQ)({cellTestId:X.Of.ASSET_OPEN_COLUMN_AVG_BOUGHT_PRICE,accessorKey:"avgBoughtPrice",headerText:e("Avg Bought Price")})),H(r,s.j7.AVG_SOLD_PRICE,(0,B.yQ)({cellTestId:X.Of.ASSET_OPEN_COLUMN_AVG_SOLD_PRICE,accessorKey:"avgSoldPrice",headerText:e("Avg Sold Price")})),H(r,s.j7.MARKET_VALUE,(0,B.iu)({cellTestId:X.Of.ASSET_OPEN_COLUMN_MARKET_VALUE,accessorKey:"symbol",headerText:e("Market Value")})),r},ei=function(e){var r=e.positionId,t=e.t,n=void 0===t?d.ag.t.bind(d.ag):t,o=e.onError,i=O.lj.getCompanyIntegration()!==a.wS.CENTROID;b._.oneClickCloseMarketOrder({positionId:r,onSuccess:function(){i&&(0,c.ur)({message:n("Position has been closed."),messageType:S.KK.SUCCESS})},onError:function(e){(0,c.ur)({message:e,messageType:S.KK.ERROR}),null==o||o()}})},ec=function(e,r,t){return(0,B.K3)({id:"delete",size:50,accessorKey:"orderId",headerText:r("Close"),actionButtonType:P.K2.DELETE,headerAlignment:"center",disabled:t,onClick:function(n){if(!t){var o=(0,_.DC)(e,n);if(P.XR.addActiveRow(o,P.K2.DELETE),n.copyTradeInfo&&n.closable&&F({orderId:n.orderId,values:{copierId:n.copyTradeInfo.copierId,copiedSignalId:n.copyTradeInfo.copySignalId,symbol:n.symbol,symbolType:n.symbolType},onCancel:function(){P.XR.removeActiveRow(o,P.K2.DELETE)}}),!n.copyTradeInfo&&n.closable){var i=function(){(0,z.K)({positionId:o,onCancel:function(){P.XR.removeActiveRow(o,P.K2.DELETE)}})};f.j.getIsOneClickTradingEnabled()?ei({positionId:o,t:r,onError:function(){return i()}}):i()}}}})},ea=function(e){return(0,B.K3)({id:"edit",size:50,accessorKey:"orderId",headerText:(0,N.Oh)(),actionButtonType:P.K2.EDIT,headerAlignment:"center",disabled:e,onClick:function(r){var t=r.orderId,n=r.symbol,o=r.orderType,i=r.editable;
1!e&&(E.q.order.editOrderClick({symbol:n,direction:(0,v.GI)((0,v.cj)(o)),orderType:(0,v.oi)(o),positionModuleTab:y.of.OPEN_POSITIONS}),P.XR.addActiveRow(t,P.K2.EDIT),i&&(0,V.Z)({orderId:t,onCancel:function(){P.XR.removeActiveRow(t,P.K2.EDIT)}}))}})},es=function(e,r,t){return(0,B.K3)({id:"track",size:50,accessorKey:"orderId",headerText:t("Track"),actionButtonType:P.K2.TRACK,headerAlignment:"center",onClick:function(t){var n=t.symbol,o=t.decimal,i=t.orderType,c=t.stopLoss,a=t.takeProfit,s=t.openPrice,l=t.closable,d=t.editable,u=t.marketFillPolicy,f=t.orderId,T=!m._.orderTrackers.some(function(e){return e.orderId===f}),O={symbol:n,orderId:f,decimal:o,orderType:i,stopLoss:c,takeProfit:a,entryPrice:s,isClosable:(0,v.HS)({marketFillPolicy:u,flag:l}),isEditable:(0,v.HS)({marketFillPolicy:u,flag:d})};E.q.order.trackOrderClick({trackOrderParams:O,livePrice:p.$.getOrderSymbolLivePrice({id:String(f),orderType:i,isOpenPosition:!0}),positionModuleTab:y.of.OPEN_POSITIONS,isTracking:T}),(0,Y.v)({navigate:r,nextTrackingState:T,orderId:f,pathname:e,symbol:n,trackOrderParams:O})}})},el=function(){var e=(0,o.$G)().t,r=(0,u.eZ)(s.ZV.OPEN_POSITION),t=(0,O.$X)(),c=(0,I.ry)(),d=(0,T.kz)(),f=(0,i.TH)().pathname,E=(0,i.s0)();return{tableColumns:(0,n.useMemo)(function(){var n={},o=r.filter(function(e){return e.visible}).map(function(e){return e.label});switch(t){case a.wS.HORIZON:n=en(e);var i=eo(e);o.forEach(function(e){i[e]&&(n[e]=i[e])}),n.deleteAction=ec(t,e,d);break;case a.wS.CENTROID:n=er(e);var s=et(e);o.forEach(function(e){s[e]&&(n[e]=s[e])}),n.trackAction=es(f,E,e),n.editAction=ea(d),n.deleteAction=ec(t,e,d);break;case a.wS.METATRADER5:n=q(e);var u=J(e);o.forEach(function(e){u[e]&&(n[e]=u[e])}),n.trackAction=es(f,E,e),n.editAction=ea(d),n.deleteAction=ec(t,e,d);break;default:n=q(e);var T=ee(e);o.forEach(function(e){T[e]&&(n[e]=T[e])}),n.trackAction=es(f,E,e),n.editAction=ea(d),n.deleteAction=ec(t,e,d)}return f!==l.oI.TRADE||t===a.wS.HORIZON||c||delete n.SYMBOL,Object.values(n).filter(function(e){return!!e})},[r,t,f,c,e,d,E])}}},23582:function(e,r,t){"use strict";t.d(r,{h:()=>Y,A:()=>W}),t(41539),t(39714),t(57327),t(21249),t(26833);var n=t(32735),o=t(81182),i=t(11750),c=t(16689),a=t(86653),s=t(43545),l=t(907),d=t(479),u=t(84451),f=t(20787),T=t(17609),O=t(1403),E=t(71028),y=t(57753),p=t(51015),I=t(41174),_=t(56740),S=t(31305),P=t(74370),m=t(39153),b=t(53094),v=t(16672),N=t(19367),h=t(82100),C=t(57475),g=t(4638),L=t(99684);t(9653),t(35192),t(92222);var x=t(48881),j=t(6807),R=t(82337),D=t(32972),A=t(3082),M=t(64536),w=t(33481),U=t(92963),K=t(55869);function k(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Z=function(e){var r;return k(r={openTime:(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Open Date"),formatter:function(e){return A._.convertToDayjsWithOffset({input:Number(e)}).format(R.ju)}}),orderNo:(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order No.")})},s.j7.SYMBOL,(0,g.Dc)({cellTestId:j.Of.ASSET_PENDING_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),k(r,"orderType",(0,g.Y1)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Type")})),r},G=function(e){var r;return k(r={},s.j7.SIZE,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Size")})),k(r,s.j7.UNITS,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_UNITS,accessorKey:"units",headerText:e("Units")})),k(r,s.j7.EXPIRY,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_EXPIRY,accessorKey:"tradeExpiry",headerText:e("Expiry"),formatter:function(e){return(0,K.og)(e)}})),k(r,s.j7.PRICE,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ENTRY_PRICE,accessorKey:"price",headerText:e("Price")})),k(r,s.j7.CURRENT_PRICE,(0,g.Io)({cellTestId:j.Of.ASSET_PENDING_COLUMN_CURRENT_PRICE,accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:s.ZV.PENDING_ORDER})),k(r,s.j7.TAKE_PROFIT,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_TAKE_PROFIT,accessorKey:"takeProfit",headerText:e("Take Profit")})),k(r,s.j7.STOP_LOSS,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_STOP_LOSS,accessorKey:"stopLoss",headerText:e("Stop Loss")})),r},F=function(e){var r;return k(r={},s.j7.VOLUME,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Volume"),formatter:function(e,r){var t=Number(e),n=null==r?void 0:r.filledLotSize,o=Number.isFinite(t)?(0,w.Wi)(t,(0,D.N)(t)):"--",i=Number.isFinite(n)?(0,w.Wi)(n,(0,D.N)(n),!1):"--";return"".concat(o," / ").concat(i)}})),k(r,s.j7.UNITS,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_UNITS,accessorKey:"units",headerText:e("Units")})),k(r,s.j7.FILL_POLICY,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_FILL_POLICY,accessorKey:"fillPolicy",headerText:e("Fill Policy"),formatter:function(e){return(0,K.JE)(e)}})),k(r,s.j7.EXPIRY,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_EXPIRY,accessorKey:"tradeExpiry",headerText:e("Expiry"),formatter:function(e){return(0,K.og)(e)}})),k(r,s.j7.EXPIRY_DATE,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_EXPIRY_DATE,accessorKey:"expiration",headerText:e("Expiry Date"),formatter:function(e,r){return 0===e?"--":A._.convertToDayjsWithOffset({input:Number(e)}).format((null==r?void 0:r.tradeExpiry)===x.Nz.SPECIFIED_DAY?R.zT:R.ju)}})),k(r,s.j7.PRICE,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ENTRY_PRICE,accessorKey:"price",headerText:e("Price")})),k(r,s.j7.PENDING_PRICE,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_STOP_LIMIT_PRICE,accessorKey:"priceTrigger",headerText:e("Stop Limit Price")})),k(r,s.j7.CURRENT_PRICE,(0,g.Io)({cellTestId:j.Of.ASSET_PENDING_COLUMN_CURRENT_PRICE,accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:s.ZV.PENDING_ORDER})),k(r,s.j7.TAKE_PROFIT,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_TAKE_PROFIT,accessorKey:"takeProfit",headerText:e("Take Profit")})),k(r,s.j7.STOP_LOSS,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_STOP_LOSS,accessorKey:"stopLoss",headerText:e("Stop Loss")})),r},z=function(e){var r;return k(r={},s.j7.OPEN_TIME,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Order Date"),formatter:function(e){return A._.convertToDayjsWithOffset({input:Number(e)}).format(R.ju)}})),k(r,s.j7.ORDER_NO,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order ID")})),k(r,s.j7.SYMBOL,(0,g.Dc)({cellTestId:j.Of.ASSET_PENDING_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")}
1)),k(r,s.j7.ORDER_TYPE,(0,g.Y1)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Order Type")})),r},V=function(e){var r;return k(r={},s.j7.PRICE,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_PRICE,accessorKey:"price",headerText:e("Price")})),k(r,s.j7.CURRENT_PRICE,(0,g.Io)({cellTestId:j.Of.ASSET_PENDING_COLUMN_MARKET_PRICE,accessorKey:"currentPrice",headerText:e("Market Price"),columnPreferenceOrderType:s.ZV.PENDING_ORDER})),k(r,s.j7.VOLUME_SIZE,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Volume")})),k(r,s.j7.FILLED_VOLUME,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_FILL_VOLUME,accessorKey:"filledVolume",headerText:e("Fill Volume")})),k(r,s.j7.FILL_POLICY,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_TIME_IN_FORCE,accessorKey:"fillPolicy",headerText:(0,U.r9)(U.tM.FILL_POLICY,a.wS.CENTROID),formatter:function(e){return(0,K.JE)(e)}})),k(r,s.j7.MARKET_RANGE,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_MARKET_RANGE,accessorKey:"marketRange",headerText:e("Market Range"),formatter:function(e){return(0,w.Wi)(Number(e),0,!1)}})),r},B=function(e){var r;return k(r={},s.j7.ORDER_TYPE,(0,g.Y1)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Order Type"),size:150})),k(r,s.j7.ORDER_STATUS,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_STATUS,accessorKey:"horizonOrderStatus",headerText:e("Order Status"),formatter:function(e){return(0,M.gj)(e)}})),k(r,s.j7.LIMIT_PRICE,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_LIMIT_PRICE,accessorKey:"limitPrice",headerText:e("Limit Price")})),k(r,s.j7.STOP_PRICE,(0,g.yQ)({cellTestId:j.Of.ASSET_PENDING_COLUMN_STOP_PRICE,accessorKey:"stopPrice",headerText:e("Stop Price")})),k(r,s.j7.LAST_PRICE,(0,g.Io)({cellTestId:j.Of.ASSET_PENDING_COLUMN_LAST_PRICE,accessorKey:"lastPrice",headerText:e("Last Price"),columnPreferenceOrderType:s.ZV.PENDING_ORDER})),k(r,s.j7.PLACED_QUANTITY,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_PLACED_QUANTITY,accessorKey:"lotSize",headerText:e("Placed Quantity")})),k(r,s.j7.FILLED_QUANTITY,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_FILLED_QUANTITY,accessorKey:"filledLotSize",headerText:e("Filled Quantity")})),k(r,s.j7.REMAINING_QUANTITY,(0,g.vM)({cellTestId:j.Of.ASSET_PENDING_COLUMN_REMAINING_QUANTITY,accessorKey:"remainedLotSize",headerText:e("Remaining Quantity")})),k(r,s.j7.TIME_IN_FORCE,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_TIME_IN_FORCE,accessorKey:"fillPolicy",headerText:e("Time-In-Force"),formatter:function(e){return(0,K.JE)(e)}})),k(r,s.j7.EXPIRY_DATE,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_EXPIRY_DATE,accessorKey:"expiration",headerText:e("Expiry Date"),formatter:function(e){return(0,R.IM)(e,R.zT)}})),k(r,s.j7.ORDER_NO,(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order ID"),size:250})),r},Y=function(e){var r=e.symbol,t=e.orderId,n=e.id,o=e.t,i=void 0===o?d.ag.t:o,s=(0,b.Q)(i),l=O.lj.getCompanyIntegration()===a.wS.CENTROID&&null!=n?n.toString():t;m.T.closeLimitOrder({payload:{symbol:r,orderId:l},onSuccess:function(){(0,c.ur)({message:s("Order has been deleted."),messageType:_.KK.SUCCESS})},onError:function(e){(0,c.ur)({message:e,messageType:_.KK.ERROR})}})},X=function(e,r){return(0,g.K3)({id:"delete",size:50,accessorKey:"orderId",headerText:e("Delete"),actionButtonType:S.K2.DELETE,headerAlignment:"center",disabled:r,onClick:function(t){var n,o,i,c;r||(S.XR.addActiveRow(null!=(n=t.orderId)?n:"",S.K2.DELETE),f.j.getIsOneClickTradingEnabled()?Y({symbol:null!=(o=t.symbol)?o:"",orderId:null!=(i=t.orderId)?i:"",id:t.id,t:e}):(0,h.a)({orderId:null!=(c=t.orderId)?c:"",onCancel:function(){var e;S.XR.removeActiveRow(null!=(e=t.orderId)?e:"",S.K2.DELETE)}}))}})},Q=function(e,r){return(0,g.K3)({id:"edit",size:50,accessorKey:"orderId",headerText:e("Edit"),actionButtonType:S.K2.EDIT,headerAlignment:"center",disabled:r,onClick:function(e){var t,n;
1r||(E.q.order.editOrderClick({symbol:e.symbol,direction:(0,N.GI)((0,N.cj)(e.orderType)),orderType:(0,N.oi)(e.orderType),positionModuleTab:y.of.PENDING_ORDERS}),S.XR.addActiveRow(null!=(t=e.orderId)?t:"",S.K2.EDIT),(0,C.B)({orderId:null!=(n=e.orderId)?n:"",onCancel:function(){var r;S.XR.removeActiveRow(null!=(r=e.orderId)?r:"",S.K2.EDIT)}}))}})},$=function(e,r,t){return(0,g.K3)({id:"track",size:50,accessorKey:"orderId",headerText:t("Track"),actionButtonType:S.K2.TRACK,headerAlignment:"center",onClick:function(t){var n=t.symbol,o=t.decimal,i=t.orderType,c=t.stopLoss,a=t.takeProfit,s=t.price,l=t.priceTrigger,d=t.closable,u=t.editable,f=t.marketFillPolicy,T=t.orderId,O=!P._.orderTrackers.some(function(e){return e.orderId===T}),p=P._.getEntryAndAdditionalPrices({orderType:i,price:s,priceTrigger:l}),_=p.entryPrice,S=p.additionalPrice,m={symbol:n,decimal:o,orderId:T,orderType:i,stopLoss:(0,v.U8)(c),takeProfit:(0,v.U8)(a),entryPrice:(0,v.U8)(_),additionalPrice:(0,v.U8)(S),isClosable:(0,N.HS)({marketFillPolicy:f,flag:d}),isEditable:(0,N.HS)({marketFillPolicy:f,flag:u})};E.q.order.trackOrderClick({trackOrderParams:m,livePrice:I.$.getOrderSymbolLivePrice({id:String(T),orderType:i,isOpenPosition:!1}),priceTrigger:l,positionModuleTab:y.of.PENDING_ORDERS,isTracking:O}),(0,L.v)({navigate:r,nextTrackingState:O,orderId:T,pathname:e,symbol:n,trackOrderParams:m})}})},W=function(){var e=(0,o.$G)().t,r=(0,i.TH)().pathname,t=(0,i.s0)(),c=(0,u.eZ)(s.ZV.PENDING_ORDER),d=(0,O.$X)(),f=(0,p.ry)(),E=(0,T.kz)();return{tableColumns:(0,n.useMemo)(function(){var n={},o=c.filter(function(e){return e.visible}).map(function(e){return e.label});switch(d){case a.wS.HORIZON:n=k({openTime:(0,g.wD)({cellTestId:j.Of.ASSET_PENDING_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Created Date"),formatter:function(e){return A._.convertToDayjsWithOffset({input:Number(e)}).format(R.ju)}})},s.j7.SYMBOL,(0,g.Dc)({cellTestId:j.Of.ASSET_PENDING_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol Name"),size:200}));var i=B(e);o.forEach(function(e){i[e]&&(n[e]=i[e])}),n.deleteAction=X(e,E);break;case a.wS.CENTROID:n=z(e);var u=V(e);o.forEach(function(e){u[e]&&(n[e]=u[e])}),n.trackAction=$(r,t,e),n.editAction=Q(e,E),n.deleteAction=X(e,E);break;case a.wS.METATRADER5:n=Z(e);var T=F(e);o.forEach(function(e){T[e]&&(n[e]=T[e])}),n.trackAction=$(r,t,e),n.deleteAction=X(e,E),n.editAction=Q(e,E);break;default:n=Z(e);var O=G(e);o.forEach(function(e){O[e]&&(n[e]=O[e])}),n.trackAction=$(r,t,e),n.editAction=Q(e,E),n.deleteAction=X(e,E)}return r!==l.oI.TRADE||d===a.wS.HORIZON||f||delete n.SYMBOL,d===a.wS.CENTROID&&delete n.trackAction,Object.values(n).filter(function(e){return!!e})},[c,d,e,r,t,f,E])}}},99684:function(e,r,t){"use strict";t.d(r,{k:()=>s,v:()=>a}),t(26699),t(32023);var n=t(907),o=t(41174),i=t(59440),c=t(74370),a=function(e){var r=e.navigate,t=e.nextTrackingState,o=e.orderId,a=e.pathname,s=e.symbol,l=e.trackOrderParams;if(t){var d=i.N.getSymbolDetail();((null==d?void 0:d.symbol)!==s||location.pathname.includes(n.oI.ASSETS))&&i.N.setSymbolDetail({symbolId:s}),a!==n.oI.TRADE?(c._.resetChartReadyStatus(),c._.trackOrder(l),r(n.oI.TRADE)):c._.trackOrder(l)}else c._.cancelTrackOrder(o)},s=function(e){var r=e.isEnable,t=e.navigate,c=e.symbol,a=e.symbolType;r&&c&&(o.$.onSelectOrderSymbol(c,a),location.pathname!==n.oI.TRADE&&(i.N.setIsNavigatingWithSymbol(),t(n.oI.TRADE)))}}}]);
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.