@eaera-com/eaera-widgets-v2 0.1.86 → 0.1.87

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.
Files changed (26) hide show
  1. package/dist/components/base/EaeraDescriptions.d.ts +1 -1
  2. package/dist/components/base/EaeraTooltip.d.ts +12 -12
  3. package/dist/components/chunks/EaeraChatBox-BizsNzpv.mjs +7 -0
  4. package/dist/components/chunks/{index-9V1MulD6.mjs → index-BWt-XZ6U.mjs} +1 -1
  5. package/dist/components/chunks/{index-Bi7fGqMj.mjs → index-COzBGvhd.mjs} +1 -1
  6. package/dist/components/chunks/{index-ocf8b0Fd.mjs → index-CcNULtBu.mjs} +1 -1
  7. package/dist/components/chunks/{index-IeLjCes0.mjs → index-Cq-BW1_s.mjs} +1 -1
  8. package/dist/components/chunks/{index-B97jyUEn.mjs → index-CqkcXehS.mjs} +1 -1
  9. package/dist/components/composite/EaeraDropdownV2.d.ts +6 -6
  10. package/dist/components/custom/{EaeraChatBox/index.d.ts → EaeraChatBox.d.ts} +5 -3
  11. package/dist/components/custom/EaeraChatBox.mjs +1 -0
  12. package/dist/components/index.d.ts +1 -1
  13. package/dist/components/index.mjs +1 -7
  14. package/dist/components/webtrade/EaeraLightweightChart.mjs +1 -1
  15. package/dist/components/webtrade/EaeraMarketDepth.mjs +1 -1
  16. package/dist/components/webtrade/EaeraOrderPlacement.mjs +1 -1
  17. package/dist/components/webtrade/EaeraTimeNSales.mjs +1 -1
  18. package/dist/components/webtrade/EaeraWatchlist.mjs +1 -1
  19. package/dist/design-system/components/_chatbox.scss +1176 -0
  20. package/dist/design-system/themes/aurora/index.scss +1 -0
  21. package/dist/design-system/themes/core/index.scss +1 -0
  22. package/dist/design-system/themes/netr/index.scss +1 -0
  23. package/dist/eaera-widgets-v2.es.js +4979 -4925
  24. package/dist/eaera-widgets-v2.umd.cjs +20 -20
  25. package/dist/style.css +1 -1
  26. package/package.json +1 -1
