1(self.webpackChunk_aqx_member_web=self.webpackChunk_aqx_member_web||[]).push([["8012"],{15163:function(e,t,r){"use strict";var n=r(9522).end;e.exports=r(23488)("trimEnd")?function(){return n(this)}:"".trimEnd},23673:function(e,t,r){r(62634);var n=r(29638),o=r(15163);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==o},{trimEnd:o})},62634:function(e,t,r){var n=r(29638),o=r(15163);n({target:"String",proto:!0,name:"trimEnd",forced:void 0!==o},{trimRight:o})},77023:function(e,t,r){var n=r(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},35192:function(e,t,r){r(82109)({target:"Number",stat:!0},{isFinite:r(77023)})},98900:function(e,t,r){"use strict";r.d(t,{Bu:()=>a,DQ:()=>c}),r(48881),r(43545);var n=r(70452),o=r(6807);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(e){var t;return e?(i(t={},n.U.ALL,{cancel:o.Of.BULK_CLOSE_MODAL_BUTTON_CANCEL_ALL,submit:o.Of.BULK_CLOSE_MODAL_BUTTON_SUBMIT_ALL}),i(t,n.U.PROFIT,{cancel:o.Of.BULK_CLOSE_MODAL_BUTTON_CANCEL_PROFIT,submit:o.Of.BULK_CLOSE_MODAL_BUTTON_SUBMIT_PROFIT}),i(t,n.U.LOSS,{cancel:o.Of.BULK_CLOSE_MODAL_BUTTON_CANCEL_LOSS,submit:o.Of.BULK_CLOSE_MODAL_BUTTON_SUBMIT_LOSS}),t)[e]:{cancel:o.Of.BULK_DELETE_MODAL_BUTTON_CANCEL,submit:o.Of.BULK_DELETE_MODAL_BUTTON_SUBMIT}},c=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,t,r){"use strict";r.d(t,{K2:()=>O,Q8:()=>T,XR:()=>p});var n,o=r(81993);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var u={activeRowMap:{}},d=new(function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,r,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=a(r=t),i(e=function(e,t){var r;if(t&&("object"==((r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(r,[],a(this).constructor):r.apply(this,n)),"addActiveRow",function(t,r){var n,o;e.context.activeRowMap=(n=c({},e.context.activeRowMap),o=null!=(o=i({},t,r))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n)}),i(e,"removeActiveRow",function(t,r){var n=c({},e.context.activeRowMap);n[t]===r&&delete n[t],e.context.activeRowMap=c({},n)}),i(e,"reset",function(){e.context=c({},u)}),e.context=u,e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e),t}(o.default));function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=new function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");f(this,"reset",d.reset),f(this,"addActiveRow",d.addActiveRow),f(this,"removeActiveRow",d.removeActiveRow),f(this,"getActiveRowMap",function(){return d.context.activeRowMap})},T=function(e,t){return(0,o.useService)(d,function(r){return r.activeRowMap[e]===t})},O=((n={}
1).TRACK="TRACK",n.CLOSE="CLOSE",n.DELETE="DELETE",n.EDIT="EDIT",n.SHARE="SHARE",n)},78766:function(e,t,r){"use strict";r.d(t,{gt:()=>H,W6:()=>eo,dM:()=>er,Zi:()=>et,rT:()=>B,F4:()=>q,bz:()=>$,_H:()=>X,Wq:()=>R,zP:()=>_,SZ:()=>x,td:()=>p,Od:()=>D,M7:()=>A,Vx:()=>eP,cB:()=>F,WR:()=>ee,pZ:()=>O,Nk:()=>z,EW:()=>Y,VO:()=>V,I:()=>en});var n,o,i,a,c,l,s,u=r(32735),d=r(6053),f=r(17609);let p=function(){var e=(0,f.ln)(),t=(0,d.lE)().isKycAlertVisible;return(0,u.useMemo)(function(){var r=t?null==e?void 0:e.accountId:null==e?void 0:e.accountNumber;return null!=r?r:"accountID"},[e,t])};var T=r(81182);let O=function(){var e=(0,T.$G)().i18n.language;return(0,u.useMemo)(function(){var t="ar_AE"===e;return{customLanguage:t?"en_GB":e,shouldReverseDir:t}},[e])};var y=r(73407);let E={getTradeSharingCardDetail:function(e){return y.WY.get("/api/plugin/v2/trade-sharing-card",{signal:e})}};function b(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=new function e(){var t=this;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");m(this,"tradeSharingCardDetailAC",void 0),m(this,"getTradeSharingCardDetail",function(e){var r;return(r=function(){var t,r,n,o;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(l){var s=[c,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),null==(t=this.tradeSharingCardDetailAC)||t.abort(),this.trade
1SharingCardDetailAC=new AbortController,[4,E.getTradeSharingCardDetail(this.tradeSharingCardDetailAC.signal)];case 1:return r=i.sent().result,e.onSuccess(r),[3,4];case 2:return n=i.sent(),e.onError(n),[3,4];case 3:return null==(o=e.onFinally)||o.call(e),[7];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){b(i,n,o,a,c,"next",e)}function c(e){b(i,n,o,a,c,"throw",e)}a(void 0)})}).call(t)})},g=((n={}).RATIO_1X1="RATIO_1X1",n.RATIO_5X6="RATIO_5X6",n);r(75093),r(13616);var v=r(81993),I=r(78562);function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(71934);var _=((o={}).TRADE_ID="tradeID",o.USERNAME="username",o.WATERMARK="watermark",o),P=["tradeID","username","watermark"],C={tradeID:!1,username:!1,watermark:!1},x=((i={}).OPEN="open",i.CLOSED="closed",i),R=((a={}).RATIO_1_1="1x1",a.RATIO_5_6="5x6",a),A=(S(l={},"1x1","1:1"),S(l,"5x6","5:6"),l),N=function(e){return Object.values(R).includes(e)},D=((c={}).PERCENTAGE="PERCENTAGE",c.CURRENCY="CURRENCY",c),j="PERCENTAGE",L=function(e){return Object.values(D).includes(e)};function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){w(e,t,r[t])})}return e}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(K=function(){return!!e})()}var Z={designPreferences:C,designPreferencesLoading:!1,selectedRatio:"5x6",selectedTab:j,selectedOrderLoading:!1,tradeSharingCardDetailsLoading:!1},G=new(function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,r,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=M(r=t),w(e=function(e,t){var r;if(t&&("object"==((r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,K()?Reflect.construct(r,[],M(this).constructor):r.apply(this,n)),"setSelectedOrder",function(t){e.context.selectedOrder=t}),w(e,"resetSelectedOrder",function(){e.context.selectedOrder=void 0}),w(e,"setSelectedOrderLoading",function(t){e.context.selectedOrderLoading=t}),w(e,"setImageCreatedAt",function(t){e.context.imageCreatedAt=t}),w(e,"setDesignPreference",function(t,r){var n,o;e.context.designPreferences=(n=U({},e.context.designPreferences),o=null!=(o=w({},t,r))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n)}),w(e,"setAllDesignPreferences",function(t){e.context.designPreferences=t}),w(e,"resetAllDesignPreferences",function(){e.context.designPreferences=C}),w(e,"setSelectedRatio",function(t){e.context.selectedRatio=t}),w(e,"setSelectedTab",function(t){e.context.selectedTab=t}),w(e,"setDesignPreferencesLoading",function(t){e.context.designPreferencesLoading=t}),w(e,"setTradeSharingCardDetails",function(t){e.context.tradeSharingCardDetails=t}),w(e,"setTradeSharingCardDetailsLoading",function(t){e.context.tradeSharingCardDetailsLoading=t}),w(e,"reset",function(){e.context=U({},Z)}),e.context=U({},Z),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&k(t,e),t}(v.default)),F=function(){return(0,v.useService)(G,function(e){return e.designPreferences})},z=function(){return(0,v.useService)(G,function(e){return e.tradeSharingCardDetail
1s})},V=function(){return(0,v.useService)(G,function(e){return e.selectedOrder})},B=function(){return(0,v.useService)(G,function(e){return e.selectedRatio})},X=function(){return(0,v.useService)(G,function(e){return e.selectedTab})},Y=function(){return(0,v.useService)(G,function(e){return e.imageCreatedAt})},$=function(){return(0,v.useService)(G,function(e){return e.designPreferencesLoading||e.tradeSharingCardDetailsLoading||e.selectedOrderLoading})},H=function(){var e=V(),t=(0,I.yF)(),r=(0,u.useRef)(!1),n=null!=e?e:{},o=n.orderDetailType,i=n.orderId,a=o===x.OPEN&&!!i,c=!!i&&t.includes(i);return(0,u.useEffect)(function(){a&&c&&(r.current=!0)},[a,c]),a&&r.current&&!c};function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q=(W(s={},R.RATIO_1_1,g.RATIO_1X1),W(s,R.RATIO_5_6,g.RATIO_5X6),s),q=function(){var e,t=(null!=(e=z())?e:{}).cardSizeToBackgroundImage,r=B();return null==t?void 0:t[Q[r]]},J=r(31378),ee=function(){var e,t=(0,J.eP)().theme,r=null!=(e=z())?e:{},n=r.profitColor,o=r.lossColor,i=r.titleTextColor,a=r.bodyTextColor;return(0,u.useMemo)(function(){var e,r;return{profitColor:null!=(e=null!=n?n:t.themeColors.pnl.positive.default)?e:t.themeColors.tradeSharingCard.profitColor,lossColor:null!=(r=null!=o?o:t.themeColors.pnl.negative.default)?r:t.themeColors.tradeSharingCard.lossColor,titleTextColor:null!=i?i:t.themeColors.tradeSharingCard.titleTextColor,bodyTextColor:null!=a?a:t.themeColors.tradeSharingCard.bodyTextColor}},[t,a,n,o,i])},et=361,er=429,en=function(e){return e===R.RATIO_1_1?et:er},eo="TRADE_SHARING_CARD_BACKGROUND";r(15296),r(92274),r(68233),r(803),r(63045),r(48868),r(54861),r(81874),r(37092),r(32435),r(86305),r(42295),r(66251),r(55737);var ei=r(86653),ea=r(48881),ec=r(43545),el=r(479),es=r(95986),eu=r(3082),ed=r(37528),ef=r(56740),ep=r(78675),eT=r(76898),eO=r(19367),ey=function(e){var t=[x.OPEN,x.CLOSED];return"string"==typeof e&&t.includes(e)};function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eb(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function em(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){eb(i,n,o,a,c,"next",e)}function c(e){eb(i,n,o,a,c,"throw",e)}a(void 0)})}}function eh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){eh(e,t,r[t])})}return e}function ev(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function eI(e){return function(e){if(Array.isArray(e))return eE(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eE(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eE(e,t)}}(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.")}()}function eS(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(l){var s=[c,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var e_=function(e,t,r){return eI(P.filter(function(t){return e[t]})).concat([t,r]).join(",")},eP=new function e(){var t=this;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");eh(this,"init",function(){var e=[t.fetchDesignPreference(),t.fetchTradeSharingCardDetail()];G.context.selectedOrder||e.push(t.fetchSelectedOrderDetails()),Promise.all(e)}),eh(this,"updateDesignPreference",function(e,t,r){return em(function(){var n,o,i,a;return eS(this,function(c){switch(c.label){case 0:return G.setDesignPreference(e,t),o=(n=G.context).designPreferences,i=n.selectedRatio,a=n.selectedTab,[4,ec.VM.updateUserPreference({type:ec.Gt.TRADE_SHARING_CARD,category:ec.iQ.TRADE_SHARING_CARD,value:e_(o,i,a)},{onSuccess:function(){null==r||r()},onError:function(){G.setDesignPreference(e,!t)}})];case 1:return c.sent(),[2]}})})()}),eh(this,"updateCardRatio",function(e,t){return em(function(){var r;return eS(this,function(n){switch(n.label){case 0:return r=G.context.selectedRatio,G.setSelectedRatio(e),[4,ec.VM.updateUserPreference({type:ec.Gt.TRADE_SHARING_CARD,category:ec.iQ.TRADE_SHARING_CARD,value:e_(G.context.designPreferences,e,G.context.selectedTab)},{onSuccess:function(){null==t||t()},onError:function(){G.setSelectedRatio(r)}})];case 1:return n.sent(),[2]}})})()}),eh(this,"updateCardTab",function(e,t){return em(function(){var r;return eS(this,function(n){switch(n.label){case 0:return r=G.context.selectedTab,G.setSelectedTab(e),[4,ec.VM.updateUserPreference({type:ec.Gt.TRADE_SHARING_CARD,category:ec.iQ.TRADE_SHARING_CARD,value:e_(G.context.designPreferences,G.context.selectedRatio,e)},{onSuccess:function(){null==t||t()},onError:function(){G.setSelectedTab(r)}})];case 1:return n.sent(),[2]}})})()}),eh(this,"setSelectedOrder",function(e){G.setSelectedOrder(e);var t=eu._.checkIsRequiredIntegration(ei.wS.METATRADER4),r=e.closeTime,n=e.orderDetailType,o=e.openTime,i=e.orderId,a=e.symbol,c=eg({orderDetailType:n,orderId:i},n===x.CLOSED&&{openTime:o,closeTime:r,symbol:a,type:t?ea.hx.ORDER:ea.hx.POSITION});eT.Z.setItem(eT.V.LAST_SELECTED_ORDER,JSON.stringify(c))}),eh(this,"resetSelectedOrder",function(){G.resetSelectedOrder(),eT.Z.removeItem(eT.V.LAST_SELECTED_ORDER)}),eh(this,"setImageCreatedAt",function(e){G.setImageCreatedAt(e)}),eh(this,"reset",function(){G.reset()}),eh(this,"fetchDesignPreference",function(){G.setDesignPreferencesLoading(!0),ec.VM.getUserPreference({category:ec.iQ.TRADE_SHARING_CARD,type:ec.Gt.TRADE_SHARING_CARD},{onSuccess:function(e){var t=null==e?void 0:e.find(function(e){var t=e.category,r=e.type;return t===ec.iQ.TRADE_SHARING_CARD&&r===ec.Gt.TRADE_SHARING_CARD}),r=eg({},C),n=new Set((null==t?void 0:t.value)?t.value.split(","):[]);P.forEach(function(e){n.has(e)&&(r[e]=!0)}),G.setAllDesignPreferences(r);var o=eI(n).find(N);G.setSelectedRatio(null!=o?o:"5x6");var i=eI(n).find(L);G.setSelectedTab(null!=i?i:j)},onError:function(e){var t=e.code,r=e.message;"canceled"!==r&&ef.Yu.showAlert({message:(0,y.yi)(t,r),messageType:ef.KK.ERROR})},onFinally:function(){G.setDesignPreferencesLoading(!1)}})}),eh(this,"fetchTradeSharingCardDetail",function(){G.setTradeSharingCardDetail
1sLoading(!0),h.getTradeSharingCardDetail({onSuccess:function(e){e&&G.setTradeSharingCardDetails(e)},onError:function(e){var t=e.code,r=e.message;"canceled"!==r&&ef.Yu.showAlert({message:(0,y.yi)(t,r),messageType:ef.KK.ERROR})},onFinally:function(){G.setTradeSharingCardDetailsLoading(!1)}})}),eh(this,"parseSelectedOrderCacheDetails",function(){var e=eT.Z.getItem(eT.V.LAST_SELECTED_ORDER);if(e)try{var t=JSON.parse(e);if(!t.hasOwnProperty("orderDetailType")||!ey(t.orderDetailType))throw Error("invalid order detail type");var r=t.orderDetailType===x.OPEN&&!t.orderId,n=t.orderDetailType===x.CLOSED&&(!t.symbol||!t.orderId||!t.type||!t.openTime||!t.closeTime);if(r||n)throw Error("invalid cached order params");return t}catch(e){ef.Yu.showAlert({message:el.ag.t("No order found."),messageType:ef.KK.ERROR});return}}),eh(this,"fetchSelectedOrderDetails",function(){var e=t.parseSelectedOrderCacheDetails();if(e)if(e.orderDetailType===x.OPEN){var r={orderId:e.orderId};t.fetchOrderDetail(r)}else{var n=e.orderId,o=e.symbol,i=e.type,a=e.openTime,c=e.closeTime;t.fetchOrderHistoryDetail({orderId:n,symbol:o,type:i,closeTime:c,openTime:a})}}),eh(this,"fetchOrderDetail",function(e){G.setSelectedOrderLoading(!0),ea.dU.getOrderDetailV2(e,{onSuccess:function(e){return em(function(){var t,r,n,o,i,a,c,l,s,u,d,f,p;return eS(this,function(T){switch(T.label){case 0:if(T.trys.push([0,,2,3]),!e)return[2];return t=e.currentPrice,r=e.orderType,n=e.symbol,o=eu._.checkIsRequiredIntegration(ei.wS.CENTROID),i=es.k.getAccountLeverage(),[4,this.getOrderDetailLivePrices(n)];case 1:return l=(c=null!=(a=T.sent())?a:{}).liveBuy,s=c.liveSell,u={liveBuy:null!=l?l:t,liveSell:null!=s?s:t},d=(0,ed.qB)(u.liveBuy,u.liveSell,r,!0),f=(0,eO.Jy)(e,u),p=(0,eO.ed)(e,u,o,i),G.setSelectedOrder(ev(eg({},e),{livePrice:d,pnl:f,roi:p,orderDetailType:x.OPEN})),G.setImageCreatedAt(new Date),[3,3];case 2:return G.setSelectedOrderLoading(!1),[7];case 3:return[2]}})}).call(t)},onError:function(){G.setSelectedOrderLoading(!1),ef.Yu.showAlert({message:el.ag.t("No order found."),messageType:ef.KK.ERROR})}})}),eh(this,"getOrderDetailLivePrices",function(e){return em(function(){return eS(this,function(t){return 0===e.length?[2,void 0]:[2,new Promise(function(t){var r,n=function(e,o){clearTimeout(r),ep.up.unsubscribe(e,ep.GT,n),t(o)};ep.up.subscribe(e,ep.GT,n),r=setTimeout(function(){ep.up.unsubscribe(e,ep.GT,n),t(void 0)},5e3)})]})})()}),eh(this,"fetchOrderHistoryDetail",function(e){G.setSelectedOrderLoading(!0),ea.dU.getOrderHistoryDetail(e,{onSuccess:function(e){if(e){var t=eu._.checkIsRequiredIntegration(ei.wS.CENTROID),r=es.k.getAccountLeverage(),n=(0,eO.E9)(e,t,r),o=(0,eO.QE)(e.profit,n);G.setSelectedOrder(ev(eg({},e),{livePrice:e.closePrice,pnl:e.profit,roi:o,orderDetailType:x.CLOSED})),G.setImageCreatedAt(new Date)}},onError:function(){ef.Yu.showAlert({message:el.ag.t("No order found."),messageType:ef.KK.ERROR})},onFinally:function(){G.setSelectedOrderLoading(!1)}})})}},28085:function(e,t,r){"use strict";r.d(t,{Z:()=>E}),r(92222),r(21249);var n=r(74512),o=r(32735),i=r(10281),a=r(62715),c=r(71225),l=r(38074),s=r(86653),u=r(46645),d=r(6807),f=r(1403),p=r(63913),T=r(92963),O=r(86969),y=function(e){var t=e.label,r=e.value,o=e.testID;return(0,n.jsxs)(_,{children:[(0,n.jsx)(P,{dataTestId:"".concat(o,"-label"),children:t}),(0,n.jsx)(C,{dataTestId:"".concat(o,"-value"),children:r})]})};let E=function(e){var t=e.orderType,r=e.symbol,i=e.orderId,c=e.symbolType,l=e.metadata,E=(0,f.$X)(),_=E===s.wS.CENTROID,P=(0,u.l7)(t),C=!_||_&&!P,x=(0,o.useMemo)(function(){var e=P?T.tM.MARKET_ORDER_NO:T.tM.PENDING_ORDER_NO;return(0,T.r9)(e,E)},[P,E]);return(0,n.jsxs)(b,{children:[(0,n.jsxs)(m,{children:[(0,n.jsx)(h,{typography:a.wZ.TEXT_L_MEDIUM,dataTestId:d.Of.EDIT_SYMBOL_VALUE,children:(0,p.g8)(r,c)}),C&&(0,n.jsx)(I,{"data-testid":d.Of.EDIT_ORDER_TYPE_VALUE,children:void 0!==t&&(0,n.jsx)(O.Z,{orderType:t})})]}),(0,n.jsxs)(m,{children:[(0,n.jsx)(g,{typography:a.wZ.TEXT_M_REGULAR,dataTestId:d.Of.EDIT_ORDER_ID_LABEL,children:x}),(0,n.jsx)(v,{typography:a.wZ.TEXT_M_REGULAR,dataTestId:d.Of.EDIT_ORDER_ID_VALUE,children:i})]}),(null==l?void 0:l.length)>0&&(0,n.jsx)(S,{children:l.map(function(e){var t=e.label,r=e.value,o=e.testID;return(0,n.jsx)(y,{label:t,value:r,testID:o},t)})})]})};var b=i.ZP.div.withConfig({componentId:"sc-59b112b8-0"})(["display:flex;flex-direction:column;row-gap:","px;padding-bottom:20px;border-bottom:1px solid ",";"],c.A.XXS,function(e){return e.theme.themeColors.border.default}),m=i.ZP.div.withConfig({componentId:"sc-59b112b8-1"})(["display:flex;flex-direction:row;column-gap:","px;"],c.A.M),h=(0,i.ZP)(l.ZP).withConfig({componentId:"sc-59b112b8-2"})(["flex:1;flex-grow:1;color:",";"],function(e){return e.theme.themeColors.text.strong}),g=(0,i.ZP)(l.ZP).withConfig({componentId:"sc-59b112b8-3"})(["flex:1;flex-grow:1;color:",";"],function(e){return e.theme.themeColors.text.subtle}),v=(0,i.ZP)(l.ZP).withConfig({componentId:"sc-59b112b8-4"})(["color:",";"],function(e){return e.theme.themeColors.text.subtle}),I=i.ZP.div.withConfig({componentId:"sc-59b112b8-5"})(["align-content:center;"]),S=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;"],c.A.XS,c.A.M,c.A.M),_=i.ZP.div.withConfig({componentId:"sc-59b112b8-7"})(["display:flex;justify-content:space-between;"]),P=(0,i.ZP)(l.ZP).withConfig({componentId:"sc-59b112b8-8"})(["color:",";"],function(e){return e.theme.themeColors.text.subtle}),C=(0,i.ZP)(l.ZP).withConfig({componentId:"sc-59b112b8-9"})(["color:",";"],function(e){return e.theme.themeColors.text.default})},57475:function(e,t,r){"use strict";r.d(t,{B:()=>es}),r(41539),r(39714),r(92222);
1var n=r(74512),o=r(32735),i=r(10281),a=r(81182),c=r(82647),l=r(71225),s=r(45954),u=r(97186),d=r(88651),f=r(16689),p=r(82391),T=r(6807);r(42295),r(96752),r(36364),r(92274),r(75654),r(48868),r(54861);var O=r(99773),y=r(84823),E=r(48881),b=r(36333),m=r(479),h=r(19554),g=r(1403),v=r(3082),I=r(13266),S=r(48260),_=r(61856),P=r(37402),C=r(18699),x=r(16672),R=r(19367),A=r(92963),N=r(64989),D=r(3827),j=r(59395);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(e,t)}}(e,t)||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 M=y.Ry().shape({orderId:y.Z_(),symbol:y.Z_(),lotSize:(0,j.sT)(y.Z_()),fillPolicy:(0,j.Ke)(y.nK()),price:y.Z_().test("test-price",N.UF,function(e){return(0,N.FY)(e)}).when(["$orderTypeLabel","$priceLabel"],function(e,t){var r=w(e,2),n=r[0],o=r[1];return n!==C.Zk.MARKET_TO_LIMIT&&n!==C.Zk.MARKET?t.required((0,N.$A)({label:o||""})):t}),priceTrigger:y.Z_().test("test-price-trigger",N.UF,function(e){return(0,N.FY)(e)}).when(["$orderTypeLabel","$priceTriggerLabel"],function(e,t){var r=w(e,2),n=r[0],o=r[1];return n===C.Zk.STOP_LIMIT?t.required((0,N.$A)({label:o||""})):t}),stopLoss:y.Z_().test("test-stop-loss",N.UF,function(e){return(0,N.FY)(e)}).test("test-stop-loss-positive",function(){return m.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,j.wQ)(P.Qr.STOP_LOSS)),takeProfit:y.Z_().test("test-take-profit",N.UF,function(e){return(0,N.FY)(e)}).test("test-take-profit-positive",function(){return m.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,j.wQ)(P.Qr.TAKE_PROFIT)),expiration:y.hT().transform(N.mf).when(["fillPolicy","$expirationLabel"],function(e,t){var r=w(e,2),n=r[0],o=r[1];return n===E.T3.GTD?t.required((0,N.$A)({label:o||""})):t})}),U=function(e,t,r){return r?null==e?void 0:e.toFixed(t):void 0},k=function(e){var t=e.pendingOrder,r=e.stopLoss,n=e.takeProfit,i=e.price,a=e.priceTrigger,c=e.onSuccess,l=e.onError,s=e.allowSavingUnchangedValues,u=e.isConfirmationRequired,d=e.onValidateFail,f=e.showTradeConfirmationModal,p=(0,g.jO)().isMT4,T=(0,g.$X)(),y=t||{},E=y.expiration,m=y.fillPolicy,C=y.lotSize,N=y.orderId,j=y.orderType,L=y.price,w=y.stopLoss,k=y.symbol,K=y.takeProfit,Z=y.lotSizeStep,G=y.minContractLotSize,F=y.decimal,z=y.tradeExpiry,V=y.priceTrigger,B=y.units,X=(0,h.Q9)(),Y=(0,I.MN)(),$=null!=Y?Y:{},H=$.maxContractLotSize,W=$.contractSize,Q=(0,P.zs)(j,Y),q=(0,D.h)(),J=(0,_.GM)().lotSizeMode,ee=(0,o.useMemo)(function(){return S._.mapOrderTypeLabelFromOrderType(j)},[j]),et=(0,o.useMemo)(function(){return(0,A.qn)(A.tV.PRICE,T)},[T]),er=(0,o.useMemo)(function(){return(0,A.qn)(A.tV.PRICE_TRIGGER,T)},[T]),en=(0,o.useMemo)(function(){return(0,A.qn)(A.tV.EXPIRATION,T)},[T]),eo=E?v._.convertToDayjsWithOffset({input:E,baseFromOffset:!0}).toDate():void 0,ei=(0,o.useMemo)(function(){return(0,O.X)(M)},[]),ea=null!=a?a:V,ec=null!=i?i:L,el=null!=r?r:w,es=null!=n?n:K,eu=(0,R.cj)(j),ed=(0,b.w)({resolver:ei,mode:"onBlur",context:{orderTypeLabel:ee,lotSizeStep:Z,maxContractLotSize:H,minContractLotSize:G,contractSize:W,sizeLabel:q,lotSizeMode:J,isFillPolicyRequired:!p,priceLabel:et,priceTriggerLabel:er,expirationLabel:en,buySellType:eu},shouldFocusError:!1,defaultValues:{orderId:N,symbol:k,orderType:j,units:null==B?void 0:B.toString(),lotSize:null==C?void 0:C.toString(),fillPolicy:p?void 0:m,tradeExpiry:z,priceTrigger:U(ea,F,!!ea),price:U(ec,F,!!ec),stopLoss:U(el,F,!!el),takeProfit:U(es,F,!!es),expiration:eo}}),ef=ed.handleSubmit,ep=ed.reset,eT=(0,o.useCallback)(function(e){var r,n=e.values,o=e.onEditModalCancel,i=(0,x.Gt)(w),a=(0,x.Gt)(K),d=(0,x.Gt)(L),p=(0,x.Gt)(V),T=n.lotSize?(0,x.Gt)(Number(n.lotSize)):void 0,O=(0,x.Gt)(Number(n.stopLoss)),y=(0,x.Gt)(Number(n.takeProfit)),E=(0,x.Gt)(Number(n.price)),b=(0,x.Gt)(Number(n.priceTrigger)),m=n.tradeExpiry!==z,h=(null==(r=n.expiration)?void 0:r.getTime())!==(null==eo?void 0:eo.getTime()),g=void 0!==T&&T!==C;if(!(O!==i||y!==a||g||m||h||E!==d||b!==p)&&!s){null==o||o();return}var v=function(){return S._.editPendingOrder({formData:n,pendingOrder:t,mixpanelProperties:{livePrice:Q},onSuccess:function(){c(),null==o||o(),ep()},onError:l})};X&&!u?v():f({formValues:n,orderType:j,formMethods:ed,pendingOrder:t,symbolDetail:Y,onConfirm:function(e){null==e||e(),v()}})},[w,K,L,V,z,eo,s,X,u,t,Y,Q,l,c,ep,j,ed,C,f]);return{formMethods:ed,onSubmit:(0,o.useCallback)(function(e){var t=e.event,r=e.onEditModalCancel;ef(function(e){eT({values:e,onEditModalCancel:r})},d)(t)},[ef,eT,d])}},K=r(18551),Z=r(71028),G=r(57753),F=r(51015),z=r(56740),V=r(59440),B=r(58822),X=r(70469),Y=r(55869),$=r(65528),H=r(26448),W=r(58118),Q=r(31111),q=r(85029),J=r(62772),ee=r(6904),et=r(28085);function er(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function en(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function eo(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function ei(e){return function(e){if(Array.isArray(e))return er(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return er(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return er(e,t)}}(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 ea=function(e){var t=e.orderId,r=e.onCancel,i=e.stopLoss,l=e.takeProfit,d=e.entryPrices,f=e.skipConfirmation,O=void 0!==f&&f,y=(0,a.$G)().t,E=(0,F.ES)(t),b=(0,g.jO)(),m=b.isCentroid,h=b.isHorizon,v=(0,I.GG)(),_=(0,o.useRef)(E),P=(0,o.useRef)(!1);(0,o.useEffect)(function(){(null==E?void 0:E.symbol)&&(_.current=E)},[E]);var C=_.current||{},x=C.expiration,R=C.symbolType,A=C.orderType,N=C.symbol,D=(0,B.Kg)(),j=ec(_.current),L=el(e,_.current),w=L.formMethods,M=L.onSubmit,U=(0,o.useCallback)(function(e){M({onEditModalCancel:e.onCancel})},[M]);(0,o.useEffect)(function(){S._.setOrderTypeLabelFromOrderType(A)},[A]),(0,o.useEffect)(function(){return N&&V.N.initEditView(N),function(){V.N.resetEditView()}},[N]),(0,o.useEffect)(function(){O&&(void 0!==i||void 0!==l||void 0!==d)&&!P.current&&(P.current=!0,M({onEditModalCancel:r}))},[O,i,l,d,M,r]);var k=(0,o.useCallback)(function(){Z.q.page.actionClick({action:G.pW.EDIT_ORDER_MODAL_CANCEL_CLICKED,symbol:N}),null==r||r()},[r,N]);return O?(0,n.jsx)(p.q,{methods:w,pendingOrder:_.current,children:(0,n.jsx)(eu,{})}):(0,n.jsx)(p.q,{modalType:G.XV.EDIT_MODAL,methods:w,pendingOrder:_.current,children:(0,n.jsxs)(u.ZP,{variant:u.KH.CONFIRMATION,okText:y("Confirm"),okButtonDataTestId:T.Of.EDIT_BUTTON_ORDER,cancelText:y("Cancel"),cancelButtonDataTestId:T.Of.EDIT_BUTTON_CANCEL,onCancel:k,onOk:U,modalTitle:y("Edit Order"),loading:D,children:[(0,n.jsxs)(ed,{children:[(0,n.jsx)(et.Z,{orderType:A,symbol:N,orderId:t,symbolType:R,metadata:j}),(0,n.jsxs)(ef,{children:[m&&(0,n.jsx)(W.Z,{}),!m&&(0,n.jsx)(Q.Z,{}),(0,n.jsx)(q.Z,{}),!h&&!m&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J.default,{}),(0,n.jsx)(ee.default,{})]}),!m&&(0,n.jsx)(H.Z,{dropdownPlacement:c.s1.TOP_END,symbolMaturityDate:h?x:void 0,isInModal:!0,isEdit:!0})]})]}),v&&(0,n.jsx)(s.ZP,{absolute:!0})]})})},ec=function(e){var t=(0,a.$G)().t,r=(0,g.$X)(),n=(0,g.jO)(),i=n.isCentroid,c=n.isMT4,l=e||{},s=l.lotSize,u=l.units,d=l.fillPolicy;return(0,o.useMemo)(function(){return ei(i?[]:[{label:(0,A.r9)(A.tM.SIZE,r),value:null!=s?s:"--",testID:T.Of.EDIT_VOLUME},{label:t("Units"),value:u?(0,X._)(u.toString()):"--",testID:T.Of.EDIT_UNITS}]).concat(ei(!c&&d?[{label:(0,A.r9)(A.tM.FILL_POLICY,r),value:(0,Y.JE)(d),testID:T.Of.EDIT_FILL_POLICY}]:[]))},[d,r,i,c,s,t,u])}
1,el=function(e,t){var r=e.onCancel,n=e.skipConfirmation,i=e.stopLoss,c=e.takeProfit,l=e.entryPrices,s=(0,a.$G)().t,u=(0,g.Cl)(),d=(0,K.j)().getErrorSnackbarProps,p=k(eo(en({pendingOrder:t,stopLoss:i,takeProfit:c},(0,o.useCallback)(function(){return l&&0!==l.length?(null==l?void 0:l.length)===2?{priceTrigger:l[0],price:l[1]}:{price:l[0]}:{}},[l])()),{allowSavingUnchangedValues:n&&(void 0!==i||void 0!==c||void 0!==l),onSuccess:function(){u&&(0,f.ur)({message:s("Order has been updated."),messageType:z.KK.SUCCESS})},onError:function(e){var t=d(e),o=t.message,i=t.messageType;n&&(null==r||r()),(0,f.ur)({message:o,messageType:i,zIndex:1002})},onValidateFail:n?function(e){null==r||r(),(0,f.ur)({message:(0,j.gb)(e,{stopLoss:i,takeProfit:c},t),messageType:z.KK.ERROR,zIndex:1002})}:void 0,showTradeConfirmationModal:$.d}));return{onSubmit:p.onSubmit,formMethods:p.formMethods}};let es=function(e){var t=(e||{}).onCancel,r=function(e){null==t||t(),e()};(0,d.ZP)(function(t){return(0,n.jsx)(ea,eo(en({},e),{onCancel:function(){return r(t)}}))})};var eu=i.ZP.div.withConfig({componentId:"sc-510fb4ac-0"})(["display:none;"]),ed=i.ZP.div.withConfig({componentId:"sc-510fb4ac-1"})(["display:flex;flex-direction:column;width:488px;padding:","px ","px;padding-bottom:","px;box-sizing:border-box;"],l.A.XL,l.A.L,l.A.XXS),ef=i.ZP.div.withConfig({componentId:"sc-510fb4ac-2"})(["display:flex;flex-direction:column;row-gap:","px;padding-top:","px;"],l.A.REGULAR,l.A.L)},76991:function(e,t,r){"use strict";r.d(t,{Z:()=>eO}),r(41539),r(39714);var n=r(74512),o=r(32735),i=r(10281),a=r(81182),c=r(71225),l=r(45954),s=r(97186),u=r(88651),d=r(16689),f=r(82391),p=r(6807);r(42295),r(96752),r(48868),r(54861),r(92274),r(75654);var T=r(99773),O=r(84823),y=r(82337),E=r(36333),b=r(479),m=r(19554),h=r(1403),g=r(13266),v=r(48260),I=r(61856),S=r(37402),_=r(18699),P=r(16672),C=r(30519),x=r(64989),R=r(3827),A=r(59395),N=O.Ry().shape({lotSize:(0,A.sT)(O.Z_()),fillPolicy:(0,A.Ke)(O.nK()),orderType:O.nK(),stopLoss:O.Z_().test("test-stop-loss",x.UF,function(e){return(0,x.FY)(e)}).test("test-stop-loss-positive",function(){return b.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}
1).test((0,A.wQ)(S.Qr.STOP_LOSS)).test((0,A._o)(S.Qr.STOP_LOSS)),takeProfit:O.Z_().test("test-take-profit",x.UF,function(e){return(0,x.FY)(e)}).test("test-take-profit-positive",function(){return b.ag.t("Value must be greater than 0")},function(e){return!e||Number(e)>0}).test((0,A.wQ)(S.Qr.TAKE_PROFIT)).test((0,A._o)(S.Qr.TAKE_PROFIT))}),D=function(e){var t,r,n=e.marketOrder,i=e.stopLoss,a=e.takeProfit,c=e.allowSavingUnchangedValues,l=e.isConfirmationRequired,s=e.onError,u=e.onSuccess,d=e.onValidateFail,f=e.showTradeConfirmationModal,p=n||{},T=p.orderType,O=p.stopLoss,y=p.takeProfit,E=(0,m.Q9)(),b=(0,g.MN)(),h=(0,S.zs)(T,b),I=j((t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n),r=r={stopLoss:null!=i?i:n.stopLoss,takeProfit:null!=a?a:n.takeProfit},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)),_=I.handleSubmit,C=I.reset,x=(0,o.useCallback)(function(e){var t=e.values,r=e.onEditModalCancel,o=(0,P.Gt)(O),i=(0,P.Gt)(y),a=(0,P.Gt)(Number(t.stopLoss)),d=(0,P.Gt)(Number(t.takeProfit));if(o===a&&i===d&&!0!==c){null==r||r();return}var p=function(){return v._.editMarketOrder({formData:t,order:n,mixpanelProperties:{livePrice:h},onSuccess:function(){u(),null==r||r(),C()},onError:s})};E&&!l?p():f({formValues:t,orderType:T,formMethods:I,marketOrder:n,symbolDetail:b,isCopyTradeOrder:!!n.copyTradeInfo,onConfirm:function(e){null==e||e(),p()}})},[O,y,E,T,I,h,c,l,n,b,s,u,C,f]),R=(0,o.useCallback)(function(e){var t=e.event,r=e.onEditModalCancel;_(function(e){x({values:e,onEditModalCancel:r})},function(e){var n=I.getValues(),o=(0,P.Gt)(O),i=(0,P.Gt)(y);o===(0,P.Gt)(Number(n.stopLoss))&&i===(0,P.Gt)(Number(n.takeProfit))&&!0!==c&&(null==r||r()),null==d||d(e,t)})(t)},[_,x,I,O,y,c,d]);return{formMethods:I,onSubmit:R}},j=function(e){var t,r,n=(0,h.jO)(),i=n.isMT4,a=n.isCentroid,c=e||{},l=c.expiration,s=c.fillPolicy,u=c.orderId,d=c.orderType,f=c.stopLoss,p=c.symbol,O=c.takeProfit,m=c.minContractLotSize,v=(0,P.vh)(e,["decimal","lotSize","lotSizeStep","contractSize","units"]),S=v.contractSize,x=v.decimal,D=v.lotSize,j=v.lotSizeStep,L=v.units,w=(0,g.MN)(),M=null!=w?w:{},U=M.maxContractLotSize,k=M.bid,K=M.ask,Z=(0,R.h)(),G=(0,I.GM)().lotSizeMode,F=(0,o.useMemo)(function(){return(0,T.X)(N)},[]),z=!!e.copyTradeInfo,V=(0,A.jB)({orderType:d,lotSize:D}),B=V===_.B9.BUY?k:K;return(0,E.w)({resolver:F,mode:"all",context:{lotSizeStep:j,maxContractLotSize:U,minContractLotSize:m,contractSize:S,sizeLabel:Z,lotSizeMode:G,isFillPolicyRequired:!i,isCopyTrade:z,entryPrice:B,isCentroid:a,buySellType:V,priceLabel:V===_.B9.BUY?b.ag.t("Sell Price"):b.ag.t("Buy Price")},shouldFocusError:!1,defaultValues:{orderId:u,orderType:d,symbol:p,fillPolicy:s,units:null==L?void 0:L.toString(),lotSize:null==D?void 0:D.toString(),stopLoss:f?null==(t=(0,C.r)(f,x))?void 0:t.toString():void 0,takeProfit:O?null==(r=(0,C.r)(O,x))?void 0:r.toString():void 0,expiration:l?(0,y.GN)({input:l}).toDate():void 0}})},L=r(18551),w=r(71028),M=r(57753),U=r(51015),k=r(59440),K=r(74370),Z=r(58822),G=r(33481),F=r(70469),z=r(92963),V=r(55869),B=r(65528),X=r(28085),Y=r(31111);r(88674);var $=(0,o.lazy)(function(){return r.e("7612").then(r.bind(r,14879))}),H=(0,o.lazy)(function(){return Promise.resolve().then(r.bind(r,62772))});let W=function(){var e=(0,h._9)(),t=(0,h.jO)().isHorizon;return e?null:(0,n.jsx)(o.Suspense,{children:t?(0,n.jsx)($,{}):(0,n.jsx)(H,{})})};var Q=(0,o.lazy)(function(){return r.e("5877").then(r.bind(r,82911))}),q=(0,o.lazy)(function(){return Promise.resolve().then(r.bind(r,6904))});let J=function(){var e=(0,h._9)(),t=(0,h.jO)().isHorizon;return e?null:(0,n.jsx)(o.Suspense,{children:t?(0,n.jsx)(Q,{}):(0,n.jsx)(q,{})})};r(56977);var ee=r(66698),et=r(18354),er=r(62715),en=r(18909),eo=r(38074);let ei=function(e){var t=e.decimal,r=(0,a.$G)().t,o=(0,f.g)(),i=o.formState,c=o.watch,l=o.setValue,s=c("stopLoss"),u=i.errors.stopLoss;return(0,n.jsxs)(ea,{children:[(0,n.jsx)(ec,{children:(0,n.jsx)(eo.ZP,{typography:er.wZ.TEXT_M_MEDIUM,children:r("Stop Loss")})}),(0,n.jsx)(et.ZP,{variant:et.vI.ITEM_WITH_FIELD_LABEL,label:r("Price"),children:(0,n.jsx)(en.ZP,{variant:en.Bv.BORDERED_NUMERIC,placeholder:"$",value:s,error:null==u?void 0:u.message,onChange:function(e){l("stopLoss",e.target.value,{shouldValidate:!0,shouldDirty:!0})},onBlur:function(){if(s&&""!==s){var e=new ee.BigNumber(s);e.isFinite()&&e.gt(0)&&l("stopLoss",e.toFixed(t),{shouldValidate:!0,shouldDirty:!0})}}})})]})};var ea=i.ZP.div.withConfig({componentId:"sc-ddae0c33-0"})(["display:flex;flex-direction:column;margin-top:","px;"],c.A.XS),ec=i.ZP.div.withConfig({componentId:"sc-ddae0c33-1"})(["margin-bottom:","px;"],c.A.REGULAR);let el=function(e){var t=e.decimal,r=(0,a.$G)().t,o=(0,f.g)(),i=o.formState,c=o.watch,l=o.setValue,s=c("takeProfit"),u=i.errors.takeProfit;return(0,n.jsxs)(es,{children:[(0,n.jsx)(eu,{children:(0,n.jsx)(eo.ZP,{typography:er.wZ.TEXT_M_MEDIUM,children:r("Take Profit")})}),(0,n.jsx)(et.ZP,{variant:et.vI.ITEM_WITH_FIELD_LABEL,label:r("Price"),children:(0,n.jsx)(en.ZP,{variant:en.Bv.BORDERED_NUMERIC,placeholder:"$",value:s,error:null==u?void 0:u.message,onChange:function(e){l("takeProfit",e.target.value,{shouldValidate:!0,shouldDirty:!0})},onBlur:function(){if(s&&""!==s){var e=new ee.BigNumber(s);e.isFinite()&&e.gt(0)&&l("takeProfit",e.toFixed(t),{shouldValidate:!0,shouldDirty:!0})}}})})]})};var es=i.ZP.div.withConfig({componentId:"sc-dbd9ab35-0"})(["display:flex;flex-direction:column;margin-top:","px;"],c.A.XS),eu=i.ZP.div.withConfig({componentId:"sc-dbd9ab35-1"})(["margin-bottom:","px;"],c.A.REGULAR),ed=i.ZP.div.withConfig({componentId:"sc-f6eac929-0"})(["display:flex;flex-direction:column;row-gap:","px;padding-top:","px;"],c.A.REGULAR,c.A.L);let ef=function(e){var t=e.decimal,r=(0,h.jO)().isCentroid,o=(0,f.g)().isEditing,i=((0,g.LH)(o,["symbol"])||{}).symbol;return(0,n.jsx)(ed,{children:i?(0,n.jsxs)(n.Fragment,{children:[!r&&(0,n.jsx)(Y.Z,{}),(0,n.jsx)(W,{}),(0,n.jsx)(J,{})]}
1):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ei,{decimal:t}),(0,n.jsx)(el,{decimal:t})]})})};var ep=function(e){var t,r=e.orderId,i=e.onCancel,c=e.stopLoss,u=e.takeProfit,T=e.skipConfirmation,O=void 0!==T&&T,y=(0,a.$G)().t,E=(0,U.Zb)(r),b=(0,h.Cl)(),m=(0,L.j)().getErrorSnackbarProps,I=(0,g.GG)(),S=(0,Z.Kg)(),_=(0,o.useRef)(E),P=(0,o.useRef)(!1);(0,o.useEffect)(function(){(null==E?void 0:E.symbol)&&(_.current=E)},[E]);var C=_.current||{},x=C.symbolType,R=C.orderType,N=C.symbol,j=eT(_.current),G=D({marketOrder:_.current,stopLoss:c,takeProfit:u,allowSavingUnchangedValues:O&&(void 0!==c||void 0!==u),onSuccess:function(){b&&(0,d.ur)({message:y("Position has been updated."),messageType:d.KK.SUCCESS})},onError:function(e){var t=m(e),n=t.message,o=t.messageType;O&&(K._.revertEditTrackOrderPrice({orderId:r,isPendingOrder:!1}),null==i||i()),(0,d.ur)({message:n,messageType:o,zIndex:1002})},onValidateFail:O?function(e){null==i||i(),(0,d.ur)({message:(0,A.gb)(e,{stopLoss:c,takeProfit:u},_.current),messageType:d.KK.ERROR,zIndex:1002})}:void 0,showTradeConfirmationModal:B.d}),F=G.onSubmit,z=G.formMethods,V=(0,o.useCallback)(function(e){F({onEditModalCancel:e.onCancel})},[F]);(0,o.useEffect)(function(){v._.setOrderTypeLabelFromOrderType(R)},[R]),(0,o.useEffect)(function(){return N&&k.N.initEditView(N),function(){k.N.resetEditView()}},[N]),(0,o.useEffect)(function(){O&&(void 0!==c||void 0!==u)&&!P.current&&(P.current=!0,F({onEditModalCancel:i}))},[O,c,u,F,i]);var Y=(0,o.useCallback)(function(){w.q.page.actionClick({action:M.pW.EDIT_ORDER_MODAL_CANCEL_CLICKED,symbol:N}),null==i||i()},[i,N]);return O?(0,n.jsx)(f.q,{methods:z,marketOrder:_.current,children:(0,n.jsx)(ey,{})}):(0,n.jsx)(f.q,{modalType:M.XV.EDIT_MODAL,methods:z,marketOrder:_.current,children:(0,n.jsxs)(s.ZP,{variant:s.KH.CONFIRMATION,okText:(null==E?void 0:E.copyTradeInfo)?y("Update Order"):y("Update Position"),okButtonDataTestId:p.Of.EDIT_BUTTON_ORDER,cancelText:y("Cancel"),cancelButtonDataTestId:p.Of.EDIT_BUTTON_CANCEL,onCancel:Y,onOk:V,modalTitle:(null==E?void 0:E.copyTradeInfo)?y("Edit Copy Trade Order"):y("Edit Position"),loading:S,dataTestId:p.Of.EDIT_CONFIRMATION_MODAL,children:[(0,n.jsxs)(eE,{children:[(0,n.jsx)(X.Z,{orderType:R,symbol:N,orderId:r,symbolType:x,metadata:j}),(0,n.jsx)(ef,{decimal:null==(t=_.current)?void 0:t.decimal})]}),I&&(0,n.jsx)(l.ZP,{absolute:!0})]})})},eT=function(e){var t=(0,a.$G)().t,r=(0,Z.XT)(),n=(0,h.$X)(),i=(0,h.jO)(),c=i.isCentroid,l=i.isMT4,s=e||{},u=s.notional,d=s.openPrice,f=s.units,T=s.lotSize,O=s.decimal,y=s.fillPolicy;return(0,o.useMemo)(function(){var e,o,i=[{label:r===_.Zk.MARKET?(0,z.r9)(z.tM.ENTRY_PRICE,n):t("Price"),value:(0,G.Wi)(d,O),testID:p.Of.EDIT_ENTRY_PRICE},{label:c?t("Net Volume"):(0,z.r9)(z.tM.SIZE,n),value:null!=T?T:"-",testID:p.Of.EDIT_VOLUME}];return c&&u?i.push({label:t("Notional"),value:(0,G.Wi)(u,O),testID:p.Of.EDIT_UNITS}):c||i.push({label:t("Units"),value:(0,F._)(null!=(o=null==f||null==(e=f.toString)?void 0:e.call(f))?o:""),testID:p.Of.EDIT_UNITS}),!l&&y&&i.push({label:(0,z.r9)(z.tM.FILL_POLICY,n),value:(0,V.JE)(y),testID:p.Of.EDIT_FILL_POLICY}),i},[r,n,t,u,d,O,T,f,c,l,y])};let eO=function(e){var t=(e||{}).onCancel,r=function(e){null==t||t(),e()};(0,u.ZP)(function(t){var o,i;return(0,n.jsx)(ep,(o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),i=i={onCancel:function(){return r(t)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})};var ey=i.ZP.div.withConfig({componentId:"sc-fc8a5558-0"})(["display:none;"]),eE=i.ZP.div.withConfig({componentId:"sc-fc8a5558-1"})(["display:flex;flex-direction:column;width:488px;padding:","px ","px;padding-bottom:","px;box-sizing:border-box;"],c.A.XL,c.A.L,c.A.XXS)},37373:function(e,t,r){"use strict";r.d(t,{hX:()=>ek}),r(92222),r(88674),r(41539);
1var n=r(74512),o=r(32735),i=r(10281),a=r(81182),c=r(96838),l=r(71225),s=r(97186),u=r(88651),d=r(16689),f=r(68995),p=r(6807),T=r(56740),O=r(78766),y=r(1403),E=r(62715),b=r(38074),m=r(31378),h=r(82337),g=r(17609),v=l.A.XXL;r(68309),r(52963),r(42295),r(23673);var I=function(e){for(var t=e.max,r=e.getValue,n=e.match,o=0,i=t;o<=i;){var a=Math.floor((o+i)/2),c=r(a);if(c===n)return a;c<n?o=a+1:i=a-1}return i},S=function(e,t,r){var n=e.measureText(t).width,o=e.measureText("â¦").width;if(n<=r+1||n<=o)return t;var i=I({max:t.length,getValue:function(r){return e.measureText(t.substring(0,r)).width},match:r-o});return t.substring(0,Math.max(i,0)).trimEnd()+"â¦"},_=function(e){var t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode();if(!t)return null;var r=t.nodeValue,n=document.createRange();return{measurer:{measureText:function(e){return t.nodeValue=e,n.selectNodeContents(t),{width:n.getBoundingClientRect().width}}},dispose:function(){t.nodeValue=r}}};let P=r.p+"assets/static/trade-sharing-card-background.30bc1cd4..png";function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}}(e,t)||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 R=function(){var e,t=(0,O.bz)(),r=null!=(e=(0,O.F4)())?e:{},n=r.name,i=r.url,a=x((0,o.useState)(),2),c=a[0],l=a[1];(0,o.useEffect)(function(){if(i){var e=new Image,t=function(){return l({url:i,hasFailed:!1})},r=function(){return l({url:i,hasFailed:!0})};return e.addEventListener("load",t),e.addEventListener("error",r),e.src="/".concat(i),function(){e.removeEventListener("load",t),e.removeEventListener("error",r)}}},[i]);var s=!!i&&(null==c?void 0:c.url)===i,u=!i||s&&!!(null==c?void 0:c.hasFailed);return{backgroundImage:u?P:"/".concat(i),backgroundAlt:u?O.W6:n||O.W6,isLoading:t||!!i&&!s}},A=function(e,t){var r=x((0,o.useState)(null),2),n=r[0],i=r[1],a=(0,o.useCallback)(function(e){return i(e)},[]),c=x((0,o.useState)(e),2),l=c[0],s=c[1];return(0,o.useLayoutEffect)(function(){if(n){var r=!1,o=function(){if(!r){var o=_(n);if(o)try{o.measurer.measureText(e);var i=null!=t?t:n.clientWidth;i>0&&s(S(o.measurer,e,i))}finally{o.dispose()}}};o(),document.fonts&&document.fonts.ready.then(o);var i="undefined"==typeof ResizeObserver?void 0:new ResizeObserver(o);return null==i||i.observe(n),function(){r=!0,null==i||i.disconnect()}}},[n,e,t]),{fittedText:l,ref:a}},N=r(63450),D=i.ZP.div.withConfig({componentId:"sc-b3d96fb4-0"})(["display:flex;flex-direction:",";"],function(e){return e.$shouldReverseDir?"row-reverse":"row"}),j=(0,i.ZP)(N.ZP).withConfig({componentId:"sc-b3d96fb4-1"})(["padding:3px ","px;"],l.A.XXS),L=i.ZP.div.withConfig({componentId:"sc-e5a797d3-0"})(["display:flex;flex-direction:column;gap:","px;margin-top:","px;padding-top:","px;border-top:1px solid ",";"],l.A.XXS,l.A.REGULAR,l.A.XS,function(e){return e.$titleTextColor}),w=(0,i.ZP)(D).withConfig({componentId:"sc-e5a797d3-1"})(["align-items:center;justify-content:space-between;"]),M=(0,i.ZP)(D).withConfig({componentId:"sc-e5a797d3-2"})(["align-items:center;gap:","px;max-width:60%;"],l.A.XXS),U=i.ZP.div.withConfig({componentId:"sc-e5a797d3-3"})(["flex-shrink:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:",";text-align:right;max-width:","px;"],function(e){return e.$textColor},185);let k=function(e){var t,r=e.customLanguage,i=e.shouldReverseDir,c=e.titleTextColor,l=(0,a.$G)().t,s=(0,O.cB)(),u=s.tradeID,d=s.username,f=(0,O.EW)(),p=null!=(t=(0,g.ln)())?t:{},T=p.accountName,y=void 0===T?"":T,v=p.isDemo,I=(0,O.td)(),S=v?m.Wb.themeColors.tag.default:m.Wb.themeColors.tag.success,_=S.background,P=S.color,C=(0,o.useMemo)(function(){if(!f)return{};var e=(0,h.ZP)(f);return{dateStr:e.format(h.zT),timeStr:e.format(h.T_)}},[f]),x=C.dateStr,R=C.timeStr,N=A(String(null!=I?I:"")),D=N.fittedText,k=N.ref,K=A("@".concat(y),185),Z=K.fittedText,G=K.ref;return(0,n.jsxs)(L,{$titleTextColor:c,children:[(0,n.jsxs)(w,{$shouldReverseDir:i,children:[!!x&&(0,n.jsx)(b.ZP,{color:c,typography:E.wZ.TEXT_L_REGULAR,children:x}),(0,n.jsxs)(M,{$shouldReverseDir:i,children:[u&&I&&(0,n.jsx)(U,{ref:k,$textColor:c,children:(0,n.jsx)(b.ZP,{color:c,typography:E.wZ.TEXT_L_REGULAR,renderAs:"span",children:D})}),(0,n.jsx)(j,{backgroundColor:_,textColor:P,children:l(v?"DEMO":"LIVE",{lng:r})})]})]}),(0,n.jsxs)(w,{$shouldReverseDir:i,children:[!!R&&(0,n.jsx)(b.ZP,{color:c,typography:E.wZ.TEXT_L_REGULAR,children:R}),d&&y&&(0,n.jsx)(U,{ref:G,$textColor:c,children:(0,n.jsx)(b.ZP,{color:c,typography:E.wZ.TEXT_L_REGULAR,renderAs:"span",children:Z})})]})]})};var K=r(58944),Z=r(33007),G=(0,i.ZP)(D).withConfig({componentId:"sc-a211a4bb-0"})(["align-items:center;gap:","px;"],l.A.XXS),F=(0,i.ZP)(b.ZP).withConfig({componentId:"sc-a211a4bb-1"})(["width:96px;text-align:right;"]),z=i.ZP.div.withConfig({componentId:"sc-a211a4bb-2"})(["display:flex;padding:","px;background-color:",";"],l.A.XXS,function(e){return e.theme.themeColors.white});let V=function(){var e,t=(0,a.$G)().t,r=(0,Z.VC)().theme,o=(null!=(e=(0,O.Nk)())?e:{}).qrCodeUrl,i=(0,O.pZ)(),c=i.customLanguage,l=i.shouldReverseDir;return o?(0,n.jsxs)(G,{$shouldReverseDir:l,children:[(0,n.jsx)(F,{color:r.themeColors.white,typography:E.wZ.TEXT_S_REGULAR,children:t("Scan the QR code and find out more",{lng:c}
1)}),(0,n.jsx)(z,{children:(0,n.jsx)(K.default,{value:o,size:v})})]}):null};r(82526),r(41817);var B=r(33481),X=i.ZP.div.withConfig({componentId:"sc-36aa9c1d-0"})(["display:flex;",""],function(e){return e.$isCompact?(0,i.iv)(["flex-direction:row;align-items:baseline;justify-content:space-between;gap:","px;"],l.A.XS):(0,i.iv)(["flex-direction:column;gap:","px;"],l.A.XXXS)}),Y=i.ZP.div.withConfig({componentId:"sc-36aa9c1d-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:",";",""],function(e){return e.$textColor},function(e){return e.$isCompact&&(0,i.iv)(["flex-shrink:0;max-width:","px;"],185)}),$=i.ZP.div.withConfig({componentId:"sc-36aa9c1d-2"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:",";",""],function(e){return e.$textColor},function(e){return e.$isCompact&&(0,i.iv)(["flex:1;min-width:0;text-align:right;"])});let H=function(e){var t=e.titleText,r=e.titleTextColor,o=e.bodyText,i=e.bodyTextColor,a=e.isCompact,c=A(t,a?185:void 0),l=c.fittedText,s=c.ref,u=A(o),d=u.fittedText,f=u.ref;return(0,n.jsxs)(X,{$isCompact:a,children:[(0,n.jsx)(Y,{ref:s,$isCompact:a,$textColor:r,children:(0,n.jsx)(b.ZP,{color:r,typography:E.wZ.TEXT_L_REGULAR,renderAs:"span",children:l})}),(0,n.jsx)($,{ref:f,$isCompact:a,$textColor:i,children:(0,n.jsx)(b.ZP,{color:i,typography:E.wZ.TEXT_XL_SEMIBOLD,renderAs:"span",children:d})})]})};var W=function(e){return e?"".concat(e):"-"},Q=i.ZP.div.withConfig({componentId:"sc-d0294516-0"})(["display:flex;flex-direction:column;gap:","px;direction:ltr;"],l.A.REGULAR);let q=function(e){var t=e.bodyTextColor,r=e.customLanguage,o=e.titleTextColor,i=e.isCompact,c=(0,a.$G)().t,l=(0,O.VO)(),s=null!=l?l:{},u=s.decimal,d=s.closePrice,f=s.livePrice,p=s.openPrice,T=s.orderDetailType,y=s.symbol,E=s.tickRulesGroup,b=null!=f?f:d,m=(null==l?void 0:l.hasOwnProperty("description"))?W(l.description):"-",h=T===O.SZ.OPEN;return(0,n.jsxs)(Q,{children:[(0,n.jsx)(H,{titleText:m,titleTextColor:o,bodyText:W(y),bodyTextColor:t,isCompact:i}),(0,n.jsx)(H,{titleText:c(h?"Current Price":"Close Price",{lng:r}),titleTextColor:o,bodyText:(0,B.Wi)(b,(0,B.os)(b,E,u),!0),bodyTextColor:t,isCompact:i}),(0,n.jsx)(H,{titleText:c("Entry Price",{lng:r}),titleTextColor:o,bodyText:(0,B.Wi)(p,(0,B.os)(p,E,u),!0),bodyTextColor:t,isCompact:i})]})};var J=r(48881),ee=r(46645),et=r(16672),er=r(19367),en=function(e){var t=(0,et.M7)(e);if(void 0===t)return"--";if(0===t)return(0,B.Wi)(0,2,!1);var r=t>0?"+":"-",n=Math.abs(t);return n<et.UT?"".concat(r,"<").concat(et.UT):"".concat(r).concat((0,B.Wi)(n,2))},eo=i.ZP.div.withConfig({componentId:"sc-2ea7d654-0"})(["display:flex;flex-direction:column;gap:","px;"],l.A.XXS),ei=(0,i.ZP)(D).withConfig({componentId:"sc-2ea7d654-1"})(["align-items:center;gap:","px;"],l.A.XXS);let ea=function(e){var t,r,i=e.selectedTab,c=(0,a.$G)().t,l=(0,y.jO)().isCentroid,s=(null!=(r=(0,g.ln)())?r:{}).baseCurrency,u=(0,O.WR)(),d=u.profitColor,f=u.lossColor,p=u.titleTextColor,T=u.bodyTextColor,h=(0,O.pZ)(),v=h.customLanguage,I=h.shouldReverseDir,S=(0,O.VO)(),_=null!=S?S:{},P=_.lotSize,C=_.orderDetailType,x=_.orderType,R=void 0===x?J.pE.BUY:x,A=_.pnl,N=_.roi,D=C===O.SZ.OPEN,L=i===O.Od.PERCENTAGE,w=L?N:A,M=void 0!==P&&P>=0?J.pE.BUY:J.pE.SELL,U=l?M:R,k={backgroundColor:(t=(0,ee.em)(U))?m.Wb.themeColors.tag.success.background:m.Wb.themeColors.tag.error.background,textColor:t?m.Wb.themeColors.tag.success.color:m.Wb.themeColors.tag.error.color},K=k.backgroundColor,Z=k.textColor,G=(0,o.useMemo)(function(){return w&&0!==w?w>0?d:f:T},[w,T,d,f]);return(0,n.jsxs)(eo,{children:[(0,n.jsxs)(ei,{$shouldReverseDir:I,children:[(0,n.jsx)(b.ZP,{color:p,typography:E.wZ.TEXT_L_REGULAR,children:c(D?"Unrealised P&L":"Realised P&L",{lng:v})}),(0,n.jsx)(j,{backgroundColor:K,textColor:Z,children:(0,er.su)(U,void 0,v)})]}),(0,n.jsxs)(ei,{$shouldReverseDir:I,children:[(0,n.jsx)(b.ZP,{color:G,typography:E.wZ.DISPLAY_XL_SEMIBOLD,children:en(w)}),(0,n.jsx)(b.ZP,{color:G,typography:E.wZ.DISPLAY_XS_SEMIBOLD,children:L?"%":void 0===s?"USD":s})]})]})};r(91038),r(78783),r(21249);var ec=i.ZP.div.withConfig({componentId:"sc-d63b915e-0"})(["position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;width:","px;height:","px;transform:rotate(-25deg) translateX(","px) translateY(-","px);opacity:",";pointer-events:none;"],2*O.Zi,2*O.dM,l.A.XL,O.dM,.05),el=i.ZP.div.withConfig({componentId:"sc-d63b915e-1"})(["display:flex;flex-direction:row;height:60px;margin-bottom:45px;"]),es=(0,i.ZP)(b.ZP).withConfig({componentId:"sc-d63b915e-2"})(["width:125px;height:","px;margin:0 ","px;"],l.A.L,l.A.L);let eu=function(){var e=(0,Z.VC)().theme,t=(0,O.cB)().watermark,r
1=(0,O.td)();return t?(0,n.jsx)(ec,{children:Array.from({length:80}).map(function(t,o){return(0,n.jsx)(el,{children:Array.from({length:4}).map(function(t,o){return(0,n.jsx)(es,{typography:E.wZ.DISPLAY_XS_SEMIBOLD,color:e.themeColors.white,children:r},"".concat(o,"-watermark-text"))})},"".concat(o,"-watermark"))})}):null};var ed=(0,o.forwardRef)(function(e,t){var r,o=e.backgroundImage,i=e.selectedRatio,a=e.selectedTab,c=null!=(r=(0,y.rW)())?r:{},l=c.logoDarkThemePath,s=c.logoPath,u=(0,O.WR)(),d=u.titleTextColor,f=u.bodyTextColor,p=(0,O.pZ)(),T=p.customLanguage,E=p.shouldReverseDir,b=null!=l?l:s,m=i===O.Wq.RATIO_1_1,h=(0,O.I)(i);return(0,n.jsx)(ef,{ref:t,$cardHeight:h,$cardWidth:O.Zi,children:(0,n.jsxs)(ep,{$backgroundImage:o,children:[(0,n.jsx)(eu,{}),(0,n.jsxs)(eT,{children:[(0,n.jsxs)(eO,{$shouldReverseDir:E,children:[(0,n.jsx)(ey,{children:b&&(0,n.jsx)(eE,{$logoImage:"/".concat(b)})}),(0,n.jsx)(V,{})]}),(0,n.jsxs)(eb,{children:[(0,n.jsx)(ea,{selectedTab:a}),(0,n.jsx)(q,{bodyTextColor:f,customLanguage:T,titleTextColor:d,isCompact:m})]}),(0,n.jsx)(k,{customLanguage:T,shouldReverseDir:E,titleTextColor:d})]})]})})});ed.displayName="UITradeShareCard";var ef=i.ZP.div.withConfig({componentId:"sc-bb7a669-0"})(["position:relative;width:","px;height:","px;border-radius:","px;overflow:hidden;"],function(e){return e.$cardWidth},function(e){return e.$cardHeight},l.A.REGULAR),ep=i.ZP.div.withConfig({componentId:"sc-bb7a669-1"})(["position:relative;width:100%;height:100%;background-image:",";background-size:cover;background-position:center;background-repeat:no-repeat;"],function(e){var t=e.$backgroundImage;return"url('".concat(t,"')")}),eT=i.ZP.div.withConfig({componentId:"sc-bb7a669-2"})(["position:relative;display:flex;flex-direction:column;height:100%;box-sizing:border-box;padding:","px;"],l.A.XL),eO=(0,i.ZP)(D).withConfig({componentId:"sc-bb7a669-3"})(["align-items:center;justify-content:space-between;width:100%;gap:","px;margin-bottom:","px;height:36px;"],l.A.XS,l.A.M),ey=i.ZP.div.withConfig({componentId:"sc-bb7a669-4"})(["width:130px;height:","px;"],l.A.XXL),eE=i.ZP.div.withConfig({componentId:"sc-bb7a669-5"})(["width:100%;height:100%;background-image:",";background-size:contain;background-position:center;background-repeat:no-repeat;"],function(e){var t=e.$logoImage;return"url('".concat(t,"')")}),eb=i.ZP.div.withConfig({componentId:"sc-bb7a669-6"})(["display:flex;flex-direction:column;flex:1;gap:","px;"],l.A.M),em=(0,i.F4)(["0%{background-position:-468px 0;}100%{background-position:468px 0;}"]),eh=i.ZP.div.withConfig({componentId:"sc-3b31cbb9-0"})(["width:","px;height:","px;border-radius:","px;background:",";background-image:linear-gradient( to right,"," 0%,"," 20%,"," 40%,"," 100% );background-repeat:no-repeat;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:",";animation-timing-function:linear;"],O.Zi,function(e){return e.$cardHeight},l.A.REGULAR,function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.background.base},function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.background.subtle},em);let eg=function(e){var t=e.selectedRatio;return(0,n.jsx)(eh,{$cardHeight:(0,O.I)(t)})};var ev=r(80199),eI=i.ZP.div.withConfig({componentId:"sc-c1137ca6-0"})(["display:flex;align-items:center;justify-content:center;gap:","px;padding:","px ","px;"],l.A.REGULAR,l.A.XS,l.A.M);let eS=function(){var e=(0,a.$G)().t,t=(0,Z.VC)().theme,r=(0,O.cB)(),i=[{label:e("Trade ID"),dataTestId:p.Of.TRADE_SHARING_CARD_TRADE_ID_BUTTON,iconDataTestId:p.Of.TRADE_SHARING_CARD_TRADE_ID_ICON,value:O.zP.TRADE_ID},{label:e("Username"),dataTestId:p.Of.TRADE_SHARING_CARD_USERNAME_BUTTON,iconDataTestId:p.Of.TRADE_SHARING_CARD_USERNAME_ICON,value:O.zP.USERNAME},{label:e("Watermark"),dataTestId:p.Of.TRADE_SHARING_CARD_WATERMARK_BUTTON,iconDataTestId:p.Of.TRADE_SHARING_CARD_WATERMARK_ICON,value:O.zP.WATERMARK}],l=(0,o.useCallback)(function(e,t){O.Vx.updateDesignPreference(e,t)},[]);return(0,n.jsx)(eI,{children:i.map(function(e){var o=e.label,i=e.dataTestId,a=e.iconDataTestId,s=e.value,u=!!r[s],d=u?t.themeColors.primary:t.themeColors.text.muted;return(0,n.jsx)(c.ZP,{size:"regular",variant:u?c.eF.OUTLINED_THEMED:c.eF.OUTLINED,textColor:d,hoverTextColor:d,activeTextColor:d,leftSection:(0,n.jsx)(ev.ZP,{icon:u?ev.Ro.CHECKBOX_SELECTED:ev.Ro.CHECKBOX_UNSELECTED,dataTestId:a}),uppercase:!1,onClick:function(){return l(s,!u)},dataTestId:i,children:(0,n.jsx)(b.ZP,{typography:E.wZ.TEXT_M_REGULAR,color:d,children:o})},i)})})};var e_=[{value:O.Wq.RATIO_1_1,dataTestId:p.Of.TRADE_SHARING_RATIO_1_1_BUTTON},{value:O.Wq.RATIO_5_6,dataTestId:p.Of.TRADE_SHARING_RATIO_5_6_BUTTON}];let eP=function(e){var t=e.selectedRatio,r=e.onChange,i=(0,Z.VC)().theme,a=(0,o.useCallback)(function(e){return function(){r(e)}},[r]);return(0,n.jsx)(eC,{children:e_.map(function(e){var r=e.value,o=e.dataTestId,c=r===t;return(0,n.jsx)(ex,{$isSelected:c,onClick:a(r),"data-testid":o,children:(0,n.jsx)(b.ZP,{typography:E.wZ.TEXT_M_MEDIUM,color:c?i.theme
1Colors.primary:i.themeColors.text.muted,children:O.M7[r]})},o)})})};var eC=i.ZP.div.withConfig({componentId:"sc-5e6dce3a-0"})(["display:flex;align-items:center;justify-content:center;gap:","px;padding:","px ","px;"],l.A.REGULAR,l.A.XS,l.A.M),ex=i.ZP.button.withConfig({componentId:"sc-5e6dce3a-1"})(["display:flex;align-items:center;justify-content:center;padding:","px ","px;border-radius:6px;cursor:pointer;background:transparent;"," &:hover{background-color:",";}"],l.A.XS,l.A.S,function(e){var t=e.$isSelected,r=e.theme;return t?(0,i.iv)(["border:1px solid ",";"],r.themeColors.primary):(0,i.iv)(["border:1px solid ",";"],r.themeColors.border.secondary)},function(e){return e.theme.themeColors.background.subtle});function eR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eA(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}var eN=function(){var e,t=document.createElement("style");return document.head.appendChild(t),null==(e=t.sheet)||e.insertRule("body { line-height: ".concat(.5," !important; }")),function(){return t.remove()}},eD=function(e){var t,i,l=e.onCancel,u=(0,a.$G)().t,y=(0,o.useRef)(null),E=(null!=(i=(0,O.VO)())?i:{}).orderId,b=R(),m=b.backgroundImage,h=b.isLoading,g=(0,O._H)(),v=(0,O.rT)(),I=(0,O.gt)(),S=(t=(0,o.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){c=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return eR(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eR(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_=S[0],P=S[1],C=[{label:u("Percentage"),value:O.Od.PERCENTAGE,dataTestId:p.Of.TRADE_SHARING_TAB_PERCENTAGE},{label:u("Currency"),value:O.Od.CURRENCY,dataTestId:p.Of.TRADE_SHARING_TAB_CURRENCY}],x=(0,o.useCallback)(function(e){O.Vx.updateCardTab(e)},[]),A=(0,o.useCallback)(function(e){O.Vx.updateCardRatio(e)},[]),N=(0,o.useCallback)(function(){var e;return(e=function(){var e,t,n;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(l){var s=[c,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:if(!y.current)return[2];P(!0),e=eN(),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,r.e("36").then(r.t.bind(r,67907,23))];case 2:return[4,(0,o.sent().default)(y.current,{backgroundColor:null,scale:2,useCORS:!0})];case 3:return t=o.sent(),(n=document.createElement("a")).download="trade-share-".concat(E,"-").concat(Date.now(),".png"),n.href=t.toDataURL("image/png"),n.click(),(0,d.ur)({message:I?u("Image saved successfully. Position has been closed."):u("Image saved successfully"),messageType:T.KK.SUCCESS}),I&&(null==l||l()),[3,6];case 4:return console.error("Failed to save trade sharing card image",o.sent()),(0,d.ur)({message:u("Failed to save image"),messageType:T.KK.ERROR}),[3,6];case 5:return e(),P(!1),[7];case 6:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){eA(i,n,o,a,c,"next",e)}function c(e){eA(i,n,o,a,c,"throw",e)}a(void 0)})})()},[I,l,E,u]);return(0,n.jsx)(s.ZP,{variant:s.KH.CONFIRMATION,modalTitle:u("Share to your friends"),onCancel:l,dataTestId:p.Of.TRADE_SHARING_MODAL,footer:(0,n.jsxs)(ej,{children:[(0,n.jsx)(c.ZP,{variant:c.eF.OUTLINED_THEMED,onClick:l,dataTestId:p.Of.TRADE_SHARING_CARD_CANCEL_BUTTON,children:u("Close")}),(0,n.jsx)(c.ZP,{variant:c.eF.FILLED_THEMED,onClick:N,loading:_,disabled:h,dataTestId:p.Of.TRADE_SHARING_CARD_SAVE_BUTTON,children:u("Save")})]}),children:(0,n.jsx)(eL,{children:(0,n.jsxs)(ew,{children:[(0,n.jsx)(eM,{children:(0,n.jsx)(f.Z,{stretch:!0,variant:f.N.INNER_GROUP,tabList:C,selectedValue:g,onClick:x,dataTestId:p.Of.TRADE_SHARING_TAB})}),(0,n.jsx)(eU,{children:h?(0,n.jsx)(eg,{selectedRatio:v}):(0,n.jsx)(ed,{ref:y,backgroundImage:m,selectedRatio:v,selectedTab:g})}),(0,n.jsx)(eP,{selectedRatio:v,onChange:A}),(0,n.jsx)(eS,{})]})})})},ej=i.ZP.div.withConfig({componentId:"sc-847d2f1a-0"})(["display:flex;justify-content:flex-end;
1gap:","px;padding:","px;"],l.A.S,l.A.L),eL=i.ZP.div.withConfig({componentId:"sc-847d2f1a-1"})(["display:flex;justify-content:center;width:488px;padding-top:","px;"],l.A.XL),ew=i.ZP.div.withConfig({componentId:"sc-847d2f1a-2"})(["display:flex;flex-direction:column;width:393px;"]),eM=i.ZP.div.withConfig({componentId:"sc-847d2f1a-3"})(["padding:","px ","px;"],l.A.XS,l.A.M),eU=i.ZP.div.withConfig({componentId:"sc-847d2f1a-4"})(["display:flex;justify-content:center;padding:","px;"],l.A.XS),ek=function(e){var t=(null!=e?e:{}).onCancel;O.Vx.init();var r=function(e){null==t||t(),O.Vx.resetSelectedOrder(),e()};(0,u.ZP)(function(t){var i,a;return(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(eD,(i=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),a=a={onCancel:function(){return r(t)}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i))})})}},81624:function(e,t,r){"use strict";r.d(t,{wD:()=>H,iu:()=>ec,Y1:()=>es,Hp:()=>eo,yQ:()=>ee,Jr:()=>Q,Sg:()=>ea,Io:()=>et,K3:()=>ed,vM:()=>q,DF:()=>en,Dc:()=>J}),r(9653),r(35192);var n=r(74512),o=r(10281),i=r(62715),a=r(63450),c=r(38074),l=r(86653),s=r(6807),u=r(32972),d=r(95986),f=r(3082),p=r(31305),T=r(19367),O=r(33481),y=r(63913),E=r(88399),b=r(96838),m=r(80199);r(92222);var h=o.ZP.div.withConfig({componentId:"sc-c49bc9b4-0"})(["cursor:pointer;min-height:30px;display:flex;align-items:center;justify-content:center;"]),g=(0,o.ZP)(b.ZP).withConfig({componentId:"sc-c49bc9b4-1"})(["cursor:pointer;display:flex;justify-content:center;& svg{","}"],function(e){var t=e.$isActive,r=e.theme;return t?"color: ".concat(r.themeColors.icon.active,";"):""});function v(e){var t,r=e.cell,o=e.disabled,i=e.dataTestId,a=e.onClick,c=(0,p.Q8)(null!=(t=r.row.original.orderId)?t:"",p.K2.DELETE);return(0,n.jsx)(h,{className:c?"button-activated":"",onClick:function(){o||null==a||a(r.row.original)},children:(0,n.jsx)(g,{variant:b.eF.ICON_ONLY,icon:m.Ro.BULK_CLOSE_DELETE,disabled:o,dataTestId:i,$isActive:c})})}function I(e){var t,r=e.cell,o=e.disabled,i=e.dataTestId,a=e.onClick,c=(0,p.Q8)(null!=(t=r.row.original.orderId)?t:"",p.K2.EDIT);return(0,n.jsx)(h,{className:c?"button-activated":"",onClick:function(){o||null==a||a(r.row.original)},children:(0,n.jsx)(g,{variant:b.eF.ICON_ONLY,icon:m.Ro.EDIT,disabled:o,dataTestId:i,$isActive:c})})}function S(e){var t=e.cell,r=e.disabled,o=e.dataTestId,i=e.onClick;return(0,n.jsx)(h,{onClick:function(){r||null==i||i(t.row.original)},children:(0,n.jsx)(g,{variant:b.eF.ICON_ONLY,icon:m.Ro.SHARE,disabled:r,dataTestId:o})})}r(41539);var _=r(32735),P=r(6454);function C(e){var t=e.cell,r=e.disabled,o=e.dataTestId,i=e.onClick,a=(0,P.bp)(),c=(0,_.useMemo)(function(){return a.some(function(e){return e.orderId===t.row.original.orderId})},[a,t.row.original.orderId]);return(0,n.jsx)(h,{className:c?"button-activated":"",onClick:function(){r||null==i||i(t.row.original)},children:(0,n.jsx)(g,{variant:b.eF.ICON_ONLY,icon:m.Ro.TRACK_ORDER,disabled:r,dataTestId:o,$isActive:c})})}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function R(e){var t=e.type,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["type"]);return t===p.K2.TRACK?(0,n.jsx)(C,x({},r)):t===p.K2.CLOSE||t===p.K2.DELETE?(0,n.jsx)(v,x({},r)):t===p.K2.EDIT?(0,n.jsx)(I,x({},r)):t===p.K2.SHARE?(0,n.jsx)(S,x({},r)):null}
1r(88674);var A=r(1403);function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var D=(0,_.lazy)(function(){return r.e("4240").then(r.bind(r,61882))}),j=(0,_.lazy)(function(){return r.e("759").then(r.bind(r,6091))}),L=(0,_.lazy)(function(){return r.e("7622").then(r.bind(r,4837))});let w=function(e){var t=(0,A.jO)(),r=t.isHorizon,o=t.isCentroid,i=(0,A._9)(),a=(0,_.useMemo)(function(){return o?(0,n.jsx)(L,N({},e)):r?(0,n.jsx)(D,N({},e)):(0,n.jsx)(j,N({},e))},[o,r,e]);return i?null:(0,n.jsx)(_.Suspense,{children:a})};var M=r(17609);let U=function(e){var t=e.order,r=e.dataTestId,o=(0,A.jO)().isCentroid,i=(0,M.MO)(["leverage"]).leverage,a=(0,_.useMemo)(function(){return(0,T.XC)(t,o,i)},[t,o,i]);return(0,n.jsx)(c.ZP,{dataTestId:r,children:(0,O.Wi)(a,2,!0)})};var k=r(51015);let K=function(e){var t=e.symbol,r=e.dataTestId,o=(0,k.Zb)(t).marketValue;return(0,n.jsx)(c.ZP,{dataTestId:r,children:(0,O.Wi)(Number(o),2)})};function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var G=(0,_.lazy)(function(){return r.e("7655").then(r.bind(r,70239))}),F=(0,_.lazy)(function(){return r.e("8540").then(r.bind(r,13065))}),z=(0,_.lazy)(function(){return r.e("8034").then(r.bind(r,61706))});let V=function(e){var t=e.isStatic,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["isStatic"]),o=(0,A.jO)().isHorizon;return(0,n.jsx)(_.Suspense,{children:o?(0,n.jsx)(z,Z({},r)):(0,n.jsx)(n.Fragment,{children:t?(0,n.jsx)(G,Z({},r)):(0,n.jsx)(F,Z({},r))})})};function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var X=(0,_.lazy)(function(){return r.e("2153").then(r.bind(r,69370))}),Y=(0,_.lazy)(function(){return r.e("5786").then(r.bind(r,63404))});let $=function(e){var t=(0,A.jO)().isHorizon;return(0,n.jsx)(_.Suspense,{children:t?(0,n.jsx)(X,B({},e)):(0,n.jsx)(Y,B({},e))})};function H(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,a=e.formatter,l=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==i&&i,meta:e.meta,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=e.getValue(),o=null==(t=e.row)?void 0:t.original;return"function"==typeof a&&("number"==typeof r||"string"==typeof r)&&(r=a(r,o)),(0,n.jsx)(c.ZP,{dataTestId:l,children:null!=r?r:"--"})}}}var W=o.ZP.div.withConfig({componentId:"sc-a26b0398-0"})(["width:fit-content;"]);function Q(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,l=e.formatter,s=e.getVariant,u=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=e.getValue(),o=null==(t=e.row)?void 0:t.original;return r?(0,n.jsx)(W,{children:(0,n.jsx)(a.ZP,{dataTestId:u,variant:s(r),children:null==l?void 0:l(r,o)})}):(0,n.jsx)(c.ZP,{children:"--"})}}}function q(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,a=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=Number(e.getValue());return Number.isFinite(r)&&(t=(0,O.Wi)(r,(0,u.N)(r))),(0,n.jsx)(c.ZP,{dataTestId:a,children:null!=t?t:"--"})}}}function J(e){var t=e.accessorKey,r=e.headerText,o=e.size,a=e.sortDescFirst,l=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==a&&a,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r,o=e.getValue(),a=null==(r=e.row)||null==(t=r.original)?void 0:t.symbolType,c=a?(0,y.g8)(o,a):o;return(0,n.jsx)(ef,{typography:i.wZ.TEXT_M_REGULAR,dataTestId:l,children:c||"--"})}}}function ee(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,a=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r,o,i,l,s,u,d=e.getValue(),f=(null==(r=e.row)||null==(t=r.original)?void 0:t.t
1ickRulesGroup)||[],p=null!=(u=null==(i=e.row)||null==(o=i.original)?void 0:o.decimal)?u:null==(s=e.row.getParentRow())||null==(l=s.original)?void 0:l.decimal;return(0,n.jsx)(c.ZP,{dataTestId:a,children:(0,O.Wi)(d,(0,O.os)(d,f,p),!0)})}}}function et(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.columnPreferenceOrderType,a=e.cellTestId;return{accessorKey:t,id:"lastPrice",size:o,enableSorting:!1,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=null==(t=e.row)?void 0:t.original;if(!(null==r?void 0:r.symbol))return(0,n.jsx)(c.ZP,{dataTestId:a,children:"--"});if(r.copyTradeInfo){var o=e.getValue();return(0,n.jsx)(c.ZP,{dataTestId:a,children:(0,O.Wi)(o,r.decimal)})}return(0,n.jsx)(w,{order:r,columnPreferenceOrderType:i,dataTestId:a})}}}var er=function(e,t,r){return(Number(e.getValue(r))||0)-(Number(t.getValue(r))||0)};function en(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,a=e.isStatic,l=void 0===a||a,s=e.cellTestId;return{accessorKey:t,id:"pnlGross",size:o,sortDescFirst:void 0!==i&&i,sortingFn:er,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=null==(t=e.row)?void 0:t.original;return(0,n.jsx)(V,{dataTestId:s,symbol:r.symbol,order:r,isStatic:l})}}}function eo(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.cellTestId;return{accessorKey:t,id:"roi",size:o,enableSorting:!1,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=null==(t=e.row)?void 0:t.original;return(0,n.jsx)($,{dataTestId:i,order:r})}}}var ei=function(e,t){var r=e.original,n=t.original,o=d.k.getAccountLeverage(),i=f._.getCompanyIntegration()===l.wS.CENTROID;return(0,T.XC)(r,i,o)-(0,T.XC)(n,i,o)};function ea(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,a=e.cellTestId;return{accessorKey:t,id:"marginUsed",size:o,sortDescFirst:void 0!==i&&i,sortingFn:ei,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t,r=null==(t=e.row)?void 0:t.original;return(0,n.jsx)(U,{dataTestId:a,order:r})}}}function ec(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.cellTestId;return{accessorKey:t,id:"marketValue",size:o,enableSorting:!1,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t=e.getValue();return(0,n.jsx)(K,{dataTestId:i,symbol:t})}}}var el=function(e,t,r){return(0,T.Lx)(e.getValue(r)).localeCompare((0,T.Lx)(t.getValue(r)))};function es(e){var t=e.accessorKey,r=e.headerText,o=e.size,i=e.sortDescFirst,a=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==i&&i,sortingFn:el,header:function(){return(0,n.jsx)(c.ZP,{children:r})},cell:function(e){var t=e.getValue();return(0,n.jsx)(c.ZP,{children:(0,n.jsx)(E.Z,{orderType:t,dataTestId:a})})}}}var eu=function(e,t){var r,n,o,i,a,c,l,u,d,f;switch(e){case p.K2.CLOSE:case p.K2.DELETE:return{isEnable:null==t||null==(n=t.row)||null==(r=n.original)?void 0:r.closable,testId:s.Of.ASSET_OPEN_BUTTON_CLOSE};case p.K2.EDIT:return{isEnable:null==t||null==(i=t.row)||null==(o=i.original)?void 0:o.editable,testId:s.Of.ASSET_OPEN_BUTTON_EDIT};case p.K2.TRACK:return{isEnable:(null==t||null==(c=t.row)||null==(a=c.original)?void 0:a.trackable)&&!(null==t||null==(u=t.row)||null==(l=u.original)?void 0:l.copyTradeInfo),testId:s.Of.ASSET_OPEN_BUTTON_TRACK};case p.K2.SHARE:return{isEnable:null==t||null==(f=t.row)||null==(d=f.original)?void 0:d.isEnable,testId:s.Of.ASSET_OPEN_BUTTON_SHARE};default:return{isEnable:!1,testId:void 0}}};function ed(e){var t=e.id,r=e.accessorKey,o=e.headerText,i=e.actionButtonType,a=e.size,c=e.onClick,l=e.headerAlignment,s=void 0===l?"left":l,u=e.disabled,d=e.isRowEnabled,f=e.dataTestId;return{id:t,accessorKey:r,size:a,enableSorting:!1,header:function(){return(0,n.jsx)(ep,{$alignment:s,children:o})},cell:function(e){var t,r=eu(i,e),o=r.isEnable,a=r.testId,l=u||!(null!=(t=null==d?void 0:d(e.row.original))?t:o);return(0,n.jsx)(R,{type:i,cell:e,onClick:function(){return null==c?void 0:c(e.row.original)},disabled:l,dataTestId:null!=f?f:a})},meta:{styles:{padding:"inherit"}},accessorFn:function(e){return e.orderId}}}var ef=(0,o.ZP)(c.ZP).attrs({variant:c.fD.TRUNCATED}).withConfig({componentId:"sc-a26b0398-1"})(["color:",";"],function(e){return e.theme.themeColors.text.strong}),ep=(0,o.ZP)(c.ZP).withConfig({componentId:"sc-a26b0398-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,t,r){"use strict";r.d(t,{w:()=>ec,b:()=>ef}),r(41539),r(57327),r(21249),r(26833);var n=r(32735),o=r(81182),i=r(11750),a=r(16689),c=r(86653),l=r(43545),s=r(907),u=r(479),d=r
1(30418),f=r(20787),p=r(17609),T=r(1403),O=r(71028),y=r(57753),E=r(41174),b=r(78562),m=r(37528),h=r(56740),g=r(31305),v=r(78766),I=r(74370),S=r(48260),_=r(19367),P=r(92963);r(66992),r(33948);var C=r(74512),x=r(10281),R=r(62715),A=r(71225),N=r(97186),D=r(88651),j=r(38074),L=r(73407),w=r(38416),M=r(63913),U=function(e){var t=e.orderId,r=e.values,a=e.onCancel,c=(0,o.$G)().t,u=(0,i.s0)(),d=r.copierId,f=r.copiedSignalId,p=r.symbol,O=r.symbolType,y=(0,w.iw)(),b=(0,T.$X)(),m=(0,n.useCallback)(function(){w.bD.closeCopyTradeOrder({values:{copierId:d,copiedSignalId:f},onSuccess:function(){null==a||a()},onError:function(e){switch(e){case L.c4.PW_1005:E.$.onOrderSelectedTabChanged(l.ZV.COPY_TRADE_PROFILE);break;case L.c4.PW_1003:u(s.oI.COPY_TRADE)}null==a||a()}})},[d,f,a,u]);return(0,C.jsx)(N.ZP,{variant:N.KH.CONFIRMATION,modalTitle:c("Confirm Close Copy Trade Position"),okText:c("Confirm"),onOk:m,cancelText:c("Cancel"),onCancel:a,loading:y,children:(0,C.jsxs)(k,{children:[(0,C.jsx)(Z,{typography:R.wZ.TEXT_L_MEDIUM,children:(0,M.g8)(p,O)}),t&&(0,C.jsxs)(K,{children:[(0,C.jsx)(G,{typography:R.wZ.TEXT_M_REGULAR,children:(0,P.r9)(P.tM.MARKET_ORDER_NO,b)}),(0,C.jsx)(F,{typography:R.wZ.TEXT_M_REGULAR,children:t})]})]})})},k=x.ZP.div.withConfig({componentId:"sc-ce057d1c-0"})(["width:100%;box-sizing:border-box;display:flex;flex-direction:column;padding:","px ","px ","px;gap:","px;"],A.A.L,A.A.L,A.A.XXS,A.A.XXS),K=x.ZP.div.withConfig({componentId:"sc-ce057d1c-1"})(["display:flex;flex-direction:row;justify-content:space-between;"]),Z=(0,x.ZP)(j.ZP).withConfig({componentId:"sc-ce057d1c-2"})(["flex:1;color:",";"],function(e){return e.theme.themeColors.text.strong}),G=(0,x.ZP)(j.ZP).withConfig({componentId:"sc-ce057d1c-3"})(["color:",";"],function(e){return e.theme.themeColors.text.strong}),F=(0,x.ZP)(j.ZP).withConfig({componentId:"sc-ce057d1c-4"})(["color:",";"],function(e){return e.theme.themeColors.text.strong});let z=function(e){var t=(e||{}).onCancel,r=function(e){null==t||t(),e()};(0,D.ZP)(function(t){var n,o;return(0,C.jsx)(U,(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),o=o={onCancel:function(){return r(t)}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))})};var V=r(82100),B=r(76991),X=r(37373),Y=r(81624),$=r(99684);r(9653);var H=r(6807),W=r(82337),Q=r(3082),q=r(33481);function J(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ee=function(e){var t;return J(t={},l.j7.OPEN_TIME,(0,Y.wD)({cellTestId:H.Of.ASSET_OPEN_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Open Date"),size:160,formatter:function(e){return Q._.convertToDayjsWithOffset({input:Number(e)}).format(W.ju)}})),J(t,l.j7.ORDER_NO,(0,Y.wD)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order No.")})),J(t,l.j7.SYMBOL,(0,Y.Dc)({cellTestId:H.Of.ASSET_OPEN_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),t},et=function(e){var t;return J(t={},l.j7.TYPE,(0,Y.Y1)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Type")})),J(t,l.j7.PROFIT_LOSS,(0,Y.DF)({cellTestId:H.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"profit",headerText:e("Profit/Loss"),isStatic:!1})),J(t,l.j7.ROI_PERCENT,(0,Y.Hp)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"profit",headerText:e("ROI%")})),J(t,l.j7.VOLUME,(0,Y.vM)({accessorKey:"lotSize",headerText:e("Volume"),cellTestId:H.Of.ASSET_OPEN_COLUMN_VOLUME})),J(t,l.j7.UNITS,(0,Y.vM)({accessorKey:"units",headerText:e("Units"),cellTestId:H.Of.ASSET_OPEN_COLUMN_UNITS}
1)),J(t,l.j7.MARGIN_USED,(0,Y.Sg)({accessorKey:"marginRate",headerText:e("Margin Used"),cellTestId:H.Of.ASSET_OPEN_COLUMN_MARGIN_USED})),J(t,l.j7.ENTRY_PRICE,(0,Y.yQ)({accessorKey:"openPrice",headerText:e("Entry Price"),cellTestId:H.Of.ASSET_OPEN_COLUMN_ENTRY_PRICE})),J(t,l.j7.CURRENT_PRICE,(0,Y.Io)({accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:l.ZV.OPEN_POSITION,cellTestId:H.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE})),J(t,l.j7.TAKE_PROFIT,(0,Y.yQ)({accessorKey:"takeProfit",headerText:e("Take Profit"),cellTestId:H.Of.ASSET_OPEN_COLUMN_TAKE_PROFIT})),J(t,l.j7.STOP_LOSS,(0,Y.yQ)({accessorKey:"stopLoss",headerText:e("Stop Loss"),cellTestId:H.Of.ASSET_OPEN_COLUMN_STOP_LOSS})),J(t,l.j7.SWAP,(0,Y.wD)({accessorKey:"swap",headerText:e("Swap"),formatter:function(e){return(0,q.Wi)(Number(e),2)},cellTestId:H.Of.ASSET_OPEN_COLUMN_SWAP})),J(t,l.j7.COMMENT,(0,Y.wD)({accessorKey:"comment",headerText:e("Comment"),cellTestId:H.Of.ASSET_OPEN_COLUMN_COMMENT})),t},er=function(e){var t;return J(t={},l.j7.TYPE,(0,Y.Y1)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Type")})),J(t,l.j7.PROFIT_LOSS,(0,Y.DF)({cellTestId:H.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"profit",headerText:e("Profit/Loss"),isStatic:!1})),J(t,l.j7.ROI_PERCENT,(0,Y.Hp)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"profit",headerText:e("ROI%")})),J(t,l.j7.SIZE,(0,Y.vM)({accessorKey:"lotSize",headerText:e("Size"),cellTestId:H.Of.ASSET_OPEN_COLUMN_VOLUME})),J(t,l.j7.UNITS,(0,Y.vM)({accessorKey:"units",headerText:e("Units"),cellTestId:H.Of.ASSET_OPEN_COLUMN_UNITS})),J(t,l.j7.MARGIN_USED,(0,Y.Sg)({accessorKey:"marginRate",headerText:e("Margin Used"),cellTestId:H.Of.ASSET_OPEN_COLUMN_MARGIN_USED})),J(t,l.j7.ENTRY_PRICE,(0,Y.yQ)({accessorKey:"openPrice",headerText:e("Entry Price"),cellTestId:H.Of.ASSET_OPEN_COLUMN_ENTRY_PRICE})),J(t,l.j7.CURRENT_PRICE,(0,Y.Io)({accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:l.ZV.OPEN_POSITION,cellTestId:H.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE})),J(t,l.j7.TAKE_PROFIT,(0,Y.yQ)({accessorKey:"takeProfit",headerText:e("Take Profit"),cellTestId:H.Of.ASSET_OPEN_COLUMN_TAKE_PROFIT})),J(t,l.j7.STOP_LOSS,(0,Y.yQ)({accessorKey:"stopLoss",headerText:e("Stop Loss"),cellTestId:H.Of.ASSET_OPEN_COLUMN_STOP_LOSS})),J(t,l.j7.SWAP,(0,Y.wD)({accessorKey:"swap",headerText:e("Swap"),formatter:function(e){return(0,q.Wi)(Number(e),2)},cellTestId:H.Of.ASSET_OPEN_COLUMN_SWAP})),J(t,l.j7.COMMISSION,(0,Y.yQ)({accessorKey:"commission",headerText:e("Commission"),cellTestId:H.Of.ASSET_OPEN_COLUMN_COMMISSION})),J(t,l.j7.COMMENT,(0,Y.wD)({accessorKey:"comment",headerText:e("Comment"),cellTestId:H.Of.ASSET_OPEN_COLUMN_COMMENT})),t},en=function(e){var t;return J(t={},l.j7.ORDER_NO,(0,Y.wD)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Position ID")})),J(t,l.j7.SYMBOL,(0,Y.Dc)({cellTestId:H.Of.ASSET_OPEN_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),J(t,l.j7.VOLUME,(0,Y.vM)({accessorKey:"lotSize",headerText:e("Net Volume"),cellTestId:H.Of.ASSET_OPEN_COLUMN_VOLUME})),t},eo=function(e){var t;return J(t={},l.j7.MARGIN_USED,(0,Y.Sg)({accessorKey:"marginRate",headerText:e("Margin Used"),cellTestId:H.Of.ASSET_OPEN_COLUMN_MARGIN_USED})),J(t,l.j7.PROFIT_LOSS,(0,Y.DF)({cellTestId:H.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"profit",headerText:e("Profit/Loss"),isStatic:!1})),J(t,l.j7.ROI_PERCENT,(0,Y.Hp)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"profit",headerText:e("ROI%")})),J(t,l.j7.ENTRY_PRICE,(0,Y.yQ)({accessorKey:"openPrice",headerText:e("Avg Entry Price"),cellTestId:H.Of.ASSET_OPEN_COLUMN_ENTRY_PRICE})),J(t,l.j7.CURRENT_PRICE,(0,Y.Io)({accessorKey:"currentPrice",headerText:e("Market Price"),cellTestId:H.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE,columnPreferenceOrderType:l.ZV.OPEN_POSITION})),J(t,l.j7.NOTIONAL,(0,Y.wD)({accessorKey:"notional",headerText:e("Notional"),cellTestId:H.Of.ASSET_OPEN_COLUMN_NOTIONAL,formatter:function(e){return(0,q.Wi)(Number(e),2)}})),J(t,l.j7.TAKE_PROFIT,(0,Y.yQ)({accessorKey:"takeProfit",headerText:e("Take Profit"),cellTestId:H.Of.ASSET_OPEN_COLUMN_TAKE_PROFIT})),J(t,l.j7.STOP_LOSS,(0,Y.yQ)({accessorKey:"stopLoss",headerText:e("Stop Loss"),cellTestId:H.Of.ASSET_OPEN_COLUMN_STOP_LOSS})),J(t,l.j7.SWAP,(0,Y.wD)({accessorKey:"swap",headerText:e("Swap"),cellTestId:H.Of.ASSET_OPEN_COLUMN_SWAP,formatter:function(e){return(0,q.Wi)(Number(e),2)}})),J(t,l.j7.COMMISSION,(0,Y.yQ)({accessorKey:"commission",headerText:e("Commission"),
1cellTestId:H.Of.ASSET_OPEN_COLUMN_COMMISSION})),t},ei=function(e){var t;return J(t={},l.j7.SYMBOL,(0,Y.Dc)({cellTestId:H.Of.ASSET_OPEN_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol Name"),size:200})),J(t,l.j7.SIZE,(0,Y.vM)({cellTestId:H.Of.ASSET_OPEN_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Quantity")})),t},ea=function(e){var t;return J(t={},l.j7.PROFIT_AND_LOSS,(0,Y.DF)({cellTestId:H.Of.ASSET_OPEN_COLUMN_PROFIT,accessorKey:"symbol",headerText:e("Profit/Loss(%)")})),J(t,l.j7.ROI_PERCENT,(0,Y.Hp)({cellTestId:H.Of.ASSET_OPEN_COLUMN_ROI,accessorKey:"symbol",headerText:e("ROI%")})),J(t,l.j7.LAST_PRICE,(0,Y.Io)({cellTestId:H.Of.ASSET_OPEN_COLUMN_CURRENT_PRICE,accessorKey:"lastPrice",headerText:e("Last Price"),columnPreferenceOrderType:l.ZV.OPEN_POSITION})),J(t,l.j7.AVG_BOUGHT_PRICE,(0,Y.yQ)({cellTestId:H.Of.ASSET_OPEN_COLUMN_AVG_BOUGHT_PRICE,accessorKey:"avgBoughtPrice",headerText:e("Avg Bought Price")})),J(t,l.j7.AVG_SOLD_PRICE,(0,Y.yQ)({cellTestId:H.Of.ASSET_OPEN_COLUMN_AVG_SOLD_PRICE,accessorKey:"avgSoldPrice",headerText:e("Avg Sold Price")})),J(t,l.j7.MARKET_VALUE,(0,Y.iu)({cellTestId:H.Of.ASSET_OPEN_COLUMN_MARKET_VALUE,accessorKey:"symbol",headerText:e("Market Value")})),t},ec=function(e){var t=e.positionId,r=e.t,n=void 0===r?u.ag.t.bind(u.ag):r,o=e.onError,i=T.lj.getCompanyIntegration()!==c.wS.CENTROID;S._.oneClickCloseMarketOrder({positionId:t,onSuccess:function(){i&&(0,a.ur)({message:n("Position has been closed."),messageType:h.KK.SUCCESS})},onError:function(e){(0,a.ur)({message:e,messageType:h.KK.ERROR}),null==o||o()}})},el=function(e,t,r){return(0,Y.K3)({id:"delete",size:50,accessorKey:"orderId",headerText:t("Close"),actionButtonType:g.K2.DELETE,headerAlignment:"center",disabled:r,onClick:function(n){if(!r){var o=(0,m.DC)(e,n);if(g.XR.addActiveRow(o,g.K2.DELETE),n.copyTradeInfo&&n.closable&&z({orderId:n.orderId,values:{copierId:n.copyTradeInfo.copierId,copiedSignalId:n.copyTradeInfo.copySignalId,symbol:n.symbol,symbolType:n.symbolType},onCancel:function(){g.XR.removeActiveRow(o,g.K2.DELETE)}}),!n.copyTradeInfo&&n.closable){var i=function(){(0,V.K)({positionId:o,onCancel:function(){g.XR.removeActiveRow(o,g.K2.DELETE)}})};f.j.getIsOneClickTradingEnabled()?ec({positionId:o,t:t,onError:function(){return i()}}):i()}}}})},es=function(e){return(0,Y.K3)({id:"edit",size:50,accessorKey:"orderId",headerText:(0,P.Oh)(),actionButtonType:g.K2.EDIT,headerAlignment:"center",disabled:e,onClick:function(t){var r=t.orderId,n=t.symbol,o=t.orderType,i=t.editable;
1!e&&(O.q.order.editOrderClick({symbol:n,direction:(0,_.GI)((0,_.cj)(o)),orderType:(0,_.oi)(o),positionModuleTab:y.of.OPEN_POSITIONS}),g.XR.addActiveRow(r,g.K2.EDIT),i&&(0,B.Z)({orderId:r,onCancel:function(){g.XR.removeActiveRow(r,g.K2.EDIT)}}))}})},eu=function(e,t,r){return(0,Y.K3)({id:"share",size:50,accessorKey:"orderId",headerText:e("Share"),actionButtonType:g.K2.SHARE,headerAlignment:"center",onClick:function(e){var n,o,i=E.$.getOrderSymbolPricesById(e.symbol),a=i.liveBuy,c=i.liveSell,l={liveBuy:a||e.currentPrice,liveSell:c||e.currentPrice},s=(0,m.qB)(l.liveBuy,l.liveSell,e.orderType,!0);v.Vx.setSelectedOrder((n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),o=o={livePrice:s,pnl:(0,_.Jy)(e,l),roi:(0,_.ed)(e,l,t,r),orderDetailType:v.SZ.OPEN},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n)),v.Vx.setImageCreatedAt(new Date),(0,X.hX)()}})},ed=function(e,t,r){return(0,Y.K3)({id:"track",size:50,accessorKey:"orderId",headerText:r("Track"),actionButtonType:g.K2.TRACK,headerAlignment:"center",onClick:function(r){var n=r.symbol,o=r.decimal,i=r.orderType,a=r.stopLoss,c=r.takeProfit,l=r.openPrice,s=r.closable,u=r.editable,d=r.marketFillPolicy,f=r.orderId,p=!I._.orderTrackers.some(function(e){return e.orderId===f}),T={symbol:n,orderId:f,decimal:o,orderType:i,stopLoss:a,takeProfit:c,entryPrice:l,isClosable:(0,_.HS)({marketFillPolicy:d,flag:s}),isEditable:(0,_.HS)({marketFillPolicy:d,flag:u})};O.q.order.trackOrderClick({trackOrderParams:T,livePrice:E.$.getOrderSymbolLivePrice({id:String(f),orderType:i,isOpenPosition:!0}),positionModuleTab:y.of.OPEN_POSITIONS,isTracking:p}),(0,$.v)({navigate:t,nextTrackingState:p,orderId:f,pathname:e,symbol:n,trackOrderParams:T})}})},ef=function(){var e=(0,o.$G)().t,t=(0,d.eZ)(l.ZV.OPEN_POSITION),r=(0,T.$X)(),a=(0,b.ry)(),u=(0,p.kz)(),f=(0,T.c)().hasTradeSharingCard,O=(0,p.MO)(["leverage"]).leverage,y=r===c.wS.CENTROID,E=(0,i.TH)().pathname,m=(0,i.s0)();return{tableColumns:(0,n.useMemo)(function(){var n={},o=t.filter(function(e){return e.visible}).map(function(e){return e.label});switch(r){case c.wS.HORIZON:n=ei(e);var i=ea(e);o.forEach(function(e){i[e]&&(n[e]=i[e])}),f&&(n.shareAction=eu(e,y,O)),n.deleteAction=el(r,e,u);break;case c.wS.CENTROID:n=en(e);var l=eo(e);o.forEach(function(e){l[e]&&(n[e]=l[e])}),n.trackAction=ed(E,m,e),n.editAction=es(u),f&&(n.shareAction=eu(e,y,O)),n.deleteAction=el(r,e,u);break;case c.wS.METATRADER5:n=ee(e);var d=et(e);o.forEach(function(e){d[e]&&(n[e]=d[e])}),n.trackAction=ed(E,m,e),n.editAction=es(u),f&&(n.shareAction=eu(e,y,O)),n.deleteAction=el(r,e,u);break;default:n=ee(e);var p=er(e);o.forEach(function(e){p[e]&&(n[e]=p[e])}),n.trackAction=ed(E,m,e),n.editAction=es(u),f&&(n.shareAction=eu(e,y,O)),n.deleteAction=el(r,e,u)}return E!==s.oI.TRADE||r===c.wS.HORIZON||a||delete n.SYMBOL,Object.values(n).filter(function(e){return!!e})},[t,r,E,a,e,u,m,f,y,O])}}},23582:function(e,t,r){"use strict";r.d(t,{h:()=>B,A:()=>H}),r(41539),r(39714),r(57327),r(21249),r(26833);var n=r(32735),o=r(81182),i=r(11750),a=r(16689),c=r(86653),l=r(43545),s=r(907),u=r(479),d=r
1(84451),f=r(20787),p=r(17609),T=r(1403),O=r(71028),y=r(57753),E=r(51015),b=r(41174),m=r(56740),h=r(31305),g=r(74370),v=r(39153),I=r(53094),S=r(16672),_=r(19367),P=r(82100),C=r(57475),x=r(81624),R=r(99684);r(9653),r(35192),r(92222);var A=r(6807),N=r(82337),D=r(32972),j=r(3082),L=r(64536),w=r(33481),M=r(92963),U=r(55869);function k(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(e){var t;return k(t={openTime:(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Open Date"),formatter:function(e){return j._.convertToDayjsWithOffset({input:Number(e)}).format(N.ju)}}),orderNo:(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order No.")})},l.j7.SYMBOL,(0,x.Dc)({cellTestId:A.Of.ASSET_PENDING_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),k(t,"orderType",(0,x.Y1)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Type")})),t},Z=function(e){var t;return k(t={},l.j7.SIZE,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Size")})),k(t,l.j7.UNITS,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_UNITS,accessorKey:"units",headerText:e("Units")})),k(t,l.j7.EXPIRY,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_EXPIRY,accessorKey:"tradeExpiry",headerText:e("Expiry"),formatter:function(e){return(0,U.og)(e)}})),k(t,l.j7.PRICE,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ENTRY_PRICE,accessorKey:"price",headerText:e("Price")})),k(t,l.j7.CURRENT_PRICE,(0,x.Io)({cellTestId:A.Of.ASSET_PENDING_COLUMN_CURRENT_PRICE,accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:l.ZV.PENDING_ORDER})),k(t,l.j7.TAKE_PROFIT,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_TAKE_PROFIT,accessorKey:"takeProfit",headerText:e("Take Profit")})),k(t,l.j7.STOP_LOSS,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_STOP_LOSS,accessorKey:"stopLoss",headerText:e("Stop Loss")})),t},G=function(e){var t;return k(t={},l.j7.VOLUME,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Volume"),formatter:function(e,t){var r=Number(e),n=null==t?void 0:t.filledLotSize,o=Number.isFinite(r)?(0,w.Wi)(r,(0,D.N)(r)):"--",i=Number.isFinite(n)?(0,w.Wi)(n,(0,D.N)(n),!1):"--";return"".concat(o," / ").concat(i)}})),k(t,l.j7.UNITS,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_UNITS,accessorKey:"units",headerText:e("Units")})),k(t,l.j7.FILL_POLICY,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_FILL_POLICY,accessorKey:"fillPolicy",headerText:e("Fill Policy"),formatter:function(e){return(0,U.JE)(e)}})),k(t,l.j7.EXPIRY,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_EXPIRY,accessorKey:"tradeExpiry",headerText:e("Expiry"),formatter:function(e){return(0,U.og)(e)}})),k(t,l.j7.EXPIRY_DATE,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_EXPIRY_DATE,accessorKey:"expiration",headerText:e("Expiry Date"),formatter:function(e,t){return(0,U.Sj)(Number(e),null==t?void 0:t.tradeExpiry)}})),k(t,l.j7.PRICE,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ENTRY_PRICE,accessorKey:"price",headerText:e("Price")})),k(t,l.j7.PENDING_PRICE,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_STOP_LIMIT_PRICE,accessorKey:"priceTrigger",headerText:e("Stop Limit Price")})),k(t,l.j7.CURRENT_PRICE,(0,x.Io)({cellTestId:A.Of.ASSET_PENDING_COLUMN_CURRENT_PRICE,accessorKey:"currentPrice",headerText:e("Current Price"),columnPreferenceOrderType:l.ZV.PENDING_ORDER})),k(t,l.j7.TAKE_PROFIT,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_TAKE_PROFIT,accessorKey:"takeProfit",headerText:e("Take Profit")})),k(t,l.j7.STOP_LOSS,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_STOP_LOSS,accessorKey:"stopLoss",headerText:e("Stop Loss")})),t},F=function(e){var t;return k(t={},l.j7.OPEN_TIME,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Order Date"),formatter:function(e){return j._.convertToDayjsWithOffset({input:Number(e)}).format(N.ju)}})),k(t,l.j7.ORDER_NO,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order ID")}
1)),k(t,l.j7.SYMBOL,(0,x.Dc)({cellTestId:A.Of.ASSET_PENDING_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol")})),k(t,l.j7.ORDER_TYPE,(0,x.Y1)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Order Type")})),t},z=function(e){var t;return k(t={},l.j7.PRICE,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_PRICE,accessorKey:"price",headerText:e("Price")})),k(t,l.j7.CURRENT_PRICE,(0,x.Io)({cellTestId:A.Of.ASSET_PENDING_COLUMN_MARKET_PRICE,accessorKey:"currentPrice",headerText:e("Market Price"),columnPreferenceOrderType:l.ZV.PENDING_ORDER})),k(t,l.j7.VOLUME_SIZE,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_VOLUME,accessorKey:"lotSize",headerText:e("Volume")})),k(t,l.j7.FILLED_VOLUME,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_FILL_VOLUME,accessorKey:"filledVolume",headerText:e("Fill Volume")})),k(t,l.j7.FILL_POLICY,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_TIME_IN_FORCE,accessorKey:"fillPolicy",headerText:(0,M.r9)(M.tM.FILL_POLICY,c.wS.CENTROID),formatter:function(e){return(0,U.JE)(e)}})),k(t,l.j7.MARKET_RANGE,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_MARKET_RANGE,accessorKey:"marketRange",headerText:e("Market Range"),formatter:function(e){return(0,w.Wi)(Number(e),0,!1)}})),t},V=function(e){var t;return k(t={},l.j7.ORDER_TYPE,(0,x.Y1)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_TYPE,accessorKey:"orderType",headerText:e("Order Type"),size:150})),k(t,l.j7.ORDER_STATUS,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_STATUS,accessorKey:"horizonOrderStatus",headerText:e("Order Status"),formatter:function(e){return(0,L.gj)(e)}})),k(t,l.j7.LIMIT_PRICE,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_LIMIT_PRICE,accessorKey:"limitPrice",headerText:e("Limit Price")})),k(t,l.j7.STOP_PRICE,(0,x.yQ)({cellTestId:A.Of.ASSET_PENDING_COLUMN_STOP_PRICE,accessorKey:"stopPrice",headerText:e("Stop Price")})),k(t,l.j7.LAST_PRICE,(0,x.Io)({cellTestId:A.Of.ASSET_PENDING_COLUMN_LAST_PRICE,accessorKey:"lastPrice",headerText:e("Last Price"),columnPreferenceOrderType:l.ZV.PENDING_ORDER})),k(t,l.j7.PLACED_QUANTITY,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_PLACED_QUANTITY,accessorKey:"lotSize",headerText:e("Placed Quantity")})),k(t,l.j7.FILLED_QUANTITY,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_FILLED_QUANTITY,accessorKey:"filledLotSize",headerText:e("Filled Quantity")})),k(t,l.j7.REMAINING_QUANTITY,(0,x.vM)({cellTestId:A.Of.ASSET_PENDING_COLUMN_REMAINING_QUANTITY,accessorKey:"remainedLotSize",headerText:e("Remaining Quantity")})),k(t,l.j7.TIME_IN_FORCE,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_TIME_IN_FORCE,accessorKey:"fillPolicy",headerText:e("Time-In-Force"),formatter:function(e){return(0,U.JE)(e)}})),k(t,l.j7.EXPIRY_DATE,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_EXPIRY_DATE,accessorKey:"expiration",headerText:e("Expiry Date"),formatter:function(e){return(0,N.IM)(e,N.zT)}})),k(t,l.j7.ORDER_NO,(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_ORDER_ID,accessorKey:"orderId",headerText:e("Order ID"),size:250})),t},B=function(e){var t=e.symbol,r=e.orderId,n=e.id,o=e.t,i=void 0===o?u.ag.t:o,l=(0,I.Q)(i),s=T.lj.getCompanyIntegration()===c.wS.CENTROID&&null!=n?n.toString():r;v.T.closeLimitOrder({payload:{symbol:t,orderId:s},onSuccess:function(){(0,a.ur)({message:l("Order has been deleted."),messageType:m.KK.SUCCESS})},onError:function(e){(0,a.ur)({message:e,messageType:m.KK.ERROR})}})},X=function(e,t){return(0,x.K3)({id:"delete",size:50,accessorKey:"orderId",headerText:e("Delete"),actionButtonType:h.K2.DELETE,headerAlignment:"center",disabled:t,onClick:function(r){var n,o,i,a;t||(h.XR.addActiveRow(null!=(n=r.orderId)?n:"",h.K2.DELETE),f.j.getIsOneClickTradingEnabled()?B({symbol:null!=(o=r.symbol)?o:"",orderId:null!=(i=r.orderId)?i:"",id:r.id,t:e}):(0,P.a)({orderId:null!=(a=r.orderId)?a:"",onCancel:function(){var e;h.XR.removeActiveRow(null!=(e=r.orderId)?e:"",h.K2.DELETE)}}))}})},Y=function(e,t){return(0,x.K3)({id:"edit",size:50,accessorKey:"orderId",headerText:e("Edit"),actionButtonType:h.K2.EDIT,headerAlignment:"center",disabled:t,onClick:function(e){var r,n;
1t||(O.q.order.editOrderClick({symbol:e.symbol,direction:(0,_.GI)((0,_.cj)(e.orderType)),orderType:(0,_.oi)(e.orderType),positionModuleTab:y.of.PENDING_ORDERS}),h.XR.addActiveRow(null!=(r=e.orderId)?r:"",h.K2.EDIT),(0,C.B)({orderId:null!=(n=e.orderId)?n:"",onCancel:function(){var t;h.XR.removeActiveRow(null!=(t=e.orderId)?t:"",h.K2.EDIT)}}))}})},$=function(e,t,r){return(0,x.K3)({id:"track",size:50,accessorKey:"orderId",headerText:r("Track"),actionButtonType:h.K2.TRACK,headerAlignment:"center",onClick:function(r){var n=r.symbol,o=r.decimal,i=r.orderType,a=r.stopLoss,c=r.takeProfit,l=r.price,s=r.priceTrigger,u=r.closable,d=r.editable,f=r.marketFillPolicy,p=r.orderId,T=!g._.orderTrackers.some(function(e){return e.orderId===p}),E=g._.getEntryAndAdditionalPrices({orderType:i,price:l,priceTrigger:s}),m=E.entryPrice,h=E.additionalPrice,v={symbol:n,decimal:o,orderId:p,orderType:i,stopLoss:(0,S.U8)(a),takeProfit:(0,S.U8)(c),entryPrice:(0,S.U8)(m),additionalPrice:(0,S.U8)(h),isClosable:(0,_.HS)({marketFillPolicy:f,flag:u}),isEditable:(0,_.HS)({marketFillPolicy:f,flag:d})};O.q.order.trackOrderClick({trackOrderParams:v,livePrice:b.$.getOrderSymbolLivePrice({id:String(p),orderType:i,isOpenPosition:!1}),priceTrigger:s,positionModuleTab:y.of.PENDING_ORDERS,isTracking:T}),(0,R.v)({navigate:t,nextTrackingState:T,orderId:p,pathname:e,symbol:n,trackOrderParams:v})}})},H=function(){var e=(0,o.$G)().t,t=(0,i.TH)().pathname,r=(0,i.s0)(),a=(0,d.eZ)(l.ZV.PENDING_ORDER),u=(0,T.$X)(),f=(0,E.ry)(),O=(0,p.kz)();return{tableColumns:(0,n.useMemo)(function(){var n={},o=a.filter(function(e){return e.visible}).map(function(e){return e.label});switch(u){case c.wS.HORIZON:n=k({openTime:(0,x.wD)({cellTestId:A.Of.ASSET_PENDING_COLUMN_OPEN_DATE,accessorKey:"openTime",headerText:e("Created Date"),formatter:function(e){return j._.convertToDayjsWithOffset({input:Number(e)}).format(N.ju)}})},l.j7.SYMBOL,(0,x.Dc)({cellTestId:A.Of.ASSET_PENDING_COLUMN_SYMBOL,accessorKey:"symbol",headerText:e("Symbol Name"),size:200}));var i=V(e);o.forEach(function(e){i[e]&&(n[e]=i[e])}),n.deleteAction=X(e,O);break;case c.wS.CENTROID:n=F(e);var d=z(e);o.forEach(function(e){d[e]&&(n[e]=d[e])}),n.trackAction=$(t,r,e),n.editAction=Y(e,O),n.deleteAction=X(e,O);break;case c.wS.METATRADER5:n=K(e);var p=G(e);o.forEach(function(e){p[e]&&(n[e]=p[e])}),n.trackAction=$(t,r,e),n.deleteAction=X(e,O),n.editAction=Y(e,O);break;default:n=K(e);var T=Z(e);o.forEach(function(e){T[e]&&(n[e]=T[e])}),n.trackAction=$(t,r,e),n.editAction=Y(e,O),n.deleteAction=X(e,O)}return t!==s.oI.TRADE||u===c.wS.HORIZON||f||delete n.SYMBOL,u===c.wS.CENTROID&&delete n.trackAction,Object.values(n).filter(function(e){return!!e})},[a,u,e,t,r,f,O])}}},99684:function(e,t,r){"use strict";r.d(t,{k:()=>l,v:()=>c}),r(26699),r(32023);var n=r(907),o=r(41174),i=r(59440),a=r(74370),c=function(e){var t=e.navigate,r=e.nextTrackingState,o=e.orderId,c=e.pathname,l=e.symbol,s=e.trackOrderParams;if(r){var u=i.N.getSymbolDetail();((null==u?void 0:u.symbol)!==l||location.pathname.includes(n.oI.ASSETS))&&i.N.setSymbolDetail({symbolId:l}),c!==n.oI.TRADE?(a._.resetChartReadyStatus(),a._.trackOrder(s),t(n.oI.TRADE)):a._.trackOrder(s)}else a._.cancelTrackOrder(o)},l=function(e){var t=e.isEnable,r=e.navigate,a=e.symbol,c=e.symbolType;t&&a&&(o.$.onSelectOrderSymbol(a,c),location.pathname!==n.oI.TRADE&&(i.N.setIsNavigatingWithSymbol(),r(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.