@tradecanvas/chart 1.69.0 → 1.70.0
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.
- package/dist/Chart.d.ts +15 -96
- package/dist/Chart.d.ts.map +1 -1
- package/dist/DataManager.d.ts +7 -0
- package/dist/DataManager.d.ts.map +1 -1
- package/dist/{LayoutSession-CoCMrrbh.js → LayoutSession-Bcy79w0l.js} +1030 -829
- package/dist/LayoutSession-Bcy79w0l.js.map +1 -0
- package/dist/LayoutSession-D7S6GZgJ.cjs +2 -0
- package/dist/LayoutSession-D7S6GZgJ.cjs.map +1 -0
- package/dist/SeriesStore.d.ts +2 -0
- package/dist/SeriesStore.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/model/DisplaySeries.d.ts +50 -0
- package/dist/model/DisplaySeries.d.ts.map +1 -0
- package/dist/model/DrawingPanes.d.ts +24 -0
- package/dist/model/DrawingPanes.d.ts.map +1 -0
- package/dist/model/IndicatorHistory.d.ts +52 -0
- package/dist/model/IndicatorHistory.d.ts.map +1 -0
- package/dist/model/IndicatorPanes.d.ts +76 -0
- package/dist/model/IndicatorPanes.d.ts.map +1 -0
- package/dist/model/IndicatorSetup.d.ts +34 -0
- package/dist/model/IndicatorSetup.d.ts.map +1 -0
- package/dist/model/PaneLayout.d.ts +55 -0
- package/dist/model/PaneLayout.d.ts.map +1 -0
- package/dist/model/PriceFit.d.ts +75 -0
- package/dist/model/PriceFit.d.ts.map +1 -0
- package/dist/model/SymbolRequests.d.ts +34 -0
- package/dist/model/SymbolRequests.d.ts.map +1 -0
- package/dist/widget/index.cjs +1 -1
- package/dist/widget/index.js +1 -1
- package/package.json +3 -3
- package/dist/LayoutSession-BWC7O5R9.cjs +0 -2
- package/dist/LayoutSession-BWC7O5R9.cjs.map +0 -1
- package/dist/LayoutSession-CoCMrrbh.js.map +0 -1
- package/dist/PaneManager.d.ts +0 -19
- package/dist/PaneManager.d.ts.map +0 -1
package/dist/SeriesStore.d.ts
CHANGED
|
@@ -95,6 +95,8 @@ export declare class SeriesStore {
|
|
|
95
95
|
* kept by the array and a few bars it samples (the GPU's) is stale.
|
|
96
96
|
*/
|
|
97
97
|
revision(): number;
|
|
98
|
+
/** Moves on every write to the bars shown: see `DataManager.version`. */
|
|
99
|
+
version(): number;
|
|
98
100
|
/** The live series: kept aside during a replay, else every bar, hidden ones too. */
|
|
99
101
|
liveBars(): DataSeries;
|
|
100
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeriesStore.d.ts","sourceRoot":"","sources":["../src/SeriesStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIhE,+EAA+E;AAC/E,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;AAEpG,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACnD,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACnD,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAID,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,iE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AU,GAAG,IAAI;IAIpC,iDAAiD;IACjD,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIlC,sCAAsC;IACtC,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAMlC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAIpB,kGAAkG;IAClG,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,KAAK;IAIb,yFAAyF;IACzF,OAAO,CAAC,WAAW;IAMnB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAcxB,kGAAkG;IAClG,OAAO,CAAC,IAAI;CAQb"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-BWC7O5R9.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);function r(e){let{id:t,params:n={},position:r=null}=typeof e==`string`?{id:e}:e;return JSON.stringify([t,Object.keys(n).sort().map(e=>[e,n[e]]),r])}function i(e,t,n){let i=new Map,a=t.map(e=>{let t=r(e),n=i.get(t)??0;return i.set(t,n+1),{spec:e,key:`${t}#${n}`}}),o=new Set(a.map(e=>e.key));for(let[t,r]of[...n])o.has(t)||(e.removeIndicator(r),n.delete(t));for(let{spec:t,key:r}of a){if(n.has(r))continue;let i=typeof t==`string`?e.addIndicator(t):t.position===void 0?e.addIndicator(t.id,t.params??{}):e.addIndicator(t.id,t.params??{},t.position);i&&n.set(r,i)}}var a=3,o=e=>({time:e.time,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}),s=e=>e.length>0?e[e.length-1]:null;function c(t,n,r){for(let i=0;i<r;i++)if(!e.D(t[i],n[i]))return!1;return!0}function l(e,t){if(e.isReplayActive())return!0;let n=s(e.getData());return t.inReplay?n?.time===t.last?.time:n===t.shownBar?n?.time===t.last?.time||!e.isExtendedHoursVisible():!1}function u(t,n,r){let i=[];for(let a=0;a<n.length;a++){let s=t[r+a];if(!e.D(s,n[a])){if(s.time!==n[a].time||!e.E(s))return null;i.push(o(s))}}return i}function d(e,t){if(t.length===0)return!0;if(!e.updateBar)return!1;for(let n of t)if(!e.updateBar(n))return!1;return!0}function f(e){return e.slice(Math.max(1,e.length-1-3),-1).map(o)}function p(t,n){let r=[];for(let i=n;i<t.length;i++){if(!e.E(t[i])||!(t[i].time>t[i-1].time))return null;r.push(o(t[i]))}return r}function m(t,n,r){let i=r.length;if(i===0||!r.last||!e.E(r.last)||n.length<i||!l(t,r))return!1;let a=r.recent??[],s=i-1-a.length;if(n!==r.source&&(r.source.length!==i||!c(r.source,n,s)))return!1;let f=n[i-1];if(f.time!==r.last.time||!e.E(f))return!1;let m=u(n,a,s),h=p(n,i);return!m||!h||!d(t,m)?!1:(e.D(f,r.last)||t.updateLastBar(o(f)),h.length===1?t.appendBar(h[0]):h.length>1&&t.appendBars(h),!0)}function h(e,t,n){(!n||!m(e,t,n))&&e.setData(t.map(o));let r=t.length>0?o(t[t.length-1]):null,i=e.isReplayActive();return{source:t,length:t.length,last:r,recent:f(t),shownBar:i?null:s(e.getData()),inReplay:i}}function g(e){let{viewport:t,data:r}=e,i=(0,n.priceToYMapper)(t),a=r.length-1,o=Math.max(0,Math.floor(t.visibleRange.from)),s=Math.min(a,Math.ceil(t.visibleRange.to)),c=e=>r.length>0?(0,n.timestampToBarIndex)(e,r):e;return{timeToX:e=>(0,n.barIndexToX)(c(e),t),xToTime:e=>{let i=(0,n.xToBarIndex)(e,t);return r.length>0?(0,n.barIndexToTime)(i,r):i},indexToX:e=>(0,n.barIndexToX)(e,t),xToIndex:e=>(0,n.xToBarIndex)(e,t),priceToY:i,yToPrice:e=>(0,n.yToPrice)(e,t),barWidth:t.barWidth,visible:s<o?{from:0,to:-1}:{from:o,to:s}}}var _={"1x1":{cols:1,rows:1},"1x2":{cols:2,rows:1},"2x1":{cols:1,rows:2},"2x2":{cols:2,rows:2},"1x3":{cols:3,rows:1},"3x1":{cols:1,rows:3},"2x3":{cols:3,rows:2},"3x2":{cols:2,rows:3}},v=class{root;cells=[];layout;options;destroyed=!1;syncing=!1;constructor(e,t={}){this.options=t,this.layout=t.layout??`2x2`,this.root=document.createElement(`div`),this.root.style.cssText=`display:grid;width:100%;height:100%;overflow:hidden;`,e.appendChild(this.root),this.applyLayout(),this.createCells()}applyLayout(){let{cols:e,rows:t}=_[this.layout],n=this.options.gap??1;this.root.style.gridTemplateColumns=`repeat(${e}, 1fr)`,this.root.style.gridTemplateRows=`repeat(${t}, 1fr)`,this.root.style.gap=`${n}px`}createCells(){let{cols:e,rows:t}=_[this.layout],n=e*t;for(let e=0;e<n;e++)this.cells.push(this.createCell(e))}createCell(t){let n=this.options.cells?.[t]??{},r=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden;min-width:0;min-height:0;`,this.root.appendChild(r);let i=new e.c(r,{chartType:`candlestick`,autoScale:!0,features:{crosshair:!0,keyboard:!0,volume:!0,legend:!0,priceAxis:!0,timeAxis:!0,grid:!0},...this.options.chartOptions,...n.chartOptions,theme:this.options.theme}),a={container:r,chart:i,symbol:n.symbol??`Chart ${t+1}`,timeframe:n.timeframe??`5m`};return this.options.syncCrosshair!==!1&&(i.on(`crosshairMove`,e=>{let t=e.payload.bar?.time;if(t!==void 0)for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(t)}),i.on(`crosshairLeave`,()=>{for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(null)})),this.options.syncTimeAxis!==!1&&i.on(`visibleRangeChange`,e=>{if(this.syncing)return;this.syncing=!0;let{from:t,to:n}=e.payload,r=i.getData();if(r.length>0&&t>=0&&n<r.length){let e=r[t]?.time,a=r[n]?.time;if(e&&a)for(let t of this.cells)t.chart!==i&&t.chart.setVisibleRange(e,a)}this.syncing=!1}),a}setLayout(e){if(e===this.layout)return;let t=this.cells.length,{cols:n,rows:r}=_[e],i=n*r;if(i<t)for(let e=t-1;e>=i;e--){let t=this.cells[e];t.chart.destroy(),t.container.remove(),this.cells.pop()}this.layout=e,this.applyLayout();for(let e=t;e<i;e++)this.cells.push(this.createCell(e))}getChart(e){return this.cells[e]?.chart??null}getCharts(){return this.cells.map(e=>e.chart)}getCellCount(){return this.cells.length}setData(e,t){this.cells[e]?.chart.setData(t)}setAllData(e){for(let t of this.cells)t.chart.setData(e)}async connectCell(e,t){let n=this.cells[e];n&&(n.symbol=t.symbol,n.timeframe=t.timeframe,await n.chart.connect(t))}async connectAll(e,t,r,i=500){let a=[];for(let o=0;o<this.cells.length&&o<t.length;o++)a.push(this.connectCell(o,{...typeof e==`function`?{adapter:e(t[o],o)}:(0,n.isDataFeed)(e)?{feed:e}:{adapter:e},symbol:t[o],timeframe:r,historyLimit:i}));await Promise.all(a)}setTheme(e){for(let t of this.cells)t.chart.setTheme(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(let e of this.cells)e.chart.destroy(),e.container.remove();this.cells=[],this.root.remove()}}},y=class extends n.BaseFinanceChart{options;constructor(e,t){super(e,t.theme),this.options=t,this.requestRender()}renderChart(e,t,r,i){(0,n.renderSparkline)(e,t,r,this.options,i)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}},b=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderDepthChart)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},x=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderEquityCurve)(e,t,r,this.options,i,a)}update(e,t){this.options={...this.options,data:e},t!==void 0&&(this.options={...this.options,benchmark:t}),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},S=class extends n.BaseFinanceChart{options;crosshair=null;cachedRects=[];cachedGroups=[];currentData=[];lastLayoutWidth=0;lastLayoutHeight=0;handleClick=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentData=t.data??[],t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),t.onCellClick&&(this.handleClick=e=>{let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;this.onCanvasClick(n,r)},this.canvas.addEventListener(`click`,this.handleClick)),this.applyLabel(),this.recomputeLayout(),this.requestRender()}applyLabel(){let e=new Set(this.currentData.map(e=>e.group).filter(Boolean)).size,t=this.options.grouped&&e>0?`Market map of ${this.currentData.length} cells in ${e} groups`:`Heatmap of ${this.currentData.length} cells`;this.setLabel(this.options.ariaLabel??t)}recomputeLayout(){let e={x:0,y:0,width:this.width,height:this.height},t=this.options.cellPadding??2;if(this.lastLayoutWidth=this.width,this.lastLayoutHeight=this.height,this.cachedGroups=[],this.options.grouped){let{groups:r,cells:i}=(0,n.layoutGroupedTreemap)(this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1),group:e.group,value:e.value})),e,t,n.GROUP_HEADER);this.cachedRects=i,this.cachedGroups=r}else if(this.options.weighted){let r=this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1)}));this.cachedRects=(0,n.layoutSquarifiedTreemap)(r,e,t)}else this.cachedRects=(0,n.layoutUniformGrid)(this.currentData.map(e=>({id:e.id})),e,t)}onCanvasClick(e,t){if(this.options.onCellClick)for(let n of this.cachedRects){let r=n.rect;if(e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height){let e=this.currentData.find(e=>e.id===n.id);e&&this.options.onCellClick(e);return}}}renderChart(e,t,r,i){(t!==this.lastLayoutWidth||r!==this.lastLayoutHeight)&&this.recomputeLayout();let a=this.crosshair?.getPosition()??null;(0,n.renderHeatmap)(e,t,r,this.currentData,this.cachedRects,this.options,i,a,this.cachedGroups)}update(e){this.currentData=e,this.options={...this.options,data:e},this.applyLabel(),this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},e.data&&(this.currentData=e.data),this.applyLabel(),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair?.destroy(),this.handleClick&&this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},C=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderWaterfall)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},w=500;function T(e){let t=1-e;return 1-t*t*t}var E=class extends n.BaseFinanceChart{options;currentValue;targetValue;animationStart=null;animationFrom=0;animationFrameId=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentValue=t.value,this.targetValue=t.value,this.requestRender()}renderChart(e,t,r,i){(0,n.renderGauge)(e,t,r,this.options,i,this.currentValue)}setValue(e){if(this.options.animate===!1){this.cancelAnimation(),this.currentValue=e,this.targetValue=e,this.options={...this.options,value:e},this.requestRender();return}this.targetValue=e,this.animationFrom=this.currentValue,this.animationStart=performance.now(),this.options={...this.options,value:e},this.startAnimationLoop()}setOptions(e){let t={...this.options,...e};if(e.value!==void 0&&e.value!==this.targetValue){this.options=t,this.setValue(e.value);return}this.options=t,this.requestRender()}startAnimationLoop(){if(this.animationFrameId!==null)return;let e=()=>{if(this.animationFrameId=null,this.animationStart===null)return;let t=this.options.animationDuration??w,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=T(r);this.currentValue=this.animationFrom+(this.targetValue-this.animationFrom)*i,this.requestRender(),r<1?this.animationFrameId=requestAnimationFrame(e):(this.currentValue=this.targetValue,this.animationStart=null)};this.animationFrameId=requestAnimationFrame(e)}cancelAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.animationStart=null}destroy(){this.cancelAnimation(),super.destroy()}},D=class extends n.BaseFinanceChart{options;layout=null;layoutFor=null;crosshair;onClick=e=>{let t=this.canvas.getBoundingClientRect();this.layout&&this.clickAt(this.layout,e.clientX-t.left,e.clientY-t.top)};onMove=e=>{if(!this.layout||!this.clickable())return;let t=this.canvas.getBoundingClientRect();this.canvas.style.cursor=this.hits(this.layout,e.clientX-t.left,e.clientY-t.top)?`pointer`:``};constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender()),this.canvas.addEventListener(`click`,this.onClick),this.canvas.addEventListener(`pointermove`,this.onMove),this.applyLabel(),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition(),o=this.layoutFor;(!this.layout||!o||o.options!==this.options||o.width!==t||o.height!==r||o.theme!==i)&&(this.layout=this.compute(t,r,i,(0,n.canvasMeasure)(e,i)),this.layoutFor={options:this.options,width:t,height:r,theme:i}),this.draw(e,t,r,i,a,this.layout)}setOptions(e){this.options={...this.options,...e},`theme`in e&&this.setTheme(e.theme??`dark`),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??this.describe())}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.onClick),this.canvas.removeEventListener(`pointermove`,this.onMove),super.destroy()}},O=class extends D{compute(e,t,r,i){return(0,n.computeBarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderBarChart)(e,t,r,this.options,i,a,o)}describe(){return`Bar chart of ${this.options.series.map(e=>e.name).join(`, `)}, ${this.options.categories.length} categories`}clickable(){return this.options.onBarClick!==void 0}hits(e,t,r){return(0,n.hitBar)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitBar)(e,t,r);i&&this.options.onBarClick?.({category:i.category,series:i.series,value:i.value,index:i.index})}update(e,t){this.setOptions({categories:e,series:t})}},k=class extends D{compute(e,t,r,i){return(0,n.computeDonutLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderDonut)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.filter(e=>Number.isFinite(e.value)&&e.value>0).map(e=>e.label).join(`, `);return`${(this.options.innerRadius??.6)>0?`Donut`:`Pie`} chart of ${e}`}clickable(){return this.options.onSliceClick!==void 0}hits(e,t,r){return(0,n.hitSlice)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitSlice)(e,t,r);i&&this.options.onSliceClick?.(i.slice)}update(e){this.setOptions({data:e})}},A=class extends D{compute(e,t,r,i){return(0,n.computeScatterLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderScatter)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.series.reduce((e,t)=>e+t.points.length,0);return`Scatter chart${this.options.xLabel&&this.options.yLabel?` of ${this.options.yLabel} against ${this.options.xLabel}`:``}, ${e} points`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestPoint)(e,t,r);i&&this.options.onPointClick?.(i.point,i.series)}update(e){this.setOptions({series:e})}},j=class extends D{compute(e,t,r,i){return(0,n.computeHistogramLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderHistogram)(e,t,r,this.options,i,a,o)}describe(){return`Histogram of ${this.options.values.length} values`}clickable(){return!1}hits(){return!1}clickAt(){}update(e){this.setOptions({values:e})}},M=class extends D{compute(e,t,r,i){return(0,n.computeCalendarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCalendar)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.map(e=>e.date).filter(e=>/^\d{4}-\d{2}-\d{2}$/.test(e)).sort(),t=this.options.from??e[0],n=this.options.to??e[e.length-1];return t&&n?`Calendar of daily values from ${t} to ${n}`:`Calendar of daily values`}clickable(){return this.options.onDayClick!==void 0}hits(e,t,r){return(0,n.hitDay)(e,t,r)?.day!==void 0}clickAt(e,t,r){let i=(0,n.hitDay)(e,t,r)?.day;i&&this.options.onDayClick?.(i)}update(e){this.setOptions({data:e})}},N=12,P=class extends D{compute(e,t,r,i){return(0,n.computeMatrixLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderMatrix)(e,t,r,this.options,i,a,o)}describe(){let{rows:e,columns:t}=this.options;return t?e.length+t.length<=N?`Matrix of ${e.join(`, `)} by ${t.join(`, `)}`:`Matrix of ${e.length} rows by ${t.length} columns`:e.length<=N?`Matrix of ${e.join(`, `)}`:`Matrix of ${e.length} rows`}clickable(){return this.options.onCellClick!==void 0}hits(e,t,r){return(0,n.hitMatrixCell)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitMatrixCell)(e,t,r);i&&this.options.onCellClick?.(i.cell)}update(e){this.setOptions({values:e})}},F=class extends D{compute(e,t,r,i){return(0,n.computeCounterClockLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCounterClock)(e,t,r,this.options,i,a,o)}describe(){return`Counter-clock chart of price against volume, ${this.options.period??25}-bar averages`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestCounterClockPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestCounterClockPoint)(e,t,r);i&&this.options.onPointClick?.(i.point)}getPhase(){return(0,n.counterClockPhase)((0,n.counterClockPoints)(this.options.data,this.options.period??25,(0,n.shownCount)(this.options)))}update(e){this.setOptions({data:e})}},I=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function L(e){return e.map(e=>({time:e.time,value:e.equity}))}function R(e){let t=-1/0;return e.map(e=>{e.equity>t&&(t=e.equity);let n=t>0?(e.equity/t-1)*100:0;return{time:e.time,value:n}})}function z(e){if(e.length===0)return[];let n=[];for(let r of e){let e=(0,t.timeframeBucketStart)(r.time,`1M`),i=n[n.length-1];i&&i.key===e?i.close=r.equity:n.push({key:e,close:r.equity})}let r=e[0].equity,i=[];for(let e of n){let t=r===0?1:r,n=(e.close/t-1)*100;r=e.close;let a=new Date(e.key),o=a.getUTCFullYear(),s=a.getUTCMonth();i.push({id:`${o}-${String(s+1).padStart(2,`0`)}`,label:I[s],group:String(o),value:n})}return i}var B=100;function V(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function H(e){return e>0?`positive`:e<0?`negative`:`neutral`}function U(e){return[{label:`Total Return`,value:V(e.totalReturnPct*B),tone:H(e.totalReturnPct)},{label:`CAGR`,value:V(e.cagr*B),tone:H(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:H(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:H(e.sortino)},{label:`Max Drawdown`,value:V(-Math.abs(e.maxDrawdownPct)*B),tone:`negative`},{label:`Win Rate`,value:`${(e.winRate*B).toFixed(1)}%`,tone:`neutral`},{label:`Profit Factor`,value:Number.isFinite(e.profitFactor)?e.profitFactor.toFixed(2):`∞`,tone:H(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function W(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var G=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=W(t.theme),this.root=document.createElement(`div`),this.build(),e.appendChild(this.root)}build(){let e=this.theme,{result:t,title:n,subtitle:r}=this.options,i=this.panelBackground(),a=e.grid;if(this.root.style.cssText=[`display:flex`,`flex-direction:column`,`gap:14px`,`width:100%`,`box-sizing:border-box`,`padding:16px`,`background:${e.background}`,`color:${e.text}`,`font-family:${e.font.family}`].join(`;`),n||r){let t=document.createElement(`div`);if(n){let r=document.createElement(`div`);r.textContent=n,r.style.cssText=`font-size:${e.font.sizeLarge}px;font-weight:600;letter-spacing:-0.01em;`,t.appendChild(r)}if(r){let n=document.createElement(`div`);n.textContent=r,n.style.cssText=`font-size:${e.font.sizeSmall}px;color:${e.textSecondary};margin-top:2px;`,t.appendChild(n)}this.root.appendChild(t)}this.root.appendChild(this.buildStatsStrip(U(t.metrics),i,a));let o=document.createElement(`div`);o.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))`,`grid-auto-rows:220px`,`gap:14px`].join(`;`),this.root.appendChild(o);let s=this.buildPanel(`Equity Curve`,i,a);s.wrap.style.gridColumn=`1 / -1`,o.appendChild(s.wrap),this.equityChart=new x(s.body,{data:L(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let c=this.buildPanel(`Drawdown`,i,a);o.appendChild(c.wrap),this.drawdownChart=new x(c.body,{data:R(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let l=z(t.equityCurve),u=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(u.wrap),this.heatmap=new S(u.body,{data:l,theme:e,showValues:!0,valueFormat:e=>`${e>=0?`+`:``}${e.toFixed(1)}`,colorScale:{negative:e.candleDown,zero:i,positive:e.candleUp}})}buildStatsStrip(e,t,n){let r=document.createElement(`div`);r.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))`,`gap:10px`].join(`;`);let i=this.theme;for(let a of e){let e=document.createElement(`div`);e.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`padding:10px 12px`,`display:flex`,`flex-direction:column`,`gap:4px`].join(`;`);let o=document.createElement(`div`);o.textContent=a.label,o.style.cssText=`font-size:${i.font.sizeSmall}px;color:${i.textSecondary};text-transform:uppercase;letter-spacing:0.04em;`;let s=document.createElement(`div`);s.textContent=a.value;let c=a.tone===`positive`?i.candleUp:a.tone===`negative`?i.candleDown:i.text;s.style.cssText=`font-size:${i.font.sizeLarge}px;font-weight:600;color:${c};font-variant-numeric:tabular-nums;`,e.appendChild(o),e.appendChild(s),r.appendChild(e)}return r}buildPanel(e,t,n){let r=this.theme,i=document.createElement(`div`);i.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`overflow:hidden`,`display:flex`,`flex-direction:column`].join(`;`);let a=document.createElement(`div`);a.textContent=e,a.style.cssText=[`font-size:${r.font.sizeSmall}px`,`font-weight:600`,`color:${r.textSecondary}`,`padding:8px 12px`,`border-bottom:1px solid ${n}`,`text-transform:uppercase`,`letter-spacing:0.04em`].join(`;`);let o=document.createElement(`div`);return o.style.cssText=`flex:1;min-height:0;position:relative;`,i.appendChild(a),i.appendChild(o),{wrap:i,body:o}}panelBackground(){return this.theme.name===`light`?`rgba(0,0,0,0.02)`:`rgba(255,255,255,0.03)`}update(e){this.options={...this.options,result:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}setTheme(e){this.theme=W(e),this.options={...this.options,theme:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}destroyCharts(){this.equityChart?.destroy(),this.drawdownChart?.destroy(),this.heatmap?.destroy(),this.equityChart=null,this.drawdownChart=null,this.heatmap=null}destroy(){this.destroyCharts(),this.root.remove()}};Object.defineProperty(exports,`AlertManager`,{enumerable:!0,get:function(){return n.AlertManager}}),Object.defineProperty(exports,`Animator`,{enumerable:!0,get:function(){return n.Animator}}),exports.BarChart=O,Object.defineProperty(exports,`BarCountdown`,{enumerable:!0,get:function(){return n.BarCountdown}}),Object.defineProperty(exports,`BinanceAdapter`,{enumerable:!0,get:function(){return n.BinanceAdapter}}),Object.defineProperty(exports,`BybitAdapter`,{enumerable:!0,get:function(){return n.BybitAdapter}}),Object.defineProperty(exports,`CANDLE_PATTERNS`,{enumerable:!0,get:function(){return n.CANDLE_PATTERNS}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.CORRECTABLE_BARS=a,exports.CalendarChart=M,exports.Chart=e.c,exports.ChartGrid=v,Object.defineProperty(exports,`ChartLegend`,{enumerable:!0,get:function(){return n.ChartLegend}}),Object.defineProperty(exports,`ChartStateManager`,{enumerable:!0,get:function(){return n.ChartStateManager}}),Object.defineProperty(exports,`CoinbaseAdapter`,{enumerable:!0,get:function(){return n.CoinbaseAdapter}}),Object.defineProperty(exports,`CompareRenderer`,{enumerable:!0,get:function(){return n.CompareRenderer}}),exports.CounterClockChart=F,Object.defineProperty(exports,`CrosshairTooltip`,{enumerable:!0,get:function(){return n.CrosshairTooltip}}),Object.defineProperty(exports,`CurrentPriceLine`,{enumerable:!0,get:function(){return n.CurrentPriceLine}}),Object.defineProperty(exports,`DARK_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.DARK_PRICE_LIMITS}}),Object.defineProperty(exports,`DARK_TERMINAL`,{enumerable:!0,get:function(){return t.DARK_TERMINAL}}),Object.defineProperty(exports,`DARK_THEME`,{enumerable:!0,get:function(){return t.DARK_THEME}}),Object.defineProperty(exports,`DEFAULT_DRAWING_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_DRAWING_STYLE}}),Object.defineProperty(exports,`DEFAULT_FONT_FAMILY`,{enumerable:!0,get:function(){return t.DEFAULT_FONT_FAMILY}}),exports.DEFAULT_HISTORY_PAGE_SIZE=e.C,Object.defineProperty(exports,`DEFAULT_LEGEND_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_LEGEND_CONFIG}}),Object.defineProperty(exports,`DEFAULT_MAX_WEBGL_CHARTS`,{enumerable:!0,get:function(){return n.DEFAULT_MAX_WEBGL_CHARTS}}),Object.defineProperty(exports,`DEFAULT_RECONNECT`,{enumerable:!0,get:function(){return t.DEFAULT_RECONNECT}}),Object.defineProperty(exports,`DEFAULT_SESSION_HOURS`,{enumerable:!0,get:function(){return n.DEFAULT_SESSION_HOURS}}),Object.defineProperty(exports,`DEFAULT_SIGNAL_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_SIGNAL_STYLE}}),Object.defineProperty(exports,`DEFAULT_STREAM_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_STREAM_CONFIG}}),Object.defineProperty(exports,`DEFAULT_TIMEFRAME_FAVORITES`,{enumerable:!0,get:function(){return t.DEFAULT_TIMEFRAME_FAVORITES}}),Object.defineProperty(exports,`DEFAULT_TRADE_ZONE_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_TRADE_ZONE_STYLE}}),Object.defineProperty(exports,`DEFAULT_TRADING_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_TRADING_CONFIG}}),Object.defineProperty(exports,`DataExporter`,{enumerable:!0,get:function(){return n.DataExporter}}),exports.DataManager=e.T,exports.DepthChart=b,exports.DonutChart=k,exports.DragDropImporter=e.o,Object.defineProperty(exports,`DrawingBase`,{enumerable:!0,get:function(){return n.DrawingBase}}),exports.EXCHANGE_TIMEZONE=e.l,exports.EXCHANGE_TIME_ZONE=e.u,Object.defineProperty(exports,`Easing`,{enumerable:!0,get:function(){return n.Easing}}),exports.EquityCurveChart=x,exports.GaugeChart=E,exports.HISTORY_RETRY_MS=e.w,Object.defineProperty(exports,`HNX_SESSIONS`,{enumerable:!0,get:function(){return t.HNX_SESSIONS}}),Object.defineProperty(exports,`HOSE_SESSIONS`,{enumerable:!0,get:function(){return t.HOSE_SESSIONS}}),exports.HeatmapChart=S,exports.HistogramChart=j,Object.defineProperty(exports,`INDICATOR_CATEGORIES`,{enumerable:!0,get:function(){return n.INDICATOR_CATEGORIES}}),Object.defineProperty(exports,`IndicatorBase`,{enumerable:!0,get:function(){return n.IndicatorBase}}),Object.defineProperty(exports,`IndicatorValueMap`,{enumerable:!0,get:function(){return n.IndicatorValueMap}}),Object.defineProperty(exports,`KEPT_BUCKETS`,{enumerable:!0,get:function(){return n.KEPT_BUCKETS}}),Object.defineProperty(exports,`KRX_SESSIONS`,{enumerable:!0,get:function(){return t.KRX_SESSIONS}}),Object.defineProperty(exports,`KR_COLORS`,{enumerable:!0,get:function(){return t.KR_COLORS}}),Object.defineProperty(exports,`KeyboardHandler`,{enumerable:!0,get:function(){return n.KeyboardHandler}}),Object.defineProperty(exports,`KrakenAdapter`,{enumerable:!0,get:function(){return n.KrakenAdapter}}),Object.defineProperty(exports,`LIGHT_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.LIGHT_PRICE_LIMITS}}),Object.defineProperty(exports,`LIGHT_THEME`,{enumerable:!0,get:function(){return t.LIGHT_THEME}}),exports.LayoutManager=e.x,exports.LayoutSession=e.t,Object.defineProperty(exports,`MARKET_CRYPTO`,{enumerable:!0,get:function(){return t.MARKET_CRYPTO}}),Object.defineProperty(exports,`MARKET_HNX`,{enumerable:!0,get:function(){return t.MARKET_HNX}}),Object.defineProperty(exports,`MARKET_HOSE`,{enumerable:!0,get:function(){return t.MARKET_HOSE}}),Object.defineProperty(exports,`MARKET_HOSE_ETF`,{enumerable:!0,get:function(){return t.MARKET_HOSE_ETF}}),Object.defineProperty(exports,`MARKET_KRX`,{enumerable:!0,get:function(){return t.MARKET_KRX}}),Object.defineProperty(exports,`MARKET_NXT`,{enumerable:!0,get:function(){return t.MARKET_NXT}}),Object.defineProperty(exports,`MARKET_NYSE`,{enumerable:!0,get:function(){return t.MARKET_NYSE}}),Object.defineProperty(exports,`MARKET_UPBIT_KRW`,{enumerable:!0,get:function(){return t.MARKET_UPBIT_KRW}}),Object.defineProperty(exports,`MARKET_UPCOM`,{enumerable:!0,get:function(){return t.MARKET_UPCOM}}),Object.defineProperty(exports,`MARKET_VN30F`,{enumerable:!0,get:function(){return t.MARKET_VN30F}}),Object.defineProperty(exports,`MAX_ALERT_BARS`,{enumerable:!0,get:function(){return n.MAX_ALERT_BARS}}),exports.MAX_LAYOUT_NAME=e.n,Object.defineProperty(exports,`MIN_ALERT_BARS`,{enumerable:!0,get:function(){return n.MIN_ALERT_BARS}}),Object.defineProperty(exports,`MS_TIME_THRESHOLD`,{enumerable:!0,get:function(){return t.MS_TIME_THRESHOLD}}),Object.defineProperty(exports,`ManualFeed`,{enumerable:!0,get:function(){return n.ManualFeed}}),exports.MatrixChart=P,Object.defineProperty(exports,`MockAdapter`,{enumerable:!0,get:function(){return n.MockAdapter}}),Object.defineProperty(exports,`NXT_SESSIONS`,{enumerable:!0,get:function(){return t.NXT_SESSIONS}}),exports.PLUGIN_API_VERSION=e.v,Object.defineProperty(exports,`PRICE_SOURCES`,{enumerable:!0,get:function(){return t.PRICE_SOURCES}}),Object.defineProperty(exports,`PaperExecutionAdapter`,{enumerable:!0,get:function(){return n.PaperExecutionAdapter}}),exports.PerformanceDashboard=G,exports.PluginManager=e.p,Object.defineProperty(exports,`PollingAdapter`,{enumerable:!0,get:function(){return n.PollingAdapter}}),Object.defineProperty(exports,`RANGE_PRESETS`,{enumerable:!0,get:function(){return n.RANGE_PRESETS}}),Object.defineProperty(exports,`ReconnectManager`,{enumerable:!0,get:function(){return n.ReconnectManager}}),Object.defineProperty(exports,`ReplayController`,{enumerable:!0,get:function(){return n.ReplayController}}),Object.defineProperty(exports,`ReplayManager`,{enumerable:!0,get:function(){return n.ReplayManager}}),Object.defineProperty(exports,`ResamplingAdapter`,{enumerable:!0,get:function(){return n.ResamplingAdapter}}),Object.defineProperty(exports,`ReshapeMemo`,{enumerable:!0,get:function(){return n.ReshapeMemo}}),Object.defineProperty(exports,`SANS_FONT_FAMILY`,{enumerable:!0,get:function(){return t.SANS_FONT_FAMILY}}),exports.ScatterChart=A,Object.defineProperty(exports,`Screenshot`,{enumerable:!0,get:function(){return n.Screenshot}}),Object.defineProperty(exports,`SessionBreaks`,{enumerable:!0,get:function(){return n.SessionBreaks}}),Object.defineProperty(exports,`SessionShading`,{enumerable:!0,get:function(){return n.SessionShading}}),Object.defineProperty(exports,`SignalMarkerManager`,{enumerable:!0,get:function(){return n.SignalMarkerManager}}),exports.SparklineChart=y,Object.defineProperty(exports,`StreamManager`,{enumerable:!0,get:function(){return n.StreamManager}}),Object.defineProperty(exports,`TC_PALETTE`,{enumerable:!0,get:function(){return t.TC_PALETTE}}),Object.defineProperty(exports,`TC_SERIES_COLORS`,{enumerable:!0,get:function(){return t.TC_SERIES_COLORS}}),Object.defineProperty(exports,`TIMEFRAMES_CRYPTO`,{enumerable:!0,get:function(){return t.TIMEFRAMES_CRYPTO}}),Object.defineProperty(exports,`TIMEFRAMES_FOREX`,{enumerable:!0,get:function(){return t.TIMEFRAMES_FOREX}}),Object.defineProperty(exports,`TIMEFRAMES_STOCK`,{enumerable:!0,get:function(){return t.TIMEFRAMES_STOCK}}),exports.ThemeManager=e.S,Object.defineProperty(exports,`TickAggregator`,{enumerable:!0,get:function(){return n.TickAggregator}}),Object.defineProperty(exports,`TickBarAdapter`,{enumerable:!0,get:function(){return n.TickBarAdapter}}),Object.defineProperty(exports,`TickBarBuilder`,{enumerable:!0,get:function(){return n.TickBarBuilder}}),Object.defineProperty(exports,`TradeZoneManager`,{enumerable:!0,get:function(){return n.TradeZoneManager}}),Object.defineProperty(exports,`UPCOM_SESSIONS`,{enumerable:!0,get:function(){return t.UPCOM_SESSIONS}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`UpbitAdapter`,{enumerable:!0,get:function(){return n.UpbitAdapter}}),Object.defineProperty(exports,`VN30F_SESSIONS`,{enumerable:!0,get:function(){return t.VN30F_SESSIONS}}),Object.defineProperty(exports,`VN_COLORS`,{enumerable:!0,get:function(){return t.VN_COLORS}}),Object.defineProperty(exports,`VOLUME_ALPHA`,{enumerable:!0,get:function(){return t.VOLUME_ALPHA}}),Object.defineProperty(exports,`VolumeRenderer`,{enumerable:!0,get:function(){return n.VolumeRenderer}}),exports.WaterfallChart=C,Object.defineProperty(exports,`Watermark`,{enumerable:!0,get:function(){return n.Watermark}}),Object.defineProperty(exports,`WebSocketAdapter`,{enumerable:!0,get:function(){return n.WebSocketAdapter}}),Object.defineProperty(exports,`adapterFromFeed`,{enumerable:!0,get:function(){return n.adapterFromFeed}}),Object.defineProperty(exports,`axisTimes`,{enumerable:!0,get:function(){return n.axisTimes}}),Object.defineProperty(exports,`barIndexToX`,{enumerable:!0,get:function(){return n.barIndexToX}}),Object.defineProperty(exports,`barTimeUnit`,{enumerable:!0,get:function(){return t.barTimeUnit}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.m,exports.computeDrawdownCurve=R,exports.computeMonthlyReturns=z,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`contrastRatio`,{enumerable:!0,get:function(){return t.contrastRatio}}),Object.defineProperty(exports,`correlationMatrix`,{enumerable:!0,get:function(){return n.correlationMatrix}}),Object.defineProperty(exports,`counterClockPhase`,{enumerable:!0,get:function(){return n.counterClockPhase}}),Object.defineProperty(exports,`counterClockPoints`,{enumerable:!0,get:function(){return n.counterClockPoints}}),Object.defineProperty(exports,`createMarketTheme`,{enumerable:!0,get:function(){return t.createMarketTheme}}),Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`detectCandlePatterns`,{enumerable:!0,get:function(){return n.detectCandlePatterns}}),exports.feedBars=h,Object.defineProperty(exports,`feedFromAdapter`,{enumerable:!0,get:function(){return n.feedFromAdapter}}),Object.defineProperty(exports,`formatFraction`,{enumerable:!0,get:function(){return t.formatFraction}}),Object.defineProperty(exports,`formatNumber`,{enumerable:!0,get:function(){return t.formatNumber}}),Object.defineProperty(exports,`formatTooltipTime`,{enumerable:!0,get:function(){return n.formatTooltipTime}}),Object.defineProperty(exports,`formatVND`,{enumerable:!0,get:function(){return t.formatVND}}),Object.defineProperty(exports,`formatVolumeLoc`,{enumerable:!0,get:function(){return t.formatVolumeLoc}}),Object.defineProperty(exports,`fractionTick`,{enumerable:!0,get:function(){return t.fractionTick}}),Object.defineProperty(exports,`getCurrentSession`,{enumerable:!0,get:function(){return t.getCurrentSession}}),exports.getGlobalPlugins=e.h,Object.defineProperty(exports,`getLocale`,{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(exports,`histogramBins`,{enumerable:!0,get:function(){return n.histogramBins}}),Object.defineProperty(exports,`indicatorCategory`,{enumerable:!0,get:function(){return n.indicatorCategory}}),Object.defineProperty(exports,`indicatorSource`,{enumerable:!0,get:function(){return t.indicatorSource}}),Object.defineProperty(exports,`inkOn`,{enumerable:!0,get:function(){return t.inkOn}}),Object.defineProperty(exports,`isDataFeed`,{enumerable:!0,get:function(){return n.isDataFeed}}),Object.defineProperty(exports,`isPriceLevelAlert`,{enumerable:!0,get:function(){return n.isPriceLevelAlert}}),Object.defineProperty(exports,`isPriceSource`,{enumerable:!0,get:function(){return t.isPriceSource}}),Object.defineProperty(exports,`isTimeFrame`,{enumerable:!0,get:function(){return t.isTimeFrame}}),Object.defineProperty(exports,`isValidTimeZone`,{enumerable:!0,get:function(){return t.isValidTimeZone}}),exports.localStorageLayouts=e.i,Object.defineProperty(exports,`lttbDownsample`,{enumerable:!0,get:function(){return n.lttbDownsample}}),Object.defineProperty(exports,`lttbVisibleIndices`,{enumerable:!0,get:function(){return n.lttbVisibleIndices}}),Object.defineProperty(exports,`marketStatus`,{enumerable:!0,get:function(){return t.marketStatus}}),exports.memoryLayouts=e.a,Object.defineProperty(exports,`niceScale`,{enumerable:!0,get:function(){return n.niceScale}}),Object.defineProperty(exports,`normalizeBar`,{enumerable:!0,get:function(){return t.normalizeBar}}),Object.defineProperty(exports,`normalizeBarTime`,{enumerable:!0,get:function(){return t.normalizeBarTime}}),Object.defineProperty(exports,`offsetAt`,{enumerable:!0,get:function(){return t.offsetAt}}),exports.overlayScale=g,exports.overlaysForLayer=e.y,Object.defineProperty(exports,`parseIndicatorSource`,{enumerable:!0,get:function(){return t.parseIndicatorSource}}),exports.parseOHLCV=e.s,Object.defineProperty(exports,`parseTimeframe`,{enumerable:!0,get:function(){return t.parseTimeframe}}),Object.defineProperty(exports,`pickBaseTimeframe`,{enumerable:!0,get:function(){return t.pickBaseTimeframe}}),exports.pluginKey=e.b,Object.defineProperty(exports,`priceFormatterFor`,{enumerable:!0,get:function(){return t.priceFormatterFor}}),Object.defineProperty(exports,`priceStepAt`,{enumerable:!0,get:function(){return t.priceStepAt}}),Object.defineProperty(exports,`priceToY`,{enumerable:!0,get:function(){return n.priceToY}}),Object.defineProperty(exports,`priceToYMapper`,{enumerable:!0,get:function(){return n.priceToYMapper}}),Object.defineProperty(exports,`rangePresetStart`,{enumerable:!0,get:function(){return n.rangePresetStart}}),Object.defineProperty(exports,`rankSymbols`,{enumerable:!0,get:function(){return t.rankSymbols}}),Object.defineProperty(exports,`readNews`,{enumerable:!0,get:function(){return t.readNews}}),Object.defineProperty(exports,`readQuote`,{enumerable:!0,get:function(){return t.readQuote}}),Object.defineProperty(exports,`readableOn`,{enumerable:!0,get:function(){return t.readableOn}}),Object.defineProperty(exports,`registerLocale`,{enumerable:!0,get:function(){return t.registerLocale}}),exports.registerPlugin=e.g,Object.defineProperty(exports,`resampleBars`,{enumerable:!0,get:function(){return t.resampleBars}}),Object.defineProperty(exports,`roundToPriceStep`,{enumerable:!0,get:function(){return t.roundToPriceStep}}),Object.defineProperty(exports,`scaleMarketPrices`,{enumerable:!0,get:function(){return t.scaleMarketPrices}}),exports.selectKeyStats=U,Object.defineProperty(exports,`servesTimeframe`,{enumerable:!0,get:function(){return n.servesTimeframe}}),Object.defineProperty(exports,`setLocale`,{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(exports,`setMaxWebGLCharts`,{enumerable:!0,get:function(){return n.setMaxWebGLCharts}}),Object.defineProperty(exports,`sourcePrice`,{enumerable:!0,get:function(){return t.sourcePrice}}),Object.defineProperty(exports,`stepDecimals`,{enumerable:!0,get:function(){return t.stepDecimals}}),Object.defineProperty(exports,`symbolTimeZone`,{enumerable:!0,get:function(){return t.symbolTimeZone}}),exports.syncIndicators=i,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`tickBarCount`,{enumerable:!0,get:function(){return t.tickBarCount}}),Object.defineProperty(exports,`timeToX`,{enumerable:!0,get:function(){return n.timeToX}}),Object.defineProperty(exports,`timeframeBucketStart`,{enumerable:!0,get:function(){return t.timeframeBucketStart}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),Object.defineProperty(exports,`timestampToBarIndex`,{enumerable:!0,get:function(){return n.timestampToBarIndex}}),exports.toEquityPoints=L,Object.defineProperty(exports,`toHeikinAshi`,{enumerable:!0,get:function(){return n.toHeikinAshi}}),Object.defineProperty(exports,`toKagi`,{enumerable:!0,get:function(){return n.toKagi}}),Object.defineProperty(exports,`toLineBreak`,{enumerable:!0,get:function(){return n.toLineBreak}}),Object.defineProperty(exports,`toPointAndFigure`,{enumerable:!0,get:function(){return n.toPointAndFigure}}),Object.defineProperty(exports,`toRangeBars`,{enumerable:!0,get:function(){return n.toRangeBars}}),Object.defineProperty(exports,`toRenko`,{enumerable:!0,get:function(){return n.toRenko}}),exports.unregisterPlugin=e._,Object.defineProperty(exports,`usesKoreanUnits`,{enumerable:!0,get:function(){return t.usesKoreanUnits}}),Object.defineProperty(exports,`vn30fContracts`,{enumerable:!0,get:function(){return t.vn30fContracts}}),Object.defineProperty(exports,`vn30fLastTradingDay`,{enumerable:!0,get:function(){return t.vn30fLastTradingDay}}),Object.defineProperty(exports,`volumeColor`,{enumerable:!0,get:function(){return t.volumeColor}}),Object.defineProperty(exports,`wallToUtc`,{enumerable:!0,get:function(){return t.wallToUtc}}),Object.defineProperty(exports,`withResampling`,{enumerable:!0,get:function(){return n.withResampling}}),Object.defineProperty(exports,`withTickBars`,{enumerable:!0,get:function(){return n.withTickBars}}),Object.defineProperty(exports,`xToBarIndex`,{enumerable:!0,get:function(){return n.xToBarIndex}}),Object.defineProperty(exports,`xToTime`,{enumerable:!0,get:function(){return n.xToTime}}),Object.defineProperty(exports,`yToPrice`,{enumerable:!0,get:function(){return n.yToPrice}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-D7S6GZgJ.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);function r(e){let{id:t,params:n={},position:r=null}=typeof e==`string`?{id:e}:e;return JSON.stringify([t,Object.keys(n).sort().map(e=>[e,n[e]]),r])}function i(e,t,n){let i=new Map,a=t.map(e=>{let t=r(e),n=i.get(t)??0;return i.set(t,n+1),{spec:e,key:`${t}#${n}`}}),o=new Set(a.map(e=>e.key));for(let[t,r]of[...n])o.has(t)||(e.removeIndicator(r),n.delete(t));for(let{spec:t,key:r}of a){if(n.has(r))continue;let i=typeof t==`string`?e.addIndicator(t):t.position===void 0?e.addIndicator(t.id,t.params??{}):e.addIndicator(t.id,t.params??{},t.position);i&&n.set(r,i)}}var a=3,o=e=>({time:e.time,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}),s=e=>e.length>0?e[e.length-1]:null;function c(t,n,r){for(let i=0;i<r;i++)if(!e.D(t[i],n[i]))return!1;return!0}function l(e,t){if(e.isReplayActive())return!0;let n=s(e.getData());return t.inReplay?n?.time===t.last?.time:n===t.shownBar?n?.time===t.last?.time||!e.isExtendedHoursVisible():!1}function u(t,n,r){let i=[];for(let a=0;a<n.length;a++){let s=t[r+a];if(!e.D(s,n[a])){if(s.time!==n[a].time||!e.E(s))return null;i.push(o(s))}}return i}function d(e,t){if(t.length===0)return!0;if(!e.updateBar)return!1;for(let n of t)if(!e.updateBar(n))return!1;return!0}function f(e){return e.slice(Math.max(1,e.length-1-3),-1).map(o)}function p(t,n){let r=[];for(let i=n;i<t.length;i++){if(!e.E(t[i])||!(t[i].time>t[i-1].time))return null;r.push(o(t[i]))}return r}function m(t,n,r){let i=r.length;if(i===0||!r.last||!e.E(r.last)||n.length<i||!l(t,r))return!1;let a=r.recent??[],s=i-1-a.length;if(n!==r.source&&(r.source.length!==i||!c(r.source,n,s)))return!1;let f=n[i-1];if(f.time!==r.last.time||!e.E(f))return!1;let m=u(n,a,s),h=p(n,i);return!m||!h||!d(t,m)?!1:(e.D(f,r.last)||t.updateLastBar(o(f)),h.length===1?t.appendBar(h[0]):h.length>1&&t.appendBars(h),!0)}function h(e,t,n){(!n||!m(e,t,n))&&e.setData(t.map(o));let r=t.length>0?o(t[t.length-1]):null,i=e.isReplayActive();return{source:t,length:t.length,last:r,recent:f(t),shownBar:i?null:s(e.getData()),inReplay:i}}function g(e){let{viewport:t,data:r}=e,i=(0,n.priceToYMapper)(t),a=r.length-1,o=Math.max(0,Math.floor(t.visibleRange.from)),s=Math.min(a,Math.ceil(t.visibleRange.to)),c=e=>r.length>0?(0,n.timestampToBarIndex)(e,r):e;return{timeToX:e=>(0,n.barIndexToX)(c(e),t),xToTime:e=>{let i=(0,n.xToBarIndex)(e,t);return r.length>0?(0,n.barIndexToTime)(i,r):i},indexToX:e=>(0,n.barIndexToX)(e,t),xToIndex:e=>(0,n.xToBarIndex)(e,t),priceToY:i,yToPrice:e=>(0,n.yToPrice)(e,t),barWidth:t.barWidth,visible:s<o?{from:0,to:-1}:{from:o,to:s}}}var _={"1x1":{cols:1,rows:1},"1x2":{cols:2,rows:1},"2x1":{cols:1,rows:2},"2x2":{cols:2,rows:2},"1x3":{cols:3,rows:1},"3x1":{cols:1,rows:3},"2x3":{cols:3,rows:2},"3x2":{cols:2,rows:3}},v=class{root;cells=[];layout;options;destroyed=!1;syncing=!1;constructor(e,t={}){this.options=t,this.layout=t.layout??`2x2`,this.root=document.createElement(`div`),this.root.style.cssText=`display:grid;width:100%;height:100%;overflow:hidden;`,e.appendChild(this.root),this.applyLayout(),this.createCells()}applyLayout(){let{cols:e,rows:t}=_[this.layout],n=this.options.gap??1;this.root.style.gridTemplateColumns=`repeat(${e}, 1fr)`,this.root.style.gridTemplateRows=`repeat(${t}, 1fr)`,this.root.style.gap=`${n}px`}createCells(){let{cols:e,rows:t}=_[this.layout],n=e*t;for(let e=0;e<n;e++)this.cells.push(this.createCell(e))}createCell(t){let n=this.options.cells?.[t]??{},r=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden;min-width:0;min-height:0;`,this.root.appendChild(r);let i=new e.c(r,{chartType:`candlestick`,autoScale:!0,features:{crosshair:!0,keyboard:!0,volume:!0,legend:!0,priceAxis:!0,timeAxis:!0,grid:!0},...this.options.chartOptions,...n.chartOptions,theme:this.options.theme}),a={container:r,chart:i,symbol:n.symbol??`Chart ${t+1}`,timeframe:n.timeframe??`5m`};return this.options.syncCrosshair!==!1&&(i.on(`crosshairMove`,e=>{let t=e.payload.bar?.time;if(t!==void 0)for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(t)}),i.on(`crosshairLeave`,()=>{for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(null)})),this.options.syncTimeAxis!==!1&&i.on(`visibleRangeChange`,e=>{if(this.syncing)return;this.syncing=!0;let{from:t,to:n}=e.payload,r=i.getData();if(r.length>0&&t>=0&&n<r.length){let e=r[t]?.time,a=r[n]?.time;if(e&&a)for(let t of this.cells)t.chart!==i&&t.chart.setVisibleRange(e,a)}this.syncing=!1}),a}setLayout(e){if(e===this.layout)return;let t=this.cells.length,{cols:n,rows:r}=_[e],i=n*r;if(i<t)for(let e=t-1;e>=i;e--){let t=this.cells[e];t.chart.destroy(),t.container.remove(),this.cells.pop()}this.layout=e,this.applyLayout();for(let e=t;e<i;e++)this.cells.push(this.createCell(e))}getChart(e){return this.cells[e]?.chart??null}getCharts(){return this.cells.map(e=>e.chart)}getCellCount(){return this.cells.length}setData(e,t){this.cells[e]?.chart.setData(t)}setAllData(e){for(let t of this.cells)t.chart.setData(e)}async connectCell(e,t){let n=this.cells[e];n&&(n.symbol=t.symbol,n.timeframe=t.timeframe,await n.chart.connect(t))}async connectAll(e,t,r,i=500){let a=[];for(let o=0;o<this.cells.length&&o<t.length;o++)a.push(this.connectCell(o,{...typeof e==`function`?{adapter:e(t[o],o)}:(0,n.isDataFeed)(e)?{feed:e}:{adapter:e},symbol:t[o],timeframe:r,historyLimit:i}));await Promise.all(a)}setTheme(e){for(let t of this.cells)t.chart.setTheme(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(let e of this.cells)e.chart.destroy(),e.container.remove();this.cells=[],this.root.remove()}}},y=class extends n.BaseFinanceChart{options;constructor(e,t){super(e,t.theme),this.options=t,this.requestRender()}renderChart(e,t,r,i){(0,n.renderSparkline)(e,t,r,this.options,i)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}},b=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderDepthChart)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},x=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderEquityCurve)(e,t,r,this.options,i,a)}update(e,t){this.options={...this.options,data:e},t!==void 0&&(this.options={...this.options,benchmark:t}),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},S=class extends n.BaseFinanceChart{options;crosshair=null;cachedRects=[];cachedGroups=[];currentData=[];lastLayoutWidth=0;lastLayoutHeight=0;handleClick=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentData=t.data??[],t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),t.onCellClick&&(this.handleClick=e=>{let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;this.onCanvasClick(n,r)},this.canvas.addEventListener(`click`,this.handleClick)),this.applyLabel(),this.recomputeLayout(),this.requestRender()}applyLabel(){let e=new Set(this.currentData.map(e=>e.group).filter(Boolean)).size,t=this.options.grouped&&e>0?`Market map of ${this.currentData.length} cells in ${e} groups`:`Heatmap of ${this.currentData.length} cells`;this.setLabel(this.options.ariaLabel??t)}recomputeLayout(){let e={x:0,y:0,width:this.width,height:this.height},t=this.options.cellPadding??2;if(this.lastLayoutWidth=this.width,this.lastLayoutHeight=this.height,this.cachedGroups=[],this.options.grouped){let{groups:r,cells:i}=(0,n.layoutGroupedTreemap)(this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1),group:e.group,value:e.value})),e,t,n.GROUP_HEADER);this.cachedRects=i,this.cachedGroups=r}else if(this.options.weighted){let r=this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1)}));this.cachedRects=(0,n.layoutSquarifiedTreemap)(r,e,t)}else this.cachedRects=(0,n.layoutUniformGrid)(this.currentData.map(e=>({id:e.id})),e,t)}onCanvasClick(e,t){if(this.options.onCellClick)for(let n of this.cachedRects){let r=n.rect;if(e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height){let e=this.currentData.find(e=>e.id===n.id);e&&this.options.onCellClick(e);return}}}renderChart(e,t,r,i){(t!==this.lastLayoutWidth||r!==this.lastLayoutHeight)&&this.recomputeLayout();let a=this.crosshair?.getPosition()??null;(0,n.renderHeatmap)(e,t,r,this.currentData,this.cachedRects,this.options,i,a,this.cachedGroups)}update(e){this.currentData=e,this.options={...this.options,data:e},this.applyLabel(),this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},e.data&&(this.currentData=e.data),this.applyLabel(),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair?.destroy(),this.handleClick&&this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},C=class extends n.BaseFinanceChart{options;crosshair=null;constructor(e,t){super(e,t.theme),this.options=t,t.crosshair!==!1&&(this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender())),this.requestRender()}renderChart(e,t,r,i){let a=this.crosshair?.getPosition()??null;(0,n.renderWaterfall)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.requestRender()}destroy(){this.crosshair?.destroy(),super.destroy()}},w=500;function T(e){let t=1-e;return 1-t*t*t}var E=class extends n.BaseFinanceChart{options;currentValue;targetValue;animationStart=null;animationFrom=0;animationFrameId=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentValue=t.value,this.targetValue=t.value,this.requestRender()}renderChart(e,t,r,i){(0,n.renderGauge)(e,t,r,this.options,i,this.currentValue)}setValue(e){if(this.options.animate===!1){this.cancelAnimation(),this.currentValue=e,this.targetValue=e,this.options={...this.options,value:e},this.requestRender();return}this.targetValue=e,this.animationFrom=this.currentValue,this.animationStart=performance.now(),this.options={...this.options,value:e},this.startAnimationLoop()}setOptions(e){let t={...this.options,...e};if(e.value!==void 0&&e.value!==this.targetValue){this.options=t,this.setValue(e.value);return}this.options=t,this.requestRender()}startAnimationLoop(){if(this.animationFrameId!==null)return;let e=()=>{if(this.animationFrameId=null,this.animationStart===null)return;let t=this.options.animationDuration??w,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=T(r);this.currentValue=this.animationFrom+(this.targetValue-this.animationFrom)*i,this.requestRender(),r<1?this.animationFrameId=requestAnimationFrame(e):(this.currentValue=this.targetValue,this.animationStart=null)};this.animationFrameId=requestAnimationFrame(e)}cancelAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.animationStart=null}destroy(){this.cancelAnimation(),super.destroy()}},D=class extends n.BaseFinanceChart{options;layout=null;layoutFor=null;crosshair;onClick=e=>{let t=this.canvas.getBoundingClientRect();this.layout&&this.clickAt(this.layout,e.clientX-t.left,e.clientY-t.top)};onMove=e=>{if(!this.layout||!this.clickable())return;let t=this.canvas.getBoundingClientRect();this.canvas.style.cursor=this.hits(this.layout,e.clientX-t.left,e.clientY-t.top)?`pointer`:``};constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender()),this.canvas.addEventListener(`click`,this.onClick),this.canvas.addEventListener(`pointermove`,this.onMove),this.applyLabel(),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition(),o=this.layoutFor;(!this.layout||!o||o.options!==this.options||o.width!==t||o.height!==r||o.theme!==i)&&(this.layout=this.compute(t,r,i,(0,n.canvasMeasure)(e,i)),this.layoutFor={options:this.options,width:t,height:r,theme:i}),this.draw(e,t,r,i,a,this.layout)}setOptions(e){this.options={...this.options,...e},`theme`in e&&this.setTheme(e.theme??`dark`),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??this.describe())}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.onClick),this.canvas.removeEventListener(`pointermove`,this.onMove),super.destroy()}},O=class extends D{compute(e,t,r,i){return(0,n.computeBarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderBarChart)(e,t,r,this.options,i,a,o)}describe(){return`Bar chart of ${this.options.series.map(e=>e.name).join(`, `)}, ${this.options.categories.length} categories`}clickable(){return this.options.onBarClick!==void 0}hits(e,t,r){return(0,n.hitBar)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitBar)(e,t,r);i&&this.options.onBarClick?.({category:i.category,series:i.series,value:i.value,index:i.index})}update(e,t){this.setOptions({categories:e,series:t})}},k=class extends D{compute(e,t,r,i){return(0,n.computeDonutLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderDonut)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.filter(e=>Number.isFinite(e.value)&&e.value>0).map(e=>e.label).join(`, `);return`${(this.options.innerRadius??.6)>0?`Donut`:`Pie`} chart of ${e}`}clickable(){return this.options.onSliceClick!==void 0}hits(e,t,r){return(0,n.hitSlice)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitSlice)(e,t,r);i&&this.options.onSliceClick?.(i.slice)}update(e){this.setOptions({data:e})}},A=class extends D{compute(e,t,r,i){return(0,n.computeScatterLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderScatter)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.series.reduce((e,t)=>e+t.points.length,0);return`Scatter chart${this.options.xLabel&&this.options.yLabel?` of ${this.options.yLabel} against ${this.options.xLabel}`:``}, ${e} points`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestPoint)(e,t,r);i&&this.options.onPointClick?.(i.point,i.series)}update(e){this.setOptions({series:e})}},j=class extends D{compute(e,t,r,i){return(0,n.computeHistogramLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderHistogram)(e,t,r,this.options,i,a,o)}describe(){return`Histogram of ${this.options.values.length} values`}clickable(){return!1}hits(){return!1}clickAt(){}update(e){this.setOptions({values:e})}},M=class extends D{compute(e,t,r,i){return(0,n.computeCalendarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCalendar)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.map(e=>e.date).filter(e=>/^\d{4}-\d{2}-\d{2}$/.test(e)).sort(),t=this.options.from??e[0],n=this.options.to??e[e.length-1];return t&&n?`Calendar of daily values from ${t} to ${n}`:`Calendar of daily values`}clickable(){return this.options.onDayClick!==void 0}hits(e,t,r){return(0,n.hitDay)(e,t,r)?.day!==void 0}clickAt(e,t,r){let i=(0,n.hitDay)(e,t,r)?.day;i&&this.options.onDayClick?.(i)}update(e){this.setOptions({data:e})}},N=12,P=class extends D{compute(e,t,r,i){return(0,n.computeMatrixLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderMatrix)(e,t,r,this.options,i,a,o)}describe(){let{rows:e,columns:t}=this.options;return t?e.length+t.length<=N?`Matrix of ${e.join(`, `)} by ${t.join(`, `)}`:`Matrix of ${e.length} rows by ${t.length} columns`:e.length<=N?`Matrix of ${e.join(`, `)}`:`Matrix of ${e.length} rows`}clickable(){return this.options.onCellClick!==void 0}hits(e,t,r){return(0,n.hitMatrixCell)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitMatrixCell)(e,t,r);i&&this.options.onCellClick?.(i.cell)}update(e){this.setOptions({values:e})}},F=class extends D{compute(e,t,r,i){return(0,n.computeCounterClockLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCounterClock)(e,t,r,this.options,i,a,o)}describe(){return`Counter-clock chart of price against volume, ${this.options.period??25}-bar averages`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestCounterClockPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestCounterClockPoint)(e,t,r);i&&this.options.onPointClick?.(i.point)}getPhase(){return(0,n.counterClockPhase)((0,n.counterClockPoints)(this.options.data,this.options.period??25,(0,n.shownCount)(this.options)))}update(e){this.setOptions({data:e})}},I=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function L(e){return e.map(e=>({time:e.time,value:e.equity}))}function R(e){let t=-1/0;return e.map(e=>{e.equity>t&&(t=e.equity);let n=t>0?(e.equity/t-1)*100:0;return{time:e.time,value:n}})}function z(e){if(e.length===0)return[];let n=[];for(let r of e){let e=(0,t.timeframeBucketStart)(r.time,`1M`),i=n[n.length-1];i&&i.key===e?i.close=r.equity:n.push({key:e,close:r.equity})}let r=e[0].equity,i=[];for(let e of n){let t=r===0?1:r,n=(e.close/t-1)*100;r=e.close;let a=new Date(e.key),o=a.getUTCFullYear(),s=a.getUTCMonth();i.push({id:`${o}-${String(s+1).padStart(2,`0`)}`,label:I[s],group:String(o),value:n})}return i}var B=100;function V(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function H(e){return e>0?`positive`:e<0?`negative`:`neutral`}function U(e){return[{label:`Total Return`,value:V(e.totalReturnPct*B),tone:H(e.totalReturnPct)},{label:`CAGR`,value:V(e.cagr*B),tone:H(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:H(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:H(e.sortino)},{label:`Max Drawdown`,value:V(-Math.abs(e.maxDrawdownPct)*B),tone:`negative`},{label:`Win Rate`,value:`${(e.winRate*B).toFixed(1)}%`,tone:`neutral`},{label:`Profit Factor`,value:Number.isFinite(e.profitFactor)?e.profitFactor.toFixed(2):`∞`,tone:H(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function W(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var G=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=W(t.theme),this.root=document.createElement(`div`),this.build(),e.appendChild(this.root)}build(){let e=this.theme,{result:t,title:n,subtitle:r}=this.options,i=this.panelBackground(),a=e.grid;if(this.root.style.cssText=[`display:flex`,`flex-direction:column`,`gap:14px`,`width:100%`,`box-sizing:border-box`,`padding:16px`,`background:${e.background}`,`color:${e.text}`,`font-family:${e.font.family}`].join(`;`),n||r){let t=document.createElement(`div`);if(n){let r=document.createElement(`div`);r.textContent=n,r.style.cssText=`font-size:${e.font.sizeLarge}px;font-weight:600;letter-spacing:-0.01em;`,t.appendChild(r)}if(r){let n=document.createElement(`div`);n.textContent=r,n.style.cssText=`font-size:${e.font.sizeSmall}px;color:${e.textSecondary};margin-top:2px;`,t.appendChild(n)}this.root.appendChild(t)}this.root.appendChild(this.buildStatsStrip(U(t.metrics),i,a));let o=document.createElement(`div`);o.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))`,`grid-auto-rows:220px`,`gap:14px`].join(`;`),this.root.appendChild(o);let s=this.buildPanel(`Equity Curve`,i,a);s.wrap.style.gridColumn=`1 / -1`,o.appendChild(s.wrap),this.equityChart=new x(s.body,{data:L(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let c=this.buildPanel(`Drawdown`,i,a);o.appendChild(c.wrap),this.drawdownChart=new x(c.body,{data:R(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let l=z(t.equityCurve),u=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(u.wrap),this.heatmap=new S(u.body,{data:l,theme:e,showValues:!0,valueFormat:e=>`${e>=0?`+`:``}${e.toFixed(1)}`,colorScale:{negative:e.candleDown,zero:i,positive:e.candleUp}})}buildStatsStrip(e,t,n){let r=document.createElement(`div`);r.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))`,`gap:10px`].join(`;`);let i=this.theme;for(let a of e){let e=document.createElement(`div`);e.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`padding:10px 12px`,`display:flex`,`flex-direction:column`,`gap:4px`].join(`;`);let o=document.createElement(`div`);o.textContent=a.label,o.style.cssText=`font-size:${i.font.sizeSmall}px;color:${i.textSecondary};text-transform:uppercase;letter-spacing:0.04em;`;let s=document.createElement(`div`);s.textContent=a.value;let c=a.tone===`positive`?i.candleUp:a.tone===`negative`?i.candleDown:i.text;s.style.cssText=`font-size:${i.font.sizeLarge}px;font-weight:600;color:${c};font-variant-numeric:tabular-nums;`,e.appendChild(o),e.appendChild(s),r.appendChild(e)}return r}buildPanel(e,t,n){let r=this.theme,i=document.createElement(`div`);i.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`overflow:hidden`,`display:flex`,`flex-direction:column`].join(`;`);let a=document.createElement(`div`);a.textContent=e,a.style.cssText=[`font-size:${r.font.sizeSmall}px`,`font-weight:600`,`color:${r.textSecondary}`,`padding:8px 12px`,`border-bottom:1px solid ${n}`,`text-transform:uppercase`,`letter-spacing:0.04em`].join(`;`);let o=document.createElement(`div`);return o.style.cssText=`flex:1;min-height:0;position:relative;`,i.appendChild(a),i.appendChild(o),{wrap:i,body:o}}panelBackground(){return this.theme.name===`light`?`rgba(0,0,0,0.02)`:`rgba(255,255,255,0.03)`}update(e){this.options={...this.options,result:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}setTheme(e){this.theme=W(e),this.options={...this.options,theme:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}destroyCharts(){this.equityChart?.destroy(),this.drawdownChart?.destroy(),this.heatmap?.destroy(),this.equityChart=null,this.drawdownChart=null,this.heatmap=null}destroy(){this.destroyCharts(),this.root.remove()}};Object.defineProperty(exports,`AlertManager`,{enumerable:!0,get:function(){return n.AlertManager}}),Object.defineProperty(exports,`Animator`,{enumerable:!0,get:function(){return n.Animator}}),exports.BarChart=O,Object.defineProperty(exports,`BarCountdown`,{enumerable:!0,get:function(){return n.BarCountdown}}),Object.defineProperty(exports,`BinanceAdapter`,{enumerable:!0,get:function(){return n.BinanceAdapter}}),Object.defineProperty(exports,`BybitAdapter`,{enumerable:!0,get:function(){return n.BybitAdapter}}),Object.defineProperty(exports,`CANDLE_PATTERNS`,{enumerable:!0,get:function(){return n.CANDLE_PATTERNS}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.CORRECTABLE_BARS=a,exports.CalendarChart=M,exports.Chart=e.c,exports.ChartGrid=v,Object.defineProperty(exports,`ChartLegend`,{enumerable:!0,get:function(){return n.ChartLegend}}),Object.defineProperty(exports,`ChartStateManager`,{enumerable:!0,get:function(){return n.ChartStateManager}}),Object.defineProperty(exports,`CoinbaseAdapter`,{enumerable:!0,get:function(){return n.CoinbaseAdapter}}),Object.defineProperty(exports,`CompareRenderer`,{enumerable:!0,get:function(){return n.CompareRenderer}}),exports.CounterClockChart=F,Object.defineProperty(exports,`CrosshairTooltip`,{enumerable:!0,get:function(){return n.CrosshairTooltip}}),Object.defineProperty(exports,`CurrentPriceLine`,{enumerable:!0,get:function(){return n.CurrentPriceLine}}),Object.defineProperty(exports,`DARK_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.DARK_PRICE_LIMITS}}),Object.defineProperty(exports,`DARK_TERMINAL`,{enumerable:!0,get:function(){return t.DARK_TERMINAL}}),Object.defineProperty(exports,`DARK_THEME`,{enumerable:!0,get:function(){return t.DARK_THEME}}),Object.defineProperty(exports,`DEFAULT_DRAWING_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_DRAWING_STYLE}}),Object.defineProperty(exports,`DEFAULT_FONT_FAMILY`,{enumerable:!0,get:function(){return t.DEFAULT_FONT_FAMILY}}),exports.DEFAULT_HISTORY_PAGE_SIZE=e.C,Object.defineProperty(exports,`DEFAULT_LEGEND_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_LEGEND_CONFIG}}),Object.defineProperty(exports,`DEFAULT_MAX_WEBGL_CHARTS`,{enumerable:!0,get:function(){return n.DEFAULT_MAX_WEBGL_CHARTS}}),Object.defineProperty(exports,`DEFAULT_RECONNECT`,{enumerable:!0,get:function(){return t.DEFAULT_RECONNECT}}),Object.defineProperty(exports,`DEFAULT_SESSION_HOURS`,{enumerable:!0,get:function(){return n.DEFAULT_SESSION_HOURS}}),Object.defineProperty(exports,`DEFAULT_SIGNAL_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_SIGNAL_STYLE}}),Object.defineProperty(exports,`DEFAULT_STREAM_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_STREAM_CONFIG}}),Object.defineProperty(exports,`DEFAULT_TIMEFRAME_FAVORITES`,{enumerable:!0,get:function(){return t.DEFAULT_TIMEFRAME_FAVORITES}}),Object.defineProperty(exports,`DEFAULT_TRADE_ZONE_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_TRADE_ZONE_STYLE}}),Object.defineProperty(exports,`DEFAULT_TRADING_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_TRADING_CONFIG}}),Object.defineProperty(exports,`DataExporter`,{enumerable:!0,get:function(){return n.DataExporter}}),exports.DataManager=e.T,exports.DepthChart=b,exports.DonutChart=k,exports.DragDropImporter=e.o,Object.defineProperty(exports,`DrawingBase`,{enumerable:!0,get:function(){return n.DrawingBase}}),exports.EXCHANGE_TIMEZONE=e.l,exports.EXCHANGE_TIME_ZONE=e.u,Object.defineProperty(exports,`Easing`,{enumerable:!0,get:function(){return n.Easing}}),exports.EquityCurveChart=x,exports.GaugeChart=E,exports.HISTORY_RETRY_MS=e.w,Object.defineProperty(exports,`HNX_SESSIONS`,{enumerable:!0,get:function(){return t.HNX_SESSIONS}}),Object.defineProperty(exports,`HOSE_SESSIONS`,{enumerable:!0,get:function(){return t.HOSE_SESSIONS}}),exports.HeatmapChart=S,exports.HistogramChart=j,Object.defineProperty(exports,`INDICATOR_CATEGORIES`,{enumerable:!0,get:function(){return n.INDICATOR_CATEGORIES}}),Object.defineProperty(exports,`IndicatorBase`,{enumerable:!0,get:function(){return n.IndicatorBase}}),Object.defineProperty(exports,`IndicatorValueMap`,{enumerable:!0,get:function(){return n.IndicatorValueMap}}),Object.defineProperty(exports,`KEPT_BUCKETS`,{enumerable:!0,get:function(){return n.KEPT_BUCKETS}}),Object.defineProperty(exports,`KRX_SESSIONS`,{enumerable:!0,get:function(){return t.KRX_SESSIONS}}),Object.defineProperty(exports,`KR_COLORS`,{enumerable:!0,get:function(){return t.KR_COLORS}}),Object.defineProperty(exports,`KeyboardHandler`,{enumerable:!0,get:function(){return n.KeyboardHandler}}),Object.defineProperty(exports,`KrakenAdapter`,{enumerable:!0,get:function(){return n.KrakenAdapter}}),Object.defineProperty(exports,`LIGHT_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.LIGHT_PRICE_LIMITS}}),Object.defineProperty(exports,`LIGHT_THEME`,{enumerable:!0,get:function(){return t.LIGHT_THEME}}),exports.LayoutManager=e.x,exports.LayoutSession=e.t,Object.defineProperty(exports,`MARKET_CRYPTO`,{enumerable:!0,get:function(){return t.MARKET_CRYPTO}}),Object.defineProperty(exports,`MARKET_HNX`,{enumerable:!0,get:function(){return t.MARKET_HNX}}),Object.defineProperty(exports,`MARKET_HOSE`,{enumerable:!0,get:function(){return t.MARKET_HOSE}}),Object.defineProperty(exports,`MARKET_HOSE_ETF`,{enumerable:!0,get:function(){return t.MARKET_HOSE_ETF}}),Object.defineProperty(exports,`MARKET_KRX`,{enumerable:!0,get:function(){return t.MARKET_KRX}}),Object.defineProperty(exports,`MARKET_NXT`,{enumerable:!0,get:function(){return t.MARKET_NXT}}),Object.defineProperty(exports,`MARKET_NYSE`,{enumerable:!0,get:function(){return t.MARKET_NYSE}}),Object.defineProperty(exports,`MARKET_UPBIT_KRW`,{enumerable:!0,get:function(){return t.MARKET_UPBIT_KRW}}),Object.defineProperty(exports,`MARKET_UPCOM`,{enumerable:!0,get:function(){return t.MARKET_UPCOM}}),Object.defineProperty(exports,`MARKET_VN30F`,{enumerable:!0,get:function(){return t.MARKET_VN30F}}),Object.defineProperty(exports,`MAX_ALERT_BARS`,{enumerable:!0,get:function(){return n.MAX_ALERT_BARS}}),exports.MAX_LAYOUT_NAME=e.n,Object.defineProperty(exports,`MIN_ALERT_BARS`,{enumerable:!0,get:function(){return n.MIN_ALERT_BARS}}),Object.defineProperty(exports,`MS_TIME_THRESHOLD`,{enumerable:!0,get:function(){return t.MS_TIME_THRESHOLD}}),Object.defineProperty(exports,`ManualFeed`,{enumerable:!0,get:function(){return n.ManualFeed}}),exports.MatrixChart=P,Object.defineProperty(exports,`MockAdapter`,{enumerable:!0,get:function(){return n.MockAdapter}}),Object.defineProperty(exports,`NXT_SESSIONS`,{enumerable:!0,get:function(){return t.NXT_SESSIONS}}),exports.PLUGIN_API_VERSION=e.v,Object.defineProperty(exports,`PRICE_SOURCES`,{enumerable:!0,get:function(){return t.PRICE_SOURCES}}),Object.defineProperty(exports,`PaperExecutionAdapter`,{enumerable:!0,get:function(){return n.PaperExecutionAdapter}}),exports.PerformanceDashboard=G,exports.PluginManager=e.p,Object.defineProperty(exports,`PollingAdapter`,{enumerable:!0,get:function(){return n.PollingAdapter}}),Object.defineProperty(exports,`RANGE_PRESETS`,{enumerable:!0,get:function(){return n.RANGE_PRESETS}}),Object.defineProperty(exports,`ReconnectManager`,{enumerable:!0,get:function(){return n.ReconnectManager}}),Object.defineProperty(exports,`ReplayController`,{enumerable:!0,get:function(){return n.ReplayController}}),Object.defineProperty(exports,`ReplayManager`,{enumerable:!0,get:function(){return n.ReplayManager}}),Object.defineProperty(exports,`ResamplingAdapter`,{enumerable:!0,get:function(){return n.ResamplingAdapter}}),Object.defineProperty(exports,`ReshapeMemo`,{enumerable:!0,get:function(){return n.ReshapeMemo}}),Object.defineProperty(exports,`SANS_FONT_FAMILY`,{enumerable:!0,get:function(){return t.SANS_FONT_FAMILY}}),exports.ScatterChart=A,Object.defineProperty(exports,`Screenshot`,{enumerable:!0,get:function(){return n.Screenshot}}),Object.defineProperty(exports,`SessionBreaks`,{enumerable:!0,get:function(){return n.SessionBreaks}}),Object.defineProperty(exports,`SessionShading`,{enumerable:!0,get:function(){return n.SessionShading}}),Object.defineProperty(exports,`SignalMarkerManager`,{enumerable:!0,get:function(){return n.SignalMarkerManager}}),exports.SparklineChart=y,Object.defineProperty(exports,`StreamManager`,{enumerable:!0,get:function(){return n.StreamManager}}),Object.defineProperty(exports,`TC_PALETTE`,{enumerable:!0,get:function(){return t.TC_PALETTE}}),Object.defineProperty(exports,`TC_SERIES_COLORS`,{enumerable:!0,get:function(){return t.TC_SERIES_COLORS}}),Object.defineProperty(exports,`TIMEFRAMES_CRYPTO`,{enumerable:!0,get:function(){return t.TIMEFRAMES_CRYPTO}}),Object.defineProperty(exports,`TIMEFRAMES_FOREX`,{enumerable:!0,get:function(){return t.TIMEFRAMES_FOREX}}),Object.defineProperty(exports,`TIMEFRAMES_STOCK`,{enumerable:!0,get:function(){return t.TIMEFRAMES_STOCK}}),exports.ThemeManager=e.S,Object.defineProperty(exports,`TickAggregator`,{enumerable:!0,get:function(){return n.TickAggregator}}),Object.defineProperty(exports,`TickBarAdapter`,{enumerable:!0,get:function(){return n.TickBarAdapter}}),Object.defineProperty(exports,`TickBarBuilder`,{enumerable:!0,get:function(){return n.TickBarBuilder}}),Object.defineProperty(exports,`TradeZoneManager`,{enumerable:!0,get:function(){return n.TradeZoneManager}}),Object.defineProperty(exports,`UPCOM_SESSIONS`,{enumerable:!0,get:function(){return t.UPCOM_SESSIONS}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`UpbitAdapter`,{enumerable:!0,get:function(){return n.UpbitAdapter}}),Object.defineProperty(exports,`VN30F_SESSIONS`,{enumerable:!0,get:function(){return t.VN30F_SESSIONS}}),Object.defineProperty(exports,`VN_COLORS`,{enumerable:!0,get:function(){return t.VN_COLORS}}),Object.defineProperty(exports,`VOLUME_ALPHA`,{enumerable:!0,get:function(){return t.VOLUME_ALPHA}}),Object.defineProperty(exports,`VolumeRenderer`,{enumerable:!0,get:function(){return n.VolumeRenderer}}),exports.WaterfallChart=C,Object.defineProperty(exports,`Watermark`,{enumerable:!0,get:function(){return n.Watermark}}),Object.defineProperty(exports,`WebSocketAdapter`,{enumerable:!0,get:function(){return n.WebSocketAdapter}}),Object.defineProperty(exports,`adapterFromFeed`,{enumerable:!0,get:function(){return n.adapterFromFeed}}),Object.defineProperty(exports,`axisTimes`,{enumerable:!0,get:function(){return n.axisTimes}}),Object.defineProperty(exports,`barIndexToX`,{enumerable:!0,get:function(){return n.barIndexToX}}),Object.defineProperty(exports,`barTimeUnit`,{enumerable:!0,get:function(){return t.barTimeUnit}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.m,exports.computeDrawdownCurve=R,exports.computeMonthlyReturns=z,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`contrastRatio`,{enumerable:!0,get:function(){return t.contrastRatio}}),Object.defineProperty(exports,`correlationMatrix`,{enumerable:!0,get:function(){return n.correlationMatrix}}),Object.defineProperty(exports,`counterClockPhase`,{enumerable:!0,get:function(){return n.counterClockPhase}}),Object.defineProperty(exports,`counterClockPoints`,{enumerable:!0,get:function(){return n.counterClockPoints}}),Object.defineProperty(exports,`createMarketTheme`,{enumerable:!0,get:function(){return t.createMarketTheme}}),Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`detectCandlePatterns`,{enumerable:!0,get:function(){return n.detectCandlePatterns}}),exports.feedBars=h,Object.defineProperty(exports,`feedFromAdapter`,{enumerable:!0,get:function(){return n.feedFromAdapter}}),Object.defineProperty(exports,`formatFraction`,{enumerable:!0,get:function(){return t.formatFraction}}),Object.defineProperty(exports,`formatNumber`,{enumerable:!0,get:function(){return t.formatNumber}}),Object.defineProperty(exports,`formatTooltipTime`,{enumerable:!0,get:function(){return n.formatTooltipTime}}),Object.defineProperty(exports,`formatVND`,{enumerable:!0,get:function(){return t.formatVND}}),Object.defineProperty(exports,`formatVolumeLoc`,{enumerable:!0,get:function(){return t.formatVolumeLoc}}),Object.defineProperty(exports,`fractionTick`,{enumerable:!0,get:function(){return t.fractionTick}}),Object.defineProperty(exports,`getCurrentSession`,{enumerable:!0,get:function(){return t.getCurrentSession}}),exports.getGlobalPlugins=e.h,Object.defineProperty(exports,`getLocale`,{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(exports,`histogramBins`,{enumerable:!0,get:function(){return n.histogramBins}}),Object.defineProperty(exports,`indicatorCategory`,{enumerable:!0,get:function(){return n.indicatorCategory}}),Object.defineProperty(exports,`indicatorSource`,{enumerable:!0,get:function(){return t.indicatorSource}}),Object.defineProperty(exports,`inkOn`,{enumerable:!0,get:function(){return t.inkOn}}),Object.defineProperty(exports,`isDataFeed`,{enumerable:!0,get:function(){return n.isDataFeed}}),Object.defineProperty(exports,`isPriceLevelAlert`,{enumerable:!0,get:function(){return n.isPriceLevelAlert}}),Object.defineProperty(exports,`isPriceSource`,{enumerable:!0,get:function(){return t.isPriceSource}}),Object.defineProperty(exports,`isTimeFrame`,{enumerable:!0,get:function(){return t.isTimeFrame}}),Object.defineProperty(exports,`isValidTimeZone`,{enumerable:!0,get:function(){return t.isValidTimeZone}}),exports.localStorageLayouts=e.i,Object.defineProperty(exports,`lttbDownsample`,{enumerable:!0,get:function(){return n.lttbDownsample}}),Object.defineProperty(exports,`lttbVisibleIndices`,{enumerable:!0,get:function(){return n.lttbVisibleIndices}}),Object.defineProperty(exports,`marketStatus`,{enumerable:!0,get:function(){return t.marketStatus}}),exports.memoryLayouts=e.a,Object.defineProperty(exports,`niceScale`,{enumerable:!0,get:function(){return n.niceScale}}),Object.defineProperty(exports,`normalizeBar`,{enumerable:!0,get:function(){return t.normalizeBar}}),Object.defineProperty(exports,`normalizeBarTime`,{enumerable:!0,get:function(){return t.normalizeBarTime}}),Object.defineProperty(exports,`offsetAt`,{enumerable:!0,get:function(){return t.offsetAt}}),exports.overlayScale=g,exports.overlaysForLayer=e.y,Object.defineProperty(exports,`parseIndicatorSource`,{enumerable:!0,get:function(){return t.parseIndicatorSource}}),exports.parseOHLCV=e.s,Object.defineProperty(exports,`parseTimeframe`,{enumerable:!0,get:function(){return t.parseTimeframe}}),Object.defineProperty(exports,`pickBaseTimeframe`,{enumerable:!0,get:function(){return t.pickBaseTimeframe}}),exports.pluginKey=e.b,Object.defineProperty(exports,`priceFormatterFor`,{enumerable:!0,get:function(){return t.priceFormatterFor}}),Object.defineProperty(exports,`priceStepAt`,{enumerable:!0,get:function(){return t.priceStepAt}}),Object.defineProperty(exports,`priceToY`,{enumerable:!0,get:function(){return n.priceToY}}),Object.defineProperty(exports,`priceToYMapper`,{enumerable:!0,get:function(){return n.priceToYMapper}}),Object.defineProperty(exports,`rangePresetStart`,{enumerable:!0,get:function(){return n.rangePresetStart}}),Object.defineProperty(exports,`rankSymbols`,{enumerable:!0,get:function(){return t.rankSymbols}}),Object.defineProperty(exports,`readNews`,{enumerable:!0,get:function(){return t.readNews}}),Object.defineProperty(exports,`readQuote`,{enumerable:!0,get:function(){return t.readQuote}}),Object.defineProperty(exports,`readableOn`,{enumerable:!0,get:function(){return t.readableOn}}),Object.defineProperty(exports,`registerLocale`,{enumerable:!0,get:function(){return t.registerLocale}}),exports.registerPlugin=e.g,Object.defineProperty(exports,`resampleBars`,{enumerable:!0,get:function(){return t.resampleBars}}),Object.defineProperty(exports,`roundToPriceStep`,{enumerable:!0,get:function(){return t.roundToPriceStep}}),Object.defineProperty(exports,`scaleMarketPrices`,{enumerable:!0,get:function(){return t.scaleMarketPrices}}),exports.selectKeyStats=U,Object.defineProperty(exports,`servesTimeframe`,{enumerable:!0,get:function(){return n.servesTimeframe}}),Object.defineProperty(exports,`setLocale`,{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(exports,`setMaxWebGLCharts`,{enumerable:!0,get:function(){return n.setMaxWebGLCharts}}),Object.defineProperty(exports,`sourcePrice`,{enumerable:!0,get:function(){return t.sourcePrice}}),Object.defineProperty(exports,`stepDecimals`,{enumerable:!0,get:function(){return t.stepDecimals}}),Object.defineProperty(exports,`symbolTimeZone`,{enumerable:!0,get:function(){return t.symbolTimeZone}}),exports.syncIndicators=i,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`tickBarCount`,{enumerable:!0,get:function(){return t.tickBarCount}}),Object.defineProperty(exports,`timeToX`,{enumerable:!0,get:function(){return n.timeToX}}),Object.defineProperty(exports,`timeframeBucketStart`,{enumerable:!0,get:function(){return t.timeframeBucketStart}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),Object.defineProperty(exports,`timestampToBarIndex`,{enumerable:!0,get:function(){return n.timestampToBarIndex}}),exports.toEquityPoints=L,Object.defineProperty(exports,`toHeikinAshi`,{enumerable:!0,get:function(){return n.toHeikinAshi}}),Object.defineProperty(exports,`toKagi`,{enumerable:!0,get:function(){return n.toKagi}}),Object.defineProperty(exports,`toLineBreak`,{enumerable:!0,get:function(){return n.toLineBreak}}),Object.defineProperty(exports,`toPointAndFigure`,{enumerable:!0,get:function(){return n.toPointAndFigure}}),Object.defineProperty(exports,`toRangeBars`,{enumerable:!0,get:function(){return n.toRangeBars}}),Object.defineProperty(exports,`toRenko`,{enumerable:!0,get:function(){return n.toRenko}}),exports.unregisterPlugin=e._,Object.defineProperty(exports,`usesKoreanUnits`,{enumerable:!0,get:function(){return t.usesKoreanUnits}}),Object.defineProperty(exports,`vn30fContracts`,{enumerable:!0,get:function(){return t.vn30fContracts}}),Object.defineProperty(exports,`vn30fLastTradingDay`,{enumerable:!0,get:function(){return t.vn30fLastTradingDay}}),Object.defineProperty(exports,`volumeColor`,{enumerable:!0,get:function(){return t.volumeColor}}),Object.defineProperty(exports,`wallToUtc`,{enumerable:!0,get:function(){return t.wallToUtc}}),Object.defineProperty(exports,`withResampling`,{enumerable:!0,get:function(){return n.withResampling}}),Object.defineProperty(exports,`withTickBars`,{enumerable:!0,get:function(){return n.withTickBars}}),Object.defineProperty(exports,`xToBarIndex`,{enumerable:!0,get:function(){return n.xToBarIndex}}),Object.defineProperty(exports,`xToTime`,{enumerable:!0,get:function(){return n.xToTime}}),Object.defineProperty(exports,`yToPrice`,{enumerable:!0,get:function(){return n.yToPrice}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, g as l, h as u, i as ee, l as te, m as ne, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./LayoutSession-
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, g as l, h as u, i as ee, l as te, m as ne, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./LayoutSession-Bcy79w0l.js";
|
|
2
2
|
import { CHART_STYLE_KEYS as me, DARK_PRICE_LIMITS as he, DARK_TERMINAL as ge, DARK_THEME as _e, DARK_THEME as ve, DEFAULT_DRAWING_STYLE as ye, DEFAULT_FONT_FAMILY as be, DEFAULT_RECONNECT as xe, DEFAULT_SIGNAL_STYLE as Se, DEFAULT_STREAM_CONFIG as Ce, DEFAULT_TIMEFRAME_FAVORITES as we, DEFAULT_TRADE_ZONE_STYLE as Te, DEFAULT_TRADING_CONFIG as Ee, HNX_SESSIONS as d, HOSE_SESSIONS as f, KRX_SESSIONS as p, KR_COLORS as m, LIGHT_PRICE_LIMITS as h, LIGHT_THEME as g, LIGHT_THEME as _, MARKET_CRYPTO as v, MARKET_HNX as y, MARKET_HOSE as b, MARKET_HOSE_ETF as x, MARKET_KRX as S, MARKET_NXT as C, MARKET_NYSE as w, MARKET_UPBIT_KRW as T, MARKET_UPCOM as E, MARKET_VN30F as D, MS_TIME_THRESHOLD as De, NXT_SESSIONS as Oe, PRICE_SOURCES as ke, SANS_FONT_FAMILY as Ae, TC_PALETTE as je, TC_SERIES_COLORS as Me, TIMEFRAMES_CRYPTO as Ne, TIMEFRAMES_FOREX as Pe, TIMEFRAMES_STOCK as Fe, UPCOM_SESSIONS as Ie, VN30F_SESSIONS as Le, VN_COLORS as Re, VOLUME_ALPHA as ze, barTimeUnit as Be, barsAreDaily as Ve, computePriceLimits as He, contrastRatio as Ue, createMarketTheme as We, createVNTheme as Ge, formatFraction as Ke, formatNumber as qe, formatVND as Je, formatVolumeLoc as Ye, fractionTick as Xe, getCurrentSession as Ze, getLocale as Qe, indicatorSource as $e, inkOn as et, isPriceSource as tt, isTimeFrame as nt, isValidTimeZone as rt, marketStatus as it, normalizeBar as at, normalizeBarTime as ot, offsetAt as st, parseIndicatorSource as ct, parseTimeframe as lt, pickBaseTimeframe as ut, priceFormatterFor as dt, priceStepAt as ft, rankSymbols as pt, readNews as mt, readQuote as ht, readableOn as gt, registerLocale as _t, resampleBars as vt, roundToPriceStep as yt, scaleMarketPrices as bt, setLocale as xt, sourcePrice as St, stepDecimals as Ct, symbolTimeZone as wt, t as Tt, tickBarCount as Et, timeframeBucketStart as Dt, timeframeBucketStart as Ot, timeframeToMs as kt, usesKoreanUnits as At, vn30fContracts as jt, vn30fLastTradingDay as Mt, volumeColor as Nt, wallToUtc as Pt, zoneOffsetMinutes as Ft } from "@tradecanvas/commons";
|
|
3
3
|
import { AlertManager as It, Animator as Lt, BarCountdown as Rt, BaseFinanceChart as O, BinanceAdapter as zt, BybitAdapter as Bt, CANDLE_PATTERNS as Vt, ChartLegend as Ht, ChartStateManager as Ut, CoinbaseAdapter as Wt, CompareRenderer as Gt, CrosshairTooltip as Kt, CurrentPriceLine as qt, DEFAULT_LEGEND_CONFIG as Jt, DEFAULT_MAX_WEBGL_CHARTS as Yt, DEFAULT_SESSION_HOURS as Xt, DataExporter as Zt, DrawingBase as Qt, Easing as $t, FinanceCrosshair as k, GROUP_HEADER as en, INDICATOR_CATEGORIES as tn, IndicatorBase as nn, IndicatorValueMap as rn, KEPT_BUCKETS as an, KeyboardHandler as on, KrakenAdapter as sn, MAX_ALERT_BARS as cn, MIN_ALERT_BARS as ln, ManualFeed as un, MockAdapter as dn, PaperExecutionAdapter as fn, PollingAdapter as pn, RANGE_PRESETS as mn, ReconnectManager as hn, ReplayController as gn, ReplayManager as _n, ResamplingAdapter as vn, ReshapeMemo as yn, Screenshot as bn, SessionBreaks as xn, SessionShading as Sn, SignalMarkerManager as A, StreamManager as Cn, TickAggregator as wn, TickBarAdapter as Tn, TickBarBuilder as En, TradeZoneManager as Dn, UndoRedoManager as On, UpbitAdapter as kn, VolumeRenderer as An, Watermark as jn, WebSocketAdapter as Mn, adapterFromFeed as Nn, axisTimes as Pn, barIndexToTime as Fn, barIndexToX as In, barIndexToX as j, canvasMeasure as Ln, computeBarLayout as Rn, computeCalendarLayout as zn, computeCounterClockLayout as Bn, computeDonutLayout as Vn, computeHistogramLayout as Hn, computeMatrixLayout as Un, computeScatterLayout as Wn, correlationMatrix as Gn, counterClockPhase as Kn, counterClockPhase as qn, counterClockPoints as Jn, counterClockPoints as Yn, detectCandlePatterns as Xn, feedFromAdapter as Zn, formatTooltipTime as Qn, histogramBins as $n, hitBar as M, hitDay as N, hitMatrixCell as P, hitSlice as F, indicatorCategory as er, isDataFeed as tr, isDataFeed as nr, isPriceLevelAlert as rr, layoutGroupedTreemap as ir, layoutSquarifiedTreemap as ar, layoutUniformGrid as or, lttbDownsample as sr, lttbVisibleIndices as cr, nearestCounterClockPoint as I, nearestPoint as L, niceScale as lr, priceToY as ur, priceToYMapper as dr, priceToYMapper as fr, rangePresetStart as pr, renderBarChart as mr, renderCalendar as hr, renderCounterClock as gr, renderDepthChart as _r, renderDonut as vr, renderEquityCurve as yr, renderGauge as br, renderHeatmap as xr, renderHistogram as Sr, renderMatrix as Cr, renderScatter as wr, renderSparkline as Tr, renderWaterfall as Er, servesTimeframe as Dr, setMaxWebGLCharts as Or, shownCount as kr, timeToX as Ar, timestampToBarIndex as jr, timestampToBarIndex as Mr, toHeikinAshi as Nr, toKagi as Pr, toLineBreak as Fr, toPointAndFigure as Ir, toRangeBars as Lr, toRenko as Rr, withResampling as zr, withTickBars as Br, xToBarIndex as Vr, xToBarIndex as R, xToTime as Hr, yToPrice as Ur, yToPrice as Wr } from "@tradecanvas/core";
|
|
4
4
|
//#region src/frameworks/syncIndicators.ts
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ChartTypeOptions, DataSeries } from '@tradecanvas/commons';
|
|
2
|
+
import { ChartTypeLookup } from '../charts/ChartTypeStrategy.js';
|
|
3
|
+
/** What the series a chart type draws is made of, read each time it is asked for. */
|
|
4
|
+
export interface DisplaySources {
|
|
5
|
+
/** The bars shown. */
|
|
6
|
+
bars(): DataSeries;
|
|
7
|
+
/** Moves on every write to them, in place or not (`SeriesStore.version`). */
|
|
8
|
+
version(): number;
|
|
9
|
+
chartType(): string;
|
|
10
|
+
/** Replaced, never changed in place, when the options change. */
|
|
11
|
+
chartTypeOptions(): ChartTypeOptions;
|
|
12
|
+
/** A chart type of a plugin's, which draws its own series. */
|
|
13
|
+
lookup: ChartTypeLookup;
|
|
14
|
+
/** The market's price step at a price: range bars are built on it. */
|
|
15
|
+
stepAt(price: number): number | undefined;
|
|
16
|
+
/** The box the built-in point & figure columns were made on, for its renderer. */
|
|
17
|
+
onBoxSize(box: number): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The series the chart type draws (Heikin-Ashi candles, Renko bricks, Kagi
|
|
21
|
+
* lines…), made from the bars when something it is made of changed and
|
|
22
|
+
* kept between frames otherwise. It sees every change itself: a write to
|
|
23
|
+
* the bars moves their version, so no writer has to remember to drop it.
|
|
24
|
+
* No DOM.
|
|
25
|
+
*/
|
|
26
|
+
export declare class DisplaySeries {
|
|
27
|
+
private readonly sources;
|
|
28
|
+
private series;
|
|
29
|
+
private madeAt;
|
|
30
|
+
/** Moves on `invalidate`, for a change the sources don't show. */
|
|
31
|
+
private epoch;
|
|
32
|
+
/** What Renko, Kagi and point & figure keep from one build to the next, to make the end again only. */
|
|
33
|
+
private readonly memo;
|
|
34
|
+
constructor(sources: DisplaySources);
|
|
35
|
+
get(): DataSeries;
|
|
36
|
+
/** Made again on the next `get`: something it is made of changed where the sources don't show it. */
|
|
37
|
+
invalidate(): void;
|
|
38
|
+
/**
|
|
39
|
+
* A new series, a new chart type or new hours shown: nothing kept from the
|
|
40
|
+
* last build is of use, the end made again included.
|
|
41
|
+
*/
|
|
42
|
+
reset(): void;
|
|
43
|
+
/**
|
|
44
|
+
* The built-in point & figure's columns come with the box they were built
|
|
45
|
+
* on, which its renderer draws them at, in the one walk (a plugin's chart
|
|
46
|
+
* type keeps its own).
|
|
47
|
+
*/
|
|
48
|
+
private make;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=DisplaySeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisplaySeries.d.ts","sourceRoot":"","sources":["../../src/model/DisplaySeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAA4D,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEhI,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,IAAI,IAAI,UAAU,CAAC;IACnB,6EAA6E;IAC7E,OAAO,IAAI,MAAM,CAAC;IAClB,SAAS,IAAI,MAAM,CAAC;IACpB,iEAAiE;IACjE,gBAAgB,IAAI,gBAAgB,CAAC;IACrC,8DAA8D;IAC9D,MAAM,EAAE,eAAe,CAAC;IACxB,sEAAsE;IACtE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,kFAAkF;IAClF,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,qBAAa,aAAa;IAQZ,OAAO,CAAC,QAAQ,CAAC,OAAO;IAPpC,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,MAAM,CAAsH;IACpI,kEAAkE;IAClE,OAAO,CAAC,KAAK,CAAK;IAClB,uGAAuG;IACvG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;gBAEb,OAAO,EAAE,cAAc;IAEpD,GAAG,IAAI,UAAU;IAkBjB,qGAAqG;IACrG,UAAU,IAAI,IAAI;IAIlB;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKb;;;;OAIG;IACH,OAAO,CAAC,IAAI;CAOb"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DataSeries, PanelConfig, Rect, ViewportState } from '@tradecanvas/commons';
|
|
2
|
+
/** A pane with less plot than this, px, takes no drawings: there is no room to place one. */
|
|
3
|
+
export declare const MIN_DRAWING_PANE_HEIGHT = 24;
|
|
4
|
+
/**
|
|
5
|
+
* The pane a drawing begun at `pos` goes on: undefined the price pane
|
|
6
|
+
* (whose plot is `priceRect`), an indicator pane's id, null where none
|
|
7
|
+
* takes drawings (an axis, a header, a side or folded pane).
|
|
8
|
+
*/
|
|
9
|
+
export declare function drawingPaneAt(pos: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}, priceRect: Rect, panels: readonly Pick<PanelConfig, 'id'>[], viewportOf: (paneId: string) => ViewportState | null): string | null | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The viewport a pane's drawings are drawn and read with: its plot under
|
|
15
|
+
* the header, its value scale, the bars' times. Null for a pane that takes
|
|
16
|
+
* none: on a side (its x is not the time), folded, or too short to draw in.
|
|
17
|
+
* `paneViewport` and `data` are read only for a pane that takes them: this
|
|
18
|
+
* runs on every pointer move with a drawing tool, and a stale series is
|
|
19
|
+
* worked out again when read.
|
|
20
|
+
*/
|
|
21
|
+
export declare function drawingPaneViewport(panel: Pick<PanelConfig, 'position'> | undefined, shownCollapsed: boolean, paneViewport: () => ViewportState | undefined, data: () => DataSeries): ViewportState | null;
|
|
22
|
+
/** Whether pane `paneId` is among `panels` and takes a drawing: no price-only tool goes on a pane. */
|
|
23
|
+
export declare function takesDrawing(panels: readonly Pick<PanelConfig, 'id'>[], paneId: string, priceOnly: boolean): boolean;
|
|
24
|
+
//# sourceMappingURL=DrawingPanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawingPanes.d.ts","sourceRoot":"","sources":["../../src/model/DrawingPanes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEzF,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAK1C;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7B,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,SAAS,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,EAC1C,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,GAAG,IAAI,GACnD,MAAM,GAAG,IAAI,GAAG,SAAS,CAO3B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,SAAS,EAChD,cAAc,EAAE,OAAO,EACvB,YAAY,EAAE,MAAM,aAAa,GAAG,SAAS,EAC7C,IAAI,EAAE,MAAM,UAAU,GACrB,aAAa,GAAG,IAAI,CAMtB;AAED,sGAAsG;AACtG,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAEpH"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { SnapshotIndicator, UndoRedoManager } from '@tradecanvas/core';
|
|
2
|
+
/** Changes to one indicator closer together than this are one undo step (a colour dragged, a period typed). */
|
|
3
|
+
export declare const INDICATOR_EDIT_MERGE_MS = 800;
|
|
4
|
+
/** The undo history the indicator steps go in. */
|
|
5
|
+
export type IndicatorSteps = Pick<UndoRedoManager, 'push' | 'last' | 'replaceLast' | 'dropLast'>;
|
|
6
|
+
export interface IndicatorHistoryOptions {
|
|
7
|
+
steps: IndicatorSteps;
|
|
8
|
+
/** The chart's indicators as a layout keeps them. */
|
|
9
|
+
snapshot: () => SnapshotIndicator[];
|
|
10
|
+
/** Whether undo is on (`features.drawingUndoRedo`). */
|
|
11
|
+
enabled: () => boolean;
|
|
12
|
+
now?: () => number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The indicators' undo steps: each change as the indicators before and
|
|
16
|
+
* after it, a burst of quick changes to one indicator merged into one step,
|
|
17
|
+
* an edit (a settings dialog) as one step from its begin to its end. The
|
|
18
|
+
* panes another indicator took over in a step go with it, so the drawings
|
|
19
|
+
* on them can follow. No DOM.
|
|
20
|
+
*/
|
|
21
|
+
export declare class IndicatorHistory {
|
|
22
|
+
private readonly steps;
|
|
23
|
+
private readonly snapshot;
|
|
24
|
+
private readonly enabled;
|
|
25
|
+
private readonly now;
|
|
26
|
+
/** Above 0 while a change is being recorded, or runs quietly: nested changes add no steps. */
|
|
27
|
+
private depth;
|
|
28
|
+
private edit;
|
|
29
|
+
/** The panes renamed by the change being recorded, null outside one. */
|
|
30
|
+
private renames;
|
|
31
|
+
constructor(options: IndicatorHistoryOptions);
|
|
32
|
+
/**
|
|
33
|
+
* Run an indicator change as one undo step. Quick changes about the same
|
|
34
|
+
* `subject` (an indicator, a pane) merge into one step; a burst that ends
|
|
35
|
+
* where it began leaves none.
|
|
36
|
+
*/
|
|
37
|
+
record<T>(subject: string | undefined, change: () => T): T;
|
|
38
|
+
private push;
|
|
39
|
+
/** Run `change` without recording undo steps for the indicators it changes. */
|
|
40
|
+
quietly<T>(change: () => T): T;
|
|
41
|
+
/** Pane `from` was handed to the indicator `to` in the change being recorded. */
|
|
42
|
+
renamed(from: string, to: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Start an edit of one indicator: its changes until `end` are one undo
|
|
45
|
+
* step, and none when they end where they began (a cancel that put
|
|
46
|
+
* everything back). An edit still open is ended first.
|
|
47
|
+
*/
|
|
48
|
+
begin(subject: string): void;
|
|
49
|
+
/** End the edit `begin` started, as one undo step when anything changed. */
|
|
50
|
+
end(): void;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=IndicatorHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorHistory.d.ts","sourceRoot":"","sources":["../../src/model/IndicatorHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE5E,+GAA+G;AAC/G,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,kDAAkD;AAClD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,CAAC,CAAC;AAEjG,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,iBAAiB,EAAE,CAAC;IACpC,uDAAuD;IACvD,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AASD;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,8FAA8F;IAC9F,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,IAAI,CAAiE;IAC7E,wEAAwE;IACxE,OAAO,CAAC,OAAO,CAAmC;gBAEtC,OAAO,EAAE,uBAAuB;IAO5C;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC;IAkB1D,OAAO,CAAC,IAAI;IAiBZ,+EAA+E;IAC/E,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC;IAS9B,iFAAiF;IACjF,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAIvC;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAO5B,4EAA4E;IAC5E,GAAG,IAAI,IAAI;CASZ"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { IndicatorDescriptor } from '@tradecanvas/commons';
|
|
2
|
+
import { IndicatorEngine } from '@tradecanvas/core';
|
|
3
|
+
import { LayoutManager } from '../layout/LayoutManager.js';
|
|
4
|
+
/** What the panes read and change of the indicators. */
|
|
5
|
+
export type PaneMembers = Pick<IndicatorEngine, 'getIndicatorConfig' | 'getIndicatorDescriptor' | 'getPaneMembers' | 'getDependents' | 'setPane' | 'removeIndicator'>;
|
|
6
|
+
/** The panes' places in the layout. */
|
|
7
|
+
export type PaneSlots = Pick<LayoutManager, 'getPanels' | 'addPanel' | 'removePanel'>;
|
|
8
|
+
/** What goes with a pane when another indicator takes it over, or when it goes. */
|
|
9
|
+
export interface PaneHandover {
|
|
10
|
+
/** The pane's own style to `heir`, or away with the pane (null). */
|
|
11
|
+
passStyle(from: string, heir: string | null): void;
|
|
12
|
+
/** Hand pane `from`, its place and its drawings, to the indicator `to`. */
|
|
13
|
+
renamePane(from: string, to: string): void;
|
|
14
|
+
/** The panes' value scales are to be worked out again. */
|
|
15
|
+
invalidateScales(): void;
|
|
16
|
+
}
|
|
17
|
+
/** Where a move sends an indicator: an indicator drawn in the pane, `'new'` a pane of its own, `'price'` the price pane. */
|
|
18
|
+
export type PaneTarget = string;
|
|
19
|
+
/**
|
|
20
|
+
* Which pane each indicator is drawn in: its own, another indicator's (on
|
|
21
|
+
* that pane's scale), or the price pane; who takes a pane over when its
|
|
22
|
+
* indicator goes or moves away, and who follows it. No DOM.
|
|
23
|
+
*/
|
|
24
|
+
export declare class IndicatorPanes {
|
|
25
|
+
private readonly members;
|
|
26
|
+
private readonly slots;
|
|
27
|
+
private readonly handover;
|
|
28
|
+
constructor(members: PaneMembers, slots: PaneSlots, handover: PaneHandover);
|
|
29
|
+
/** Whether the indicator has a pane of its own in the layout. */
|
|
30
|
+
ownsPane(instanceId: string): boolean;
|
|
31
|
+
/** The pane an indicator is drawn in: its own, or the one it shares. */
|
|
32
|
+
paneOf(instanceId: string): string;
|
|
33
|
+
/** The instance owning the pane `instanceId` is drawn in; null for the price pane. */
|
|
34
|
+
hostOf(instanceId: string, self?: string): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The pane an indicator is drawn in, other than its own: the pane of the
|
|
37
|
+
* instance `requested`, or, for a price-pane indicator computed from a pane
|
|
38
|
+
* indicator's line, that indicator's pane. Null = the price pane (overlays)
|
|
39
|
+
* or a pane of its own (panels).
|
|
40
|
+
*/
|
|
41
|
+
paneFor(descriptor: Pick<IndicatorDescriptor, 'placement' | 'inputs'>, params: Readonly<Record<string, unknown>>, requested?: string, self?: string): string | null;
|
|
42
|
+
/** The value of the input an indicator reads its source from (a price, another indicator's line); undefined without one. */
|
|
43
|
+
sourceOf(instanceId: string): unknown;
|
|
44
|
+
/**
|
|
45
|
+
* After an indicator's inputs changed: a price-pane indicator follows a
|
|
46
|
+
* new source into its pane, and leaves it when it no longer reads from it;
|
|
47
|
+
* otherwise it stays where it is. `before` is its source before the
|
|
48
|
+
* change (`sourceOf`). True when it changed panes.
|
|
49
|
+
*/
|
|
50
|
+
followSource(instanceId: string, before: unknown): boolean;
|
|
51
|
+
/** Where a move would put the indicator: the pane's host, `null` (its own or the price pane), or `undefined` when it can't go. */
|
|
52
|
+
moveHost(instanceId: string, target: PaneTarget): string | null | undefined;
|
|
53
|
+
private isPanel;
|
|
54
|
+
/**
|
|
55
|
+
* Remove one indicator. The first pane indicator drawn in its pane takes
|
|
56
|
+
* the pane over and the others stay in it; without one (only price-pane
|
|
57
|
+
* indicators were drawn there) they go back to the price pane. `moved`
|
|
58
|
+
* hears of each of them as soon as it is in its new pane, before the next
|
|
59
|
+
* one moves. Returns them, or null for an unknown indicator.
|
|
60
|
+
*/
|
|
61
|
+
detach(instanceId: string, moved?: (member: string) => void): string[] | null;
|
|
62
|
+
/**
|
|
63
|
+
* Move an indicator to another pane (see `moveHost` for `target`).
|
|
64
|
+
* Indicators drawn in its own pane stay there (one of them takes the pane
|
|
65
|
+
* over) or follow it when they read its lines. Returns every indicator
|
|
66
|
+
* whose pane changed, or null when it can't go there.
|
|
67
|
+
*/
|
|
68
|
+
move(instanceId: string, target: PaneTarget): string[] | null;
|
|
69
|
+
/**
|
|
70
|
+
* The indicator leaves the pane it owns for `host`: those reading its
|
|
71
|
+
* lines go with it; of the rest, the first that draws in a pane takes the
|
|
72
|
+
* pane over. Returns the pane's members.
|
|
73
|
+
*/
|
|
74
|
+
private leavePane;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=IndicatorPanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorPanes.d.ts","sourceRoot":"","sources":["../../src/model/IndicatorPanes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,eAAe,EACf,oBAAoB,GAAG,wBAAwB,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAAS,GAAG,iBAAiB,CACrH,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;AA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kI;IAClI,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAa3E,OAAO,CAAC,OAAO;IAIf;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAsB,GAAG,MAAM,EAAE,GAAG,IAAI;IAoB9F;;;;;OAKG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,IAAI;IAsB7D;;;;OAIG;IACH,OAAO,CAAC,SAAS;CAmBlB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PaneStyle } from '@tradecanvas/commons';
|
|
2
|
+
import { IndicatorEngine, SnapshotIndicator } from '@tradecanvas/core';
|
|
3
|
+
import { LayoutManager } from '../layout/LayoutManager.js';
|
|
4
|
+
/** What a layout keeps of the indicators. */
|
|
5
|
+
export type SetupSources = Pick<IndicatorEngine, 'getActiveIndicators' | 'getIndicatorConfig' | 'getIndicatorStyle' | 'getIntervals'>;
|
|
6
|
+
/** What a layout keeps of the panes. */
|
|
7
|
+
export type SetupPanes = Pick<LayoutManager, 'getPanels' | 'getMaximizedPanel'>;
|
|
8
|
+
/** What putting the panes back changes. */
|
|
9
|
+
export type RestoredPanes = Pick<LayoutManager, 'setPanelSize' | 'setPanelCollapsed' | 'setPanelScale' | 'orderPanels' | 'setMaximizedPanel'>;
|
|
10
|
+
/**
|
|
11
|
+
* The indicators as a layout or a template keeps them: inputs, style,
|
|
12
|
+
* levels, scale and panes (shared, size, order, fold, maximise, own style).
|
|
13
|
+
*/
|
|
14
|
+
export declare function captureIndicatorSetup(engine: SetupSources, layout: SetupPanes, paneStyle: (instanceId: string) => PaneStyle | null): SnapshotIndicator[];
|
|
15
|
+
/** The panes as they were: size first (it opens a fold), then fold, scale, order, maximise. */
|
|
16
|
+
export declare function restorePanes(layout: RestoredPanes, restored: readonly (readonly [SnapshotIndicator, string])[]): void;
|
|
17
|
+
/**
|
|
18
|
+
* `list` with each indicator after the one whose pane it is drawn in and the
|
|
19
|
+
* ones whose lines it reads (otherwise in the order given).
|
|
20
|
+
*/
|
|
21
|
+
export declare function dependencyOrder(list: readonly SnapshotIndicator[]): SnapshotIndicator[];
|
|
22
|
+
/** The same indicator in the same place: kind, the pane it is drawn in, its scale, and a pane of its own or not. */
|
|
23
|
+
export declare function sameKindAndPlace(a: SnapshotIndicator, b: SnapshotIndicator): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The indicators of `current` an undo may change in place: in `wanted` under
|
|
26
|
+
* the same id, alike in kind and place, with the same inputs (changing their
|
|
27
|
+
* values only: an input one has and the other lacks can't be taken away in place),
|
|
28
|
+
* in a pane whose host is kept too: one drawn in a pane taken down would
|
|
29
|
+
* fall back to the price pane, so it is put back with its host.
|
|
30
|
+
*/
|
|
31
|
+
export declare function keptInPlace(current: readonly SnapshotIndicator[], wanted: readonly SnapshotIndicator[]): Set<string>;
|
|
32
|
+
/** `params` with each line read from another indicator following that indicator's new id (`ids`: old → new). */
|
|
33
|
+
export declare function renameSources(params: Readonly<Record<string, unknown>>, ids: ReadonlyMap<string, string>): Record<string, number | string | boolean>;
|
|
34
|
+
//# sourceMappingURL=IndicatorSetup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorSetup.d.ts","sourceRoot":"","sources":["../../src/model/IndicatorSetup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,qBAAqB,GAAG,oB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
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PaneStyle, ResolvedLayout, ViewportState } from '@tradecanvas/commons';
|
|
2
|
+
import { IndicatorEngine, PanelRenderInfo } from '@tradecanvas/core';
|
|
3
|
+
import { LayoutManager } from '../layout/LayoutManager.js';
|
|
4
|
+
/** The pane's title and the line under it, above its plot. */
|
|
5
|
+
export declare const PANE_HEADER_HEIGHT = 20;
|
|
6
|
+
/** What the panes read of the indicators drawn in them. */
|
|
7
|
+
export type PaneSources = Pick<IndicatorEngine, 'getPaneValueRange' | 'getPaneMembers' | 'getOutput' | 'getIndicatorDescriptor' | 'getActiveIndicators'>;
|
|
8
|
+
/** Where the hovered bar is reported: from the top of the highest pane beside the price pane to the bottom of the lowest. */
|
|
9
|
+
export interface ReportBounds {
|
|
10
|
+
top: number;
|
|
11
|
+
bottom: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The indicator panes as the renderer draws them: their place from the
|
|
15
|
+
* layout, each on its own value scale, with its own style. Worked out once
|
|
16
|
+
* a frame and kept until the layout or the values move. No DOM.
|
|
17
|
+
*/
|
|
18
|
+
export declare class PaneLayout {
|
|
19
|
+
private readonly manager;
|
|
20
|
+
private readonly sources;
|
|
21
|
+
/** Told each new layout's report bounds, for the crosshair. */
|
|
22
|
+
private readonly onLayout;
|
|
23
|
+
private layout;
|
|
24
|
+
private infos;
|
|
25
|
+
private readonly styles;
|
|
26
|
+
constructor(manager: LayoutManager, sources: PaneSources,
|
|
27
|
+
/** Told each new layout's report bounds, for the crosshair. */
|
|
28
|
+
onLayout: (bounds: ReportBounds) => void);
|
|
29
|
+
resolved(): ResolvedLayout;
|
|
30
|
+
/** The layout changed (a size, a pane, an axis width): worked out again on the next read. */
|
|
31
|
+
invalidate(): void;
|
|
32
|
+
/** The panes' values moved (a tick, a new indicator, a style): their scales are worked out again. */
|
|
33
|
+
invalidateScales(): void;
|
|
34
|
+
/** Each pane as drawn under the main viewport, read only when they are worked out again. */
|
|
35
|
+
panels(mainState: () => ViewportState): PanelRenderInfo[];
|
|
36
|
+
/** Where the time axis starts: below the main chart and every pane under it. */
|
|
37
|
+
timeAxisTop(): number;
|
|
38
|
+
/**
|
|
39
|
+
* The panes with nothing to draw on this chart type: every indicator in
|
|
40
|
+
* them is left off it (a compare in its own pane, a correlation, on
|
|
41
|
+
* Renko). They are laid out as if they weren't there, so no empty pane
|
|
42
|
+
* with a made-up scale takes the plot's room; back on candles they return.
|
|
43
|
+
*/
|
|
44
|
+
offChartType(): Set<string>;
|
|
45
|
+
style(paneId: string): PaneStyle | undefined;
|
|
46
|
+
/** Set (or with null, take off) a pane's style: whether it changed. */
|
|
47
|
+
setStyle(paneId: string, style: PaneStyle | null): boolean;
|
|
48
|
+
/** A pane's style goes with the pane: to the indicator that takes it over, or away with it (`heir` null). */
|
|
49
|
+
passStyle(paneId: string, heir: string | null): void;
|
|
50
|
+
/** A pane's first value on screen (its own indicator's first line), the 0% of a percent scale. */
|
|
51
|
+
private baseline;
|
|
52
|
+
}
|
|
53
|
+
/** The hovered bar is reported over the price pane and the panes above and below it. */
|
|
54
|
+
export declare function reportBounds(layout: ResolvedLayout): ReportBounds;
|
|
55
|
+
//# sourceMappingURL=PaneLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaneLayout.d.ts","sourceRoot":"","sources":["../../src/model/PaneLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAIrC,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,eAAe,EACf,mBAAmB,GAAG,gBAAgB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