@@ -1 +1 @@
1
- import{ElLoadingDirective as e}from"element-plus/es";import{ref as t,computed as a,watch as r,defineComponent as l,onMounted as o,onUnmounted as i,openBlock as n,createElementBlock as s,createElementVNode as c,unref as u,toDisplayString as d,Fragment as m,createCommentVNode as p,createVNode as v,withCtx as g,renderList as y,normalizeClass as f,createBlock as b,resolveDynamicComponent as w,shallowRef as x,nextTick as C,normalizeStyle as k,Teleport as T,Transition as L,withModifiers as S,createTextVNode as M,withDirectives as F,renderSlot as D}from"vue";import{b as P,a as O}from"./vendor-vueuse-core-B96HGhR7.mjs";import{isBusinessDay as _,ColorType as R,CandlestickSeries as E,AreaSeries as $,LineSeries as z,createChart as j}from"lightweight-charts";import{ElNotification as B}from"element-plus";import{Square as I,Columns2 as A,Rows2 as N,Columns3 as H,Rows3 as V,Grid2X2 as K,ChartCandlestick as W,Camera as U,Table as Y,Scan as Z,CalendarDays as q}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import{useI18n as G}from"vue-i18n";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as X}from"./index-DXC-pgpu.mjs";import{_ as J,O as Q}from"./index-Ton12Mr0.mjs";import{_ as ee}from"./_plugin-vue_export-helper-BCo6x5W8.mjs";import{_ as te}from"./EaeraDialog-uLsXC20k.mjs";import{_ as ae}from"./EaeraButton-BPVKRBOn.mjs";import{t as re,a as le}from"./vendor-html-to-image-DzdJgLib.mjs";import{_ as oe}from"./EaeraDivider-Dggvc36a.mjs";import ie from"../composite/EaeraDropdownV2.mjs";import{_ as ne}from"./EaeraTooltip-BIlULHv4.mjs";import{_ as se}from"./EaeraDatePicker-Bwt5r5gk.mjs";const ce={Candlestick:"candlestick",Line:"line",Area:"area"},ue={Single:"single",TwoRows:"two-rows",TwoCols:"two-cols",ThreeRows:"three-rows",ThreeCols:"three-cols",Four:"four"},de=e=>{switch(e){case ue.Single:return 1;case ue.TwoRows:case ue.TwoCols:return 2;case ue.ThreeRows:case ue.ThreeCols:return 3;case ue.Four:return 4;default:return 1}},me={OneMinute:"1m",FiveMinutes:"5m",FifteenMinutes:"15m",ThirtyMinutes:"30m",OneHour:"1h",FourHours:"4h",OneDay:"1d",OneWeek:"1w",OneMonth:"1mn"},he={OneDay:"1D",OneWeek:"1W",OneMonth:"1M",ThreeMonths:"3M",SixMonths:"6M",OneYear:"1Y",All:"ALL",Custom:"CUSTOM"},pe={Drawing:"drawing",Orderline:"orderline"},ve=[me.OneMinute,me.FiveMinutes,me.FifteenMinutes,me.ThirtyMinutes,me.OneHour,me.FourHours,me.OneDay,me.OneWeek,me.OneMonth],ge=[he.OneDay,he.OneWeek,he.OneMonth,he.ThreeMonths,he.SixMonths,he.OneYear,he.All,he.Custom],ye=[{value:ce.Candlestick,icon:"Candle3"},{value:ce.Line,icon:"LineChart2"},{value:ce.Area,icon:"AreaChart"}],fe=["download-image","copy-image-to-clipboard","open-image-in-new-tab"],be={[me.OneMinute]:60,[me.FiveMinutes]:300,[me.FifteenMinutes]:900,[me.ThirtyMinutes]:1800,[me.OneHour]:3600,[me.FourHours]:14400,[me.OneDay]:86400,[me.OneWeek]:604800,[me.OneMonth]:2592e3},we=(e,t=100,a=1.272)=>{const r=[],l=Math.floor(Date.now()/1e3),o=be[e]??900;let i=a;for(let n=t-1;n>=0;n--){const e=2e-4,t=i,a=t+15e-5*(Math.random()-.48)+(Math.random()-.5)*e,s=Math.max(t,a)+Math.random()*e*.6,c=Math.min(t,a)-Math.random()*e*.6,u=l-n*o;r.push({time:u,open:+t.toFixed(5),high:+s.toFixed(5),low:+c.toFixed(5),close:+a.toFixed(5)}),i=a}return r},xe=(e,l,o={})=>{const{t:i}=G(),n=t(e.selectedTimeRange??he.OneDay),s=t(e.customTimeRange??null),c=t(e.isExpanded??!1),u=P("multi-chart:layout",e.multiChartLayout??ue.Single),d=t("chart-0"),m=e.selectedTimeFrame??me.OneMinute,p=e.selectedChartType??ce.Candlestick,v=e.dataBarCount??100,g=P("multi-chart:configs",{"chart-0":{timeFrame:m,chartType:p}}),y=e.symbol??"",f=e.overlaySubtitle??"",b=P("multi-chart:symbols",{"chart-0":y}),w=P("multi-chart:descriptions",{"chart-0":f}),x=t(null),C=a(()=>{const e=de(u.value);return Array.from({length:e},(e,t)=>`chart-${t}`)});r(C,e=>{const t=u.value,a={...g.value},r={...w.value},l={...b.value};try{const t={...a},o={...r},i={...l},n=t["chart-0"]??{timeFrame:m,chartType:p},s=o["chart-0"]??f,c=i["chart-0"]??y;e.forEach(e=>{const a=t[e];a&&a.timeFrame&&a.chartType||(t[e]={...n}),o[e]||(o[e]=s),i[e]||(i[e]=c)});const u={},d={},v={};e.forEach(e=>{if(!t[e]||!o[e]||!i[e])throw new Error(`Incomplete config for chart pane "${e}"`);u[e]=t[e],d[e]=o[e],v[e]=i[e]}),g.value=u,w.value=d,b.value=v}catch(o){console.error("Failed to expand chart layout:",o),u.value=t,g.value=a,w.value=r,b.value=l,B.error({message:i("chart.multi-chart.error.expansion-failed"),duration:5e3})}},{immediate:!0}),r(()=>e.selectedTimeFrame,e=>{if(e){const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],timeFrame:e})}}),r(()=>e.selectedChartType,e=>{if(e){const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],chartType:e})}}),r(()=>e.selectedTimeRange,e=>{e&&(n.value=e)}),r(()=>e.customTimeRange,e=>{void 0!==e&&(s.value=e??null)}),r(()=>e.isExpanded,e=>{"boolean"==typeof e&&(c.value=e)}),r(()=>e.multiChartLayout,e=>{e&&(u.value=e)}),r(()=>e.symbol,e=>{const t=d.value;if(void 0!==e&&b.value[t]!==e){b.value={...b.value,[t]:e};const{[t]:a,...r}=R.value;R.value=r}}),r(d,t=>{const a=b.value[t];void 0!==a&&a!==e.symbol&&l("activeSymbolChange",a)}),r(()=>e.overlaySubtitle,e=>{const t=d.value,a=e??"";w.value[t]!==a&&(w.value={...w.value,[t]:a})});const k=(e,t)=>{const a=i(e);return"string"==typeof a&&a.trim().length>0?a:t},T=a(()=>ve.map(e=>({label:k(`chart.time-frame.${e}`,e),value:e}))),L=a(()=>ge.map(e=>({label:k(`chart.time-range.${e}`,e),value:e}))),S=a(()=>ye.map(e=>({label:k(`chart.type.${e.value}`,e.value),value:e.value,icon:e.icon,chartIcon:e.icon}))),M=a(()=>fe.map(e=>"download-image"===e?{value:e,label:k("chart.snapshot.download-image","Download image"),desc:k("chart.snapshot.download-image-shortcut","Ctrl + Alt + S")}:"copy-image-to-clipboard"===e?{value:e,label:k("chart.snapshot.copy-image-to-clipboard","Copy image"),desc:k("chart.snapshot.copy-image-to-clipboard-shortcut","Ctrl + Shift + S")}:{value:e,label:k("chart.snapshot.open-in-new-tab","Open in new tab"),desc:k("chart.snapshot.open-in-new-tab-shortcut","Alt + S")})),F=a(()=>g.value[d.value]??{timeFrame:m,chartType:p}),D=a(()=>e.chartData&&e.chartData.length>0?e.chartData:we(F.value.timeFrame,v)),O=a(()=>{const e=D.value;return e.length>0?e[e.length-1].close:null}),_=a(()=>({selectedTimeFrame:F.value.timeFrame,selectedTimeRange:n.value,selectedChartType:F.value.chartType,customTimeRange:s.value,isExpanded:c.value,isLoading:e.isLoading??!1}));r(_,e=>{l("stateChange",e)},{immediate:!0});const R=t({}),E=e=>g.value[e]?.timeFrame??m,$=async e=>{const t=o.snapshotTargetRef?.value;if(t)switch(e){case"download-image":await(async e=>{try{const t=await re(e,{quality:1,pixelRatio:2}),a=document.createElement("a");a.href=t,a.download=`chart-snapshot-${Date.now()}.png`,a.click()}catch(t){console.error("Failed to download chart image:",t),B.error({message:i("chart.snapshot.error.download"),duration:5e3})}})(t);break;case"copy-image-to-clipboard":await(async e=>{try{const t=await le(e,{quality:1,pixelRatio:2});if(!t?.type||"undefined"==typeof ClipboardItem)throw new Error("Failed to generate image blob");const a=new ClipboardItem({[t.type]:t});await navigator.clipboard.write([a])}catch(t){console.error("Failed to copy chart image to clipboard:",t),B.error({message:i("chart.snapshot.error.copy"),duration:5e3})}})(t);break;case"open-image-in-new-tab":await(async e=>{try{const t=await re(e,{quality:1,pixelRatio:2}),a=window.open();a&&(a.document.write(`\n <html>\n <head><title>Chart Snapshot</title></head>\n <body style="margin:0;display:flex;justify-content:center;align-items:center;min-height:100vh;background:#000;">\n <img src="${t}" style="max-width:100%;max-height:100vh;" />\n </body>\n </html>\n `),a.document.close())}catch(t){console.error("Failed to open chart image in new tab:",t),B.error({message:i("chart.snapshot.error.open"),duration:5e3})}})(t)}};return{symbol:a(()=>e.symbol??""),overlaySubtitle:a(()=>e.overlaySubtitle??""),chartData:D,selectedTimeFrame:a(()=>F.value.timeFrame),selectedTimeRange:a(()=>n.value),selectedChartType:a(()=>F.value.chartType),customTimeRange:a(()=>s.value),timeFrameOptions:a(()=>e.timeFrameOptions&&e.timeFrameOptions.length>0?e.timeFrameOptions:T.value),timeRangeOptions:a(()=>e.timeRangeOptions&&e.timeRangeOptions.length>0?e.timeRangeOptions:L.value),chartTypeOptions:a(()=>e.chartTypeOptions&&e.chartTypeOptions.length>0?e.chartTypeOptions:S.value),snapshotOptions:a(()=>void 0!==e.snapshotOptions?e.snapshotOptions:M.value),isLoading:a(()=>e.isLoading??!1),isExpanded:a(()=>c.value),isMultiChart:a(()=>u.value!==ue.Single),multiChartLayout:a(()=>u.value),chartIds:C,selectedChartId:a(()=>d.value),activeChartLastPrice:O,tickSize:a(()=>e.tickSize),dark:a(()=>e.dark),chartDomId:a(()=>e.chartDomId??"eaera-lightweight-chart-canvas"),overlayTitle:a(()=>e.overlayTitle??""),state:_,getTimeFrameForChart:E,getChartTypeForChart:e=>g.value[e]?.chartType??p,getChartDataForChart:t=>{if(e.chartData&&e.chartData.length>0)return e.chartData;const a=E(t),r=R.value[t];if(r&&r.length>0){const e=be[a],t=r[r.length-1].time,l=Math.floor(Date.now()/1e3)-e;if(Math.abs(t-l)<2*e)return r}const l=we(a,v);return R.value={...R.value,[t]:l},l},getSymbolForChart:e=>b.value[e]??y,getSymbolDescriptionForChart:e=>w.value[e]??f,onResize:(e,t)=>l("resize",e,t),onChangeTimeFrame:e=>{const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],timeFrame:e}),l("changeTimeFrame",e)},onChangeTimeRange:e=>{n.value=e,l("changeTimeRange",e)},onChangeChartType:e=>{const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],chartType:e}),l("changeChartType",e)},onChangeCustomRange:e=>{s.value=e,l("changeCustomRange",e)},onLoadMoreLeft:()=>l("loadMoreLeft"),onSnapshot:async e=>{await $(e)},onToggleExpanded:()=>{c.value=!c.value,l("toggleExpanded")},onChangeMultiChartLayout:e=>{const t=u.value,a=de(t),r=de(e);if(r<a)return void(x.value=e);if(r>a){const e={...g.value},t={...w.value},l={...b.value},o=d.value,i=e[o]??e["chart-0"],n=t[o]??f,s=l[o]??y;for(let c=a;c<r;c++){const a=`chart-${c}`;e[a]||(e[a]={...i}),t[a]||(t[a]=n),l[a]||(l[a]=s)}g.value=e,w.value=t,b.value=l}u.value=e;parseInt(d.value.split("-")[1]??"0",10)>=r&&(d.value="chart-0"),l("changeMultiChartLayout",e)},onSelectChart:e=>{d.value=e},confirmLayoutSwitch:e=>{const t=x.value;if(!t)return;const a=de(t),r={},o={},i={};e.slice(0,a).forEach((e,t)=>{const a=`chart-${t}`;r[a]=g.value[e]??{timeFrame:m,chartType:p},o[a]=w.value[e]??f,i[a]=b.value[e]??y}),g.value=r,w.value=o,b.value=i,d.value="chart-0",u.value=t,x.value=null,l("changeMultiChartLayout",t)},cancelLayoutSwitch:()=>{x.value=null},pendingLayoutSwitch:a(()=>x.value)}},Ce=e=>e,ke={class:"p-2.5"},Te={class:"w-full h-8 flex items-center justify-between"},Le={class:"h-full flex items-center gap-1"},Se={key:0,class:"flex items-center gap-1 text-label-lg text-[var(--er-text-primary)]"},Me={class:"whitespace-nowrap"},Fe={class:"text-[var(--er-text-secondary)] whitespace-nowrap"},De={class:"flex items-center"},Pe={type:"button",class:"flex items-center justify-center h-8 px-3 border-none rounded-lg bg-transparent text-label-lg text-[var(--er-text-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Oe={class:"flex items-center"},_e={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Re={class:"h-full flex items-center gap-1"},Ee={class:"flex items-center"},$e={type:"button",class:"flex items-center justify-center h-8 px-3 border-none rounded-lg bg-transparent text-label-lg text-[var(--er-text-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},ze={class:"flex items-center"},je={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Be={key:1,class:"flex items-center"},Ie={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Ae={key:0,class:"text-body-xs text-[var(--er-text-secondary)]"},Ne={class:"flex items-center"},He={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Ve={class:"flex flex-col gap-2 py-4 px-3 min-w-[150px]"},Ke={class:"flex items-center gap-3"},We={class:"w-4"},Ue=["onClick"],Ye=l({__name:"EaeraLightweightChartHeader",props:{context:{}},setup(e){const t=e,{t:r}=G(),{symbol:l,overlayTitle:x,overlaySubtitle:C,selectedTimeFrame:k,timeFrameOptions:T,chartTypeOptions:L,snapshotOptions:S,isExpanded:M,isMultiChart:F,multiChartLayout:D,onChangeTimeFrame:P,onChangeChartType:O,onSnapshot:_,onToggleExpanded:R,onChangeMultiChartLayout:E}=t.context,$=a(()=>T.value.map(e=>({label:e.label,value:e.value,itemClick:()=>P(e.value)}))),z=a(()=>L.value.map(e=>({label:e.label,value:e.value,itemClick:()=>O(e.value)}))),j=a(()=>S.value.map(e=>({label:e.label,value:e.value,desc:e.desc,itemClick:()=>_(e.value)}))),B=a(()=>[{order:1,options:[{icon:I,id:ue.Single}]},{order:2,options:[{icon:A,id:ue.TwoCols},{icon:N,id:ue.TwoRows}]},{order:3,options:[{icon:H,id:ue.ThreeCols},{icon:V,id:ue.ThreeRows}]},{order:4,options:[{icon:K,id:ue.Four}]}]),q=a(()=>C.value||x.value||""),X=a(()=>{const e=`chart.time-frame.sc.${k.value}`,t=r(e);if("string"==typeof t&&t.trim().length>0&&t!==e)return t;const a=T.value.find(e=>e.value===k.value);return a?.label??k.value}),J=e=>{const t=e.key.toLowerCase();return"escape"===t&&M.value?(e.preventDefault(),void R()):"s"===t?e.ctrlKey&&e.altKey&&!e.shiftKey?(e.preventDefault(),void _("download-image")):e.ctrlKey&&e.shiftKey&&!e.altKey?(e.preventDefault(),void _("copy-image-to-clipboard")):void(!e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),_("open-image-in-new-tab"))):void 0};return o(()=>window.addEventListener("keydown",J)),i(()=>window.removeEventListener("keydown",J)),(e,t)=>{const a=ne,r=ie,o=oe;return n(),s("div",ke,[c("div",Te,[c("div",Le,[u(F)?(n(),s(m,{key:1},[c("div",De,[v(r,{"use-menu":"","dropdown-options":$.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",Pe,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.time-frame")},{default:g(()=>[c("span",null,d(X.value),1)]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])]),v(o,{direction:"vertical"}),c("div",Oe,[v(r,{"use-menu":"","dropdown-options":z.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",_e,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.chart-type-selector")},{default:g(()=>[v(u(W),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])])],64)):(n(),s("div",Se,[c("span",Me,d(u(l)),1),q.value?(n(),s(m,{key:0},[t[1]||(t[1]=c("span",{class:"text-[var(--er-text-secondary)]"},"/",-1)),c("span",Fe,d(q.value),1)],64)):p("",!0)]))]),c("div",Re,[u(F)?p("",!0):(n(),s(m,{key:0},[c("div",Ee,[v(r,{"use-menu":"","dropdown-options":$.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",$e,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.time-frame")},{default:g(()=>[c("span",null,d(X.value),1)]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])]),v(o,{direction:"vertical"}),c("div",ze,[v(r,{"use-menu":"","dropdown-options":z.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",je,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.chart-type-selector")},{default:g(()=>[v(u(W),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])])],64)),u(S).length?(n(),s("div",Be,[v(r,{"use-menu":"","dropdown-options":j.value},{menu_item:g(({data:e})=>[c("div",null,[c("div",null,d(e.label),1),e.desc?(n(),s("div",Ae,d(e.desc),1)):p("",!0)])]),default:g(()=>[c("button",Ie,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.snapshot")},{default:g(()=>[v(u(U),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])])):p("",!0),c("div",Ne,[v(r,null,{dropdown:g(()=>[c("div",Ve,[(n(!0),s(m,null,y(B.value,(e,t)=>(n(),s("div",{key:t},[c("div",Ke,[c("span",We,d(e.order),1),(n(!0),s(m,null,y(e.options,(e,t)=>(n(),s("div",{key:t,class:f(["cursor-pointer p-[2px] border rounded-xs transition-colors",u(D)===e.id?"border-[var(--er-border-action)] bg-[var(--er-surface-elevated)] text-[var(--er-text-brand)]":"border-[var(--er-border-default)] hover:bg-[var(--er-surface-muted)]"]),onClick:t=>u(E)(e.id)},[(n(),b(w(e.icon),{size:20}))],10,Ue))),128))])]))),128))])]),default:g(()=>[c("button",He,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.multi-chart")},{default:g(()=>[v(u(Y),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1})]),c("button",{type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]",onClick:t[0]||(t[0]=(...e)=>u(R)&&u(R)(...e))},[v(a,{placement:"bottom",content:e.$t("chart.tools.tooltip.fullscreen")},{default:g(()=>[v(u(Z),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])])])])}}}),Ze={class:"border-t border-[var(--er-border-default)] px-3 py-2"},qe={class:"flex justify-between items-center h-6"},Ge={class:"h-full flex items-center gap-2 select-none"},Xe={class:"h-full flex items-center gap-0.5"},Je=["onClick"],Qe={class:"h-full flex items-center select-none"},et={class:"text-label-md text-[var(--er-text-primary)] whitespace-nowrap","aria-live":"polite"},tt=l({__name:"EaeraLightweightChartFooter",props:{context:{}},setup(e){const r=e,{selectedTimeRange:l,timeRangeOptions:p,onChangeTimeRange:g,onChangeTimeFrame:b,onChangeCustomRange:w}=r.context,x=t(null),C=a(()=>p.value.filter(e=>e.value!==he.Custom)),k=(e,t)=>{g(e),b(t)},T=()=>{x.value?.handleOpen()},L=e=>{if(!e||2!==e.length)return;const t={startDate:e[0],endDate:e[1]};w(t),k(he.Custom,me.ThirtyMinutes)},S=e=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",a=-e.getTimezoneOffset(),r=`UTC${a>=0?"+":"-"}${String(Math.floor(Math.abs(a)/60)).padStart(2,"0")}:${String(Math.abs(a)%60).padStart(2,"0")}`;return`${new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"long",day:"numeric"}).format(e)} ${new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(e)} ${r}`},M=t("");let F;const D=()=>{M.value=S(new Date)};return o(()=>{D(),F=window.setInterval(D,1e3)}),i(()=>{void 0!==F&&clearInterval(F)}),(e,t)=>{const a=oe;return n(),s("div",Ze,[c("div",qe,[c("div",Ge,[c("div",Xe,[(n(!0),s(m,null,y(C.value,e=>(n(),s("button",{key:e.value,type:"button",class:f(["h-full flex items-center px-1 border-none rounded text-label-md text-[var(--er-text-primary)] cursor-pointer whitespace-nowrap bg-transparent hover:bg-[var(--er-surface-elevated)]",{"bg-[var(--er-surface-elevated)]":u(l)===e.value}]),onClick:t=>(e=>{switch(e){case he.OneDay:k(he.OneDay,me.OneMinute);break;case he.OneWeek:k(he.OneWeek,me.ThirtyMinutes);break;case he.OneMonth:k(he.OneMonth,me.ThirtyMinutes);break;case he.ThreeMonths:k(he.ThreeMonths,me.OneDay);break;case he.SixMonths:k(he.SixMonths,me.OneWeek);break;default:k(e,me.OneWeek)}})(e.value)},d(e.label),11,Je))),128)),v(a,{direction:"vertical",class:"mx-1"}),c("button",{type:"button",class:"flex items-center justify-center w-6 h-6 p-0 border-none rounded bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]",onClick:T},[v(u(q),{size:20,"absolute-stroke-width":"","stroke-width":"1.2"})]),v(u(se),{ref_key:"customDateRef",ref:x,"value-format":"YYYY-MM-DD",type:"daterange",class:"hidden",onChange:L},null,512)])]),c("div",Qe,[c("span",et,d(M.value),1)])])])}}}),at=(e,t,a=6)=>{if(!e.length||a<=0)return e;const r=Math.max(1,Math.floor((e=>({[me.OneMinute]:6e4,[me.FiveMinutes]:3e5,[me.FifteenMinutes]:9e5,[me.ThirtyMinutes]:18e5,[me.OneHour]:36e5,[me.FourHours]:144e5,[me.OneDay]:864e5,[me.OneWeek]:6048e5,[me.OneMonth]:2592e6}[e]))(t)/1e3)),l=e[e.length-1]?.time;if("number"!=typeof l||Number.isNaN(l))return e;const o=Array.from({length:a},(e,t)=>({time:l+r*(t+1)}));return[...e,...o]},rt=e=>{const t=lt(e);return t?((e,t)=>new Intl.DateTimeFormat(void 0,{timeZone:"UTC",...t}).format(e))(t,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):""},lt=e=>{if(null==e)return null;if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e){const t=new Date(e);return Number.isNaN(t.getTime())?null:t}return _(e)?new Date(e.year,e.month-1,e.day):null},ot=e=>e?{surfacePrimary:"#191D23",surfacePositive:"#16c784",surfaceNegative:"#ef4444",surfaceElevated:"#323A45",textPrimary:"#F0F1F3",textSecondary:"#B1B9C5",borderPrimary:"#323A45",borderPrimaryInverse:"#D8DCE2",borderAction:"#A259FB",areaTop:"#A259FB4D",areaBottom:"#A259FB0D"}:{surfacePrimary:"white",surfacePositive:"#16c784",surfaceNegative:"#ef4444",surfaceElevated:"#d8dce2",textPrimary:"#0f1115",textSecondary:"#4b5768",borderPrimary:"#d8dce2",borderPrimaryInverse:"#323a45",borderAction:"#A259FB",areaTop:"#A259FB4D",areaBottom:"#A259FB0D"},it=e=>{const t={width:0,height:0};const a=(e=>{const t=ot(e);return{background:{type:R.Solid,color:t.surfacePrimary},textColor:t.textSecondary}})(e),r=(e=>{const t=ot(e);return{vertLines:{color:t.borderPrimary,visible:!0,style:0},horzLines:{color:t.borderPrimary,visible:!0,style:0}}})(e),l=(e=>{const t=ot(e);return{mode:0,vertLine:{color:t.borderPrimaryInverse,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:t.surfaceElevated},horzLine:{color:t.borderPrimaryInverse,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:t.surfacePositive}}})(e),o=(e=>{const t=ot(e);return{rightPriceScale:{borderColor:t.borderPrimary,scaleMargins:{top:.3,bottom:.1},textColor:t.textSecondary},timeScale:{borderColor:t.borderPrimary,timeVisible:!0,rightOffsetPixels:48,allowShiftVisibleRangeOnWhitespaceReplacement:!0,textColor:t.textSecondary}}})(e);return{...t,layout:a,grid:r,crosshair:l,localization:{timeFormatter:e=>rt(e)},...o}},nt=e=>{const t=ot(e);return{upColor:t.surfacePositive,downColor:t.surfaceNegative,borderVisible:!1,wickUpColor:t.surfacePositive,wickDownColor:t.surfaceNegative}},st=["id"],ct={class:"absolute top-2 left-2 z-10 flex gap-x-4 gap-y-1 flex-wrap w-full"},ut={key:0,class:"text-label-lg font-semibold max-w-[calc(100%-1rem)]"},dt={class:"text-[var(--er-text-secondary)] whitespace-nowrap"},mt={key:1,class:"flex flex-wrap gap-x-2 gap-y-0.5 text-label-lg font-semibold max-w-[calc(100%-1rem)]"},ht={class:"text-[var(--er-text-secondary)]"},pt={class:"text-[var(--er-text-secondary)]"},vt={class:"text-[var(--er-text-secondary)]"},gt={class:"text-[var(--er-text-secondary)]"},yt=l({__name:"EaeraChartCanvas",props:{chartData:{default:()=>[]},selectedChartType:{default:ce.Candlestick},selectedTimeFrame:{default:me.OneMinute},dark:{type:Boolean,default:!1},tickSize:{default:null},symbol:{default:""},symbolDescription:{default:""},isMultiChart:{type:Boolean,default:!1},chartDomId:{default:void 0},openLabel:{default:"O"},highLabel:{default:"H"},lowLabel:{default:"L"},closeLabel:{default:"C"}},emits:["loadMoreLeft","resize"],setup(e,{expose:l,emit:u}){const m=e,v=u,g="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10),y=a(()=>m.chartDomId??`eaera-chart-canvas-${g}`),f=x(null),b=x(null),{width:w,height:T}=O(f),L=x(null),S=x(null),M=t(0),F=()=>{M.value+=1},D={openPrice:null,highPrice:null,lowPrice:null,closePrice:null,time:null,state:null,symbolLabel:m.symbol},P=x({...D}),_=a(()=>P.value.state?{color:`var(--er-text-${P.value.state})`}:{}),R=a(()=>m.dark??!1),B=a(()=>{const e=Number(m.tickSize??.01);return!Number.isFinite(e)||e<=0?.01:e}),I=e=>{if(!Number.isFinite(e)||e<=0)return 2;const t=e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20}),a=(t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t).split(".")[1];return a?a.length:0},A=e=>Number.isFinite(e)?Number(e.toFixed(I(B.value))):e,N=a(()=>{const e=new Map;return m.chartData.forEach(t=>{e.set(t.time,t)}),e}),H=a(()=>{const e=at(m.chartData,m.selectedTimeFrame,30);return m.selectedChartType===ce.Line||m.selectedChartType===ce.Area?e.map(e=>"open"in e?{time:e.time,value:e.close}:{time:e.time}):e}),V=a(()=>m.chartData.map(e=>e.time)),K=()=>{P.value={...D,symbolLabel:m.symbol}},W=()=>{S.value&&L.value&&(S.value.applyOptions({priceFormat:{type:"price",precision:I(B.value),minMove:B.value}}),L.value.priceScale("right").applyOptions({ticksVisible:!1,ensureEdgeTickMarksVisible:!0}))},U=()=>{L.value&&S.value&&(L.value.removeSeries(S.value),S.value=null)},Y=e=>{if(L.value){switch(U(),e){case ce.Candlestick:S.value=L.value.addSeries(E,nt(R.value));break;case ce.Line:S.value=L.value.addSeries(z,(t=R.value,{color:ot(t).borderAction,lineWidth:2,lineStyle:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4}));break;case ce.Area:S.value=L.value.addSeries($,(e=>{const t=ot(e);return{lineColor:t.borderAction,topColor:t.areaTop,bottomColor:t.areaBottom,lineWidth:2,lineStyle:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4}})(R.value));break;default:S.value=L.value.addSeries(E,nt(R.value))}var t;W(),F()}},Z=()=>{S.value&&(S.value.setData(H.value),W(),F())};let q=null,G=null;const X=()=>{L.value&&(q&&(L.value.unsubscribeCrosshairMove(q),q=null),G&&(L.value.timeScale().unsubscribeVisibleLogicalRangeChange(G),G=null))},J=()=>{((e,t)=>{L.value&&(L.value.applyOptions({width:e,height:t}),F(),v("resize",e,t))})(Math.max(0,w.value),Math.max(0,T.value))},Q=()=>{b.value&&(L.value=j(b.value,it(R.value)),F(),Y(m.selectedChartType),Z(),L.value&&(X(),q=e=>{const t="number"==typeof e.time?e.time:null;if(null===t)return void K();const a=N.value.get(t);a?P.value={openPrice:A(a.open),highPrice:A(a.high),lowPrice:A(a.low),closePrice:A(a.close),time:t,state:a.close>=a.open?"success":"error",symbolLabel:m.symbol}:K()},G=e=>{e&&e.from<=10&&v("loadMoreLeft")},L.value.subscribeCrosshairMove(q),L.value.timeScale().subscribeVisibleLogicalRangeChange(G)),J())};return r([w,T],J),r(()=>m.selectedChartType,e=>{Y(e),Z()}),r([()=>m.chartData,()=>m.selectedTimeFrame,B],()=>{Z()}),r(R,()=>{L.value&&(L.value.applyOptions(it(R.value)),Y(m.selectedChartType),Z())},{immediate:!0}),r(()=>m.symbol,e=>{P.value.symbolLabel=e}),o(async()=>{await C(),Q()}),i(()=>{X(),U(),L.value&&(L.value.remove(),L.value=null,F()),K()}),l({chartInstance:L,currentSeries:S,chartRenderKey:M,crosshairData:P,chartDataTimes:V,roundPriceByTickSize:A,clearCrosshairData:K,syncSeriesData:Z}),(t,a)=>(n(),s("div",{ref_key:"containerRef",ref:f,class:"relative w-full h-full min-h-0 min-w-0"},[c("div",{id:y.value,ref_key:"chartRef",ref:b,class:"w-full h-full"},null,8,st),c("div",ct,[e.isMultiChart&&e.symbolDescription?(n(),s("div",ut,[c("span",dt,d(e.symbolDescription),1)])):p("",!0),null!==P.value.closePrice?(n(),s("div",mt,[c("div",null,[c("span",ht,d(e.openLabel),1),c("span",{style:k(_.value)},d(P.value.openPrice),5)]),c("div",null,[c("span",pt,d(e.highLabel),1),c("span",{style:k(_.value)},d(P.value.highPrice),5)]),c("div",null,[c("span",vt,d(e.lowLabel),1),c("span",{style:k(_.value)},d(P.value.lowPrice),5)]),c("div",null,[c("span",gt,d(e.closeLabel),1),c("span",{style:k(_.value)},d(P.value.closePrice),5)])])):p("",!0)])],512))}}),ft=l({__name:"EaeraLightweightChartDrawingPlugin",props:{chart:{},series:{},symbol:{},selectedTimeFrame:{},chartDataTimes:{},isDark:{type:Boolean},floatingTarget:{},headerHeight:{},footerHeight:{},config:{}},emits:["stateChange"],setup(e,{emit:t}){const r=e,l=t,o=a(()=>r.selectedTimeFrame),i=a(()=>({position:"absolute",left:"0px",right:"0px",top:`${r.headerHeight}px`,bottom:`${r.footerHeight}px`,height:"auto",zIndex:20})),s=e=>{l("stateChange",e)};return(t,a)=>(n(),b(u(X),{chart:e.chart,series:e.series,symbol:e.symbol,"selected-time-frame":o.value,"chart-data-times":e.chartDataTimes,drawings:e.config.drawings,"is-dark":e.isDark,"create-drawing":e.config.createDrawing,"update-drawing":e.config.updateDrawing,"delete-drawing":e.config.deleteDrawing,"load-drawings":e.config.loadDrawings,"delete-all-drawings":e.config.deleteAllDrawings,"floating-target":e.floatingTarget,"floating-layer-style":i.value,"show-sidebar":e.config.showSidebar??!0,"show-floating-toolbar":e.config.showFloatingToolbar??!0,onStateChange:s},null,8,["chart","series","symbol","selected-time-frame","chart-data-times","drawings","is-dark","create-drawing","update-drawing","delete-drawing","load-drawings","delete-all-drawings","floating-target","floating-layer-style","show-sidebar","show-floating-toolbar"]))}}),bt=l({__name:"EaeraLightweightChartOrderlinePlugin",props:{chart:{},series:{},renderKey:{},isDark:{type:Boolean},config:{}},emits:["stateChange"],setup(e,{expose:a,emit:r}){const l=e,o=r,i=t(null),s=e=>{l.config.onDeleteLine(e)},c=(e,t)=>{l.config.onLinePriceChange(e,t)},d=(e,t)=>{l.config.onLinePricePreview?.(e,t)},m=e=>{l.config.onDragStateChange?.(e)},p=(e,t,a)=>{l.config.onSLTPChange?.(e,t,a)},v=e=>{o("stateChange",e)};return a({openMenu:e=>{i.value?.openMenu?.(e)}}),(t,a)=>(n(),b(u(J),{ref_key:"overlayRef",ref:i,"order-lines":e.config.orderLines,"chart-instance":e.chart,"series-instance":e.series,"order-line-tool":e.config.orderLineTool??null,"render-key":e.renderKey,"market-price":e.config.marketPrice??null,"tick-size":e.config.tickSize??null,dark:e.isDark,onDeleteLine:s,onLinePriceChange:c,onLinePricePreview:d,onDragStateChange:m,onSlTpChange:p,onStateChange:v},null,8,["order-lines","chart-instance","series-instance","order-line-tool","render-key","market-price","tick-size","dark"]))}}),wt=["onClick"],xt=.01,Ct="text-[color:var(--er-text-success)]",kt="text-[color:var(--er-text-danger)]",Tt="border-[color:var(--er-surface-muted)] bg-[color:var(--er-surface-elevated)]",Lt=ee(l({__name:"ChartContextMenu",props:{symbol:{},tickSize:{default:null}},emits:["action"],setup(e,{expose:r,emit:l}){const u=e,w=l,x=t(!1),C=t({x:0,y:0}),M=t(null),F=t("plot"),D=t(null),P=a(()=>({position:"fixed",zIndex:2,top:`${C.value.y}px`,left:`${C.value.x}px`})),O=["fixed","z-[2]","flex","flex-col","min-w-[240px]","py-2","border","rounded-sm","shadow-lg","surface-[var(--er-surface-page)]"],_=["flex","items-center","h-8","px-2","cursor-pointer","select-none","rounded-sm","hover:bg-[var(--er-action-neutral-subtle-hover)]"],R=["px-2","font-[family-name:var(--er-font-brand),system-ui,sans-serif]","text-[14px]","font-normal","leading-5","tracking-[0.018em]","text-[color:var(--er-action-neutral-default)]","whitespace-nowrap"];a(()=>[...O,Tt].join(" "));const E=a(()=>{const e=u.symbol||"GBPUSD",t=null!=M.value?M.value.toFixed(5):"—";return[{label:"Reset chart view",tone:"neutral",action:"reset-view"},..."plot"===F.value?[{label:`Buy Market 0.01 ${e}`,tone:"buy",action:"buy-market"},{label:`Sell Market 0.01 ${e}`,tone:"sell",action:"sell-market"},{label:`Buy Limit 0.01 ${e}`,tone:"buy",action:"buy-limit"},{label:`Sell Limit 0.01 ${e}`,tone:"sell",action:"sell-limit"},{label:`Buy Stop 0.01 ${e}`,tone:"buy",action:"buy-stop"},{label:`Buy Stop Limit 0.01 ${e}`,tone:"buy",action:"buy-stop-limit"},{label:`Sell Stop 0.01 ${e}`,tone:"sell",action:"sell-stop"},{label:`Sell Stop Limit 0.01 ${e}`,tone:"sell",action:"sell-stop-limit"},{label:"Lock vertical cursor line by time",tone:"neutral",action:"lock-cursor"}]:[],{label:`Copy price ${t}`,tone:"neutral",action:"copy-price"},{label:"Paste",tone:"neutral",action:"paste"}]}),$=new Set(["buy-limit","sell-limit","buy-stop","buy-stop-limit","sell-stop","sell-stop-limit"]),z={"buy-limit":{title:"Buy Limit",side:"buy",showStopLimitPrice:!1},"sell-limit":{title:"Sell Limit",side:"sell",showStopLimitPrice:!1},"buy-stop":{title:"Buy Stop",side:"buy",showStopLimitPrice:!1},"buy-stop-limit":{title:"Buy Stop Limit",side:"buy",showStopLimitPrice:!0},"sell-stop":{title:"Sell Stop",side:"sell",showStopLimitPrice:!1},"sell-stop-limit":{title:"Sell Stop Limit",side:"sell",showStopLimitPrice:!0}},j={"buy-market":{side:"buy",orderType:"market"},"sell-market":{side:"sell",orderType:"market"},"buy-limit":{side:"buy",orderType:"buy_limit"},"sell-limit":{side:"sell",orderType:"sell_limit"},"buy-stop":{side:"buy",orderType:"buy_stop"},"buy-stop-limit":{side:"buy",orderType:"buy_stop_limit"},"sell-stop":{side:"sell",orderType:"sell_stop"},"sell-stop-limit":{side:"sell",orderType:"sell_stop_limit"}},B=()=>{x.value=!1,D.value=null},I=()=>{D.value=null,x.value=!1},A=e=>{if(!D.value)return;const t=j[D.value.action];t&&(w("action",D.value.action,{symbol:u.symbol,price:e.price?Number(e.price):M.value,side:t.side,orderType:t.orderType,volume:e.volume?Number(e.volume):xt,stopLimitPrice:e.stopLimitPrice?Number(e.stopLimitPrice):void 0,takeProfit:e.takeProfitEnabled&&e.takeProfit?Number(e.takeProfit):void 0,stopLoss:e.stopLossEnabled&&e.stopLoss?Number(e.stopLoss):void 0,comment:e.comment||void 0}),I())},N=e=>{(x.value||D.value)&&B()},H=e=>{"Escape"===e.key&&(x.value||D.value)&&B()};return o(()=>{document.addEventListener("mousedown",N),document.addEventListener("keydown",H)}),i(()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",H)}),r({open:(e,t,a,r="plot")=>{C.value={x:e,y:t},M.value=a,F.value=r,D.value=null,x.value=!0},close:B}),(t,a)=>(n(),b(T,{to:"body"},[v(L,{name:"context-menu-fade"},{default:g(()=>[D.value?(n(),s("div",{key:0,class:f("fixed z-[2]"),style:k(P.value),onMousedown:a[0]||(a[0]=S(()=>{},["stop"]))},[v(Q,{title:D.value.title,"status-tag-text":D.value.statusTagText,side:D.value.side,symbol:e.symbol,"reference-price":M.value,"tick-size":e.tickSize,"show-stop-limit-price":D.value.showStopLimitPrice,"initial-comment":D.value.initialComment,onConfirm:A,onDiscard:I,onClose:I},null,8,["title","status-tag-text","side","symbol","reference-price","tick-size","show-stop-limit-price","initial-comment"])],36)):x.value?(n(),s("div",{key:1,class:f(O),style:k({top:`${C.value.y}px`,left:`${C.value.x}px`}),onClick:a[1]||(a[1]=S(()=>{},["stop"]))},[(n(!0),s(m,null,y(E.value,(e,t)=>{return n(),s("div",{key:t,class:f((e.tone,[..._].join(" "))),onClick:t=>(e=>{if("buy-market"===e.action||"sell-market"===e.action){const t=j[e.action];return w("action",e.action,{symbol:u.symbol,price:M.value,side:t.side,orderType:t.orderType,volume:xt}),void B()}if($.has(e.action)){const t=z[e.action];return void(D.value={action:e.action,title:t.title,statusTagText:`${t.title} 0.01`,side:t.side,showStopLimitPrice:t.showStopLimitPrice,initialComment:""})}w("action",e.action,{symbol:u.symbol,price:M.value}),B()})(e)},[c("span",{class:f((a=e.tone,"buy"===a?[...R,Ct].join(" "):"sell"===a?[...R,kt].join(" "):R.join(" ")))},d(e.label),3)],10,wt);var a}),128))],4)):p("",!0)]),_:1})]))}}),[["__scopeId","data-v-a1ce2602"]]),St={class:"flex flex-col gap-3 py-2"},Mt={class:"text-body-sm text-[var(--er-text-secondary)]"},Ft=["onClick"],Dt={class:"flex items-center gap-1.5"},Pt={key:0,width:"10",height:"10",viewBox:"0 0 12 12",fill:"none"},Ot={class:"text-label-md font-medium text-[var(--er-text-primary)] truncate"},_t={class:"flex justify-end gap-3"},Rt=l({__name:"SwitchMultiChartDialog",props:{isVisible:{type:Boolean},sourceLayout:{},sourcePanes:{},targetCount:{}},emits:["confirm","cancel"],setup(e,{emit:l}){const o=e,i=l,u=t([]),w={width:"120px",height:"64px"},x=a(()=>{switch(o.sourceLayout){case ue.TwoRows:case ue.ThreeRows:return"grid-cols-1";case ue.TwoCols:return"grid-cols-2";case ue.ThreeCols:return"grid-cols-3";case ue.Four:return"grid-cols-2 grid-rows-2";default:return"grid-cols-1"}}),C=e=>u.value.includes(e),k=()=>{u.value.length===o.targetCount&&i("confirm",[...u.value])},T=()=>{i("cancel")},L=()=>{i("cancel")};return r(()=>o.isVisible,e=>{e&&(u.value=o.sourcePanes.slice(0,o.targetCount).map(e=>e.id))},{immediate:!0}),(t,a)=>{const r=ae,l=te;return n(),b(l,{"dialog-visible":e.isVisible,width:"400px","append-body":"","destroy-on-close":"","close-on-click-modal":!0,"close-on-press-escape":!0,onClose:L},{header:g(()=>[...a[0]||(a[0]=[c("span",{class:"text-title-sm"},"Switch Multi-Chart",-1)])]),default:g(()=>[c("div",St,[c("span",Mt," Select "+d(e.targetCount)+" pane"+d(e.targetCount>1?"s":"")+" to keep* ",1),c("div",{class:f(["grid gap-1 justify-start",x.value])},[(n(!0),s(m,null,y(e.sourcePanes,e=>{return n(),s("div",{key:e.id,class:f(["flex flex-col items-center justify-center rounded-sm border cursor-pointer transition-colors p-2",C(e.id)?"border-[var(--er-border-action)] bg-[var(--er-surface-elevated)]":(t=e.id,!C(t)&&u.value.length>=o.targetCount?"border-[var(--er-border-default)] opacity-40 cursor-not-allowed":"border-[var(--er-border-default)] hover:bg-[var(--er-surface-muted)]")]),style:w,onClick:t=>(e=>{C(e)?u.value=u.value.filter(t=>t!==e):u.value.length>=o.targetCount||(u.value=[...u.value,e])})(e.id)},[c("div",Dt,[c("div",{class:f(["flex items-center justify-center w-4 h-4 rounded-sm border transition-colors shrink-0",C(e.id)?"border-[var(--er-border-action)] bg-[var(--er-border-action)]":"border-[var(--er-border-muted)]"])},[C(e.id)?(n(),s("svg",Pt,[...a[1]||(a[1]=[c("path",{d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):p("",!0)],2),c("span",Ot,d(e.symbol||`Pane ${e.index+1}`),1)])],10,Ft);var t}),128))],2)])]),footer:g(()=>[c("div",_t,[v(r,{color:"contrast",onClick:T},{default:g(()=>[...a[2]||(a[2]=[M("Cancel",-1)])]),_:1}),v(r,{color:"primary",disabled:u.value.length!==e.targetCount,onClick:k},{default:g(()=>[...a[3]||(a[3]=[M(" Confirm ",-1)])]),_:1},8,["disabled"])])]),_:1},8,["dialog-visible"])}}}),Et={key:1,class:"relative w-full flex-1 min-h-0"},$t=["onClick"],zt=l({__name:"index",props:{symbol:{},chartData:{},selectedTimeFrame:{},selectedTimeRange:{},selectedChartType:{},customTimeRange:{},timeFrameOptions:{},timeRangeOptions:{},chartTypeOptions:{},snapshotOptions:{},isLoading:{type:Boolean},isExpanded:{type:Boolean},multiChartLayout:{},dataBarCount:{},tickSize:{},dark:{type:Boolean},chartDomId:{},overlayTitle:{},overlaySubtitle:{},openLabel:{},highLabel:{},lowLabel:{},closeLabel:{},plugins:{},drawingPlugin:{},orderlinePlugin:{}},emits:["resize","changeTimeFrame","changeTimeRange","changeChartType","changeCustomRange","loadMoreLeft","toggleExpanded","changeMultiChartLayout","stateChange","drawingStateChange","orderlineStateChange","contextMenuAction","activeSymbolChange"],setup(r,{expose:l,emit:o}){const i=r,c=o,d=x(null),g=xe(i,c,{snapshotTargetRef:d}),{isLoading:w,symbol:C,overlaySubtitle:k,chartData:T,selectedTimeFrame:L,selectedChartType:M,tickSize:P,dark:O,isMultiChart:_,multiChartLayout:R,chartIds:E,selectedChartId:$}=g,z=x(null),j=t({}),B=x(null),I=x(null),A=x(null),N=x(null),H=a(()=>O.value??!1),V=a(()=>B.value?.$el?.offsetHeight??0),K=a(()=>I.value?.$el?.offsetHeight??0),W=a(()=>E.value.map((e,t)=>({id:e,index:t,symbol:g.getSymbolForChart(e),description:g.getSymbolDescriptionForChart(e),timeFrame:g.getTimeFrameForChart(e)}))),U=a(()=>z.value?.chartInstance??null),Y=a(()=>z.value?.currentSeries??null),Z=a(()=>z.value?.chartRenderKey??0),q=a(()=>z.value?.chartDataTimes??[]),G=a(()=>i.plugins??[]),X=a(()=>i.drawingPlugin??null),J=a(()=>i.orderlinePlugin??null),Q=a(()=>G.value.includes(pe.Drawing)&&!!X.value),ee=a(()=>G.value.includes(pe.Orderline)&&!!J.value),te=a(()=>Q.value&&(X.value?.showSidebar??!0)),ae=e=>{c("drawingStateChange",e)},re=e=>{c("orderlineStateChange",e)},le=e=>{if(_.value)return;const t=z.value;if(!t)return;let a=t.crosshairData?.closePrice??null,r="plot";const l=t.chartInstance,o=t.currentSeries;if(l&&o){const i=l.chartElement().getBoundingClientRect(),n=e.clientY-i.top,s=o.coordinateToPrice(n);null!=s&&(a=t.roundPriceByTickSize?.(s));const c=l.priceScale("right").width(),u=l.priceScale("left").width(),d=e.clientX-i.left;(d<u||d>i.width-c)&&(r="axis")}A.value?.open(e.clientX,e.clientY,a,r)},oe=(e,t)=>{c("contextMenuAction",e,t)},ie=a(()=>["flex flex-1 flex-col min-h-0 min-w-0 h-full overflow-hidden relative rounded-xs bg-[var(--er-surface-page)]",{"rounded-l-none":te.value&&!_.value}]),ne=a(()=>{switch(R.value){case ue.TwoRows:case ue.ThreeRows:return"flex flex-col";case ue.TwoCols:case ue.ThreeCols:return"flex flex-row";case ue.Four:return"grid grid-cols-2 grid-rows-2";default:return"flex flex-row"}}),se=e=>["min-h-0 min-w-0 rounded-sm overflow-hidden ring-1 transition-all cursor-pointer",R.value===ue.Four?"h-full w-full":"flex-1",$.value===e?"ring-[var(--er-border-action)]":"ring-[var(--er-border-default)]"];return l({state:g.state,selectedTimeFrame:g.selectedTimeFrame,selectedTimeRange:g.selectedTimeRange,selectedChartType:g.selectedChartType,customTimeRange:g.customTimeRange,isExpanded:g.isExpanded,isMultiChart:g.isMultiChart,multiChartLayout:g.multiChartLayout,selectedChartId:g.selectedChartId,activeChartLastPrice:g.activeChartLastPrice,chartInstance:U,currentSeries:Y,chartRenderKey:Z,headerHeight:V,footerHeight:K,takeSnapshot:g.onSnapshot,openMenu:e=>{N.value?.openMenu?.(e)}}),(t,a)=>{const r=e;return n(),s("div",{class:"flex h-full w-full min-h-0 min-w-0 gap-1 overflow-hidden",onContextmenu:S(le,["prevent"])},[!u(_)&&Q.value&&X.value?(n(),b(ft,{key:0,chart:U.value,series:Y.value,symbol:u(C),"selected-time-frame":u(L),"chart-data-times":q.value,"is-dark":H.value,"floating-target":d.value,"header-height":V.value,"footer-height":K.value,config:X.value,onStateChange:ae},null,8,["chart","series","symbol","selected-time-frame","chart-data-times","is-dark","floating-target","header-height","footer-height","config"])):p("",!0),F((n(),s("div",{ref_key:"lightweightChartRef",ref:d,class:f(ie.value)},[!u(_)&&ee.value&&J.value?(n(),b(bt,{key:0,ref_key:"orderlinePluginRef",ref:N,chart:U.value,series:Y.value,"render-key":Z.value,"is-dark":H.value,config:J.value,onStateChange:re},null,8,["chart","series","render-key","is-dark","config"])):p("",!0),v(u(Ye),{ref_key:"headerRef",ref:B,context:u(g)},null,8,["context"]),u(_)?(n(),s("div",{key:2,class:f(["w-full flex-1 min-h-0 gap-2 p-1",ne.value])},[(n(!0),s(m,null,y(u(E),e=>(n(),s("div",{key:e,class:f(se(e)),onClick:t=>u(g).onSelectChart(e)},[v(yt,{ref_for:!0,ref:t=>((e,t)=>{j.value[e]=t??null})(e,t),"chart-data":u(g).getChartDataForChart(e),"selected-chart-type":u(g).getChartTypeForChart(e),"selected-time-frame":u(g).getTimeFrameForChart(e),dark:H.value,"tick-size":u(P),symbol:u(g).getSymbolForChart(e),"symbol-description":u(g).getSymbolDescriptionForChart(e),"is-multi-chart":!0,"open-label":i.openLabel,"high-label":i.highLabel,"low-label":i.lowLabel,"close-label":i.closeLabel,onLoadMoreLeft:u(g).onLoadMoreLeft},null,8,["chart-data","selected-chart-type","selected-time-frame","dark","tick-size","symbol","symbol-description","open-label","high-label","low-label","close-label","onLoadMoreLeft"])],10,$t))),128))],2)):(n(),s("div",Et,[v(yt,{ref_key:"primaryCanvasRef",ref:z,"chart-data":u(T),"selected-chart-type":u(M),"selected-time-frame":u(L),dark:H.value,"tick-size":u(P),symbol:u(C),"symbol-description":u(k),"is-multi-chart":!1,"open-label":i.openLabel,"high-label":i.highLabel,"low-label":i.lowLabel,"close-label":i.closeLabel,onLoadMoreLeft:u(g).onLoadMoreLeft,onResize:u(g).onResize},null,8,["chart-data","selected-chart-type","selected-time-frame","dark","tick-size","symbol","symbol-description","open-label","high-label","low-label","close-label","onLoadMoreLeft","onResize"])])),v(u(tt),{ref_key:"footerRef",ref:I,context:u(g)},null,8,["context"]),D(t.$slots,"chart-overlay")],2)),[[r,u(w)]]),u(_)?p("",!0):(n(),b(Lt,{key:1,ref_key:"contextMenuRef",ref:A,symbol:u(C),onAction:oe},null,8,["symbol"])),u(g).pendingLayoutSwitch.value?(n(),b(Rt,{key:2,"is-visible":!!u(g).pendingLayoutSwitch.value,"source-layout":u(R),"source-panes":W.value,"target-count":u(de)(u(g).pendingLayoutSwitch.value),onConfirm:u(g).confirmLayoutSwitch,onCancel:u(g).cancelLayoutSwitch},null,8,["is-visible","source-layout","source-panes","target-count","onConfirm","onCancel"])):p("",!0)],32)}}});export{ue as C,pe as E,me as T,zt as _,ce as a,he as b,de as g,xe as p,Ce as u};
1
+ import{ElLoadingDirective as e}from"element-plus/es";import{ref as t,computed as a,watch as r,defineComponent as l,onMounted as o,onUnmounted as i,openBlock as n,createElementBlock as s,createElementVNode as c,unref as u,toDisplayString as d,Fragment as m,createCommentVNode as p,createVNode as v,withCtx as g,renderList as y,normalizeClass as f,createBlock as b,resolveDynamicComponent as w,shallowRef as x,nextTick as C,normalizeStyle as k,Teleport as T,Transition as L,withModifiers as S,createTextVNode as M,withDirectives as F,renderSlot as D}from"vue";import{b as P,a as O}from"./vendor-vueuse-core-B96HGhR7.mjs";import{isBusinessDay as _,ColorType as R,CandlestickSeries as E,AreaSeries as $,LineSeries as z,createChart as j}from"lightweight-charts";import{Square as B,Columns2 as I,Rows2 as A,Columns3 as N,Rows3 as H,Grid2X2 as V,ChartCandlestick as K,Camera as W,Table as U,Scan as Y,CalendarDays as Z}from"@lucide/vue";import{ElNotification as q}from"element-plus";import"./vendor-email-misspelled-0hsXkSSK.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import{useI18n as G}from"vue-i18n";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as X}from"./index-DXC-pgpu.mjs";import{_ as J,O as Q}from"./index-Ton12Mr0.mjs";import{_ as ee}from"./_plugin-vue_export-helper-BCo6x5W8.mjs";import{_ as te}from"./EaeraDialog-uLsXC20k.mjs";import{_ as ae}from"./EaeraButton-BPVKRBOn.mjs";import{t as re,a as le}from"./vendor-html-to-image-DzdJgLib.mjs";import{_ as oe}from"./EaeraDivider-Dggvc36a.mjs";import ie from"../composite/EaeraDropdownV2.mjs";import{_ as ne}from"./EaeraTooltip-BIlULHv4.mjs";import{_ as se}from"./EaeraDatePicker-Bwt5r5gk.mjs";const ce={Candlestick:"candlestick",Line:"line",Area:"area"},ue={Single:"single",TwoRows:"two-rows",TwoCols:"two-cols",ThreeRows:"three-rows",ThreeCols:"three-cols",Four:"four"},de=e=>{switch(e){case ue.Single:return 1;case ue.TwoRows:case ue.TwoCols:return 2;case ue.ThreeRows:case ue.ThreeCols:return 3;case ue.Four:return 4;default:return 1}},me={OneMinute:"1m",FiveMinutes:"5m",FifteenMinutes:"15m",ThirtyMinutes:"30m",OneHour:"1h",FourHours:"4h",OneDay:"1d",OneWeek:"1w",OneMonth:"1mn"},he={OneDay:"1D",OneWeek:"1W",OneMonth:"1M",ThreeMonths:"3M",SixMonths:"6M",OneYear:"1Y",All:"ALL",Custom:"CUSTOM"},pe={Drawing:"drawing",Orderline:"orderline"},ve=[me.OneMinute,me.FiveMinutes,me.FifteenMinutes,me.ThirtyMinutes,me.OneHour,me.FourHours,me.OneDay,me.OneWeek,me.OneMonth],ge=[he.OneDay,he.OneWeek,he.OneMonth,he.ThreeMonths,he.SixMonths,he.OneYear,he.All,he.Custom],ye=[{value:ce.Candlestick,icon:"Candle3"},{value:ce.Line,icon:"LineChart2"},{value:ce.Area,icon:"AreaChart"}],fe=["download-image","copy-image-to-clipboard","open-image-in-new-tab"],be={[me.OneMinute]:60,[me.FiveMinutes]:300,[me.FifteenMinutes]:900,[me.ThirtyMinutes]:1800,[me.OneHour]:3600,[me.FourHours]:14400,[me.OneDay]:86400,[me.OneWeek]:604800,[me.OneMonth]:2592e3},we=(e,t=100,a=1.272)=>{const r=[],l=Math.floor(Date.now()/1e3),o=be[e]??900;let i=a;for(let n=t-1;n>=0;n--){const e=2e-4,t=i,a=t+15e-5*(Math.random()-.48)+(Math.random()-.5)*e,s=Math.max(t,a)+Math.random()*e*.6,c=Math.min(t,a)-Math.random()*e*.6,u=l-n*o;r.push({time:u,open:+t.toFixed(5),high:+s.toFixed(5),low:+c.toFixed(5),close:+a.toFixed(5)}),i=a}return r},xe=(e,l,o={})=>{const{t:i}=G(),n=t(e.selectedTimeRange??he.OneDay),s=t(e.customTimeRange??null),c=t(e.isExpanded??!1),u=P("multi-chart:layout",e.multiChartLayout??ue.Single),d=t("chart-0"),m=e.selectedTimeFrame??me.OneMinute,p=e.selectedChartType??ce.Candlestick,v=e.dataBarCount??100,g=P("multi-chart:configs",{"chart-0":{timeFrame:m,chartType:p}}),y=e.symbol??"",f=e.overlaySubtitle??"",b=P("multi-chart:symbols",{"chart-0":y}),w=P("multi-chart:descriptions",{"chart-0":f}),x=t(null),C=a(()=>{const e=de(u.value);return Array.from({length:e},(e,t)=>`chart-${t}`)});r(C,e=>{const t=u.value,a={...g.value},r={...w.value},l={...b.value};try{const t={...a},o={...r},i={...l},n=t["chart-0"]??{timeFrame:m,chartType:p},s=o["chart-0"]??f,c=i["chart-0"]??y;e.forEach(e=>{const a=t[e];a&&a.timeFrame&&a.chartType||(t[e]={...n}),o[e]||(o[e]=s),i[e]||(i[e]=c)});const u={},d={},v={};e.forEach(e=>{if(!t[e]||!o[e]||!i[e])throw new Error(`Incomplete config for chart pane "${e}"`);u[e]=t[e],d[e]=o[e],v[e]=i[e]}),g.value=u,w.value=d,b.value=v}catch(o){console.error("Failed to expand chart layout:",o),u.value=t,g.value=a,w.value=r,b.value=l,q.error({message:i("chart.multi-chart.error.expansion-failed"),duration:5e3})}},{immediate:!0}),r(()=>e.selectedTimeFrame,e=>{if(e){const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],timeFrame:e})}}),r(()=>e.selectedChartType,e=>{if(e){const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],chartType:e})}}),r(()=>e.selectedTimeRange,e=>{e&&(n.value=e)}),r(()=>e.customTimeRange,e=>{void 0!==e&&(s.value=e??null)}),r(()=>e.isExpanded,e=>{"boolean"==typeof e&&(c.value=e)}),r(()=>e.multiChartLayout,e=>{e&&(u.value=e)}),r(()=>e.symbol,e=>{const t=d.value;if(void 0!==e&&b.value[t]!==e){b.value={...b.value,[t]:e};const{[t]:a,...r}=R.value;R.value=r}}),r(d,t=>{const a=b.value[t];void 0!==a&&a!==e.symbol&&l("activeSymbolChange",a)}),r(()=>e.overlaySubtitle,e=>{const t=d.value,a=e??"";w.value[t]!==a&&(w.value={...w.value,[t]:a})});const k=(e,t)=>{const a=i(e);return"string"==typeof a&&a.trim().length>0?a:t},T=a(()=>ve.map(e=>({label:k(`chart.time-frame.${e}`,e),value:e}))),L=a(()=>ge.map(e=>({label:k(`chart.time-range.${e}`,e),value:e}))),S=a(()=>ye.map(e=>({label:k(`chart.type.${e.value}`,e.value),value:e.value,icon:e.icon,chartIcon:e.icon}))),M=a(()=>fe.map(e=>"download-image"===e?{value:e,label:k("chart.snapshot.download-image","Download image"),desc:k("chart.snapshot.download-image-shortcut","Ctrl + Alt + S")}:"copy-image-to-clipboard"===e?{value:e,label:k("chart.snapshot.copy-image-to-clipboard","Copy image"),desc:k("chart.snapshot.copy-image-to-clipboard-shortcut","Ctrl + Shift + S")}:{value:e,label:k("chart.snapshot.open-in-new-tab","Open in new tab"),desc:k("chart.snapshot.open-in-new-tab-shortcut","Alt + S")})),F=a(()=>g.value[d.value]??{timeFrame:m,chartType:p}),D=a(()=>e.chartData&&e.chartData.length>0?e.chartData:we(F.value.timeFrame,v)),O=a(()=>{const e=D.value;return e.length>0?e[e.length-1].close:null}),_=a(()=>({selectedTimeFrame:F.value.timeFrame,selectedTimeRange:n.value,selectedChartType:F.value.chartType,customTimeRange:s.value,isExpanded:c.value,isLoading:e.isLoading??!1}));r(_,e=>{l("stateChange",e)},{immediate:!0});const R=t({}),E=e=>g.value[e]?.timeFrame??m,$=async e=>{const t=o.snapshotTargetRef?.value;if(t)switch(e){case"download-image":await(async e=>{try{const t=await re(e,{quality:1,pixelRatio:2}),a=document.createElement("a");a.href=t,a.download=`chart-snapshot-${Date.now()}.png`,a.click()}catch(t){console.error("Failed to download chart image:",t),q.error({message:i("chart.snapshot.error.download"),duration:5e3})}})(t);break;case"copy-image-to-clipboard":await(async e=>{try{const t=await le(e,{quality:1,pixelRatio:2});if(!t?.type||"undefined"==typeof ClipboardItem)throw new Error("Failed to generate image blob");const a=new ClipboardItem({[t.type]:t});await navigator.clipboard.write([a])}catch(t){console.error("Failed to copy chart image to clipboard:",t),q.error({message:i("chart.snapshot.error.copy"),duration:5e3})}})(t);break;case"open-image-in-new-tab":await(async e=>{try{const t=await re(e,{quality:1,pixelRatio:2}),a=window.open();a&&(a.document.write(`\n <html>\n <head><title>Chart Snapshot</title></head>\n <body style="margin:0;display:flex;justify-content:center;align-items:center;min-height:100vh;background:#000;">\n <img src="${t}" style="max-width:100%;max-height:100vh;" />\n </body>\n </html>\n `),a.document.close())}catch(t){console.error("Failed to open chart image in new tab:",t),q.error({message:i("chart.snapshot.error.open"),duration:5e3})}})(t)}};return{symbol:a(()=>e.symbol??""),overlaySubtitle:a(()=>e.overlaySubtitle??""),chartData:D,selectedTimeFrame:a(()=>F.value.timeFrame),selectedTimeRange:a(()=>n.value),selectedChartType:a(()=>F.value.chartType),customTimeRange:a(()=>s.value),timeFrameOptions:a(()=>e.timeFrameOptions&&e.timeFrameOptions.length>0?e.timeFrameOptions:T.value),timeRangeOptions:a(()=>e.timeRangeOptions&&e.timeRangeOptions.length>0?e.timeRangeOptions:L.value),chartTypeOptions:a(()=>e.chartTypeOptions&&e.chartTypeOptions.length>0?e.chartTypeOptions:S.value),snapshotOptions:a(()=>void 0!==e.snapshotOptions?e.snapshotOptions:M.value),isLoading:a(()=>e.isLoading??!1),isExpanded:a(()=>c.value),isMultiChart:a(()=>u.value!==ue.Single),multiChartLayout:a(()=>u.value),chartIds:C,selectedChartId:a(()=>d.value),activeChartLastPrice:O,tickSize:a(()=>e.tickSize),dark:a(()=>e.dark),chartDomId:a(()=>e.chartDomId??"eaera-lightweight-chart-canvas"),overlayTitle:a(()=>e.overlayTitle??""),state:_,getTimeFrameForChart:E,getChartTypeForChart:e=>g.value[e]?.chartType??p,getChartDataForChart:t=>{if(e.chartData&&e.chartData.length>0)return e.chartData;const a=E(t),r=R.value[t];if(r&&r.length>0){const e=be[a],t=r[r.length-1].time,l=Math.floor(Date.now()/1e3)-e;if(Math.abs(t-l)<2*e)return r}const l=we(a,v);return R.value={...R.value,[t]:l},l},getSymbolForChart:e=>b.value[e]??y,getSymbolDescriptionForChart:e=>w.value[e]??f,onResize:(e,t)=>l("resize",e,t),onChangeTimeFrame:e=>{const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],timeFrame:e}),l("changeTimeFrame",e)},onChangeTimeRange:e=>{n.value=e,l("changeTimeRange",e)},onChangeChartType:e=>{const t=d.value;g.value[t]&&(g.value[t]={...g.value[t],chartType:e}),l("changeChartType",e)},onChangeCustomRange:e=>{s.value=e,l("changeCustomRange",e)},onLoadMoreLeft:()=>l("loadMoreLeft"),onSnapshot:async e=>{await $(e)},onToggleExpanded:()=>{c.value=!c.value,l("toggleExpanded")},onChangeMultiChartLayout:e=>{const t=u.value,a=de(t),r=de(e);if(r<a)return void(x.value=e);if(r>a){const e={...g.value},t={...w.value},l={...b.value},o=d.value,i=e[o]??e["chart-0"],n=t[o]??f,s=l[o]??y;for(let c=a;c<r;c++){const a=`chart-${c}`;e[a]||(e[a]={...i}),t[a]||(t[a]=n),l[a]||(l[a]=s)}g.value=e,w.value=t,b.value=l}u.value=e;parseInt(d.value.split("-")[1]??"0",10)>=r&&(d.value="chart-0"),l("changeMultiChartLayout",e)},onSelectChart:e=>{d.value=e},confirmLayoutSwitch:e=>{const t=x.value;if(!t)return;const a=de(t),r={},o={},i={};e.slice(0,a).forEach((e,t)=>{const a=`chart-${t}`;r[a]=g.value[e]??{timeFrame:m,chartType:p},o[a]=w.value[e]??f,i[a]=b.value[e]??y}),g.value=r,w.value=o,b.value=i,d.value="chart-0",u.value=t,x.value=null,l("changeMultiChartLayout",t)},cancelLayoutSwitch:()=>{x.value=null},pendingLayoutSwitch:a(()=>x.value)}},Ce=e=>e,ke={class:"p-2.5"},Te={class:"w-full h-8 flex items-center justify-between"},Le={class:"h-full flex items-center gap-1"},Se={key:0,class:"flex items-center gap-1 text-label-lg text-[var(--er-text-primary)]"},Me={class:"whitespace-nowrap"},Fe={class:"text-[var(--er-text-secondary)] whitespace-nowrap"},De={class:"flex items-center"},Pe={type:"button",class:"flex items-center justify-center h-8 px-3 border-none rounded-lg bg-transparent text-label-lg text-[var(--er-text-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Oe={class:"flex items-center"},_e={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Re={class:"h-full flex items-center gap-1"},Ee={class:"flex items-center"},$e={type:"button",class:"flex items-center justify-center h-8 px-3 border-none rounded-lg bg-transparent text-label-lg text-[var(--er-text-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},ze={class:"flex items-center"},je={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Be={key:1,class:"flex items-center"},Ie={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Ae={key:0,class:"text-body-xs text-[var(--er-text-secondary)]"},Ne={class:"flex items-center"},He={type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]"},Ve={class:"flex flex-col gap-2 py-4 px-3 min-w-[150px]"},Ke={class:"flex items-center gap-3"},We={class:"w-4"},Ue=["onClick"],Ye=l({__name:"EaeraLightweightChartHeader",props:{context:{}},setup(e){const t=e,{t:r}=G(),{symbol:l,overlayTitle:x,overlaySubtitle:C,selectedTimeFrame:k,timeFrameOptions:T,chartTypeOptions:L,snapshotOptions:S,isExpanded:M,isMultiChart:F,multiChartLayout:D,onChangeTimeFrame:P,onChangeChartType:O,onSnapshot:_,onToggleExpanded:R,onChangeMultiChartLayout:E}=t.context,$=a(()=>T.value.map(e=>({label:e.label,value:e.value,itemClick:()=>P(e.value)}))),z=a(()=>L.value.map(e=>({label:e.label,value:e.value,itemClick:()=>O(e.value)}))),j=a(()=>S.value.map(e=>({label:e.label,value:e.value,desc:e.desc,itemClick:()=>_(e.value)}))),Z=a(()=>[{order:1,options:[{icon:B,id:ue.Single}]},{order:2,options:[{icon:I,id:ue.TwoCols},{icon:A,id:ue.TwoRows}]},{order:3,options:[{icon:N,id:ue.ThreeCols},{icon:H,id:ue.ThreeRows}]},{order:4,options:[{icon:V,id:ue.Four}]}]),q=a(()=>C.value||x.value||""),X=a(()=>{const e=`chart.time-frame.sc.${k.value}`,t=r(e);if("string"==typeof t&&t.trim().length>0&&t!==e)return t;const a=T.value.find(e=>e.value===k.value);return a?.label??k.value}),J=e=>{const t=e.key.toLowerCase();return"escape"===t&&M.value?(e.preventDefault(),void R()):"s"===t?e.ctrlKey&&e.altKey&&!e.shiftKey?(e.preventDefault(),void _("download-image")):e.ctrlKey&&e.shiftKey&&!e.altKey?(e.preventDefault(),void _("copy-image-to-clipboard")):void(!e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),_("open-image-in-new-tab"))):void 0};return o(()=>window.addEventListener("keydown",J)),i(()=>window.removeEventListener("keydown",J)),(e,t)=>{const a=ne,r=ie,o=oe;return n(),s("div",ke,[c("div",Te,[c("div",Le,[u(F)?(n(),s(m,{key:1},[c("div",De,[v(r,{"use-menu":"","dropdown-options":$.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",Pe,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.time-frame")},{default:g(()=>[c("span",null,d(X.value),1)]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])]),v(o,{direction:"vertical"}),c("div",Oe,[v(r,{"use-menu":"","dropdown-options":z.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",_e,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.chart-type-selector")},{default:g(()=>[v(u(K),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])])],64)):(n(),s("div",Se,[c("span",Me,d(u(l)),1),q.value?(n(),s(m,{key:0},[t[1]||(t[1]=c("span",{class:"text-[var(--er-text-secondary)]"},"/",-1)),c("span",Fe,d(q.value),1)],64)):p("",!0)]))]),c("div",Re,[u(F)?p("",!0):(n(),s(m,{key:0},[c("div",Ee,[v(r,{"use-menu":"","dropdown-options":$.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",$e,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.time-frame")},{default:g(()=>[c("span",null,d(X.value),1)]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])]),v(o,{direction:"vertical"}),c("div",ze,[v(r,{"use-menu":"","dropdown-options":z.value},{menu_item:g(({data:e})=>[c("div",null,d(e.label),1)]),default:g(()=>[c("button",je,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.chart-type-selector")},{default:g(()=>[v(u(K),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])])],64)),u(S).length?(n(),s("div",Be,[v(r,{"use-menu":"","dropdown-options":j.value},{menu_item:g(({data:e})=>[c("div",null,[c("div",null,d(e.label),1),e.desc?(n(),s("div",Ae,d(e.desc),1)):p("",!0)])]),default:g(()=>[c("button",Ie,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.snapshot")},{default:g(()=>[v(u(W),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1},8,["dropdown-options"])])):p("",!0),c("div",Ne,[v(r,null,{dropdown:g(()=>[c("div",Ve,[(n(!0),s(m,null,y(Z.value,(e,t)=>(n(),s("div",{key:t},[c("div",Ke,[c("span",We,d(e.order),1),(n(!0),s(m,null,y(e.options,(e,t)=>(n(),s("div",{key:t,class:f(["cursor-pointer p-[2px] border rounded-xs transition-colors",u(D)===e.id?"border-[var(--er-border-action)] bg-[var(--er-surface-elevated)] text-[var(--er-text-brand)]":"border-[var(--er-border-default)] hover:bg-[var(--er-surface-muted)]"]),onClick:t=>u(E)(e.id)},[(n(),b(w(e.icon),{size:20}))],10,Ue))),128))])]))),128))])]),default:g(()=>[c("button",He,[v(a,{placement:"right",content:e.$t("chart.tools.tooltip.multi-chart")},{default:g(()=>[v(u(U),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])]),_:1})]),c("button",{type:"button",class:"flex items-center justify-center w-8 h-8 p-0 border-none rounded-lg bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]",onClick:t[0]||(t[0]=(...e)=>u(R)&&u(R)(...e))},[v(a,{placement:"bottom",content:e.$t("chart.tools.tooltip.fullscreen")},{default:g(()=>[v(u(Y),{size:20,"stroke-width":"1.2","absolute-stroke-width":""})]),_:1},8,["content"])])])])])}}}),Ze={class:"border-t border-[var(--er-border-default)] px-3 py-2"},qe={class:"flex justify-between items-center h-6"},Ge={class:"h-full flex items-center gap-2 select-none"},Xe={class:"h-full flex items-center gap-0.5"},Je=["onClick"],Qe={class:"h-full flex items-center select-none"},et={class:"text-label-md text-[var(--er-text-primary)] whitespace-nowrap","aria-live":"polite"},tt=l({__name:"EaeraLightweightChartFooter",props:{context:{}},setup(e){const r=e,{selectedTimeRange:l,timeRangeOptions:p,onChangeTimeRange:g,onChangeTimeFrame:b,onChangeCustomRange:w}=r.context,x=t(null),C=a(()=>p.value.filter(e=>e.value!==he.Custom)),k=(e,t)=>{g(e),b(t)},T=()=>{x.value?.handleOpen()},L=e=>{if(!e||2!==e.length)return;const t={startDate:e[0],endDate:e[1]};w(t),k(he.Custom,me.ThirtyMinutes)},S=e=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",a=-e.getTimezoneOffset(),r=`UTC${a>=0?"+":"-"}${String(Math.floor(Math.abs(a)/60)).padStart(2,"0")}:${String(Math.abs(a)%60).padStart(2,"0")}`;return`${new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"long",day:"numeric"}).format(e)} ${new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(e)} ${r}`},M=t("");let F;const D=()=>{M.value=S(new Date)};return o(()=>{D(),F=window.setInterval(D,1e3)}),i(()=>{void 0!==F&&clearInterval(F)}),(e,t)=>{const a=oe;return n(),s("div",Ze,[c("div",qe,[c("div",Ge,[c("div",Xe,[(n(!0),s(m,null,y(C.value,e=>(n(),s("button",{key:e.value,type:"button",class:f(["h-full flex items-center px-1 border-none rounded text-label-md text-[var(--er-text-primary)] cursor-pointer whitespace-nowrap bg-transparent hover:bg-[var(--er-surface-elevated)]",{"bg-[var(--er-surface-elevated)]":u(l)===e.value}]),onClick:t=>(e=>{switch(e){case he.OneDay:k(he.OneDay,me.OneMinute);break;case he.OneWeek:k(he.OneWeek,me.ThirtyMinutes);break;case he.OneMonth:k(he.OneMonth,me.ThirtyMinutes);break;case he.ThreeMonths:k(he.ThreeMonths,me.OneDay);break;case he.SixMonths:k(he.SixMonths,me.OneWeek);break;default:k(e,me.OneWeek)}})(e.value)},d(e.label),11,Je))),128)),v(a,{direction:"vertical",class:"mx-1"}),c("button",{type:"button",class:"flex items-center justify-center w-6 h-6 p-0 border-none rounded bg-transparent text-[var(--er-icon-primary)] cursor-pointer hover:bg-[var(--er-surface-hover)]",onClick:T},[v(u(Z),{size:20,"absolute-stroke-width":"","stroke-width":"1.2"})]),v(u(se),{ref_key:"customDateRef",ref:x,"value-format":"YYYY-MM-DD",type:"daterange",class:"hidden",onChange:L},null,512)])]),c("div",Qe,[c("span",et,d(M.value),1)])])])}}}),at=(e,t,a=6)=>{if(!e.length||a<=0)return e;const r=Math.max(1,Math.floor((e=>({[me.OneMinute]:6e4,[me.FiveMinutes]:3e5,[me.FifteenMinutes]:9e5,[me.ThirtyMinutes]:18e5,[me.OneHour]:36e5,[me.FourHours]:144e5,[me.OneDay]:864e5,[me.OneWeek]:6048e5,[me.OneMonth]:2592e6}[e]))(t)/1e3)),l=e[e.length-1]?.time;if("number"!=typeof l||Number.isNaN(l))return e;const o=Array.from({length:a},(e,t)=>({time:l+r*(t+1)}));return[...e,...o]},rt=e=>{const t=lt(e);return t?((e,t)=>new Intl.DateTimeFormat(void 0,{timeZone:"UTC",...t}).format(e))(t,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):""},lt=e=>{if(null==e)return null;if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e){const t=new Date(e);return Number.isNaN(t.getTime())?null:t}return _(e)?new Date(e.year,e.month-1,e.day):null},ot=e=>e?{surfacePrimary:"#191D23",surfacePositive:"#16c784",surfaceNegative:"#ef4444",surfaceElevated:"#323A45",textPrimary:"#F0F1F3",textSecondary:"#B1B9C5",borderPrimary:"#323A45",borderPrimaryInverse:"#D8DCE2",borderAction:"#A259FB",areaTop:"#A259FB4D",areaBottom:"#A259FB0D"}:{surfacePrimary:"white",surfacePositive:"#16c784",surfaceNegative:"#ef4444",surfaceElevated:"#d8dce2",textPrimary:"#0f1115",textSecondary:"#4b5768",borderPrimary:"#d8dce2",borderPrimaryInverse:"#323a45",borderAction:"#A259FB",areaTop:"#A259FB4D",areaBottom:"#A259FB0D"},it=e=>{const t={width:0,height:0};const a=(e=>{const t=ot(e);return{background:{type:R.Solid,color:t.surfacePrimary},textColor:t.textSecondary}})(e),r=(e=>{const t=ot(e);return{vertLines:{color:t.borderPrimary,visible:!0,style:0},horzLines:{color:t.borderPrimary,visible:!0,style:0}}})(e),l=(e=>{const t=ot(e);return{mode:0,vertLine:{color:t.borderPrimaryInverse,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:t.surfaceElevated},horzLine:{color:t.borderPrimaryInverse,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:t.surfacePositive}}})(e),o=(e=>{const t=ot(e);return{rightPriceScale:{borderColor:t.borderPrimary,scaleMargins:{top:.3,bottom:.1},textColor:t.textSecondary},timeScale:{borderColor:t.borderPrimary,timeVisible:!0,rightOffsetPixels:48,allowShiftVisibleRangeOnWhitespaceReplacement:!0,textColor:t.textSecondary}}})(e);return{...t,layout:a,grid:r,crosshair:l,localization:{timeFormatter:e=>rt(e)},...o}},nt=e=>{const t=ot(e);return{upColor:t.surfacePositive,downColor:t.surfaceNegative,borderVisible:!1,wickUpColor:t.surfacePositive,wickDownColor:t.surfaceNegative}},st=["id"],ct={class:"absolute top-2 left-2 z-10 flex gap-x-4 gap-y-1 flex-wrap w-full"},ut={key:0,class:"text-label-lg font-semibold max-w-[calc(100%-1rem)]"},dt={class:"text-[var(--er-text-secondary)] whitespace-nowrap"},mt={key:1,class:"flex flex-wrap gap-x-2 gap-y-0.5 text-label-lg font-semibold max-w-[calc(100%-1rem)]"},ht={class:"text-[var(--er-text-secondary)]"},pt={class:"text-[var(--er-text-secondary)]"},vt={class:"text-[var(--er-text-secondary)]"},gt={class:"text-[var(--er-text-secondary)]"},yt=l({__name:"EaeraChartCanvas",props:{chartData:{default:()=>[]},selectedChartType:{default:ce.Candlestick},selectedTimeFrame:{default:me.OneMinute},dark:{type:Boolean,default:!1},tickSize:{default:null},symbol:{default:""},symbolDescription:{default:""},isMultiChart:{type:Boolean,default:!1},chartDomId:{default:void 0},openLabel:{default:"O"},highLabel:{default:"H"},lowLabel:{default:"L"},closeLabel:{default:"C"}},emits:["loadMoreLeft","resize"],setup(e,{expose:l,emit:u}){const m=e,v=u,g="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10),y=a(()=>m.chartDomId??`eaera-chart-canvas-${g}`),f=x(null),b=x(null),{width:w,height:T}=O(f),L=x(null),S=x(null),M=t(0),F=()=>{M.value+=1},D={openPrice:null,highPrice:null,lowPrice:null,closePrice:null,time:null,state:null,symbolLabel:m.symbol},P=x({...D}),_=a(()=>P.value.state?{color:`var(--er-text-${P.value.state})`}:{}),R=a(()=>m.dark??!1),B=a(()=>{const e=Number(m.tickSize??.01);return!Number.isFinite(e)||e<=0?.01:e}),I=e=>{if(!Number.isFinite(e)||e<=0)return 2;const t=e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20}),a=(t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t).split(".")[1];return a?a.length:0},A=e=>Number.isFinite(e)?Number(e.toFixed(I(B.value))):e,N=a(()=>{const e=new Map;return m.chartData.forEach(t=>{e.set(t.time,t)}),e}),H=a(()=>{const e=at(m.chartData,m.selectedTimeFrame,30);return m.selectedChartType===ce.Line||m.selectedChartType===ce.Area?e.map(e=>"open"in e?{time:e.time,value:e.close}:{time:e.time}):e}),V=a(()=>m.chartData.map(e=>e.time)),K=()=>{P.value={...D,symbolLabel:m.symbol}},W=()=>{S.value&&L.value&&(S.value.applyOptions({priceFormat:{type:"price",precision:I(B.value),minMove:B.value}}),L.value.priceScale("right").applyOptions({ticksVisible:!1,ensureEdgeTickMarksVisible:!0}))},U=()=>{L.value&&S.value&&(L.value.removeSeries(S.value),S.value=null)},Y=e=>{if(L.value){switch(U(),e){case ce.Candlestick:S.value=L.value.addSeries(E,nt(R.value));break;case ce.Line:S.value=L.value.addSeries(z,(t=R.value,{color:ot(t).borderAction,lineWidth:2,lineStyle:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4}));break;case ce.Area:S.value=L.value.addSeries($,(e=>{const t=ot(e);return{lineColor:t.borderAction,topColor:t.areaTop,bottomColor:t.areaBottom,lineWidth:2,lineStyle:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4}})(R.value));break;default:S.value=L.value.addSeries(E,nt(R.value))}var t;W(),F()}},Z=()=>{S.value&&(S.value.setData(H.value),W(),F())};let q=null,G=null;const X=()=>{L.value&&(q&&(L.value.unsubscribeCrosshairMove(q),q=null),G&&(L.value.timeScale().unsubscribeVisibleLogicalRangeChange(G),G=null))},J=()=>{((e,t)=>{L.value&&(L.value.applyOptions({width:e,height:t}),F(),v("resize",e,t))})(Math.max(0,w.value),Math.max(0,T.value))},Q=()=>{b.value&&(L.value=j(b.value,it(R.value)),F(),Y(m.selectedChartType),Z(),L.value&&(X(),q=e=>{const t="number"==typeof e.time?e.time:null;if(null===t)return void K();const a=N.value.get(t);a?P.value={openPrice:A(a.open),highPrice:A(a.high),lowPrice:A(a.low),closePrice:A(a.close),time:t,state:a.close>=a.open?"success":"error",symbolLabel:m.symbol}:K()},G=e=>{e&&e.from<=10&&v("loadMoreLeft")},L.value.subscribeCrosshairMove(q),L.value.timeScale().subscribeVisibleLogicalRangeChange(G)),J())};return r([w,T],J),r(()=>m.selectedChartType,e=>{Y(e),Z()}),r([()=>m.chartData,()=>m.selectedTimeFrame,B],()=>{Z()}),r(R,()=>{L.value&&(L.value.applyOptions(it(R.value)),Y(m.selectedChartType),Z())},{immediate:!0}),r(()=>m.symbol,e=>{P.value.symbolLabel=e}),o(async()=>{await C(),Q()}),i(()=>{X(),U(),L.value&&(L.value.remove(),L.value=null,F()),K()}),l({chartInstance:L,currentSeries:S,chartRenderKey:M,crosshairData:P,chartDataTimes:V,roundPriceByTickSize:A,clearCrosshairData:K,syncSeriesData:Z}),(t,a)=>(n(),s("div",{ref_key:"containerRef",ref:f,class:"relative w-full h-full min-h-0 min-w-0"},[c("div",{id:y.value,ref_key:"chartRef",ref:b,class:"w-full h-full"},null,8,st),c("div",ct,[e.isMultiChart&&e.symbolDescription?(n(),s("div",ut,[c("span",dt,d(e.symbolDescription),1)])):p("",!0),null!==P.value.closePrice?(n(),s("div",mt,[c("div",null,[c("span",ht,d(e.openLabel),1),c("span",{style:k(_.value)},d(P.value.openPrice),5)]),c("div",null,[c("span",pt,d(e.highLabel),1),c("span",{style:k(_.value)},d(P.value.highPrice),5)]),c("div",null,[c("span",vt,d(e.lowLabel),1),c("span",{style:k(_.value)},d(P.value.lowPrice),5)]),c("div",null,[c("span",gt,d(e.closeLabel),1),c("span",{style:k(_.value)},d(P.value.closePrice),5)])])):p("",!0)])],512))}}),ft=l({__name:"EaeraLightweightChartDrawingPlugin",props:{chart:{},series:{},symbol:{},selectedTimeFrame:{},chartDataTimes:{},isDark:{type:Boolean},floatingTarget:{},headerHeight:{},footerHeight:{},config:{}},emits:["stateChange"],setup(e,{emit:t}){const r=e,l=t,o=a(()=>r.selectedTimeFrame),i=a(()=>({position:"absolute",left:"0px",right:"0px",top:`${r.headerHeight}px`,bottom:`${r.footerHeight}px`,height:"auto",zIndex:20})),s=e=>{l("stateChange",e)};return(t,a)=>(n(),b(u(X),{chart:e.chart,series:e.series,symbol:e.symbol,"selected-time-frame":o.value,"chart-data-times":e.chartDataTimes,drawings:e.config.drawings,"is-dark":e.isDark,"create-drawing":e.config.createDrawing,"update-drawing":e.config.updateDrawing,"delete-drawing":e.config.deleteDrawing,"load-drawings":e.config.loadDrawings,"delete-all-drawings":e.config.deleteAllDrawings,"floating-target":e.floatingTarget,"floating-layer-style":i.value,"show-sidebar":e.config.showSidebar??!0,"show-floating-toolbar":e.config.showFloatingToolbar??!0,onStateChange:s},null,8,["chart","series","symbol","selected-time-frame","chart-data-times","drawings","is-dark","create-drawing","update-drawing","delete-drawing","load-drawings","delete-all-drawings","floating-target","floating-layer-style","show-sidebar","show-floating-toolbar"]))}}),bt=l({__name:"EaeraLightweightChartOrderlinePlugin",props:{chart:{},series:{},renderKey:{},isDark:{type:Boolean},config:{}},emits:["stateChange"],setup(e,{expose:a,emit:r}){const l=e,o=r,i=t(null),s=e=>{l.config.onDeleteLine(e)},c=(e,t)=>{l.config.onLinePriceChange(e,t)},d=(e,t)=>{l.config.onLinePricePreview?.(e,t)},m=e=>{l.config.onDragStateChange?.(e)},p=(e,t,a)=>{l.config.onSLTPChange?.(e,t,a)},v=e=>{o("stateChange",e)};return a({openMenu:e=>{i.value?.openMenu?.(e)}}),(t,a)=>(n(),b(u(J),{ref_key:"overlayRef",ref:i,"order-lines":e.config.orderLines,"chart-instance":e.chart,"series-instance":e.series,"order-line-tool":e.config.orderLineTool??null,"render-key":e.renderKey,"market-price":e.config.marketPrice??null,"tick-size":e.config.tickSize??null,dark:e.isDark,onDeleteLine:s,onLinePriceChange:c,onLinePricePreview:d,onDragStateChange:m,onSlTpChange:p,onStateChange:v},null,8,["order-lines","chart-instance","series-instance","order-line-tool","render-key","market-price","tick-size","dark"]))}}),wt=["onClick"],xt=.01,Ct="text-[color:var(--er-text-success)]",kt="text-[color:var(--er-text-danger)]",Tt="border-[color:var(--er-surface-muted)] bg-[color:var(--er-surface-elevated)]",Lt=ee(l({__name:"ChartContextMenu",props:{symbol:{},tickSize:{default:null}},emits:["action"],setup(e,{expose:r,emit:l}){const u=e,w=l,x=t(!1),C=t({x:0,y:0}),M=t(null),F=t("plot"),D=t(null),P=a(()=>({position:"fixed",zIndex:2,top:`${C.value.y}px`,left:`${C.value.x}px`})),O=["fixed","z-[2]","flex","flex-col","min-w-[240px]","py-2","border","rounded-sm","shadow-lg","surface-[var(--er-surface-page)]"],_=["flex","items-center","h-8","px-2","cursor-pointer","select-none","rounded-sm","hover:bg-[var(--er-action-neutral-subtle-hover)]"],R=["px-2","font-[family-name:var(--er-font-brand),system-ui,sans-serif]","text-[14px]","font-normal","leading-5","tracking-[0.018em]","text-[color:var(--er-action-neutral-default)]","whitespace-nowrap"];a(()=>[...O,Tt].join(" "));const E=a(()=>{const e=u.symbol||"GBPUSD",t=null!=M.value?M.value.toFixed(5):"—";return[{label:"Reset chart view",tone:"neutral",action:"reset-view"},..."plot"===F.value?[{label:`Buy Market 0.01 ${e}`,tone:"buy",action:"buy-market"},{label:`Sell Market 0.01 ${e}`,tone:"sell",action:"sell-market"},{label:`Buy Limit 0.01 ${e}`,tone:"buy",action:"buy-limit"},{label:`Sell Limit 0.01 ${e}`,tone:"sell",action:"sell-limit"},{label:`Buy Stop 0.01 ${e}`,tone:"buy",action:"buy-stop"},{label:`Buy Stop Limit 0.01 ${e}`,tone:"buy",action:"buy-stop-limit"},{label:`Sell Stop 0.01 ${e}`,tone:"sell",action:"sell-stop"},{label:`Sell Stop Limit 0.01 ${e}`,tone:"sell",action:"sell-stop-limit"},{label:"Lock vertical cursor line by time",tone:"neutral",action:"lock-cursor"}]:[],{label:`Copy price ${t}`,tone:"neutral",action:"copy-price"},{label:"Paste",tone:"neutral",action:"paste"}]}),$=new Set(["buy-limit","sell-limit","buy-stop","buy-stop-limit","sell-stop","sell-stop-limit"]),z={"buy-limit":{title:"Buy Limit",side:"buy",showStopLimitPrice:!1},"sell-limit":{title:"Sell Limit",side:"sell",showStopLimitPrice:!1},"buy-stop":{title:"Buy Stop",side:"buy",showStopLimitPrice:!1},"buy-stop-limit":{title:"Buy Stop Limit",side:"buy",showStopLimitPrice:!0},"sell-stop":{title:"Sell Stop",side:"sell",showStopLimitPrice:!1},"sell-stop-limit":{title:"Sell Stop Limit",side:"sell",showStopLimitPrice:!0}},j={"buy-market":{side:"buy",orderType:"market"},"sell-market":{side:"sell",orderType:"market"},"buy-limit":{side:"buy",orderType:"buy_limit"},"sell-limit":{side:"sell",orderType:"sell_limit"},"buy-stop":{side:"buy",orderType:"buy_stop"},"buy-stop-limit":{side:"buy",orderType:"buy_stop_limit"},"sell-stop":{side:"sell",orderType:"sell_stop"},"sell-stop-limit":{side:"sell",orderType:"sell_stop_limit"}},B=()=>{x.value=!1,D.value=null},I=()=>{D.value=null,x.value=!1},A=e=>{if(!D.value)return;const t=j[D.value.action];t&&(w("action",D.value.action,{symbol:u.symbol,price:e.price?Number(e.price):M.value,side:t.side,orderType:t.orderType,volume:e.volume?Number(e.volume):xt,stopLimitPrice:e.stopLimitPrice?Number(e.stopLimitPrice):void 0,takeProfit:e.takeProfitEnabled&&e.takeProfit?Number(e.takeProfit):void 0,stopLoss:e.stopLossEnabled&&e.stopLoss?Number(e.stopLoss):void 0,comment:e.comment||void 0}),I())},N=e=>{(x.value||D.value)&&B()},H=e=>{"Escape"===e.key&&(x.value||D.value)&&B()};return o(()=>{document.addEventListener("mousedown",N),document.addEventListener("keydown",H)}),i(()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",H)}),r({open:(e,t,a,r="plot")=>{C.value={x:e,y:t},M.value=a,F.value=r,D.value=null,x.value=!0},close:B}),(t,a)=>(n(),b(T,{to:"body"},[v(L,{name:"context-menu-fade"},{default:g(()=>[D.value?(n(),s("div",{key:0,class:f("fixed z-[2]"),style:k(P.value),onMousedown:a[0]||(a[0]=S(()=>{},["stop"]))},[v(Q,{title:D.value.title,"status-tag-text":D.value.statusTagText,side:D.value.side,symbol:e.symbol,"reference-price":M.value,"tick-size":e.tickSize,"show-stop-limit-price":D.value.showStopLimitPrice,"initial-comment":D.value.initialComment,onConfirm:A,onDiscard:I,onClose:I},null,8,["title","status-tag-text","side","symbol","reference-price","tick-size","show-stop-limit-price","initial-comment"])],36)):x.value?(n(),s("div",{key:1,class:f(O),style:k({top:`${C.value.y}px`,left:`${C.value.x}px`}),onClick:a[1]||(a[1]=S(()=>{},["stop"]))},[(n(!0),s(m,null,y(E.value,(e,t)=>{return n(),s("div",{key:t,class:f((e.tone,[..._].join(" "))),onClick:t=>(e=>{if("buy-market"===e.action||"sell-market"===e.action){const t=j[e.action];return w("action",e.action,{symbol:u.symbol,price:M.value,side:t.side,orderType:t.orderType,volume:xt}),void B()}if($.has(e.action)){const t=z[e.action];return void(D.value={action:e.action,title:t.title,statusTagText:`${t.title} 0.01`,side:t.side,showStopLimitPrice:t.showStopLimitPrice,initialComment:""})}w("action",e.action,{symbol:u.symbol,price:M.value}),B()})(e)},[c("span",{class:f((a=e.tone,"buy"===a?[...R,Ct].join(" "):"sell"===a?[...R,kt].join(" "):R.join(" ")))},d(e.label),3)],10,wt);var a}),128))],4)):p("",!0)]),_:1})]))}}),[["__scopeId","data-v-a1ce2602"]]),St={class:"flex flex-col gap-3 py-2"},Mt={class:"text-body-sm text-[var(--er-text-secondary)]"},Ft=["onClick"],Dt={class:"flex items-center gap-1.5"},Pt={key:0,width:"10",height:"10",viewBox:"0 0 12 12",fill:"none"},Ot={class:"text-label-md font-medium text-[var(--er-text-primary)] truncate"},_t={class:"flex justify-end gap-3"},Rt=l({__name:"SwitchMultiChartDialog",props:{isVisible:{type:Boolean},sourceLayout:{},sourcePanes:{},targetCount:{}},emits:["confirm","cancel"],setup(e,{emit:l}){const o=e,i=l,u=t([]),w={width:"120px",height:"64px"},x=a(()=>{switch(o.sourceLayout){case ue.TwoRows:case ue.ThreeRows:return"grid-cols-1";case ue.TwoCols:return"grid-cols-2";case ue.ThreeCols:return"grid-cols-3";case ue.Four:return"grid-cols-2 grid-rows-2";default:return"grid-cols-1"}}),C=e=>u.value.includes(e),k=()=>{u.value.length===o.targetCount&&i("confirm",[...u.value])},T=()=>{i("cancel")},L=()=>{i("cancel")};return r(()=>o.isVisible,e=>{e&&(u.value=o.sourcePanes.slice(0,o.targetCount).map(e=>e.id))},{immediate:!0}),(t,a)=>{const r=ae,l=te;return n(),b(l,{"dialog-visible":e.isVisible,width:"400px","append-body":"","destroy-on-close":"","close-on-click-modal":!0,"close-on-press-escape":!0,onClose:L},{header:g(()=>[...a[0]||(a[0]=[c("span",{class:"text-title-sm"},"Switch Multi-Chart",-1)])]),default:g(()=>[c("div",St,[c("span",Mt," Select "+d(e.targetCount)+" pane"+d(e.targetCount>1?"s":"")+" to keep* ",1),c("div",{class:f(["grid gap-1 justify-start",x.value])},[(n(!0),s(m,null,y(e.sourcePanes,e=>{return n(),s("div",{key:e.id,class:f(["flex flex-col items-center justify-center rounded-sm border cursor-pointer transition-colors p-2",C(e.id)?"border-[var(--er-border-action)] bg-[var(--er-surface-elevated)]":(t=e.id,!C(t)&&u.value.length>=o.targetCount?"border-[var(--er-border-default)] opacity-40 cursor-not-allowed":"border-[var(--er-border-default)] hover:bg-[var(--er-surface-muted)]")]),style:w,onClick:t=>(e=>{C(e)?u.value=u.value.filter(t=>t!==e):u.value.length>=o.targetCount||(u.value=[...u.value,e])})(e.id)},[c("div",Dt,[c("div",{class:f(["flex items-center justify-center w-4 h-4 rounded-sm border transition-colors shrink-0",C(e.id)?"border-[var(--er-border-action)] bg-[var(--er-border-action)]":"border-[var(--er-border-muted)]"])},[C(e.id)?(n(),s("svg",Pt,[...a[1]||(a[1]=[c("path",{d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):p("",!0)],2),c("span",Ot,d(e.symbol||`Pane ${e.index+1}`),1)])],10,Ft);var t}),128))],2)])]),footer:g(()=>[c("div",_t,[v(r,{color:"contrast",onClick:T},{default:g(()=>[...a[2]||(a[2]=[M("Cancel",-1)])]),_:1}),v(r,{color:"primary",disabled:u.value.length!==e.targetCount,onClick:k},{default:g(()=>[...a[3]||(a[3]=[M(" Confirm ",-1)])]),_:1},8,["disabled"])])]),_:1},8,["dialog-visible"])}}}),Et={key:1,class:"relative w-full flex-1 min-h-0"},$t=["onClick"],zt=l({__name:"index",props:{symbol:{},chartData:{},selectedTimeFrame:{},selectedTimeRange:{},selectedChartType:{},customTimeRange:{},timeFrameOptions:{},timeRangeOptions:{},chartTypeOptions:{},snapshotOptions:{},isLoading:{type:Boolean},isExpanded:{type:Boolean},multiChartLayout:{},dataBarCount:{},tickSize:{},dark:{type:Boolean},chartDomId:{},overlayTitle:{},overlaySubtitle:{},openLabel:{},highLabel:{},lowLabel:{},closeLabel:{},plugins:{},drawingPlugin:{},orderlinePlugin:{}},emits:["resize","changeTimeFrame","changeTimeRange","changeChartType","changeCustomRange","loadMoreLeft","toggleExpanded","changeMultiChartLayout","stateChange","drawingStateChange","orderlineStateChange","contextMenuAction","activeSymbolChange"],setup(r,{expose:l,emit:o}){const i=r,c=o,d=x(null),g=xe(i,c,{snapshotTargetRef:d}),{isLoading:w,symbol:C,overlaySubtitle:k,chartData:T,selectedTimeFrame:L,selectedChartType:M,tickSize:P,dark:O,isMultiChart:_,multiChartLayout:R,chartIds:E,selectedChartId:$}=g,z=x(null),j=t({}),B=x(null),I=x(null),A=x(null),N=x(null),H=a(()=>O.value??!1),V=a(()=>B.value?.$el?.offsetHeight??0),K=a(()=>I.value?.$el?.offsetHeight??0),W=a(()=>E.value.map((e,t)=>({id:e,index:t,symbol:g.getSymbolForChart(e),description:g.getSymbolDescriptionForChart(e),timeFrame:g.getTimeFrameForChart(e)}))),U=a(()=>z.value?.chartInstance??null),Y=a(()=>z.value?.currentSeries??null),Z=a(()=>z.value?.chartRenderKey??0),q=a(()=>z.value?.chartDataTimes??[]),G=a(()=>i.plugins??[]),X=a(()=>i.drawingPlugin??null),J=a(()=>i.orderlinePlugin??null),Q=a(()=>G.value.includes(pe.Drawing)&&!!X.value),ee=a(()=>G.value.includes(pe.Orderline)&&!!J.value),te=a(()=>Q.value&&(X.value?.showSidebar??!0)),ae=e=>{c("drawingStateChange",e)},re=e=>{c("orderlineStateChange",e)},le=e=>{if(_.value)return;const t=z.value;if(!t)return;let a=t.crosshairData?.closePrice??null,r="plot";const l=t.chartInstance,o=t.currentSeries;if(l&&o){const i=l.chartElement().getBoundingClientRect(),n=e.clientY-i.top,s=o.coordinateToPrice(n);null!=s&&(a=t.roundPriceByTickSize?.(s));const c=l.priceScale("right").width(),u=l.priceScale("left").width(),d=e.clientX-i.left;(d<u||d>i.width-c)&&(r="axis")}A.value?.open(e.clientX,e.clientY,a,r)},oe=(e,t)=>{c("contextMenuAction",e,t)},ie=a(()=>["flex flex-1 flex-col min-h-0 min-w-0 h-full overflow-hidden relative rounded-xs bg-[var(--er-surface-page)]",{"rounded-l-none":te.value&&!_.value}]),ne=a(()=>{switch(R.value){case ue.TwoRows:case ue.ThreeRows:return"flex flex-col";case ue.TwoCols:case ue.ThreeCols:return"flex flex-row";case ue.Four:return"grid grid-cols-2 grid-rows-2";default:return"flex flex-row"}}),se=e=>["min-h-0 min-w-0 rounded-sm overflow-hidden ring-1 transition-all cursor-pointer",R.value===ue.Four?"h-full w-full":"flex-1",$.value===e?"ring-[var(--er-border-action)]":"ring-[var(--er-border-default)]"];return l({state:g.state,selectedTimeFrame:g.selectedTimeFrame,selectedTimeRange:g.selectedTimeRange,selectedChartType:g.selectedChartType,customTimeRange:g.customTimeRange,isExpanded:g.isExpanded,isMultiChart:g.isMultiChart,multiChartLayout:g.multiChartLayout,selectedChartId:g.selectedChartId,activeChartLastPrice:g.activeChartLastPrice,chartInstance:U,currentSeries:Y,chartRenderKey:Z,headerHeight:V,footerHeight:K,takeSnapshot:g.onSnapshot,openMenu:e=>{N.value?.openMenu?.(e)}}),(t,a)=>{const r=e;return n(),s("div",{class:"flex h-full w-full min-h-0 min-w-0 gap-1 overflow-hidden",onContextmenu:S(le,["prevent"])},[!u(_)&&Q.value&&X.value?(n(),b(ft,{key:0,chart:U.value,series:Y.value,symbol:u(C),"selected-time-frame":u(L),"chart-data-times":q.value,"is-dark":H.value,"floating-target":d.value,"header-height":V.value,"footer-height":K.value,config:X.value,onStateChange:ae},null,8,["chart","series","symbol","selected-time-frame","chart-data-times","is-dark","floating-target","header-height","footer-height","config"])):p("",!0),F((n(),s("div",{ref_key:"lightweightChartRef",ref:d,class:f(ie.value)},[!u(_)&&ee.value&&J.value?(n(),b(bt,{key:0,ref_key:"orderlinePluginRef",ref:N,chart:U.value,series:Y.value,"render-key":Z.value,"is-dark":H.value,config:J.value,onStateChange:re},null,8,["chart","series","render-key","is-dark","config"])):p("",!0),v(u(Ye),{ref_key:"headerRef",ref:B,context:u(g)},null,8,["context"]),u(_)?(n(),s("div",{key:2,class:f(["w-full flex-1 min-h-0 gap-2 p-1",ne.value])},[(n(!0),s(m,null,y(u(E),e=>(n(),s("div",{key:e,class:f(se(e)),onClick:t=>u(g).onSelectChart(e)},[v(yt,{ref_for:!0,ref:t=>((e,t)=>{j.value[e]=t??null})(e,t),"chart-data":u(g).getChartDataForChart(e),"selected-chart-type":u(g).getChartTypeForChart(e),"selected-time-frame":u(g).getTimeFrameForChart(e),dark:H.value,"tick-size":u(P),symbol:u(g).getSymbolForChart(e),"symbol-description":u(g).getSymbolDescriptionForChart(e),"is-multi-chart":!0,"open-label":i.openLabel,"high-label":i.highLabel,"low-label":i.lowLabel,"close-label":i.closeLabel,onLoadMoreLeft:u(g).onLoadMoreLeft},null,8,["chart-data","selected-chart-type","selected-time-frame","dark","tick-size","symbol","symbol-description","open-label","high-label","low-label","close-label","onLoadMoreLeft"])],10,$t))),128))],2)):(n(),s("div",Et,[v(yt,{ref_key:"primaryCanvasRef",ref:z,"chart-data":u(T),"selected-chart-type":u(M),"selected-time-frame":u(L),dark:H.value,"tick-size":u(P),symbol:u(C),"symbol-description":u(k),"is-multi-chart":!1,"open-label":i.openLabel,"high-label":i.highLabel,"low-label":i.lowLabel,"close-label":i.closeLabel,onLoadMoreLeft:u(g).onLoadMoreLeft,onResize:u(g).onResize},null,8,["chart-data","selected-chart-type","selected-time-frame","dark","tick-size","symbol","symbol-description","open-label","high-label","low-label","close-label","onLoadMoreLeft","onResize"])])),v(u(tt),{ref_key:"footerRef",ref:I,context:u(g)},null,8,["context"]),D(t.$slots,"chart-overlay")],2)),[[r,u(w)]]),u(_)?p("",!0):(n(),b(Lt,{key:1,ref_key:"contextMenuRef",ref:A,symbol:u(C),onAction:oe},null,8,["symbol"])),u(g).pendingLayoutSwitch.value?(n(),b(Rt,{key:2,"is-visible":!!u(g).pendingLayoutSwitch.value,"source-layout":u(R),"source-panes":W.value,"target-count":u(de)(u(g).pendingLayoutSwitch.value),onConfirm:u(g).confirmLayoutSwitch,onCancel:u(g).cancelLayoutSwitch},null,8,["is-visible","source-layout","source-panes","target-count","onConfirm","onCancel"])):p("",!0)],32)}}});export{ue as C,pe as E,me as T,zt as _,ce as a,he as b,de as g,xe as p,Ce as u};
@@ -1 +1 @@
1
- import{ref as e,watch as t,computed as s,provide as a,inject as r,defineComponent as i,shallowRef as o,openBlock as l,createElementBlock as c,createVNode as p,unref as n,createSlots as d,withCtx as m,createElementVNode as u,renderSlot as v,normalizeStyle as k,toDisplayString as y,Fragment as b,renderList as _,normalizeClass as w,createBlock as f,resolveDynamicComponent as z,createCommentVNode as S,useSlots as g,normalizeProps as L,guardReactiveProps as D}from"vue";import{a as E}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as x}from"vue-i18n";import"element-plus";import"element-plus/es";import{Search as C,ArrowDown as O,ArrowUp as P,MoveUp as V}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as N}from"./EaeraInput-CkbcAxy0.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import A from"../composite/EaeraDropdownV2.mjs";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";const M={Bid:"bid",Ask:"ask",Last:"last"},R={Up:"up",Down:"down",Flat:"flat"},B={Up:"Up",Down:"Down",Center:"Center"},F=Symbol("EAERA_MARKET_DEPTH_CONTEXT_KEY"),j=(r,i)=>{const{t:o}=x(),l=e(r.searchValue),c=e(!1);t(()=>r.searchValue,e=>{l.value=e});const p=(e,t)=>{const s=o(e);return"string"==typeof s&&s.trim().length>0?s:t},n=s(()=>({searchValue:l.value,showingDropdown:c.value}));t(n,e=>{i("stateChange",e)},{immediate:!0});const d={searchValue:s({get:()=>l.value,set:e=>{l.value=e,i("update:searchValue",e)}}),searchPlaceholder:s(()=>r.searchPlaceholder??""),searchOptions:s(()=>r.searchOptions??[]),selectedSearchOption:s(()=>r.selectedSearchOption??""),loadingSearchOptions:s(()=>r.loadingSearchOptions??!1),rows:s(()=>r.rows),levels:s(()=>r.levels),lastPrice:s(()=>r.lastPrice),previousPrice:s(()=>r.previousPrice),tickSize:s(()=>r.tickSize),priceDirection:s(()=>r.priceDirection??R.Flat),viewportVsLast:s(()=>r.viewportVsLast??B.Center),shouldRenderEmptyState:s(()=>r.shouldRenderEmptyState??!1),priceLabel:s(()=>r.priceLabel||p("market.depth.table.price","Price")),sizeLabel:s(()=>r.sizeLabel||p("market.depth.table.size","Size")),fetchingSymbolLabel:s(()=>r.fetchingSymbolLabel||p("market.search.fetching-symbol","Fetching symbol")),symbolNotFoundLabel:s(()=>r.symbolNotFoundLabel||p("market.search.symbol-not-found","Symbol not found")),showingDropdown:s({get:()=>c.value,set:e=>{c.value=e}}),state:n,onResize:(e,t)=>i("resize",e,t),onSelectSearchOption:e=>i("select-search-option",e),onWheel:e=>i("wheel",e),onBackCenter:()=>i("back-center")};return a(F,d),d},$=()=>{const e=r(F);if(!e)throw new Error("useEaeraMarketDepth must be used inside EaeraMarketDepth");return e},U={class:"custom-market-depth-search__dropdown-anchor"},T={key:0,class:"custom-market-depth-search__empty body-sm text-placeholder"},W={key:0},I={key:1},K={key:1,class:"custom-market-depth-search__option-list"},Y=["onClick"],q={class:"body-md__w"},G={class:"body-sm"},H=i({__name:"EaeraMarketDepthSearch",setup(a){const{searchValue:r,searchPlaceholder:i,searchOptions:f,selectedSearchOption:z,loadingSearchOptions:S,fetchingSymbolLabel:g,symbolNotFoundLabel:L,showingDropdown:D,onSelectSearchOption:x}=$(),O=o(null),P=e(),{width:V}=E(O),M=s(()=>`${Math.max(V.value,200)}px`),R=e(r.value),B=e(!1);t(r,e=>{R.value=e});const F=e=>{B.value||(r.value=e)},j=()=>{B.value=!0},H=e=>{r.value=e.data},X=e=>{B.value=!1;const t=e.data??R.value;r.value=t},J=e=>{x(e)},Q=e=>{D.value=e};return t(r,e=>{e?P.value?.openDropdown():P.value?.closeDropdown()},{immediate:!0}),(e,t)=>(l(),c("div",{ref_key:"searchRef",ref:O,class:"custom-market-depth-search"},[p(n(N),{modelValue:R.value,"onUpdate:modelValue":t[0]||(t[0]=e=>R.value=e),placeholder:n(i),clearable:"",class:"watchlist-input custom-market-depth-search__input",onInput:F,onCompositionstart:j,onCompositionupdate:H,onCompositionend:X},d({_:2},[n(r)?void 0:{name:"suffix",fn:m(()=>[p(n(C),{size:16,class:"icon-primary"})]),key:"0"}]),1032,["modelValue","placeholder"]),u("div",U,[p(n(A),{ref_key:"dropdownRef",ref:P,trigger:"click",placement:"bottom-start",class:"custom-market-depth-search__dropdown",onVisibleChange:Q},{dropdown:m(()=>[v(e.$slots,"dropdown",{options:n(f),selected:n(z),minWidth:M.value,loading:n(S),fetchingSymbolLabel:n(g),symbolNotFoundLabel:n(L),selectOption:J},()=>[u("div",{class:"custom-market-depth-search__dropdown-panel",style:k({minWidth:M.value})},[n(S)||!n(f).length?(l(),c("div",T,[n(S)?(l(),c("div",W,y(n(g)),1)):(l(),c("div",I,y(n(L)),1))])):(l(),c("div",K,[(l(!0),c(b,null,_(n(f),e=>(l(),c("div",{key:e.value,class:w(["custom-market-depth-search__option",e.value===n(z)&&"is-selected"]),onClick:t=>J(e.value)},[u("div",q,y(e.label),1),u("div",G,y(e.description),1)],10,Y))),128))]))],4)])]),default:m(()=>[t[1]||(t[1]=u("div",{class:"custom-market-depth-search__dropdown-trigger"},null,-1))]),_:3},512)])],512))}}),X={class:"custom-market-depth-table"},J={class:"custom-market-depth-table__header text-primary"},Q={class:"custom-market-depth-table__header-price label-lg"},Z={class:"custom-market-depth-table__header-size label-lg"},ee=i({__name:"EaeraMarketDepthTable",setup(e){const{rows:t,levels:a,lastPrice:r,tickSize:i,priceDirection:o,viewportVsLast:p,shouldRenderEmptyState:d,priceLabel:m,sizeLabel:v,onWheel:k,onBackCenter:w}=$(),g={[B.Up]:P,[B.Down]:O},L=e=>{if(null==e)return null;const t=(e=>{if("number"!=typeof e||!Number.isFinite(e)||e<=0)return 2;const t=e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20}),s=(t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t).split(".")[1];return s?s.length:0})(i.value);return Number(e).toFixed(t)},D=(e,t,s)=>({key:`${t}-${e.price}${s?.keySuffix?`-${s.keySuffix}`:""}`,price:L(e.price),size:t===M.Last?null:s?.sizeOverride??(t===M.Ask?e.askSize:e.bidSize),type:t,isEmpty:!1}),E=s(()=>g[p.value]),x=s(()=>{const e=Math.max(a.value,0);if(!e)return[];if(d.value)return Array.from({length:e},(e,t)=>({key:`empty-${t}`,price:null,size:null,type:null,isEmpty:!0}));const s=[...t.value].reverse().flatMap(e=>{const t=(e=>e.price>r.value?M.Ask:e.price<r.value?M.Bid:M.Last)(e),s=Math.abs(e.price-r.value)<1e-10;if(t!==M.Last||!s)return[D(e,t)];const a=D(e,M.Last),i=o.value!==R.Down,l=D(e,i?M.Bid:M.Ask,{keySuffix:"synthetic-last",sizeOverride:e.bidSize+e.askSize});return i?[a,l]:[l,a]});return s.length<=e?s:o.value===R.Down?s.slice(s.length-e):s.slice(0,e)}),C=s(()=>Math.max(...x.value.filter(e=>!e.isEmpty&&e.type!==M.Last).map(e=>e.size??0),1));return(e,t)=>(l(),c("div",X,[u("div",J,[u("div",Q,y(n(m)),1),u("div",Z,y(n(v)),1)]),u("div",{class:"custom-market-depth-table__rows",onWheel:t[0]||(t[0]=e=>n(k)(e.deltaY))},[(l(!0),c(b,null,_(x.value,(e,t)=>(l(),f(n(le),{key:e.key,price:e.price,type:e.type,size:e.size,"max-size":C.value,empty:e.isEmpty,"first-child":!t},null,8,["price","type","size","max-size","empty","first-child"]))),128))],32),n(d)||n(p)===n(B).Center?S("",!0):(l(),c("div",{key:0,class:"custom-market-depth-table__back-center",onClick:t[1]||(t[1]=(...e)=>n(w)&&n(w)(...e))},[(l(),f(z(E.value),{size:16,class:"icon-secondary"}))]))]))}}),te={key:0},se={key:1},ae={class:"custom-market-depth-price-row__size text-primary"},re={key:2},ie={class:"custom-market-depth-price-row__last-price"},oe={class:"custom-market-depth-price-row__last-icon"},le=i({__name:"EaeraMarketDepthPriceRow",props:{type:{},price:{},size:{},maxSize:{},firstChild:{type:Boolean},empty:{type:Boolean}},setup(e){const{lastPrice:t,previousPrice:a}=$(),r=e,i=s(()=>{const e=r.size??0,t=r.maxSize||1;return 100*Math.min(e/t,1)+"%"}),o=s(()=>t.value>a.value?{className:"is-increase",icon:"ArrowNarrowUp"}:t.value<a.value?{className:"is-decrease",icon:"ArrowNarrowDown"}:void 0);return(e,t)=>(l(),c("div",null,[r.empty?(l(),c("div",te,[u("div",{class:w(["custom-market-depth-price-row custom-market-depth-price-row--empty body-sm",r.firstChild&&"is-first-child"])},[...t[0]||(t[0]=[u("div",{class:"custom-market-depth-price-row__price"}," ",-1),u("div",{class:"custom-market-depth-price-row__size text-primary"}," ",-1)])],2)])):r.type===n(M).Ask||r.type===n(M).Bid?(l(),c("div",se,[u("div",{class:w(["custom-market-depth-price-row custom-market-depth-price-row--quantity body-sm",r.type===n(M).Ask?"custom-market-depth-price-row--ask":"custom-market-depth-price-row--bid",r.firstChild&&"is-first-child"]),style:k({"--size-percent":i.value})},[u("div",{class:w(["custom-market-depth-price-row__price",r.type===n(M).Ask?"is-ask":"is-bid"])},y(r.price),3),u("div",ae,y(r.size),1)],6)])):(l(),c("div",re,[u("div",{class:w(["custom-market-depth-price-row custom-market-depth-price-row--last-price body-lg__w",r.firstChild&&"is-first-child",o.value?.className])},[u("div",ie,[u("span",null,y(r.price),1)]),u("div",oe,[o.value?(l(),f(n(V),{key:0,size:16})):S("",!0)])],2)]))]))}}),ce={class:"custom-market-depth"},pe={class:"custom-market-depth__table"},ne=i({__name:"index",props:{searchValue:{},searchPlaceholder:{},searchOptions:{},selectedSearchOption:{},loadingSearchOptions:{type:Boolean},rows:{},levels:{},lastPrice:{},previousPrice:{},tickSize:{},priceDirection:{},viewportVsLast:{},shouldRenderEmptyState:{type:Boolean},priceLabel:{},sizeLabel:{},fetchingSymbolLabel:{},symbolNotFoundLabel:{}},emits:["resize","update:searchValue","select-search-option","wheel","back-center","stateChange"],setup(e,{expose:s,emit:a}){const r=g(),i=o(null),{width:k,height:y}=E(i),b=j(e,a);return s({state:b.state}),t([k,y],()=>{i.value&&b.onResize(k.value,y.value)}),(e,t)=>(l(),c("div",ce,[u("div",{ref_key:"searchRef",ref:i,class:"custom-market-depth__search"},[p(n(H),null,d({_:2},[n(r)["search-dropdown"]?{name:"dropdown",fn:m(t=>[v(e.$slots,"search-dropdown",L(D(t)))]),key:"0"}:void 0]),1024)],512),u("div",pe,[p(n(ee))])]))}});export{R as E,ne as _,M as a,B as b,j as p,$ as u};
1
+ import{ref as e,watch as t,computed as s,provide as a,inject as r,defineComponent as i,shallowRef as o,openBlock as l,createElementBlock as c,createVNode as p,unref as n,createSlots as d,withCtx as m,createElementVNode as u,renderSlot as v,normalizeStyle as k,toDisplayString as y,Fragment as b,renderList as _,normalizeClass as w,createBlock as f,resolveDynamicComponent as z,createCommentVNode as S,useSlots as g,normalizeProps as L,guardReactiveProps as D}from"vue";import{a as E}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as x}from"vue-i18n";import{Search as C,ArrowDown as O,ArrowUp as P,MoveUp as V}from"@lucide/vue";import"element-plus";import"element-plus/es";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as N}from"./EaeraInput-CkbcAxy0.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import A from"../composite/EaeraDropdownV2.mjs";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";const M={Bid:"bid",Ask:"ask",Last:"last"},R={Up:"up",Down:"down",Flat:"flat"},B={Up:"Up",Down:"Down",Center:"Center"},F=Symbol("EAERA_MARKET_DEPTH_CONTEXT_KEY"),j=(r,i)=>{const{t:o}=x(),l=e(r.searchValue),c=e(!1);t(()=>r.searchValue,e=>{l.value=e});const p=(e,t)=>{const s=o(e);return"string"==typeof s&&s.trim().length>0?s:t},n=s(()=>({searchValue:l.value,showingDropdown:c.value}));t(n,e=>{i("stateChange",e)},{immediate:!0});const d={searchValue:s({get:()=>l.value,set:e=>{l.value=e,i("update:searchValue",e)}}),searchPlaceholder:s(()=>r.searchPlaceholder??""),searchOptions:s(()=>r.searchOptions??[]),selectedSearchOption:s(()=>r.selectedSearchOption??""),loadingSearchOptions:s(()=>r.loadingSearchOptions??!1),rows:s(()=>r.rows),levels:s(()=>r.levels),lastPrice:s(()=>r.lastPrice),previousPrice:s(()=>r.previousPrice),tickSize:s(()=>r.tickSize),priceDirection:s(()=>r.priceDirection??R.Flat),viewportVsLast:s(()=>r.viewportVsLast??B.Center),shouldRenderEmptyState:s(()=>r.shouldRenderEmptyState??!1),priceLabel:s(()=>r.priceLabel||p("market.depth.table.price","Price")),sizeLabel:s(()=>r.sizeLabel||p("market.depth.table.size","Size")),fetchingSymbolLabel:s(()=>r.fetchingSymbolLabel||p("market.search.fetching-symbol","Fetching symbol")),symbolNotFoundLabel:s(()=>r.symbolNotFoundLabel||p("market.search.symbol-not-found","Symbol not found")),showingDropdown:s({get:()=>c.value,set:e=>{c.value=e}}),state:n,onResize:(e,t)=>i("resize",e,t),onSelectSearchOption:e=>i("select-search-option",e),onWheel:e=>i("wheel",e),onBackCenter:()=>i("back-center")};return a(F,d),d},$=()=>{const e=r(F);if(!e)throw new Error("useEaeraMarketDepth must be used inside EaeraMarketDepth");return e},U={class:"custom-market-depth-search__dropdown-anchor"},T={key:0,class:"custom-market-depth-search__empty body-sm text-placeholder"},W={key:0},I={key:1},K={key:1,class:"custom-market-depth-search__option-list"},Y=["onClick"],q={class:"body-md__w"},G={class:"body-sm"},H=i({__name:"EaeraMarketDepthSearch",setup(a){const{searchValue:r,searchPlaceholder:i,searchOptions:f,selectedSearchOption:z,loadingSearchOptions:S,fetchingSymbolLabel:g,symbolNotFoundLabel:L,showingDropdown:D,onSelectSearchOption:x}=$(),O=o(null),P=e(),{width:V}=E(O),M=s(()=>`${Math.max(V.value,200)}px`),R=e(r.value),B=e(!1);t(r,e=>{R.value=e});const F=e=>{B.value||(r.value=e)},j=()=>{B.value=!0},H=e=>{r.value=e.data},X=e=>{B.value=!1;const t=e.data??R.value;r.value=t},J=e=>{x(e)},Q=e=>{D.value=e};return t(r,e=>{e?P.value?.openDropdown():P.value?.closeDropdown()},{immediate:!0}),(e,t)=>(l(),c("div",{ref_key:"searchRef",ref:O,class:"custom-market-depth-search"},[p(n(N),{modelValue:R.value,"onUpdate:modelValue":t[0]||(t[0]=e=>R.value=e),placeholder:n(i),clearable:"",class:"watchlist-input custom-market-depth-search__input",onInput:F,onCompositionstart:j,onCompositionupdate:H,onCompositionend:X},d({_:2},[n(r)?void 0:{name:"suffix",fn:m(()=>[p(n(C),{size:16,class:"icon-primary"})]),key:"0"}]),1032,["modelValue","placeholder"]),u("div",U,[p(n(A),{ref_key:"dropdownRef",ref:P,trigger:"click",placement:"bottom-start",class:"custom-market-depth-search__dropdown",onVisibleChange:Q},{dropdown:m(()=>[v(e.$slots,"dropdown",{options:n(f),selected:n(z),minWidth:M.value,loading:n(S),fetchingSymbolLabel:n(g),symbolNotFoundLabel:n(L),selectOption:J},()=>[u("div",{class:"custom-market-depth-search__dropdown-panel",style:k({minWidth:M.value})},[n(S)||!n(f).length?(l(),c("div",T,[n(S)?(l(),c("div",W,y(n(g)),1)):(l(),c("div",I,y(n(L)),1))])):(l(),c("div",K,[(l(!0),c(b,null,_(n(f),e=>(l(),c("div",{key:e.value,class:w(["custom-market-depth-search__option",e.value===n(z)&&"is-selected"]),onClick:t=>J(e.value)},[u("div",q,y(e.label),1),u("div",G,y(e.description),1)],10,Y))),128))]))],4)])]),default:m(()=>[t[1]||(t[1]=u("div",{class:"custom-market-depth-search__dropdown-trigger"},null,-1))]),_:3},512)])],512))}}),X={class:"custom-market-depth-table"},J={class:"custom-market-depth-table__header text-primary"},Q={class:"custom-market-depth-table__header-price label-lg"},Z={class:"custom-market-depth-table__header-size label-lg"},ee=i({__name:"EaeraMarketDepthTable",setup(e){const{rows:t,levels:a,lastPrice:r,tickSize:i,priceDirection:o,viewportVsLast:p,shouldRenderEmptyState:d,priceLabel:m,sizeLabel:v,onWheel:k,onBackCenter:w}=$(),g={[B.Up]:P,[B.Down]:O},L=e=>{if(null==e)return null;const t=(e=>{if("number"!=typeof e||!Number.isFinite(e)||e<=0)return 2;const t=e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20}),s=(t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t).split(".")[1];return s?s.length:0})(i.value);return Number(e).toFixed(t)},D=(e,t,s)=>({key:`${t}-${e.price}${s?.keySuffix?`-${s.keySuffix}`:""}`,price:L(e.price),size:t===M.Last?null:s?.sizeOverride??(t===M.Ask?e.askSize:e.bidSize),type:t,isEmpty:!1}),E=s(()=>g[p.value]),x=s(()=>{const e=Math.max(a.value,0);if(!e)return[];if(d.value)return Array.from({length:e},(e,t)=>({key:`empty-${t}`,price:null,size:null,type:null,isEmpty:!0}));const s=[...t.value].reverse().flatMap(e=>{const t=(e=>e.price>r.value?M.Ask:e.price<r.value?M.Bid:M.Last)(e),s=Math.abs(e.price-r.value)<1e-10;if(t!==M.Last||!s)return[D(e,t)];const a=D(e,M.Last),i=o.value!==R.Down,l=D(e,i?M.Bid:M.Ask,{keySuffix:"synthetic-last",sizeOverride:e.bidSize+e.askSize});return i?[a,l]:[l,a]});return s.length<=e?s:o.value===R.Down?s.slice(s.length-e):s.slice(0,e)}),C=s(()=>Math.max(...x.value.filter(e=>!e.isEmpty&&e.type!==M.Last).map(e=>e.size??0),1));return(e,t)=>(l(),c("div",X,[u("div",J,[u("div",Q,y(n(m)),1),u("div",Z,y(n(v)),1)]),u("div",{class:"custom-market-depth-table__rows",onWheel:t[0]||(t[0]=e=>n(k)(e.deltaY))},[(l(!0),c(b,null,_(x.value,(e,t)=>(l(),f(n(le),{key:e.key,price:e.price,type:e.type,size:e.size,"max-size":C.value,empty:e.isEmpty,"first-child":!t},null,8,["price","type","size","max-size","empty","first-child"]))),128))],32),n(d)||n(p)===n(B).Center?S("",!0):(l(),c("div",{key:0,class:"custom-market-depth-table__back-center",onClick:t[1]||(t[1]=(...e)=>n(w)&&n(w)(...e))},[(l(),f(z(E.value),{size:16,class:"icon-secondary"}))]))]))}}),te={key:0},se={key:1},ae={class:"custom-market-depth-price-row__size text-primary"},re={key:2},ie={class:"custom-market-depth-price-row__last-price"},oe={class:"custom-market-depth-price-row__last-icon"},le=i({__name:"EaeraMarketDepthPriceRow",props:{type:{},price:{},size:{},maxSize:{},firstChild:{type:Boolean},empty:{type:Boolean}},setup(e){const{lastPrice:t,previousPrice:a}=$(),r=e,i=s(()=>{const e=r.size??0,t=r.maxSize||1;return 100*Math.min(e/t,1)+"%"}),o=s(()=>t.value>a.value?{className:"is-increase",icon:"ArrowNarrowUp"}:t.value<a.value?{className:"is-decrease",icon:"ArrowNarrowDown"}:void 0);return(e,t)=>(l(),c("div",null,[r.empty?(l(),c("div",te,[u("div",{class:w(["custom-market-depth-price-row custom-market-depth-price-row--empty body-sm",r.firstChild&&"is-first-child"])},[...t[0]||(t[0]=[u("div",{class:"custom-market-depth-price-row__price"}," ",-1),u("div",{class:"custom-market-depth-price-row__size text-primary"}," ",-1)])],2)])):r.type===n(M).Ask||r.type===n(M).Bid?(l(),c("div",se,[u("div",{class:w(["custom-market-depth-price-row custom-market-depth-price-row--quantity body-sm",r.type===n(M).Ask?"custom-market-depth-price-row--ask":"custom-market-depth-price-row--bid",r.firstChild&&"is-first-child"]),style:k({"--size-percent":i.value})},[u("div",{class:w(["custom-market-depth-price-row__price",r.type===n(M).Ask?"is-ask":"is-bid"])},y(r.price),3),u("div",ae,y(r.size),1)],6)])):(l(),c("div",re,[u("div",{class:w(["custom-market-depth-price-row custom-market-depth-price-row--last-price body-lg__w",r.firstChild&&"is-first-child",o.value?.className])},[u("div",ie,[u("span",null,y(r.price),1)]),u("div",oe,[o.value?(l(),f(n(V),{key:0,size:16})):S("",!0)])],2)]))]))}}),ce={class:"custom-market-depth"},pe={class:"custom-market-depth__table"},ne=i({__name:"index",props:{searchValue:{},searchPlaceholder:{},searchOptions:{},selectedSearchOption:{},loadingSearchOptions:{type:Boolean},rows:{},levels:{},lastPrice:{},previousPrice:{},tickSize:{},priceDirection:{},viewportVsLast:{},shouldRenderEmptyState:{type:Boolean},priceLabel:{},sizeLabel:{},fetchingSymbolLabel:{},symbolNotFoundLabel:{}},emits:["resize","update:searchValue","select-search-option","wheel","back-center","stateChange"],setup(e,{expose:s,emit:a}){const r=g(),i=o(null),{width:k,height:y}=E(i),b=j(e,a);return s({state:b.state}),t([k,y],()=>{i.value&&b.onResize(k.value,y.value)}),(e,t)=>(l(),c("div",ce,[u("div",{ref_key:"searchRef",ref:i,class:"custom-market-depth__search"},[p(n(H),null,d({_:2},[n(r)["search-dropdown"]?{name:"dropdown",fn:m(t=>[v(e.$slots,"search-dropdown",L(D(t)))]),key:"0"}:void 0]),1024)],512),u("div",pe,[p(n(ee))])]))}});export{R as E,ne as _,M as a,B as b,j as p,$ as u};
@@ -1 +1 @@
1
- import{ref as e,watch as a,computed as l,provide as s,inject as t,defineComponent as o,shallowRef as i,openBlock as n,createElementBlock as r,createElementVNode as m,createVNode as c,unref as d,createSlots as u,withCtx as p,renderSlot as v,normalizeStyle as b,toDisplayString as _,Fragment as y,renderList as g,normalizeClass as f,createBlock as S,resolveDynamicComponent as w,onMounted as z,nextTick as k,onBeforeUnmount as T,useSlots as L,normalizeProps as N,guardReactiveProps as E}from"vue";import{a as C}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as V}from"vue-i18n";import"element-plus";import"element-plus/es";import{ChevronUp as x,ChevronDown as O,Search as j}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as F}from"./EaeraInput-CkbcAxy0.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import P from"../composite/EaeraDropdownV2.mjs";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as H}from"./EaeraTableV2-CIeL4xlB.mjs";const M=Symbol("EAERA_TIME_N_SALES_CONTEXT_KEY"),$=(t,o)=>{const{t:i}=V(),n=e(t.searchValue),r=e(t.minTradeSize),m=e(!1);a(()=>t.searchValue,e=>{n.value=e}),a(()=>t.minTradeSize,e=>{r.value=e});const c=(e,a)=>{const l=i(e);return"string"==typeof l&&l.trim().length>0?l:a},d=l(()=>[{key:"date",label:c("time-and-sales.table.date","Date"),minWidth:50},{key:"time",label:c("time-and-sales.table.time","Time"),minWidth:60},{key:"price",label:c("time-and-sales.table.price","Price"),minWidth:70,align:"right"},{key:"size",label:c("time-and-sales.table.size","Size"),minWidth:50,align:"right"}].map(e=>({...e,cellClass:"fs-10",cell:{dataClass:"text-primary"}}))),u=l(()=>({searchValue:n.value,minTradeSize:r.value,showingDropdown:m.value}));a(u,e=>{o("stateChange",e)},{immediate:!0});const p={searchValue:l({get:()=>n.value,set:e=>{n.value=e,o("update:searchValue",e)}}),searchPlaceholder:l(()=>t.searchPlaceholder??""),searchOptions:l(()=>t.searchOptions??[]),selectedSearchOption:l(()=>t.selectedSearchOption??""),loadingSearchOptions:l(()=>t.loadingSearchOptions??!1),minTradeSize:l({get:()=>r.value,set:e=>{r.value=e,o("update:minTradeSize",e)}}),minTradeSizePlaceholder:l(()=>t.minTradeSizePlaceholder||c("time-and-sales.table.size","Size")),rows:l(()=>t.rows??[]),fields:l(()=>t.fields&&t.fields.length>0?t.fields:d.value),tableHeight:l(()=>Number(t.tableHeight)||0),tableMaxHeight:l(()=>`${Math.max((Number(t.tableHeight)||0)-16,0)}px`),loading:l(()=>t.loading??!1),fetchingSymbolLabel:l(()=>t.fetchingSymbolLabel||c("market.search.fetching-symbol","Fetching symbol")),symbolNotFoundLabel:l(()=>t.symbolNotFoundLabel||c("market.search.symbol-not-found","Symbol not found")),emptyLabel:l(()=>t.emptyLabel||c("time-and-sales.table.empty","No data")),showingDropdown:l({get:()=>m.value,set:e=>{m.value=e}}),state:u,onResize:(e,a)=>o("resize",e,a),onSelectSearchOption:e=>o("select-search-option",e),onLoadMore:()=>o("load-more")};return s(M,p),p},D=()=>{const e=t(M);if(!e)throw new Error("useEaeraTimeNSales must be used inside EaeraTimeNSales");return e},R={class:"custom-time-n-sales-search__row"},W={class:"custom-time-n-sales-search__symbol-field"},A={class:"custom-time-n-sales-search__dropdown-anchor"},I={key:0,class:"custom-time-n-sales-search__empty body-sm text-placeholder"},B={key:0},q={key:1},U={key:1,class:"custom-time-n-sales-search__option-list"},K=["onClick"],X={class:"body-md__w"},Y={class:"body-sm"},G={class:"custom-time-n-sales-search__size-field"},J={class:"custom-time-n-sales-search__size-icons"},Q=o({__name:"EaeraTimeNSalesSearch",setup(s){const{searchValue:t,searchPlaceholder:o,searchOptions:z,selectedSearchOption:k,loadingSearchOptions:T,minTradeSize:L,minTradeSizePlaceholder:N,fetchingSymbolLabel:E,symbolNotFoundLabel:V,showingDropdown:H,onSelectSearchOption:M}=D(),$=i(null),Q=e(),{width:Z}=C($),ee=l(()=>`${Math.max(Z.value,200)}px`),ae=e(t.value),le=e(!1),se=l({get:()=>L.value,set:e=>{L.value=e}});a(t,e=>{ae.value=e});const te=e=>{le.value||(t.value=e)},oe=()=>{le.value=!0},ie=e=>{t.value=e.data},ne=e=>{le.value=!1;const a=e.data??ae.value;t.value=a},re=e=>{M(e)},me=e=>{H.value=e},ce=()=>{L.value=(e=>{const a=Number(e);return!Number.isFinite(a)||a<1?"":`${a}`})(L.value)},de=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${a+1}`},ue=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${Math.max(1,a-1)}`},he=l(()=>[{value:"up",icon:x,onClick:de},{value:"down",icon:O,onClick:ue}]);return a(t,e=>{e?Q.value?.openDropdown():Q.value?.closeDropdown()},{immediate:!0}),(e,a)=>(n(),r("div",{ref_key:"searchRef",ref:$,class:"custom-time-n-sales-search"},[m("div",R,[m("div",W,[c(d(F),{modelValue:ae.value,"onUpdate:modelValue":a[0]||(a[0]=e=>ae.value=e),placeholder:d(o),clearable:"",class:"watchlist-input custom-time-n-sales-search__symbol-input",onInput:te,onCompositionstart:oe,onCompositionupdate:ie,onCompositionend:ne},u({_:2},[d(t)?void 0:{name:"suffix",fn:p(()=>[c(d(j),{size:16,class:"icon-primary"})]),key:"0"}]),1032,["modelValue","placeholder"]),m("div",A,[c(d(P),{ref_key:"dropdownRef",ref:Q,trigger:"click",placement:"bottom-start",class:"custom-time-n-sales-search__dropdown",onVisibleChange:me},{dropdown:p(()=>[v(e.$slots,"dropdown",{options:d(z),selected:d(k),minWidth:ee.value,loading:d(T),fetchingSymbolLabel:d(E),symbolNotFoundLabel:d(V),selectOption:re},()=>[m("div",{class:"custom-time-n-sales-search__dropdown-panel",style:b({minWidth:ee.value})},[d(T)||!d(z).length?(n(),r("div",I,[d(T)?(n(),r("div",B,_(d(E)),1)):(n(),r("div",q,_(d(V)),1))])):(n(),r("div",U,[(n(!0),r(y,null,g(d(z),e=>(n(),r("div",{key:e.value,class:f(["custom-time-n-sales-search__option",e.value===d(k)&&"is-selected"]),onClick:a=>re(e.value)},[m("div",X,_(e.label),1),m("div",Y,_(e.description),1)],10,K))),128))]))],4)])]),default:p(()=>[a[2]||(a[2]=m("div",{class:"custom-time-n-sales-search__dropdown-trigger"},null,-1))]),_:3},512)])]),m("div",G,[c(d(F),{modelValue:se.value,"onUpdate:modelValue":a[1]||(a[1]=e=>se.value=e),class:"watchlist-input custom-time-n-sales-search__size-input",placeholder:d(N),onChange:ce,onInput:ce},{suffix:p(()=>[m("div",J,[(n(!0),r(y,null,g(he.value,e=>(n(),S(w(e.icon),{key:e.value,size:12,class:"icon-primary custom-time-n-sales-search__size-icon",onClick:e.onClick},null,8,["onClick"]))),128))])]),_:1},8,["modelValue","placeholder"])])])],512))}}),Z={class:"custom-time-n-sales-table"},ee=o({__name:"EaeraTimeNSalesTable",setup(a){const{rows:l,fields:s,tableMaxHeight:t,loading:o,emptyLabel:u,onLoadMore:v}=D(),b=e(),y=i(null),g=()=>{const e=y.value;e&&((e,a=50)=>{const{scrollTop:l,clientHeight:s,scrollHeight:t}=e;return l+s>=t-a})(e)&&v()},f=()=>{g()};let S=null;const w=()=>{null==S&&(S=requestAnimationFrame(()=>{S=null,g()}))};return z(async()=>{await k(),(()=>{const e=b.value?.$el;if(!e)return;const a=e.querySelector(".el-scrollbar__wrap");a&&(y.value=a,a.addEventListener("scroll",f,{passive:!0}),a.addEventListener("wheel",w,{passive:!0}))})()}),T(()=>{(()=>{const e=y.value;e&&(e.removeEventListener("scroll",f),e.removeEventListener("wheel",w),y.value=null)})(),null!=S&&(cancelAnimationFrame(S),S=null)}),(e,a)=>(n(),r("div",Z,[c(d(H),{ref_key:"tableRef",ref:b,class:"watchlist-table custom-time-n-sales-table__table",items:d(l),fields:d(s),"max-height":d(t),stripe:!1,"hide-footer":"",loading:d(o)},{empty:p(()=>[m("div",null,_(d(u)),1)]),_:1},8,["items","fields","max-height","loading"])]))}}),ae={class:"custom-time-n-sales"},le={class:"custom-time-n-sales__table"},se=o({__name:"index",props:{searchValue:{},searchPlaceholder:{},searchOptions:{},selectedSearchOption:{},loadingSearchOptions:{type:Boolean},minTradeSize:{},minTradeSizePlaceholder:{},rows:{},fields:{},tableHeight:{},loading:{type:Boolean},fetchingSymbolLabel:{},symbolNotFoundLabel:{},emptyLabel:{}},emits:["resize","update:searchValue","select-search-option","update:minTradeSize","load-more","stateChange"],setup(e,{expose:l,emit:s}){const t=L(),o=i(null),{width:b,height:_}=C(o),y=$(e,s);return l({state:y.state}),a([b,_],()=>{o.value&&y.onResize(b.value,_.value)}),(e,a)=>(n(),r("div",ae,[m("div",{ref_key:"searchRef",ref:o,class:"custom-time-n-sales__search"},[c(d(Q),null,u({_:2},[d(t)["search-dropdown"]?{name:"dropdown",fn:p(a=>[v(e.$slots,"search-dropdown",N(E(a)))]),key:"0"}:void 0]),1024)],512),m("div",le,[c(d(ee))])]))}});export{se as _,$ as p,D as u};
1
+ import{ref as e,watch as a,computed as l,provide as s,inject as t,defineComponent as o,shallowRef as i,openBlock as n,createElementBlock as r,createElementVNode as m,createVNode as c,unref as d,createSlots as u,withCtx as p,renderSlot as v,normalizeStyle as b,toDisplayString as _,Fragment as y,renderList as g,normalizeClass as f,createBlock as S,resolveDynamicComponent as w,onMounted as z,nextTick as k,onBeforeUnmount as T,useSlots as L,normalizeProps as N,guardReactiveProps as E}from"vue";import{a as C}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as V}from"vue-i18n";import{ChevronUp as x,ChevronDown as O,Search as j}from"@lucide/vue";import"element-plus";import"element-plus/es";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as F}from"./EaeraInput-CkbcAxy0.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import P from"../composite/EaeraDropdownV2.mjs";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as H}from"./EaeraTableV2-CIeL4xlB.mjs";const M=Symbol("EAERA_TIME_N_SALES_CONTEXT_KEY"),$=(t,o)=>{const{t:i}=V(),n=e(t.searchValue),r=e(t.minTradeSize),m=e(!1);a(()=>t.searchValue,e=>{n.value=e}),a(()=>t.minTradeSize,e=>{r.value=e});const c=(e,a)=>{const l=i(e);return"string"==typeof l&&l.trim().length>0?l:a},d=l(()=>[{key:"date",label:c("time-and-sales.table.date","Date"),minWidth:50},{key:"time",label:c("time-and-sales.table.time","Time"),minWidth:60},{key:"price",label:c("time-and-sales.table.price","Price"),minWidth:70,align:"right"},{key:"size",label:c("time-and-sales.table.size","Size"),minWidth:50,align:"right"}].map(e=>({...e,cellClass:"fs-10",cell:{dataClass:"text-primary"}}))),u=l(()=>({searchValue:n.value,minTradeSize:r.value,showingDropdown:m.value}));a(u,e=>{o("stateChange",e)},{immediate:!0});const p={searchValue:l({get:()=>n.value,set:e=>{n.value=e,o("update:searchValue",e)}}),searchPlaceholder:l(()=>t.searchPlaceholder??""),searchOptions:l(()=>t.searchOptions??[]),selectedSearchOption:l(()=>t.selectedSearchOption??""),loadingSearchOptions:l(()=>t.loadingSearchOptions??!1),minTradeSize:l({get:()=>r.value,set:e=>{r.value=e,o("update:minTradeSize",e)}}),minTradeSizePlaceholder:l(()=>t.minTradeSizePlaceholder||c("time-and-sales.table.size","Size")),rows:l(()=>t.rows??[]),fields:l(()=>t.fields&&t.fields.length>0?t.fields:d.value),tableHeight:l(()=>Number(t.tableHeight)||0),tableMaxHeight:l(()=>`${Math.max((Number(t.tableHeight)||0)-16,0)}px`),loading:l(()=>t.loading??!1),fetchingSymbolLabel:l(()=>t.fetchingSymbolLabel||c("market.search.fetching-symbol","Fetching symbol")),symbolNotFoundLabel:l(()=>t.symbolNotFoundLabel||c("market.search.symbol-not-found","Symbol not found")),emptyLabel:l(()=>t.emptyLabel||c("time-and-sales.table.empty","No data")),showingDropdown:l({get:()=>m.value,set:e=>{m.value=e}}),state:u,onResize:(e,a)=>o("resize",e,a),onSelectSearchOption:e=>o("select-search-option",e),onLoadMore:()=>o("load-more")};return s(M,p),p},D=()=>{const e=t(M);if(!e)throw new Error("useEaeraTimeNSales must be used inside EaeraTimeNSales");return e},R={class:"custom-time-n-sales-search__row"},W={class:"custom-time-n-sales-search__symbol-field"},A={class:"custom-time-n-sales-search__dropdown-anchor"},I={key:0,class:"custom-time-n-sales-search__empty body-sm text-placeholder"},B={key:0},q={key:1},U={key:1,class:"custom-time-n-sales-search__option-list"},K=["onClick"],X={class:"body-md__w"},Y={class:"body-sm"},G={class:"custom-time-n-sales-search__size-field"},J={class:"custom-time-n-sales-search__size-icons"},Q=o({__name:"EaeraTimeNSalesSearch",setup(s){const{searchValue:t,searchPlaceholder:o,searchOptions:z,selectedSearchOption:k,loadingSearchOptions:T,minTradeSize:L,minTradeSizePlaceholder:N,fetchingSymbolLabel:E,symbolNotFoundLabel:V,showingDropdown:H,onSelectSearchOption:M}=D(),$=i(null),Q=e(),{width:Z}=C($),ee=l(()=>`${Math.max(Z.value,200)}px`),ae=e(t.value),le=e(!1),se=l({get:()=>L.value,set:e=>{L.value=e}});a(t,e=>{ae.value=e});const te=e=>{le.value||(t.value=e)},oe=()=>{le.value=!0},ie=e=>{t.value=e.data},ne=e=>{le.value=!1;const a=e.data??ae.value;t.value=a},re=e=>{M(e)},me=e=>{H.value=e},ce=()=>{L.value=(e=>{const a=Number(e);return!Number.isFinite(a)||a<1?"":`${a}`})(L.value)},de=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${a+1}`},ue=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${Math.max(1,a-1)}`},he=l(()=>[{value:"up",icon:x,onClick:de},{value:"down",icon:O,onClick:ue}]);return a(t,e=>{e?Q.value?.openDropdown():Q.value?.closeDropdown()},{immediate:!0}),(e,a)=>(n(),r("div",{ref_key:"searchRef",ref:$,class:"custom-time-n-sales-search"},[m("div",R,[m("div",W,[c(d(F),{modelValue:ae.value,"onUpdate:modelValue":a[0]||(a[0]=e=>ae.value=e),placeholder:d(o),clearable:"",class:"watchlist-input custom-time-n-sales-search__symbol-input",onInput:te,onCompositionstart:oe,onCompositionupdate:ie,onCompositionend:ne},u({_:2},[d(t)?void 0:{name:"suffix",fn:p(()=>[c(d(j),{size:16,class:"icon-primary"})]),key:"0"}]),1032,["modelValue","placeholder"]),m("div",A,[c(d(P),{ref_key:"dropdownRef",ref:Q,trigger:"click",placement:"bottom-start",class:"custom-time-n-sales-search__dropdown",onVisibleChange:me},{dropdown:p(()=>[v(e.$slots,"dropdown",{options:d(z),selected:d(k),minWidth:ee.value,loading:d(T),fetchingSymbolLabel:d(E),symbolNotFoundLabel:d(V),selectOption:re},()=>[m("div",{class:"custom-time-n-sales-search__dropdown-panel",style:b({minWidth:ee.value})},[d(T)||!d(z).length?(n(),r("div",I,[d(T)?(n(),r("div",B,_(d(E)),1)):(n(),r("div",q,_(d(V)),1))])):(n(),r("div",U,[(n(!0),r(y,null,g(d(z),e=>(n(),r("div",{key:e.value,class:f(["custom-time-n-sales-search__option",e.value===d(k)&&"is-selected"]),onClick:a=>re(e.value)},[m("div",X,_(e.label),1),m("div",Y,_(e.description),1)],10,K))),128))]))],4)])]),default:p(()=>[a[2]||(a[2]=m("div",{class:"custom-time-n-sales-search__dropdown-trigger"},null,-1))]),_:3},512)])]),m("div",G,[c(d(F),{modelValue:se.value,"onUpdate:modelValue":a[1]||(a[1]=e=>se.value=e),class:"watchlist-input custom-time-n-sales-search__size-input",placeholder:d(N),onChange:ce,onInput:ce},{suffix:p(()=>[m("div",J,[(n(!0),r(y,null,g(he.value,e=>(n(),S(w(e.icon),{key:e.value,size:12,class:"icon-primary custom-time-n-sales-search__size-icon",onClick:e.onClick},null,8,["onClick"]))),128))])]),_:1},8,["modelValue","placeholder"])])])],512))}}),Z={class:"custom-time-n-sales-table"},ee=o({__name:"EaeraTimeNSalesTable",setup(a){const{rows:l,fields:s,tableMaxHeight:t,loading:o,emptyLabel:u,onLoadMore:v}=D(),b=e(),y=i(null),g=()=>{const e=y.value;e&&((e,a=50)=>{const{scrollTop:l,clientHeight:s,scrollHeight:t}=e;return l+s>=t-a})(e)&&v()},f=()=>{g()};let S=null;const w=()=>{null==S&&(S=requestAnimationFrame(()=>{S=null,g()}))};return z(async()=>{await k(),(()=>{const e=b.value?.$el;if(!e)return;const a=e.querySelector(".el-scrollbar__wrap");a&&(y.value=a,a.addEventListener("scroll",f,{passive:!0}),a.addEventListener("wheel",w,{passive:!0}))})()}),T(()=>{(()=>{const e=y.value;e&&(e.removeEventListener("scroll",f),e.removeEventListener("wheel",w),y.value=null)})(),null!=S&&(cancelAnimationFrame(S),S=null)}),(e,a)=>(n(),r("div",Z,[c(d(H),{ref_key:"tableRef",ref:b,class:"watchlist-table custom-time-n-sales-table__table",items:d(l),fields:d(s),"max-height":d(t),stripe:!1,"hide-footer":"",loading:d(o)},{empty:p(()=>[m("div",null,_(d(u)),1)]),_:1},8,["items","fields","max-height","loading"])]))}}),ae={class:"custom-time-n-sales"},le={class:"custom-time-n-sales__table"},se=o({__name:"index",props:{searchValue:{},searchPlaceholder:{},searchOptions:{},selectedSearchOption:{},loadingSearchOptions:{type:Boolean},minTradeSize:{},minTradeSizePlaceholder:{},rows:{},fields:{},tableHeight:{},loading:{type:Boolean},fetchingSymbolLabel:{},symbolNotFoundLabel:{},emptyLabel:{}},emits:["resize","update:searchValue","select-search-option","update:minTradeSize","load-more","stateChange"],setup(e,{expose:l,emit:s}){const t=L(),o=i(null),{width:b,height:_}=C(o),y=$(e,s);return l({state:y.state}),a([b,_],()=>{o.value&&y.onResize(b.value,_.value)}),(e,a)=>(n(),r("div",ae,[m("div",{ref_key:"searchRef",ref:o,class:"custom-time-n-sales__search"},[c(d(Q),null,u({_:2},[d(t)["search-dropdown"]?{name:"dropdown",fn:p(a=>[v(e.$slots,"search-dropdown",N(E(a)))]),key:"0"}:void 0]),1024)],512),m("div",le,[c(d(ee))])]))}});export{se as _,$ as p,D as u};
@@ -577,7 +577,7 @@ declare function __VLS_template(): {
577
577
  "before-hide": (...args: any[]) => void;
578
578
  }, PublicProps, {
579
579
  style: string | false | CSSProperties | StyleValue[] | null;
580
- role: "dialog" | "menu" | "group" | "grid" | "listbox" | "navigation" | "tooltip" | "tree";
580
+ role: "dialog" | "menu" | "grid" | "group" | "listbox" | "navigation" | "tooltip" | "tree";
581
581
  visible: boolean | null;
582
582
  content: string;
583
583
  teleported: boolean;
@@ -628,7 +628,7 @@ declare function __VLS_template(): {
628
628
  hide: (event?: Event) => void;
629
629
  }, {}, {}, {}, {
630
630
  style: string | false | CSSProperties | StyleValue[] | null;
631
- role: "dialog" | "menu" | "group" | "grid" | "listbox" | "navigation" | "tooltip" | "tree";
631
+ role: "dialog" | "menu" | "grid" | "group" | "listbox" | "navigation" | "tooltip" | "tree";
632
632
  visible: boolean | null;
633
633
  content: string;
634
634
  teleported: boolean;
@@ -684,7 +684,7 @@ declare function __VLS_template(): {
684
684
  "before-hide": (...args: any[]) => void;
685
685
  }, string, {
686
686
  style: string | false | CSSProperties | StyleValue[] | null;
687
- role: "dialog" | "menu" | "group" | "grid" | "listbox" | "navigation" | "tooltip" | "tree";
687
+ role: "dialog" | "menu" | "grid" | "group" | "listbox" | "navigation" | "tooltip" | "tree";
688
688
  visible: boolean | null;
689
689
  content: string;
690
690
  teleported: boolean;
@@ -1594,7 +1594,7 @@ declare const __VLS_component: DefineComponent<Props, {
1594
1594
  "before-hide": (...args: any[]) => void;
1595
1595
  }, PublicProps, {
1596
1596
  style: string | false | CSSProperties | StyleValue[] | null;
1597
- role: "dialog" | "menu" | "group" | "grid" | "listbox" | "navigation" | "tooltip" | "tree";
1597
+ role: "dialog" | "menu" | "grid" | "group" | "listbox" | "navigation" | "tooltip" | "tree";
1598
1598
  visible: boolean | null;
1599
1599
  content: string;
1600
1600
  teleported: boolean;
@@ -1645,7 +1645,7 @@ declare const __VLS_component: DefineComponent<Props, {
1645
1645
  hide: (event?: Event) => void;
1646
1646
  }, {}, {}, {}, {
1647
1647
  style: string | false | CSSProperties | StyleValue[] | null;
1648
- role: "dialog" | "menu" | "group" | "grid" | "listbox" | "navigation" | "tooltip" | "tree";
1648
+ role: "dialog" | "menu" | "grid" | "group" | "listbox" | "navigation" | "tooltip" | "tree";
1649
1649
  visible: boolean | null;
1650
1650
  content: string;
1651
1651
  teleported: boolean;
@@ -1701,7 +1701,7 @@ declare const __VLS_component: DefineComponent<Props, {
1701
1701
  "before-hide": (...args: any[]) => void;
1702
1702
  }, string, {
1703
1703
  style: string | false | CSSProperties | StyleValue[] | null;
1704
- role: "dialog" | "menu" | "group" | "grid" | "listbox" | "navigation" | "tooltip" | "tree";
1704
+ role: "dialog" | "menu" | "grid" | "group" | "listbox" | "navigation" | "tooltip" | "tree";
1705
1705
  visible: boolean | null;
1706
1706
  content: string;
1707
1707
  teleported: boolean;
@@ -1,11 +1,11 @@
1
- import { IEaeraChatBoxChatController, EaeraChatBoxMode } from '../../../types/EaeraChatBox';
1
+ import { IEaeraChatBoxChatController, EaeraChatBoxMode } from '../../types/EaeraChatBox';
2
2
  import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  type __VLS_Props = {
4
4
  /** Data controller — from cms-sdk `useEaeraChatBox()` or a mock. */
5
5
  chat: IEaeraChatBoxChatController;
6
6
  /** floating (FAB + panel) or embedded (inline panel). */
7
7
  mode?: EaeraChatBoxMode;
8
- /** embedded — start with the panel visible. Default true. */
8
+ /** embedded — start with the panel visible. Supports v-model:open. Default true. */
9
9
  open?: boolean;
10
10
  };
11
11
  declare const _default: DefineComponent<__VLS_Props, {
@@ -18,5 +18,7 @@ declare const _default: DefineComponent<__VLS_Props, {
18
18
  }>, {
19
19
  open: boolean;
20
20
  mode: EaeraChatBoxMode;
21
- }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
21
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
22
+ rootEl: HTMLDivElement;
23
+ }, any>;
22
24
  export default _default;
@@ -0,0 +1 @@
1
+ import{_ as e}from"../chunks/EaeraChatBox-BizsNzpv.mjs";import"vue";import"@lucide/vue";import"vue-i18n";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"element-plus";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraTag-DsDZxISm.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"element-plus/es";import"../chunks/eventListener-o1XlgLVq.mjs";export{e as default};
@@ -1,5 +1,5 @@
1
1
  import { App } from 'vue';
2
- import { default as EaeraChatBox } from './custom/EaeraChatBox/index';
2
+ import { default as EaeraChatBox } from './custom/EaeraChatBox';
3
3
  import { default as EaeraAvatar } from './base/EaeraAvatar';
4
4
  import { default as EaeraAutoComplete } from './base/EaeraAutoComplete';
5
5
  import { default as EaeraBadge } from './base/EaeraBadge';