@nabeeltahirdeveloper/chart-sdk 2.3.11-beta → 2.3.12-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31356,7 +31356,7 @@ const Sx = {
31356
31356
  "th",
31357
31357
  {
31358
31358
  className: `px-3 py-2 text-right text-md ${o ? "text-slate-700" : "text-slate-300"}`,
31359
- children: "Change"
31359
+ children: "Change (24h)"
31360
31360
  }
31361
31361
  )
31362
31362
  ] })
@@ -46,4 +46,4 @@
46
46
  .scrollbar-light::-webkit-scrollbar-thumb:hover {
47
47
  background: #94a3b8;
48
48
  }
49
- `}),a.jsxs("div",{style:{width:`${i}px`,minWidth:"220px",maxWidth:"1500px"},className:`border-l flex flex-col h-full shrink-0 ${o?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[a.jsxs("div",{className:`p-3 border-b flex justify-center items-center gap-2 ${o?"border-slate-200":"border-slate-700"}`,children:[a.jsx(mT,{className:o?"text-2xl text-slate-500":"text-2xl text-slate-400"}),a.jsx("input",{type:"text",placeholder:"Search symbol",value:l,onChange:x=>c(x.target.value),className:`w-full px-3 py-1.5 rounded text-md focus:outline-none focus:border-sky-500 ${o?"bg-white border border-slate-200 text-slate-800 placeholder:text-slate-400":"bg-slate-800 border border-slate-600 text-slate-100 placeholder:text-slate-400"}`})]}),a.jsx("div",{className:`flex-1 overflow-y-auto ${o?"scrollbar-light":"scrollbar-dark"}`,style:{scrollbarWidth:"thin",scrollbarColor:o?"#cbd5e1 #ffffff":"#1e293b #12161d"},children:r?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:`text-sm ${o?"text-slate-700":"text-slate-200"}`,children:"Loading symbols..."})}):h.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:`text-sm text-center px-4 ${o?"text-slate-700":"text-slate-200"}`,children:e.length===0?"No symbols found. Please check server connection.":"No symbols match your search."})}):a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{className:`sticky top-0 z-10 ${o?"bg-white border-b border-slate-200":"bg-[#12161d] border-b border-slate-700"}`,children:a.jsxs("tr",{children:[a.jsx("th",{className:`px-3 py-2 text-left text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Symbol"}),a.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Bid"}),a.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Ask"}),a.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Change"})]})}),a.jsx("tbody",{children:g.map(({category:x,symbols:b})=>a.jsxs(te.Fragment,{children:[a.jsx("tr",{className:o?"bg-slate-50":"bg-slate-900",children:a.jsx("td",{colSpan:4,className:`px-3 py-2 text-xs font-semibold ${o?BT[x]||"text-slate-600":wT[x]||"text-slate-400"}`,children:yT[x]||x.toUpperCase()})}),b.map(v)]},x))})]})})]})]})},vT=({accountSummary:i,orders:e,onClose:t,onModify:A,height:r})=>{const{accountSummary:n,orders:s,theme:o,isShow:l,setIsShow:c,historyOrders:h,fetchHistoryOrders:g}=Lt(),v=i||n,x=e||s,b=h||[],C=o==="light",E=l?"history":"trade";te.useEffect(()=>{l&&g&&g()},[l,g]);const F="#26A69A",S="#EF5350",P=C?"#f8fafc":"#12161D",R=C?"#e2e8f0":"#1e293b",L=C?"#f1f5f9":"#12161D",z=C?"#F0F5F9":"#2B3543",j=C?"#f8fafc":"#131c2e",$=C?"#12161D":"#fff",V=C?"#64748b":"#fff",ee=(x||[]).filter(pe=>pe.status==="OPEN"||!pe.closeAt),ie=v?.balance||0,ce=v?.equity??ie,X=v?.margin||0,q=v?.freeMargin??ce-X,se=X>0?ce/X*100:0,le=ee.reduce((pe,Pe)=>pe+(Pe.livePnL??Pe.profit??0),0),ne=pe=>{const Pe=parseFloat(pe);return Number.isFinite(Pe)?Pe.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00"},he=pe=>{const Pe=parseFloat(pe);return!Pe||isNaN(Pe)?"—":Pe>=1e4?Pe.toFixed(2):Pe>=10?Pe.toFixed(4):Pe.toFixed(5)},de=pe=>{const Pe=parseFloat(pe);return isNaN(Pe)?"—":(Pe>=0?"+":"")+Pe.toFixed(2)},we=pe=>{const Pe=parseFloat(pe);return isNaN(Pe)?"—":Pe.toFixed(2)},xe=pe=>{if(!pe)return"—";const Pe=new Date(pe);return isNaN(Pe.getTime())?String(pe):`${Pe.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"})} ${Pe.toTimeString().slice(0,8)}`},Se=te.useCallback((pe,Pe)=>{pe.stopPropagation(),t&&t(Pe.id,Pe)},[t]),ye=te.useCallback((pe,Pe)=>{pe.stopPropagation(),A&&A(Pe)},[A]),ve={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace",backgroundColor:P,borderTop:`1px solid ${R}`,display:"flex",flexDirection:"column",height:r?`${r}px`:"auto",overflow:"hidden",fontSize:"11px",color:$},Qe={display:"flex",alignItems:"center",gap:"0",padding:"5px 10px",backgroundColor:z,borderBottom:`1px solid ${R}`,flexShrink:0,flexWrap:"wrap",rowGap:"2px"},Ee={display:"flex",alignItems:"center",gap:"4px",paddingRight:"14px",marginRight:"14px",borderRight:`1px solid ${R}`,whiteSpace:"nowrap"},Ie={color:V,fontWeight:600,fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.05em"},Ze={fontFamily:"monospace",fontWeight:700,fontSize:"11px"},ze={display:"flex",borderBottom:`1px solid ${R}`,flexShrink:0,backgroundColor:L},Ce=pe=>({padding:"5px 14px",fontSize:"11px",fontWeight:pe?700:500,color:pe?C?"#0ea5e9":"#38bdf8":V,borderBottom:pe?`2px solid ${C?"#0ea5e9":"#38bdf8"}`:"2px solid transparent",background:"none",border:"none",cursor:"pointer",transition:"color 0.15s",outline:"none"}),Ne={padding:"4px 8px",textAlign:"left",color:V,fontWeight:700,fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:`1px solid ${R}`,whiteSpace:"nowrap",backgroundColor:L,position:"sticky",top:0,zIndex:1},Fe={padding:"3px 8px",borderBottom:`1px solid ${R}`,whiteSpace:"nowrap",fontFamily:"monospace",fontSize:"11px",color:$};return a.jsxs("div",{style:ve,children:[a.jsxs("div",{style:Qe,children:[a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Balance:"}),a.jsxs("span",{style:{...Ze,color:$},children:["$",ne(ie)]})]}),a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Equity:"}),a.jsxs("span",{style:{...Ze,color:ce>=ie?F:S},children:["$",ne(ce)]})]}),a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Margin:"}),a.jsxs("span",{style:{...Ze,color:$},children:["$",ne(X)]})]}),a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Free Margin:"}),a.jsxs("span",{style:{...Ze,color:q>=0?$:S},children:["$",ne(q)]})]}),a.jsxs("div",{style:{...Ee,borderRight:"none",marginRight:0,paddingRight:0},children:[a.jsx("span",{style:Ie,children:"Margin Level:"}),a.jsx("span",{style:{...Ze,color:se>=100?F:S},children:X>0?se.toFixed(2)+"%":"—"})]}),ee.length>0&&a.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"},children:[a.jsx("span",{style:Ie,children:"Float P/L:"}),a.jsxs("span",{style:{...Ze,color:le>=0?F:S,fontWeight:700},children:[le>=0?"+":"",ne(le)]})]})]}),a.jsxs("div",{style:ze,children:[a.jsx("button",{style:Ce(E==="trade"),onClick:()=>c&&c(!1),children:"Trade"}),a.jsx("button",{style:Ce(E==="history"),onClick:()=>c&&c(!0),children:"History"})]}),E==="trade"&&a.jsx("div",{style:{overflowY:"auto",flex:1},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:"800px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:Ne,children:"Symbol"}),a.jsx("th",{style:Ne,children:"Ticket"}),a.jsx("th",{style:Ne,children:"Time"}),a.jsx("th",{style:Ne,children:"Type"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Volume"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Price"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"S/L"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"T/P"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Current"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Profit"}),a.jsx("th",{style:{...Ne,textAlign:"center"},children:"Action"}),a.jsx("th",{style:{...Ne,textAlign:"center"},children:"Close"})]})}),a.jsx("tbody",{children:ee.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:12,style:{...Fe,textAlign:"center",padding:"16px",color:V},children:"No open positions"})}):ee.map(pe=>{const Pe=pe.livePnL??pe.profit??0,Je=Pe>=0?F:S;return a.jsxs("tr",{style:{cursor:"default"},onMouseEnter:it=>it.currentTarget.style.backgroundColor=j,onMouseLeave:it=>it.currentTarget.style.backgroundColor="transparent",children:[a.jsx("td",{style:{...Fe,fontWeight:700,color:$,letterSpacing:"0.02em"},children:pe.symbol}),a.jsx("td",{style:{...Fe,color:V,fontSize:"10px"},children:String(pe.id||"").slice(0,8).toUpperCase()}),a.jsx("td",{style:{...Fe,color:V},children:xe(pe.openAt||pe.time)}),a.jsx("td",{style:{...Fe,fontWeight:700,color:pe.type?.toUpperCase()==="BUY"?F:S},children:pe.type?.toUpperCase()}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:we(pe.volume)}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:he(pe.price??pe.openPrice)}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.stopLoss?S:V},children:pe.stopLoss?he(pe.stopLoss):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.takeProfit?F:V},children:pe.takeProfit?he(pe.takeProfit):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",color:V},children:pe.currentPrice?he(pe.currentPrice):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",fontWeight:700,color:Je},children:de(Pe)}),a.jsx("td",{style:{...Fe,textAlign:"center"},children:a.jsx("button",{onClick:it=>ye(it,pe),title:"Modify TP/SL",style:{background:"none",border:"none",cursor:"pointer",color:V,padding:"2px 4px",borderRadius:"3px",fontSize:"11px",lineHeight:1},onMouseEnter:it=>it.currentTarget.style.color="#f59e0b",onMouseLeave:it=>it.currentTarget.style.color=V,children:"✎"})}),a.jsx("td",{style:{...Fe,textAlign:"right",fontWeight:700,color:Je},children:a.jsx("button",{onClick:it=>Se(it,pe),title:"Close position",style:{padding:"2px 8px",backgroundColor:"#7f1d1d",border:"1px solid #991b1b",borderRadius:"3px",color:"#fca5a5",fontSize:"10px",fontWeight:700,cursor:"pointer"},onMouseEnter:it=>it.currentTarget.style.backgroundColor="#991b1b",onMouseLeave:it=>it.currentTarget.style.backgroundColor="#7f1d1d",children:"Close"})})]},pe.id)})})]})}),E==="history"&&a.jsx("div",{style:{overflowY:"auto",flex:1},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:"900px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:Ne,children:"Symbol"}),a.jsx("th",{style:Ne,children:"Ticket"}),a.jsx("th",{style:Ne,children:"Open Time"}),a.jsx("th",{style:Ne,children:"Type"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Volume"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Open Price"}),a.jsx("th",{style:Ne,children:"Close Time"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Close Price"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"S/L"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"T/P"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Profit"})]})}),a.jsx("tbody",{children:b.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:11,style:{...Fe,textAlign:"center",padding:"16px",color:V},children:"No trade history"})}):b.map(pe=>{const Pe=pe.profit??0,Je=Pe>=0?F:S;return a.jsxs("tr",{style:{cursor:"default"},onMouseEnter:it=>it.currentTarget.style.backgroundColor=j,onMouseLeave:it=>it.currentTarget.style.backgroundColor="transparent",children:[a.jsx("td",{style:{...Fe,fontWeight:700,color:$,letterSpacing:"0.02em"},children:pe.symbol}),a.jsx("td",{style:{...Fe,color:V,fontSize:"10px"},children:String(pe.id||"").slice(0,8).toUpperCase()}),a.jsx("td",{style:{...Fe,color:V},children:xe(pe.openAt)}),a.jsx("td",{style:{...Fe,fontWeight:700,color:pe.type?.toUpperCase()==="BUY"?F:S},children:pe.type?.toUpperCase()}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:we(pe.volume)}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:he(pe.openPrice)}),a.jsx("td",{style:{...Fe,color:V},children:xe(pe.closeAt)}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:he(pe.closePrice)}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.stopLoss?S:V},children:pe.stopLoss?he(pe.stopLoss):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.takeProfit?F:V},children:pe.takeProfit?he(pe.takeProfit):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",fontWeight:700,color:Je},children:de(Pe)})]},pe.id)})})]})})]})},TT="2.3.2";je.AccountPanel=vT,je.BuySellPanel=vh,je.Chart=tT,je.ChartTypeSelector=aT,je.CoinSelector=Rd,je.DrawingTools=Zd,je.LeftSidebar=gT,je.MarketExecutionModal=Th,je.MarketWatch=CT,je.PositionsPanel=cT,je.SYMBOL_CONFIG=Oa,je.StopLoss=$d,je.TakeProfit=Xd,je.TimeframeSelector=sT,je.ToolCustomizationModal=Uh,je.TopBar=fT,je.TradePanel=lT,je.TradingProvider=hm,je.TradingToolbar=rT,je.VolumeControl=Gd,je.alignToTimeframe=We,je.detectGaps=ap,je.getSymbolConfig=Oi,je.is24x7Symbol=op,je.isCryptoSymbol=sp,je.isForexSymbol=np,je.isWithinTradingSession=lp,je.normalizeCandleTimes=Va,je.normalizeTime=Y,je.processCandles=Ga,je.processSingleCandle=$a,je.setSocketBaseUrl=fh,je.timeframeToSeconds=tA,je.useTrading=Lt,je.validateTimeOrdering=cp,je.version=TT,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})}));
49
+ `}),a.jsxs("div",{style:{width:`${i}px`,minWidth:"220px",maxWidth:"1500px"},className:`border-l flex flex-col h-full shrink-0 ${o?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[a.jsxs("div",{className:`p-3 border-b flex justify-center items-center gap-2 ${o?"border-slate-200":"border-slate-700"}`,children:[a.jsx(mT,{className:o?"text-2xl text-slate-500":"text-2xl text-slate-400"}),a.jsx("input",{type:"text",placeholder:"Search symbol",value:l,onChange:x=>c(x.target.value),className:`w-full px-3 py-1.5 rounded text-md focus:outline-none focus:border-sky-500 ${o?"bg-white border border-slate-200 text-slate-800 placeholder:text-slate-400":"bg-slate-800 border border-slate-600 text-slate-100 placeholder:text-slate-400"}`})]}),a.jsx("div",{className:`flex-1 overflow-y-auto ${o?"scrollbar-light":"scrollbar-dark"}`,style:{scrollbarWidth:"thin",scrollbarColor:o?"#cbd5e1 #ffffff":"#1e293b #12161d"},children:r?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:`text-sm ${o?"text-slate-700":"text-slate-200"}`,children:"Loading symbols..."})}):h.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:`text-sm text-center px-4 ${o?"text-slate-700":"text-slate-200"}`,children:e.length===0?"No symbols found. Please check server connection.":"No symbols match your search."})}):a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{className:`sticky top-0 z-10 ${o?"bg-white border-b border-slate-200":"bg-[#12161d] border-b border-slate-700"}`,children:a.jsxs("tr",{children:[a.jsx("th",{className:`px-3 py-2 text-left text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Symbol"}),a.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Bid"}),a.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Ask"}),a.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Change (24h)"})]})}),a.jsx("tbody",{children:g.map(({category:x,symbols:b})=>a.jsxs(te.Fragment,{children:[a.jsx("tr",{className:o?"bg-slate-50":"bg-slate-900",children:a.jsx("td",{colSpan:4,className:`px-3 py-2 text-xs font-semibold ${o?BT[x]||"text-slate-600":wT[x]||"text-slate-400"}`,children:yT[x]||x.toUpperCase()})}),b.map(v)]},x))})]})})]})]})},vT=({accountSummary:i,orders:e,onClose:t,onModify:A,height:r})=>{const{accountSummary:n,orders:s,theme:o,isShow:l,setIsShow:c,historyOrders:h,fetchHistoryOrders:g}=Lt(),v=i||n,x=e||s,b=h||[],C=o==="light",E=l?"history":"trade";te.useEffect(()=>{l&&g&&g()},[l,g]);const F="#26A69A",S="#EF5350",P=C?"#f8fafc":"#12161D",R=C?"#e2e8f0":"#1e293b",L=C?"#f1f5f9":"#12161D",z=C?"#F0F5F9":"#2B3543",j=C?"#f8fafc":"#131c2e",$=C?"#12161D":"#fff",V=C?"#64748b":"#fff",ee=(x||[]).filter(pe=>pe.status==="OPEN"||!pe.closeAt),ie=v?.balance||0,ce=v?.equity??ie,X=v?.margin||0,q=v?.freeMargin??ce-X,se=X>0?ce/X*100:0,le=ee.reduce((pe,Pe)=>pe+(Pe.livePnL??Pe.profit??0),0),ne=pe=>{const Pe=parseFloat(pe);return Number.isFinite(Pe)?Pe.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00"},he=pe=>{const Pe=parseFloat(pe);return!Pe||isNaN(Pe)?"—":Pe>=1e4?Pe.toFixed(2):Pe>=10?Pe.toFixed(4):Pe.toFixed(5)},de=pe=>{const Pe=parseFloat(pe);return isNaN(Pe)?"—":(Pe>=0?"+":"")+Pe.toFixed(2)},we=pe=>{const Pe=parseFloat(pe);return isNaN(Pe)?"—":Pe.toFixed(2)},xe=pe=>{if(!pe)return"—";const Pe=new Date(pe);return isNaN(Pe.getTime())?String(pe):`${Pe.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"})} ${Pe.toTimeString().slice(0,8)}`},Se=te.useCallback((pe,Pe)=>{pe.stopPropagation(),t&&t(Pe.id,Pe)},[t]),ye=te.useCallback((pe,Pe)=>{pe.stopPropagation(),A&&A(Pe)},[A]),ve={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace",backgroundColor:P,borderTop:`1px solid ${R}`,display:"flex",flexDirection:"column",height:r?`${r}px`:"auto",overflow:"hidden",fontSize:"11px",color:$},Qe={display:"flex",alignItems:"center",gap:"0",padding:"5px 10px",backgroundColor:z,borderBottom:`1px solid ${R}`,flexShrink:0,flexWrap:"wrap",rowGap:"2px"},Ee={display:"flex",alignItems:"center",gap:"4px",paddingRight:"14px",marginRight:"14px",borderRight:`1px solid ${R}`,whiteSpace:"nowrap"},Ie={color:V,fontWeight:600,fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.05em"},Ze={fontFamily:"monospace",fontWeight:700,fontSize:"11px"},ze={display:"flex",borderBottom:`1px solid ${R}`,flexShrink:0,backgroundColor:L},Ce=pe=>({padding:"5px 14px",fontSize:"11px",fontWeight:pe?700:500,color:pe?C?"#0ea5e9":"#38bdf8":V,borderBottom:pe?`2px solid ${C?"#0ea5e9":"#38bdf8"}`:"2px solid transparent",background:"none",border:"none",cursor:"pointer",transition:"color 0.15s",outline:"none"}),Ne={padding:"4px 8px",textAlign:"left",color:V,fontWeight:700,fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:`1px solid ${R}`,whiteSpace:"nowrap",backgroundColor:L,position:"sticky",top:0,zIndex:1},Fe={padding:"3px 8px",borderBottom:`1px solid ${R}`,whiteSpace:"nowrap",fontFamily:"monospace",fontSize:"11px",color:$};return a.jsxs("div",{style:ve,children:[a.jsxs("div",{style:Qe,children:[a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Balance:"}),a.jsxs("span",{style:{...Ze,color:$},children:["$",ne(ie)]})]}),a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Equity:"}),a.jsxs("span",{style:{...Ze,color:ce>=ie?F:S},children:["$",ne(ce)]})]}),a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Margin:"}),a.jsxs("span",{style:{...Ze,color:$},children:["$",ne(X)]})]}),a.jsxs("div",{style:Ee,children:[a.jsx("span",{style:Ie,children:"Free Margin:"}),a.jsxs("span",{style:{...Ze,color:q>=0?$:S},children:["$",ne(q)]})]}),a.jsxs("div",{style:{...Ee,borderRight:"none",marginRight:0,paddingRight:0},children:[a.jsx("span",{style:Ie,children:"Margin Level:"}),a.jsx("span",{style:{...Ze,color:se>=100?F:S},children:X>0?se.toFixed(2)+"%":"—"})]}),ee.length>0&&a.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"},children:[a.jsx("span",{style:Ie,children:"Float P/L:"}),a.jsxs("span",{style:{...Ze,color:le>=0?F:S,fontWeight:700},children:[le>=0?"+":"",ne(le)]})]})]}),a.jsxs("div",{style:ze,children:[a.jsx("button",{style:Ce(E==="trade"),onClick:()=>c&&c(!1),children:"Trade"}),a.jsx("button",{style:Ce(E==="history"),onClick:()=>c&&c(!0),children:"History"})]}),E==="trade"&&a.jsx("div",{style:{overflowY:"auto",flex:1},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:"800px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:Ne,children:"Symbol"}),a.jsx("th",{style:Ne,children:"Ticket"}),a.jsx("th",{style:Ne,children:"Time"}),a.jsx("th",{style:Ne,children:"Type"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Volume"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Price"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"S/L"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"T/P"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Current"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Profit"}),a.jsx("th",{style:{...Ne,textAlign:"center"},children:"Action"}),a.jsx("th",{style:{...Ne,textAlign:"center"},children:"Close"})]})}),a.jsx("tbody",{children:ee.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:12,style:{...Fe,textAlign:"center",padding:"16px",color:V},children:"No open positions"})}):ee.map(pe=>{const Pe=pe.livePnL??pe.profit??0,Je=Pe>=0?F:S;return a.jsxs("tr",{style:{cursor:"default"},onMouseEnter:it=>it.currentTarget.style.backgroundColor=j,onMouseLeave:it=>it.currentTarget.style.backgroundColor="transparent",children:[a.jsx("td",{style:{...Fe,fontWeight:700,color:$,letterSpacing:"0.02em"},children:pe.symbol}),a.jsx("td",{style:{...Fe,color:V,fontSize:"10px"},children:String(pe.id||"").slice(0,8).toUpperCase()}),a.jsx("td",{style:{...Fe,color:V},children:xe(pe.openAt||pe.time)}),a.jsx("td",{style:{...Fe,fontWeight:700,color:pe.type?.toUpperCase()==="BUY"?F:S},children:pe.type?.toUpperCase()}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:we(pe.volume)}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:he(pe.price??pe.openPrice)}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.stopLoss?S:V},children:pe.stopLoss?he(pe.stopLoss):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.takeProfit?F:V},children:pe.takeProfit?he(pe.takeProfit):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",color:V},children:pe.currentPrice?he(pe.currentPrice):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",fontWeight:700,color:Je},children:de(Pe)}),a.jsx("td",{style:{...Fe,textAlign:"center"},children:a.jsx("button",{onClick:it=>ye(it,pe),title:"Modify TP/SL",style:{background:"none",border:"none",cursor:"pointer",color:V,padding:"2px 4px",borderRadius:"3px",fontSize:"11px",lineHeight:1},onMouseEnter:it=>it.currentTarget.style.color="#f59e0b",onMouseLeave:it=>it.currentTarget.style.color=V,children:"✎"})}),a.jsx("td",{style:{...Fe,textAlign:"right",fontWeight:700,color:Je},children:a.jsx("button",{onClick:it=>Se(it,pe),title:"Close position",style:{padding:"2px 8px",backgroundColor:"#7f1d1d",border:"1px solid #991b1b",borderRadius:"3px",color:"#fca5a5",fontSize:"10px",fontWeight:700,cursor:"pointer"},onMouseEnter:it=>it.currentTarget.style.backgroundColor="#991b1b",onMouseLeave:it=>it.currentTarget.style.backgroundColor="#7f1d1d",children:"Close"})})]},pe.id)})})]})}),E==="history"&&a.jsx("div",{style:{overflowY:"auto",flex:1},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:"900px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:Ne,children:"Symbol"}),a.jsx("th",{style:Ne,children:"Ticket"}),a.jsx("th",{style:Ne,children:"Open Time"}),a.jsx("th",{style:Ne,children:"Type"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Volume"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Open Price"}),a.jsx("th",{style:Ne,children:"Close Time"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Close Price"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"S/L"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"T/P"}),a.jsx("th",{style:{...Ne,textAlign:"right"},children:"Profit"})]})}),a.jsx("tbody",{children:b.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:11,style:{...Fe,textAlign:"center",padding:"16px",color:V},children:"No trade history"})}):b.map(pe=>{const Pe=pe.profit??0,Je=Pe>=0?F:S;return a.jsxs("tr",{style:{cursor:"default"},onMouseEnter:it=>it.currentTarget.style.backgroundColor=j,onMouseLeave:it=>it.currentTarget.style.backgroundColor="transparent",children:[a.jsx("td",{style:{...Fe,fontWeight:700,color:$,letterSpacing:"0.02em"},children:pe.symbol}),a.jsx("td",{style:{...Fe,color:V,fontSize:"10px"},children:String(pe.id||"").slice(0,8).toUpperCase()}),a.jsx("td",{style:{...Fe,color:V},children:xe(pe.openAt)}),a.jsx("td",{style:{...Fe,fontWeight:700,color:pe.type?.toUpperCase()==="BUY"?F:S},children:pe.type?.toUpperCase()}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:we(pe.volume)}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:he(pe.openPrice)}),a.jsx("td",{style:{...Fe,color:V},children:xe(pe.closeAt)}),a.jsx("td",{style:{...Fe,textAlign:"right"},children:he(pe.closePrice)}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.stopLoss?S:V},children:pe.stopLoss?he(pe.stopLoss):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",color:pe.takeProfit?F:V},children:pe.takeProfit?he(pe.takeProfit):"—"}),a.jsx("td",{style:{...Fe,textAlign:"right",fontWeight:700,color:Je},children:de(Pe)})]},pe.id)})})]})})]})},TT="2.3.2";je.AccountPanel=vT,je.BuySellPanel=vh,je.Chart=tT,je.ChartTypeSelector=aT,je.CoinSelector=Rd,je.DrawingTools=Zd,je.LeftSidebar=gT,je.MarketExecutionModal=Th,je.MarketWatch=CT,je.PositionsPanel=cT,je.SYMBOL_CONFIG=Oa,je.StopLoss=$d,je.TakeProfit=Xd,je.TimeframeSelector=sT,je.ToolCustomizationModal=Uh,je.TopBar=fT,je.TradePanel=lT,je.TradingProvider=hm,je.TradingToolbar=rT,je.VolumeControl=Gd,je.alignToTimeframe=We,je.detectGaps=ap,je.getSymbolConfig=Oi,je.is24x7Symbol=op,je.isCryptoSymbol=sp,je.isForexSymbol=np,je.isWithinTradingSession=lp,je.normalizeCandleTimes=Va,je.normalizeTime=Y,je.processCandles=Ga,je.processSingleCandle=$a,je.setSocketBaseUrl=fh,je.timeframeToSeconds=tA,je.useTrading=Lt,je.validateTimeOrdering=cp,je.version=TT,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nabeeltahirdeveloper/chart-sdk",
3
- "version": "2.3.11-beta",
3
+ "version": "2.3.12-beta",
4
4
  "main": "dist/chart-sdk.umd.js",
5
5
  "module": "dist/chart-sdk.es.js",
6
6
  "exports": {