Files
sigpro-grid/node_modules/ag-charts-community/dist/package/main.esm.min.mjs
2026-03-17 08:44:54 +01:00

17 lines
998 KiB
JavaScript
Executable File

var Pd=Object.defineProperty,Dm=Object.getOwnPropertyDescriptor,WC=Object.getOwnPropertyNames,YC=Object.prototype.hasOwnProperty,Pn=(t,e)=>{for(var i in e)Pd(t,i,{get:e[i],enumerable:!0})},Mm=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of WC(e))!YC.call(t,n)&&n!==i&&Pd(t,n,{get:()=>e[n],enumerable:!(s=Dm(e,n))||s.enumerable});return t},$C=(t,e,i)=>(Mm(t,e,"default"),i&&Mm(i,e,"default")),b=(t,e,i,s)=>{for(var n=s>1?void 0:s?Dm(e,i):e,a=t.length-1,r;a>=0;a--)(r=t[a])&&(n=(s?r(e,i,n):r(n))||n);return s&&n&&Pd(e,i,n),n},Am={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},KC=void 0,ZC=void 0;ZC=KC;var XC=void 0,qC=void 0;qC=XC;var Cm=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(Cm||{}),Tm=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.TOP_LEFT="top-left",t.CENTER="center",t))(Tm||{}),JC=void 0,QC=void 0;QC=JC;var eT=void 0,tT=void 0;tT=eT;import{Logger as iT}from"ag-charts-core";function Lm(t,e,i,s){return{unit:t,step:e,epoch:i,utc:s,every(n){return Lm(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var Nm={};function ke(t,e=1,i,s=!1){iT.warnOnce("time import is deprecated, use object notation instead");const n=`${t}:${e}:${i?.getTime()??0}:${s}`;let a=Nm[n];return a==null&&(a=Lm(t,e,i,s),Nm[n]=a),a}var sT={get millisecond(){return ke("millisecond")},get second(){return ke("second")},get minute(){return ke("minute")},get hour(){return ke("hour")},get day(){return ke("day")},get monday(){return ke("day",7,new Date(1970,0,5))},get tuesday(){return ke("day",7,new Date(1970,0,6))},get wednesday(){return ke("day",7,new Date(1970,0,7))},get thursday(){return ke("day",7,new Date(1970,0,1))},get friday(){return ke("day",7,new Date(1970,0,2))},get saturday(){return ke("day",7,new Date(1970,0,3))},get sunday(){return ke("day",7,new Date(1970,0,4))},get month(){return ke("month")},get year(){return ke("year")},get utcMillisecond(){return ke("millisecond",1,void 0,!0)},get utcSecond(){return ke("second",1,void 0,!0)},get utcMinute(){return ke("minute",1,void 0,!0)},get utcHour(){return ke("hour",1,void 0,!0)},get utcDay(){return ke("day",1,void 0,!0)},get utcMonth(){return ke("month",1,void 0,!0)},get utcYear(){return ke("year",1,void 0,!0)}};import{Debug as _d,MementoCaretaker as nT,ModuleRegistry as km,deepClone as Ba,deepFreeze as aT,enterpriseRegistry as oo,jsonWalk as rT,strictObjectKeys as oT}from"ag-charts-core";import{ActionOnSet as Ws,AsyncAwaitQueue as Om,ChartAxisDirection as _n,ChartUpdateType as W,CleanupRegistry as lT,Color as wm,Debug as Em,Logger as Fn,ModuleRegistry as Vn,ModuleType as lo,Padding as cT,Property as Ys,ProxyProperty as Fd,ZIndexMap as Vd,callWithContext as hT,createId as dT,enterpriseRegistry as Rm,entries as Pm,getWindow as uT,isFiniteNumber as _m,isInputPending as pT,jsonApply as Bd,jsonDiff as gT,mergeDefaults as fT,pause as Fm,roundTo as mT,toPlainText as yT,without as bT}from"ag-charts-core";import{boxContains as xT,boxesEqual as vT,clamp as Vm,nearestSquared as ST}from"ag-charts-core";var Hl=Symbol("interpolate"),Wl=t=>t[Hl]!=null,co=class ro{constructor(e,i,s,n){this.x=e,this.y=i,this.width=s,this.height=n}static fromObject({x:e,y:i,width:s,height:n}){return new ro(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const r of e)r.x<i&&(i=r.x),r.y<s&&(s=r.y),At(r.x,r.width)>n&&(n=At(r.x,r.width)),At(r.y,r.height)>a&&(a=At(r.y,r.height));return new ro(i,s,n-i,a-s)}static nearestBox(e,i,s){return ST(e,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:At(this.x,this.width),bottom:At(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:i,width:s,height:n}=this;return new ro(e,i,s,n)}equals(e){return vT(this,e)}containsPoint(e,i){return xT(this,e,i)}intersection(e){const i=Math.max(this.x,e.x),s=Math.max(this.y,e.y),n=Math.min(At(this.x,this.width),At(e.x,e.width)),a=Math.min(At(this.y,this.height),At(e.y,e.height));if(!(i>n||s>a))return new ro(i,s,n-i,a-s)}collidesBBox(e){return this.x<At(e.x,e.width)&&At(this.x,this.width)>e.x&&this.y<At(e.y,e.height)&&At(this.y,this.height)>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,i){if(this.containsPoint(e,i))return 0;const s=e-Vm(this.x,e,At(this.x,this.width)),n=i-Vm(this.y,i,At(this.y,this.height));return s*s+n*n}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[Hl](e,i){return new ro(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};co.zero=Object.freeze(new co(0,0,0,0)),co.NaN=Object.freeze(new co(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var R=co;function At(t,e){return t===-1/0&&e===1/0?1/0:t+e}import{clamp as IT,toIterable as DT}from"ag-charts-core";import{getOffscreenCanvas as Bm}from"ag-charts-core";import{Debug as MT}from"ag-charts-core";function zm({context:t,pixelRatio:e,width:i,height:s}){t.save();try{t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(s*e))}finally{t.restore()}}function Gm(t){if(MT.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function jm(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var zd;function AT(){const t=Bm();return zd??(zd=new t(1,1)),zd}var Gd=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[a,r]=jm(e,i,s),o=Bm();this.canvas=new o(a,r),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),Gm(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?AT().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:s,context:n}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[a,r]=jm(t,e,i);s.width=a,s.height=r}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){zm(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}};import{DeclaredSceneChangeDetection as Um,Logger as jd,assignIfNotStrictlyEqual as Hm,createId as CT,createSvgElement as Wm,objectsEqual as TT}from"ag-charts-core";var Ud=(t,e)=>Math.sign(t-e);function Ym(t,e){if(typeof t=="number"&&typeof e=="number")return Ud(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let a=0;a<n;a+=1){const r=Ud(i[a],s[a]);if(r!==0)return r}return Ud(i.length,s.length)}import{SceneChangeDetection as K}from"ag-charts-core";var $m=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))($m||{}),LT=5,Bn=class ym{constructor(e){this.serialNumber=ym._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=CT(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=e?.name,this.tag=e?.tag??Number.NaN,this.zIndex=e?.zIndex??0,this.scene=e?.scene,(e?.debugDirty??ym._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,s){const n=e?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const a=Wm("svg");if(a.setAttribute("width",String(i)),a.setAttribute("height",String(s)),a.setAttribute("viewBox",`0 0 ${i} ${s}`),a.setAttribute("overflow","visible"),n.defs?.length){const r=Wm("defs");r.append(...n.defs),a.append(r)}return a.append(...n.elements),a.outerHTML}static*extractBBoxes(e,i){for(const s of e)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}preRender(e,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){e.ctx.save();try{this.render(e)}catch(i){const s=i.errorCount??1;if(s>=LT)throw i.errorCount=s,i;jd.warnOnce("Error during rendering",i,i.stack)}finally{e.ctx.restore()}}render(e){const{stats:i}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const s=this.name??this.id;e.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(e){throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(e){this.batchLevel++;try{e()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{Hm(this,e)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,i){this.batchLevel++;try{Hm(this,e,i)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,i){return!1}pickNode(e,i){if(this.containsPoint(e,i))return this}pickNodes(e,i,s=[]){return this.containsPoint(e,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){if(this.batchLevel>0){this.batchDirty=!0;return}e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],s=new Error("Stack trace for property change tracking").stack?.split(`
`).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,i]of this._debugDirtyProperties.entries())i.length>1&&jd.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${i.length}x)`,()=>{for(const s of i)jd.log(s)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};Bn.className="AbstractNode",Bn._nextSerialNumber=0,Bn._debugEnabled=!1,b([Um()],Bn.prototype,"visible",2),b([Um({equals:TT,changeCb:Bn.handleNodeZIndexChange})],Bn.prototype,"zIndex",2);var vs=Bn;import{DeclaredSceneChangeDetection as Ss,DeclaredSceneObjectChangeDetection as Hd,SceneArrayChangeDetection as NT,SceneObjectChangeDetection as Km,TRIPLE_EQ as kT,boxesEqual as OT,clamp as wT,generateUUID as Wd,isGradientFill as Yd,isImageFill as Zm,isPatternFill as Xm,isString as ET,objectsEqual as Yl}from"ag-charts-core";import{createSvgElement as RT,normalizeAngle360FromDegrees as PT}from"ag-charts-core";import{createSvgElement as _T}from"ag-charts-core";import{Color as $d,Logger as Kd,clamp as FT}from"ag-charts-core";var $l=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}get bandwidth(){}get step(){}get inset(){}},Kl=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};import{clamp as qm,readIntegratedWrappedValue as Jm}from"ag-charts-core";function Qm(t,e,i){if(i==null||i[0]===0&&i[1]===1)return;const s=qm(0,Math.floor(i[0]*t.length),t.length),n=qm(0,Math.ceil(i[1]*t.length),t.length),a=e?t.length-n:s,r=e?t.length-s:n;return[a,r]}function VT(t,e,i){return Qm(t,e,i)??[0,t.length]}function ey(t,e,i){const s=Qm(t,e,i);if(s==null)return{ticks:t,count:t.length,firstTickIndex:0};const[n,a]=s;return{ticks:t.slice(n,a),count:t.length,firstTickIndex:n}}function Zl(t){const e=Jm(t.at(0)),i=Jm(t.at(-1));return e!=null&&i!=null?[e,i]:[void 0,void 0]}var ty=t=>{const e=$d.fromString(t),[i,s,n]=$d.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},Zd=1e-6,iy=t=>t.c<Zd||t.l<Zd||t.l>1-Zd,BT=(t,e,i)=>{i=FT(0,i,1);let s;if(iy(t))s=e.h;else if(iy(e))s=t.h;else{const o=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=o*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,a=t.l*(1-i)+e.l*i,r=t.a*(1-i)+e.a*i;return $d.fromOKLCH(a,n,s,r)},za=class extends $l{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(ty)}update(){const{domain:t,range:e}=this;t.length<2&&(Kd.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let i=1;i<t.length;i++){const s=t[i-1],n=t[i];if(s>n){Kd.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((a,r)=>a-r);break}}if(e.length<t.length)for(let i=e.length;i<t.length;i++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(ty)}normalizeDomains(...t){return{domain:t.map(e=>e.domain).flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],a=e.at(-1),r=i[0],o=i.at(-1);if(t<=n)return r;if(t>=a)return o;let l,c;if(e.length===2){const u=(t-n)/(a-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-l*p)/p}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const u=e[l],p=e[l+1];c=(t-u)/(p-u)}const h=s[l],d=s[l+1];return BT(h,d,c).toRgbaString()}invert(){}getDomainMinMax(){return Zl(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&Kd.warnOnce("Expected update to not invalidate scale"))}};b([Kl],za.prototype,"domain",2),b([Kl],za.prototype,"range",2);var Xd=class{constructor(t,e=[],i){this.colorSpace=t,this.stops=e,this.bbox=i,this._cache=void 0}createGradient(t,e,i){const s=this.bbox??e;if(!s.isFinite())return;if(this._cache?.ctx===t&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:a}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let r=this.createCanvasGradient(t,s,i);if(r==null)return;const o=a==="oklch",l=.05;let c=n[0];r.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(o){const u=new za;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)r.addColorStop(p,u.convert(p)??"transparent")}r.addColorStop(d.stop,d.color),c=d}return"createPattern"in r&&(r=r.createPattern()),this._cache={ctx:t,bbox:s,gradient:r},r}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);for(const{stop:s,color:n}of this.stops){const a=_T("stop");a.setAttribute("offset",`${s}`),a.setAttribute("stop-color",`${n}`),i.appendChild(a)}return i}},zT=class extends Xd{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e,i){const{angle:n}=this,a=PT(n+-90),r=i?.centerX??e.x+e.width*.5,o=i?.centerY??e.y+e.height*.5;return t.createConicGradient(a,r,o)}createSvgGradient(t){return RT("linearGradient")}};import{createSvgElement as GT,normalizeAngle360FromDegrees as jT}from"ag-charts-core";var UT=class extends Xd{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}getGradientPoints(t){const{angle:i}=this,s=jT(i+90),n=Math.cos(s),a=Math.sin(s),r=t.width,o=t.height,l=t.x+r*.5,c=t.y+o*.5,h=Math.hypot(o,r)/2,d=Math.atan2(o,r);let u;s<Math.PI/2?u=s:s<Math.PI?u=Math.PI-s:s<1.5*Math.PI?u=s-Math.PI:u=2*Math.PI-s;const p=h*Math.abs(Math.cos(u-d));return{x0:l+n*p,y0:c+a*p,x1:l-n*p,y1:c-a*p}}createCanvasGradient(t,e){const{x0:i,y0:s,x1:n,y1:a}=this.getGradientPoints(e);if(!(Number.isNaN(i)||Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(a)))return t.createLinearGradient(i,s,n,a)}createSvgGradient(t){const{x0:e,y0:i,x1:s,y1:n}=this.getGradientPoints(t),a=GT("linearGradient");return a.setAttribute("x1",String(e)),a.setAttribute("y1",String(i)),a.setAttribute("x2",String(s)),a.setAttribute("y2",String(n)),a.setAttribute("gradientUnits","userSpaceOnUse"),a}};import{createSvgElement as HT}from"ag-charts-core";var WT=class extends Xd{constructor(t,e,i){super(t,e,i)}createCanvasGradient(t,e,i){const s=i?.centerX??e.x+e.width*.5,n=i?.centerY??e.y+e.height*.5,a=i?.innerRadius??0,r=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(s,n,a,s,n,r)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,s=HT("radialGradient");return s.setAttribute("cx",String(e)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}};import{BaseProperties as YT,Logger as $T,Property as sy}from"ag-charts-core";var qd=class extends YT{constructor(){super(...arguments),this.color="black"}};b([sy],qd.prototype,"stop",2),b([sy],qd.prototype,"color",2);function KT(t){let e;for(const i of t)if(i?.stop!=null){if(e!=null&&i.stop<e)return!1;e=i.stop}return!0}function ny(t){return t.flatMap((e,i)=>{const{stop:s}=e,n=t.at(i+1)?.color;return n==null?[e]:[e,{stop:s,color:n}]})}function ZT(t,e){const i=e==="discrete"?1:0,s=t.map((n,a,{length:r})=>({stop:(a+i)/(r-1+i),color:n}));return e==="discrete"?ny(s):s}function ay(t,e,i,s="continuous"){const n=t.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return ZT(e,s);if(!KT(n))return $T.warnOnce("[fills] must have the stops defined in ascending order"),[];const a=Math.min(...i),r=Math.max(...i),o=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g<n.length;g+=1){const f=n[g];if(g>=h){h=n.length-1;for(let m=g+1;m<n.length;m+=1)if(n[m]?.stop!=null){h=m;break}}let y=f?.stop;if(y==null){const m=n[c]?.stop,x=n[h]?.stop,v=m??a,S=x??r,I=o&&m==null?1:0;y=v+(S-v)*(g-c+I)/(h-c+I)}else c=g;l[g]=Math.max(0,Math.min(1,(y-a)/(r-a)))}let d=n.find(g=>g.color!=null)?.color,u;const p=n.map((g,f)=>{let y=g?.color;const m=l[f];return y!=null?d=y:d==null?(u==null&&(u=new za,u.domain=[0,1],u.range=e),y=u.convert(m)):y=d,{stop:m,color:y}});return s==="discrete"?ny(p):p}import{Logger as XT,createSvgElement as Jd,getDOMMatrix as qT,normalizeAngle360FromDegrees as JT}from"ag-charts-core";var QT=class{constructor(t,e){this.imageLoader=t,this._cache=void 0,this.url=e.url,this.backgroundFill=e.backgroundFill??"black",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.repeat=e.repeat??"no-repeat",this.width=e.width,this.height=e.height,this.fit=e.fit??"stretch",this.rotation=e.rotation??0}createCanvasImage(t,e,i,s){if(!e)return null;const[n,a]=this.getSize(e.width,e.height,i,s);return n<1||a<1?(XT.warnOnce("Image fill is too small to render, ignoring."),null):t.createPattern(e,this.repeat)}getSize(t,e,i,s){const{fit:n}=this;let a=t,r=e,o=1;const l=i/s,c=t/e;return n==="stretch"||t===0||e===0?(a=i,r=s):n==="contain"?o=c>l?i/t:s/e:n==="cover"&&(o=c>l?s/e:i/t),[Math.max(1,a*o),Math.max(1,r*o)]}setImageTransform(t,e){if(typeof t=="string")return;const{url:i,rotation:s,width:n,height:a}=this,r=this.imageLoader?.loadImage(i);if(!r)return;const o=JT(s),l=Math.cos(o),c=Math.sin(o),[h,d]=this.getSize(r.width,r.height,n??e.width,a??e.height),u=h/r.width,p=d/r.height,g=e.x+e.width/2,f=e.y+e.height/2,y=l*h-c*d,m=c*h+l*d,x=y/2,v=m/2,S=qT();t?.setTransform(new S([l*u,c*p,-c*u,l*p,g-x,f-v]))}createPattern(t,e,i,s){const n=this.width??e,a=this.height??i,r=this._cache;if(r?.ctx===t&&r.width===n&&r.height===a)return r.pattern;const o=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(t,o,n,a);if(l!=null)return this._cache={ctx:t,pattern:l,width:n,height:a},l}toSvg(t,e){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:a}=this,{x:r,y:o,width:l,height:c}=t,h=Jd("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(r)),h.setAttribute("y",String(o)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const d=Jd("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(a)),h.appendChild(d);const u=Jd("image");return u.setAttribute("href",i),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/e}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}};import{Logger as eL,createSvgElement as Qd,getDOMMatrix as tL,normalizeAngle360FromDegrees as iL}from"ag-charts-core";import{bezier2DDistance as sL,bezier2DExtrema as nL,evaluateBezier as ry,getPath2D as oy,lineDistanceSquared as ly,normalizeAngle360 as cy}from"ag-charts-core";import{Logger as hy}from"ag-charts-core";var aL=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,ce=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,rL=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,dy=/^[01]/,oL={z:[],h:[ce],v:[ce],m:[ce,ce],l:[ce,ce],t:[ce,ce],s:[ce,ce,ce,ce],q:[ce,ce,ce,ce],c:[ce,ce,ce,ce,ce,ce],a:[ce,ce,ce,dy,dy,ce,ce]};function lL(t){if(!t)return;const e=[];let i=0,s;for(;i<t.length;){const n=aL.exec(t.slice(i));let a;if(n==null){if(!s){hy.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}a=s}else a=n[1],i+=n[0].length;const r=cL(a,t,i);if(!r)return;i=r[0],s=a,e.push(r[1])}return e}function cL(t,e,i){const s=oL[t.toLocaleLowerCase()],n={command:t,params:[]};for(const a of s){const r=e.slice(i),o=a.exec(r);if(o!=null){n.params.push(Number.parseFloat(o[0])),i+=o[0].length;const l=rL.exec(r.slice(o[0].length));l!=null&&(i+=l[0].length)}else{if(n.params.length===1)return[i,n];hy.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${t}]`);return}}return[i,n]}function hL(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function dL(t,e,i,s=1e-6){if(Math.abs(t)<s)return hL(e,i);const n=e*e-4*t*i,a=[];if(Math.abs(n)<s){const r=-e/(2*t);r>=0&&r<=1&&a.push(r)}else if(n>0){const r=Math.sqrt(n),o=(-e-r)/(2*t),l=(-e+r)/(2*t);o>=0&&o<=1&&a.push(o),l>=0&&l<=1&&a.push(l)}return a}function uL(t,e,i,s,n=1e-6){if(Math.abs(t)<n)return dL(e,i,s,n);const a=e/t,r=i/t,o=s/t,l=(3*r-a*a)/9,c=(9*a*r-27*o-2*a*a*a)/54,h=l*l*l+c*c,d=1/3,u=[];if(h>=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),d),f=Math.sign(c-p)*Math.pow(Math.abs(c-p),d),y=Math.abs(Math.sqrt(3)*(g-f)/2),m=-d*a+(g+f);if(m>=0&&m<=1&&u.push(m),Math.abs(y)<n){const x=-d*a-(g+f)/2;x>=0&&x<=1&&u.push(x)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=d*a,f=2*Math.sqrt(-l),y=f*Math.cos(d*p)-g,m=f*Math.cos(d*(p+2*Math.PI))-g,x=f*Math.cos(d*(p+4*Math.PI))-g;y>=0&&y<=1&&u.push(y),m>=0&&m<=1&&u.push(m),x>=0&&x<=1&&u.push(x)}return u}function ho(t,e,i,s,n,a,r,o){const l=(i-t)*(o-a)-(s-e)*(r-n);if(l===0)return 0;const c=((r-n)*(e-a)-(t-n)*(o-a))/l,h=((i-t)*(e-a)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function pL(t,e,i,s,n,a,r,o,l,c,h,d){let u=0;const p=c-d,g=h-l,f=l*(d-c)-c*(h-l),y=uy(t,i,n,r),m=uy(e,s,a,o),x=p*y[0]+g*m[0],v=p*y[1]+g*m[1],S=p*y[2]+g*m[2],I=p*y[3]+g*m[3]+f,M=uL(x,v,S,I);for(const D of M){const C=D*D,A=D*C,T=y[0]*A+y[1]*C+y[2]*D+y[3],L=m[0]*A+m[1]*C+m[2]*D+m[3];let N;l===h?N=(L-c)/(d-c):N=(T-l)/(h-l),N>=0&&N<=1&&u++}return u}function uy(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}var Ga=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const t=oy();this.path2d=new t}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.sx=t,this.sy=e,this.cx=t,this.cy=e,this.path2d.moveTo(t,e),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e}lineTo(t,e){this.openedPath?(this.cx=t,this.cy=e,this.path2d.lineTo(t,e),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e):this.moveTo(t,e)}cubicCurveTo(t,e,i,s,n,a){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,a),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=a}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(t,e,i,s){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.closePath()}roundRect(t,e,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(t,e+n),this.arc(t+n,e+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+n),this.lineTo(t+i,e+s-n),this.arc(t+i-n,e+s-n,n,0,Math.PI/2),this.lineTo(t+i-n,e+s),this.lineTo(t+n,e+s),this.arc(t+ +n,e+s-n,n,Math.PI/2,Math.PI),this.lineTo(t,e+s-n),this.closePath()}ellipse(t,e,i,s,n,a,r,o=!1){const l=i,c=s/i,h=Math.cos(n),d=Math.sin(n),u=-c*d,p=c*h,g=l*Math.cos(a),f=l*Math.sin(a),y=t+h*g+u*f,m=e+d*g+p*f,x=(y-this.cx)**2+(m-this.cy)**2;this.openedPath?x>1e-6&&this.lineTo(y,m):this.moveTo(y,m);let v=o?-cy(a-r):cy(r-a);Math.abs(Math.abs(r-a)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(o?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),I=v/S,M=4/3*Math.tan(I/4);for(let D=0;D<S;D+=1){const C=a+I*(D+0),A=a+I*(D+1),T=l*Math.sin(C),L=l*Math.cos(C),N=l*Math.sin(A),O=l*Math.cos(A),E=L-M*T,k=T+M*L,P=O+M*N,F=N-M*O,w=O,j=N;this.cubicCurveTo(t+h*E+u*k,e+d*E+p*k,t+h*P+u*F,e+d*P+p*F,t+h*w+u*j,e+d*w+p*j)}}arc(t,e,i,s,n,a){this.ellipse(t,e,i,i,0,s,n,a)}appendSvg(t){const e=lL(t);if(e==null)return!1;let i=0,s=0,n,a,r=0,o=0;for(const{command:l,params:c}of e){n??(n=c[0]),a??(a=c[1]);const h=l===l.toLowerCase(),d=h?n:0,u=h?a:0;switch(l.toLowerCase()){case"m":this.moveTo(d+c[0],u+c[1]),n=d+c[0],a=u+c[1],i=n,s=a;break;case"c":this.cubicCurveTo(d+c[0],u+c[1],d+c[2],u+c[3],d+c[4],u+c[5]),r=d+c[2],o=u+c[3],n=d+c[4],a=u+c[5];break;case"s":this.cubicCurveTo(n+n-r,a+a-o,d+c[0],u+c[1],d+c[2],u+c[3]),r=d+c[0],o=u+c[1],n=d+c[2],a=u+c[3];break;case"q":this.cubicCurveTo((d+2*c[0])/3,(u+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),r=c[0],o=c[1],n=c[2],a=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-r))/3,(a+2*(a+a-o))/3,(2*(n+n-r)+c[0])/3,(2*(a+a-o)+c[1])/3,c[0],c[1]),r=n+n-r,o=a+a-o,n=c[0],a=c[1];break;case"a":this.svgEllipse(n,a,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],d+c[5],u+c[6]),n=d+c[5],a=u+c[6];break;case"h":this.lineTo(d+c[0],a),n=d+c[0];break;case"l":this.lineTo(d+c[0],u+c[1]),n=d+c[0],a=u+c[1];break;case"v":this.lineTo(n,u+c[0]),a=u+c[0];break;case"z":this.closePath(),n=i,a=s;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(t,e,i,s,n,a,r,o,l){i=Math.abs(i),s=Math.abs(s);const c=(t-o)/2,h=(e-l)/2,d=Math.sin(n),u=Math.cos(n),p=u*c+d*h,g=-d*c+u*h,f=p/i,y=g/s;let m=f*f+y*y,x=(t+o)/2,v=(e+l)/2,S=0,I=0;m>=1?(m=Math.sqrt(m),i*=m,s*=m):(m=Math.sqrt(1/m-1),a===r&&(m=-m),S=m*i*y,I=-m*s*f,x+=u*S-d*I,v+=d*S+u*I);const M=Math.atan2((g-I)/s,(p-S)/i),D=Math.atan2((-g-I)/s,(-p-S)/i)-M,C=M+D,A=!!(1-r);this.ellipse(x,v,i,s,n,M,C,A)}clear(t){t?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const e=oy();this.path2d=new e,this.openedPath=!1,this.closedPath=!1}isPointInPath(t,e){const i=this.commands,s=this.params,n=this.commandsLength,a=-1e4,r=-1e4;let o=Number.NaN,l=Number.NaN,c=0,h=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=ho(o,l,c,h,a,r,t,e),c=s[p++],o=c,h=s[p++],l=h;break;case 1:d+=ho(c,h,s[p++],s[p++],a,r,t,e),c=s[p-2],h=s[p-1];break;case 2:d+=pL(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,r,t,e),c=s[p-2],h=s[p-1];break;case 3:d+=ho(o,l,c,h,a,r,t,e);break}return d%2===1}distanceSquared(t,e){let i=1/0;const s=this.commands,n=this.params,a=this.commandsLength;let r=Number.NaN,o=Number.NaN,l=0,c=0;for(let h=0,d=0;h<a;h++)switch(s[h]){case 0:l=r=n[d++],c=o=n[d++];break;case 1:{const u=l,p=c;l=n[d++],c=n[d++],i=ly(t,e,u,p,l,c,i);break}case 2:{const u=l,p=c,g=n[d++],f=n[d++],y=n[d++],m=n[d++];l=n[d++],c=n[d++],i=sL(u,p,g,f,y,m,l,c,t,e)**2;break}case 3:i=ly(t,e,l,c,r,o,i);break}return i}toSVG(t=(e,i)=>({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(r,o)=>{e.push(r);for(let l=0;l<o;l+=2){const{x:c,y:h}=t(s[a++],s[a++]);e.push(c,h)}};let a=0;for(let r=0;r<this.commandsLength;r++)switch(i[r]){case 0:n("M",2);break;case 1:n("L",2);break;case 2:n("C",6);break;case 3:n("Z",0);break}return e.join(" ")}computeBBox(){const{commands:t,params:e}=this;let[i,s,n,a]=[1/0,1/0,-1/0,-1/0],[r,o]=[Number.NaN,Number.NaN],[l,c]=[Number.NaN,Number.NaN];const h=(u,p)=>{i=Math.min(p,i),s=Math.min(u,s),n=Math.max(u,n),a=Math.max(p,a),r=u,o=p};let d=0;for(let u=0;u<this.commandsLength;u++)switch(t[u]){case 0:h(e[d++],e[d++]),l=r,c=o;break;case 1:h(e[d++],e[d++]);break;case 2:{const g=r,f=o,y=e[d++],m=e[d++],x=e[d++],v=e[d++],S=e[d++],I=e[d++],M=nL(g,f,y,m,x,v,S,I);for(const D of M){const C=ry(g,y,x,S,D),A=ry(f,m,v,I,D);h(C,A)}h(S,I);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new R(s,i,n-s,a-i)}};import{toRadians as Xl}from"ag-charts-core";function Xe(t,e,i){const s=Math.round(e*t)/t;return i==null?s:i===0?0:i<1?Math.ceil(i*t)/t:Math.round((i+e)*t)/t-s}function py(t,e){return Math.floor(e*t)/t}function eu(t,e,i){const{width:s,height:n,padding:a,strokeWidth:r}=e,o=s/2,l=n/2,c=Math.max(1,s-a-r/2),h=Math.max(1,n-a-r/2);let d=!1;for(const[u,p]of i){const g=o+(u-.5)*c,f=l+(p-.5)*h;d?t.lineTo(g,f):t.moveTo(g,f),d=!0}t.closePath()}var gy={circles(t,{width:e,strokeWidth:i,padding:s}){const n=e/2,a=Math.max(1,n-s-i/2);t.arc(n,n,a,0,Math.PI*2)},squares(t,{width:e,height:i,pixelRatio:s,padding:n,strokeWidth:a}){const r=n+a/2;t.moveTo(Xe(s,r),Xe(s,r)),t.lineTo(Xe(s,e-r),Xe(s,r)),t.lineTo(Xe(s,e-r),Xe(s,i-r)),t.lineTo(Xe(s,r),Xe(s,i-r)),t.closePath()},triangles(t,e){eu(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){eu(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:s}){const a=Math.max(1,(e-s)/2),r=a/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:r,h=l*Math.PI/5-o,d=e/2+Math.cos(h)*c,u=i/2+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},hearts(t,{width:e,height:i,padding:s}){const n=Math.max(1,e/4-s/2),a=e/2,r=i/2+n/2;t.arc(a-n,r-n,n,Xl(130),Xl(330)),t.arc(a+n,r-n,n,Xl(220),Xl(50)),t.lineTo(a,r+n),t.closePath()},crosses(t,e){eu(t,e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const a=Xe(s,e/2)-n%2/2;t.moveTo(a,0),t.lineTo(a,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const a=Xe(s,i/2)-n%2/2;t.moveTo(0,a),t.lineTo(e,a)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),a=s*Math.cos(n),r=s*Math.sin(n);t.moveTo(-a,r),t.lineTo(a,-r),t.moveTo(-a,i+r),t.lineTo(e+a,-r),t.moveTo(e-a,i+r),t.lineTo(e+a,i-r)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),a=s*Math.cos(n),r=s*Math.sin(n);t.moveTo(e-a,-r),t.lineTo(e+a,r),t.moveTo(-a,-r),t.lineTo(e+a,i+r),t.moveTo(-a,i-r),t.lineTo(a,i+r)}},gL=class{constructor(t){this._cache=void 0,this.width=Math.max(t?.width??10,1),this.height=Math.max(t?.height??10,1),this.fill=t.fill??"none",this.fillOpacity=t.fillOpacity??1,this.backgroundFill=t.backgroundFill??"none",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.stroke=t.stroke??"black",this.strokeOpacity=t.strokeOpacity??1,this.strokeWidth=t.strokeWidth??1,this.padding=t.padding??1,this.pattern=t.pattern??"forward-slanted-lines",this.rotation=t.rotation??0,this.scale=t.scale??1,this.path=t.path}getPath(t){const{pattern:e,width:i,height:s,padding:n,strokeWidth:a,path:r}=this,o=new Ga;let l=gy[e]!=null;return r&&l&&(l=!o.appendSvg(r)),l&&gy[e](o,{width:i,height:s,pixelRatio:t,strokeWidth:a,padding:n}),o}renderStroke(t,e){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(e.strokeStyle=i,e.lineWidth=s,e.globalAlpha=n,e.stroke(t))}renderFill(t,e){const{fill:i,fillOpacity:s}=this;i!=="none"&&(e.fillStyle=i,e.globalAlpha=s,e.fill(t))}createCanvasPattern(t,e){const{width:i,height:s,scale:n,backgroundFill:a,backgroundFillOpacity:r}=this;if(i*n<1||s*n<1)return eL.warnOnce("Pattern fill is too small to render, ignoring."),null;const o=new Gd({width:i,height:s,pixelRatio:e*n}),l=o.context;a!=="none"&&(l.fillStyle=a,l.globalAlpha=r,l.fillRect(0,0,i,s));const c=this.getPath(e).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=t.createPattern(o.canvas,"repeat");return this.setPatternTransform(h,e),o.destroy(),h}setPatternTransform(t,e,i=0,s=0){if(t==null)return;const n=iL(this.rotation),a=1/e,r=Math.cos(n)*a,o=Math.sin(n)*a,l=tL();t.setTransform(new l([r,o,-o,r,i,s]))}createPattern(t,e){if(this._cache?.ctx===t&&this._cache.pixelRatio===e)return this._cache.pattern;const i=this.createCanvasPattern(t,e);if(i!=null)return this._cache={ctx:t,pattern:i,pixelRatio:e},i}toSvg(){const{width:t,height:e,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:a,stroke:r,strokeWidth:o,strokeOpacity:l,rotation:c,scale:h}=this,d=Qd("pattern");d.setAttribute("viewBox",`0 0 ${t} ${e}`),d.setAttribute("width",String(t)),d.setAttribute("height",String(e)),d.setAttribute("patternUnits","userSpaceOnUse");const u=Qd("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(t)),u.setAttribute("height",String(e)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(a)),d.appendChild(u);const p=Qd("path");return p.setAttribute("fill",i),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",r),p.setAttribute("stroke-width",String(o)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(p),d}};function fy(t,e){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a}=e;i&&t.setAttribute("font-style",i),s&&t.setAttribute("font-weight",String(s)),n!=null&&t.setAttribute("font-size",String(n)),a&&t.setAttribute("font-family",a)}function fL(t,e){const{stroke:i,strokeWidth:s,strokeOpacity:n}=e;i&&t.setAttribute("stroke",i),s!=null&&t.setAttribute("stroke-width",String(s)),n!=null&&t.setAttribute("stroke-opacity",String(n))}function mL(t,e){const{lineDash:i,lineDashOffset:s}=e;if(i?.some(n=>n!==0)){const n=i.length%2===1?[...i,...i]:i;t.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&t.setAttribute("stroke-dashoffset",String(s))}}var nt=class extends vs{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(Yd(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:a=0,reverse:r=!1}=e;if(n==null)return;let o=ay(n,["black"],[0,1]);switch(r&&(o=o.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new UT(i,o,a);case"radial":return new WT(i,o);case"conic":return new zT(i,o,a)}}getPattern(e){if(Xm(e))return this.createPattern(e)}createPattern(e){return new gL(e)}getImage(e){if(Zm(e))return this.createImage(e)}createImage(e){return new QT(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&Yl(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return Xe(this.layerManager?.canvas?.pixelRatio??1,e,i)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,i){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,i),e.globalCompositeOperation="source-over"),this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){const{__fill:s,__fillOpacity:n=1,fillImage:a}=this;if(s!=null&&s!=="none"&&n>0){const r=e.globalAlpha;a&&(e.globalAlpha=a.backgroundFillOpacity,e.fillStyle=a.backgroundFill,this.executeFill(e,i),e.globalAlpha=r),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=r,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,i){i?e.fill(i):e.fill()}applyFillAndAlpha(e){const{__fill:i,fillGradient:s,fillPattern:n,fillImage:a,__fillOpacity:r=1,__opacity:o=1}=this,l=o*r;if(l!==1&&(e.globalAlpha*=l),s){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;e.fillStyle=s.createGradient(e,c,h)??"black"}else if(n){const{x:c,y:h}=this.getBBox(),d=this.layerManager?.canvas?.pixelRatio??1,u=n.createPattern(e,d);n.setPatternTransform(u,d,c,h),u?e.fillStyle=u:(e.fillStyle=n.fill,e.globalAlpha*=n.fillOpacity)}else if(a){const c=this.getBBox(),h=a.createPattern(e,c.width,c.height,this);a.setImageTransform(h,c),e.fillStyle=h??"transparent"}else e.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(e){const{__stroke:i,__strokeOpacity:s=1,strokeGradient:n,__opacity:a=1}=this;e.strokeStyle=n?.createGradient(e,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const r=a*s;r!==1&&(e.globalAlpha*=r)}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:s}=this;s?.enabled&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*i,e.shadowOffsetY=s.yOffset*i,e.shadowBlur=s.blur*i)}renderStroke(e,i){const{__stroke:s,__strokeWidth:n=0,__strokeOpacity:a=1,__lineDash:r,__lineDashOffset:o,__lineCap:l,__lineJoin:c,__miterLimit:h}=this;if(s!=null&&s!=="none"&&n>0&&a>0){const{globalAlpha:d}=e;this.applyStrokeAndAlpha(e),e.lineWidth=n,r&&e.setLineDash(r),o&&(e.lineDashOffset=o),l&&(e.lineCap=l),c&&(e.lineJoin=c),h!=null&&(e.miterLimit=h),this.executeStroke(e,i),e.globalAlpha=d}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")e.setAttribute("fill",s);else if(Yd(s)&&this.fillGradient){i??(i=[]);const a=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),r=Wd();a.setAttribute("id",r),i.push(a),e.setAttribute("fill",`url(#${r})`)}else if(Xm(s)&&this.fillPattern){i??(i=[]);const a=this.fillPattern.toSvg(),r=Wd();a.setAttribute("id",r),i.push(a),e.setAttribute("fill",`url(#${r})`)}else if(Zm(s)&&this.fillImage){i??(i=[]);const a=this.layerManager?.canvas?.pixelRatio??1,r=this.fillImage.toSvg(this.getBBox(),a),o=Wd();r.setAttribute("id",o),i.push(r),e.setAttribute("fill",`url(#${o})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:r}=this;fL(e,{stroke:ET(i)?i:void 0,strokeOpacity:s,strokeWidth:n}),mL(e,{lineDash:a,lineDashOffset:r})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,i,s){const n=e?.opacity??1,a=e?.fill,r=(e?.fillOpacity??1)*n,o=(e?.strokeOpacity??1)*n,l=e?.strokeWidth??0,c=e?.lineDashOffset??0;let h=!1;this.__fillOpacity!==r&&(this.__fillOpacity=r,h=!0),this.__strokeOpacity!==o&&(this.__strokeOpacity=o,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,h=!0),this.setFillProperties(a,i,s),a!==this.fill&&(this.fill=a),e?.stroke!==this.stroke&&(this.stroke=e?.stroke),h&&this.markDirty()}setFillProperties(e,i,s){const n=i==null||!Yd(e)||e.bounds==null||e.bounds==="item"?void 0:i[e.bounds];let a=!1;this.__fillBBox!==n&&(this.__fillBBox=n,a=!0),this.__fillParams!==s&&(this.__fillParams=s,a=!0),a&&(this.onFillChange(),this.markDirty())}};b([Ss()],nt.prototype,"drawingMode",2),b([Ss()],nt.prototype,"fillOpacity",2),b([Ss()],nt.prototype,"strokeOpacity",2),b([Hd({equals:Yl,changeCb:nt.handleFillChange})],nt.prototype,"fill",2),b([Km({equals:Yl,changeCb:nt.handleStrokeChange})],nt.prototype,"stroke",2),b([Ss()],nt.prototype,"strokeWidth",2),b([NT()],nt.prototype,"lineDash",2),b([Ss()],nt.prototype,"lineDashOffset",2),b([Ss()],nt.prototype,"lineCap",2),b([Ss()],nt.prototype,"lineJoin",2),b([Ss()],nt.prototype,"miterLimit",2),b([Ss({convertor:t=>wT(0,t??1,1)})],nt.prototype,"opacity",2),b([Km({equals:kT,checkDirtyOnAssignment:!0})],nt.prototype,"fillShadow",2),b([Hd({equals:OT,changeCb:t=>t.onFillChange()})],nt.prototype,"fillBBox",2),b([Hd({equals:Yl,changeCb:t=>t.onFillChange()})],nt.prototype,"fillParams",2);var zn=nt;import{createSvgElement as yL}from"ag-charts-core";import{isNumberEqual as ja}from"ag-charts-core";var my=[1,0,0,1,0,0],Gn=class Nd{get e(){return[...this.elements]}constructor(e=my){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return ja(e[0],1)&&ja(e[1],0)&&ja(e[2],0)&&ja(e[3],1)&&ja(e[4],0)&&ja(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],a=e[1]*i[0]+e[3]*i[1],r=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];s=s??e,s[0]=n,s[1]=a,s[2]=r,s[3]=o,s[4]=l,s[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return e instanceof Nd?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new Nd(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const r=e[4],o=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new Nd([a,-s,-n,i,n*o-a*r,s*r-i*o])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const r=e[4],o=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,e[0]=a,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*o-a*r,e[5]=s*r-i*o,this}transformPoint(e,i){const s=this.elements;return{x:e*s[0]+i*s[2]+s[4],y:e*s[1]+i*s[3]+s[5]}}transformBBox(e,i){const s=this.elements,n=s[0],a=s[1],r=s[2],o=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,d=e.y+c,u=Math.abs(l*n)+Math.abs(c*r),p=Math.abs(l*a)+Math.abs(c*o);return i??(i=new R(0,0,0,0)),i.x=h*n+d*r+s[4]-u,i.y=h*a+d*o+s[5]-p,i.width=u+u,i.height=p+p,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,s,n,a,r,o){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=o?.scalingCenterX??0,d=o?.scalingCenterY??0);const u=n,p=Math.cos(u),g=Math.sin(u);let f,y;u===0?(f=0,y=0):(f=o?.rotationCenterX??0,y=o?.rotationCenterY??0);const m=a,x=r,v=h*(1-l)-f,S=d*(1-c)-y;return e.setElements([p*l,g*l,-g*c,p*c,p*v-g*S+f+m,g*v+p*S+y+x]),e}};function $s(t){return by(t.constructor)}var yy=Symbol("isMatrixTransform");function by(t){return t[yy]===!0}function tu(t){var e,i;const s=t;if(by(t))return t;const n=Symbol("matrix_combined_transform");class a extends s{constructor(){super(...arguments),this[i]=new Gn,this._dirtyTransform=!0}onChangeDetection(o){super.onChangeDetection(o),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(o){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(my),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(o){return this.computeTransformMatrix(),this[n].identity?o.clone():this[n].transformBBox(o)}toParentPoint(o,l){return this.computeTransformMatrix(),this[n].identity?{x:o,y:l}:this[n].transformPoint(o,l)}fromParent(o){return this.computeTransformMatrix(),this[n].identity?o.clone():this[n].inverse().transformBBox(o)}fromParentPoint(o,l){return this.computeTransformMatrix(),this[n].identity?{x:o,y:l}:this[n].inverse().transformPoint(o,l)}computeBBox(){const o=super.computeBBox();return o&&this.toParent(o)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(o,l){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNode(o,l)}pickNodes(o,l,c){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNodes(o,l,c)}render(o){this.computeTransformMatrix();const{ctx:l}=o,c=this[n];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(o)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const o=super.toSVG(),l=this[n];if(l.identity||o==null)return o;const c=yL("g");c.append(...o.elements);const[h,d,u,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${g} ${f})`),{elements:[c],defs:o.defs}}}return e=yy,i=n,a[e]=!0,a}function Ua(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends tu(i){constructor(){super(...arguments),this[e]=new Gn,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(r){super.updateMatrix(r);const{rotation:o,rotationCenterX:l,rotationCenterY:c}=this;o!==0&&(Gn.updateTransformMatrix(this[s],1,1,o,0,0,{rotationCenterX:l,rotationCenterY:c}),r.multiplySelf(this[s]))}}return e=s,b([K()],n.prototype,"rotationCenterX",2),b([K()],n.prototype,"rotationCenterY",2),b([K()],n.prototype,"rotation",2),n}function bL(t){return"scalingX"in t&&"scalingY"in t&&"scalingCenterX"in t&&"scalingCenterY"in t}function ql(t){var e;const i=t,s=Symbol("matrix_scale");class n extends tu(i){constructor(){super(...arguments),this[e]=new Gn,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(r){super.updateMatrix(r);const{scalingX:o,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;o===1&&l===1||(Gn.updateTransformMatrix(this[s],o,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),r.multiplySelf(this[s]))}resetScalingProperties(r,o,l,c){this.__scalingX=r,this.__scalingY=o,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return e=s,b([K()],n.prototype,"scalingX",2),b([K()],n.prototype,"scalingY",2),b([K()],n.prototype,"scalingCenterX",2),b([K()],n.prototype,"scalingCenterY",2),n}function Ha(t){var e;const i=t,s=Symbol("matrix_translation");class n extends tu(i){constructor(){super(...arguments),this[e]=new Gn,this.translationX=0,this.translationY=0}updateMatrix(r){super.updateMatrix(r);const{translationX:o,translationY:l}=this;o===0&&l===0||(Gn.updateTransformMatrix(this[s],1,1,0,o,l),r.multiplySelf(this[s]))}}return e=s,b([K()],n.prototype,"translationX",2),b([K()],n.prototype,"translationY",2),n}var ve=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())$s(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return $s(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():$s(t)&&(e=t.toParent(e));for(const i of t.traverseUp())$s(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())$s(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return $s(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){$s(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())$s(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},Jl,iu=class _l extends vs{constructor(e){super(e),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=e?.optimizeForInfrequentRedraws===!0}static is(e){return e instanceof _l}static computeChildrenBBox(e,i=!0){return R.merge(vs.extractBBoxes(e,i))}static compareChildren(e,i){return Ym(e.__zIndex,i.__zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return _l.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const u of this.descendants())u instanceof zn&&(s=Math.max(s,u.strokeWidth));const a=Math.max(1,s/2*n),{x:r,y:o}=ve.toCanvasPoint(this,0,0),l=py(e,r+i.x-a)-r,c=py(e,o+i.y-a)-o,h=Math.ceil(i.x+i.width-l+a),d=Math.ceil(i.y+i.height-c+a);return new R(l,c,h,d)}prepareSharedCanvas(e,i,s){return Jl?.pixelRatio===s?Jl.resize(e,i,s):Jl=new Gd({width:e,height:i,pixelRatio:s}),Jl}setScene(e){const i=this.scene;super.setScene(e),this.layer&&i&&i!==e&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const s of this.children())s.setScene(e)}markDirty(e){this.dirty=!0,super.markDirty(e)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(e){for(const i of DT(e))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);e.parentNode=void 0,e.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const r=s[n].pickNode(e,i);if(r!=null)return r}}else if(!this.isContainerNode)return this}}pickNodes(e,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(e,i,s);return s}isDirty(e){const{width:i,height:s,devicePixelRatio:n}=e,{dirty:a,layer:r}=this,o=r!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,a||o||l}preRender(e){let i;if(this.dirty){i=super.preRender(e,0);for(const s of this.children()){const n=s.preRender(e);i.groups+=n.groups,i.nonGroups+=n.nonGroups,i.complexity+=n.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e},a=this.isDirty(e);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:r,stats:o,devicePixelRatio:l}=e;let{image:c}=this;if(a){c?.bitmap.close(),c=void 0;const d=i?void 0:this.computeSafeClippingBBox(l),u=(p,...g)=>{const f=p.context;n.ctx=f,p.clear(),f.save();try{f.setTransform(...g),f.globalAlpha=1,this.renderInContext(n)}finally{f.restore(),f.verifyDepthZero?.()}};if(i)u(i,r.getTransform());else if(d){const{x:p,y:g,width:f,height:y}=d,m=Math.floor(f*l),x=Math.floor(y*l);if(m>0&&x>0){const v=this.prepareSharedCanvas(f,y,l);u(v,l,0,0,l,-p*l,-g*l),c={bitmap:v.transferToImageBitmap(),x:p,y:g,width:f,height:y}}}this.image=c,o&&o.layersRendered++}else o&&o.layersSkipped++;const{globalAlpha:h}=r;if(r.globalAlpha=h*this.opacity,i){r.save();try{r.resetTransform(),i.drawImage(r)}finally{r.restore()}}else if(c){const{bitmap:d,x:u,y:p,width:g,height:f}=c;r.drawImage(d,0,0,g*l,f*l,u,p,g,f)}r.globalAlpha=h,super.render(n)}applyClip(e,i){const{x:s,y:n,width:a,height:r}=i;e.beginPath(),e.rect(s,n,a,r),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&(this.sortChildren(_l.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=ve.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}n.isolatedRender(e)}}finally{i.restore()}}sortChildren(e){if(!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*excludeChildren(e){for(const i of this.children())(e.instance&&!(i instanceof e.instance)||e.name&&i.name!==e.name)&&(yield i)}*descendants(){for(const e of this.children())yield e,e instanceof _l&&(yield*e.descendants())}setClipRect(e){this.clipRect=e?ve.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&e.push(...n.defs))}return{elements:i,defs:e}}};iu.className="Group",b([K({convertor:t=>IT(0,t,1)})],iu.prototype,"opacity",2);var z=iu,xL=class extends ql(z){},cZ=class extends Ua(z){},gt=class extends Ha(z){},Wa=class extends Ua(Ha(z)){},vL=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise((e,i)=>{this.acquireQueue.push([t,e,i]),this.available&&this.dispatchNext().catch(i)})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e,i]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(s){i?.(s)}[t,e,i]=this.acquireQueue.shift()??[]}this.available=!0}},xy=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){const i=this.eventListeners.get(t);i!=null&&(i.delete(e),i.size===0&&this.eventListeners.delete(t))}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){const e=this.eventListeners.get(t.type);if(e)for(const i of e)i(t)}};import{getWindow as SL}from"ag-charts-core";function IL(t){const e=SL();function i(n,a){return e.requestAnimationFrame(n)}function s(n){e.cancelAnimationFrame(n)}return vy(i,t,s)}function su(t){function e(s,n=0){if(n===0){queueMicrotask(s);return}return setTimeout(s,n)}function i(s){clearTimeout(s)}return vy(e,t,i)}function vy(t,e,i){let s=0,n=!1,a,r,o;function l(){return n}function c(){n=!1,o=void 0,r?.(),r=void 0,a=void 0,s>0&&(o=t(h))}function h(){const f=s;s=0,n=!0;const y=e({count:f});if(!y){c();return}y.then(c,c)}function d(f){s===0&&!l()&&(o=t(h,f)),s++}function u(){o!=null&&i&&(i(o),o=void 0,s=0)}async function p(){if(l())for(a??(a=new Promise(g));l();)await a}function g(f){r=f}return{schedule:d,cancel:u,waitForCompletion:p}}import{attachListener as DL,getAttribute as nu,getElementBBox as ML,getWindow as Sy,setAttribute as qi,setElementBBox as Iy,setElementStyle as au,setElementStyles as AL}from"ag-charts-core";var Dy=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function Ya(t,e,i){const{offsetX:s,offsetY:n,clientX:a,clientY:r}=e,{currentX:o,currentY:l}=Ks.calcCurrentXY(i,e);return{type:t,device:"mouse",offsetX:s,offsetY:n,clientX:a,clientY:r,currentX:o,currentY:l,sourceEvent:e}}function Ql(t,e,i){return{type:t,sourceEvent:e}}var CL={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>Ya("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>Ya("click",t,e),dblclick:(t,e)=>Ya("dblclick",t,e),mouseenter:(t,e)=>Ya("mouseenter",t,e),mousemove:(t,e)=>Ya("mousemove",t,e),mouseleave:(t,e)=>Ya("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,a=t.deltaMode===0?.01:1,r=t.deltaX*a,o=t.deltaY*a;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:r,deltaY:o,sourceEvent:t}},touchstart:(t,e)=>Ql("touchstart",t,e),touchmove:(t,e)=>Ql("touchmove",t,e),touchend:(t,e)=>Ql("touchend",t,e),touchcancel:(t,e)=>Ql("touchcancel",t,e)},Ks=class{static alloc(t,e,i){return CL[t](e,i)}static isHTMLEvent(t){return Dy.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}};import{entries as TL}from"ag-charts-core";var LL=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const s=a=>{const r=Ks.alloc(t,a,e.getElement());this.dispatch(t,e,r)},n={};(t.startsWith("touch")||t==="wheel")&&(n.passive=!1),this.initSourceHandler(t,s),e.getElement().addEventListener(t,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const s=this.lazyGetWidgetListeners(t,e),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(t){if(this.widgetListeners=void 0,this.sourceListeners){for(const[e,i]of TL(this.sourceListeners))t.getElement().removeEventListener(e,i);this.sourceListeners=void 0}}dispatch(t,e,i){for(const s of this.widgetListeners?.[t]??[])s(i,e)}};import{CleanupRegistry as NL,attachListener as My,boxContains as kL,partialAssign as Ay}from"ag-charts-core";import{CleanupRegistry as OL,attachListener as jn,getWindow as wL}from"ag-charts-core";var EL=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.window=wL(),this.cleanup=new OL,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:a,mousemove:r,mouseup:o}=this;this.cleanup.register(jn(n,"mousedown",a,{capture:!0}),jn(n,"mouseenter",a,{capture:!0}),jn(n,"mouseleave",a,{capture:!0}),jn(n,"mouseout",a,{capture:!0}),jn(n,"mouseover",a,{capture:!0}),jn(n,"mousemove",r,{capture:!0}),jn(n,"mouseup",o,{capture:!0})),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function RL(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new EL(t,e,i,s)}import{CleanupRegistry as Cy,attachListener as Un,getWindow as PL}from"ag-charts-core";var _L=500,FL=100;function VL(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}var ru=!1,BL=class{constructor(t,e,i,s,n){this.glob=t,this.self=e,this.initialTouch=s,this.target=n,this.cleanup=new Cy,this.longTapInterrupted=!1,this.longtap=()=>{const{target:o,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new Cy;o.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),ru=!0;const h=f=>f.preventDefault(),d=f=>{ru=!1,f.preventDefault(),c.flush()};c.register(Un(o,"touchmove",h,{passive:!1}),Un(o,"touchend",d,{passive:!1}),Un(o,"touchcancel",d,{passive:!1}));const{clientX:u,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:PL(),clientX:u,clientY:p,pointerType:"touch"});o.dispatchEvent(g)}},this.touchmove=o=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(o.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||VL(h,d)>FL,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(o,d))},this.touchend=o=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(o.changedTouches,o.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(o,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,_L);const{touchmove:a,touchend:r}=this;this.cleanup.register(Un(n,"touchmove",a,{passive:!1}),Un(n,"touchstart",r,{passive:!1}),Un(n,"touchend",r,{passive:!1}),Un(n,"touchcancel",r,{passive:!1})),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.flatMap(i=>Array.from(i));return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function zL(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||ru))return new BL(t,e,i,s,n)}function ou(t,e,i,s){const{currentX:n,currentY:a}=Ks.calcCurrentXY(t.getElement(),s),r=s.pageX-i.pageX,o=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+r,offsetY:i.offsetY+o,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:a,originDeltaX:r,originDeltaY:o,sourceEvent:s}}function GL(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function lu(t,e,i,s,n){const{currentX:a,currentY:r}=Ks.calcCurrentXY(t.getElement(),n),o=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+o,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:a,currentY:r,originDeltaX:o,originDeltaY:l,sourceEvent:s}}var Ty={},Ly=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(t){this.listeners??(this.listeners=new Map);let e=this.listeners.get(t);return e===void 0&&(e=new Set,this.listeners.set(t,e)),e}add(t,e,i){switch(this.getListenerSet(t).add(i),t){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(e);break}}}remove(t,e,i){this.getListenerSet(t).delete(i)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=t.getElement(),i=new NL;i.register(My(e,"mousedown",s=>this.triggerMouseDrag(t,s)),My(e,"touchstart",s=>this.triggerTouchDrag(t,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(t,e){e.button===0&&this.startMouseDrag(t,e)}startMouseDrag(t,e){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};Ay(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const a=ou(t,"drag-start",i,n);this.dispatch("drag-start",t,a)},mousemove:n=>{const a=ou(t,"drag-move",i,n);this.dispatch("drag-move",t,a)},mouseup:n=>{const a=ou(t,"drag-end",i,n);this.dispatch("drag-end",t,a),this.endDrag(t,a)}};this.mouseDragger=RL(Ty,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),a=n.getBoundingClientRect();kL(a,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:Number.NaN,pageY:Number.NaN,...GL(t,i)};Ay(["pageX","pageY"],s,i);const n={touchmove:(o,l)=>{const c=lu(t,"drag-move",s,o,l);this.dispatch("drag-move",t,c)},touchend:(o,l)=>{const c=lu(t,"drag-end",s,o,l);this.dispatch("drag-end",t,c)}},a=t.getElement();this.touchDragger=zL(Ty,this,n,i,a);const r=lu(t,"drag-start",s,e,i);this.dispatch("drag-start",t,r)}dispatch(t,e,i){for(const s of this.getListenerSet(t))s(i,e);this.dispatchCallback(t,i)}},jL=class{constructor(t){this.elem=t}setBounds(t){Iy(this.elemContainer??this.elem,t)}getBounds(){return ML(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();Iy(e,i),AL(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Is=class extends jL{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(t){qi(this.elem,"id",t)}get id(){return nu(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.remove();for(const t of this.children)t.parent=void 0,t.destroy();this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(t){au(this.elem,"display",t?"none":void 0)}isHidden(){return Sy()?.getComputedStyle?.(this.elem).display==="none"}setCursor(t){au(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){qi(this.elem,"aria-describedby",t)}setAriaHidden(t){qi(this.elem,"aria-hidden",t)}setAriaLabel(t){qi(this.elem,"aria-label",t)}setAriaExpanded(t){qi(this.elem,"aria-expanded",t)}setAriaControls(t){qi(this.elem,"aria-controls",t)}setAriaHasPopup(t){qi(this.elem,"aria-haspopup",t)}setInnerHTML(t){this.elem.innerHTML=t}setPointerEvents(t){au(this.elem,"pointer-events",t)}setCSSVariable(t,e){this.elem.style.setProperty(t,e)}isDisabled(){return nu(this.elem,"aria-disabled",!1)}hasPopup(){const t=nu(this.elem,"aria-haspopup");return t!==void 0&&t!=="false"}parseFloat(t){return t===""?0:Number.parseFloat(t)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(t){this.elem.focus(t)}setFocusOverride(t){qi(this.elem,"data-focus-override",t)}setPreventsDefault(t){qi(this.elem,"data-preventdefault",t)}setTabIndex(t){qi(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.indexOf(t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){t.getElement().remove()}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndex<e.domIndex?i:e,void 0)}addListener(t,e){return Ks.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new LL),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new Ly(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){Ks.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Ly(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...e,...Ks.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=s=>{s.persisted||e()};return DL(Sy(),"pagehide",i)}};import{AbstractModuleInstance as UL,Property as ec,ProxyPropertyOnWrite as cu,ZIndexMap as HL}from"ag-charts-core";import{DeclaredSceneChangeDetection as Ji,boxesEqual as WL,isNumberEqual as Ny}from"ag-charts-core";var uo=(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:r},o,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-r,e-a),h=Math.atan2(n-r,s-a);t.arc(a,r,o,c,h)}else t.lineTo(e,i)};import{SceneChangeDetection as hu,createSvgElement as YL}from"ag-charts-core";var Be=class extends zn{constructor(){super(...arguments),this.path=new Ga,this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(t){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(t))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){e.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Ga),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e)}finally{e.restore()}}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=YL("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};Be.className="Path",b([hu()],Be.prototype,"clip",2),b([hu()],Be.prototype,"clipX",1),b([hu()],Be.prototype,"clipY",1);function tc(t,e,i,s,n){let a=!1,r=!1,o=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return o>t?(a=!0,o=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):Ny(o,0)&&(o=0),h>e?(r=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):Ny(h,0)&&(h=0),{leading0:o,leading1:l,trailing0:c,trailing1:h,leadingClipped:a,trailingClipped:r}}function ic(t,e,i,s,n,a,r){let{topLeft:o,topRight:l,bottomRight:c,bottomLeft:h}=a;const d=Math.max(o+h,l+c),u=Math.max(o+l,h+c);if(d<=0&&u<=0){if(r==null)t.rect(e,i,s,n);else{const D=Math.max(e,r.x),C=Math.min(e+s,r.x+r.width),A=Math.max(i,r.y),T=Math.min(i+n,r.y+r.height);t.rect(D,A,C-D,T-A)}return}else if(r==null&&o===l&&o===c&&o===h){t.roundRect(e,i,s,n,o);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(r==null)r=new R(e,i,s,n);else{const D=Math.max(e,r.x),C=Math.min(e+s,r.x+r.width),A=Math.max(i,r.y),T=Math.min(i+n,r.y+r.height);r=new R(D,A,C-D,T-A)}const p=Math.max(d/n,u/s,1);p>1&&(o/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,y=!0,m=!0,x,v,S,I;if(g){const D=tc(r.height,r.width,Math.max(e+o-r.x,0),Math.max(i+o-r.y,0),o);D.leadingClipped&&(m=!1),D.trailingClipped&&(f=!1);const C=Math.max(r.x+D.leading1,r.x),A=Math.max(r.y+D.leading0,r.y),T=Math.max(r.x+D.trailing1,r.x),L=Math.max(r.y+D.trailing0,r.y),N=e+o,O=i+o;x={x0:C,y0:A,x1:T,y1:L,cx:N,cy:O}}if(f){const D=tc(r.width,r.height,Math.max(i+l-r.y,0),Math.max(r.x+r.width-(e+s-l),0),l);D.leadingClipped&&(g=!1),D.trailingClipped&&(y=!1);const C=Math.min(r.x+r.width-D.leading0,r.x+r.width),A=Math.max(r.y+D.leading1,r.y),T=Math.min(r.x+r.width-D.trailing0,r.x+r.width),L=Math.max(r.y+D.trailing1,r.y),N=e+s-l,O=i+l;v={x0:C,y0:A,x1:T,y1:L,cx:N,cy:O}}if(y){const D=tc(r.height,r.width,Math.max(r.x+r.width-(e+s-c),0),Math.max(r.y+r.height-(i+n-c),0),c);D.leadingClipped&&(f=!1),D.trailingClipped&&(m=!1);const C=Math.min(r.x+r.width-D.leading1,r.x+r.width),A=Math.min(r.y+r.height-D.leading0,r.y+r.height),T=Math.min(r.x+r.width-D.trailing1,r.x+r.width),L=Math.min(r.y+r.height-D.trailing0,r.y+r.height),N=e+s-c,O=i+n-c;S={x0:C,y0:A,x1:T,y1:L,cx:N,cy:O}}if(m){const D=tc(r.width,r.height,Math.max(r.y+r.height-(i+n-h),0),Math.max(e+h-r.x,0),h);D.leadingClipped&&(y=!1),D.trailingClipped&&(g=!1);const C=Math.max(r.x+D.leading0,r.x),A=Math.min(r.y+r.height-D.leading1,r.y+r.height),T=Math.max(r.x+D.trailing0,r.x),L=Math.min(r.y+r.height-D.trailing1,r.y+r.height),N=e+h,O=i+n-h;I={x0:C,y0:A,x1:T,y1:L,cx:N,cy:O}}let M=!1;g&&x!=null&&(uo(t,x,o,!M),M||(M=!0)),f&&v!=null&&(uo(t,v,l,!M),M||(M=!0)),y&&S!=null&&(uo(t,S,c,!M),M||(M=!0)),m&&I!=null&&uo(t,I,h,!M),t.closePath()}var ze=class extends Be{constructor(){super(...arguments),this.borderPath=new Ga,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.__strokeWidth,this.effectiveStrokeWidth=this.__strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,__crisp:i,__topLeftCornerRadius:s,__topRightCornerRadius:n,__bottomRightCornerRadius:a,__bottomLeftCornerRadius:r}=this;let{__x:o,__y:l,__width:c,__height:h,__strokeWidth:d,__clipBBox:u}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(),e.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(o,c),h=this.align(l,h),o=this.align(o),l=this.align(l),u=u==null?void 0:new R(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height))),d)if(c<g){const m=o+g/2;e.moveTo(m,l),e.lineTo(m,l+h),d=g,this.borderClipPath=void 0}else if(h<g){const m=l+g/2;e.moveTo(o,m),e.lineTo(o+c,m),d=g,this.borderClipPath=void 0}else if(d<c&&d<h){const m=d/2;o+=m,l+=m,c-=d,h-=d;const x=u?.clone().shrink(m),v={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:a>0?a-d:0,bottomLeft:r>0?r-d:0};this.borderClipPath=void 0,c>0&&h>0&&(x==null||x?.width>0&&x?.height>0)&&(ic(t,o,l,c,h,v,x),ic(e,o,l,c,h,v,x))}else this.borderClipPath=this.borderClipPath??new Ga,this.borderClipPath.clear(),this.borderClipPath.rect(o,l,c,h),e.rect(o,l,c,h);else{const m={topLeft:s,topRight:n,bottomRight:a,bottomLeft:r};this.borderClipPath=void 0,ic(t,o,l,c,h,m,u)}if([s,n,a,r].every($L)){let m=function(S,I){return v.getBBox().distanceSquared(S,I)};var y=m;const x=this.getBBox();this.hittester=x.containsPoint.bind(x);const v=this;this.distanceSquared=m}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=f}computeBBox(){const{__x:t,__y:e,__width:i,__height:s,__clipBBox:n}=this;return n?.clone()??new R(t,e,i,s)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(t,e,i,s,n,a,r,o){this.__drawingMode=t,this.__topLeftCornerRadius=e,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=s,this.__bottomLeftCornerRadius=n,this.__visible=a,this.__crisp=r,this.__fillShadow=o,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(t,e,i,s,n,a){this.__x=t,this.__y=e,this.__width=i,this.__height=s,this.__opacity=n,this.__clipBBox=a,this.dirtyPath=!0,this.markDirty()}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAndAlpha(t){super.applyFillAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(t){super.applyStrokeAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:s}=t,{lineDash:n,lineDashOffset:a,lineCap:r,lineJoin:o,borderPath:l,borderClipPath:c}=this;c&&t.clip(c.getPath2D()),this.applyStrokeAndAlpha(t),t.lineWidth=i,n&&t.setLineDash(n),a&&(t.lineDashOffset=a),r&&(t.lineCap=r),o&&(t.lineJoin=o),t.stroke(l.getPath2D()),t.globalAlpha=s}}};ze.className="Rect",b([Ji()],ze.prototype,"x",2),b([Ji()],ze.prototype,"y",2),b([Ji()],ze.prototype,"width",2),b([Ji()],ze.prototype,"height",2),b([Ji()],ze.prototype,"topLeftCornerRadius",2),b([Ji()],ze.prototype,"topRightCornerRadius",2),b([Ji()],ze.prototype,"bottomRightCornerRadius",2),b([Ji()],ze.prototype,"bottomLeftCornerRadius",2),b([Ji({equals:WL})],ze.prototype,"clipBBox",2),b([Ji()],ze.prototype,"crisp",2);function $L(t){return t===0}import{Debug as KL,LineSplitter as du,SceneRefChangeDetection as ZL,cachedTextMeasurer as uu,createSvgElement as ky,isArray as Hn,measureTextSegments as sc,toFontString as XL,toPlainText as qL,toTextString as $a}from"ag-charts-core";import{Debug as nc,DebugMetrics as JL,Logger as ac,TextMeasurer as QL,getWindow as eN,isString as tN,toArray as iN}from"ag-charts-core";var sN=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){nc.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval(()=>{this.logAccumulatedStats()},this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(t,e){const i=this.stats.get(t);i?(i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.sum+=e,i.count+=1):this.stats.set(t,{min:e,max:e,sum:e,count:1})}recordTimings(t){for(const[e,i]of Object.entries(t))e!=="start"&&typeof i=="number"&&this.recordTiming(e,i)}logAccumulatedStats(){if(this.stats.size===0)return;const t=(Date.now()-this.lastLogTime)/1e3,e=Array.from(this.stats.keys()).sort((a,r)=>a==="\u23F1\uFE0F"?-1:r==="\u23F1\uFE0F"?1:a.localeCompare(r)),i=[];for(const a of e){const r=this.stats.get(a),o=r.sum/r.count;i.push(`${a}[${r.min.toFixed(1)}/${o.toFixed(1)}/${r.max.toFixed(1)}]ms`)}const n=this.stats.get("\u23F1\uFE0F")?.count??0;ac.log(`\u{1F4CA} Stats (${t.toFixed(0)}s, ${n} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},Ka,Wn=0;function nN(){return Ka??(Ka=new sN),Ka}function aN(){Wn++;let t=!1;return()=>{t||Wn===0||(t=!0,Wn--,Wn===0&&Ry())}}function rN(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function oN(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])typeof n=="number"&&s.push(rN(n));return`Heap ${s.join(" / ")}`}function Oy(t,e,i,s,n={},a=R.zero,r){if(!nc.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:d=0,opsSkipped:u=0}=s??{},p=performance.now(),{start:g,...f}=e,y=p-g,m=nN();m.recordTimings(f),m.recordTiming("\u23F1\uFE0F",y);const x=Object.entries(f).map(([w,j])=>Ey(w,j)).filter(w=>w!=null).join(" + "),v=Object.entries(n).map(([w,j])=>`${w}: ${JSON.stringify(j)}`).join(" ; "),S=nc.check("scene:stats:verbose"),I=S?oN():null,M=S?JL.flush():{},D=Object.entries(M),C=[],A=[];for(const[w,j]of D)w.endsWith(":aggregation")&&Array.isArray(j)?C.push(`${w.replace(":aggregation","")}(${j.join(",")})`):w.endsWith(":nodeData")&&typeof j=="number"&&A.push(`${w.replace(":nodeData","")}(${j})`);const T=C.length>0?`Aggregation: ${C.join(", ")}`:null,L=A.length>0?`NodeData: ${A.join(", ")}`:null,N=[`${Ey("\u23F1\uFE0F",g,p)} (${x})`,`${v}`,T,L,`Layers: ${S?pu(o,l):t.size}`,S?`Nodes: ${pu(c,h)}`:null,S?`Ops: ${pu(d,u)}`:null,I].filter(tN),O=new QL(i),E=new Map(N.map(w=>[w,O.measureText(w)])),k=Math.max(...Array.from(E.values(),w=>w.width)),P=pN(E.values(),w=>w.height),F=2+a.x;i.save();try{i.fillStyle=r?.background??"white",i.fillRect(F,0,k,P),i.fillStyle=r?.foreground??"black";let w=0;for(const[j,q]of E.entries())w+=q.height,i.fillText(j,F,w)}catch(w){ac.warnOnce("Error during debug stats rendering",w)}finally{i.restore()}}function lN(t){const e=iN(eN("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);t.debugNodeSearch=i}function cN(t,e){t.save();try{for(const[i,s]of Object.entries(e)){const n=ve.toCanvas(s);if(!n){ac.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(n.x,n.y,n.width,n.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,n.x,n.y,n.width),t.fillText(i,n.x,n.y,n.width)}}catch(i){ac.warnOnce("Error during debug rendering",i)}finally{t.restore()}}var hN=new Set,dN=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function uN(t){const{...e}=t;for(const i of Object.keys(e))dN.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(hN.add(i),delete e[i]);return e}function rc(t,e){if(!nc.check(!0,"scene"))return{};let i=0;return{node:e==="json"?uN(t):t,name:t.name??t.id,dirty:t instanceof z?t.dirty:void 0,...Array.from(t instanceof z?t.children():[],s=>rc(s,e)).reduce((s,n)=>{let{name:a}=n;const{node:{visible:r,opacity:o,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:g}=n;(!r||o<=0)&&(a=`(${a})`),z.is(g)&&g.renderToOffscreenCanvas&&(a=`*${a}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,y=[`${(i++).toString().padStart(3,"0")}|`,`${a??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(v=>!!v).join(" ");let m=y,x=1;for(;s[m]!=null&&x<100;)m=`${y} (${x++})`;return s[m]=n,s},{})}}function wy(t){const e=t instanceof z?t.dirty:void 0;if(!e)return{dirtyTree:{},paths:[]};const i=Array.from(t instanceof z?t.children():[],a=>wy(a)).filter(a=>a.paths.length>0),s=z.is(t)?t.name??t.id:t.id,n=i.length?i.flatMap(a=>a.paths).map(a=>`${s}.${a}`):[s];return{dirtyTree:{name:s,node:t,dirty:e,...i.map(a=>a.dirtyTree).filter(a=>a.dirty!=null).reduce((a,r)=>(a[r.name??"<unknown>"]=r,a),{})},paths:n}}function pu(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function Ey(t,e,i){const s=i==null?e:i-e;return`${t}: ${Math.round(s*100)/100}ms`}function pN(t,e){let i=0;for(const s of t)i+=e(s);return i}function Ry(t=!1){if(!Ka){t&&(Wn=0);return}!t&&Wn>0||(Ka.destroy(),Ka=void 0,t&&(Wn=0))}var zt=class ei extends zn{constructor(e){super(e),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=ei.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=e?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),Hn(this.text))this.lines=[],this.richText??(this.richText=new z),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(e=>$a(e.text).split(du)).filter(Boolean).map(()=>new ei({trimText:!1})));else{const e=$a(this.text).split(du);this.lines=this.trimText?e.map(i=>i.trim()):e}}get font(){return this.fontCache??(this.fontCache=XL(this)),this.fontCache}static measureBBox(e,i,s,n){if(Hn(e)){const{font:a,lineHeight:r,textAlign:o,textBaseline:l}=n,{width:c,height:h,lineMetrics:d}=sc(e,a),u=r?r*d.length:h,p=ei.calcTopOffset(u,d[0],l),g=ei.calcLeftOffset(c,o);return new R(i-g,s-p,c,u)}else return ei.computeBBox($a(e).split(du),i,s,n)}static computeBBox(e,i,s,n){const{font:a,lineHeight:r,textAlign:o,textBaseline:l}=n,{width:c,height:h,lineMetrics:d}=uu(a).measureLines(e),u=r?r*d.length:h,p=ei.calcTopOffset(u,d[0],l),g=ei.calcLeftOffset(c,o);return new R(i-g,s-p,c,u)}static calcTopOffset(e,i,s){switch(s){case"alphabetic":return i?.ascent??0;case"middle":return e/2;case"bottom":return e;default:return 0}}static calcSegmentedTopOffset(e,i,s){switch(s){case"alphabetic":return i[0]?.ascent??0;case"middle":return i.length===1?i[0].ascent+i[0].segments.reduce((n,a)=>Math.min(n,uu(a).baselineDistance("middle")),0):e/2;case"bottom":return e;default:return 0}}static calcLeftOffset(e,i){let s=0;switch(i){case"center":s=.5;break;case"right":case"end":s=1}return e*s}getBBox(){const e=super.getBBox();if(!this.textMap?.size||!Hn(this.text))return e;const{height:i,lineMetrics:s}=sc(this.text,this),n=ei.calcSegmentedTopOffset(i,s,this.textBaseline),a=this.y-n;return e.y===a?e:new R(e.x,a,e.width,e.height)}computeBBox(){if(this.generateTextMap(),this.textMap?.size){const o=R.merge(this.textMap.values());return o.x=this.x-ei.calcLeftOffset(o.width,this.textAlign),o.y=this.y,o}const{x:e,y:i,lines:s,textBaseline:n,textAlign:a}=this,r=ei.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:a});return this.boxing!=null&&r.grow(this.boxPadding),r}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return qL(this.text)}isPointInPath(e,i){return this.getBBox()?.containsPoint(e,i)??!1}setScene(e){this.richText?.setScene(e),super.setScene(e)}generateTextMap(){if(!Hn(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let e=0;const i=this.richText.children();for(const{width:s,height:n,ascent:a,segments:r}of sc(this.text,this).lineMetrics){let o=0;for(const{color:l,textMetrics:c,...h}of r){const d=i.next().value;d.x=this.x-s/2+o,d.y=a+e,d.setProperties({...h,fill:l??this.fill});const u=d.getBBox();this.textMap.set(d,u),o+=c.width}e+=n}}render(e){const{ctx:i,stats:s}=e;if(!this.layerManager||!this.hasRenderableText())return s&&(s.nodesSkipped+=1),super.render(e);if(Hn(this.text)&&this.richText){this.generateTextMap();const n=this.richText.getBBox(),{width:a,height:r,lineMetrics:o}=sc(this.text,this);let l=0;switch(this.textAlign){case"left":case"start":l=a/2;break;case"right":case"end":l=a/-2}const c=this.y-ei.calcSegmentedTopOffset(r,o,this.textBaseline);this.renderBoxing(e,n.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(e),i.restore()}else this.renderText(e);if(ei.debug.check()){const n=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(n.x,n.y,n.width,n.height)}super.render(e)}markDirty(e){return this.textMap?.clear(),super.markDirty(e)}renderText(e){const{fill:i,stroke:s,strokeWidth:n,font:a,textAlign:r}=this;if(!i&&!(s&&n)||!this.layerManager)return super.render(e);const{ctx:o}=e;o.font!==a&&(o.font=a),o.textAlign=r,this.renderBoxing(e),this.fillStroke(o)}renderBoxing(e,i){if(!this.boxing)return;const s=i??ei.computeBBox(this.lines,this.x,this.y,this);if(s.width===0||s.height===0)return;const{x:n,y:a,width:r,height:o}=s.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=n,this.boxing.y=a,this.boxing.width=r,this.boxing.height=o,this.boxing.preRender(e),this.boxing.render(e)}executeFill(e){this.renderLines((i,s,n)=>e.fillText(i,s,n))}executeStroke(e){this.renderLines((i,s,n)=>e.strokeText(i,s,n))}renderLines(e){const{x:i,y:s,lines:n}=this;if(!Number.isFinite(i)||!Number.isFinite(s))return;const a=uu(this),{lineMetrics:r}=a.measureLines(n),{textBaseline:o,lineHeight:l=a.lineHeight()}=this;let c=0;o==="top"?c=r[0].ascent:(o==="middle"||o==="bottom")&&(c=l*(1-n.length),o==="middle"?(c/=2,c-=a.baselineDistance(o)):c-=r[0].descent);for(const h of r)e(h.text,i,s+c),c+=l}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}setBoxing(e){const i=e.border?.enabled?e.border?.stroke:void 0;e.fill!=null||i!=null?(this.boxing??(this.boxing=new ze({scene:this.scene})),this.boxing.fill=e.fill,this.boxing.fillOpacity=e.fillOpacity??1,this.boxing.cornerRadius=e.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=e.border?.strokeWidth??0,this.boxing.strokeOpacity=e.border?.strokeOpacity??1,this.boxPadding=e.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}getBoxingProperties(){const{fill:e,fillOpacity:i,cornerRadius:s,stroke:n,strokeWidth:a,strokeOpacity:r}=this.boxing??{};return{border:{enabled:n!=null,stroke:n,strokeWidth:a,strokeOpacity:r},cornerRadius:s,fill:e,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const e=this.text;if(e==null)return;const i=ky("text");if(Hn(e))for(const s of e){const n=ky("tspan");fy(n,{fontSize:s.fontSize??this.fontSize,fontFamily:s.fontFamily??this.fontFamily,fontWeight:s.fontWeight??this.fontWeight,fontStyle:s.fontStyle??this.fontStyle}),this.applySvgFillAttributes(n),n.textContent=$a(s.text),i.append(n)}else this.applySvgFillAttributes(i),fy(i,this),i.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),i.setAttribute("alignment-baseline",this.textBaseline),i.setAttribute("x",String(this.x)),i.setAttribute("y",String(this.y)),i.textContent=$a(e);return{elements:[i]}}hasRenderableText(){const{text:e}=this;return e==null?!1:Hn(e)?!0:$a(e)!==""}};zt.className="Text",zt.debug=KL.create(!0,"scene:text"),zt.defaultFontSize=10,b([K()],zt.prototype,"x",2),b([K()],zt.prototype,"y",2),b([ZL({changeCb:t=>t.onTextChange()})],zt.prototype,"text",2),b([K({changeCb:t=>{t.fontCache=void 0}})],zt.prototype,"fontStyle",2),b([K({changeCb:t=>{t.fontCache=void 0}})],zt.prototype,"fontWeight",2),b([K({changeCb:t=>{t.fontCache=void 0}})],zt.prototype,"fontSize",2),b([K({changeCb:t=>{t.fontCache=void 0}})],zt.prototype,"fontFamily",2),b([K()],zt.prototype,"textAlign",2),b([K()],zt.prototype,"textBaseline",2),b([K()],zt.prototype,"lineHeight",2);var Gt=zt,Py=class extends Ua(Gt){},Za=class extends Ua(Ha(Gt)){},Xa=class extends UL{constructor(t){super(),this.ctx=t,this.rectNode=new ze,this.textNode=new Gt,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new z({name:"background",zIndex:HL.CHART_BACKGROUND})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};b([ec,cu("node","visible")],Xa.prototype,"visible",2),b([ec,cu("rectNode","fill")],Xa.prototype,"fill",2),b([ec],Xa.prototype,"image",2),b([ec,cu("textNode")],Xa.prototype,"text",2);import{BaseProperties as gN,FONT_SIZE as fN,Property as jt,ProxyPropertyOnWrite as Zs,createId as mN,isArray as yN,isSegmentTruncated as bN,isTextTruncated as xN,toPlainText as _y,toTextString as vN,wrapText as SN,wrapTextSegments as IN}from"ag-charts-core";var ge=class extends gN{constructor(){super(...arguments),this.id=mN(this),this.node=new Py({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=fN.SMALLER,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(t,e){return t.eventsHub.on("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n}=this,a=Math.min(this.maxWidth??1/0,t)-s*2,r=this.maxHeight??e-s*2,o={maxWidth:a,maxHeight:r,font:this,textWrap:n};if(!Number.isFinite(a)&&!Number.isFinite(r)){this.node.text=i;return}let l;yN(i)?(l=IN(i,o),this.truncated=l.some(bN)):(l=SN(vN(i),o),this.truncated=xN(l)),this.node.text=l}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(!this.enabled||!this.text){this.destroyProxyText();return}const s=ve.toCanvas(this.node);if(!s)return;const{id:n}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:e}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",o=>this.handleMouseMove(t,o)),this.proxyText.addListener("mouseleave",o=>this.handleMouseLeave(t,o))]);const a=_y(this.text);a!==this.lastProxyTextContent&&(this.proxyText.textContent=a,this.lastProxyTextContent=a);const{lastProxyBBox:r}=this;(r==null||s.x!==r.x||s.y!==r.y||s.width!==r.width||s.height!==r.height)&&(this.proxyText.setBounds(s),this.lastProxyBBox={x:s.x,y:s.y,width:s.width,height:s.height})}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.truncated){const{x:i,y:s}=ve.toCanvas(this.node),n=e.sourceEvent.offsetX+i,a=e.sourceEvent.offsetY+s;t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:a,showArrow:!1},[{type:"structured",title:_y(this.text)}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const t of this.proxyTextListeners??[])t();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};ge.className="Caption",ge.SMALL_PADDING=10,b([jt,Zs("node","visible")],ge.prototype,"enabled",2),b([jt,Zs("node")],ge.prototype,"text",2),b([jt,Zs("node")],ge.prototype,"textAlign",2),b([jt,Zs("node")],ge.prototype,"fontStyle",2),b([jt,Zs("node")],ge.prototype,"fontWeight",2),b([jt,Zs("node")],ge.prototype,"fontSize",2),b([jt,Zs("node")],ge.prototype,"fontFamily",2),b([jt,Zs("node","fill")],ge.prototype,"color",2),b([jt],ge.prototype,"spacing",2),b([jt],ge.prototype,"maxWidth",2),b([jt],ge.prototype,"maxHeight",2),b([jt],ge.prototype,"wrapping",2),b([jt],ge.prototype,"padding",2),b([jt],ge.prototype,"layoutStyle",2);import{ChartAxisDirection as ki,every as DN,isObject as MN}from"ag-charts-core";var oc=class extends Array{destroy(){for(const t of this)t.destroy();this.length=0}findById(t){return this.find(e=>e.id===t)}matches(t){return this.length===Object.keys(t).length&&DN(t,(e,i)=>MN(i)&&"type"in i&&this.findById(e)?.type===i.type)}getById(t){const e=this.findById(t);if(!e)throw new Error(`Could not find axis by id [${t}].`);return e}},AN=class extends oc{get[ki.X](){return this.getById(ki.X)}get[ki.Y](){return this.getById(ki.Y)}perpendicular(t){const e=t.direction===ki.X?ki.Y:ki.X;return this[e]}},CN=class extends oc{get[ki.Angle](){return this.getById(ki.Angle)}get[ki.Radius](){return this.getById(ki.Radius)}};import{Property as gu,cachedTextMeasurer as TN,isArray as Fy,measureTextSegments as LN,toTextString as NN}from"ag-charts-core";var lc=class{constructor(){this.title=new ge,this.subtitle=new ge,this.footnote=new ge}positionCaptions({layoutBox:t}){const{title:e,subtitle:i,footnote:s}=this,n=t.height/10;e.enabled&&(this.positionCaption("top",e,t,n),this.shrinkLayoutByCaption("top",e,t)),i.enabled&&(this.positionCaption("top",i,t,n),this.shrinkLayoutByCaption("top",i,t)),s.enabled&&(this.positionCaption("bottom",s,t,n),this.shrinkLayoutByCaption("bottom",s,t))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:s}=this,{rect:n}=t.series;for(const a of[e,i,s])if(a.layoutStyle==="overlay"){if(a.textAlign==="left")a.node.x=n.x+a.padding;else if(a.textAlign==="right"){const r=a.node.getBBox();a.node.x=n.x+n.width-r.width-a.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){if(!e.text)return;const{lineMetrics:n}=Fy(e.text)?LN(e.text,e):TN(e).measureLines(NN(e.text)),a=Math.max(n[0].height,s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,a)}shrinkLayoutByCaption(t,e,i){if(e.layoutStyle==="block"){const s=e.node.getBBox().clone(),{spacing:n=0}=e;t==="bottom"&&Fy(e.text)&&(s.y-=s.height),i.shrink(Math.ceil(t==="top"?s.y-i.y+s.height+n:i.y+i.height-s.y+n),t)}}};b([gu],lc.prototype,"title",2),b([gu],lc.prototype,"subtitle",2),b([gu],lc.prototype,"footnote",2);import{CallbackCache as kN,ChartUpdateType as ON,CleanupRegistry as wN,EventEmitter as EN,ModuleRegistry as RN,ModuleType as PN}from"ag-charts-core";import{Logger as _N}from"ag-charts-core";var FN=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],VN=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t??(t="candlestick"),t}guardMemento(t){return t==null||FN.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>_N.error("error restoring state",n))}};import{CleanupRegistry as BN,Debug as zN}from"ag-charts-core";var fe="13.1.0",Vy=Symbol("previous-memento-not-found"),GN=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=zN.create(!0,"history"),this.cleanup=new BN,this.cleanup.register(t.on("series:undo",this.undo.bind(this)),t.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of e){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===Vy)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):Vy}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(fe,fe,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}};import{MementoCaretaker as jN,objectsEqual as UN}from"ag-charts-core";var HN=class{constructor(){this.caretaker=new jN(fe),this.state=new Map}setState(t,e){UN(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const s=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:s},t)}};import{attachListener as WN,createElement as Yn,createId as YN,entries as $N,getDocument as By,getWindow as fu,isDocumentFragment as KN,kebabCase as ZN,setAttribute as XN,stopPageScrolling as qN}from"ag-charts-core";var JN=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-background{position:absolute}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border: 1px solid #dddddd;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border: 1px solid #dddddd;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border: 1px solid #dddddd;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border: 1px solid #dddddd;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: 1px solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:var(--ag-charts-button-border);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border:var(--ag-charts-tooltip-border);border-radius:var(--ag-charts-tooltip-border-radius);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-button-border);color:var(--ag-charts-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2;+.ag-charts-toolbar__button{border-left-color:var(--ag-charts-accent-color)}}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-right-width:0}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);border-right-width:1px}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);border-right-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
`;import{CleanupRegistry as QN}from"ag-charts-core";var mu=class{constructor(){this.cleanup=new QN,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}};import{CleanupRegistry as ek,attachListener as tk,getDocument as ik,getWindow as sk,isHTMLElement as nk,setAttribute as zy}from"ag-charts-core";var ak=class kd{constructor(e,i,s){this.element=e,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new ek,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(e,i){this.cleanup.register(tk(e,"focus",()=>this.onTab(e,i)))}setGuardIndices(e){const i=e;zy(this.topTabGuard,"tabindex",i),zy(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let s;e.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(e,i){const s=sk();return Array.from(e.querySelectorAll(i)).filter(n=>{if(nk(n)){const a=s.getComputedStyle(n);return a.display!=="none"&&a.visibility!=="none"}return!1})}findEnterTarget(e){const i=kd.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=kd.queryFocusable(ik(),"[tabindex]").filter(a=>a.tabIndex>0).sort((a,r)=>a.tabIndex-r.tabIndex),{before:s,after:n}=kd.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,a,r;for(;s<=n;){const o=Math.floor((s+n)/2),l=e[o].tabIndex;if(l===i){a=e[o-1]||void 0,r=e[o+1]||void 0;break}else l<i?(a=e[o],s=o+1):(r=e[o],n=o-1)}return{before:a,after:r}}};import{getDocument as rk,getResizeObserver as ok,getWindow as Gy}from"ag-charts-core";import{getWindow as yu}from"ag-charts-core";var lk=class{constructor(t){this.callback=t,this.devicePixelRatio=yu("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=yu("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=yu("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},jy=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,s]of this.queuedObserveRequests)this.observe(i,s);this.queuedObserveRequests=[],this.observeWindow()};const t=ok();t!==void 0&&(this.resizeObserver=new t(i=>{for(const{target:s,contentRect:{width:n,height:a}}of i){const r=this.elements.get(s);this.checkSize(r,s,n,a)}}));let e;this.pixelRatioObserver=new lk(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=rk("readyState")==="complete",this.documentReady?this.observeWindow():Gy()?.addEventListener("load",this.onLoad)}destroy(){Gy()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,s){if(t&&(i!==t.size?.width||s!==t.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:s,pixelRatio:n},t.cb(t.size,e)}}observe(t,e){if(!this.documentReady){this.queuedObserveRequests.push([t,e]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const i={cb:e};this.elements.set(t,i)}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},po=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),e!==void 0&&super.set(t,e),delete this.cachedState,delete this.cachedValue,this}delete(t){return delete this.cachedState,delete this.cachedValue,super.delete(t)}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},ck='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas-background" aria-hidden="true"></div><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',hk=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],dk=new Set(["styles","canvas-container","canvas","tooltip-container"]),Uy={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},uk=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function pk(t,e){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===t&&e(n.intersectionRatio)},{root:t});return i.observe(t),i}var Hy={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return Hy}};function Wy(t,e){const i=Yn("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var cc=class Fa extends mu{constructor(e,i,s,n,a,r="normal"){super(),this.eventsHub=e,this.chart=i,this.styleContainer=n,this.skipCss=a,this.mode=r,this.anchorName=`--${YN(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new jy,this.cursorState=new po("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let o=!1;if(this.observer=pk(this.element,l=>{l===0&&!o&&this.eventsHub.emit("dom:hidden",null),o=l===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",JN),this.setContainer(s),this.cleanup.register(qN(this.element)),this.mode==="normal"){const l=this.rootElements["canvas-center"].element;if(l==null)throw new Error("Error initializing tab guards");const c=Wy(l,"beforebegin"),h=Wy(l,"afterend");this.tabGuards=new ak(l,c,h)}}initDOM(){if(this.mode==="normal"){const s=Yn("div");return s.innerHTML=ck,s.firstChild}const e=Yn("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const i=Yn("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:i}=this,s={};for(const n of hk){const a=`ag-charts-${n}`;let r;if(e==="normal"?r=i.classList.contains(a)?i:i.getElementsByClassName(a)[0]:dk.has(n)?r=i:r=i.getElementsByClassName(a)[0]??Yn("div"),r==null)throw new Error(`AG Charts - unable to find DOM element ${a}`);s[n]={element:r,children:new Map,listeners:[]}}return s}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const e of Object.values(this.rootElements)){for(const i of e.children.values())i.remove();e.element.remove()}this.element.remove()}postRenderUpdate(){this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Fa.batchedUpdateContainer.length===0&&fu().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Fa.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of Fa.batchedUpdateContainer)e.destroyed||e.updateContainer();Fa.batchedUpdateContainer.splice(0)}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.documentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);for(const[e,i]of this.styles)this.addStyles(e,i)}}setSizeOptions(e=300,i=300,s,n){const{style:a}=this.element;a.width=`${s??e}px`,a.height=`${n??i}px`,this.minWidth=s??e,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:e}=this.rootElements["canvas-center"].element;e.visibility=this.containerSize==null?"hidden":"",this.containerSize?(e.width=`${this.containerSize.width??0}px`,e.height=`${this.containerSize.height??0}px`):(e.width="",e.height=""),this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(!(e==null||e===this.container)){if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=e.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.eventsHub.emit("dom:resize",null)}),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(e){const i="ag-charts-theme-";for(const s of Array.from(this.element.classList))s.startsWith(i)&&s!==e&&this.element.classList.remove(s);this.element.classList.add(e)}setThemeParameters(e){for(const[i,s]of $N(e)){let n=`${s}`;i.endsWith("Size")||i.endsWith("Radius")?n=`${s}px`:i.endsWith("Border")&&typeof s=="boolean"&&(n=s?"var(--ag-charts-border)":"none"),this.element.style.setProperty(`--ag-charts-${ZN(i)}`,n)}}updateCanvasLabel(e){XN(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:e}addEventListener(e,i,s){const n=this.getEventElement(this.element,e);return WN(n,e,i,s)}removeEventListener(e,i,s){this.getEventElement(this.element,e).removeEventListener(e,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const e=fu(),i=new R(0,0,e.innerWidth,e.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??Hy}getRawOverlayClientRect(){let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let a;if(i!=null&&e===i)a=!0;else{const o=e.computedStyleMap?.()?.get("overflow-y")?.toString();a=o==="auto"||o==="scroll"}if(a)return R.fromObject(e.getBoundingClientRect());e=e.parentElement}if(this.documentRoot!=null)return R.fromObject(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=fu();return new R(0,0,s,n)}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??By("body");for(;e!=null;){if(e===i)return;if(KN(e.parentNode))return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],s=[];for(const n of i.values())s.push(R.fromObject(n.getBoundingClientRect()));return R.merge(s)}isManagedChildDOMElement(e,i,s){const{children:n}=this.rootElements[i],a=n?.get(s);return a!=null&&e.contains(a)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const s="data-ag-charts";if(this.styles.set(e,i),this.container==null||this.skipCss)return;const n=o=>o.getAttribute(s)===e,a=o=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of o.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=Yn("style");return this.chart.styleNonce!=null&&(d.nonce=this.chart.styleNonce),h==null?o.prepend(d):o.insertBefore(d,h.nextSibling),d};let r;this.styleContainer?r=a(this.styleContainer):this.initiallyConnected===!1?r=this.addChild("styles",e):this.documentRoot==null&&!Fa.headStyles.has(e)?(r=a(By("head")),Fa.headStyles.add(e)):this.documentRoot!=null&&(r=this.addChild("styles",e)),!(r==null||n(r))&&(r.setAttribute(s,e),r.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(e,i,s,n){const{element:a,children:r,listeners:o}=this.rootElements[e];if(!r)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(r.has(i))return r.get(i);const{childElementType:l="div"}=uk.get(e)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??Yn(l);for(const[h,d,u]of o)c.addEventListener(h,d,u);if(r.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),n){const h=a.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else a?.appendChild(c);return c}removeChild(e,i){const{children:s}=this.rootElements[e];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(e){const{dataset:i}=this.element;i[e]??(i[e]="0"),i[e]=String(Number(i[e])+1)}setDataBoolean(e,i){this.element.dataset[e]=String(i)}setDataNumber(e,i){this.element.dataset[e]=String(i)}updateContainerClassName(){const{element:e,containerSize:i,minWidth:s,minHeight:n}=this;e.classList.toggle(Uy.safeHorizontal,s>=(i?.width??1/0)),e.classList.toggle(Uy.safeVertical,n>=(i?.height??1/0))}};cc.className="DOMManager",cc.batchedUpdateContainer=[],cc.headStyles=new Set;var Yy=cc;import{CleanupRegistry as gk,createElement as fk,setElementStyle as mk}from"ag-charts-core";import{createElement as yk,createSvgElement as $y}from"ag-charts-core";var bk=class extends Is{constructor(){super(yk("div")),this.textElement=$y("text"),this.textElement.role="presentation",this.svgElement=$y("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(t){this.textElement.textContent=t;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}};import{createElement as xk}from"ag-charts-core";import{isButtonClickEvent as vk,setAttribute as Ky}from"ag-charts-core";var Sk=class{constructor(t,e){this.getDispatcher=e,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const s={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,s)}},this.onCollapsed=i=>{this.controller.setAriaExpanded(!1),i.mode==="0"&&this.controller.focus()},t.setAriaExpanded(!1),this.controller=t}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(t){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=t,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(t){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:t?.overrideFocusVisible})}},bu=class extends Is{constructor(t,e){super(t),Ky(this.elem,"role",e),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{vk(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new Sk(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(t){Ky(this.elem,"aria-disabled",!t)}setControlled(t){return this.lazyControllerImpl().setControlled(t)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(t){return this.lazyControllerImpl().expandControlled(t)}addListener(t,e){return super.addListener(t,(i,s)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,s)})}},hc=class extends bu{constructor(){super(xk("button"))}};import{createElement as Ik,setAttribute as Dk}from"ag-charts-core";var Zy=class extends Is{constructor(){super(Ik("div")),Dk(this.elem,"role","group")}destructor(){}};import{createElement as Mk,setAttribute as Ak,setElementStyle as Ck}from"ag-charts-core";import{PREV_NEXT_KEYS as xu,createElement as Tk,getAttribute as Lk,hasNoModifiers as Nk,setAttribute as Xy}from"ag-charts-core";var vu=class extends Is{constructor(t,e){super(Tk("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[a,r]=n==="both"?[xu.horizontal,xu.vertical]:[xu[n],void 0];let o=-1;if(Nk(i.sourceEvent)){const l=i.sourceEvent.key;l===a.nextKey||l===r?.nextKey?o=s.index+1:(l===a.prevKey||l===r?.prevKey)&&(o=s.index-1)}this.children[o]?.focus()},Xy(this.elem,"role",e),this.orientation=t}get orientation(){return Lk(this.elem,"aria-orientation")??"both"}set orientation(t){Xy(this.elem,"aria-orientation",t==="both"?void 0:t)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const t of this.children)this.removeChildListeners(t),t.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown)}removeChildListeners(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}onChildAdded(t){this.addChildListeners(t),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){this.removeChildListeners(t);const{focusedChildIndex:e,children:i}=this,s=e===t.index;for(let n=0;n<i.length;n++){const a=i[n];a.index===e&&(this.focusedChildIndex=n),a.index=n}if(s){const n=i[e]??i[e-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},kk=class extends vu{constructor(){super("both","list"),this.setHidden(!0)}destructor(){for(const t of this.children)t.getElement().parentElement.remove()}addChildToDOM(t,e){const i=Mk("div");Ak(i,"role","listitem"),Ck(i,"position","absolute"),Is.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}},qa=class extends Is{constructor(t){super(t)}destructor(){}};import{clamp as Ok,createElement as wk,formatPercent as Ek,getAttribute as Rk,setAttribute as Pk}from"ag-charts-core";var Su=class Fl extends Is{constructor(){super(wk("input")),this._step=Fl.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),e!==void 0)){const i=()=>this.getElement().step=e.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Rk(this.elem,"aria-orientation")??"both"}set orientation(e){Pk(this.elem,"aria-orientation",e==="both"?void 0:e),Fl.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=Ok(e,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(e,i){const{divider:s}=this.step,n=Math.round(e*1e4)/s,{ariaValueText:a=Ek(n/s)}=i??{},r=this.getElement();r.value=`${n}`,r.ariaValueText=a,r.ariaValueNow=`${n}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",Fl.onKeyDown):e.addListener("keydown",Fl.onKeyDown)}static onKeyDown(e,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};Su.STEP_ONE={attributeValue:"1",divider:1},Su.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Iu=Su;import{setAttribute as qy}from"ag-charts-core";var _k=class extends hc{constructor(){super(),qy(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){qy(this.elem,"aria-checked",t)}},dc=class extends vu{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function Ja(t,e){return e.params?.type===t}function Fk(t){if(t==="button")return new hc;if(t==="slider")return new Iu;if(t==="toolbar")return new dc;if(t==="group")return new Zy;if(t==="list")return new kk;if(t==="region")return new qa(fk("div"));if(t==="text")return new bk;if(t==="listswitch")return new _k;throw new Error("AG Charts - error allocating meta")}function Jy(t){const e={params:t,result:void 0};return e.result=Fk(e.params.type),e}var Vk=class{constructor(t,e,i){this.eventsHub=t,this.localeManager=e,this.domManager=i,this.cleanup=new gk}destroy(){this.cleanup.flush()}addLocalisation(t){t(),this.cleanup.register(this.eventsHub.on("locale:change",t))}createProxyContainer(t){const e=Jy(t),{params:i,result:s}=e,n=s.getElement();this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.role??i.type,Ja("toolbar",e)&&(e.result.orientation=e.params.orientation);const{ariaLabel:a}=i;return a&&this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(a.id,a.params)}),s}createProxyElement(t){const e=Jy(t);if(Ja("button",e)){const{params:i,result:s}=e,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:a}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(a.id,a.params)})}this.setParent(e.params,e.result)}if(Ja("slider",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.type="range",n.role=i.role??"presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(Ja("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(Ja("listswitch",e)){const{params:i,result:s}=e;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(Ja("region",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.role=i.role??"region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return mk(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),t.classList?.length&&i.classList.add(...t.classList),i}initInteract(t,e){const{tabIndex:i,domIndex:s}=t,n=this.initElement(t,e);i!==void 0&&(n.tabIndex=i),s!==void 0&&(e.domIndex=s)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i),e.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",t.domManagerId)}}}};import{Logger as Bk}from"ag-charts-core";var zk=/\$\{(\w+)}(?:\[(\w+)])?/gi,Du={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},Gk=({defaultValue:t,variables:e})=>t?.replaceAll(zk,(i,s,n)=>{const a=e[s],r=n==null?null:Du[n];return n!=null&&r==null&&Bk.warnOnce(`Format style [${n}] is not supported`),r!=null?r.format(a):typeof a=="number"?Du.number.format(a):a instanceof Date?Du.datetime.format(a):String(a)}),jk=class{constructor(t){this.eventsHub=t,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.eventsHub.emit("locale:change",null))}t(t,e={}){const{localeText:i=Am,getLocaleText:s}=this,n=i[t];return String(s?.({key:t,defaultValue:n,variables:e})??Gk({key:t,defaultValue:n,variables:e})??t)}};import{CleanupRegistry as Uk,Debug as Qa,EventEmitter as Hk,Logger as Wk,createId as Yk,downloadUrl as $k}from"ag-charts-core";import{ObserveChanges as Kk,createElement as Zk,getWindow as Xk}from"ag-charts-core";var Qy=class{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:e,height:i,canvasElement:s,willReadFrequently:n=!1}=t;this.pixelRatio=t.pixelRatio??Xk("devicePixelRatio")??1,this.element=s??Zk("canvas"),this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(e??0,i??0,this.pixelRatio),Gm(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:s,context:n}=this;s.width=Math.round(t*i),s.height=Math.round(e*i),n.setTransform(i,0,0,i,0,0),s.style.width=t+"px",s.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}clear(){zm(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};b([Kk(t=>t.onEnabledChange())],Qy.prototype,"enabled",2);import{EventEmitter as qk,getImage as Jk}from"ag-charts-core";var Qk=class extends qk{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(t,e){const i=this.cache.get(t);if(i?.image)return i.image;if(i!=null&&e){i.nodes.add(e);return}if(!e)return;const s={image:void 0,nodes:new Set([e])},n=Jk(),a=new n;return this.imageLoadingCount++,a.onload=()=>{s.image=a;for(const r of s.nodes)r.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:t})},a.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:t})},a.src=t,this.cache.set(t,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const t of this.cache.values())t.nodes.clear();this.cache.clear()}};import{Debug as eO}from"ag-charts-core";var tO=class{constructor(t){this.canvas=t,this.debug=eO.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i);for(const{canvas:s}of this.layersMap.values())s.resize(t,e,i)}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{name:n}=t,a=new Gd({width:e,height:i,pixelRatio:s});return this.layersMap.set(a,{id:this.nextLayerId++,name:n,canvas:a}),this.debug("Scene.addLayer() - layers",this.layersMap),a}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}},uc=class extends Hk{constructor(t){super(),this.debug=Qa.create(!0,"scene"),this.id=Yk(this),this.imageLoader=new Qk,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new Uk,this.updateDebugFlags(),this.canvas=new Qy(t),this.layersManager=new tO(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{Wk.warnOnce(`Unable to load image ${e}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(t){const{element:e}=this.canvas;return e.remove(),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?.setScene(),this.root=t,t&&(t.visible=!0,t.setScene(this)),this)}updateDebugFlags(){Qa.inDevelopmentMode(()=>vs._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>t.remove()}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return t.remove(),this}download(t,e){$k(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:s,debugColors:n}=t??{},{canvas:a,canvas:{context:r}={},root:o,width:l,height:c,pixelRatio:h}=this;if(!r)return;const d=Qa.check("scene:stats","scene:stats:verbose");d&&this.ensureDebugStatsRegistration();const u=performance.now(),p=this.applyPendingResize();if(o&&!o.visible){this.isDirty=!1;return}let g;if(o instanceof z&&(g=o.dirty),o!=null&&g===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:rc(o,"console")}),d&&Oy(this.layersManager,e,r,void 0,i,s,n);return}const f={ctx:r,width:l,height:c,devicePixelRatio:h,debugNodes:{}};Qa.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),lN(f);let y=!1;if((g!==!1||p)&&(y=!0,a.clear()),o&&Qa.check("scene:dirtyTree")){const{dirtyTree:m,paths:x}=wy(o);Qa.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:m,paths:x})}if(o&&y){if(o.visible&&o.preRender(f),this.debug.check()){const m=rc(o,"console");this.debug("Scene.render() - before",{canvasCleared:y,tree:m})}if(o.visible)try{r.save(),o.render(f),r.restore()}catch(m){throw this.canvas.reset(),m}}e["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,d&&Oy(this.layersManager,e,r,f.stats,i,s,n),cN(r,f.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:rc(o,"console"),canvasCleared:y})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const t=aN(),e=()=>{t(),this.releaseDebugStats=void 0};this.releaseDebugStats=e,this.cleanup.register(e)}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return vs.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),Ry(),Object.assign(this,{canvas:void 0})}};uc.className="Scene";import{deepClone as iO,isArray as sO,mergeDefaults as nO}from"ag-charts-core";var aO=class{constructor(t,e,i){this.eventsHub=t,this.annotationRoot=e,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||sO(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return nO(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:iO([...this.annotations])})}attachNode(t){return this.annotationRoot.append(t),()=>(t.remove(),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}};import{ZIndexMap as er}from"ag-charts-core";var rO=class{constructor(t,e){this.eventsHub=t,this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new z({name:"Axes-Grids",zIndex:er.AXIS_GRID}),this.axisGroup=new z({name:"Axes",zIndex:er.AXIS}),this.axisLabelGroup=new z({name:"Axes-Labels",zIndex:er.SERIES_LABEL}),this.axisCrosslineRangeGroup=new z({name:"Axes-Crosslines-Range",zIndex:er.SERIES_CROSSLINE_RANGE}),this.axisCrosslineLineGroup=new z({name:"Axes-Crosslines-Line",zIndex:er.SERIES_CROSSLINE_LINE}),this.axisCrosslineLabelGroup=new z({name:"Axes-Crosslines-Label",zIndex:er.SERIES_LABEL}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of e){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(t){for(const[,e]of this.axes)for(const i of e)if(i.axisId===t)return i}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}};import{ActionOnSet as eb,Debug as oO,Logger as tb,throttle as ib}from"ag-charts-core";var Mu=class{constructor(t,e,i){this.eventsHub=t,this.caller=e,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=oO.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(t){const{pendingData:e}=this;if(e!=null&&(e.params.windowStart==null&&e.params.windowEnd==null||e.params.windowStart?.valueOf()===t.windowStart?.valueOf()&&e.params.windowEnd?.valueOf()===t.windowEnd?.valueOf())){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,e.data);return}this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:t}=this;if(!t)return;const{params:e,fetchRequest:i}=t,s=await i;return{params:e,data:s}}restoreData(t){this.pendingData=t}createThrottledFetch(t){return ib(e=>this.fetch(e).catch(i=>tb.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return ib((e,i)=>this.dispatch(e,i),t,{leading:!0,trailing:!0})}dispatch(t,e){this.debug(`DataService - dispatching 'data-load' | ${t}`),this.eventsHub.emit("data:load",{data:e})}async fetch(t){"context"in this.caller&&(t.context=this.caller.context);const e=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),s=this.requestCounter++;this.debug(`DataService - requesting | ${s}`);let n;try{n=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(r){this.debug(`DataService - request failed | ${s}`),tb.errorOnce(`DataService - request failed | [${r}]`)}this.isLoadingInitialData=!1;const a=this.freshRequests.indexOf(e);return a===-1||this.dispatchOnlyLatest&&a!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${s}`),n):(this.freshRequests=this.freshRequests.slice(a+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(s,n):this.eventsHub.emit("data:error",null),n)});this.latestRequest={params:t,fetchRequest:e},this.freshRequests.push(e),await e}};b([eb({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],Mu.prototype,"dispatchThrottle",2),b([eb({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],Mu.prototype,"requestThrottle",2);import{ChartUpdateType as lO,cachedTextMeasurer as cO,getDocument as hO,getResizeObserver as dO}from"ag-charts-core";var uO=class{constructor(t,e){this.domManager=t,this.updateService=e,this.observers=[]}updateFonts(t){if(!(!t||t.size===0)){this.loadFonts(t);for(const e of t)this.observeFontStatus(e)}}destroy(){for(const t of this.observers)t.disconnect();this.observers=[]}loadFonts(t){const e=Array.from(t).map(a=>encodeURIComponent(a)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${e.join(s)}${i}&display=swap');
`;this.domManager.addStyles(`google-font-${e.join("-")}`,n)}observeFontStatus(t){const e=dO();if(e===void 0)return;const i=hO();if(!i)return;const s=i.createElement("div");s.style.setProperty("position","absolute"),s.style.setProperty("top","0"),s.style.setProperty("margin","0"),s.style.setProperty("padding","0"),s.style.setProperty("overflow","hidden"),s.style.setProperty("visibility","hidden"),s.style.setProperty("width","auto"),s.style.setProperty("max-width","none"),s.style.setProperty("font-synthesis","none"),s.style.setProperty("font-family",t),s.style.setProperty("font-size","16px"),s.style.setProperty("white-space","nowrap"),s.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(t)}`,s);const n=new e(a=>{const r=a?.at(0)?.contentBoxSize.at(0)?.inlineSize;r!=null&&r>0&&(cO.clear(),this.updateService.update(lO.PERFORM_LAYOUT))});n.observe(s),this.observers.push(n)}};import{Logger as pO,buildDateFormatter as sb,createNumberFormatter as gO,formatValue as nb,isPlainObject as Au,parseNumberFormat as fO,simpleMemorize2 as mO,toTextString as yO}from"ag-charts-core";import{Logger as bO}from"ag-charts-core";var ab=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===t);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(s){bO.errorOnce(s)}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},Qi={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},xO={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Ct={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},vO=/%[-_0]?L/,SO=/%[-_0]?S/,IO=/%[-_0]?M/,DO=/%[-_0]?[HI]/,MO=/^%[-_0]?[de]$/,AO=/^%[-_0]?[Bbm]$/,CO=/^%[-_0]?[Yy]$/;function TO(t,e,i){if(typeof t=="string")return t;t??(t=Qi);const{millisecond:s=Qi.millisecond,second:n=Qi.second,minute:a=Qi.minute,hour:r=Qi.hour,day:o=Qi.day,month:l=Qi.month,year:c=Qi.year}=t,h=Ct[e],d=xO[e],u=i?Ct[i]:-1;if(u<Ct.year&&h>=Ct.year&&!CO.test(c)||u<Ct.month&&h>=Ct.month&&!AO.test(l)||u<Ct.day&&h>=Ct.day&&!MO.test(o))return d;let p;switch(e){case"year":return c;case"month":return u<Ct.year?`${l} ${c}`:l;case"day":return u<Ct.year?`${l} ${o} ${c}`:`${l} ${o}`;case"hour":p=r;break;case"minute":p=a;break;case"second":p=n;break;case"millisecond":p=s;break;default:return d}if(h>=Ct.hour&&!DO.test(p)||h>=Ct.minute&&!IO.test(p)||h>=Ct.second&&!SO.test(p)||h>=Ct.millisecond&&!vO.test(p))return d;let g;return u<Ct.year?g=`${l} ${o} ${c}`:u<Ct.month&&(g=`${l} ${o}`),g?`${p} ${g}`:p}var tr=class Od extends ab{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=mO((e,i,s,n,a)=>{const r=Od.mergeSpecifiers(e,i)??Qi;return Od.getFormatter("date",r,s,n,{truncateDate:a})}),this.formatter=void 0}static mergeSpecifiers(...e){let i;for(const s of e)Au(s)&&Au(i)?i={...i,...s}:i=s;return i}static getFormatter(e,i,s,n="long",{truncateDate:a}={}){if(Au(i)){if(e!=="date"){pO.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const r=n==="component"?i?.[s]??Qi[s]:TO(i,s,a);return sb(r)}switch(e){case"number":{const r=fO(i);return r==null?void 0:gO(r)}case"date":return sb(i);case"category":return r=>i.replace("%s",String(r))}}setFormatter(e){this.formatter!==e&&(this.formatter=e,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(e,i,{specifier:s,truncateDate:n,allowNull:a}={}){if(i.value==null&&!a)return;const{formatter:r}=this;if(r==null)return;if(typeof r=="function"){const h=e(r,i);return h==null?void 0:String(h)}const o=r[i.property];if(o==null)return;if(typeof o=="function"){const h=e(o,i);return h==null?h:yO(h)}else if(i.type==="date"){const{unit:h,style:d}=i;return this.dateFormatter(o,s,h,d,n)?.(i.value)}const l=s??o;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=Od.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(e,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,a=typeof n=="function"?void 0:n?.[e.property];switch(e.type){case"date":{const{unit:r,style:o}=e,l=a!=null&&typeof a!="function"?a:void 0;return this.dateFormatter(l,i,r,o,s)?.(e.value)??String(e.value)}case"number":return nb(e.value,e.fractionDigits);case"category":return e.value==null?"":Array.isArray(e.value)?e.value.join(" - "):typeof e.value=="string"?e.value:typeof e.value=="number"?nb(e.value):String(e.value)}}};import{objectsEqual as LO,validate as NO}from"ag-charts-core";import{array as go,arrayOfDefs as kO,boolean as rb,commonChartOptionsDefs as pc,defined as ir,geoJson as OO,htmlElement as wO,object as ob,or as EO,positiveNumber as RO,required as lb,strictUnion as PO,string as sr,undocumented as cb,union as _O}from"ag-charts-core";var Cu={activeItem:{type:lb(PO()("series-node","legend")),seriesId:sr,itemId:lb(EO(sr,RO))}};Cu.frozen=cb(rb);var fo={mode:cb(_O("integrated","standalone")),container:wO,context:()=>!0,theme:ir,series:go,annotations:ir,navigator:ir,scrollbar:ir,initialState:{active:Cu,chartType:sr,annotations:ir,legend:kO({visible:rb,seriesId:sr,itemId:sr,legendItemName:sr},"legend state array"),zoom:ir}},FO={...pc,...fo,axes:ob,data:go},VO={...pc,...fo,axes:ob,data:go},BO={...pc,...fo,data:go,topology:OO},zO={...pc,...fo,data:go},hb=(t=>(t[t.Default=64]="Default",t[t.ZoomDrag=32]="ZoomDrag",t[t.Annotations=16]="Annotations",t[t.ContextMenu=8]="ContextMenu",t[t.Animation=4]="Animation",t[t.AnnotationsSelected=2]="AnnotationsSelected",t[t.Frozen=1]="Frozen",t[t.Clickable=82]="Clickable",t[t.Focusable=68]="Focusable",t[t.Keyable=86]="Keyable",t[t.ContextMenuable=72]="ContextMenuable",t[t.AnnotationsMoveable=18]="AnnotationsMoveable",t[t.AnnotationsDraggable=114]="AnnotationsDraggable",t[t.ZoomDraggable=100]="ZoomDraggable",t[t.ZoomClickable=68]="ZoomClickable",t[t.ZoomWheelable=118]="ZoomWheelable",t[t.All=126]="All",t))(hb||{}),db=class{constructor(){this.stateQueue=68}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}},GO=class{constructor(t,e,i,s,n){this.chartService=t,this.eventsHub=e,this.interactionManager=s,this.fireEvent=n,this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0;const a=i.addListener("pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:r}=this;r&&(this.restoreMemento(r.version,r.mementoVersion,r.memento),this.pendingMemento=void 0),a()})}isFrozen(){return this.interactionManager.isState(1)}clear(){this.update(void 0,void 0)}update(t,e){this.performUpdate("user-interaction",t,e,!1)}performUpdate(t,e,i,s){if(!this.updateable)return;const n=this.currentItem;if(this.currentItem=e,this.eventsHub.emit("active:update",e),s||!LO(n,e)){const{activeItem:a}=this.createMemento(),{datum:r}=i??{};this.fireEvent({type:"activeChange",source:t,activeItem:a,datum:r})}}createMemento(){switch(this.currentItem?.type){case"series-node":case"legend":{const{type:t,seriesId:e,itemId:i}=this.currentItem;return{activeItem:{type:t,seriesId:e,itemId:i}}}default:return this.currentItem?.type,{}}}guardMemento(t,e){if(t==null)return!0;const i=NO(t,fo.initialState.active);return e.push(...i.invalid.map(s=>s.toString())),i.invalid.length===0}restoreMemento(t,e,i){if(!this.didLayout){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.updateable=!1;const[s,n]=this.performRestoration(i?.activeItem);this.updateable=!0;const a=this.isFrozen(),r=i?.frozen,o=r===void 0?!1:a!==r;r===!0?this.interactionManager.pushState(1):r===!1&&this.interactionManager.popState(1),this.performUpdate("state-change",s,n,o)}performRestoration(t){let e=!1;const i=()=>e=!0;let s;const n=o=>s=o,a=this.pendingMemento!==void 0,r=this.chartService.id;return this.eventsHub.emit("active:load-memento",{initialState:a,chartId:r,activeItem:t,reject:i,setDatum:n}),e?[void 0,void 0]:[t,s]}};import{Debug as jO,EventEmitter as UO,Logger as ub,getWindow as HO}from"ag-charts-core";import{clamp as WO,isPlainObject as pb,linear as YO,objectsEqualWith as $O}from"ag-charts-core";import{Color as mo}from"ag-charts-core";function KO(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function gb(t,e){if(typeof t=="string")try{t=mo.fromString(t)}catch{t=mo.fromArray([0,0,0])}if(typeof e=="string")try{e=mo.fromString(e)}catch{e=mo.fromArray([0,0,0])}return i=>mo.mix(t,e,i).toRgbaString()}var Tu=.2,yo=["initial","remove","update","add","trailing","end","none"],gc={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:Tu,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+Tu,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function ZO(t){return t.every(e=>e instanceof vs)}function Lu(t){return ZO(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function Nu(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>Nu(i,e[s])):Wl(t)&&Wl(e)?t.equals(e):pb(t)&&pb(e)?$O(t,e,Nu):!1}var XO=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??YO,this.phase=t.phase;const e=t.duration??gc[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return Nu(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(s-e)):0}get delta(){return this.ease(WO(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||Wl(e))return this.interpolateValue(t,e);if(Array.isArray(e)){const s=[];for(let n=0;n<e.length;n++){const a=this.createInterpolator(t[n],e[n]);a!=null&&s.push(a)}return n=>{const a=[];for(const r of s)a.push(r(n));return a}}const i=[];for(const s of Object.keys(e)){const n=this.createInterpolator(t[s],e[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[a,r]of i)n[a]=r(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(Wl(t))return i=>t[Hl](e,i);try{switch(typeof t){case"number":return KO(t,e);case"string":return gb(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t;default:throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}};import{clamp as qO,isContinuous as JO,isFiniteNumber as fb,isNegative as QO,memo as fc,transformIntegratedCategoryValue as mb}from"ag-charts-core";import{isFiniteNumber as yb}from"ag-charts-core";function ew(t,e,i,s){return e<t.startIndex?(t.startIndex+=i,t.endIndex+=i,!1):e<t.endIndex||e===t.endIndex&&s?(t.endIndex+=i,!0):!1}function tw(t,e,i){const s=e+i;if(s<=t.startIndex)return t.startIndex=Math.max(0,t.startIndex-i),t.endIndex=Math.max(t.startIndex,t.endIndex-i),!1;if(e>=t.endIndex)return!1;if(e<=t.startIndex&&s>=t.endIndex)t.startIndex=e,t.endIndex=e;else if(e<=t.startIndex){const n=s-t.startIndex,a=t.endIndex-t.startIndex;t.startIndex=e,t.endIndex=t.startIndex+Math.max(0,a-n)}else s>=t.endIndex?t.endIndex=Math.max(t.startIndex,e):t.endIndex=Math.max(t.startIndex,t.endIndex-i);return!0}function bb(t,e){const i=Math.ceil(t/1e3);return Math.max(e,i)}function xb(t,e){return Math.max(1,Math.ceil(t/e))}function iw(t){return t.filter(e=>e.endIndex>e.startIndex)}function sw(t,e,i){if(!e.enableBanding||t<e.minDataSizeForBanding)return[i(0,t)];const s=bb(t,e.targetBandCount),n=xb(t,s),a=[];for(let r=0;r<t;r+=n){const o=Math.min(r+n,t);a.push(i(r,o))}return a}function nw(t,e){for(const i of e)i.insertCount>0&&t.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&t.handleRemoval(i.index,i.deleteCount)}function aw(t,e){for(const i of e)t.handleInsertion(i,0)}function rw(t,e){nw(t,e.spliceOps),e.updatedIndices.size>0&&aw(t,e.updatedIndices)}var ow=1e3,lw=10,vb=class{constructor(t={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:t.minDataSizeForBanding??ow,targetBandCount:t.targetBandCount??lw,maxBandSize:t.maxBandSize??1/0,enableBanding:t.enableBanding??!0}}applyIndexMap(t){rw(this,t)}initializeBands(t){this.dataSize=Math.max(0,t),this.bands=sw(this.dataSize,this.config,(e,i)=>this.createBand(e,i))}getBandCount(){return this.bands.length}handleInsertion(t,e){if(this.dataSize+=e,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=bb(this.dataSize,this.config.targetBandCount),s=xb(this.dataSize,i),n=Math.ceil(s*1.1);for(let a=0;a<this.bands.length;a++){const r=this.bands[a],o=a===this.bands.length-1;if(t===r.endIndex&&o&&e>0){r.endIndex-r.startIndex>=s?this.bands.push(this.createBand(t,t+e)):(r.endIndex+=e,r.isDirty=!0);break}ew(r,t,e,o)&&(r.isDirty=!0,e>0&&t<r.endIndex&&r.endIndex-r.startIndex>n&&this.splitBand(a,s))}}handleRemoval(t,e){if(e<=0||this.bands.length===0)return;const i=Math.min(e,Math.max(0,this.dataSize-t));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const s of this.bands)tw(s,t,i)&&(s.isDirty=!0);this.bands=iw(this.bands)}}splitBand(t,e){const i=this.bands[t],s=i.endIndex-i.startIndex,n=Math.min(e,Math.floor(s/2)),a=i.startIndex+n,r=this.createBand(i.startIndex,a),o=this.createBand(a,i.endIndex);this.bands.splice(t,1,r,o)}getStats(){const t=this.bands.filter(e=>e.isDirty);return{totalBands:this.bands.length,dirtyBands:t.length,dataSize:this.dataSize}}markRangeDirty(t,e){for(const i of this.bands)t<i.endIndex&&e>i.startIndex&&(i.isDirty=!0)}},ii=class CC{constructor(){this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(e){return e instanceof CC}setSortedUniqueMode(e,i){i&&(this.isSortedUnique=!0,this.sortOrder=e,this.sortedValues=[])}extend(e){this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(e),e instanceof Date&&(this.hasDateValues=!0)):e instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(e.valueOf())):this.domain.add(e)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let e=!1;return this.sortedValues.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}if(this.hasDateValues){const e=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...e,...Array.from(this.domain)]:e}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(e){if(this.isSortedUnique&&e.isSortedUnique&&this.sortOrder===e.sortOrder&&this.sortOrder!==void 0&&e.sortedValues){e.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...e.sortedValues);return}if(this.convertToSetMode(),e.hasDateValues&&(this.hasDateValues=!0),e.isSortedUnique&&e.sortedValues)for(const i of e.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of e.dateTimestamps)this.dateTimestamps.add(i);for(const i of e.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const e of this.sortedValues)e instanceof Date?this.dateTimestamps.add(e.valueOf()):this.domain.add(e);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},si=class TC{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof TC}static extendDomain(e,i=[1/0,-1/0]){for(const s of e)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(e){typeof e!="number"&&!(e instanceof Date)||(this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e))}getDomain(){return[...this.domain]}},bo=class extends vb{constructor(t,e={},i=!1){super(e),this.fullDomainCache=null,this.sortOrder=void 0,this.isUnique=!1,this.domainFactory=t,this.isDiscrete=i}setSortOrderMetadata(t,e){this.sortOrder=t,this.isUnique=e}createBand(t,e){const i=this.domainFactory();return this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&ii.is(i)&&i.setSortedUniqueMode(this.sortOrder,this.isUnique),{startIndex:t,endIndex:e,subDomain:i,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.fullDomainCache=null}handleInsertion(t,e){super.handleInsertion(t,e),this.fullDomainCache=null}handleRemoval(t,e){super.handleRemoval(t,e),this.fullDomainCache=null}splitBand(t,e){this.bands.length>1&&super.splitBand(t,e)}markBandsDirty(t,e){this.markRangeDirty(t,e),this.fullDomainCache=null}markAllBandsDirty(){for(const t of this.bands)t.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(t,e){const i=t.length;for(const s of this.bands){if(!s.isDirty)continue;const n=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&ii.is(n)&&n.setSortedUniqueMode(this.sortOrder,this.isUnique),s.subDomain=n;const{startIndex:a,endIndex:r}=s;for(let o=a;o<r&&o<i;o++)e?.[o]||s.subDomain.extend(t[o]);s.isDirty=!1}this.fullDomainCache=null}getDirtyBands(){return this.bands.filter(t=>t.isDirty)}extend(t){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const t of this.bands)if(!ii.is(t.subDomain)||!t.subDomain.isSortedUniqueMode()||t.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const t=new ii;t.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const e of this.bands)ii.is(e.subDomain)&&t.mergeFrom(e.subDomain);return t.getDomain()}deduplicateNulls(t){let e=!1;return t.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}getDomain(){if(this.fullDomainCache!==null)return this.fullDomainCache;if(this.bands.length===0)return this.fullDomainCache=[],[];if(this.bands.length===1){const t=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(t):t,this.fullDomainCache}if(this.isDiscrete){const t=this.bands[0].subDomain;if(ii.is(t))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const e=new ii;for(const i of this.bands)ii.is(i.subDomain)&&e.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(e.getDomain())}else{const e=new Set;for(const i of this.bands)for(const s of i.subDomain.getDomain())e.add(s);this.fullDomainCache=Array.from(e)}}else{let t,e;for(const i of this.bands){const s=i.subDomain.getDomain();if(s.length===2){const[n,a]=s;(t===void 0||n!=null&&t!=null&&n<t)&&(t=n),(e===void 0||a!=null&&e!=null&&a>e)&&(e=a)}}t!==void 0&&e!==void 0?this.fullDomainCache=[t,e]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const t=this.bands.filter(i=>i.isDirty).length,e=this.bands.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:t,averageBandSize:this.bands.length>0?e/this.bands.length:0,dataSize:this.dataSize}}};function Sb(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function cw(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,aggregateFunction:s=>Sb(s),groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function hw(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>si.extendDomain(s)}}function Ib(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function dw(t,e){const i=e?.visible??!0;return{id:t,matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:n=>Sb(n),groupAggregateFunction:(n,a=[0,0,-1])=>(i&&(a[0]+=n?.[0]??0,a[2]++,a[1]+=n?.[1]??0),a),finalFunction:(n=[0,0,0])=>{const a=n[0]+n[1];return a>=0?[0,a/n[2]]:[a/n[2],0]}}}function Db(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,a=[])=>{const r=a[1]-a[0];return e.aggregateFunction(n).map(o=>o/r)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function uw(t){return()=>{let e=0;return i=>yb(i)?(e+=t?Math.max(0,i):i,e):i}}function pw(){return()=>{let t=0;return e=>{if(!yb(e))return e;const i=t;return t+=e,i}}}import{Debug as gw,Logger as Oi,first as Mb}from"ag-charts-core";import{first as Ab}from"ag-charts-core";import{isObject as fw}from"ag-charts-core";var ku="\0__AG_NULL__\0",Ou="\0__AG_UNDEFINED__\0";function Cb(t){return t===null?ku:t===void 0?Ou:Array.isArray(t)?"["+t.map(Cb).join(",")+"]":fw(t)?JSON.stringify(t):String(t)}function wu(t){return t.map(Cb).join("-")}function Ut(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function Tb(t,e){return e?.get(t.id)??0}function Eu(t){return"scopes"in t&&Array.isArray(t.scopes)}function Xs(t,e){const i=[];for(let s=0;s<t;s+=1)i[s]=e;return i}function mc(t){const e=new Set;for(const i of t.values())i&&e.add(i);return e}function Ru(t,e,i=!1){const s=[];for(const n of t){const a=n?.[e];if(a==null&&!i)return;s.push(a)}return s}function mw(t){const e=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(t);){if(s.index!==i)return;i=s.index+s[0].length;const a=s[1].trim();if(a.startsWith("."))e.push(a.slice(1).trim());else if(a.startsWith("[")){const r=a.slice(1,-1).trim();r.startsWith("'")?e.push(r.slice(1,-1).replaceAll(/(?<!\\)\\'/g,"'")):r.startsWith('"')?e.push(r.slice(1,-1).replaceAll(/(?<!\\)\\"/g,'"')):e.push(r)}else e.push(a)}if(i===t.length)return e}function yw(t){return e=>{let i=e;for(const s of t)i=i[s];return i}}var bw=class{constructor(t,e,i){this.ctx=t,this.scopeCacheManager=e,this.resolvers=i}aggregateUngroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i,dataSources:s}=t,n=Ab(s.keys()),a=t.keys.map(l=>l.get(n)),r=s.get(n)?.data??[],o=this.ctx.keys.some(l=>l.allowNullKey===!0);t.aggregation=r?.map((l,c)=>{const h=[];for(const[d,u]of this.ctx.aggregates.entries()){const p=this.valueGroupIdxLookup(u);let g=u.groupAggregateFunction?.()??[1/0,-1/0];const f=p.map(v=>i[v][c]),y=Ru(a,c,o),m=y==null?void 0:u.aggregateFunction(f,y);m&&(g=u.groupAggregateFunction?.(m,g)??si.extendDomain(m,g));const x=u.finalFunction?.(g)??g;h[d]=x,si.extendDomain(x,e[d])}return h})}aggregateGroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[s,n]of this.ctx.aggregates.entries()){const a=this.valueGroupIdxLookup(n);for(let r=0;r<t.groups.length;r++){const o=t.groups[r];o.aggregation??(o.aggregation=[]);const l=o.keys;let c=n.groupAggregateFunction?.()??[1/0,-1/0];const h=Math.max(...a.map(u=>o.datumIndices[u]?.length??0));for(let u=0;u<h;u++){const p=a.map(f=>{const y=o.datumIndices[f]?.[u];if(y==null)return;const m=this.resolvers.resolveAbsoluteIndex(r,y);return i[f][m]}),g=n.aggregateFunction(p,l);g&&(c=n.groupAggregateFunction?.(g,c)??si.extendDomain(g,c))}const d=n.finalFunction?.(c)??c;o.aggregation[s]=d,si.extendDomain(d,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this.ctx,{columnScopes:i,columns:s,invalidData:n}=t;for(const a of e){const r=this.valueGroupIdxLookup(a),o=a.adjust()();for(let l=0;l<t.groups.length;l++){const c=t.groups[l];o(s,r,c,l)}for(const l of r){const h=this.ctx.values[l].valueType==="category",d=s[l],u=Ab(i[l]),p=n?.get(u),g=h?new ii:new si;for(let f=0;f<d.length;f+=1)p?.[f]!==!0&&g.extend(d[f]);t.domain.values[l]=g.getDomain()}}}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}},xw=class{constructor(t){this.ctx=t}setupDomainForDefinition(t,e,i){const s=t.valueType==="category";let n=e.get(t);return!n&&this.ctx.bandingConfig?.enableBanding!==!1&&(n=new bo(s?()=>new ii:()=>new si,this.ctx.bandingConfig,s),e.set(t,n)),n&&s&&n.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),n||(s?new ii:new si)}extendDomainFromData(t,e,i){if(t instanceof bo)t.extendBandsFromData(e,i);else for(let s=0;s<e.length;s++)i?.[s]!==!0&&t.extend(e[s])}initializeBandedDomain(t,e,i){if(!(t instanceof bo))return;const s=t.getStats(),n=s.bandCount===0||s.dataSize!==e;this.ctx.debug.check()&&n&&i&&this.ctx.debug(`Reinitializing bands for ${i}: bandCount=${s.bandCount}, dataSize=${s.dataSize}, dataLength=${e}`),n&&t.initializeBands(e)}};import{first as vw,iterate as Lb}from"ag-charts-core";var qs=Symbol("key-sort-orders"),Pu=Symbol("column-sort-orders"),_u=Symbol("domain-ranges"),xo=Symbol("domain-bands"),$n=Symbol("reducer-bands"),Nb=Object.freeze([0]);import{Logger as Sw,isNegative as Fu}from"ag-charts-core";function Vu(t,e){if(typeof e=="string")t.set(e,(t.get(e)??0)+1);else for(const i of e)t.set(i,(t.get(i)??0)+1)}function yc(t,e){if(t.reusableResult.valid=!1,t.hasInvalidValue){t.reusableResult.value=t.invalidValue,t.domain.extend(t.invalidValue);return}t.mode!=="integrated"&&Sw.warnOnce(`invalid value of type [${typeof e}] for [${t.def.scopes} / ${t.def.id}] ignored:`,`[${e}]`),t.reusableResult.value=void 0}function vo(t,e,i,s,n,a){return t&&e&&t(i,s,n)===!1?(a.reusableResult.missing=!1,yc(a,i),a.reusableResult):null}function So(t,e,i,s,n){n.missing=!t,!t&&!e&&Vu(i,s)}function bc(t,e,i){return e.valid=!0,e.value=t,i.extend(t),e}var Iw=class{constructor(t){this.ctx=t}createProcessValueFn(t,e,i,s,n,a){const r={def:t,accessor:e,domain:i,reusableResult:s,processorFns:n,mode:this.ctx.mode};return(a==="extend"?this.createSpecializedProcessValue(r,t.validation):null)??this.createGenericProcessValue(r,a)}createSpecializedProcessValue(t,e){return t.def.forceValue!=null?this.createSpecializedProcessValueForceValue(t):t.def.processor?this.createSpecializedProcessValueProcessor(t,e):e?t.def.type==="key"?this.createSpecializedProcessValueKeyValidation(t,e):this.createSpecializedProcessValueValueValidation(t,e):null}createValidationMeta(t){const{def:e,domain:i,reusableResult:s,mode:n}=t;return{reusableResult:s,hasInvalidValue:"invalidValue"in e,invalidValue:e.invalidValue,domain:i,def:e,mode:n}}createSpecializedProcessValueKeyValidation(t,e){const{def:i,accessor:s,domain:n,reusableResult:a}=t,r=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=i.allowNullKey??!1,d=this.createValidationMeta(t);if(s){const u=s;return function(g,f,y){let m;try{m=u(g)}catch{}const x=m!=null||h&&m==null,v=!h&&m==null;return!x||v||e(m,g,f)===!1?(a.missing=!x,!x&&!o&&Vu(c,y),yc(d,m),a):(a.missing=!1,a.valid=!0,a.value=m,n.extend(m),a)}}return function(p,g,f){const y=r in p,m=y?p[r]:l,x=!h&&m==null;return!y||x||e(m,p,g)===!1?(a.missing=!y,!y&&!o&&Vu(c,f),yc(d,m),a):(a.missing=!1,a.valid=!0,a.value=m,n.extend(m),a)}}createSpecializedProcessValueValueValidation(t,e){const{def:i,accessor:s,domain:n,reusableResult:a}=t,r=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=this.createValidationMeta(t);if(s){const d=s;return function(p,g,f){let y;try{y=d(p)}catch{}const m=y!=null,x=vo(e,m,y,p,g,h);return x!==null?x:(So(m,o,c,f,a),bc(y,a,n))}}return function(u,p,g){const f=r in u,y=f?u[r]:l,m=vo(e,f,y,u,p,h);return m!==null?m:(So(f,o,c,g,a),bc(y,a,n))}}createSpecializedProcessValueForceValue(t){const{def:e,accessor:i,domain:s,reusableResult:n}=t,a=e.property,r=e.forceValue;if(i){const o=i;return function(c,h,d){let u;try{u=o(c)}catch{}const f=u!=null&&Fu(u)?-1*r:r;return n.missing=!1,n.valid=!0,n.value=f,s.extend(f),n}}return function(l,c,h){const d=a in l,u=d?l[a]:void 0,g=d&&Fu(u)?-1*r:r;return n.missing=!1,n.valid=!0,n.value=g,s.extend(g),n}}createSpecializedProcessValueProcessor(t,e){const{def:i,accessor:s,domain:n,reusableResult:a,processorFns:r}=t,o=i.property,l="missingValue"in i,c=i.missingValue,h=i.missing,d=i.processor,u=this.createValidationMeta(t);if(s){const p=s;return function(f,y,m){let x;try{x=p(f)}catch{}const v=x!=null,S=vo(e,v,x,f,y,u);if(S!==null)return S;So(v,l,h,m,a);let I=r.get(i);return I==null&&(I=d(),r.set(i,I)),x=I(x,y),bc(x,a,n)}}return function(g,f,y){const m=o in g;let x=m?g[o]:c;const v=vo(e,m,x,g,f,u);if(v!==null)return v;So(m,l,h,y,a);let S=r.get(i);return S==null&&(S=d(),r.set(i,S)),x=S(x,f),bc(x,a,n)}}createGenericProcessValue(t,e){const{def:i,accessor:s,domain:n,processorFns:a}=t,r=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=e==="extend",d=t.reusableResult,u=this.createValidationMeta(t);return function(g,f,y){let m,x;if(s){try{m=s(g)}catch{}x=m!=null}else x=r in g,m=x?g[r]:l;i.forceValue!=null&&(m=x&&Fu(m)?-1*i.forceValue:i.forceValue,x=!0),So(x,o,c,y,d);const v=i.allowNullKey??!1;if(i.type==="key"&&m==null&&!v)return yc(u,m),d;const I=vo(i.validation,x,m,g,f,u);if(I!==null)return I;if(d.valid=!0,i.processor){let M=a.get(i);M==null&&(M=i.processor(),a.set(i,M)),m=M(m,f)}return h&&n.extend(m),d.value=m,d}}};function Dw(t,e){return!t||!e||t.length===0||e.length===0?!0:t.some(i=>e.includes(i))}function kb(t,e){if(t.valueType==="category"){for(const i of e)if(i.property===t.property&&i.valueType===t.valueType&&Dw(i.scopes,t.scopes)&&i.validation===t.validation)return i}}var Mw=class{constructor(t,e,i){this.ctx=t,this.initializer=e,this.scopeCacheManager=i,this.processValueFactory=new Iw(t)}recomputeDomains(t){const e=this.ctx.debug.check()?performance.now():0,i=t[xo];let s;const n=t[qs],a=this.setupDefinitionDomains(this.ctx.keys,i,n),r=new Map;for(const h of this.ctx.values){const d=kb(h,this.ctx.keys);d&&r.set(h,d)}const o=this.setupValueDomainsWithSharing(this.ctx.values,i,a,r),l=new Set;for(const[,h]of r){const d=a.get(h);d&&l.add(d)}this.initializeDomainBands(this.ctx.keys,a,h=>{const d=t.keys[h];return Math.max(...Array.from(d.values()).map(u=>u.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,o,h=>t.columns[h].length,h=>String(h.property));const c=new Map;if(i.size>0){s={totalBands:0,dirtyBands:0,totalData:0};for(const h of i.values())if(h instanceof bo){const d=h.getStats();c.set(h,d),s.totalBands+=d.bandCount,s.dirtyBands+=d.dirtyBandCount,s.totalData=Math.max(s.totalData,d.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,a,(h,d)=>t.keys[h]?.get(d),h=>h.scopes??[],h=>t.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,o,(h,d)=>t.columns[h],h=>[vw(h.scopes)],h=>t.invalidKeys?.get(h),l),t.domain.keys=this.ctx.keys.map(function(d){const u=a.get(d),p=u.getDomain();return si.is(u)&&p[0]>p[1]?[]:p}),t.domain.values=this.ctx.values.map(function(d){const u=o.get(d),p=u.getDomain();return si.is(u)&&p[0]>p[1]?[]:p}),t.type==="grouped"&&(t.domain.groups=t.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(t,a,o,i,c),this.ctx.debug.check()&&e>0){const d=performance.now()-e;if(s&&s.totalBands>0){const u=s.dirtyBands/s.totalBands,p=Math.round(u*s.totalData);this.ctx.debug(`recomputeDomains with banding: ${d.toFixed(2)}ms, bands: ${s.dirtyBands}/${s.totalBands} dirty, data scanned: ~${p}/${s.totalData} (${(u*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${d.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(t,e,i){const s=new Map;for(const[n,a]of t.entries()){const r=i?.get(n);s.set(a,this.initializer.setupDomainForDefinition(a,e,r))}return s}initializeDomainBands(t,e,i,s){for(const[n,a]of t.entries()){const r=e.get(a);if(!r)continue;const o=i(n);this.initializer.initializeBandedDomain(r,o,s(a))}}extendDomainsFromData(t,e,i,s,n,a){for(const[r,o]of t.entries()){const l=e.get(o);if(l&&!a?.has(l))for(const c of s(o)){if(!c)continue;const h=i(r,c);if(!h)continue;const d=n(c);this.initializer.extendDomainFromData(l,h,d)}}}setupValueDomainsWithSharing(t,e,i,s){const n=new Map;for(const a of t){const r=s.get(a);if(r){const o=i.get(r);if(o){n.set(a,o);continue}}n.set(a,this.initializer.setupDomainForDefinition(a,e))}return n}initDataDomainProcessor(t){const{keys:e,values:i}=this.ctx,s=new Set;for(const u of i)if(u.scopes)for(const p of u.scopes)s.add(p);const n=new Map,a=new Map;let r=!0;const o=()=>{for(const u of e)u.valueType==="category"?n.set(u,new ii):n.set(u,new si);for(const u of i){const p=kb(u,e);if(p){const g=n.get(p);if(g){n.set(u,g),r&&(r=(u.scopes?.length??0)===s.size);continue}}u.valueType==="category"?n.set(u,new ii):(n.set(u,new si),r&&(r=(u.scopes?.length??0)===s.size))}};o();const l=this.scopeCacheManager.buildAccessors(Lb(e,i)),c=new WeakMap;for(const u of Lb(e,i)){const p=l.get(u.property),g=n.get(u),f={value:void 0,missing:!1,valid:!1},y=this.processValueFactory.createProcessValueFn(u,p,g,f,a,t);c.set(u,y)}function h(u){const p=c.get(u);if(!p)throw new Error("AG Charts - missing processValue function for definition");return p}function d(u,p,g,f){return h(u)(p,g,f)}return{dataDomain:n,processValue:d,getProcessValue:h,initDataDomain:o,scopes:s,allScopesHaveSameDefs:r}}collectDomainBandingMetadata(t,e,i,s,n){t.optimizations??(t.optimizations={});const a=(l,c)=>l.map(h=>{const d=c.get(h),u=s.get(h),p=d instanceof bo;let g;p||(g=h.valueType==="category"?"discrete domain":"not configured");let f;if(p&&u){const y=n.get(u)??u.getStats(),m=y.bandCount>0?y.dirtyBandCount/y.bandCount:0;f={totalBands:y.bandCount,dirtyBands:y.dirtyBandCount,dataSize:y.dataSize,scanRatio:m}}return{property:String(h.property),applied:p,reason:g,stats:f}}),r=a(this.ctx.keys,e),o=a(this.ctx.values,i);t.optimizations.domainBanding={keyDefs:r,valueDefs:o}}};import{Logger as Aw,first as Cw,iterate as Tw}from"ag-charts-core";function Lw(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function Nw(t,e){const i=typeof e=="number"?e:e?.valueOf?.();if(typeof i!="number"||!Number.isFinite(i))return;if(t.lastValue===void 0){t.lastValue=i;return}const s=i-t.lastValue;if(s===0)t.isUnique=!1;else if(t.isOrdered){const n=s>0?1:-1;t.sortOrder===0?t.sortOrder=n:t.sortOrder!==n&&(t.isOrdered=!1)}t.lastValue=i}function kw(t){return{sortOrder:t.isOrdered&&t.sortOrder!==0?t.sortOrder:void 0,isUnique:t.isUnique,isDirty:!1}}var Ow=class{constructor(t,e){this.ctx=t,this.domainManager=e,this.markScopeDatumInvalid=function(i,s,n,a,r){for(const o of i){a.has(o)||(a.set(o,Xs(s.length,!1)),r.set(o,0));const l=a.get(o);l[n]||(l[n]=!0,r.set(o,r.get(o)+1))}}}extractData(t){const{dataDomain:e,getProcessValue:i,allScopesHaveSameDefs:s}=this.domainManager.initDataDomainProcessor("extend"),{keys:n,values:a}=this.ctx,{invalidData:r,invalidKeys:o,invalidKeyCount:l,invalidDataCount:c,allKeyMappings:h,keySortOrders:d}=this.extractKeys(n,t,i),{columns:u,columnScopes:p,columnNeedValueOf:g,partialValidDataCount:f,maxDataLength:y}=this.extractValues(r,c,a,t,o,i),m=x=>{const v=e.get(x),S=v.getDomain();return si.is(v)&&S[0]>S[1]?[]:S};return{type:"ungrouped",input:{count:y},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...h.values()],columns:u,columnScopes:p,columnNeedValueOf:g,invalidKeys:o,invalidKeyCount:l,invalidData:r,invalidDataCount:c,domain:{keys:n.map(m),values:a.map(m)},defs:{allScopesHaveSameDefs:s,keys:n,values:a},partialValidDataCount:f,time:0,version:0,[_u]:new Map,[qs]:d,[Pu]:new Map,[xo]:new Map,[$n]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,a=new Map,r=new Map,o=new Map,l=new Map;let c,h;const d=t.map(p=>i(p)),u=(p,g)=>{const f=h.get(p);c.set(g,c.get(f)),s.has(f)&&(s.set(g,s.get(f)),n.set(g,n.get(f)),r.set(g,r.get(f)))};for(const[p,g]of t.entries()){const{invalidValue:f,scopes:y}=g,m=d[p];c=new Map,h=new Map,o.set(g,c);const x=Lw();for(const v of y??[]){const S=e.get(v)?.data??[];if(h.has(S)){u(S,v);continue}const I=[];c.set(v,I),h.set(S,v);let M,D,C=0;for(let A=0;A<S.length;A++){if(S[A]==null||typeof S[A]!="object"){M??(M=Xs(S.length,!1)),D??(D=Xs(S.length,!1)),C+=1,M[A]=!0,D[A]=!0,I.push(f);continue}const T=m(S[A],A,v);if(T.valid){I.push(T.value),Nw(x,T.value);continue}I.push(f),M??(M=Xs(S.length,!1)),D??(D=Xs(S.length,!1)),C+=1,M[A]=!0,D[A]=!0}M&&D&&(s.set(v,M),n.set(v,D),a.set(v,C),r.set(v,C))}l.set(p,kw(x))}return{invalidData:n,invalidKeys:s,invalidKeyCount:a,invalidDataCount:r,allKeyMappings:o,keySortOrders:l}}extractValues(t,e,i,s,n,a){let r=0;const o=[],l=[],c=[];let h=0;const d=i.map(u=>a(u));for(const[u,p]of i.entries()){const{invalidValue:g}=p,f=d[u];if(new Set(p.scopes.map(D=>s.get(D))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(p)}`);const m=new Set(p.scopes),x=Cw(p.scopes),v=s.get(x)?.data??[],S=new Array,I=n.get(x);let M=!1;for(let D=0;D<v.length;D++){if(v[D]==null||typeof v[D]!="object"){this.markScopeDatumInvalid(p.scopes,v,D,t,e),S[D]=g;continue}const C=v[D],A=I==null?!1:I[D],T=f(C,D,p.scopes);let L=T.value;(A||!T.valid)&&this.markScopeDatumInvalid(p.scopes,v,D,t,e),A?L=g:T.valid||(r+=1,L=g),!M&&L!=null&&typeof L=="object"&&(M=!0),S[D]=L}o.push(S),l.push(m),c.push(M),h=Math.max(h,S.length)}return{columns:o,columnScopes:l,columnNeedValueOf:c,partialValidDataCount:r,maxDataLength:h}}warnDataMissingProperties(t){if(t.size!==0)for(const e of Tw(this.ctx.keys,this.ctx.values))for(const[i,s]of e.missing){if(s<(t.get(i)?.data.length??1/0))continue;const n=i==null?"":` for ${i}`;Aw.warnOnce(`the key '${e.property}' was not found in any data element${n}.`)}}};import{first as ww}from"ag-charts-core";var Ew=class{constructor(t){this.ctx=t}groupData(t,e){var i;const{keys:s,columns:n,columnScopes:a,invalidKeys:r,invalidData:o}=t,l=t.scopes,c=[],h=[],d=l.size!==1||e!=null?new Map:void 0;let u=!0,p=0;const g=l.size,f=this.groupBatches(l,n,a,s,o,r),y=f.length;if(this.ctx.debug?.check()&&!t.optimizations&&(t.optimizations={}),this.ctx.debug?.check()){const v=g>0?1-y/g:0;t.optimizations.batchMerging={originalBatchCount:g,mergedBatchCount:y,mergeRatio:v}}const m=f.length===1,x=Object.freeze(Xs(f[0][1].length,Nb));for(const[v,S,I,M,D,C]of f){const A=n[ww(S)];for(let T=0;T<A.length;T++){if(C?.[T]===!0)continue;const L=I.map(w=>w[T]);if(L==null||L.length===0)throw new Error("AG Charts - no keys found for scope(s): "+v.join(", "));const N=e?.(L)??L,O=d==null?void 0:wu(N);let E=d?.get(O),k,P,F=!1;if(E==null?(k={keys:N,datumIndices:[],aggregation:[],validScopes:l},P=p++,E=[P,k],F=!0,d?.set(O,E),c.push(k.keys),h.push(k)):([P,k]=E,u=!1),D?.[T]===!0){k.validScopes===l&&(k.validScopes=new Set(l.values()));for(const w of M)k.validScopes.delete(w)}if(F&&T===P&&m)k.datumIndices=x;else{!F&&k.datumIndices===x&&(k.datumIndices=x.map(w=>[...w]));for(const w of S)(i=k.datumIndices)[w]??(i[w]=[]),k.datumIndices[w].push(T-P)}}}return{...t,type:"grouped",domain:{...t.domain,groups:c},groups:h,groupsUnique:u,optimizations:t.optimizations,[xo]:t[xo],[$n]:t[$n]}}groupBatches(t,e,i,s,n,a){const r=[],o=new Set;for(const l of t){const c=e.map((g,f)=>f).filter(g=>!o.has(g)&&i[g].has(l));if(c.length===0)continue;for(const g of c)o.add(g);const h=new Set;for(const g of c)for(const f of i[g])h.add(f);const d=s.map(g=>g.get(l)).filter(g=>g!=null),u=n?.get(l),p=a?.get(l);r.push([l,c,d,h,u,p])}return this.mergeCompatibleBatches(r)}areBatchesCompatible(t,e){const[,,i,,s,n]=t,[,,a,,r,o]=e;return i.every((l,c)=>l===a[c])&&n===o&&s===r}mergeCompatibleBatches(t){const e=[],i=new Set;for(let s=0;s<t.length;s++){if(i.has(s))continue;const[n,a,r,o,l,c]=t[s],h=[[n],[...a],r,new Set(o),l,c];this.findAndMergeCompatibleBatches(t,s,h,i),e.push(h),i.add(s)}return e}findAndMergeCompatibleBatches(t,e,i,s){const n=t[e];for(let a=e+1;a<t.length;a++){if(s.has(a))continue;const r=t[a],[o,l,,c]=r;if(this.areBatchesCompatible(n,r)){i[0].push(o),i[1].push(...l);for(const h of c)i[3].add(h);s.add(a)}}}};import{first as Io}from"ag-charts-core";function Ob(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount>0}function Rw(t){return t.removedIndices.size===0&&t.totalAppendCount===0&&t.totalPrependCount>0}function Pw(t){return t.removedIndices.size===0}function _w(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0&&e.deleteCount===0)}function Fw(t){return t.removedIndices.size>0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0)}function Vw(t){const{removedIndices:e}=t;if(e.size===0)return!1;const i=Array.from(e).sort((s,n)=>s-n);if(i[0]!==0)return!1;for(let s=0;s<i.length;s++)if(i[s]!==s)return!1;return!0}function Bw(t){return Vw(t)&&t.totalAppendCount>0&&t.totalPrependCount===0}var zw=class{constructor(t,e){this.indexMap=t,this.prependValues=e.prependValues,this.appendValues=e.appendValues,this.insertionValues=e.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((t,e)=>t-e)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((t,e)=>t-e)}forEachPreservedIndex(t){const{originalLength:e,removedIndices:i,totalPrependCount:s}=this.indexMap;let n=0;const a=Array.from(i).sort((o,l)=>o-l);let r=0;for(let o=0;o<e;o++){for(;r<a.length&&a[r]<o;)n++,r++;if(!i.has(o)){const l=o+s-n;t(o,l)}}}getPrependedValues(){return this.prependValues}getAppendedValues(){return this.appendValues}getInsertionValues(){return this.insertionValues}applyToArray(t,e,i){const{spliceOps:s,finalLength:n,originalLength:a}=this.indexMap;if(!(a===n&&s.length===0)){for(const r of s){const o=r.insertCount>0?Array.from({length:r.insertCount},function(h,d){return e(r.index+d)}):[],l=t.splice(r.index,r.deleteCount,...o);i&&l.length>0&&i(l,r)}t.length!==n&&(t.length=n)}}};import{first as Gw}from"ag-charts-core";var jw=class extends vb{constructor(t={}){super(t),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(t,e){return{startIndex:t,endIndex:e,cachedResult:void 0,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(t,e,i=!1){const s=t.reducer();for(const n of this.bands){if(i&&!n.isDirty)continue;const a=t.needsOverlap&&n.startIndex>0?Math.max(0,n.startIndex-1):n.startIndex,r=this.evaluateRange(t,s,e,a,n.endIndex);n.cachedResult=r,n.isDirty=!1}}getResult(t){const e=this.bands.map(i=>i.cachedResult);return t.combineResults(e)}evaluateRange(t,e,i,s,n){let a=t.initialValue;const{keyColumns:r,keysParam:o,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;h<c;h+=1){for(let d=0;d<o.length;d++)o[d]=r[d]?.[h];a=e(a,o)}return a}captureStatsBeforeProcessing(){const t=this.bands.filter(i=>i.isDirty),e=t.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);this.lastDirtyBandCount=t.length,this.lastScanRatio=this.dataSize>0?e/this.dataSize:0,this.statsCaptured=!0}getStats(){const t=this.bands.filter(s=>!s.isDirty&&s.cachedResult!==void 0);let e,i;if(this.statsCaptured)e=this.lastDirtyBandCount,i=this.lastScanRatio;else{const s=this.bands.filter(a=>a.isDirty),n=s.reduce((a,r)=>a+(r.endIndex-r.startIndex),0);e=s.length,i=this.dataSize>0?n/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:e,dataSize:this.dataSize,scanRatio:i,cacheHits:t.length}}},wb=class{constructor(t={}){this.bandingConfig=t}static evaluateRange(t,e,i,s,n){let a=t.initialValue;const{keyColumns:r,keysParam:o,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;h<c;h+=1){for(let d=0;d<o.length;d++)o[d]=r[d]?.[h];a=e(a,o)}return a}evaluate(t,e,i={}){var s;const n=this.createContext(t,e);if(!n)return;e[s=$n]??(e[s]=new Map);const a=e[$n],r=t.property;let o=a.get(r);return o||(o=new jw(this.bandingConfig),a.set(r,o)),o.getBandCount()===0&&o.initializeBands(n.rawData.length),i.beforeEvaluate?.(o,n),o.captureStatsBeforeProcessing(),o.evaluateFromData(t,n,i.reuseCleanBands??!1),o.getResult(t)}applyIndexMap(t,e){const i=t[$n];if(i)for(const s of i.values())s.applyIndexMap(e)}createContext(t,e){if(e.type!=="ungrouped")return;const i=Eu(t)?t.scopes[0]:Gw(e.dataSources.keys());if(i==null)return;const s=e.dataSources.get(i)?.data??[],n=e.keys.map(r=>r.get(i)).filter(r=>r!=null),a=n.map(()=>{});return{scopeId:i,rawData:s,keyColumns:n,keysParam:a}}},Uw=class{constructor(t,e){this.ctx=t,this.reducerManager=e}isReprocessingSupported(t){if(t.type==="grouped"){if(!t.groupsUnique||this.getUniqueDataSets(t).size!==1)return!1;const n=Io(t.scopes);if(t.invalidKeys?.get(n)?.some(r=>r))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(s=>s.supportsBanding!==!0||typeof s.combineResults!="function")||this.ctx.processors.some(s=>s.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(s=>s.supportsReprocessing??!1)}reprocessData(t,e,i,s,n,a){const r=performance.now(),o=this.collectScopeChanges(t,e);if(o.size===0)return t;this.commitPendingTransactions(t);const l=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),h=this.processAllInsertions(t,o,l,c);this.processAllUpdates(t,o,l,c,h),this.updateBandsForChanges(t,o);const d=this.transformKeysArrays(t,o,h);this.transformColumnsArrays(t,o,h),this.transformInvalidityArrays(t,o,h),this.reprocessBandedReducers(t,o),t.type==="grouped"&&(this.transformGroupsArray(t,o,h),this.ctx.groupProcessors.length>0&&s(t,o)),this.invalidateSortOrdersForChanges(t,o),n(t),this.reprocessProcessors(t),t.reduced?.diff!=null&&o.size>0&&this.generateDiffMetadata(t,o,d),this.updateProcessedDataMetadata(t);const u=performance.now();t.time=u-r,t.version+=1,a(t,"reprocess");const p=mc(o);return t.changeDescription=p.size===1?p.values().next().value:void 0,t}updateBandsForChanges(t,e){const i=t[xo];if(i.size===0)return;const s=mc(e);for(const n of s){const{indexMap:a}=n;for(const r of i.values())r.applyIndexMap(a)}}reprocessBandedReducers(t,e){if(t.type!=="ungrouped")return;const i=this.ctx.reducers.filter(s=>s.supportsBanding&&typeof s.combineResults=="function");if(i.length!==0){t.reduced??(t.reduced={});for(const s of i){const n=this.reducerManager.evaluate(s,t,{reuseCleanBands:!0,beforeEvaluate:(a,r)=>{if(!r.scopeId)return;const o=e.get(r.scopeId);o&&a.applyIndexMap(o.indexMap)}});n!==void 0&&(t.reduced[s.property]=n)}}}collectScopeChanges(t,e){const i=new Map;for(const[s,n]of t.dataSources){const a=e?.get(n)??n.getChangeDescription();a&&i.set(s,a)}return i}commitPendingTransactions(t){const e=this.getUniqueDataSets(t);for(const i of e)i.commitPendingTransactions()}buildDefinitionProcessors(t,e){return t.map((i,s)=>({def:i,index:s,processValue:e(i)}))}processAllInsertions(t,e,i,s){const n=new Map;for(const[a,r]of e){const o=t.dataSources.get(a);if(!o)continue;const l=this.processInsertionsOnce(a,r,o,i,s);n.set(a,l)}return n}processAllUpdates(t,e,i,s,n){for(const[a,r]of e){const o=t.dataSources.get(a);if(!o)continue;const l=r.getUpdatedIndices();if(l.length===0)continue;let c=n.get(a);c||(c=new Map,n.set(a,c));for(const h of l){if(h<0||h>=o.data.length)continue;const d=this.processDatum(o,h,a,i,s);d&&c.set(h,d)}}}processInsertionsOnce(t,e,i,s,n){const a=new Map,{finalLength:r}=e.indexMap;for(const o of e.indexMap.spliceOps)if(!(o.insertCount<=0))for(let l=0;l<o.insertCount;l++){const c=o.index+l;if(c<0||c>=r)continue;const h=this.processDatum(i,c,t,s,n);h&&a.set(c,h)}return a}processDatum(t,e,i,s,n){const a=t.data[e],r=new Map,o=new Map;let l=!1,c=!1;if(a==null||typeof a!="object")l=!0,c=!0;else{for(const{index:h,def:d,processValue:u}of s){if(!d.scopes?.includes(i))continue;const p=u(a,e,i);r.set(h,{value:p.value,valid:p.valid}),p.valid||(l=!0)}for(const{index:h,def:d,processValue:u}of n){if(!d.scopes?.includes(i))continue;const p=u(a,e,d.scopes);o.set(h,{value:p.value,valid:p.valid}),p.valid||(c=!0)}}return{keys:r,values:o,hasInvalidKey:l,hasInvalidValue:c}}transformArraysWithCache(t,e,i,s,n,a){for(const[r,o]of t.entries())for(const l of n(o)){const c=e.get(l);if(!c)continue;const h=s(r,l);if(!h)continue;const d=i.get(l);this.applyChangeDescWithCache(c,h,d,(u,p)=>a(u,o,r))}}transformKeysArrays(t,e,i){const s=new Map,n=o=>{let l=s.get(o);return l||(l={tuples:[]},s.set(o,l)),l},a=new WeakSet;for(const[o,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=e.get(c);if(!h)continue;const d=t.keys[o]?.get(c);if(!d)continue;if(a.has(d)){const f=Array.from(t.keys[o].entries()).find(([y,m])=>m===d)?.[0];f&&f!==c&&s.has(f)&&s.set(c,s.get(f));continue}a.add(d);const u=i.get(c),p=n(c);let g=0;this.applyChangeDescWithCache(h,d,u,f=>{const y=f?.keys.get(o);return y?.valid?y.value:l.invalidValue},f=>{for(const y of f)p.tuples[g]||(p.tuples[g]=new Array(this.ctx.keys.length)),p.tuples[g][o]=y,g+=1})}const r=new Map;for(const[o,{tuples:l}]of s){if(l.length===0)continue;const c=new Set;for(const h of l){const d=[];for(const[u,p]of h.entries())this.ctx.keys[u].scopes?.includes(o)&&d.push(p);d.length>0&&c.add(wu(d))}r.set(o,c)}return r}transformColumnsArrays(t,e,i){this.transformArraysWithCache(this.ctx.values,e,i,s=>t.columns[s],s=>[Io(s.scopes)],(s,n,a)=>{if(s){if(s.hasInvalidKey)return n.invalidValue;const r=s.values.get(a);return r?.valid?r.value:n.invalidValue}return n.invalidValue})}transformInvalidityMap(t,e,i,s){const n=new Set;for(const[a,r]of e){let o=t.get(a);if(!o){const c=i.get(a);if(c&&Array.from(c.values()).some(s))o=Xs(r.indexMap.originalLength,!1),t.set(a,o);else continue}if(n.has(o))continue;n.add(o);const l=i.get(a);this.applyChangeDescWithCache(r,o,l,(c,h)=>s(c))}}transformInvalidityArrays(t,e,i){t.invalidKeys&&this.transformInvalidityMap(t.invalidKeys,e,i,s=>s?.hasInvalidKey??!1),t.invalidData&&this.transformInvalidityMap(t.invalidData,e,i,s=>s?s.hasInvalidKey||s.hasInvalidValue:!1)}applyChangeDescWithCache(t,e,i,s,n){t.applyToArray(e,r=>{const o=i?.get(r);return s(o,r)},n);const a=t.getUpdatedIndices();if(a.length!==0)for(const r of a){if(r<0||r>=e.length)continue;const o=i?.get(r);e[r]=s(o,r)}}transformGroupsArray(t,e,i){const s=Io(t.scopes),n=e.get(s);if(!n)return;const a=i.get(s);for(const[,o]of a??[])if(o.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");n.applyToArray(t.groups,o=>this.createDataGroupForInsertion(o,t,s,a));const r=n.getUpdatedIndices();if(r.length>0)for(const o of r)o<0||o>=t.groups.length||(t.groups[o]=this.createDataGroupForInsertion(o,t,s,a))}createDataGroupForInsertion(t,e,i,s){const n=[];for(const d of e.keys){const u=d.get(i);u&&n.push(u[t])}const a=e.groups[0],r=()=>Object.freeze(Xs(e.columnScopes.length,Nb)),o=a?.datumIndices??r(),c=s?.get(t)?.hasInvalidValue??!1;let h;return c?(h=new Set(e.scopes),h.delete(i)):h=e.scopes,{keys:n,datumIndices:o,aggregation:[],validScopes:h}}generateDiffMetadata(t,e,i){const s=(n,a)=>{const r=[];for(const o of t.keys){const l=o.get(n);if(!l)return;r.push(l[a])}return r.length>0?wu(r):void 0};for(const[n,a]of e){const r={changed:!0,added:new Set,removed:i.get(n)??new Set,updated:new Set,moved:new Set};for(const c of a.indexMap.spliceOps)if(c.insertCount>0)for(let h=0;h<c.insertCount;h++){const d=c.index+h,u=s(n,d);u&&r.added.add(u)}const{originalLength:o,totalPrependCount:l}=a.indexMap;if(!Ob(a.indexMap))if(Rw(a.indexMap)&&o>0)for(let c=l;c<l+o;c++){const h=s(n,c);h&&r.moved.add(h)}else if(Pw(a.indexMap)&&l>0)for(let c=0;c<o;c++){const h=c+l,d=s(n,h);d&&r.moved.add(d)}else a.forEachPreservedIndex((c,h)=>{if(c!==h){const d=s(n,h);d&&r.moved.add(d)}});t.reduced.diff[n]=r}}updateProcessedDataMetadata(t){let e=0;for(const s of t.dataSources.values())e=Math.max(e,s.data.length);t.input.count=e;let i=0;for(const[s,n]of t.invalidData??new Map){const a=t.invalidKeys?.get(s);for(let r=0;r<n.length;r++)n[r]&&!a?.[r]&&(i+=1)}t.partialValidDataCount=i,this.recountInvalid(t.invalidKeys,t.invalidKeyCount),this.recountInvalid(t.invalidData,t.invalidDataCount),this.invalidateCachesForChanges(t)}updateSortOrderForAppend(t,e,i){if(i.length===0)return;const s=r=>{if(typeof r=="number")return r;if(r instanceof Date)return r.valueOf()};let n=s(e);const a=t.sortOrder;for(const r of i){const o=s(r);if(o===void 0)continue;if(n===void 0){n=o;continue}const l=o-n;if(l===0&&(t.isUnique=!1),t.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==a&&(t.sortOrder=void 0)}n=o}}updateKeySortOrdersForAppend(t,e){for(const[i,s]of t.keys.entries()){const n=t[qs].get(i);if(!n)continue;const a=Io(s.values());if(!a||a.length<=e)continue;const r=e>0?a[e-1]:void 0,o=a.slice(e);this.updateSortOrderForAppend(n,r,o)}}invalidateSortOrdersForChanges(t,e){const i=mc(e);let s=!0,n=!1,a=!1,r,o;for(const l of i){const{indexMap:c}=l;_w(c)||(Ob(c)?(n=!0,r=c.originalLength):Fw(c)||(Bw(c)?(a=!0,o={originalLength:c.originalLength,removedCount:c.removedIndices.size}):s=!1))}s?n&&r!==void 0?this.updateKeySortOrdersForAppend(t,r):a&&o&&this.updateKeySortOrdersForRollingWindow(t,o):(t[qs].clear(),t[Pu].clear())}updateKeySortOrdersForRollingWindow(t,e){const{originalLength:i,removedCount:s}=e;for(const[n,a]of t.keys.entries()){const r=t[qs].get(n);if(!r)continue;const o=Io(a.values());if(!o||o.length===0)continue;const l=i-s,c=l>0?o[l-1]:void 0,h=o.slice(l);this.updateSortOrderForAppend(r,c,h)}}invalidateCachesForChanges(t){this.markDomainRangesDirty(t[_u])}markDomainRangesDirty(t){for(const e of t.values())e.isDirty=!0}recountInvalid(t,e){if(!(!t||!e))for(const[i,s]of t){const n=s.filter(Boolean).length;n===0?(t.delete(i),e.delete(i)):e.set(i,n)}}reprocessProcessors(t){if(this.ctx.processors.length!==0){t.reduced??(t.reduced={});for(const e of this.ctx.processors){const i=t.reduced[e.property],s=e.incrementalCalculate?.(t,i)??e.calculate(t,i);t.reduced[e.property]=s}}}getUniqueDataSets(t){return new Set(t.dataSources.values())}},Kn=0,Zn=1,es=2,Hw=class Vl{constructor(e){this.isDirty=!1;const i=e.reduce((a,r)=>Math.max(a,r.length),0),{maxLevelSize:s,buffer:n}=Vl.createBuffer(i);this.maxLevelSize=s,this.buffer=n,this.dataLength=i,this.populateBuffer(e)}static computeMaxLevelSize(e){let s=1<<32-Math.clz32(e);return e===s/2&&(s=s>>>1),s}static createBuffer(e){const i=Vl.computeMaxLevelSize(e),s=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:s}}populateBuffer(e){const{maxLevelSize:i,buffer:s}=this,n=i-1;for(const a of e){const r=a.length;for(let o=0;o<r;o+=1){const l=Number(a[o]);if(l!==l)continue;const c=n+o<<1,h=s[c],d=s[c+1];(h!==h||l<h)&&(s[c]=l),(d!==d||l>d)&&(s[c+1]=l)}}for(let a=i>>>1;a>=1;a>>>=1){const r=a-1,o=r+a<<1;let l=r<<1,c=o;for(let h=0;h<a;h+=1){const d=c+2,u=s[c],p=s[d];s[l]=p!==p||u<p?u:p;const g=s[c+1],f=s[d+1];s[l+1]=f!==f||g>f?g:f,l+=2,c+=4}}}rebuild(e){const i=e.reduce((n,a)=>Math.max(n,a.length),0);if(Vl.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:n,buffer:a}=Vl.createBuffer(i);this.maxLevelSize=n,this.buffer=a}this.dataLength=i,this.populateBuffer(e)}updateValue(e,i){const{maxLevelSize:s,buffer:n}=this,a=s+e-1,r=Math.trunc(a*es)+Kn,o=Math.trunc(a*es)+Zn;n[r]=Number.NaN,n[o]=Number.NaN;for(const l of i){const c=Number(l),h=n[r],d=n[o];(!Number.isFinite(h)||c<h)&&(n[r]=c),(!Number.isFinite(d)||c>d)&&(n[o]=c)}this.propagateUp(a)}updateValues(e){for(const{index:i,values:s}of e)this.updateValue(i,s)}propagateUp(e){const{buffer:i}=this;for(;e>0;){const s=Math.trunc((e-1)/2),n=2*s+1,a=2*s+2,r=i[Math.trunc(n*es)+Kn],o=i[Math.trunc(n*es)+Zn],l=i[Math.trunc(a*es)+Kn],c=i[Math.trunc(a*es)+Zn];i[Math.trunc(s*es)+Kn]=!Number.isFinite(l)||r<l?r:l,i[Math.trunc(s*es)+Zn]=!Number.isFinite(c)||o>c?o:c,e=s}}computeRangeInto(e,i,s,n,a,r,o){const l=a+r-1;if(l<i||a>=s)return o;if(a>=i&&l<s){const c=e[Math.trunc(n*es)+Kn],h=e[Math.trunc(n*es)+Zn];Number.isFinite(c)&&(o[0]=Math.min(o[0],c)),Number.isFinite(h)&&(o[1]=Math.max(o[1],h))}else r>1&&(n=Math.trunc(n*2),r=Math.trunc(r/2),this.computeRangeInto(e,i,s,Math.trunc(n+1),a,r,o),this.computeRangeInto(e,i,s,Math.trunc(n+2),a+r,r,o));return o}rangeBetween(e,i,s){const n=s??[0,0];if(e>i)return n[0]=Number.NaN,n[1]=Number.NaN,n;const{maxLevelSize:a,buffer:r}=this;return n[0]=1/0,n[1]=-1/0,this.computeRangeInto(r,e,i,0,0,a,n),n}getRange(e){const{buffer:i}=this,s=e??[0,0];return s[0]=i[Kn],s[1]=i[Zn],s}get range(){const{buffer:e}=this;return[e[Kn],e[Zn]]}get length(){return this.dataLength}};function Ww(t,e){const i=t.length;if(t.length<=1)return 1;let s=0,n=t[0];for(let a=1;a<i;a++){const r=t[a];if(r==null)continue;if(typeof(e?r.valueOf():r)!="number")return;const l=Math.sign(r-n);if(l!==0){if(s!==0&&s!==l)return;s=l}n=r}return s===0?1:s}var Yw=class{constructor(t){this.ctx=t,this.rangeBetweenBuffer=[0,0]}resolveMissingDataCount(t){let e=0;for(const i of this.ctx.values)e=Math.max(e,i.missing.get(t.id)??0);return e}resolveProcessedDataDefById(t,e){const i=this.ctx.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveKeysById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return n.get(t.id)}hasColumnById(t,e){return this.ctx.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return n}resolveColumnNeedsValueOf(t,e,i){const s=this.resolveProcessedDataIndexById(t,e);return i.columnNeedValueOf?.[s]??!0}resolveAbsoluteIndex(t,e){return t+e}getDomain(t,e,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,s],n){const a=e.map(d=>this.resolveProcessedDataIndexById(t,d)),r=n.input.count;if(i<=0&&s>=r){const d=n.domain.values;let u=1/0,p=-1/0;for(const g of a){const f=d[g];f!=null&&(f[0]<u&&(u=f[0]),f[1]>p&&(p=f[1]))}return this.rangeBetweenBuffer[0]=u,this.rangeBetweenBuffer[1]=p,this.rangeBetweenBuffer}const o=a.join(":"),l=n[_u],c=a.map(d=>n.columns[d]);let h=l.get(o);return h==null?(h=new Hw(c),l.set(o,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,s,this.rangeBetweenBuffer)}getSortOrder(t,e,i,s){const n=i.get(e);if(n==null||n.isDirty){const a={sortOrder:Ww(t,s)};return i.set(e,a),a.sortOrder}return n.sortOrder}getKeySortOrder(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s]?.get(t.id);return n?this.getSortOrder(n,s,i[qs],!0):void 0}getKeySortEntry(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i[qs].get(s);return n?.isDirty?void 0:n}getColumnSortOrder(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columnNeedValueOf?.[s]??!0;return this.getSortOrder(i.columns[s],s,i[Pu],n)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}};import{Logger as $w,iterate as Kw}from"ag-charts-core";var Zw=class{constructor(t){this.ctx=t}processScopeCache(){this.ctx.scopeCache.clear();for(const t of Kw(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const s of i)if(!this.ctx.scopeCache.has(e))this.ctx.scopeCache.set(e,new Map([[s,t]]));else{if(this.ctx.scopeCache.get(e)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(e).set(s,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,s]of this.ctx.values.entries())(!t||s.groupId&&t.includes(s.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,s=typeof e=="string"?e:e.id,n=r=>{if(r.idsMap){for(const[o,l]of r.idsMap)if(t?.includes(o)&&l.has(s))return!0}return!1},a=this.ctx.values.reduce((r,o,l)=>((o.scopes==null||i&&!o.scopes.length||o.scopes.some(h=>t?.includes(h)))&&(o.property===s||o.id===s||n(o))&&r.push(l),r),[]);if(a.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return a}buildAccessors(t){const e=new Map;if(this.ctx.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=mw(i.property);if(n==null){$w.warnOnce("Invalid property path [%s]",i.property);continue}const a=yw(n);e.set(i.property,a)}return e}},Bu=class{constructor(t,e="standalone",i=!1,s){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=gw.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let n=!0;for(const c of t.props){if(c.type==="key"&&!n)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&n&&(n=!1)}const a=({matchGroupIds:c=[]})=>{for(const h of c)if(this.values.every(d=>d.groupId!==h))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${h}).`)},r=new Set,o=new Set;for(const c of t.props){const h=c.type==="key"?r:o;if(Eu(c)&&c.scopes)for(const d of c.scopes)h.add(d);switch(c.type){case"key":this.keys.push({...c,index:this.keys.length,missing:new Map});break;case"value":if(c.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(c)}`);this.values.push({...c,index:this.values.length,missing:new Map});break;case"aggregate":a(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":a(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(o.values());for(const h of r)c.delete(h);if(c.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...c.values()]}`)}const l={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new Yw(l),this.scopeCacheManager=new Zw(l),this.domainInitializer=new xw(l),this.domainManager=new Mw(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new wb(this.opts.domainBandingConfig),this.dataExtractor=new Ow(l,this.domainManager),this.dataGrouper=new Ew(l),this.aggregator=new bw(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new Uw(l,this.reducerManager)}resolveProcessedDataDefById(t,e){return this.resolvers.resolveProcessedDataDefById(t,e)}resolveProcessedDataIndexById(t,e){return this.resolvers.resolveProcessedDataIndexById(t,e)}resolveKeysById(t,e,i){return this.resolvers.resolveKeysById(t,e,i)}hasColumnById(t,e){return this.resolvers.hasColumnById(t,e)}resolveColumnById(t,e,i){return this.resolvers.resolveColumnById(t,e,i)}resolveColumnNeedsValueOf(t,e,i){return this.resolvers.resolveColumnNeedsValueOf(t,e,i)}resolveMissingDataCount(t){return this.resolvers.resolveMissingDataCount(t)}*forEachDatum(t,e,i,s){const n=e.columnScopes.findIndex(a=>a.has(t.id));for(const a of i.datumIndices[n]??[]){const r=this.resolvers.resolveAbsoluteIndex(s,a);yield e.columns[n][r]}}getUniqueDataSets(t){return new Set(t.dataSources.values())}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(a=>a.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const a of e.groups){s.group=a;for(const r of a.datumIndices[i]??n)s.datumIndex=this.resolvers.resolveAbsoluteIndex(s.groupIndex,r),yield s;s.groupIndex++}}getDomain(t,e,i,s){const n=this.resolvers.getDomain(t,e,i,s);if(i==="key"&&n.length>0){const a=this.getKeySortMetadata(t,e,s);return{domain:n,sortMetadata:a}}return{domain:n}}getDomainBetweenRange(t,e,[i,s],n){return this.resolvers.getDomainBetweenRange(t,e,[i,s],n)}getKeySortOrder(t,e,i){return this.resolvers.getKeySortOrder(t,e,i)}getColumnSortOrder(t,e,i){return this.resolvers.getColumnSortOrder(t,e,i)}getKeySortMetadata(t,e,i){const s=this.resolvers.getKeySortEntry(t,e,i);if(s?.sortOrder!=null)return{sortOrder:s.sortOrder,isUnique:s.isUnique}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:s,groupProcessors:n,reducers:a,processors:r,propertyProcessors:o}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.dataGrouper.groupData(c):i&&(c=this.dataGrouper.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),o.length>0&&this.postProcessProperties(c),a.length>0&&this.reduceData(c),r.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&Xw(c),this.processScopeCache(),c}isReprocessingSupported(t){return this.incrementalProcessor.isReprocessingSupported(t)}reprocessData(t,e){if(!this.isReprocessingSupported(t)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const s=this.getUniqueDataSets(t);for(const n of s)n.commitPendingTransactions();return this.processData(t.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip");return this.incrementalProcessor.reprocessData(t,e,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this))}recomputeDomains(t){this.domainManager.recomputeDomains(t)}warnDataMissingProperties(t){this.dataExtractor.warnDataMissingProperties(t)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}valueIdxLookup(t,e){return this.scopeCacheManager.valueIdxLookup(t,e)}extractData(t){return this.dataExtractor.extractData(t)}reprocessGroupProcessors(t,e){const{groupProcessors:i}=this,{columns:s}=t;for(const a of i)if(!a.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const n=mc(e);for(const a of i){const r=this.valueGroupIdxLookup(a),o=a.adjust()();for(const l of n){const{indexMap:c}=l;for(const h of c.spliceOps)if(h.insertCount>0)for(let d=0;d<h.insertCount;d++){const u=h.index+d,p=t.groups[u];o(s,r,p,u)}}}}postProcessProperties(t){for(const{adjust:e,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))e()(t,n)}reduceData(t){t.reduced??(t.reduced={});for(const e of this.reducers)this.shouldUseReducerBanding(e,t)?t.reduced[e.property]=this.reduceWithBands(e,t):t.reduced[e.property]=this.reduceStandard(e,t)}shouldUseReducerBanding(t,e){return e.type==="ungrouped"&&t.supportsBanding===!0&&typeof t.combineResults=="function"}reduceWithBands(t,e){const i=this.reducerManager.evaluate(t,e,{reuseCleanBands:!1});return i===void 0?this.reduceStandard(t,e):i}reduceStandard(t,e){const i=t.reducer();if(e.type==="grouped"){let o=t.initialValue;for(const l of e.groups)o=i(o,l.keys);return o}const s=Eu(t)?t.scopes[0]:Mb(e.scopes);if(s==null)return t.initialValue;const n=e.dataSources.get(s)?.data??[],a=e.keys.map(o=>o.get(s)).filter(o=>o!=null),r=a.map(()=>{});return wb.evaluateRange(t,i,{rawData:n,keyColumns:a,keysParam:r},0,n.length)}postProcessData(t){t.reduced??(t.reduced={});for(const i of this.processors)t.reduced[i.property]=i.calculate(t,t.reduced[i.property]);const{diff:e}=t.reduced;e&&this.eventsHub?.emit("datamodel:diff",{diff:e})}initDataDomainProcessor(t){return this.domainManager.initDataDomainProcessor(t)}collectOptimizationMetadata(t,e){const i=t.optimizations?.domainBanding,s=t[$n];this.reducers.length>0&&s&&this.collectReducerBandingMetadata(t,s);const n=t.optimizations?.reducerBanding;t.optimizations={performance:{processingTime:t.time,pathTaken:e},...i&&{domainBanding:i},...n&&{reducerBanding:n}};const a=this.isReprocessingSupported(t),r=e==="reprocess";let o;if(!a){const l=[];if(t.type==="grouped"){t.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(t).size!==1&&l.push("multiple data sources");const h=Mb(t.scopes);t.invalidKeys?.get(h)?.some(u=>u)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),o=l.length>0?l.join(", "):void 0}if(t.optimizations.reprocessing={applied:r,reason:o},t.type==="grouped"){let l=0;const c=t.groups[0];if(c){const h=c.datumIndices;for(const d of t.groups)d.datumIndices===h&&l++}t.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:t.groups.length}}}collectReducerBandingMetadata(t,e){if(this.reducers.length===0)return;t.optimizations??(t.optimizations={});const i=[];for(const s of this.reducers){const n=e.get(s.property),a=this.shouldUseReducerBanding(s,t)&&n!=null;let r;a||(s.supportsBanding!==!0?r="reducer does not support banding":t.type!=="ungrouped"?r="grouped data not supported":s.combineResults===void 0?r="missing combineResults function":r="banding not applied");let o;a&&n&&(o=n.getStats()),i.push({property:String(s.property),applied:a,reason:r,stats:o})}t.optimizations.reducerBanding={reducers:i}}buildAccessors(t){return this.scopeCacheManager.buildAccessors(t)}};function Xw(t){const e=(i,s)=>{s.length>0&&(Oi.log(`DataModel.processData() - ${i}`),Oi.table(s))};if(Oi.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[]),t.optimizations){Oi.log("DataModel.processData() - Optimization Summary");const i=t.optimizations;if(i.performance&&Oi.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const s=i.reprocessing.applied?"\u2713":"\u2717",n=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";Oi.log(` Reprocessing: ${s}${n}`)}if(i.domainBanding){const s=i.domainBanding.keyDefs.filter(o=>o.applied),n=i.domainBanding.valueDefs.filter(o=>o.applied),a=s.length+n.length,r=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(a>0){Oi.log(` Domain Banding: \u2713 (${a}/${r} definitions)`);for(const o of[...s,...n])if(o.stats){const l=(o.stats.scanRatio*100).toFixed(1);Oi.log(` ${o.property}: scanned ${o.stats.dirtyBands}/${o.stats.totalBands} bands (${l}%)`)}}else{const o=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(o)].join(", ");Oi.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const s=i.sharedDatumIndices.applied?"\u2713":"\u2717",n=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;Oi.log(` Shared DatumIndices: ${s} (${n} groups)`)}if(i.batchMerging){const s=(i.batchMerging.mergeRatio*100).toFixed(0),n=`${i.batchMerging.originalBatchCount} \u2192 ${i.batchMerging.mergedBatchCount}`;Oi.log(` Batch Merging: ${n} (${s}% reduction)`)}}}var Eb=1e3;function Rb(t,e,i){const s=t.filter(n=>typeof n=="number"&&Number.isFinite(n));return s.length>0?i(s):e}function vi(t){return t.input.count<=Eb}function Pb(t){return t!=null&&JO(t)}function qw(t){return t!=null}function Jw(t){return!0}function _b(t,e){switch(t){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return Pb;default:return e?Jw:qw}}function Fb(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Js(t,e,i={}){const s=i.allowNullKey??!1;return{property:t,type:"key",valueType:Fb(e),validation:i.validation??_b(e,s),...i}}function he(t,e,i={}){const s=i.allowNullKey??!1;return{property:t,type:"value",valueType:Fb(e),validation:i.validation??_b(e,s),...i}}function Qw(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...e}}var eE=function(t){return t};function Vb(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>eE:e.length===1?e[0]:function(){const s=e.map(n=>n());return function(a,r){return s.reduce((o,l)=>l(o,r),a)}}}function tE(t,e={}){const{min:i=-1/0,max:s=1/0,processor:n,...a}=e;return{type:"value",property:t,valueType:"range",validation:Pb,processor:Vb(n,function(){return function(l){return fb(l)?qO(i,l,s):l}}),...a}}function zu(t,e,i={}){const{onlyPositive:s,processor:n,...a}=i;return{...he(t,e,a),processor:Vb(n,uw(s))}}function iE(t,e,i={}){return{...he(t,e,i),processor:pw()}}function Do(t,e,i,s){return[he(t,s,i),dE(i.groupId,e,i.separateNegative),...i.rangeId==null?[]:[hw(i.rangeId,i.groupId)]]}var Bb={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let t=Number.NaN;return function(i,s){const n=s[0],a=typeof n=="number"?n:Number(n);if(!Number.isFinite(a))return i;const r=t;if(t=a,!Number.isFinite(t))return i;const o=Math.abs(a-r),l=i??1/0;return o>0&&o<l?o:l}},supportsBanding:!0,combineResults(t){return Rb(t,1/0,e=>Math.min(...e))},needsOverlap:!0},zb={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let t=Number.NaN;return function(i,s){const n=s[0],a=typeof n=="number"?n:Number(n);if(!Number.isFinite(a))return i;const r=t;if(t=a,!Number.isFinite(t))return i;const o=Math.abs(a-r),l=i??-1/0;return o>0&&o>l?o:l}},supportsBanding:!0,combineResults(t){return Rb(t,-1/0,e=>Math.max(...e))},needsOverlap:!0},sE={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:e}}){return e?.slice().sort((i,s)=>{for(let n=0;n<i.length;n++){const a=i[n]-s[n];if(a!==0)return a}return 0})}};function nE({normaliseTo:t}){const e=(i,s)=>{if(s===0)return 0;const n=(i??0)*t/s;return n>=0?Math.min(t,n):Math.max(-t,n)};return()=>()=>(i,s,n,a)=>{const r=aE(i,s,n,a);for(const o of s){const l=n.datumIndices[o];if(l!=null)for(const c of l){const h=a+c,d=i[o],u=d[h];if(u==null){d[h]=void 0;continue}d[h]=e(u,r)}}}}function aE(t,e,i,s){const n=[0,0];for(const a of e){const r=t[a],o=i.datumIndices[a];if(o!=null)for(const l of o){const c=s+l,h=r[c];if(h==null)continue;const d=typeof h=="number"?h:Math.max(...h.map(p=>p??0)),u=d<0?0:1;u===0?n[u]=Math.min(n[u],d):n[u]=Math.max(n[u],d)}}return Math.max(Math.abs(n[0]),n[1])}function xc(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:fc({normaliseTo:e},nE)}}function rE({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],a=function(o,l,c){const h=t[0]+(o-l)/c*n;return c===0?e:h>=t[1]?t[1]:h<t[0]?t[0]:h};return function(){return function(l,c){let[h,d]=l.domain.values[c];i!=null&&(h=i),s!=null&&(d=s);const u=d-h;l.domain.values[c]=[t[0],t[1]];const p=l.columns[c];for(let g=0;g<p.length;g+=1)p[g]=a(p[g],h,u)}}}function Gu(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:fc({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},rE)}}var Mo=1,vc=2;function oE(t,e,i){let s=Mo|vc;if(t.valueType==="category")return e.length<i.length&&(s&=~Mo),s;let n=i[0]?.valueOf();for(let a=1;s!==0&&a<i.length;a++){const r=i[a]?.valueOf();(!Number.isFinite(r)||n>r)&&(s&=~vc),Number.isFinite(r)&&n===r&&(s&=~Mo),n=r}return s}function lE(t){return function(i,s){if(!vi(i))return;const{keys:n,values:a}=i.defs,{input:r,domain:{values:o},columns:l}=i;let c=!0,h=!0;if(r.count!==0){const d=i[qs];for(let u=0;(c||h)&&u<n.length;u++){const p=n[u],g=d.get(u);if(p.valueType==="category"){const f=i.domain.keys[u]?.length??0,y=i.keys[u]?.values().next().value?.length??0;f<y&&(c=!1)}else g&&(g.isUnique===!1&&(c=!1),g.sortOrder!==1&&(h=!1))}if(t&&t.length>0){let u=Mo|vc;for(let p=0;u!==0&&p<a.length;p++){const g=a[p];t.includes(g.id)&&(u&=oE(g,o[p],l[p]))}u&Mo||(c=!1),u&vc||(h=!1)}}return{uniqueKeys:c,orderedKeys:h}}}function cE(){return{uniqueKeys:!0,orderedKeys:!1}}function Ao(t){return{type:"processor",property:"animationValidation",calculate:fc(t,lE),incrementalCalculate:cE}}function hE({mode:t,separateNegative:e}){return function(){return function(){return function(a,r,o,l){const c=[0,0];for(const h of r){const d=o.datumIndices[h];if(d==null)continue;const u=c[0],p=c[1],g=a[h];let f=!1;for(const y of d){const m=l+y,x=g[m];if(!fb(x))continue;const v=e&&QO(x),S=v?u:p;if(t==="normal"?g[m]=S+x:g[m]=S,!f){const I=v?0:1;c[I]=S+x,f=!0}}}}}}}function dE(t,e,i=!1){const s=fc({mode:e,separateNegative:i},hE);return{type:"group-value-processor",matchGroupIds:[t],adjust:s,supportsReprocessing:!0}}function Gb(t){return t.id??t.property}function uE(t,e,i){const s=new Map,n=e.defs.values;for(let o=0;o<n.length;o+=1){const l=n[o];if(l.scopes?.includes(t)===!1)continue;const c=Gb(l);if(s.has(c))return;s.set(c,o)}const a=[],r=i.defs.values;for(let o=0;o<r.length;o+=1){const l=r[o];if(l.scopes?.includes(t)===!1)continue;const c=Gb(l),h=s.get(c);if(h==null)return;s.delete(c),a.push({previousIndex:h,nextIndex:o})}if(s.size===0)return a}function ju(t,e,i,s,n){for(const{previousIndex:a,nextIndex:r}of i){const o=t[a],l=e[r],c=o[s],h=l[n];if(c!==h)return!1}return!0}function Sc(t,e,i=!0){return{type:"processor",property:"diff",calculate(s,n){if(!vi(s))return;const a=new Map,r=new Map,o=new Map,l=new Map,c=e.keys.map(x=>x.get(t)),h=s.keys.map(x=>x.get(t)),d=e.columns,u=s.columns,p=uE(t,e,s);if(p==null)return n;const g=Math.max(e.input.count,s.input.count),f=s.defs.keys.some(x=>x.allowNullKey===!0);for(let x=0;x<g;x++){const v=x<e.input.count,S=x<s.input.count,I=v?Ru(c,x,f):void 0,M=I==null?"":ft(...I),D=S?Ru(h,x,f):void 0,C=D==null?"":ft(...D);if(S&&v&&M===C){ju(d,u,p,x,x)||o.set(C,x);continue}const A=l.get(C);A!=null?((i||!ju(d,u,p,A,x))&&(o.set(C,x),a.set(C,x)),l.delete(C)):S&&r.set(C,x);const T=r.get(M);T!=null?((i||!ju(d,u,p,T,x))&&(o.set(M,x),a.set(M,x)),r.delete(M)):v&&(o.delete(M),l.set(M,x))}const m={changed:r.size>0||o.size>0||l.size>0,added:new Set(r.keys()),updated:new Set(o.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...n,[t]:m}}}}function ft(...t){if(t.length===1){const e=mb(t[0]);if(e===null)return ku;if(e===void 0)return Ou;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e}return t.map(e=>{const i=mb(e);return i===null?ku:i===void 0?Ou:i}).join("___")}import{Debug as pE,Logger as gE}from"ag-charts-core";var jb=class{constructor(t){this.maxAnimationTime=t,this.debug=pE.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(yo.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(yo[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(yo.indexOf(t.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",t.id),t.stop();return}this.controllers.set(t.id,t),this.phases.get(t.phase)?.push(t)}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=e?.indexOf(t);i!=null&&i>=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=yo[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:gc[c]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const r=()=>yo[this.currentPhase]==null,o=()=>{for({phase:s,phaseControllers:n,phaseMeta:a}=i();!r()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:a}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=e,h=a.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():e=Math.min(u.update(c),e),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`,n),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),o()}while(e>0&&!r());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&gc[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){gE.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){for(const t of this.stoppedCbs)t();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(t){if(!this.isActive())return 0;let e=0;for(const[i,s]of this.phases)s.length!==0&&(t!=null&&t!==i||(e+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return e}destroy(){this.stop(),this.controllers.clear()}};function Ub(t){return t==null?!0:!Number.isNaN(t)&&t>=0&&t<=2}var fE=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.maxAnimatableItems=Eb,this.batch=new jb(this.defaultDuration*1.5),this.debug=jO.create(!0,"animation"),this.events=new UO,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(o){this.failsafeOnError(o);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||t.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:a}=t;if(!Ub(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!Ub(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const r=new XO({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(r,this.defaultDuration))return this.batch.addAnimation(r),r}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(t){return this.batch.getRemainingTime(t)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=HO().requestAnimationFrame(e=>{t(e).catch(i=>ub.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(t??i);t=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(4);try{this.batch.progress(n),this.cumulativeAnimationTime+=n}catch(a){this.failsafeOnError(a)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))})};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){ub.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new jb(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},mE=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},yE=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},bE=class{constructor(){this.items=new mE,this.lists=new yE}},Hb=class{constructor(t){this.eventsHub=t,this.builtins=new bE,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(t,e){return e.showOn==t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{widgetEvent:n}=e;if(n.sourceEvent.defaultPrevented)return;const a=s?.x??e.canvasX,r=s?.y??e.canvasY,o={showOn:t,x:a,y:r,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",o),this.eventsHub.emit("context-menu:complete",o)}isVisible(t){return!this.hiddenActions.has(t)}toggle(t,e){switch(e??(e=this.isVisible(t)?"hide":"show"),e){case"show":this.hiddenActions.delete(t);break;case"hide":this.hiddenActions.add(t);break}}};import{objectsEqual as xE}from"ag-charts-core";var Wb=class bm{constructor(e){this.eventsHub=e,this.highlightStates=new po,this.pendingUnhighlights=new Map,this.unhighlightDelay=100}updateHighlight(e,i,s=!1){i?.series?.isHighlightEnabled()===!1&&(i=void 0);const n=this.getActiveHighlight();if(i==null&&s&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(e)){const r=su(()=>{this.applyPendingUnhighlight(e)});this.pendingUnhighlights.set(e,{scheduler:r}),r.schedule(this.unhighlightDelay)}return}const a=this.pendingUnhighlights.get(e);a&&(a.scheduler.cancel(),this.pendingUnhighlights.delete(e)),i?this.highlightStates.set(e,i):this.highlightStates.delete(e),this.maybeEmitChange(e,n)}maybeEmitChange(e,i){const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit(bm.HIGHLIGHT_CHANGE_EVENT,{callerId:e,currentHighlight:s,previousHighlight:i})}applyPendingUnhighlight(e){if(!this.pendingUnhighlights.has(e))return;this.pendingUnhighlights.delete(e);const i=this.getActiveHighlight();this.highlightStates.delete(e);const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit(bm.HIGHLIGHT_CHANGE_EVENT,{callerId:e,currentHighlight:s,previousHighlight:i})}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:e}of this.pendingUnhighlights.values())e.cancel();this.pendingUnhighlights.clear()}isEqual(e,i){return e===i||e!=null&&i!=null&&e.series===i.series&&this.idsMatch(e,i)&&e.datum===i.datum}idsMatch(e,i){return e.itemId!=null&&i.itemId!=null&&e.itemId===i.itemId||e.datumIndex!=null&&i.datumIndex!=null&&xE(e.datumIndex,i.datumIndex)}};Wb.HIGHLIGHT_CHANGE_EVENT="highlight:change";var Yb=Wb;import{CleanupRegistry as vE,objectsEqual as $b}from"ag-charts-core";import{Color as SE,findMaxIndex as IE,findMinIndex as DE,isString as ME}from"ag-charts-core";import{BaseProperties as Xn,PropertiesArray as AE,Property as _,mergeDefaults as CE}from"ag-charts-core";var Kb=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.Series=2]="Series",t[t.OtherSeries=3]="OtherSeries",t[t.OtherItem=4]="OtherItem",t))(Kb||{}),Uu=[0,1,2,3,4];function TE(t){switch(t){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function nr(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return e(t)}}var Qs=class extends Xn{};b([_],Qs.prototype,"fill",2),b([_],Qs.prototype,"fillOpacity",2),b([_],Qs.prototype,"stroke",2),b([_],Qs.prototype,"strokeWidth",2),b([_],Qs.prototype,"strokeOpacity",2),b([_],Qs.prototype,"lineDash",2),b([_],Qs.prototype,"lineDashOffset",2);var Ds=class extends Xn{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(t){const e=TE(t);return e.length===0?{}:CE(...e.map(i=>this[i]))}};b([_],Ds.prototype,"enabled",2),b([_],Ds.prototype,"range",2),b([_],Ds.prototype,"bringToFront",2),b([_],Ds.prototype,"highlightedItem",2),b([_],Ds.prototype,"unhighlightedItem",2),b([_],Ds.prototype,"highlightedSeries",2),b([_],Ds.prototype,"unhighlightedSeries",2);var ts=class extends Xn{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};b([_],ts.prototype,"start",2),b([_],ts.prototype,"stop",2),b([_],ts.prototype,"fill",2),b([_],ts.prototype,"fillOpacity",2),b([_],ts.prototype,"stroke",2),b([_],ts.prototype,"strokeWidth",2),b([_],ts.prototype,"strokeOpacity",2),b([_],ts.prototype,"lineDash",2),b([_],ts.prototype,"lineDashOffset",2);var Ic=class{constructor(){this.key="x",this.segments=new AE(ts)}};b([_],Ic.prototype,"enabled",2),b([_],Ic.prototype,"key",2),b([_],Ic.prototype,"segments",2);var en=class extends Xn{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};b([_],en.prototype,"type",2),b([_],en.prototype,"colorStops",2),b([_],en.prototype,"bounds",2),b([_],en.prototype,"gradient",2),b([_],en.prototype,"rotation",2),b([_],en.prototype,"reverse",2),b([_],en.prototype,"colorSpace",2);var Ge=class extends Xn{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};b([_],Ge.prototype,"type",2),b([_],Ge.prototype,"colorStops",2),b([_],Ge.prototype,"bounds",2),b([_],Ge.prototype,"gradient",2),b([_],Ge.prototype,"rotation",2),b([_],Ge.prototype,"scale",2),b([_],Ge.prototype,"reverse",2),b([_],Ge.prototype,"path",2),b([_],Ge.prototype,"pattern",2),b([_],Ge.prototype,"width",2),b([_],Ge.prototype,"height",2),b([_],Ge.prototype,"padding",2),b([_],Ge.prototype,"fill",2),b([_],Ge.prototype,"fillOpacity",2),b([_],Ge.prototype,"backgroundFill",2),b([_],Ge.prototype,"backgroundFillOpacity",2),b([_],Ge.prototype,"stroke",2),b([_],Ge.prototype,"strokeOpacity",2),b([_],Ge.prototype,"strokeWidth",2);var Ms=class extends Xn{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};b([_],Ms.prototype,"type",2),b([_],Ms.prototype,"url",2),b([_],Ms.prototype,"rotation",2),b([_],Ms.prototype,"scale",2),b([_],Ms.prototype,"backgroundFill",2),b([_],Ms.prototype,"backgroundFillOpacity",2),b([_],Ms.prototype,"repeat",2),b([_],Ms.prototype,"fit",2);var wi=class extends Xn{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Ds}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context")),"allowNullKeys"in e&&(this.allowNullKeys=e.allowNullKeys,t.delete("allowNullKeys"))}};b([_],wi.prototype,"id",2),b([_],wi.prototype,"visible",2),b([_],wi.prototype,"focusPriority",2),b([_],wi.prototype,"showInLegend",2),b([_],wi.prototype,"cursor",2),b([_],wi.prototype,"nodeClickRange",2),b([_],wi.prototype,"highlight",2);function Zb(t,e){if(e.length===0)return[!1,!1];const i=e[0],s=e.at(-1);if(typeof i=="string"||i===null||i===void 0)return[t===i,t===s];if(t==null)return[!1,!1];const n=t.valueOf();if(i==null||s==null)return[!1,!1];let a=i.valueOf(),r=s.valueOf();return a>r&&([a,r]=[r,a]),[n===a,n===r]}function Hu(t,e,i,s,n,a){const[r,o]=Zb(e,a),[l,c]=Zb(t,n);return{xKey:i,yKey:s,xValue:t,yValue:e,first:l,last:c,min:r,max:o}}function Co(t,e,[i,s],n){let a=DE(0,e-1,o=>{const l=t===1?o:e-o,c=n(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,r=IE(0,e-1,o=>{const l=t===1?o:e-o,c=n(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=s})??e-1;return t===-1&&([a,r]=[e-r,e-a]),a=Math.max(a,0),r=Math.min(r+1,e),[a,r]}function Wu(t,e,i){if(i){const{x:n,y:a,width:r,height:o}=i;return{canvasX:n+r/2,canvasY:a+o/2}}const s=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(s){const{x:n,y:a}=ve.toCanvasPoint(t.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(a)}}}function LE(t,e,i,s,n){let a=-1,r=0,o=0,l=!1;for(;r<s&&a<=e-t;){a+=1;const c=i+o;if(l||(o*=-1),o>=0&&(o+=1),l&&o<0&&(o-=1),c<t||c>e){l=!0;continue}n(c)&&(r+=1)}return r}function Yu(t){const e={};for(const i of Uu)e[i]=t(void 0,!1,i);return e}function NE(t,...e){const i={};for(const s of e??["default"])for(const n of Uu){const a=i[s]??(i[s]={});a[n]=t(void 0,!1,n,s)}return i}function $u(t){return(t?.opacity??1)<1||(t?.fillOpacity??1)<1||(t?.strokeOpacity??1)<1}var Xb=new Map;function kE(t){if(t==null)return!1;const e=t.fill;if(!ME(e))return!1;const i=e.trim(),s=i.toLowerCase();if(s==="transparent"||s==="none")return!1;let n=Xb.get(i);if(n==null){try{n=SE.fromString(i).a===1}catch{n=!1}Xb.set(i,n)}return n}function OE(t,e){return t!=="cutout"?t:kE(e)?"cutout":"overlay"}function qb(t,e){for(const i of e??[])switch(typeof t){case"string":if(i.itemId===t)return i;break;case"number":if(i.datumIndex===t)return i;break;default:return t}}var Dc=class{constructor(t,e,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new po,this.suppressState=new po(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new vE,this.cleanup.register(s.setup(e,i),t.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:t}of this.pendingRemovals.values())t.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(t,e,i,s){const n=this.pendingRemovals.get(t);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(t)),i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:s}),this.applyStates()}removeTooltip(t,e,i=!1){if(i&&this.removeDelay>0){const n=this.pendingRemovals.get(t);if(n){e&&(n.lastMeta=e);return}const a=su(()=>{this.applyPendingRemoval(t)});this.pendingRemovals.set(t,{scheduler:a,lastMeta:e}),a.schedule(this.removeDelay);return}const s=this.pendingRemovals.get(t);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(t)),this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyPendingRemoval(t){this.pendingRemovals.has(t)&&(this.pendingRemovals.delete(t),this.stateTracker.delete(t),this.applyStates())}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):void 0;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if($b(this.appliedState?.content,e?.content)&&$b(this.appliedState?.pagination,e?.pagination)){const n=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,void 0,n)}else this.tooltip.show(s,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,s){const{canvasX:n,canvasY:a}=t,r=e.properties.tooltip,{placement:o,anchorTo:l,xOffset:c,yOffset:h}=r.position,d=Wu(e,i,s);return{canvasX:n,canvasY:a,nodeCanvasX:d?.canvasX??n,nodeCanvasY:d?.canvasY??a,enableInteraction:r.interaction?.enabled??!1,showArrow:r.showArrow,position:{placement:o,anchorTo:l,xOffset:c,yOffset:h}}}};import{CleanupRegistry as wE,EventEmitter as EE}from"ag-charts-core";var Jb=3,RE=505,Qb=30;function Ku(t,e){const{device:i,offsetX:s,offsetY:n,clientX:a,clientY:r,currentX:o,currentY:l,sourceEvent:c}=e;return{type:t,device:i,offsetX:s,offsetY:n,clientX:a,clientY:r,currentX:o,currentY:l,sourceEvent:c}}function ex(t,e){const i=t*t+e*e,s=Jb*Jb;return i>=s}function PE(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY,n=i*i+s*s,a=Qb*Qb;return n<a}var _E=class{constructor(t){this.cleanup=new wE,this.events=new EE,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(t.addListener("touchstart",this.onTouchStart.bind(this)),t.addListener("touchmove",this.onTouchMove.bind(this)),t.addListener("touchend",this.onTouchEnd.bind(this)),t.addListener("mousemove",this.onMouseMove.bind(this)),t.addListener("dblclick",this.onDblClick.bind(this)),t.addListener("drag-start",this.onDragStart.bind(this)),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.events.emit("mousemove",t)}onDblClick(t){this.events.emit("dblclick",t)}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&ex(t.originDeltaX,t.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",t)}onDragEnd(t){if(this.isDragging){this.events.emit("drag-end",t),this.isDragging=!1;return}if(t.device==="mouse"){const e=Ku("click",t);this.events.emit("click",e)}else if(t.sourceEvent.type==="touchend"){if(ex(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=Ku("click",t);this.events.emit("click",e);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=RE&&PE(this.lastClick,t)){const s=Ku("dblclick",t);this.events.emit("dblclick",s),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},Zu=class extends qa{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},FE=class{constructor(t,e){this.seriesWidget=new Zu(t.getParent("series-area")),this.chartWidget=new Zu(t.getParent("canvas-proxy")),this.containerWidget=new Zu(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),e.withDragInterpretation&&(this.seriesDragInterpreter=new _E(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};import{ChartAxisDirection as Ht,Logger as Mc,ScaleAlignment as tx,attachDescription as VE,clamp as Ac,deepClone as To,deepFreeze as ix,defined as qn,definedZoomState as Cc,isFiniteNumber as Tc,isObject as BE,strictObjectKeys as Jn,validate as zE}from"ag-charts-core";import{findMinMax as GE}from"ag-charts-core";var sx=class xm extends $l{constructor(e=[],i=[]){super(),this.range=i,this.defaultTickCount=xm.defaultTickCount,this.defaultClamp=!1,this._domain=[],this.domainNeedsValueOf=!0,this.d0Cache=Number.NaN,this.d1Cache=Number.NaN,this.domain=e}static is(e){return e instanceof xm}get domain(){return this._domain}set domain(e){if(this._domain=e,e&&e.length>=2){const i=e[0];this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=e[0].valueOf(),this.d1Cache=e[1].valueOf()):(this.d0Cache=e[0],this.d1Cache=e[1])}else this.d0Cache=Number.NaN,this.d1Cache=Number.NaN}normalizeDomains(...e){return nx(...e)}calcBandwidth(e=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let r=Math.abs(this.d1Cache-this.d0Cache)/e+1;if(i!==0){const o=Math.floor(n);r=Math.min(r,o)}return n/Math.max(1,r)}convert(e,i){const{domain:s}=this;if(!s||s.length<2||e==null)return Number.NaN;const{range:n}=this,a=i?.clamp??this.defaultClamp;let r=this.d0Cache,o=this.d1Cache,l=typeof e=="number"?e:e.valueOf();if(this.transform&&(r=this.transform(r),o=this.transform(o),l=this.transform(l)),a){const[h,d]=GE([r,o]);if(l<h)return n[0];if(l>d)return n[1]}if(r===o)return(n[0]+n[1])/2;if(l===r)return n[0];if(l===o)return n[1];const c=n[0];return c+(l-r)/(o-r)*(n[1]-c)}invert(e,i){const{domain:s}=this;if(s.length<2)return;let n=this.d0Cache,a=this.d1Cache;this.transform&&(n=this.transform(n),a=this.transform(a));const{range:r}=this,[o,l]=r;let c;return o===l?c=this.toDomain((n+a)/2):c=this.toDomain(n+(e-o)/(l-o)*(a-n)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return Zl(this.domain)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};sx.defaultTickCount=5;var se=sx;function nx(...t){let e,i=1/0,s,n=-1/0;for(const a of t){const r=a.domain;for(const o of r){const l=o.valueOf();l<i&&(i=l,e=o),l>n&&(n=l,s=o)}}return e!=null&&s!=null?{domain:[e,s],animatable:!0}:{domain:[],animatable:!1}}import{ScaleAlignment as Lc,findMaxIndex as jE,findMinIndex as ax}from"ag-charts-core";import{Logger as UE,clamp as Nc}from"ag-charts-core";var Xu=class LC extends $l{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof LC}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=Nc(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=Nc(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=Nc(0,e,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&UE.warnOnce("Expected update to not invalidate scale"))}convert(e,i){this.refresh();const s=this.findIndex(e,i?.alignment);return s==null||s<0||s>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(s)}getDomainMinMax(){return Zl(this.domain)}invertNearestIndex(e){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let s=0,n=i-1,a=1/0,r=0;for(;s<=n;){const o=Math.trunc((n+s)/2),l=this.ordinalRange(o),c=Math.abs(l-e);if(c===0)return o;c<a&&(a=c,r=o),l<e?s=o+1:n=o-1}return r}update(){const[e,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:n}=this,a=this.getBandCountForUpdate();if(a===0)return;const r=i-e;let o;a===1?(s=0,o=r*(1-n*2)):o=r/Math.max(1,a-s+n*2);const l=this.round&&Math.floor(o)>0,c=l?Math.floor(o):o;let h=e+(r-c*(a-s))/2,d=c*(1-s);l&&(h=Math.round(h),d=Math.round(d)),this._step=c,this._inset=h,this._bandwidth=d,this._rawBandwidth=o*(1-s)}ordinalRange(e){const{_inset:i,_step:s,range:n}=this,a=Math.min(n[0],n[1]),r=Math.max(n[0],n[1]);return Nc(a,i+s*e,r)}};b([Kl],Xu.prototype,"range",2),b([Kl],Xu.prototype,"round",2);var Ei=Xu,HE=1e3,rx=20;function ox(t,e=0,i=t.length-1){const s=i-e+1;if(s<2)return{isUniform:!1};const n=Array.from({length:rx},(l,c)=>e+Math.floor(c*(s-1)/(rx-1))),a=n.map(l=>t[l].valueOf()),r=(a.at(-1)-a[0])/(s-1);if(!Number.isFinite(r)||r===0)return{isUniform:!1};const o=Math.abs(r*.01);for(let l=1;l<a.length;l++){const c=n[l]-n[l-1],h=(a[l]-a[l-1])/c;if(Math.abs(h-r)>o)return{isUniform:!1}}return{isUniform:!0,interval:r}}var is=class NC extends Ei{static is(e){return e instanceof NC}toDomain(e){return new Date(e)}get reversed(){const{domain:e}=this;return e.length>0&&e[0].valueOf()>e.at(-1).valueOf()}get numericBands(){return this.bands.map(e=>e.valueOf())}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:s,reversed:n}=this,a=this.numericBands,r=a.length;if(s.length<=0)return Number.NaN;const o=this.ordinalRange(0),l=this.ordinalRange(r-1);if(r===0)return o;if(i?.clamp===!0){const{range:v}=this;if(e.valueOf()<a[0])return v[0];if(e.valueOf()>a.at(-1))return v[1]}if((i?.alignment??Lc.Leading)!==Lc.Interpolate){const v=super.convert(e,i);return n?l-(v-o):v}const h=e.valueOf();let d=this.findIndex(e)??0,u;n?(d=Math.min(Math.max(d,1),r-1),u=-1):(d=Math.min(Math.max(d,0),r-2),u=1);const p=a[d],g=a[d+u],f=this.ordinalRange(d),y=this.ordinalRange(d+u),x=(h-p)/(g-p)*(y-f)+f;return n?l-(x-o):x}invert(e,i=!1){this.refresh();const{domain:s}=this;if(s.length<=0)return;const n=this.bands,a=this.getBandCountForUpdate(),r=s[0].valueOf()>s.at(-1).valueOf();let o;return i?o=this.invertNearestIndex(e-this.bandwidth/2):o=ax(0,a-1,c=>this.ordinalRange(c)>=e)??a-1,n[r?a-1-o:o]}getUniformityCache(e){}findIndex(e,i=Lc.Leading){if(e==null)return;const s=this.numericBands,n=s.length;if(n===0)return;if(n===1)return 0;const a=e.valueOf();return i===Lc.Trailing?ax(0,n-1,r=>s[r]>=a):jE(0,n-1,r=>s[r]<=a)}};import{Vec4 as lx,clamp as qu}from"ag-charts-core";function kc(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function cx(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function hx(t,e,i){return[cx(t,i.min,e,i.max,0),cx(t,i.min,e,i.max,1)]}function WE(t,e,i){const[s,n]=hx(t.x1,t.x2,e),[a,r]=hx(t.y1,t.y2,i);return{x1:s,x2:n,y1:a,y2:r}}function dx(t,e,i,s,n,a){if(i<=n&&a<=s)return i;const r=n-i,o=a-s,l=Math.abs(r)<Math.abs(o)?r:o;return qu(t,i+l,e)}function YE(t,e,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=e,a=lx.from(i),r=lx.from(t),o=WE(r,s,n),l=dx(o.x1,o.x2,r.x1,r.x2,a.x1,a.x2),c=dx(o.y1,o.y2,r.y1,r.y2,a.y1,a.y2),h={x:{min:kc(r.x1,s.min,r.x2,s.max,l),max:kc(r.x1,s.min,r.x2,s.max,l+t.width)},y:{min:kc(r.y1,n.min,r.y2,n.max,c),max:kc(r.y1,n.min,r.y2,n.max,c+t.height)}},d=h.x.max-h.x.min,u=h.y.max-h.y.min;return h.x.min=qu(0,h.x.min,1-d),h.x.max=h.x.min+d,h.y.min=qu(0,h.y.min,1-u),h.y.max=h.y.min+u,h}import{ScaleAlignment as Oc}from"ag-charts-core";function ux(t,e){const i=t?.valueOf(),s=e?.valueOf();return typeof i!="number"||typeof s!="number"?[void 0,void 0]:i<s?[Oc.Leading,Oc.Trailing]:[Oc.Trailing,Oc.Leading]}var px=t=>VE((e,{options:i})=>!se.is(t?.scale)&&!is.is(t?.scale)||e==null||i.end==null?!0:e<i.end,"to be less than end");function $E(t){for(const e of Jn(t)){const i=t[e];if(!i)continue;const{min:s,max:n}=i;(s<0||n>1)&&(Mc.warnOnce(`Attempted to update axis (${e}) zoom to an invalid ratio of [{ min: ${s}, max: ${n} }], expecting a ratio of 0 to 1. Ignoring.`),delete t[e])}}function gx(t,e){const i={};for(const{id:s,direction:n}of t){const{min:a,max:r}=e[s]??{min:0,max:1};i[s]={min:a,max:r,direction:n}}return i}function KE(t,e){const i=Jn(t),s=Jn(e);if(i.length!==s.length)return!1;for(const n of i)if(!s.includes(n))return!1;for(const n of i){const a=t[n],r=e[n];if(a!==r&&(a==null||r==null||a.direction!==r.direction||a.min!==r.min||a.max!==r.max))return!1}return!0}function ZE(t){return{source:"user-interaction",sourceDetail:t}}var fx=class extends mu{constructor(t,e,i){super(),this.eventsHub=t,this.fireChartEvent=i,this.mementoOriginatorKey="zoom",this.state={},this.axes=[],this.didLayoutAxes=!1,this.lastRestoredState={},this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.cleanup.register(t.on("zoom:change-request",s=>{this.constrainZoomToRequiredWidth(s)}),e.addListener("pre-series-update",({requiredRangeRatio:s,requiredRangeDirection:n})=>{this.didLayoutAxes=!0;const{pendingMemento:a}=this;a?this.restoreMemento(a.version,a.mementoVersion,a.memento):this.restoreRequiredRange(s,n),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),e.addListener("update-complete",({wasShortcut:s})=>{if(!s&&this.pendingZoomEventSource){const n=this.pendingZoomEventSource;this.fireChartEvent({type:"zoom",source:n,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}toCoreZoomState(t){const e={};let i;const{state:s}=this;if(this.independentAxes){const n=this.getPrimaryAxisId(Ht.X),a=this.getPrimaryAxisId(Ht.Y);i=[],n&&i.push(n),a&&i.push(a)}else i=Jn(s);for(const n of i){const{direction:a}=s[n]??{};if(a!=null){const r=t[a];if(r){const{min:o,max:l}=r;e[n]={min:o,max:l,direction:a}}}}return e}toZoomState(t){let e,i;for(const s of Jn(t)){const{min:n,max:a,direction:r}=t[s];r===Ht.X?e??(e={min:n,max:a}):r===Ht.Y&&(i??(i={min:n,max:a}))}if(e||i)return{x:e,y:i}}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!BE(t))return!1;const i=this.getPrimaryAxis(Ht.X),s=this.getPrimaryAxis(Ht.Y),n={rangeX:{start:px(i),end:qn},rangeY:{start:px(s),end:qn},ratioX:{start:qn,end:qn},ratioY:{start:qn,end:qn},autoScaledAxes:qn},{invalid:a}=zE(t,n);return a.length>0?(e.push(...a.map(String)),!1):!0}restoreMemento(t,e,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const s=Cc(this.getZoom());i?.rangeX?s.x=this.rangeToRatioDirection(Ht.X,i.rangeX)??{min:0,max:1}:i?.ratioX?s.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:s.x={min:0,max:1};const{navigatorModule:n,zoomModule:a}=this;this.eventsHub.emit("zoom:load-memento",{zoom:s,memento:i,navigatorModule:n,zoomModule:a});const r=this.toCoreZoomState(s);this.lastRestoredState=ix(To(r)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:r,isReset:!1})}findAxis(t){for(const e of this.axes)if(e.id===t)return e}getAxes(){return this.axes}setAxes(t){const{axes:e}=this;e.length=0;for(const n of t)"range"in n&&e.push(n);const i=this.state,s=gx(t,i);this.state=s,this.lastRestoredState=gx(t,this.lastRestoredState),this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:s,isReset:!1})}setIndependentAxes(t=!0){this.independentAxes=t}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:t,sourceDetail:e},i){const s=this.toCoreZoomState(i??{});return this.updateChanges({source:t,sourceDetail:e,changes:s,isReset:!1})}computeChangedAxesIds(t){const e=[],i=this.state;for(const s of Jn(t)){const n=t[s]??{min:0,max:1},a=i[s];(a==null||a.min!==n.min||a.max!==n.max)&&e.push(s)}return e}updateChanges(t){const{source:e,sourceDetail:i,isReset:s,changes:n}=t;$E(n);const a=this.computeChangedAxesIds(n),r=To(this.state),o=To(this.state);for(const l of a){const c=o[l];c!=null&&(c.min=n[l]?.min??0,c.max=n[l]?.max??1)}return this.state=o,this.dispatch(e,i,a,s,r)}resetZoom({source:t,sourceDetail:e}){this.updateChanges({source:t,sourceDetail:e,changes:this.getRestoredZoom(),isReset:!0})}resetAxisZoom({source:t,sourceDetail:e},i){this.updateChanges({source:t,sourceDetail:e,changes:{[i]:this.getRestoredZoom()[i]},isReset:!0})}panToBBox(t,e){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=this.getZoom();if(i===void 0||!i.x&&!i.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(e.width)<=Math.abs(t.width)&&Math.abs(e.height)<=Math.abs(t.height)))return Mc.warnOnce("cannot pan to target BBox - chart too small?"),!1;const n=YE(t,i,e),a=this.toCoreZoomState(n);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:a,isReset:!1})}fireZoomPanStartEvent(t){this.eventsHub.emit("zoom:pan-start",{callerId:t})}extendToEnd(t,e,i){return this.extendWith(t,e,s=>Number(s)-i)}extendWith({source:t,sourceDetail:e},i,s){const n=this.getPrimaryAxis(i);if(!n)return;const a=this.getDomainExtents(n);if(!a)return;const[,r]=a,o=s(r),l=this.rangeToRatioAxis(n,{start:o});l&&this.updateChanges({source:t,sourceDetail:e,changes:{[i]:l},isReset:!1})}updateWith({source:t,sourceDetail:e},i,s){const n=this.getPrimaryAxis(i);if(!n)return;const a=this.getDomainExtents(n);if(!a)return;let[r,o]=a;[r,o]=s(r,o);const l=this.rangeToRatioAxis(n,{start:r,end:o});l&&this.updateChanges({source:t,sourceDetail:e,changes:{[i]:l},isReset:!1})}getZoom(){return this.toZoomState(this.state)}getAxisZoom(t){return this.state[t]??{min:0,max:1}}getAxisZooms(){return this.state}getCoreZoom(){return this.state}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}getBoundSeries(){const t=this.getPrimaryAxis(Ht.X),e=this.getPrimaryAxis(Ht.Y);let i;if(this.independentAxes){const s=new Set(t?.boundSeries??[]),n=new Set(e?.boundSeries??[]);i=new Set;for(const a of s)n.has(a)&&i.add(a)}else i=new Set([...t?.boundSeries??[],...e?.boundSeries??[]]);return i}constrainZoomToItemCount(t,e,i){let s=[t.x.min,t.x.max],n=i?void 0:[t.y.min,t.y.max];for(const o of this.getBoundSeries()){const l=o.getZoomRangeFittingItems(s,n,e);l!=null&&(s=l.x,n=l.y)}const a={min:s[0],max:s[1]},r=n?{min:n[0],max:n[1]}:void 0;return Cc({x:a,y:r})}isVisibleItemsCountAtLeast(t,e,i){const s=this.getBoundSeries(),n=[t.x.min,t.x.max],a=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[t.y.min,t.y.max];let r=0;for(const o of s){const l=e-(r??0),c=o.getVisibleItems(n,a,l);if(r+=c,r>=e)return!0}return s.size===0}getMementoRanges(){const t=Cc(this.getZoom()),e={rangeX:this.getRangeDirection(Ht.X,t.x),rangeY:this.getRangeDirection(Ht.Y,t.y),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:void 0};return this.eventsHub.emit("zoom:save-memento",{memento:e}),e}restoreRequiredRange(t,e){const{lastRestoredRequiredRange:i,lastRestoredRequiredRangeDirection:s}=this,n=e!==Ht.X&&e!==Ht.Y,a=s===e&&i===t,r=t===0&&(i==null||i===0);if(n||a||r)return;const o=this.getPrimaryAxisId(e);if(!o)return;const l=this.getAxisZoom(o),c=Math.min(1,1/t);let h=0,d=1;e===Ht.X?(h=Ac(0,1-c,l.min),d=Ac(0,h+c,1)):(d=Math.min(1,l.max),h=d-c,h<0&&(d-=h,h=0),h=Ac(0,h,1),d=Ac(0,d,1)),this.lastRestoredRequiredRange=t,this.lastRestoredRequiredRangeDirection=e;const u={[e]:{min:h,max:d}},p=this.toCoreZoomState(u);this.lastRestoredState=ix(To(p)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:p,isReset:!1})}constrainZoomToRequiredWidth(t){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const e=this.lastRestoredRequiredRangeDirection,i=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!i)return;const s=t.stateAsDefinedZoom(),n=t.oldState[i],a=s[e].max-s[e].min,r=1/this.lastRestoredRequiredRange;a<=r||t.constrainZoom({...s,[e]:{min:n.min,max:n.min+r}})}dispatch(t,e,i,s,n){const{x:a,y:r}=this.getZoom()??{},o=this.state;let l;const c=this,h={source:t,sourceDetail:e,isReset:s,changedAxes:i,state:o,oldState:n,x:a,y:r,stateAsDefinedZoom(){return Cc(c.toZoomState(h.state))},constrainZoom(p){this.constrainChanges(c.toCoreZoomState(p))},constrainChanges(p){l??(l=To(o));for(const g of Jn(p)){const f=p[g],y=l[g];f&&y&&(y.min=f.min,y.max=f.max)}h.state=l}};this.eventsHub.emit("zoom:change-request",h);let d=!1;l&&!KE(o,l)&&(d=!0,this.state=l);const u=i.length>0||d;if(u){const p=this.getZoom()??{};this.eventsHub.emit("zoom:change-complete",{source:t,sourceDetail:e,x:p.x}),this.pendingZoomEventSource=t}return u}getRange(t,e){return this.getRangeAxis(this.findAxis(t),e)}getRangeDirection(t,e){return this.getRangeAxis(this.getPrimaryAxis(t),e)}getRangeAxis(t,e){if(!t||!e||!se.is(t.scale)&&!is.is(t.scale))return;const i=this.getDomainPixelExtents(t);if(!i)return;const[s,n]=i;let a,r;return s<=n?(a=t.scale.invert(0),r=t.scale.invert(s+(n-s)*e.max)):(a=t.scale.invert(s-(s-n)*e.min),r=t.scale.invert(0)),{start:a,end:r}}rangeToRatio(t,e){return this.rangeToRatioAxis(this.findAxis(t),e)}rangeToRatioDirection(t,e){return this.rangeToRatioAxis(this.getPrimaryAxis(t),e)}rangeToRatioAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[s,n]=i,{scale:a}=t,{start:r,end:o}=e,[l=tx.Leading,c=tx.Trailing]=ux(r,o),h=r==null?s:a.convert(r,{alignment:l}),d=o==null?n:a.convert(o,{alignment:c})+(a.bandwidth??0);if(!Tc(h)||!Tc(d))return;const[u,p]=[Math.min(s,n),Math.max(s,n)];if(h<u||h>p){Mc.warnOnce(`Invalid range start [${r}], expecting a value between [${a.invert(s)}] and [${a.invert(n)}], ignoring.`);return}if(d<u||d>p){Mc.warnOnce(`Invalid range end [${o}], expecting a value between [${a.invert(s)}] and [${a.invert(n)}], ignoring.`);return}const g=n-s;if(g===0)return;const f=Math.abs((h-s)/g),y=Math.abs((d-s)/g);if(!(f>=y))return{min:f,max:y}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainExtents(t){const{domain:e}=t.scale,i=e.at(0),s=e.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!Tc(e)||!Tc(i)))return[e,i]}},Ju=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Scrollbar=4]="Scrollbar",t[t.Navigator=5]="Navigator",t[t.Overlay=6]="Overlay",t))(Ju||{}),XE=class{constructor(t){this.eventsHub=t,this.elements=new Map}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i={width:t,height:e,layoutBox:new R(0,0,t,e),scrollbars:{}};for(const s of Object.values(Ju)){if(typeof s!="number")continue;const n=this.elements.get(s);if(n)for(const a of n)a(i)}return i}emitLayoutComplete({width:t,height:e},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:t,height:e},clipSeries:i.clipSeries??!1,series:i.series})}};import{isPointLabelDatum as qE,placeLabels as JE}from"ag-charts-core";var QE=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=R.zero){const s={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},n=new Set(t.map(r=>r.id));for(const r of this.labelData.keys())n.has(r)||this.labelData.delete(r);for(const r of t){const o=r.getLabelData();o.every(qE)&&this.labelData.set(r.id,o)}const a=JE(this.labelData,s,5);for(const r of t)r.updatePlacedLabelData?.(a.get(r.id)??[])}};import{Logger as e1,isArray as t1}from"ag-charts-core";var i1=class{constructor(t){this.eventsHub=t,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:s})=>({visible:t,seriesId:e,itemId:i,legendItemName:s}))}guardMemento(t){return t==null||t1(t)}restoreMemento(t,e,i){if(i)for(const s of i){const{seriesId:n,data:a}=this.getRestoredData(s)??{};!n||!a||this.updateData(n,a)}this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const r=(this.legendDataMap.get(e)??[]).map(o=>{const l=o.seriesId===e&&(!i||o.itemId===i);return l&&o.isFixed&&this.warnFixed(o.seriesId,o.itemId),!o.isFixed&&l?{...o,enabled:n}:o});return{seriesId:e,data:r}}if(!(i==null&&s==null))for(const a of this.getData()){if(i!=null&&a.itemId!==i||s!=null&&a.legendItemName!==s)continue;if(a.isFixed){this.warnFixed(a.seriesId,i);return}const r=(this.legendDataMap.get(a.seriesId)??[]).map(o=>o.itemId===i||o.legendItemName===s?{...o,enabled:n}:o);return{seriesId:a.seriesId,data:r}}}warnFixed(t,e){e1.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.eventsHub.emit("legend:change",{legendData:t??this.getData()})}updateData(t,e=[]){this.eventsHub.emit("legend:change-partial",{seriesId:t,legendData:e}),this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem(t,e,i,s){if(s){for(const o of this.getData()){const l=(this.legendDataMap.get(o.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(o.seriesId,l)}return}const n=this.getData(e),a=n.length===1,r=n.map(o=>i==null&&a||o.itemId===i?{...o,enabled:t}:o);this.updateData(e,r)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,s])=>e.concat(s),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},s1=class{updateCallback(t){this.resolvePartialCallback=t}resolvePartial(t,e,i){return this.resolvePartialCallback?.(t,e,i)}};import"ag-charts-core";var n1=class extends Ei{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(t){this._domain!==t&&(t.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=t)}get domain(){return this._domain}get bands(){return this.domain}addBand(t,e,i){this._domain.push(this.getDomainValue(t,e)),this._bandRanges.has(t)||this._bandRanges.set(t,new Map),this._bandRanges.get(t).set(e,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(t,e){return`${t}-${e}`}findIndex(t){let e=0;for(const i of this._bandRanges.keys()){if(i===t)return e;e++}}convert(t){const{_bandwidth:e,_bandRanges:i,_inset:s,_paddingInnerWidth:n}=this;let a=s;const r=t.split("-"),o=Number(r[0]);if(!this._hasFixedWidth)return super.convert(o);for(let l=0;l<o;l++){const c=i.get(l);if(!c){a+=n;continue}let h=0;for(const d of c.values())h=Math.max(h,d??e);a+=h+n}return a}invert(t,e){}getBandCountForUpdate(){return this._bandRanges.size}update(){if(!this._hasFixedWidth)return super.update();const[t,e]=this.range;let{paddingInner:i}=this;const s=this.getBandCountForUpdate();if(s===0)return;let n=0,a=s,r=s;for(const f of this._bandRanges.values()){let y=0,m=!1;for(const x of f.values()){if(x==null){m=!0;continue}y=Math.max(y,x)}m?r-=1:(a-=1,n+=y)}s===1&&(i=0);const o=e-t,l=o/s*i,c=n+l*(s-1),h=o-c;let d=t,u=a>0&&h>=0?h/a:o/s,p=u;r===s&&h>0&&(d+=h/2),this.round&&Math.floor(p)>0&&(d=Math.round(d),p=Math.round(p)),h<0&&(u=0,p=0),this._inset=d,this._bandwidth=p,this._rawBandwidth=u,this._paddingInnerWidth=l}normalizeDomains(...t){return{domain:[],animatable:!1}}toDomain(t){}},a1=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:t,seriesGrouping:e,visible:i,width:s,type:n}){if(!e)return;let a=this.groups.get(n);a==null&&(a=new Map,this.groups.set(n,a)),a.set(t,{grouping:e,visible:i,width:s})}updateSeries({internalId:t,seriesGrouping:e,visible:i,width:s,type:n}){if(!e)return;const a=this.groups.get(n)?.get(t);a&&(a.grouping=e,a.width=s,a.visible=i)}deregisterSeries({internalId:t,type:e}){const i=this.groups.get(e);i!=null&&(i.delete(t),i.size===0&&this.groups.delete(e))}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set,a=this.groups.get(t);for(const o of a?.values()??[])o.visible&&(s.add(o.grouping.groupIndex),o.grouping.groupIndex===e.groupIndex&&n.add(o.grouping.stackIndex));const r=Array.from(s);return r.sort((o,l)=>o-l),{visibleGroupCount:r.length,visibleSameStackCount:n.size,index:r.indexOf(e.groupIndex)}}updateGroupScale({type:t},e,i){const s=this.groupScales.get(t)??new n1;this.groupScales.set(t,s),s.domain=[];const n=this.groups.get(t);for(const a of n?.values()??[])a.visible&&s.addBand(a.grouping.groupIndex,a.grouping.stackIndex,a.width);s.domain.length===0&&s.addBand(0,0,void 0),s.range=[0,e],i.type==="grouped-category"?s.paddingInner=i.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(s.paddingInner=i.groupPaddingInner,s.round=s.padding!==0):s.padding=0,s.update()}getGroupScale({type:t}){return this.groupScales.get(t)}getGroupOffset(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const s=i.getDomainValue(e.groupIndex,e.stackIndex);return i.convert(s)}getStackOffset(t,e){const{seriesGrouping:i}=t;if(!i)return 0;const s=this.groups.get(t.type);if(!s)return 0;const n=this.getGroupScale(t);if(!n||(i.stackCount??0)<1)return 0;let r=0;for(const o of s.values())o.visible&&o.grouping.groupIndex===i.groupIndex&&(r=Math.max(r,o.width??n.bandwidth));return r===0?0:r/2-e/2}};import{ChartUpdateType as r1,EventEmitter as o1}from"ag-charts-core";var l1=class{constructor(t){this.updateCallback=t,this.events=new o1}addListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}update(t=r1.FULL,e){this.updateCallback(t,e)}dispatchUpdateComplete(t,e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:t,wasShortcut:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSeriesUpdate(t,e){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:t,requiredRangeDirection:e})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}},c1=class{constructor(t,e){this.eventsHub=new EN,this.callbackCache=new kN,this.highlightManager=new Yb(this.eventsHub),this.formatManager=new tr,this.layoutManager=new XE(this.eventsHub),this.localeManager=new jk(this.eventsHub),this.seriesStateManager=new a1,this.stateManager=new HN,this.seriesLabelLayoutManager=new QE,this.cleanup=new wN;const{scene:i,root:s,syncManager:n,container:a,fireEvent:r,updateCallback:o,updateMutex:l,styleContainer:c,skipCss:h,chartType:d,domMode:u,withDragInterpretation:p}=e;this.chartService=t,this.syncManager=n,this.domManager=new Yy(this.eventsHub,this.chartService,a,c,h,u),this.widgets=new FE(this.domManager,{withDragInterpretation:p});const g=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new uc({canvasElement:g}),this.scene.setRoot(s),this.cleanup.register(this.scene.on("scene-changed",()=>{this.updateService.update(ON.SCENE_RENDER)})),this.axisManager=new rO(this.eventsHub,s),this.legendManager=new i1(this.eventsHub),this.annotationManager=new aO(this.eventsHub,t.annotationRoot,r),this.chartTypeOriginator=new VN(t),this.interactionManager=new db,this.contextMenuRegistry=new Hb(this.eventsHub),this.optionsGraphService=new s1,this.updateService=new l1(o),this.activeManager=new GO(this.chartService,this.eventsHub,this.updateService,this.interactionManager,r),this.proxyInteractionService=new Vk(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new uO(this.domManager,this.updateService),this.historyManager=new GN(this.eventsHub),this.animationManager=new fE(this.interactionManager,l),this.dataService=new Mu(this.eventsHub,t,this.animationManager),this.tooltipManager=new Dc(this.eventsHub,this.localeManager,this.domManager,t.tooltip),this.zoomManager=new fx(this.eventsHub,this.updateService,r);for(const f of RN.listModulesByType(PN.Plugin))(!f.chartType||f.chartType===d)&&f.patchContext?.(this)}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.cleanup.flush()}};import{BaseProperties as h1,Property as mx}from"ag-charts-core";var Qu=class extends h1{constructor(){super(...arguments),this.range="tooltip",this.drawingMode="cutout"}};b([mx],Qu.prototype,"range",2),b([mx],Qu.prototype,"drawingMode",2);import{arraysEqual as yx,objectsEqual as bx}from"ag-charts-core";function d1(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function u1(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const n=e.get(i);if(n==null||!d1(s,n))return!1}return!0}function p1(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:s,idsMap:n,scopes:a,data:r,...o}=t[i],{type:l,idsMap:c,scopes:h,data:d,...u}=e[i];if(s!==l||a&&h&&!yx(a,h)||r&&d&&r!==d||!bx(o,u)||!u1(n,c))return!1}return!0}function g1(t,e){const{props:i,...s}=t,{props:n,...a}=e;return bx(s,a)&&p1(i,n)}function f1(t,e,i,s){return e!==t.dataSet?!1:yx(i,t.ids)&&g1(s,t.opts)}import{Debug as xx,Logger as Si,getWindow as vx,jsonDiff as m1}from"ag-charts-core";function Sx(t){return t.filter(e=>e.type==="key").map(e=>e.property).join(";")}var ep=class Li{constructor(e,i,s){this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=xx.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,a)=>{this.requested.push({id:e,opts:s,dataSet:i,resolve:n,reject:a})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const i=new Map;for(const o of this.requested)o.dataSet.hasPendingTransactions()&&i.set(o.dataSet,o.dataSet.getChangeDescription()),o.dataSet.commitPendingTransactions();this.debug("DataController.execute() - requested",this.requested);const s=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",s);const n=this.mergeRequested(s);this.debug("DataController.execute() - merged",n),this.debug.check()&&(vx().processedData=[]);const a=[];for(const{dataSet:o,ids:l,opts:c,resolves:h,rejects:d}of n){let u=function(v){return f1(v,o,l,c)};var r=u;const p=e?.find(u),g=(v,S)=>{if(this.debug.check()&&vx("processedData").push(S),S==null){for(const I of d)I(new Error("AG Charts - no processed data generated"));return}a.push({opts:c,dataSet:o,dataLength:o.data.length,ids:l,dataModel:v,processedData:S});for(const I of h)I({dataModel:v,processedData:S})},f=()=>{try{const v=new Bu(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),S=new Map(s.map(M=>[M.id,M.dataSet])),I=v.processData(S);return g(v,I),v}catch(v){for(const S of d)S(v)}};if(p==null){f();continue}const{dataModel:y,processedData:m}=p,x=i.get(o);if(m&&x&&y.isReprocessingSupported(m)){if(this.debug("DataController.execute() - reprocessing data",m,o),y.reprocessData(m,i),xx.check("data-model:reprocess-diff")){const v=new Bu(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),S=new Map(s.map(A=>[A.id,A.dataSet])),I=v.processData(S),M=JSON.parse(JSON.stringify(m,Li.jsonReplacer)),D=JSON.parse(JSON.stringify(I,Li.jsonReplacer));delete M.time,delete M.optimizations,delete D.time,delete D.optimizations;const C=m1(D,M);C?(Si.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),Si.log("Difference between incremental update and full reprocess:"),Si.log(""),Si.log("BASELINE (full reprocess):"),Si.log(JSON.stringify(D,null,2)),Si.log(""),Si.log("REPROCESSED (incremental update):"),Si.log(JSON.stringify(M,null,2)),Si.log(""),Si.log("DIFF (what changed):"),Si.log(JSON.stringify(C,null,2))):Si.log("\u2705 Data-model reprocess matches baseline (no diff)")}g(y,m);continue}f()}return a}validateRequests(e){const i=[];for(const[s,n]of e.entries())s>0&&n.dataSet.data.length!==e[0].dataSet.data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(e){const i=[];for(const s of e){const n=i.find(Li.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Li.mergeRequests)}static groupMatch({dataSet:e,opts:i}){const{groupByData:s,groupByKeys:n=!1,groupByFn:a,props:r}=i,o=Sx(r);return([l])=>(s===!1||l.dataSet===e)&&(l.opts.groupByKeys??!1)===n&&l.opts.groupByFn===a&&Sx(l.opts.props)===o}static mergeRequests(e){const i={ids:[],rejects:[],resolves:[],dataSet:e[0].dataSet,opts:{...e[0].opts,props:[]}},s=new Map,n=new Map;let a=0;for(const r of e){const{id:o,dataSet:l,resolve:c,reject:h,opts:{props:d,...u}}=r;i.ids.push(o),i.rejects.push(h),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...u,props:[]});for(const p of d){const g={...p,scopes:[o],data:l.data};Li.createIdsMap(o,g);let f;Li.crossScopeMergableTypes.has(g.type)?f=-1:n.has(l.data)?f=n.get(l.data):(f=a++,n.set(l.data,f));const y=`${g.type}-${f}-${g.groupId}`,m=s.get(y),x=m?.find(v=>Li.deepEqual(v,g));if(m==null){i.opts.props.push(g),s.set(y,[g]);continue}else if(x==null){i.opts.props.push(g),m.push(g);continue}g.scopes!=null&&(x.scopes??(x.scopes=[]),x.scopes.push(...g.scopes)),(x.type==="key"||x.type==="value")&&g.idsMap?.size&&(x.idsMap??(x.idsMap=new Map),Li.mergeIdsMap(g.idsMap,x.idsMap))}}return i}static mergeIdsMap(e,i){for(const[s,n]of e){const a=i.get(s);if(a==null)i.set(s,new Set(n));else for(const r of n)a.add(r)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(e)){if(n=e.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Li.deepEqual(e[s],i[s]))return!1;return!0}const a=Object.keys(e);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const r=a[s];if(!Li.skipKeys.has(r)&&(!Object.hasOwn(i,r)||!Li.deepEqual(e[r],i[r])))return!1}return!0}return!1}static jsonReplacer(e,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};ep.crossScopeMergableTypes=new Set(["key","group-value-processor"]),ep.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Ix=ep;import{Logger as Dx}from"ag-charts-core";var ar=class wd{constructor(e){this.data=e,this.pendingTransactions=[]}static empty(){return new wd([])}static wrap(e){return new wd(e)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const e=this.getChangeDescription();return e?e.indexMap.finalLength:this.data.length}addTransaction(e){const i=this.normalizeTransaction(e);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){return new wd([...this.data])}normalizeTransaction(e){const{add:i,addIndex:s,prepend:n,append:a,remove:r,update:o}=e;if(i===void 0)return e;const l={remove:r,update:o};if(n&&(l.prepend=n),a&&(l.append=a),i&&i.length>0){const c=this.netSize();s===void 0||s>=c?l.append=a?[...a,...i]:i:s===0?l.prepend=n?[...i,...n]:i:l.insertions=[{index:s,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(){if(!this.hasPendingTransactions())return!1;const e=this.getChangeDescription();if(!e)return!1;const i=e.getPrependedValues(),s=e.getInsertionValues(),n=e.getAppendedValues(),a=[...i,...s,...n];let r=0;return e.applyToArray(this.data,function(l){if(r>=a.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return a[r++]}),this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.updateItemToIndexCache(e,n,i,s),!0}updateItemToIndexCache(e,i,s,n){if(!this.itemToIndexCache)return;const{indexMap:a}=e,{totalPrependCount:r,totalAppendCount:o,removedIndices:l}=a,c=l.size>0,h=n.length>0;if(!c&&r===0&&o===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}let d=!1,u=0;if(c){const y=Array.from(l).sort((m,x)=>m-x);if(d=y[0]===0,d){for(let m=0;m<y.length;m++)if(y[m]!==m){d=!1;break}d&&(u=y.length)}}if(c&&!d){this.itemToIndexCache=void 0;return}const p=this.itemToIndexCache,g=r-u;if(g!==0)for(const[y,m]of p)l.has(m)?p.delete(y):p.set(y,m+g);else if(c)for(const[y,m]of p)l.has(m)&&p.delete(y);for(let y=0;y<s.length;y++){const m=s[y];p.has(m)||p.set(m,y)}const f=a.finalLength-o;for(let y=0;y<i.length;y++){const m=i[y];p.has(m)||p.set(m,f+y)}}clearPendingTransactions(){const e=this.pendingTransactions.length;return this.pendingTransactions=[],this.cachedChangeDescription=void 0,e}getPendingTransactions(){return[...this.pendingTransactions]}toJSON(){return this.data}getChangeDescription(){if(!this.hasPendingTransactions())return;if(this.cachedChangeDescription)return this.cachedChangeDescription;const{indexMap:e,prependValues:i,appendValues:s,insertionValues:n}=this.buildIndexMap(),a=new zw(e,{prependValues:i,appendValues:s,insertionValues:n});return this.cachedChangeDescription=a,a}removeFromGroups(e,i){for(const s of e){let n=0;for(;n<s.length&&i.size>0;)i.has(s[n])?(i.delete(s[n]),s.splice(n,1)):n++;if(i.size===0)break}}buildIndexMap(){const e=this.data.length,i=this.collectTransactionEffects(),s=i.prependsList.flat(),n=i.appendsList.flat(),a=i.insertionsList.flat(),r=s.length,o=n.length,l=a.length,c=e-i.removedOriginalIndices.size,h=r+c+l+o,d=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,u=this.buildSpliceOperations(r,l,o,c,i.trackedInsertions,d?.desc,d?.asc),p=this.resolveUpdatedIndices(r,l,c,i.updateTracking,d?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:e,finalLength:h,spliceOps:u,removedIndices:i.removedOriginalIndices,updatedIndices:p,totalPrependCount:r,totalAppendCount:o},prependValues:s,appendValues:n,insertionValues:a}}getSortedRemovedIndices(e){const i=Array.from(e).sort((s,n)=>s-n);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const e={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const i of this.pendingTransactions){const{prepend:s,append:n,insertions:a,remove:r,update:o}=i;this.applyPrepends(s,e),this.applyInsertions(a,e),this.applyAppends(n,e),this.applyRemovals(r,e),this.applyUpdates(o,e)}return{prependsList:e.prependsList,appendsList:e.appendsList,insertionsList:e.insertionsList,trackedInsertions:e.trackedInsertions,removedOriginalIndices:e.removedOriginalIndices,updatedOriginalIndices:e.updatedOriginalIndices,updateTracking:e.updateTracking}}applyPrepends(e,i){!Array.isArray(e)||e.length===0||(i.prependsList.unshift([...e]),i.virtualLength+=e.length)}applyInsertions(e,i){if(Array.isArray(e))for(const{index:s,items:n}of e)s>=0&&s<=i.virtualLength&&n.length>0&&(i.trackedInsertions.push({virtualIndex:s,items:[...n]}),i.insertionsList.push([...n]),i.virtualLength+=n.length)}applyAppends(e,i){!Array.isArray(e)||e.length===0||(i.appendsList.push([...e]),i.virtualLength+=e.length)}applyRemovals(e,i){if(!Array.isArray(e)||e.length===0)return;const s=new Set(e);if(this.removeFromGroups(i.prependsList,s),s.size>0&&this.removeFromGroups(i.insertionsList,s),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(e,i),s.size>0&&this.removeFromGroups(i.appendsList,s),s.size>0)for(let n=0;n<this.data.length&&s.size>0;n++){const a=this.data[n];s.has(a)&&(i.removedOriginalIndices.add(n),s.delete(a),i.virtualLength--)}s.size>0&&Dx.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyUpdates(e,i){if(!Array.isArray(e)||e.length===0)return;const s=new Set(e),n=this.collectUpdatedIndicesFromGroups(i.prependsList,s),a=s.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,s):[],r=s.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,s):[];s.size>0&&this.collectUpdatedOriginalIndices(s,i),i.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:r,updatedInsertionsIndices:a},s.size>0&&Dx.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(e,i){if(i.size===0||e.length===0)return[];const s=[];let n=0;for(const a of e){for(const r of a)i.has(r)&&(s.push(n),i.delete(r)),n++;if(i.size===0)break}return s}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let e=0;e<this.data.length;e++)this.itemToIndexCache.has(this.data[e])||this.itemToIndexCache.set(this.data[e],e)}return this.itemToIndexCache}collectUpdatedOriginalIndices(e,i){const s=this.getItemToIndexMap();for(const n of[...e]){const a=s.get(n);a!==void 0&&!i.removedOriginalIndices.has(a)&&(i.updatedOriginalIndices.add(a),e.delete(n))}}removeFromTrackedInsertions(e,i){for(let s=0;s<i.trackedInsertions.length;s++){const n=i.trackedInsertions[s],a=n.items.length,r=[];let o=0;for(;o<n.items.length;)e.includes(n.items[o])?(r.push(o+r.length),n.items.splice(o,1),i.virtualLength--):o++;r.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,n,a,r)}}adjustLaterInsertionsAfterRemoval(e,i,s,n,a){const r=a.length;for(let o=i+1;o<e.length;o++){const l=e[o];if(l.virtualIndex<=s.virtualIndex)continue;const c=Math.min(Math.max(l.virtualIndex-s.virtualIndex,0),n);let h=0;for(const d of a)if(d<c)h++;else break;c===n&&(h=r),h>0&&(l.virtualIndex-=h)}}buildSpliceOperations(e,i,s,n,a,r,o){const l=[];if(e>0&&l.push({index:0,deleteCount:0,insertCount:e}),r&&r.length>0){let c=r[0],h=1;for(let d=1;d<r.length;d++){const u=r[d];r[d-1]-u===1?h++:(l.push({index:c-h+1+e,deleteCount:h,insertCount:0}),c=u,h=1)}l.push({index:c-h+1+e,deleteCount:h,insertCount:0})}if(a.length>0)for(const c of a){const h=this.countRemovalsBeforeIndex(o,e,c.virtualIndex),d=c.virtualIndex-h;l.push({index:d,deleteCount:0,insertCount:c.items.length})}return s>0&&l.push({index:e+n+i,deleteCount:0,insertCount:s}),l}countRemovalsBeforeIndex(e,i,s){if(!e||e.length===0)return 0;let n=0;for(const a of e)if(a+i<s)n++;else break;return n}resolveUpdatedIndices(e,i,s,n,a,r,o){const l=new Set;if(n)for(const c of n.updatedPrependsIndices)l.add(c);if(r.size>0){const c=Array.from(r).sort((d,u)=>d-u);let h=0;for(const d of c){if(a)for(;h<a.length&&a[h]<d;)h++;const u=a?h:0,p=d+e;let g=0;for(const y of o)y.virtualIndex<=p&&(g+=y.items.length);const f=d+e-u+g;l.add(f)}}if(n){const c=e+s+i;for(const h of n.updatedAppendsIndices)l.add(c+h);if(n.updatedInsertionsIndices.length>0&&o.length>0){let h=0;for(const d of o){const u=this.countRemovalsBeforeIndex(a,e,d.virtualIndex),p=d.virtualIndex-u;for(let g=0;g<d.items.length;g++)n.updatedInsertionsIndices.includes(h)&&l.add(p+g),h++}}}return l}},tp=class Us{constructor(e){this.chart=e}subscribe(e=Us.DEFAULT_GROUP){let i=this.get(e);return i||(i={members:new Set},Us.chartsGroups.set(e,i)),i.members.add(this.chart),this}unsubscribe(e=Us.DEFAULT_GROUP){const i=this.get(e);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(e=Us.DEFAULT_GROUP){return this.get(e)}getGroupMembers(e=Us.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i.members):[]}getGroupSiblings(e=Us.DEFAULT_GROUP){return this.getGroupMembers(e).filter(i=>i!==this.chart)}getGroupSyncMode(e=Us.DEFAULT_GROUP){return this.getGroupMembers(e).some(i=>i.series.length>1)?"multi-series":"single-series"}get(e){return Us.chartsGroups.get(e)}};tp.chartsGroups=new Map,tp.DEFAULT_GROUP=Symbol("sync-group-default");var y1=tp;import{BaseProperties as b1,Property as Mx}from"ag-charts-core";var ip=class extends b1{constructor(){super(...arguments),this.enabled=!1}};b([Mx],ip.prototype,"enabled",2),b([Mx],ip.prototype,"tabIndex",2);import{ChartAxisDirection as sp,Property as wc,StateMachine as x1,arraysEqual as v1,calcLineHeight as Ax,countLines as S1,diffArrays as I1,findMinMax as D1,isPlainObject as M1}from"ag-charts-core";var Cx={};Pn(Cx,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ri,fromToMotion:()=>Oe,staticFromToMotion:()=>As});import{easeOut as np}from"ag-charts-core";var Ri={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Oe(t,e,i,s,n,a,r){const{fromFn:o,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=n,{nodes:h,selections:d}=Lu(s),u=(g,f)=>{let y,m=0,x=0;for(const v of f){const S=g[m]===v,I={last:x>=f.length-1,lastLive:m>=g.length-1,prev:f[x-1],prevFromProps:y,prevLive:g[m-1],next:f[x+1],nextLive:g[m+(S?1:0)]},M=`${t}_${e}_${v.id}`;i.stopByAnimationId(M);let D="unknown";S?a&&r&&(D=A1(v,v.datum,a,r)):D="removed",v.transitionOut=D==="removed";const{phase:C,start:A,finish:T,delay:L,duration:N,...O}=o(v,v.datum,D,I),{phase:E,start:k,finish:P,delay:F,duration:w,...j}=l(v,v.datum,D,I),q=T==null;i.animate({id:M,groupId:t,phase:C??E??"update",duration:N??w,delay:L??F,from:O,to:j,ease:np,collapsable:q,onPlay:()=>{const J={...A,...k,...O};c(v,J,"start")},onUpdate(J){c(v,J,"update")},onStop:()=>{const J={...A,...k,...O,...j,...T,...P};c(v,J,"end")}}),S&&m++,x++,y=O}};let p=0;for(const g of d){const f=g.nodes(),y=f.filter(m=>!g.isGarbage(m));u(y,f),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:np,onStop(){g.cleanup()}}),p++}u(h,h)}function As(t,e,i,s,n,a,r){const{nodes:o,selections:l}=Lu(s),{start:c,finish:h,phase:d}=r;i.animate({id:`${t}_${e}`,groupId:t,phase:d??"update",from:n,to:a,ease:np,onPlay:()=>{if(c){for(const u of o)u.setProperties(c);for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const f of p)f.setProperties(c)})}}},onUpdate(u){for(const p of o)p.setProperties(u);for(const p of l){const g=p.nodes();p.batchedUpdate(function(){for(const y of g)y.setProperties(u)})}},onStop:()=>{for(const u of o)u.setProperties({...a,...h});for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const f of p)f.setProperties({...a,...h});u.cleanup()})}}})}function A1(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":t.previousDatum==null&&t.datum!=null?"added":t.previousDatum!=null&&t.datum==null?"removed":"updated"}var Tx={};Pn(Tx,{resetMotion:()=>at});function at(t,e){const{nodes:i,selections:s}=Lu(t);for(const n of s){const a=n.nodes();n.batchedUpdate(function(){for(const o of a){const l=e(o,o.datum);o.setProperties(l)}n.cleanup()})}for(const n of i){const a=e(n,n.datum);n.setProperties(a)}}import{Debug as C1}from"ag-charts-core";var we=class Va{constructor(e,i,s=!0){this.parentNode=e,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=C1.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(vs,i)?()=>new i:i}static select(e,i,s=!0){return new Va(e,i,s)}static selectAll(e,i){const s=[],n=a=>{if(i(a)&&s.push(a),a instanceof z)for(const r of a.children())n(r)};return n(e),s}static selectByClass(e,...i){return Va.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return Va.selectAll(e,s=>s.tag===i)}createNode(e,i,s){const n=this.nodeFactory(e);return n.datum=e,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(e,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),s&&this._nodesMap.size===0&&this._nodes.length>0)for(const n of this._nodes)this.garbageBin.add(n);if(!s&&this._nodesMap.size>0&&this._nodesMap.clear(),s){const n=new Map,a=new Map;for(let r=0;r<e.length;r++){const o=e[r];let l=s(o);if(n.has(l)){const c=(a.get(l)??0)+1;a.set(l,c),l=`${l}:${c}`}n.set(l,r)}for(const[r,o]of this._nodesMap.entries()){const l=n.get(o);l==null?this.garbageBin.add(r):(r.datum=e[l],this.garbageBin.delete(r),n.delete(o))}for(const[r,o]of n.entries()){const l=e[o];this._nodesMap.set(this.createNode(l,i,o),r)}}else{const n=Math.max(e.length,this.data.length);for(let a=0;a<n;a++)a>=e.length?this.garbageBin.add(this._nodes[a]):a>=this._nodes.length?this.createNode(e[a],i):(this._nodes[a].datum=e[a],this.garbageBin.delete(this._nodes[a]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const e=this;function i(s){return e.garbageBin.has(s)?(e._nodesMap.delete(s),e.garbageBin.delete(s),s.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const e of this._nodesMap.keys())this.garbageBin.add(e);return this._nodesMap.clear(),this}isGarbage(e){return this.garbageBin.has(e)}each(e){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const n of i.entries())e(n[1],n[1].datum,n[0])}),this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const i=this._nodes[e];yield{node:i,datum:i.datum,index:e}}}select(e){return Va.selectAll(this.parentNode,e)}selectByClass(e){return Va.selectByClass(this.parentNode,e)}selectByTag(e){return Va.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}batchedUpdate(e){this.parentNode.batchedUpdate(e)}};import{createSvgElement as T1,lineDistanceSquared as L1}from"ag-charts-core";var ni=class extends zn{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new R(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(t,e){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(t,e):!1}distanceSquared(t,e){const{x1:i,y1:s,x2:n,y2:a}=this;return L1(t,e,i,s,n,a,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;let{x1:s,y1:n,x2:a,y2:r}=this;if(s===a){const{strokeWidth:o}=this,l=Math.round(s*i)/i+Math.trunc(o*i)%2/(i*2);s=l,a=l}else if(n===r){const{strokeWidth:o}=this,l=Math.round(n*i)/i+Math.trunc(o*i)%2/(i*2);n=l,r=l}e.beginPath(),e.moveTo(s,n),e.lineTo(a,r),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=T1("line");return t.setAttribute("x1",String(this.x1)),t.setAttribute("y1",String(this.y1)),t.setAttribute("x2",String(this.x2)),t.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(t),{elements:[t]}}};ni.className="Line",b([K()],ni.prototype,"x1",2),b([K()],ni.prototype,"y1",2),b([K()],ni.prototype,"x2",2),b([K()],ni.prototype,"y2",2);import{BaseProperties as N1,Property as rt,isArray as k1}from"ag-charts-core";var Qn=class{constructor(){this.enabled=!0}};b([rt],Qn.prototype,"enabled",2),b([rt],Qn.prototype,"stroke",2),b([rt],Qn.prototype,"strokeWidth",2),b([rt],Qn.prototype,"strokeOpacity",2);var ai=class extends N1{constructor(){super(...arguments),this.border=new Qn}};b([rt],ai.prototype,"border",2),b([rt],ai.prototype,"color",2),b([rt],ai.prototype,"cornerRadius",2),b([rt],ai.prototype,"fill",2),b([rt],ai.prototype,"fillOpacity",2),b([rt],ai.prototype,"fontStyle",2),b([rt],ai.prototype,"fontWeight",2),b([rt],ai.prototype,"fontSize",2),b([rt],ai.prototype,"fontFamily",2),b([rt],ai.prototype,"padding",2);var ri=class extends ai{constructor(){super(...arguments),this.enabled=!1,this._cachedFormatter=void 0}formatValue(t,e,i,s){const{formatter:n,format:a}=this;let r;if(n!=null&&(r??(r=t(n,s))),a!=null){let o=this._cachedFormatter;(o?.type!==e||o?.format!==a)&&(o={type:e,format:a,formatter:tr.getFormatter(e,a)},this._cachedFormatter=o),r??(r=o.formatter?.(i))}return r==null||k1(r)?r:String(r)}};b([rt],ri.prototype,"enabled",2),b([rt],ri.prototype,"formatter",2),b([rt],ri.prototype,"format",2),b([rt],ri.prototype,"itemStyler",2);function rr(t){const{enabled:e=!1,stroke:i}=t?.border??{},n=t?.fill!=null||e&&i!=null?t?.padding:null;if(n==null)return{bottom:0,left:0,right:0,top:0};if(typeof n=="number")return{bottom:n,left:n,right:n,top:n};{const{bottom:a=0,left:r=0,right:o=0,top:l=0}=n;return{bottom:a,left:r,right:o,top:l}}}import{ChartAxisDirection as O1,ChartUpdateType as w1,CleanupRegistry as E1,ObserveChanges as R1,Property as Ec,WeakCache as P1,ZIndexMap as Lo,callWithContext as Lx,clampArray as Nx,deepFreeze as _1,findMinMax as kx,findRangeExtent as Ox,isArray as F1,mergeDefaults as V1}from"ag-charts-core";var ap=class{constructor(){this.moduleMap=new Map}modules(){return this.moduleMap.values()}addModule(t,e){if(this.moduleMap.has(t))throw new Error(`AG Charts - module already initialised: ${t}`);this.moduleMap.set(t,e)}removeModule(t){this.moduleMap.get(t)?.destroy?.(),this.moduleMap.delete(t)}getModule(t){return this.moduleMap.get(t)}isEnabled(t){return this.moduleMap.has(t)}mapModules(t){return Array.from(this.moduleMap.values(),t)}destroy(){for(const t of this.moduleMap.values())t?.destroy?.();this.moduleMap.clear()}};import{BaseProperties as B1,Property as ot,clampArray as wx,createId as z1,findMinMax as G1,toRadians as Ex}from"ag-charts-core";var ss=class extends zn{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.strokeWidth=1}computeBBox(){return new R(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(t,e){return!1}render(t){const{ctx:e}=t;let{x1:i,y1:s,x2:n,y2:a}=this;i=this.align(i),s=this.align(s),n=this.align(n),a=this.align(a);const{fill:r,horizontal:o}=this,{globalAlpha:l}=e;r!=null&&(this.applyFillAndAlpha(e),e.beginPath(),e.moveTo(i,s),e.lineTo(n,s),e.lineTo(n,a),e.lineTo(i,a),e.closePath(),e.fill(),e.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:d,endLine:u}=this;if(!!((d||u)&&c&&h)){const{lineDash:g,lineDashOffset:f,lineCap:y,lineJoin:m}=this;this.applyStrokeAndAlpha(e),e.lineWidth=h,g&&e.setLineDash([...g]),f&&(e.lineDashOffset=f),y&&(e.lineCap=y),m&&(e.lineJoin=m),e.beginPath(),d&&(e.moveTo(i,s),o?e.lineTo(i,a):e.lineTo(n,s)),u&&(e.moveTo(n,a),o?e.lineTo(n,s):e.lineTo(i,a)),e.stroke(),e.globalAlpha=l}this.fillShadow?.markClean(),super.render(t)}};ss.className="Range",b([K()],ss.prototype,"x1",2),b([K()],ss.prototype,"y1",2),b([K()],ss.prototype,"x2",2),b([K()],ss.prototype,"y2",2),b([K()],ss.prototype,"startLine",2),b([K()],ss.prototype,"endLine",2),b([K()],ss.prototype,"horizontal",2);import{checkDatum as j1}from"ag-charts-core";function Rx(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function Px(t,e){const i=Rx(t);if(i==null)return!1;const s=se.is(e)||is.is(e),n=a=>j1(a,s)&&!Number.isNaN(e.convert(a,{clamp:!0}));if(t.type==="range"){const[a,r]=i;return n(a)&&n(r)}else return n(i)}var U1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},H1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},W1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},Y1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},ea=class extends ai{constructor(){super(...arguments),this.enabled=void 0,this.padding=5}};b([ot],ea.prototype,"enabled",2),b([ot],ea.prototype,"padding",2),b([ot],ea.prototype,"text",2),b([ot],ea.prototype,"position",2),b([ot],ea.prototype,"rotation",2),b([ot],ea.prototype,"parallel",2);var Tt=class extends B1{constructor(){super(),this.id=z1(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new ea,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new z({name:this.id}),this.lineGroup=new z({name:this.id}),this.labelGroup=new z({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new ss),this.crossLineLabel=this.labelGroup.appendChild(new Za),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(t){const{enabled:e,type:i,data:s,scale:n}=this;if(!n||!e||!t||!Px(this,n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const a=i==="range";a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(t){if(this.data=void 0,!t)return;const{type:e,range:i,value:s,scale:n,clippedRange:a,strokeWidth:r=0}=this;if(!n)return;const o=n.bandwidth??0,l=n.step??0,c=n instanceof Ei?(l-o)/2:0;let[h,d]=G1(a);h-=o,d+=o;let u,p,g,f;if(e==="line"){const y=o/2;if(u=n.convert(s)+y,p=Number.NaN,g=n.convert(s,{clamp:!0})+y,f=Number.NaN,g>=d||g<=h)return}else if(i){const[y,m]=i,[x,v]=ux(y,m);if(u=n.convert(y,{alignment:x}),p=n.convert(m,{alignment:v}),g=n.convert(y,{clamp:!0,alignment:x}),f=n.convert(m,{clamp:!0,alignment:v}),g>f&&([g,f]=[f,g],[u,p]=[p,u]),g>=d||f<=h)return;Number.isFinite(u)&&(g-=c),Number.isFinite(p)&&(p+=o,f+=o+c)}else return;g=wx(g,a),f=wx(f,a),u-c>=g&&(u-=c),p+c<=f&&(p+=c),this.startLine=r>0&&u>=g&&u<=g+c,this.endLine=r>0&&p>=f-o-c&&p<=f,this.data=[g,f],this.label.enabled===!1||this.label.text}updateNodes(){const{position:t,data:[e,i]=[0,0],gridLength:s}=this,n=Number.isFinite(i)?i-e:0;let a;switch(t){case"top":case"bottom":a=new R(e,t==="top"?0:-s,n,s);break;case"left":case"right":a=new R(t==="left"?0:-s,e,s,n)}this.updateRangeNode(a);const{label:r}=this;r.enabled!==!1&&r.text&&(this.updateLabel(),this.positionLabel(a))}updateRangeNode(t){const{type:e,position:i,crossLineRange:s,startLine:n,endLine:a,fill:r,fillOpacity:o,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d}=this;s.x1=t.x,s.x2=t.x+t.width,s.y1=t.y,s.y2=t.y+t.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=a,s.fill=e==="range"?r:void 0,s.fillOpacity=o??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=d}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fill=e.color,t.text=e.text,t.textAlign="center",t.textBaseline="middle",t.setFont(e),t.setBoxing(e))}get anchor(){const t=this.position==="left"||this.position==="right",e=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return e?(t?W1:Y1)[i]:(t?U1:H1)[i]}positionLabel(t){const{crossLineLabel:e,label:i,anchor:s}=this;e.rotation=Ex(i.rotation??0);const n=e.getBBox();if(!n)return;const{width:a,height:r}=n,o=i.padding+a/2,l=i.padding+r/2,c=t.x+t.width*(s.rangeH+1)/2-o*s.labelH,h=t.y+t.height*(s.rangeV+1)/2-l*s.labelV;e.x=c,e.y=h,e.rotationCenterX=c,e.rotationCenterY=h}computeLabelSize(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new Za;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.rotation=Ex(t.rotation??0),e.textBaseline="middle",e.textAlign="center";const i=e.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(t){const{label:e,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:a}=s,r=e.padding+n,o=e.padding+a,l=this.position==="left"||this.position==="right";l&&(i.rangeH===-1&&i.labelH===1?t.left=Math.max(t.left??0,r):i.rangeH===1&&i.labelH===-1&&(t.right=Math.max(t.right??0,r))),l||(i.rangeV===-1&&i.labelV===1?t.top=Math.max(t.top??0,o):i.rangeV===1&&i.labelV===-1&&(t.bottom=Math.max(t.bottom??0,o)))}};Tt.className="CrossLine",b([ot],Tt.prototype,"enabled",2),b([ot],Tt.prototype,"type",2),b([ot],Tt.prototype,"range",2),b([ot],Tt.prototype,"value",2),b([ot],Tt.prototype,"defaultColorRange",2),b([ot],Tt.prototype,"fill",2),b([ot],Tt.prototype,"fillOpacity",2),b([ot],Tt.prototype,"stroke",2),b([ot],Tt.prototype,"strokeWidth",2),b([ot],Tt.prototype,"strokeOpacity",2),b([ot],Tt.prototype,"lineDash",2),b([ot],Tt.prototype,"label",2);import{Property as rp}from"ag-charts-core";var Rc=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};b([rp],Rc.prototype,"enabled",2),b([rp],Rc.prototype,"width",2),b([rp],Rc.prototype,"style",2);import{BaseProperties as $1,Property as No}from"ag-charts-core";var ta=class extends $1{};b([No],ta.prototype,"placement",2),b([No],ta.prototype,"step",2),b([No],ta.prototype,"values",2),b([No],ta.prototype,"minSpacing",2),b([No],ta.prototype,"maxSpacing",2);import{BaseProperties as K1,Property as Le,isArray as Z1,objectsEqual as X1}from"ag-charts-core";var de=class extends K1{constructor(){super(...arguments),this.enabled=!0,this.border=new Qn,this.wrapping="never",this.truncate=!1,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(t,e,i,s){const{formatter:n,format:a}=this,{type:r,value:o,domain:l,boundSeries:c}=e,h=e.type==="number"?e.fractionDigits:void 0,d=e.type==="date"?e.unit:void 0;let u;if(n!=null){const p=e.type==="date"?e.step:void 0,g=e.type==="number"?e.visibleDomain:void 0;u=t(n,{value:o,index:i,domain:l,fractionDigits:h,unit:d,step:p,boundSeries:c,visibleDomain:g})}if(a!=null&&u==null){const{specifier:p,dateStyle:g="long",truncateDate:f}=s??{},y=`${g}:${f??"none"}`;let m=this._formatters[y];const x=tr.mergeSpecifiers(p,a);(m?.type!==r||m?.unit!==d||!X1(m?.mergedFormat,x))&&(m={type:r,mergedFormat:x,unit:d,formatter:tr.getFormatter(r,x,d,g,{truncateDate:f})},this._formatters[y]=m),u=m.formatter?.(o,h)}return u==null||Z1(u)?u:String(u)}};b([Le],de.prototype,"enabled",2),b([Le],de.prototype,"border",2),b([Le],de.prototype,"cornerRadius",2),b([Le],de.prototype,"fill",2),b([Le],de.prototype,"fillOpacity",2),b([Le],de.prototype,"fontStyle",2),b([Le],de.prototype,"fontWeight",2),b([Le],de.prototype,"fontSize",2),b([Le],de.prototype,"fontFamily",2),b([Le],de.prototype,"wrapping",2),b([Le],de.prototype,"truncate",2),b([Le],de.prototype,"spacing",2),b([Le],de.prototype,"minSpacing",2),b([Le],de.prototype,"color",2),b([Le],de.prototype,"rotation",2),b([Le],de.prototype,"avoidCollisions",2),b([Le],de.prototype,"mirrored",2),b([Le],de.prototype,"padding",2),b([Le],de.prototype,"parallel",2),b([Le],de.prototype,"itemStyler",2),b([Le],de.prototype,"formatter",2),b([Le],de.prototype,"format",2);import{Property as op}from"ag-charts-core";var Pc=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};b([op],Pc.prototype,"enabled",2),b([op],Pc.prototype,"width",2),b([op],Pc.prototype,"stroke",2);import{BaseProperties as q1,Property as _c}from"ag-charts-core";var ia=class extends q1{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};b([_c],ia.prototype,"enabled",2),b([_c],ia.prototype,"width",2),b([_c],ia.prototype,"size",2),b([_c],ia.prototype,"stroke",2);import{BaseProperties as J1,FONT_SIZE as Q1,Property as ns}from"ag-charts-core";var Pi=class extends J1{constructor(){super(...arguments),this.caption=new ge,this.enabled=!1,this.spacing=ge.SMALL_PADDING,this.fontSize=Q1.SMALLER,this.fontFamily="sans-serif",this.wrapping="always"}};b([ns],Pi.prototype,"enabled",2),b([ns],Pi.prototype,"text",2),b([ns],Pi.prototype,"spacing",2),b([ns],Pi.prototype,"fontStyle",2),b([ns],Pi.prototype,"fontWeight",2),b([ns],Pi.prototype,"fontSize",2),b([ns],Pi.prototype,"fontFamily",2),b([ns],Pi.prototype,"color",2),b([ns],Pi.prototype,"wrapping",2),b([ns],Pi.prototype,"formatter",2);import{findMinMax as eR}from"ag-charts-core";var _x=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(_x||{});function tR(t){const[e,i]=eR(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var lp=Math.PI*2,iR=lp/2;function sR(t,e){return Math.abs(e-t)<iR?e:t>e?e+lp:e-lp}function nR(t){const{min:e,max:i}=t,s=l=>l<e||l>i;return{tick:{fromFn(l,c,h){let{x1:d,x2:u,y1:p,y2:g}=l,f=l.opacity;return(h==="added"||s(c.offset))&&({x1:d,x2:u,y1:p,y2:g}=c,f=0),{x1:d,x2:u,y1:p,y2:g,opacity:f,phase:Ri[h]}},toFn(l,c,h){const{x1:d,x2:u,y1:p,y2:g}=c;let f=1;return h==="removed"&&(f=0),{x1:d,x2:u,y1:p,y2:g,opacity:f}},applyFn(l,c){l.setProperties(c),l.visible=!s(l.y)}},line:{fromFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=l.previousDatum??c;return{x1:h,x2:d,y1:u,y2:p,phase:Ri.updated}},toFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=c;return{x1:h,x2:d,y1:u,y2:p}}},label:{fromFn(l,c,h){const d=l.previousDatum??c;let{x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:y}=d,m=l.opacity;return h==="removed"||s(d.y)?y=c.rotation:(h==="added"||s(l.datum.y))&&({x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:y}=c,m=0),{x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:y,opacity:m,phase:Ri[h]}},toFn(l,c,h){const{x:d,y:u,rotationCenterX:p,rotationCenterY:g}=c;let f=0,y=1;return h==="added"?f=c.rotation:h==="removed"?(y=0,f=c.rotation):f=sR(l.previousDatum?.rotation??c.rotation,c.rotation),{x:d,y:u,rotationCenterX:p,rotationCenterY:g,rotation:f,opacity:y,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:d}=l;return{translationX:h,translationY:d,phase:Ri.updated}},toFn(l,c){const{translationX:h,translationY:d}=c;return{translationX:h,translationY:d}}}}}function aR(){return(t,e)=>({translationX:e.translationX,translationY:e.translationY})}function Fc(){return(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})}function Fx(){return(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x1:i,x2:s,y1:n,y2:a}}}function rR(){return(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x:i,y:n,width:s-i,height:a-n}}}var Vx=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(Vx||{});function Bx(t,e){return t.domain===e.domain&&t.rangeExtent===e.rangeExtent&&t.nice[0]===e.nice[0]&&t.nice[1]===e.nice[1]&&t.gridLength===e.gridLength&&t.visibleRange[0]===e.visibleRange[0]&&t.visibleRange[1]===e.visibleRange[1]&&t.scrollbarKey===e.scrollbarKey&&t.initialPrimaryTickCount?.unzoomed===e.initialPrimaryTickCount?.unzoomed&&t.initialPrimaryTickCount?.zoomed===e.initialPrimaryTickCount?.zoomed}function zx(t,e,i){const s=t.bandwidth??0,a=((t.step??0)-s)/2,r=t.convert(i),o=r-a,l=r+s+a;return[r,Nx(o,e),Nx(l,e)]}var tn=class kC{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new ta,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new Pi,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new z({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Wa({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Wa({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new z({name:`${this.id}-Labels`,zIndex:Lo.SERIES_ANNOTATION}),this.gridGroup=new gt({name:`${this.id}-Axis-grid`,zIndex:Lo.AXIS_GRID}),this.gridFillGroup=this.gridGroup.appendChild(new z({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new z({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Wa({name:`${this.id}-CrossLines-Range`,zIndex:Lo.SERIES_CROSSLINE_RANGE}),this.crossLineLineGroup=new Wa({name:`${this.id}-CrossLines-Line`,zIndex:Lo.SERIES_CROSSLINE_LINE}),this.crossLineLabelGroup=new Wa({name:`${this.id}-CrossLines-Label`,zIndex:Lo.SERIES_LABEL}),this.tickLabelGroupSelection=we.select(this.tickLabelGroup,Za,!1),this.line=new Pc,this.tick=new ia,this.gridLine=new Rc,this.label=this.createLabel(),this.defaultTickMinSpacing=kC.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format},labelThickness:0},this.axisContext=void 0,this.cleanup=new E1,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new P1(()=>{const{direction:s,boundSeries:n}=this;return _1(n.flatMap(a=>a.getFormatterContext(s)))}),this.moduleMap=new ap,this.range=this.scale.range.slice();for(const s of this.crossLines)this.initCrossLine(s);this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",s=>this.onMouseMove(s)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;for(const s of this._crossLines)this.detachCrossLine(s);this._crossLines=e.map(s=>{const n=new i;return n.set(s),n});for(const s of this._crossLines)this.attachCrossLine(s),this.initCrossLine(s)}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(e){}onMouseMove(e){const s=this.tickLabelGroup.pickNode(e.currentX,e.currentY)?.datum,{textUntruncated:n=void 0}=s??{};n?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:e.currentX,canvasY:e.currentY,showArrow:!1},[{type:"structured",title:n}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){e.rangeGroup.remove(),e.lineGroup.remove(),e.labelGroup.remove()}destroy(){this.moduleMap.destroy(),this.cleanup.flush()}setScaleRange(e){const{range:i,scale:s}=this,n=(i[1]-i[0])/(e[1]-e[0]),a=n*e[0],r=i[0]-a;s.range=[r,r+n]}updateScale(){const{range:[e,i]}=this;this.setScaleRange(this.visibleRange);for(const s of this.crossLines)s.clippedRange=[e,i]}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.crossLineRangeGroup.remove(),this.crossLineLineGroup.remove(),this.crossLineLabelGroup.remove()}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[s,n]=kx(this.range);return e>=s-i&&e<=n+i}getRangeOverflow(e){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[a,r]=kx([i[0]-n*s[0],i[0]-n*s[0]+n]);return e<a?e-a:e>r?e-r:0}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange();for(const s of this.crossLines)this.initCrossLine(s)}onGridVisibilityChange(){}createLabel(){return new de}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.gridLine.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(e,i,s=this.label){const n={border:s.border,color:s.color,cornerRadius:s.cornerRadius,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,padding:s.padding,spacing:s.spacing};let a;s.itemStyler&&(a=this.cachedCallWithContext(s.itemStyler,{...e,...n}));const r=V1(a,i,n);return{border:r.border,color:r.color,cornerRadius:r.cornerRadius,fill:r.fill,fillOpacity:r.fillOpacity,fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontWeight:r.fontWeight,padding:r.padding,spacing:r.spacing}}getTickSize(e=this.tick){return e.enabled?e.size:0}getTickSpacing(e=this.tick){if(!e.enabled)return 0;const i=this.chartLayout?.scrollbars?.[this.id];return!i?.enabled||i.placement!=="inner"?0:i.tickSpacing??0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,a=(e?i:i.filter(r=>r.isEnabled())).map(r=>r.getDomain(s));this.setDomains(...a)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...e){let i,s;if(e.length>0){const n=this.scale.normalizeDomains(...e);i={domain:n.domain,sortMetadata:{sortOrder:1}},s=n.animatable}else i={domain:[]},s=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(n){return n==null}),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateDomain(e,i="none"){const{dataDomain:{domain:s},range:n,scale:a,gridLength:r}=this,o=Ox(n),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let d;if(h==null||!Bx(h,{domain:s,rangeExtent:o,nice:c,gridLength:r,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i})){const u=a.range;this.setScaleRange([0,1]);const p=c.map(g=>g?0:2);d=this.calculateTickLayout(s,p,[0,1],e),a.range=u,this.unzoomedTickLayoutCache={domain:s,rangeExtent:o,nice:c,gridLength:r,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i,tickLayout:d}}else d=h.tickLayout;return this.updateScale(),a.domain=d.niceDomain,{unzoomedTickLayout:d,domain:a.domain}}calculateLayout(e,i){this.chartLayout=i;const s=this.getScrollbarLayoutCacheKey(i),{visibleRange:n}=this,a=n[0]===0&&n[1]===1,{unzoomedTickLayout:r,domain:o}=this.calculateDomain(e,s),l=this.getDomainExtentsNice();let c;if(a)c=r;else{const{range:f,gridLength:y}=this,m=Ox(f),x=l.map(S=>S?1:2),{tickLayoutCache:v}=this;v==null||!Bx(v,{domain:o,rangeExtent:m,nice:l,gridLength:y,visibleRange:n,initialPrimaryTickCount:e,scrollbarKey:s})?(c=this.calculateTickLayout(o,x,n,e),this.tickLayoutCache={domain:o,rangeExtent:m,nice:l,gridLength:y,visibleRange:n,initialPrimaryTickCount:e,scrollbarKey:s,tickLayout:c}):c=v.tickLayout}const{rawTickCount:h=0,fractionDigits:d,bbox:u}=c,p=r.rawTickCount??0,g=h!==0&&p!==0?{zoomed:h,unzoomed:p}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:d,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:g,bbox:u}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(e){const i=e?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updateCrossLines(){const e=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.update(e)}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:a}=this,r=Math.floor(a.x),o=Math.floor(a.y);n.setProperties({translationX:r,translationY:o}),e.setProperties({translationX:r,translationY:o}),i.setProperties({translationX:r,translationY:o}),s.setProperties({translationX:r,translationY:o})}tickFormatter(e,i,s,n,a,r="long"){const{moduleCtx:o,label:l}=this,{formatManager:c}=o,h=s?this.primaryLabel:void 0,d=this.tickFormatParams(e,i,n,a),u=this.formatterBoundSeries.get();let p,g,f;if(d.type==="number")p=d.fractionDigits;else if(d.type==="date"){const{unit:M,step:D,epoch:C}=d;g={unit:M,step:D,epoch:C},f=d.truncateDate}const y=this.uncachedCallWithContext.bind(this),m={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:e,boundSeries:u},x=h??l,v=s?l.format:void 0,{allowNull:S}=this,I={specifier:tr.mergeSpecifiers(h?.format,l.format),truncateDate:f,allowNull:S};return(M,D)=>{const C=this.datumFormatParams(M,m,p,g,r);return C.value=M,x.formatValue(y,C,D,{specifier:v,dateStyle:r,truncateDate:f})??c.format(y,C,I)??c.defaultFormat(C,I)}}formatDatum(e,i,s,n,a,r,o,l,c,h,d){if(i==null&&!d)return"";const{moduleCtx:u,dataDomain:p}=this;l??(l=p.domain);const{formatManager:g}=u,f=this.formatterBoundSeries.get();let y;switch(s){case"crosshair":case"annotation-label":y=this.layout.label.fractionDigits+1;break;case"series-label":y=2;break;case"tooltip":y=3;break;case"legend-label":y=void 0;break}const m=this.datumFormatParams(i,{source:s,datum:r,seriesId:n,legendItemName:a,key:o,property:this.getFormatterProperty(),domain:l,boundSeries:f},y,void 0,"long"),{type:x,value:v}=m,S=this.createCallWithContext(e),I=c?.formatValue(S,x,v,h??m)??g.format(S,m,{allowNull:d})??this.label.formatValue(S,m,Number.NaN)??g.defaultFormat(m);return F1(I)?I:String(I)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}hasVisibleSeries(){return this.boundSeries.some(e=>e.isEnabled())}clipTickLines(e,i,s,n){this.tickLineGroup.setClipRect(new R(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new R(e,i,s,n))}getFormatterProperty(){const{direction:e,boundSeries:i}=this;let s=e;for(const n of i){const a=n.resolveKeyDirection(e);if(a!==e){s=a;break}}return s}getTitleFormatterParams(e){const{direction:i}=this,s=this.formatterBoundSeries.get();return{domain:e,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e.domain],clipped:!1}}getLayoutTranslation(){return this.translation}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}getUpdateTypeOnResize(){return w1.PERFORM_LAYOUT}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:se.is(e)||is.is(e),getCanvasBounds:()=>ve.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>{const n=s.getKeyProperties(this.direction);for(const a of n)i.add(a);return i},new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),formatScaleValue:(i,s,n)=>{const{allowNull:a}=this;return this.formatDatum(void 0,i,s,void 0,void 0,void 0,void 0,void 0,n,void 0,a)},attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i),measureBand:i=>this.measureBand(i)}}pickBand(e){if(!Ei.is(this.scale))return;const{scale:i,range:s,id:n}=this,a=i.invert(this.isVertical()?e.y:e.x,!0),[r,o,l]=zx(i,s,a);return{id:n,value:a,band:[o,l],position:r}}measureBand(e){if(!Ei.is(this.scale))return;const[,i,s]=zx(this.scale,this.range,e);return{band:[i,s]}}isVertical(){return this.direction===O1.Y}isReversed(){return this.reverse}cachedCallWithContext(e,i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],e,i)}uncachedCallWithContext(e,i){const{chartService:s}=this.moduleCtx;return Lx([this,s],e,i)}createCallWithContext(e){const{chartService:i}=this.moduleCtx;return(s,n)=>Lx([e,this,i],s,n)}};tn.defaultTickMinSpacing=50,tn.CrossLineConstructor=Tt,b([Ec],tn.prototype,"nice",2),b([Ec],tn.prototype,"reverse",2),b([Ec],tn.prototype,"interval",2),b([Ec],tn.prototype,"title",2),b([R1((t,e,i)=>t.onGridLengthChange(e,i))],tn.prototype,"gridLength",2);var cp=tn;import{Property as Gx}from"ag-charts-core";var hp=class extends de{constructor(){super(...arguments),this.autoRotateAngle=335}};b([Gx],hp.prototype,"autoRotate",2),b([Gx],hp.prototype,"autoRotateAngle",2);import{ScaleAlignment as jx,cachedTextMeasurer as oR,countFractionDigits as lR,estimateTickCount as cR,findMinMax as hR,findRangeExtent as Ux,getTickTimeInterval as dR,intervalMilliseconds as Hx,lowestGranularityForInterval as uR,normalizeAngle360FromDegrees as pR,rotatePoint as Wx}from"ag-charts-core";import{clamp as Yx,dateToNumber as dp,previousPowerOf2 as $x}from"ag-charts-core";var or=class OC extends Ei{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(e){return e instanceof OC}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let i;const s=new Set;let n=!0;for(const a of e){const r=a.domain;s.has(r)||(s.add(r),i==null?i=Kx(r):(n&&(n=gR(r,i)),i=Kx([...i,...r])))}return i??(i=[]),{domain:i,animatable:n}}toDomain(e){}invert(e,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,e-s));return i||e===this.ordinalRange(n)?this.domain[n]:void 0}ticks(e,i=this.domain,s){const{bands:n}=this;let{tickCount:a}=e;if(a===0){const f=n.length>1?1:0;return{ticks:n[f]?[n[f]]:[],count:void 0,firstTickIndex:f}}let r=a!=null&&a!==0?Math.trunc(n.length/a):1;if(r=$x(r),r<=1)return ey(i,!1,s);a=Math.trunc(n.length/r);const o=r*a,l=$x(Math.trunc((n.length-o)/2)),c=Yx(0,Math.floor((s?.[0]??0)*n.length),n.length),h=Yx(0,Math.ceil((s?.[1]??1)*n.length),n.length),d=Math.floor((c-l)/r)*r+l,u=Math.ceil((h-l)/r)*r+l,p=[];for(let f=d;f<u;f+=r)f>=0&&f<n.length&&p.push(n[f]);let g=p.length>0?this.findIndex(p[0]):void 0;return g!=null&&(g=Math.floor((g-l)/r)),{ticks:p,count:void 0,firstTickIndex:g}}findIndex(e){const{index:i,indexInitialized:s}=this;if(!s){const{domain:n}=this;for(let a=0;a<n.length;a++)i.set(dp(n[a]),a);this.indexInitialized=!0}return i.get(dp(e))}};function Kx(t){let e;const i=new Set;for(const s of t){const n=dp(s),a=i.size;i.add(n),i.size!==a?e?.push(s):e??(e=t.slice(0,i.size))}return e??t}function gR(t,e){let i=-1;for(const s of t){const n=e.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}import{ScaleAlignment as up,datesSortOrder as fR,sortAndUniqueDates as Zx}from"ag-charts-core";import{TickIntervals as mR,dateToNumber as Cs,defaultEpoch as yR,getTickTimeInterval as pp,intervalRange as ko,intervalRangeStartIndex as bR,intervalStep as xR,isDenseInterval as gp,isPlainObject as Xx}from"ag-charts-core";var Vc=new Date(1970,0,4),lr=class wC extends se{constructor(){super([],[0,1]),this.type="time"}static is(e){return e instanceof wC}toDomain(e){return new Date(e)}convert(e,i){return super.convert(typeof e=="number"?e:e?.valueOf()??Number.NaN,i)}invert(e){return new Date(super.invert(e))}niceDomain(e,i=this.domain){if(i.length<2)return[];let[s,n]=i;const a=4,r=this.getPixelRange();for(let o=0;o<a;o++){const[l,c]=SR(s,n,e,r);if(Cs(s)===Cs(l)&&Cs(n)===Cs(c))break;s=l,n=c}return[s,n]}ticks(e,i=this.domain,s=[0,1],{extend:n=!1}={}){const{nice:a,interval:r,tickCount:o=se.defaultTickCount,minTickCount:l,maxTickCount:c}=e;if(i.length<2)return;const h=i.map(Cs),d=h[0],u=h.at(-1);if(r!=null){const y=this.getPixelRange();return{ticks:qx({start:d,stop:u,interval:r,availableRange:y,visibleRange:s,extend:n})??vR({start:d,stop:u,tickCount:o,minTickCount:l,maxTickCount:c,visibleRange:s,extend:n}),count:void 0}}else{if(a.every(Boolean)&&o===2)return{ticks:i,count:void 0};if(a.every(Boolean)&&o===1)return{ticks:i.slice(0,1),count:void 0}}const p=pp(d,u,o,l,c,{weekStart:Vc});if(p==null)return;const g=ko(p,new Date(d),new Date(u),{visibleRange:s,extend:n}),f=bR(p,new Date(d),new Date(u),{visibleRange:s,extend:n});return{ticks:g,count:void 0,firstTickIndex:f,timeInterval:p}}};function vR({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:a,extend:r}){const o=pp(t,e,i,s,n,{weekStart:Vc});return o?ko(o,new Date(t),new Date(e),{visibleRange:a,extend:r}):[]}function qx({start:t,stop:e,interval:i,availableRange:s,visibleRange:n,extend:a}){if(!i)return[];if(Xx(i)||typeof i=="string"){const d=ko(i,new Date(t),new Date(e),{visibleRange:n,extend:a});return gp(d.length,s)?void 0:d}const r=Math.abs(i);if(gp(Math.abs(e-t)/r,s))return;const o=mR.findLast(d=>r%d.duration===0);if(o){const{timeInterval:d,step:u,duration:p}=o,g={...d,step:u*xR(d)*Math.round(r/p),epoch:yR(d,{weekStart:Vc})};return ko(g,new Date(t),new Date(e),{visibleRange:n,extend:a})}let l=new Date(Math.min(t,e));const c=new Date(Math.max(t,e)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+r);return h}function SR(t,e,i,s){const{interval:n}=i,a=Math.min(Cs(t),Cs(e)),r=Math.max(Cs(t),Cs(e));let o;if(Xx(n)||typeof n=="string")o=n;else{let d;typeof n=="number"&&(d=(r-a)/Math.max(n,1),gp(d,s)&&(d=void 0)),d??(d=i.tickCount??se.defaultTickCount),o=pp(a,r,d,i.minTickCount,i.maxTickCount,{weekStart:Vc})}if(o==null)return[t,e];const l=ko(o,new Date(a),new Date(r),{extend:!0});if(l==null||l.length<2)return[t,e];const c=l[0],h=l.at(-1);return t<=e?[c,h]:[h,c]}var IR=1e3,sn=class EC extends is{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=se.defaultTickCount,this._domain=[],this.isReversed=!1}static is(e){return e instanceof EC}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this.isReversed=Jx(e))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map(e=>e.valueOf())),this._numericBands}getUniformityCache(e){const{bands:i}=this,s=i.length;if(!e||e[0]===0&&e[1]===1)return s>IR&&this._uniformityCache===void 0&&(this._uniformityCache=ox(i)),this._uniformityCache;const n=Math.floor(e[0]*s),a=Math.min(Math.ceil(e[1]*s),s-1);return ox(i,n,a)}normalizeDomains(...e){const i=e.filter(a=>a.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const s=i[0].domain,n=i.every(a=>a.domain===s);if(i.length===1||n){const a=i[0];let r=a.domain,o,l=!1;return a.sortMetadata?.sortOrder===void 0?o=fR(r):(o=a.sortMetadata.sortOrder,l=a.sortMetadata.isUnique??!1),o===-1?r=r.slice().reverse():o==null&&(r=l?r.slice().sort((c,h)=>c.valueOf()-h.valueOf()):Zx(r.slice())),{domain:r,animatable:!0}}return{domain:Zx(i.map(a=>a.domain).flat()),animatable:!0}}ticks(e,i,s=[0,1],{extend:n=!1,dropInitial:a=!1}={}){const{interval:r,maxTickCount:o,tickCount:l=o}=e,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(s=[1-s[1],1-s[0]]),this.refresh(),r==null){const{ticks:v,tickOffset:S,tickEvery:I}=this.getDefaultTicks(i,l,s,n);let M=v.length>0?this.findIndex(v[0]):void 0;return M=M==null?void 0:Math.floor((M-S)/I),{ticks:v,count:void 0,firstTickIndex:M}}let d,u;i&&i.length>=2?(d=i[0].valueOf(),u=i.at(-1).valueOf()):(d=c[0].valueOf(),u=c.at(-1).valueOf());const[p,g]=this.range,f=Math.abs(g-p),y=qx({start:d,stop:u,interval:r,availableRange:f,visibleRange:s,extend:n})??this.getDefaultTicks(i,l,s,n).ticks,m=[];let x=-1;for(const v of y){const S=this.findIndex(v,up.Trailing)??-1,I=S===x;x=S,!(a&&S===0)&&S!==-1&&!I&&m.push(c[S])}return{ticks:m,count:void 0,firstTickIndex:void 0}}stepTicks(e,i,s=[0,1],n=!0){const a=i?this.bandDomainIndices(i):void 0,r=this.ticksEvery(a,s,e,0,!1),o=r.at(-1),l=n&&e>1?a?.[1]:void 0,c=l!=null&&o!=null?this.findIndex(o):void 0;return c!=null&&l!=null&&l-c<e&&r.pop(),r}bandCount(e=[0,1]){const{domain:i}=this,s=Math.floor(e[0]*i.length);return Math.ceil(e[1]*i.length)-s}getDefaultTicks(e,i,s,n){const{bands:a}=this,r=Math.ceil(a.length/i),o=Math.floor(r/2),l=e?this.bandDomainIndices(e):void 0;return{ticks:this.ticksEvery(l,s,r,o,n),tickOffset:o,tickEvery:r}}bandDomainIndices(e){const i=Jx(e),s=this.findIndex(e[i?e.length-1:0],up.Trailing)??0,n=this.findIndex(e[i?0:e.length-1],up.Trailing)??this.bands.length-1;return[s,n]}ticksEvery([e,i]=[0,this.bands.length],s,n,a,r){const{bands:o}=this,l=e,c=i-e+1;let h=l+Math.floor(s[0]*c),d=l+Math.ceil(s[1]*c);r&&(h-=n,d+=n),h=Math.max(h,0),d=Math.min(d,o.length);let u;if(n<=1)u=o.slice(h,d);else{u=[];for(let p=h;p<d;p+=1)(p-l+a)%n===0&&u.push(o[p])}return u}};function Jx(t){return t.length>0&&t[0]>t.at(-1)}import{Logger as Qx,ScaleAlignment as Bc,decodeIntervalValue as DR,encodedToTimestamp as sa,findMaxIndex as zc,findMinIndex as MR,intervalFloor as Gc,intervalMilliseconds as AR,intervalNext as CR,intervalRange as ev,intervalRangeCount as fp,intervalRangeNumeric as TR,intervalRangeStartIndex as LR,isPlainObject as NR}from"ag-charts-core";var kR=1e3,mp=5e7,nn=class RC extends is{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=12,this._domain=[],this._bands=void 0}static is(e){return e instanceof RC}static supportsInterval(e,i){return tv(e,i)}set domain(e){e!==this._domain&&(this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(e){this._interval!==e&&(this._interval=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0)}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._bands=this._encodedBands.map(i=>DR(i,e))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._numericBands=this._encodedBands.map(i=>sa(i,e))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:e,interval:i}=this;if(e.length<2||i==null){this._encodedBands=[];return}const s=this.getCachedBandRange();if(s==null){this._encodedBands=[];return}const[n,a]=s,r={visibleRange:[0,1],extend:!1};if(fp(i,n,a,r)>mp){Qx.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:o,encodingParams:l}=TR(i,n,a,r);this._encodedBands=o,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(e){const i=this.getBandCountForUpdate();if(!e||e[0]===0&&e[1]===1){if(i>kR&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=sa(this._encodedBands[0],this._encodingParams),n=sa(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:n-s}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=sa(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:sa(this._encodedBands[1],this._encodingParams)-s}}return{isUniform:!1}}normalizeDomains(...e){return nx(...e)}getCachedBandRange(){const{domain:e,interval:i}=this;if(!(e.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:Gc(i,e[0]),stop:Gc(i,e[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:e}=this;if(e!=null){if(this._domainBoundaries===void 0){const i=this.getCachedBandRange();if(i==null)return;const[s,n]=i,a=Math.min(s.valueOf(),n.valueOf()),r=Math.max(s.valueOf(),n.valueOf()),o=CR(e,new Date(r)).valueOf();this._domainBoundaries={d0:a,dNext:o}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const e=sa(this._encodedBands[0],this._encodingParams),i=sa(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:e,intervalMs:i-e}}return this._linearParams}isLinearUnit(){const e=this._encodingParams?.unit;return e==="millisecond"||e==="second"||e==="minute"||e==="hour"}findIndex(e,i=Bc.Leading){if(e==null)return;const s=this.getBandCountForUpdate();if(s===0)return;if(s===1)return 0;const n=this.getLinearParams();if(n==null||n.intervalMs===0)return super.findIndex(e,i);const{firstBandTime:a,intervalMs:r}=n,o=e.valueOf(),l=(o-a)/r;let c=i===Bc.Trailing?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,s-1)),this.isLinearUnit()){if(i===Bc.Trailing){if(a+c*r<o&&c===s-1)return}else if(a+c*r>o&&c===0)return;return c}const h=this.numericBands;if(i===Bc.Trailing){for(;c>0&&h[c-1]>=o;)c--;for(;c<s-1&&h[c]<o;)c++;if(h[c]<o)return}else{for(;c<s-1&&h[c+1]<=o;)c++;for(;c>0&&h[c]>o;)c--;if(h[c]>o)return}return c}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:s,interval:n}=this;if(s.length<2)return Number.NaN;if(i?.clamp!==!0&&n!=null){const a=this.getDomainBoundaries();if(a!=null){const r=e.valueOf();if(r<a.d0||r>=a.dNext)return Number.NaN}}return super.convert(e,i)}calculateBands(e,i,s=!1){if(e===this.domain&&i[0]===0&&i[1]===1&&!s&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(e.length<2)return{bands:[],firstBandIndex:void 0};const{interval:n}=this;if(n==null)return{bands:[],firstBandIndex:void 0};const a={visibleRange:i,extend:s};if(!tv(e,n,a))return{bands:[],firstBandIndex:void 0};const r=e===this.domain?this.getCachedBandRange():yp(e,n);if(r==null)return{bands:[],firstBandIndex:void 0};const[o,l]=r;if(fp(n,o,l,a)>mp)return Qx.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const c=ev(n,o,l,a),h=LR(n,o,l,a);return{bands:c,firstBandIndex:h}}ticks({interval:e},i=this.domain,s=[0,1],{extend:n=!1}={}){if(i.length<2)return;let a,r,o;if(i===this.domain&&!n?({bands:a}=this.calculateBands(i,[0,1],!1),o=VT(a,!1,s),r=o[0]):{bands:a,firstBandIndex:r}=this.calculateBands(i,s,n),e==null)return{ticks:a,count:void 0,firstTickIndex:r};const l=this.interval?AR(this.interval):1/0,c=Math.min(i[0].valueOf(),i[1].valueOf()),h=Math.max(i[0].valueOf(),i[1].valueOf());let d,u,p;if(NR(e)||typeof e=="string")d=ev(e,i[0],i[1],{extend:!0,visibleRange:s}),u=0,p=d.length-1;else{const S=o?o[0]:0,I=o?o[1]:a.length-1;d=a,u=zc(S,I,M=>a[M].valueOf()<=c)??S,p=zc(S,I,M=>a[M].valueOf()<=h)??I}const g=[];let f;for(let S=u;S<=p;S++){const I=d[S].valueOf(),M=zc(0,a.length-1,C=>a[C].valueOf()<=I),D=M!=null&&M!=f?a[M]:void 0;f=M,D!=null&&I-D.getTime()<=l&&g.push(D)}let y,m;if(this.interval){const S=yp([new Date(c),new Date(h)],this.interval);y=S[0].valueOf(),m=S[1].valueOf()}else y=c,m=h;let x=MR(0,g.length-1,S=>g[S].valueOf()>=y)??0,v=zc(0,g.length-1,S=>g[S].valueOf()<=m)??g.length-1;return n&&(x=Math.max(x-1,0),v=Math.min(v+1,g.length-1)),{ticks:g.slice(x,v+1),count:g.length,firstTickIndex:r}}};function tv(t,e,i){const[s,n]=yp(t,e);return fp(e,s,n,i)<=mp}function yp(t,e){const i=Gc(e,t[0]),s=Gc(e,t[1]);return[i,s]}import{countFractionDigits as OR,createTicks as iv,findMinMax as wR,niceTicksDomain as ER}from"ag-charts-core";function RR(t,e,i,s,n){let[a,r]=wR(e.map(Number));const o=Math.floor(i.unzoomed);if(o<=1){const[m,x]=PR(a,r),v=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:S}=iv(m,x,v,void 0,void 0,n),I=[t.toDomain(m),t.toDomain(x)];return s&&I.reverse(),{domain:I,ticks:S}}if(a===r){const m=Math.floor(Math.log10(a)),x=Math.pow(10,m),v=Math.min(x,1),S=o-1;a-=v*Math.floor(S/2),r=a+v*S}let l=a,c=r;l=_R(l,c,o);const h=VR(l,c,o),d=o-1;c=l+d*h;const u=Math.floor(l/h)*h,p=Math.floor(c/h)*h;u<=a&&p>=r&&(l=u,c=p);const g=[t.toDomain(l),t.toDomain(c)];s&&g.reverse();const f=h*((i.unzoomed-1)/(i.zoomed-1)),y=FR(l,f,Math.floor(i.zoomed));return{domain:g,ticks:y}}function PR(t,e){let i=t,s=e,n=0;do{[i,s]=ER(i,s);const{ticks:a}=iv(i,s,5);if(a.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[t,e]}function _R(t,e,i){t=Math.floor(t);const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(t/a)*a}function FR(t,e,i){const s=OR(e),n=Math.pow(10,s),a=[];for(let r=0;r<i;r++){const o=t+e*r;a.push(Math.round(o*n)/n)}return a}function VR(t,e,i){const s=i-1,n=(e-t)/s;return BR(n)}function BR(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i;return s>0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:t}import{ScaleAlignment as sv,boxCollides as zR,buildDateFormatter as nv,cachedTextMeasurer as GR,compareDates as jR,createIdsGenerator as UR,dropFirstWhile as HR,dropLastWhile as WR,getMaxInnerRectSize as YR,intervalCeil as $R,intervalExtent as KR,intervalFloor as ZR,intervalHierarchy as bp,intervalMilliseconds as jc,intervalNext as XR,intervalPrevious as qR,intervalRange as Uc,intervalUnit as av,isArray as JR,isPlainObject as QR,isSegmentTruncated as eP,isTextTruncated as tP,measureTextSegments as iP,normalizeAngle360FromDegrees as sP,toPlainText as rv,toTextString as ov,wrapTextOrSegments as nP}from"ag-charts-core";var aP=18,rP=[1,2,3,4,6,8,9,10,12];function lv(t,e=0){const i=[];for(const s of t){const{x:n,y:a,width:r,height:o}=s;if(i.some(l=>zR(l,n,a,r+e,o+e)))return!0;i.push(s)}return!1}function oP(t,e,i,s){if(t==null)return e;if(typeof t!="number"){const o=e[0],l=typeof t=="string"?{unit:t,epoch:o}:{...t,epoch:o};return Uc(l,e[0],e[1],{visibleRange:i,extend:s})}const n=[],a=e[0].valueOf(),r=e[1].valueOf();for(let o=a;o<=r;o+=t)n.push(new Date(o));return n}function cv(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1)if(t[i]?.valueOf()!==e[i]?.valueOf())return!1;return!0}function lP(t){if(t.length<2)return 1/0;let e=0,i=t[0].translation;for(let s=1;s<t.length;s++){const n=t[s].translation,a=Math.abs(n-i);e=Math.max(e,a),i=n}return e}function cP(t,{niceDomain:e,rawTicks:i,rawFirstTickIndex:s=0,generatePrimaryTicks:n,primaryTicksIndices:a,alignment:r,fractionDigits:o,timeInterval:l}){const{scale:c,label:h,tickFormatter:d,inRange:u,isVertical:p,sizeLimit:g=1/0}=t,f=lr.is(c)||is.is(c),y=GR(h),m=UR(),x=[];return hv(c,e,()=>{const v=Ei.is(c)?c.bandwidth??1/0:1/0,S=(c.bandwidth??0)/2,I=hP(h.enabled,n,e,i,o,l,d);let M=p?g:v,D=p?v:g;if(h.rotation){const A=YR(h.rotation,M,D);M=A.width,D=A.height}const C={font:h,maxWidth:M,maxHeight:D,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping};for(let A=0;A<i.length;A++){const T=i[A],L=c.convert(T,{alignment:r})+S;if(u&&!u(L))continue;const N=a?.has(A)??!1,O=I(N,T,A);let E=null;h.avoidCollisions&&(E=nP(O,C)||null);const k=E??O,P=JR(k),F=k!==O&&(P?eP(k.at(-1)):tP(ov(k)));let w;if(f){const j=T?.valueOf();Number.isFinite(j)&&(w=m(`v:${j}`))}w??(w=m(`l:${P?rv(k.flat()):k}`)),x.push({tick:T,tickId:w,tickLabel:k,isPrimary:N,index:A+s,textUntruncated:F?rv(O):void 0,textMetrics:P?iP(k,h):y.measureLines(ov(k)),translation:Math.floor(L)})}}),x}function hv(t,e,i){const s=t.domain;try{t.domain=e,i()}finally{t.domain=s}}function hP(t,e,i,s,n,a,r){const o=e?"component":"long",l=e&&a?bp(a):void 0,c=e?r(i,s,!0,n,l,o):null,h=t?r(i,s,!1,n,a,o):null;return(d,u,p)=>(d?c:h)?.(u,p)??String(u)}function dP(t,e,i,s,n,a,r,o){if(!lr.is(t)&&!is.is(t))return;const l=bp(a);if(l==null)return;r&&(e=[1-e[1],1-e[0]]);const c=Math.min(t.domain[0].valueOf(),t.domain.at(-1).valueOf()),h=Math.max(t.domain[0].valueOf(),t.domain.at(-1).valueOf());let[d,u]=KR(new Date(c),new Date(h),e);d=ZR(l,d),d.valueOf()>=c&&(d=qR(l,d)),u=$R(l,u),u.valueOf()<=h&&(u=XR(l,u));const p=Uc(l,d,u),g=jc(a),f=sn.is(t),y={...n,interval:a},m=[];let x,v,S,I=0;if(sn.is(t)){const M=av(a);v=o!=null&&jc(o)>=jc(M)?2:3,S=sv.Trailing;const D=i/s,C=t.bandCount(e)/(D*aP);I=rP.findLast(A=>C>=A)??1}else nn.is(t)&&(t.interval==null||jc(t.interval)>=g)?v=1:(v=0,S=sv.Interpolate);for(let M=0;M<p.length-1;M++){const D=p[M],C=p[M+1],A=M===0,T=M===p.length-2,L=C.valueOf()-D.valueOf(),N=[Math.max((c-D.valueOf())/L,0),Math.min((h-D.valueOf())/L,1)];let O;switch(v){case 0:O=oP(y.interval,[D,C],N,!0);break;case 1:case 3:{O=t.ticks(y,[D,C],N,{extend:!0,dropInitial:!0})?.ticks??[];break}case 2:O=t.stepTicks(I,[D,C],void 0,!T);break}if(HR(O,F=>F.valueOf()<D.valueOf()),T||WR(O,F=>{switch(v){case 0:case 3:return F.valueOf()+g>C.valueOf();case 1:case 2:return F.valueOf()>=C.valueOf()}}),O.length===0)continue;const E=O[0],k=jR(E,D);(v===0?k===0:k<=g)&&(!f||!A)&&(x??(x=new Set),x.add(m.length)),m.push(...O)}return x?.size===1&&x.has(0)&&(x=void 0),{ticks:m,primaryTicksIndices:x,alignment:S}}function uP(t,e,i,s,n){const a=dv(t.format,s);if(a==null)return{width:0,height:0};const r=nv(a),o=s?bp(s):void 0,l=dv(e?.format,o),c=l?nv(l):r,h=new Date(i[0]),d=new Date(i.at(-1)),u=o?Uc(o,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let p=0,g=0;if(r!=null){const f=rr(t),y=f.left+f.right,m=f.top+f.bottom;let x,v;u!=null&&u.length>1?(x=u[0],v=u[1]):(x=h,v=d);const S=Uc(s,x,v,{limit:50});for(const I of S){const M=r(I),{width:D,height:C}=n.measureLines(M);p=Math.max(p,D+y),g=Math.max(g,C+m)}}if(c!=null&&u!=null){const f=rr(e),y=f.left+f.right,m=f.top+f.bottom;for(const x of u){const v=c(x),{width:S,height:I}=n.measureLines(v);p=Math.max(p,S+y),g=Math.max(g,I+m)}}return{width:Math.ceil(p),height:Math.ceil(g)}}function pP(t,e,i,s){return t&&!e?i*s===-1?"top":"bottom":"middle"}function gP(t,e,i,s,n){const a=e>0&&e<=Math.PI,r=i>0&&i<=Math.PI,o=a||r?-1:1;if(t)if(e||i){if(s*o===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function dv(t,e){if(t!=null){if(typeof t=="string")return t;if(QR(t)&&e!=null)return t[av(e)]}}function fP(t,e,i=0){const s=sP(t),n=!s&&i>=0&&i<=Math.PI?-1:1,a=!s&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,r=e?n*(Math.PI/2):0;return{configuredRotation:s,defaultRotation:r,parallelFlipFlag:n,regularFlipFlag:a}}var mP=new Date(1970,0,4);function uv(t){const{label:e,domain:i,axisRotation:s,labelOffset:n,sideFlag:a}=t,{defaultRotation:r,configuredRotation:o,parallelFlipFlag:l,regularFlipFlag:c}=fP(e.rotation,e.parallel,s),h=o+r,d=(C,A=0)=>{const T=e.minSpacing??(o===0&&A===0?10:0),L=h+A,N=rr(e);return lv(xP(t,C,L),T)||lv(vP(C.ticks,n,L,N),T)},{maxTickCount:u}=pv(t),p=yP(t),g=e.enabled&&e.avoidCollisions,f=Number.isFinite(u)?u:10,y=g&&e.autoRotate&&e.rotation==null;let m=0,x=0,v=!0,S={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;v&&m<=f;)({tickData:S,index:m}=bP(t,p,S,m)),x=y&&d(S,0)?pR(e.autoRotateAngle):0,v=g&&d(S,x);const I=gP(e.parallel,o,x,a,c),M=pP(e.parallel,o,a,l),D=o+x;return{tickData:S,textAlign:I,textBaseline:M,rotation:D}}function yP(t){return t.interval?.values?2:t.primaryTickCount!=null?1:0}function pv({scale:t,domain:e,range:i,visibleRange:s,label:n,defaultTickMinSpacing:a,interval:{minSpacing:r,maxSpacing:o}}){const{defaultTickCount:l}=t,c=Ux(i),h=Ux(s);if(or.is(t)||sn.is(t)&&e.length<1e3){const d=or.is(t)?e.length:Math.min(e.length,Math.max(1,Math.floor(c/(h*a)))),u=Math.ceil(c/(h*n.fontSize));return{tickCount:Math.min(u,d),minTickCount:0,maxTickCount:d}}return cR(c,h,r,o,l,a)}function bP(t,e,i,s){const{step:n,values:a}=t.interval,{maxTickCount:r,minTickCount:o,tickCount:l}=pv(t),c=A=>Math.max(l-A,o),h=n==null&&a==null&&c(s)>o,d=i.rawTicks,u=l-o,p={minTickCount:o,maxTickCount:r,tickCount:c(s)};let g=gv(t,e,p);if(h&&cv(g.rawTicks,d)){let A=s,T=u;for(;A<=T;){s=Math.trunc((A+T)/2),p.tickCount=c(s);const L=gv(t,e,p);cv(L.rawTicks,d)?A=s+1:(g=L,T=s-1)}}const{tickDomain:f,niceDomain:y,rawTicks:m,rawTickCount:x,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:I,alignment:M,fractionDigits:D,timeInterval:C}=g;return{tickData:{tickDomain:f,niceDomain:y,rawTicks:m,rawTickCount:x,fractionDigits:D,timeInterval:C,ticks:cP(t,{niceDomain:y,rawTicks:m,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:I,alignment:M,fractionDigits:D,timeInterval:C})},index:s+1}}function gv(t,e,i){const{domain:s,reverse:n,visibleRange:a,scale:r,interval:o,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:d}=t,u={nice:c.map(A=>A===0),interval:o.step,...i},p={...u,nice:c.map(A=>A===0||A===1)};let g;e===1&&h!=null&&se.is(r)&&(g=RR(r,s,h,n,a));const f=c.includes(0)?g?.domain??r.niceDomain(u,s):s;let y=f,m,x,v,S,I,M;const D=l?.enabled===!0&&p.interval==null;hv(r,f,()=>{switch(e){case 2:if(y=o.values,m=o.values,x=m.length,sn.is(r)?M=jx.Trailing:nn.is(r)&&(M=jx.Interpolate),se.is(r)){const[A,T]=hR(f.map(Number));m=m.filter(L=>Number(L)>=A&&Number(L)<=T).sort((L,N)=>Number(L)-Number(N))}break;case 1:if(g)m=g.ticks,x=g.ticks.length;else{const A=r.ticks(p,f,a);m=A?.ticks,x=A?.count}break;default:{const{tickCount:A,minTickCount:T,maxTickCount:L}=i;if(f.length>0&&p.interval==null&&(nn.is(r)||D&&(lr.is(r)||sn.is(r)))){const E=f,k=Math.min(E[0].valueOf(),E.at(-1).valueOf()),P=Math.max(E[0].valueOf(),E.at(-1).valueOf());S=dR(k,P,A,T,L,{weekStart:l==null?mP:void 0,primaryOnly:!0})}let N;sn.is(r)?N=d:nn.is(r)&&(N=r.interval),N!=null&&S!=null&&Hx(N)>=Hx(S)&&(S=N);const O=S?dP(r,a,A,L,p,S,n,d):void 0;if(O)({ticks:m,primaryTicksIndices:I,alignment:M}=O);else{const E=nn.is(r)&&p.interval==null&&S!=null?{...p,interval:S}:p,k=r.ticks(E,f,a);if(m=k?.ticks,x=k?.count,v=k?.firstTickIndex,lr.is(r)||is.is(r)){const P=typeof p.interval=="number"?uR(p.interval):p.interval;S??(S=P??k?.timeInterval)}}}}}),m??(m=[]);let C=0;for(const A of m){if(typeof A!="number")continue;const T=lR(A);T>C&&(C=T)}return D||(I=void 0),{tickDomain:y,niceDomain:f,rawTicks:m,rawTickCount:x,rawFirstTickIndex:v,generatePrimaryTicks:D,primaryTicksIndices:I,alignment:M,fractionDigits:C,timeInterval:S}}function xP(t,e,i){const{niceDomain:s,ticks:n,timeInterval:a}=e;if(a==null)return[];const r=lP(n),{label:o,labelOffset:l,primaryLabel:c,domain:h}=t,{width:d,height:u}=uP(o,c,s??h,a,oR(o)),p=[];for(const g of[0,r]){const{x:f,y}=Wx(l,g,i);p.push({x:f,y,width:d,height:u})}return p}function vP(t,e,i,s){const n=[],a=s.left+s.right,r=s.top+s.bottom;for(const{tickLabel:o,textMetrics:l,translation:c}of t){if(!o)continue;const{x:h,y:d}=Wx(e,c,i),u=l.width+a,p=l.height+r;n.push({x:h,y:d,width:u,height:p})}return n}var Oo=class PC extends cp{constructor(e,i){super(e,i),this.maxThicknessRatio=.3,this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new gt({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new gt({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new ni({zIndex:1})),this.tickLineGroupSelection=we.select(this.tickLineGroup,ni,!1),this.gridLineGroupSelection=we.select(this.gridLineGroup,ni,!1),this.gridFillGroupSelection=we.select(this.gridFillGroup,ze,!1),this.tempText=new Za({debugDirty:!1}),this.tempCaption=new ge,this.animationManager=e.animationManager,this.animationState=new x1("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let s;this.cleanup.register(e.eventsHub.on("layout:complete",n=>{const a=[n.chart.width,n.chart.height];s!=null&&!v1(a,s)&&this.animationState.transition("resize"),s=a}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof PC}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?sp.X:sp.Y}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new hp}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,i){return this.updateDirection(),super.calculateLayout(e,i)}layoutCrossLines(){const e=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.calculateLayout?.(e)}calculateTickLayout(e,i,s,n){const a=this.label.getSideFlag(),r=a*(this.getTickSize()+this.getTickSpacing()+this.label.spacing+this.seriesAreaPadding),o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o);if(i[0]===2&&i[1]===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:ae,spacing:Et}=this.measureAxisLayout(e,[],[],o,l);return{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:ae,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:Et}}}const{label:c,primaryLabel:h,scale:d,range:u,interval:p,reverse:g,defaultTickMinSpacing:f,minimumTimeGranularity:y}=this,m=uv({label:c,scale:d,interval:p,primaryLabel:h,domain:e,range:u,reverse:g,niceMode:i,visibleRange:s,defaultTickMinSpacing:f,minimumTimeGranularity:y,sideFlag:a,labelOffset:r,primaryTickCount:n,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction===sp.Y,sizeLimit:this.chartLayout?.sizeLimit,inRange:ae=>this.inRange(ae,.001),tickFormatter:(...ae)=>this.tickFormatter(...ae)}),{tickData:x}=m;if(this.label.avoidCollisions&&this.horizontal&&x.ticks.length>2&&(se.is(this.scale)||is.is(this.scale))){const ae=this.chartLayout?.padding.right??0,Et=x.ticks.at(-1);Et?.tickLabel!=null&&Et.translation+Et.textMetrics.width/2>u[1]+ae&&(Et.tickLabel=void 0,s[0]===0&&s[1]===1&&(x.ticks[0].tickLabel=void 0))}const{ticks:S,tickDomain:I,rawTicks:M,rawTickCount:D,fractionDigits:C,timeInterval:A,niceDomain:T}=x,L=S.map(ae=>this.getTickLabelProps(ae,m,l)),{position:N,gridPadding:O,gridLength:E}=this,k=N==="bottom"||N==="right"?-1:1,P=k*O,F=k*(E+O),w=this.calculateGridLines(S,P,F),j=this.calculateGridFills(S,P,F),q=this.calculateTickLines(S,k,l),{bbox:J,spacing:xe}=this.measureAxisLayout(I,S,L,o,l);return{ticks:M,rawTickCount:D,tickDomain:I,niceDomain:T,fractionDigits:C,timeInterval:A,bbox:J,layout:{ticks:S,gridLines:w,gridFills:j,tickLines:q,labels:L,spacing:xe}}}calculateGridLines(e,i,s){return e.map((n,a)=>this.calculateGridLine(n,a,i,s,e))}calculateGridLine({index:e,tickId:i,translation:s},n,a,r,o){const{gridLine:l,horizontal:c}=this,[h,d,u,p]=c?[s,a,s,r]:[a,s,r,s],{style:g}=l,{stroke:f,strokeWidth:y=0,lineDash:m}=g[e%g.length]??{};return{tickId:i,offset:s,x1:h,y1:d,x2:u,y2:p,stroke:f,strokeWidth:y,lineDash:m}}calculateGridFills(e,i,s){const{horizontal:n,range:a,type:r}=this,o=[];if(e.length==0)return o;let l=0;const c=!n&&r==="unit-time";if(c&&e[0].translation<a[0]||!c&&e[0].translation>a[0]){const d={tickId:`before:${e[0].tickId}`,translation:a[0]};o.push(this.calculateGridFill(d,-1,e[0].index,i,s,e)),l=1}return o.push(...e.map((d,u)=>this.calculateGridFill(d,u,d.index+l,i,s,e))),o}calculateGridFill({tickId:e,translation:i},s,n,a,r,o){const{gridLine:l,horizontal:c,range:h}=this,d=o[s+1],u=i,p=d?d.translation:h[1],[g,f,y,m]=c?[u,Math.max(a,r),p,Math.min(a,r)]:[Math.min(a,r),Math.min(u,p),Math.max(a,r),Math.max(u,p)],{fill:x,fillOpacity:v}=l.style[n%l.style.length]??{};return{tickId:e,x1:g,y1:f,x2:y,y2:m,fill:x,fillOpacity:v}}calculateTickLines(e,i,s=0){return e.map(n=>this.calculateTickLine(n,n.index,i,e,s))}calculateTickLine({isPrimary:e,tickId:i,translation:s},n,a,r,o=0){const{horizontal:l,tick:c,primaryTick:h}=this,d=e&&h?h:c,u=this.getTickSize(d),p=this.getTickSpacing(d),g=-a*(o+p),f=-a*u,[y,m,x,v]=l?[s,g,s,g+f]:[g,s,g+f,s],{stroke:S,width:I}=d;return{tickId:i,offset:s,x1:y,y1:m,x2:x,y2:v,stroke:S,strokeWidth:I,lineDash:void 0}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),r=>r.datum.tickId);super.update();const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:r}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=r.map(c=>c.tickId),l=I1(e,o);this.animationState.transition("update",l)}}const{enabled:s,stroke:n,width:a}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:s?a:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)}}getLayoutTranslation(){const{translationX:e,translationY:i}=this.getAxisTransform();return{x:e,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}setAxisVisible(e){this.tickLineGroup.visible=e&&(this.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=e&&(this.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=e,this.headingLabelGroup.visible=e}getAxisLineCoordinates(){const{horizontal:e}=this,[i,s]=D1(this.lineRange??this.range);return e?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(e,i){const{translation:s}=e,{position:n,primaryTick:a}=this;let r=this.getTickSize();a?.enabled&&(r=Math.max(r,this.getTickSize(a)));const o=n==="bottom"||n==="right"?-1:1,l=this.getTickSpacing(this.tick),c=-o*(i+l),h=c,d=c-o*(r+l),u=Math.min(h,d),p=Math.max(h,d);switch(n){case"top":return new R(s,u,0,p-u);case"bottom":return new R(s,u,0,p-u);case"left":return new R(u,s,p-u,0);case"right":return new R(u,s,p-u,0)}}lineNodeBBox(){const{position:e,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),a=n-s;switch(e){case"top":return new R(s,-i,a,i);case"bottom":return new R(s,0,a,i);case"left":return new R(-i,s,i,a);case"right":return new R(0,s,i,a)}}titleBBox(e,i){const{tempCaption:s}=this;return s.node.setProperties(this.titleProps(s,e,i)),s.node.getBBox()}getScrollbarThickness(e){return e?.enabled&&e.placement==="inner"?e.spacing+e.thickness:0}resolveScrollbarLayout(e,i){if(!e)return;const{position:s}=this,n=s==="top"||s==="left"?-1:1;if(e.placement==="inner"){const r=n===1?e.spacing:-e.spacing-e.thickness;return{...e,offset:r}}const a=n===1?i+e.spacing:-i-e.spacing-e.thickness;return{...e,offset:a}}applyScrollbarLayout(e,i,s){const n=this.resolveScrollbarLayout(s,i);let a=i;if(n){const{offset:r,thickness:o,placement:l}=n;l==="outer"&&(a+=n.spacing+o),this.horizontal?e.push(new R(0,r,0,o)):e.push(new R(r,0,o,0))}return{spacing:a,scrollbarLayout:n}}measureAxisLayout(e,i,s,n,a){const{tick:r,primaryTick:o,label:l,primaryLabel:c,title:h,position:d,horizontal:u,seriesAreaPadding:p}=this,g=[];if(g.push(this.lineNodeBBox()),r.enabled||o?.enabled)for(const I of i)g.push(this.getTickLineBBox(I,a));const{tempText:f}=this;if(l.enabled)for(const I of s){if(!I.visible)continue;f.setProperties(I);const M=f.getBBox();M&&g.push(M)}if(c?.enabled&&d==="bottom"&&(g.push(new R(0,Ax(l.fontSize)+2,1,this.getTickSize(r)+this.getTickSpacing(r)+l.spacing+p)),c.format!=null)){const{format:M}=c,C=(M1(M)?Object.values(M):[M]).reduce((A,T)=>Math.max(A,S1(T)),0);g.push(new R(0,this.getTickSize(o??r)+this.getTickSpacing(o??r)+c.spacing+p,1,C*Ax(c.fontSize)+2))}const y=R.merge(g),m=u?y.height:y.width,{spacing:x,scrollbarLayout:v}=this.applyScrollbarLayout(g,m,n);return this.layout.labelThickness=m,this.layout.scrollbar=v,h.enabled&&g.push(this.titleBBox(e,x)),{bbox:R.merge(g),spacing:x}}titleProps(e,i,s){const{title:n}=this;if(!n.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.fontWeight=n.fontWeight,e.wrapping=n.wrapping;const a=(n.spacing??0)+s,{range:r}=this,o=(r[0]+r[1])/2;let l,c,h,d;switch(this.position){case"top":l=o,c=-a,h=0,d="bottom";break;case"bottom":l=o,c=a,h=0,d="top";break;case"left":l=-a,c=o,h=Math.PI/-2,d="bottom";break;case"right":l=a,c=o,h=Math.PI/2,d="bottom";break}const{formatter:u=g=>g.defaultValue}=n,p=this.cachedCallWithContext(u,this.getTitleFormatterParams(i));return e.text=p,{visible:!0,text:p,textBaseline:d,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(e,i,s){const{horizontal:n,primaryLabel:a,primaryTick:r,seriesAreaPadding:o,scale:l}=this,{tickId:c,tickLabel:h="",translation:d,isPrimary:u,textUntruncated:p}=e,g=u&&a?.enabled?a:this.label,f=u&&r?.enabled?r:this.tick,{rotation:y,textBaseline:m,textAlign:x}=i,{range:v}=l,S=this.label.getSideFlag(),I=rr(g)[this.position];let M=S*(this.getTickSize(f)+this.getTickSpacing(f)+g.spacing+o)-I;s&&(M+=S*s);const D=h!=="",C=n?d:M,A=n?-M:d;return{...this.getLabelStyles({value:e.tick,formattedValue:h},void 0,g),tickId:c,rotation:y,text:h,textAlign:x,textBaseline:m,textUntruncated:p,visible:D,x:C,y:A,rotationCenterX:C,rotationCenterY:A,range:v}}updateSelections(){if(!this.tickLayout)return;const e=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,gridFills:n,labels:a}=this.tickLayout,r=o=>o.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,r),this.gridFillGroupSelection.update(this.gridLine.enabled?n:[],void 0,r),this.tickLineGroupSelection.update(i,void 0,r),this.tickLabelGroupSelection.update(a,void 0,r)}updateGridLines(){this.gridLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((e,i)=>{e.fill=i.fill,e.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateTitle(e,i){const{caption:s}=this.title,n=this.titleProps(s,e,i);s.node.visible=n.visible,s.node.text=n.text,s.node.textBaseline=n.textBaseline,s.node.datum=n}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.color,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.pointerEvents=i.textUntruncated==null?1:0,e.setFont(i),e.setBoxing(i)})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,s=tR(this),n=nR(s);Oe(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),Oe(this.id,"line",i,[this.lineNode],n.line),Oe(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(a,r)=>r.tickId,e),Oe(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(a,r)=>r.tickId,e),Oe(this.id,"title",i,[this.title.caption.node],n.label,(a,r)=>r.tickId,e)}resetSelectionNodes(){at([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],aR()),at([this.gridLineGroupSelection,this.tickLineGroupSelection],Fx()),at([this.gridFillGroupSelection],rR()),at([this.tickLabelGroupSelection],Fc()),at([this.title.caption.node],Fc()),at([this.lineNode],Fx())}};b([wc],Oo.prototype,"thickness",2),b([wc],Oo.prototype,"maxThicknessRatio",2),b([wc],Oo.prototype,"position",2),b([wc],Oo.prototype,"crossAt",2);var wo=Oo,fv=["right","top","left","bottom"];function SP(t){return typeof t=="string"&&fv.includes(t)}function IP(t){const e=[],i=[],s=[...fv];for(const n of t)n instanceof wo&&(SP(n.position)?i.push(n.position):e.push(n));for(const n of e){let a;do a=s.pop();while(a&&i.includes(a));if(a==null)break;n.position=a}}import{ModuleRegistry as DP,jsonDiff as MP}from"ag-charts-core";var mv=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function AP(t,e,i){const s=new Map,n=d=>{if(d===void 0)return mv;if(s.has(d))return s.get(d);const u=DP.getSeriesModule(d)?.matchingKeys??mv;return s.set(d,u),u},a=(d,u,p)=>{const g=n(d),f=[d];for(const y of g)y in u&&u[y]!=null&&f.push(`${y}=${u[y]}`);return p?.seriesGrouping&&f.push(`seriesGrouping.groupId=${p?.seriesGrouping.groupId}`),f.join(";")},r=new Map;let o=0;for(const d of t){const u=a(d.type,d.properties,i?.[o]);r.has(u)||r.set(u,[]),r.get(u)?.push([d,o++])}const l=new Map;o=0;for(const d of e){const u=a(d.type,d,d);l.has(u)||l.set(u,[]),l.get(u)?.push([d,o++])}if(![...r.keys()].some(d=>l.has(d)))return{status:"no-overlap",oldKeys:r.keys(),newKeys:l.keys()};const h=[];for(const[d,u]of l.entries())for(const[p,g]of u){const f=r.get(d);if(f==null||f.length<1){h.push({opts:p,targetIdx:g,idx:g,status:"add"}),r.delete(d);continue}const[y,m]=f.shift(),x=i?.[m]??{},v=MP(x,p??{}),{groupIndex:S,stackIndex:I}=v?.seriesGrouping??{};S!=null||I!=null?h.push({opts:p,series:y,diff:v,targetIdx:g,idx:m,status:"series-grouping"}):v?h.push({opts:p,series:y,diff:v,targetIdx:g,idx:m,status:"update"}):h.push({opts:p,series:y,targetIdx:g,idx:m,status:"no-op"}),f.length===0&&r.delete(d)}for(const d of r.values())for(const[u,p]of d)h.push({series:u,idx:p,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}import{ModuleRegistry as CP}from"ag-charts-core";import{ModuleType as TP}from"ag-charts-core";var an=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesModule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map(t=>[t.name,t]));function LP(t){const e=an.get(t);return e?.type===TP.Series?e.chartType:void 0}function Eo(t){const e=t.series?.[0]?.type??"line";return CP.getSeriesModule(e)?.chartType??LP(e)??"unknown"}function NP(t){return Eo(t)==="cartesian"}import{ModuleRegistry as kP,ModuleType as OP}from"ag-charts-core";var wP=class extends ap{*legends(){for(const t of kP.listModulesByType(OP.Plugin))(t.name==="legend"||t.name==="gradientLegend")&&(yield{legendType:t.name==="legend"?"category":"gradient",legend:this.getModule(t.name)})}};import{BaseProperties as EP,Property as Ro}from"ag-charts-core";import{BaseProperties as RP,Property as xp,callWithContext as PP,createElement as Hc,isArray as yv,isHTMLElement as bv,toPlainText as _P,toTextString as xv}from"ag-charts-core";var vp="ag-charts-overlay",vv="ag-charts-dark-overlay",na=class extends RP{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return yv(this.text)?_P(this.text):this.rendererAsText?this.rendererAsText:t.t(xv(this.text)||this.defaultMessageId)}getElement(t,e,i,s){if(this.content?.remove(),this.rendererAsText=void 0,this.focusBox=s,this.renderer){const n={},a=PP(t,this.renderer,n);if(bv(a))this.content=a;else{const r=Hc("div");r.innerHTML=a;const{firstElementChild:o}=r;bv(o)&&r.childElementCount===1?this.content=o:this.content=r}this.rendererAsText=this.content?.textContent?.trim()??void 0}else{const n=Hc("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});if(yv(this.text)){const a=Hc("div");for(const r of this.text){const o=Hc("span",{color:r.color,fontSize:`${r.fontSize}px`,fontFamily:r.fontFamily??"inherit",fontWeight:String(r.fontWeight),fontStyle:r.fontStyle});o.innerText=xv(r.text),a.appendChild(o)}n.appendChild(a)}else n.innerText=this.getText(i);this.content=n,this.content.classList.add(this.className),e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(a){n.style.opacity=String(a)},onStop(){n.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};b([xp],na.prototype,"enabled",2),b([xp],na.prototype,"text",2),b([xp],na.prototype,"renderer",2);var cr=class extends EP{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new na("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new na("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new na("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new na("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};b([Ro],cr.prototype,"darkTheme",2),b([Ro],cr.prototype,"loading",2),b([Ro],cr.prototype,"noData",2),b([Ro],cr.prototype,"noVisibleSeries",2),b([Ro],cr.prototype,"unsupportedBrowser",2);import{createElement as Po}from"ag-charts-core";function FP(t,e){const{animationDuration:i}=gc.add,s=i*e,n=Po("div",`${vp}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),a=Po("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),r=Po("p",{marginTop:"1em"});r.innerText=t;const o=Po("div",`${vp}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=Po("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,a,r,o),n}import{BaseProperties as VP,Border as BP,CleanupRegistry as zP,Property as Wc,ProxyPropertyOnWrite as GP,ZIndexMap as jP}from"ag-charts-core";var _o=class extends VP{constructor(t){super(),this.ctx=t,this.rectNode=new ze,this.border=new BP(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new zP,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.cleanup.flush()}getPadding(){const{border:t,padding:e}=this,i=t.enabled?t.strokeWidth:0;if(typeof e=="number"){const s=e+i;return{top:s,right:s,bottom:s,left:s}}return{top:(e.top??0)+i,right:(e.right??0)+i,bottom:(e.bottom??0)+i,left:(e.left??0)+i}}createNode(){return new z({name:"series-area-container",zIndex:jP.SERIES_AREA_CONTAINER})}onLayoutComplete(t){const{x:e,y:i,width:s,height:n}=t.series.paddedRect;this.rectNode.x=e,this.rectNode.y=i,this.rectNode.width=s,this.rectNode.height=n}};b([Wc],_o.prototype,"border",2),b([Wc],_o.prototype,"clip",2),b([GP("rectNode","cornerRadius"),Wc],_o.prototype,"cornerRadius",2),b([Wc],_o.prototype,"padding",2);import{ActionOnSet as UP,ChartAxisDirection as as,CleanupRegistry as HP,EventEmitter as WP,LRUCache as YP,Logger as $P,SeriesContentZIndexMap as Yc,SeriesZIndexMap as Fo,callWithContext as Sv,createId as KP,isEmptyObject as Sp,isGradientFill as ZP,isPatternFill as XP,jsonDiff as qP,mergeDefaults as Iv,nearestSquared as JP,without as Dv}from"ag-charts-core";import{isGradientFill as Mv,isImageFill as Av,isPatternFill as Cv}from"ag-charts-core";function Tv(t,e,i,s){if(Mv(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse,colorSpace:t.colorSpace??e.colorSpace};if(Cv(t)){const n=t.pattern??i.pattern;let a=t.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?a??(a=i.strokeWidth):a??(a=0);const r=t.width??t.height??i.width,o=t.height??t.width??i.height;return{type:"pattern",pattern:n,width:r,height:o,path:t.path,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:a,rotation:t.rotation??i.rotation,scale:t.scale??i.scale}}return Av(t)?{type:"image",url:t.url,width:t.width,height:t.height,backgroundFill:t.backgroundFill??s.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??s.backgroundFillOpacity,rotation:t.rotation??s.rotation,repeat:t.repeat??s.repeat,fit:t.fit??s.fit}:t}function Ip(t,e,i,s){return!Mv(t?.fill)&&!Cv(t?.fill)&&!Av(t?.fill)?t:{...t,fill:Tv(t.fill,e,i,s)}}var Lv=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(Lv||{}),QP=.25,e_=.125,$c=class{constructor(t,e,i,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},Dp=class{constructor(t,e){this.series=t,this.seriesGrouping=e,this.type="groupingChanged"}};function Nv(t){switch(t){case"x":return as.X;case"y":return as.Y;case"angle":return as.Angle;case"radius":return as.Radius}}function Mp(t){switch(t){case as.X:return"x";case as.Y:return"y";case as.Angle:return"angle";case as.Radius:return"radius";default:return"x"}}var Vo=class extends xy{constructor(t){super(),this.cleanup=new HP,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=$c,this.internalId=KP(this),this.contentGroup=new gt({name:`${this.internalId}-content`,zIndex:Fo.ANY_CONTENT}),this.highlightGroup=new gt({name:`${this.internalId}-highlight`,zIndex:Fo.ANY_CONTENT}),this.highlightNodeGroup=this.highlightGroup.appendChild(new z({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new z({name:`${this.internalId}-highlight-label`,zIndex:Yc.LABEL})),this.annotationGroup=new gt({name:`${this.internalId}-annotation`}),this.labelGroup=new gt({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=[as.X,as.Y],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new ap,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new WP,this._pickNodeCache=new YP(5),this.fireEventWrapper=l=>super.fireEvent(l);const{moduleCtx:e,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:a=!1,usesPlacedLabels:r=!1,alwaysClip:o=!1}=t;this.ctx=e,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=a,this.usesPlacedLabels=r,this.pickModes=i,this.alwaysClip=o,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",l=>this.setChartData(l)),this.ctx.eventsHub.on("highlight:change",l=>this.onChangeHighlight(l)))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(t){this.properties.visible=t,this.ctx.legendManager.toggleItem(t,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const t=this.data;return t==null?!1:t.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:s,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new Dp(this,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(t,e=!1){const i=this.bringToFront();return!e&&t===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=t,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:t),this.fireEvent(new Dp(this,this.seriesGrouping)),!0)}setZIndex(t){this.contentGroup.zIndex=[Fo.ANY_CONTENT,t,Yc.FOREGROUND],this.highlightGroup.zIndex=[Fo.ANY_CONTENT,t,Yc.HIGHLIGHT],this.labelGroup.zIndex=[Fo.ANY_CONTENT,t,Yc.LABEL],this.annotationGroup.zIndex=t}renderToOffscreenCanvas(){return!1}hasHighlightOpacity(){if(!this.properties.highlight.enabled||this.ctx.highlightManager.getActiveHighlight()==null)return!1;const{unhighlightedItem:t,unhighlightedSeries:e}=this.properties.highlight;return $u(t)||$u(e)}getDrawingMode(t,e="cutout"){return t?e:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const t=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:t}}}addEventListener(t,e){return super.addEventListener(t,e)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(t,e){const i=Nv(t),s=i==null?t:Mp(this.resolveKeyDirection(i)),n=e?.[s],a=[];if(!n)return a;const r=(...o)=>{for(const l of o)Array.isArray(l)?r(...l):typeof l=="object"?r(...Object.values(l)):a.push(l)};return r(...n.map(o=>this.properties[o])),a}getKeyAxis(t){}getKeys(t){return this.getPropertyValues(Mp(t),this.propertyKeys)}getKeyProperties(t){return this.propertyKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getPropertyValues(Mp(t),this.propertyNames)}getFormatterContext(t){const{id:e}=this,i=this.getPropertyValues(t,this.propertyKeys),s=this.getPropertyValues(t,this.propertyNames),n=[];for(let a=0;a<i.length;a++)n.push({seriesId:e,key:i[a],name:s[a]});return n}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(s=>s.getDomain(t)).flat();return i.length===0?e:{domain:e.domain.concat(i)}}getRange(t,e){return this.getSeriesRange(t,e)}getMinimumRangeSeries(t){}getMinimumRangeChart(t){return 0}getZoomRangeFittingItems(t,e,i){}getVisibleItems(t,e,i){return 1/0}toCanvasFromMidPoint(t){const{x:e=0,y:i=0}=t.midPoint??{};return ve.toCanvasPoint(this.contentGroup,e,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:t,seriesGrouping:e,type:i,visible:s}=this;this.ctx.seriesStateManager.updateSeries({internalId:t,type:i,visible:s,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0})}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:e=1}=this.getHighlightStyle();return e}getHighlightState(t,e,i,s){return this.properties.highlight.enabled?e?1:t?.series==null?0:this.isSeriesHighlighted(t,s)?this.isItemHighlighted(t,i)==null?2:4:3:0}getHighlightStateString(t,e,i,s){return nr(this.getHighlightState(t,e,i,s))}onChangeHighlight(t){const e=t.previousHighlight,i=t.currentHighlight,s=this.getHighlightState(i),n=this.getHighlightState(e);this.setSeriesIndex(this.declarationOrder);const a=this.hasItemStylers();if(!a&&s===n){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:r,unhighlightedItem:o,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=a||!Sp(r)||!Sp(o)||!Sp(l)}bringToFront(){return this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(t,e){return this.properties.highlight.enabled?t?.series===this:!1}isItemHighlighted(t,e){if(!(t?.datumIndex==null||e==null))return t.datumIndex===e}getHighlightStyle(t,e,i,s){const n=this.ctx.highlightManager?.getActiveHighlight();return i??(i=this.getHighlightState(n,t,e,s)),this.properties.highlight.getStyle(i)}resolveMarkerDrawingModeForState(t,e){return OE(t,e)}filterItemStylerFillParams(t){return ZP(t)?Dv(t,["bounds","colorSpace","gradient","reverse"]):XP(t)?Dv(t,["padding"]):t}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:a,contentGroup:r}=this;if(!a||!r.visible||e==="highlight"&&!this.properties.highlight.enabled||e==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let o=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:u}=this.properties;o=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:u}=this.properties;o=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=t,d=JSON.stringify({x:c,y:h,maxDistance:o,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const g=this.pickNodesExactShape(t);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(t),f=g?.distance===0?this.pickNodesExactShape(t):void 0;f!=null&&f.length!==0?p={datums:f,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n==null?void 0:this.pickNodeMainAxisFirst(t,n==="main-category");p=g==null?void 0:{datums:[g.datum],distance:g.distance};break}}if(p&&p.distance<=o)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&e.push(s)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=JP(t.x,t.y,e),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireEvent(t){Sv([this.properties,this.ctx.chartService],this.fireEventWrapper,t)}fireNodeClickEvent(t,e){const i=new this.NodeEvent("seriesNodeClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=new this.NodeEvent("seriesNodeDoubleClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,o=a!=null&&a===t.legendItemName;(s.id===this.id||o||r!=null)&&this.toggleSeriesItem(e,n,i,a,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:a}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=r!=null&&r===t.legendItemName;s.id===this.id||l||o!=null?this.toggleSeriesItem(!0,a,i,r,t):e&&n===1?this.toggleSeriesItem(!0,a,void 0,r):this.toggleSeriesItem(!1,a,void 0,r)}toggleSeriesItem(t,e,i,s,n){const a=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const r={type:"seriesVisibilityChange",seriesId:a,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(r),this.ctx.legendManager.toggleItem(t,a,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(t,e,i,s,n,a,r){const{id:o,properties:l}=this;return t.formatDatum(l,i,e,o,a,s,n,void 0,void 0,void 0,r)}getLabelText(t,e,i,s,n,a,r,o=!1){if(t==null&&!o)return"";const{axes:l,canHaveAxes:c,ctx:h,id:d,properties:u}=this,p="series-label",g="legendItemName"in u?u.legendItemName:void 0,f={seriesId:this.id,...r},y=c?Nv(s):void 0,m=y==null?void 0:l[this.resolveKeyDirection(y)];if(m!=null)return m.formatDatum(u,t,p,d,g,e,i,n,a,f,o);const{formatManager:x}=h,v=this.callWithContext.bind(this),S=M=>a.formatValue(v,M.type,M.value,f)??x.format(v,M)??(t==null?"":String(t)),I=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return S({type:"number",value:t,datum:e,seriesId:d,legendItemName:g,key:i,source:p,property:s,domain:n,boundSeries:I,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return S({type:"category",value:t,datum:e,seriesId:d,legendItemName:g,key:i,source:p,property:s,domain:n,boundSeries:I})}}getMarkerStyle(t,{datumIndex:e,datum:i,point:s},n,a,r={size:s?.size??t.size??0},o){const{itemStyler:l}=t,{highlightState:c,isHighlight:h=!1,checkForHighlight:d=!0,resolveMarkerSubPath:u=["marker"],resolveStyler:p=!1}=a??{},g=["series",`${this.declarationOrder}`,...u];if(p){const x={permissivePath:!0},v=this.ctx.optionsGraphService.resolvePartial(g,r,x);v&&(r={...v,size:v.size??r.size})}const f=d?this.getHighlightStyle(h,e,c):void 0;let m=Iv(f,r,t.getStyle(),o);if(l&&n){const x=this.ctx.highlightManager?.getActiveHighlight(),v=this.getHighlightStateString(x,h,e),S=this.filterItemStylerFillParams(m.fill),I=this.cachedCallWithContext(l,{seriesId:this.id,...m,fill:S,...n,highlightState:v,datum:i}),M=this.ctx.optionsGraphService.resolvePartial(g,I);m=Iv(M,m)}return m}applyMarkerStyle(t,e,i,s,{applyTranslation:n=!0,selected:a=!0}={}){const{shape:r,size:o=0}=t,l=this.visible&&o>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y);if(e.setStyleProperties(t,s),n?e.setProperties({visible:l,shape:r,size:o,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):e.setProperties({visible:l,shape:r,size:o}),a||(e.fillOpacity*=QP,e.strokeOpacity*=e_),typeof r=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const c=e.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[d,u]=["x","y"].map(p=>(t.strokeWidth??0)+Math.abs(h[p]-i[p]));i.focusSize=Math.max(c.width+d,c.height+u)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(t){const{width:e,height:i}=t??{width:Number.NaN,height:Number.NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=qP(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,s=i.get(t);if(s!=null)return s;try{const n=e();return i.set(t,n),n}catch(n){$P.error(String(n))}}cachedCallWithContext(t,e){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],t,e)}callWithContext(t,e){return Sv([this.properties,this.ctx.chartService],t,e)}formatTooltipWithContext(t,e,i){return t.formatTooltip([this.properties,this.ctx.chartService],e,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};Vo.className="Series",b([UP({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Vo.prototype,"seriesGrouping",2);import{ChartUpdateType as Kc,Logger as kv,Vec4 as Ov,clamp as t_,createId as i_}from"ag-charts-core";import{createElement as wv,createSvgElement as Ap,getWindow as s_,setElementBBox as n_}from"ag-charts-core";var a_=class{constructor(t){this.swapChain=t,this.hasBeenActivated=!1,this.div=wv("div"),this.svg=Ap("svg"),this.outerPath=Ap("path"),this.innerPath=Ap("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=wv("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof Be){const s=(a,r)=>{let{x:o,y:l}=ve.toCanvasPoint(t,a,r);return o-=e.x??0,l-=e.y??0,{x:o,y:l}},n=t.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(t.x-e.x,0),a=Math.max(t.y-e.y,0),r=Math.min(t.x+t.width-e.x,e.width),o=Math.min(t.y+t.height-e.y,e.height);s=new R(n,a,r-n,o-a)}else s=new R(t.x-e.x,t.y-e.y,t.width,t.height);n_(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(t=!1){if(!t&&!this.hasBeenActivated)return!1;const e=this.element.parentElement;return e!=null&&s_().getComputedStyle(e).opacity==="1"}};import{createElement as r_,createElementId as Ev,setAttribute as Cp,setAttributes as Rv,setElementStyle as Zc}from"ag-charts-core";var o_=class{constructor(t,e,i,s){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(Zc(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(Zc(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),Cp(this.label1,"id",Ev()),Cp(this.label2,"id",Ev()),Zc(this.label1,"display","none"),Zc(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Cp(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(t){const e=r_("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1);for(const i of this.listeners[t])i(e)}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],Rv(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Rv(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}};import{entries as l_}from"ag-charts-core";var c_={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function h_(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function d_(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of l_(c_))if(h_(t,s))return{name:e,activatesFocusIndicator:i}}function u_(t,e,i){const s=Wu(t,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof R){const{x:a,y:r}=n.computeCenter();return{x:e.x+a,y:e.y+r}}return ve.toCanvas(n).computeCenter()}}function p_({bounds:t}){return t instanceof R?t:t!=null?ve.toCanvas(t):R.NaN}function g_(t,e,i){const{x:s,y:n}=u_(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}import{BaseProperties as Pv,CleanupRegistry as f_,Property as Wt,calculatePlacement as m_,clamp as _v,getWindow as y_,isNode as Fv}from"ag-charts-core";import{EventEmitter as b_}from"ag-charts-core";var Vv=.1,Bv=200,zv=12,x_=.5,v_=class{constructor(){this.events=new b_,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const a=.001,r=Math.trunc(Math.ceil(n/(a*1e3)));let{x:o,y:l,vx:c,vy:h}=this;for(let d=0;d<r;d+=1){const u=o-t,p=l-e,g=-(Bv*u+zv*c)/Vv,f=-(Bv*p+zv*h)/Vv;c+=g*a,h+=f*a,o+=c*a,l+=h*a}Math.hypot(o-t,l-e)<x_?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=o,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}};import{toPlainText as rn,toTextString as S_}from"ag-charts-core";import{createElement as I_,toPlainText as D_}from"ag-charts-core";var Xc=null;function hr(t){const e=D_(t);return e===""?"":(Xc??(Xc=I_("div")),Xc.textContent=e,Xc.innerHTML.replaceAll(`
`,"<br>"))}import{DeclaredSceneChangeDetection as Tp,DeclaredSceneObjectChangeDetection as M_,TRIPLE_EQ as A_}from"ag-charts-core";import{toRadians as qc}from"ag-charts-core";function Bo(t,e){const{path:i,size:s}=t,{x:n,y:a}=t;i.clear();let r=!1;for(const[o,l]of e){const c=n+(o-.5)*s,h=a+(l-.5)*s;r?i.lineTo(c,h):i.moveTo(c,h),r=!0}i.closePath()}var C_={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.arc(e,i,n,0,Math.PI*2),t.closePath()},cross(t){Bo(t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(t){Bo(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i=i+n/2,t.arc(e-n,i-n,n,qc(130),qc(330)),t.arc(e+n,i-n,n,qc(220),qc(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){t.moveTo(e+(.891-.5)*s,i+(.391-.5)*s),t.cubicCurveTo(e+(.891-.5)*s,i+(.606-.5)*s,e+(.5-.5)*s,i+(1-.5)*s,e+(.5-.5)*s,i+(1-.5)*s),t.cubicCurveTo(e+(.5-.5)*s,i+(1-.5)*s,e+(.109-.5)*s,i+(.606-.5)*s,e+(.109-.5)*s,i+(.391-.5)*s),t.cubicCurveTo(e+(.109-.5)*s,i+(.175-.5)*s,e+(.284-.5)*s,i+(0-.5)*s,e+(.5-.5)*s,i+(0-.5)*s),t.cubicCurveTo(e+(.716-.5)*s,i+(0-.5)*s,e+(.891-.5)*s,i+(.175-.5)*s,e+(.891-.5)*s,i+(.391-.5)*s),t.closePath()},plus(t){Bo(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:s,pixelRatio:n}){const a=s/2;t.moveTo(Xe(n,e-a),Xe(n,i-a)),t.lineTo(Xe(n,e+a),Xe(n,i-a)),t.lineTo(Xe(n,e+a),Xe(n,i+a)),t.lineTo(Xe(n,e-a),Xe(n,i+a)),t.closePath()},star({path:t,x:e,y:i,size:s}){const a=s/2,r=a/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:r,h=l*Math.PI/5-o,d=e+Math.cos(h)*c,u=i+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},triangle(t){Bo(t,[[.5,0],[1,.87],[0,.87]])}},zo=class extends Be{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(t,e){return this.distanceSquared(t,e)<=0}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(t,e){const i=je.anchor(this.shape),s=t-this.x+(i.x-.5)*this.size,n=e-this.y+(i.y-.5)*this.size,a=this.size/2;return Math.max(s*s+n*n-a*a,0)}updatePath(){const{path:t,shape:e,x:i,y:s,size:n}=this,a=this.layerManager?.canvas?.pixelRatio??1,r=je.anchor(e),o={path:t,x:i-(r.x-.5)*n,y:s-(r.y-.5)*n,size:n,pixelRatio:a};t.clear(),typeof e=="string"?C_[e](o):typeof e=="function"&&e(o)}computeBBox(){const{x:t,y:e,size:i}=this,s=je.anchor(this.shape);return new R(t-i*s.x,e-i*s.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};b([M_({equals:A_})],zo.prototype,"shape",2),b([Tp()],zo.prototype,"x",2),b([Tp()],zo.prototype,"y",2),b([Tp({convertor:Math.abs})],zo.prototype,"size",2);var je=class extends Ua(ql(Ha(zo))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}resetAnimationProperties(t,e,i,s,n,a){this.__x=t,this.__y=e,this.__size=i,this.__opacity=s,this.resetScalingProperties(n,a,t,e),this.dirtyPath=!0,this.markDirty()}};function T_(t,e,i=e*(5/3)){const s=new z,n=Math.min(t.marker.strokeWidth??1,2),a=t.line?.enabled?Math.min(t.line.strokeWidth,2):0,r=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),o=Math.max(t.marker.enabled===!1?0:e,a);if(t.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,d=new ni;d.x1=0,d.y1=o/2,d.x2=r,d.y2=o/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=a,d.lineDash=h,s.append(d)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:g}=t.marker,f=new je;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h??1,f.stroke=d,f.strokeOpacity=u??1,f.strokeWidth=n,f.lineDash=p,f.lineDashOffset=g??0;const y=je.anchor(l),m=r/2+(y.x-.5)*e,x=o/2+(y.y-.5)*e,v=e/(e+n);f.x=m,f.y=x,f.scalingCenterX=m,f.scalingCenterY=x,f.scalingX=v,f.scalingY=v,s.append(f)}return z.toSVG(s,r,o)}var lt="ag-charts-tooltip",L_="ag-charts-tooltip--dark";function Ts(t){return t==null?!1:Array.isArray(t)?t.some(e=>Ts(e.text)):S_(t).trim()!==""}function aa(t,e=!1){return t==null?!e:typeof t=="number"&&!Number.isFinite(t)}function N_(t){return t.type==="raw"||!t.data||t.data.length===0?!1:t.data.every(e=>e.missing===!0)}function Gv(t){const e=[],i=new Map;for(const s of t)if(!N_(s))if(s.type==="structured"){const{heading:n}=s,a=Ts(n)?i.get(n):void 0,r={type:"structured",heading:n,items:[s]};a==null?(i.set(n,r),e.push(r)):a.items.push(s)}else e.push(s);return e}function k_(t){const e=Gv(t),i=[];for(const s of e)if(s.type!=="raw"){Ts(s.heading)&&i.push(rn(s.heading));for(const n of s.items)if(Ts(n.title)&&i.push(rn(n.title)),n.data)for(const a of n.data)a.missing!==!0&&i.push(a.label??a.fallbackLabel,rn(a.value))}return i.filter(s=>s!=="").join("; ")}function jv(t,e,i){let s="";Ts(t)?(s+=`<span class="${lt}-label">${hr(t)}</span>`,s+=" ",s+=`<span class="${lt}-value">${hr(e)}</span>`):s+=`<span class="${lt}-label">${hr(e)}</span>`;const n=[`${lt}-row`];return i&&n.push(`${lt}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function O_(t){let e="";if(t.data?.length&&t.data.every(a=>a.missing===!0))return e;const i=Ts(t.title),s=!i&&t.data?.length===1,n=t.symbol==null?void 0:T_(t.symbol,12);if(n!=null&&(i||t.data?.length)&&(e+=`<span class="${lt}-symbol">${n}</span>`),i&&(e+=`<span class="${lt}-title">${hr(t.title)}</span>`,e+=" "),t.data)for(const a of t.data)a.missing!==!0&&(e+=jv(a.label??a.fallbackLabel,rn(a.value),s),e+=" ");return e}function Uv(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${lt}-footer">${i}</div>`}function Hv(t,e,i,s){const n=e.items.length===1?e.items[0]:void 0;let a,r,o;switch(i){case"compact":a=!0,r=rn(n?.title);break;case"single":const h=Ts(e.heading);a=n!=null&&(!h||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,o=rn(h?e.heading:n?.title);break;case"shared":a=!1}let l="";if(a&&n!=null){if(Ts(r)&&(l+=`<span class="${lt}-title">${hr(r)}</span>`),n.data)for(const h of n.data)h.missing!==!0&&(l+=jv(h.label??o,rn(h.value),!1),l+=" ")}else{Ts(e.heading)&&(l+=`<span class="${lt}-heading">${hr(rn(e.heading))}</span>`,l+=" ");for(const h of e.items)l+=O_(h)}if(l.length===0)return;const c=i!=="compact"&&s!=null?Uv(t,s):void 0;return c+null&&(l+=c),l=`<div class="${lt}-content">${l.trimEnd()}</div>`,l}function w_(t,e){const i=e==null?void 0:Uv(t,e);return i==null?"":`<div class="${lt}-content">${i}</div>`}function E_(t,e,i,s){const n=Gv(e);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return Hv(t,n[0],i,s);{const a=n.map(r=>r.type==="structured"?Hv(t,r,i):r.rawHtmlString);return s!=null&&a.push(w_(t,s)??""),a.join("")}}}var R_={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},P_={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},__={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Wv={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},F_={pointer:"top",node:"top",chart:"top-left"},dr=class extends Pv{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};b([Wt],dr.prototype,"xOffset",2),b([Wt],dr.prototype,"yOffset",2),b([Wt],dr.prototype,"anchorTo",2),b([Wt],dr.prototype,"placement",2);var _i=class extends Pv{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new dr,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new f_,this.springAnimation=new v_,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new jy,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(t,e){return"togglePopover"in y_().HTMLElement.prototype&&(this.element=e.addChild("tooltip-container",lt),this.element.setAttribute("popover","manual"),this.element.className=lt,this.element.style.positionAnchor=e.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=t,()=>{e.removeChild("tooltip-container",lt),this.cleanup.flush(),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(t){return this.element?.contains(t)??!1}updateTooltipPosition(){const{element:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:a}=i,{x:r,y:o}=this.springAnimation,l=a.position?.anchorTo??"pointer";let c=a.position?.placement??F_[l];Array.isArray(c)||(c=[c]);const h=a.position?.xOffset??0,d=a.position?.yOffset??0,u=n.x,p=n.y,g=n.width-e.width-1+u,f=n.height-e.height+p;let y=0,m,x,v=!1;do{m=c[y],y+=1;const C=this.getTooltipBounds({elementSize:e,placement:m,anchorTo:l,canvasX:r,canvasY:o,yOffset:d,xOffset:h,canvasRect:s});x=m_(e.width,e.height,n,C),v=!1,Wv[m]&1&&(v||(v=x.x<u||x.x>g)),Wv[m]&2&&(v||(v=x.y<p||x.y>f))}while(y<c.length&&v);const S=_v(u,x.x,g),I=_v(p,x.y,f);v||(v=S!==x.x||I!==x.y);const M=l!=="chart"&&!v&&!h&&!d,D=a.showArrow??this.showArrow??M;this.arrowPosition=D?__[m]:void 0,this.updateClassModifiers(),t.style.translate=`${S}px ${I}px`}show(t,e,i,s,n,a=!1){const{element:r}=this;if(r!=null&&s!=null&&s.length!==0){const c=E_(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){r.innerHTML="",this.toggle(!1);return}r.innerHTML=c}else if(r==null||r.innerHTML===""){this.toggle(!1);return}const o={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};switch(this.positionParams={canvasRect:e,relativeRect:o,meta:i},i.position?.anchorTo??"pointer"){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,r.style.pointerEvents="auto",r.removeAttribute("aria-hidden"),r.tabIndex=-1):(this.enableInteraction=!1,r.style.pointerEvents="none",r.setAttribute("aria-hidden","true"),r.removeAttribute("tabindex")),r.style.setProperty("--top",`${e.top}px`),r.style.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,a)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:t},e){const{interactive:i,interactiveLeave:s,enabled:n,element:a}=this;if(a==null)return!1;if(s)return!0;const r=i&&n&&this.isVisible()&&Fv(t)&&this.contains(t);return r&&(this.interactiveLeave={callback:e,listener:o=>{(o.relatedTarget==null||Fv(o.relatedTarget)&&!this.contains(o.relatedTarget))&&this.popInteractiveLeaveCallback()}},a.addEventListener("focusout",this.interactiveLeave.listener),a.addEventListener("mouseout",this.interactiveLeave.listener)),r}popInteractiveLeaveCallback(){const{interactiveLeave:t,element:e}=this;this.interactiveLeave=void 0,t&&(e&&(e.removeEventListener("focusout",t.listener),e.removeEventListener("mouseout",t.listener)),t.callback())}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.element?.isConnected&&this._visible!==t&&(this._visible=t,this.element.togglePopover(t),t?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback()))}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:t}=this.element,e=(i,s)=>t.toggle(`${lt}--${i}`,s);e("no-interaction",!this.enableInteraction),e("arrow-top",this.arrowPosition===1),e("arrow-right",this.arrowPosition===3),e("arrow-bottom",this.arrowPosition===2),e("arrow-left",this.arrowPosition===0),e("compact",this.mode==="compact"),t.toggle(L_,this.darkTheme);for(const i of this.wrapTypes)t.toggle(`${lt}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:s,canvasX:n,canvasY:a,yOffset:r,xOffset:o,canvasRect:l}=t,{width:c,height:h}=e,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=R_[s],p=P_[s];return d.top=a+r+h*(p-1)/2+8*p,d.left=n+o+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=r,d.left=l.width/2-c/2+o,d;case"right":return d.top=l.height/2-h/2+r,d.left=l.width-c+o,d;case"left":return d.top=l.height/2-h/2+r,d.left=o,d;case"bottom":return d.top=l.height-h+r,d.left=l.width/2-c/2+o,d;case"top-left":return d.top=r,d.left=o,d;case"top-right":return d.top=r,d.left=l.width-c+o,d;case"bottom-right":return d.top=l.height-h+r,d.left=l.width-c+o,d;case"bottom-left":return d.top=l.height-h+r,d.left=o,d}return d}};b([Wt],_i.prototype,"enabled",2),b([Wt],_i.prototype,"mode",2),b([Wt],_i.prototype,"showArrow",2),b([Wt],_i.prototype,"delay",2),b([Wt],_i.prototype,"range",2),b([Wt],_i.prototype,"wrapping",2),b([Wt],_i.prototype,"position",2),b([Wt],_i.prototype,"pagination",2),b([Wt],_i.prototype,"darkTheme",2),b([Wt],_i.prototype,"bounds",2);import{objectsEqual as V_}from"ag-charts-core";function B_(t){return t.datum.itemId!==void 0?t.datum.itemId:typeof t.datum.datumIndex=="number"?t.datum.datumIndex:JSON.stringify(t.datum.datumIndex)}function Jc(t,e){return t.series===e.series&&V_(t.datumIndex,e.datumIndex)}function z_(t,e){return e==null?-1:t.findIndex(i=>Jc(i,e))}var G_=class{constructor(t,e,i){this.activeManager=t,this.tooltipProperties=e,this.focusState=i,this.candidates=[],this.activeState=new po}getActive(){return this.activeState.stateValue()}clear(){this.activeState.clear(),this.lastNotifiedActive=void 0,this.candidates.length=0,this.pendingPickedNodes=void 0}setSource(t,e){e===void 0?this.activeState.delete(t):this.activeState.set(t,e),this.syncActiveManager()}syncActiveManager(){const t=this.getActive(),e=this.lastNotifiedActive;if(t!==e&&!(t!==void 0&&e!==void 0&&Jc(t,e)))if(this.lastNotifiedActive=t,t===void 0)this.activeManager.clear();else{const i=t.series.id,s=B_(t);this.activeManager.update({type:"series-node",seriesId:i,itemId:s},t.datum)}}popPendingPickedNodes(){const t=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,t}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(t){if(t!==void 0){const i=this.getActive();if(this.tooltipProperties.pagination&&i!==void 0){const s=t.matches.find(n=>Jc(n,i));if(s)return s}}const e=t?.matches[0];return this.setSource("highlight",e),e}onPickedNodesTooltip(t){if(t!==void 0&&this.tooltipProperties.pagination){const i=this.getActive(),s=t.matches;this.candidates=s;let n=z_(s,i);n===-1&&(n=0);const a=s[n];this.setSource("tooltip",a);const r={index:n,length:s.length};return{active:a,paginationState:r}}const e=t?.matches[0];return this.setSource("tooltip",e),{active:e}}onPickedNodesFocus(t){const{series:e}=this.focusState;if(this.clear(),e!==void 0&&t!==void 0){const{datum:i,datumIndex:s}=t;this.setSource("focus",{series:e,datum:i,datumIndex:s})}}onPickedNodesAPI(t){return this.pendingPickedNodes=t,t.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:t}=this,e=this.getActive(),i=e==null?-1:t.findIndex(r=>Jc(r,e));if(i===-1)return{active:void 0,paginationState:void 0};let s=i+1;s>=t.length&&(s=0);const n=t[s];this.setSource("tooltip",n);const a={index:s,length:this.candidates.length};return{active:n,paginationState:a}}return{active:this.getActive()}}},Yv=class extends mu{constructor(t){super(),this.chart=t,this.id=i_(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0},this.hoverDevice="pointer",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=IL(()=>{if(this.hoverDevice==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=Kc.SERIES_UPDATE){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.pickManager=new G_(t.ctx.activeManager,t.tooltip,this.focus);const e=t.ctx.localeManager.t("ariaInitSeriesArea"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new o_(i,s,"img",e),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new a_(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:n,seriesWidget:a,containerWidget:r}=t.ctx.widgets;a.setTabIndex(-1),this.cleanup.register(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),a.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),a.addListener("mousemove",o=>this.onHover(o,a)),a.addListener("wheel",o=>this.onWheel(o)),a.addListener("mouseleave",o=>this.onLeave(o)),a.addListener("keydown",o=>this.onKeyDown(o)),a.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),r.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),r.addListener("click",(o,l)=>this.onClick(o,l)),r.addListener("dblclick",(o,l)=>this.onClick(o,l)),t.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),t.ctx.eventsHub.on("active:load-memento",o=>this.onActiveLoadMemento(o)),t.ctx.eventsHub.on("active:update",o=>this.onActiveUpdate(o)),t.ctx.eventsHub.on("dom:resize",()=>this.clearAll()),t.ctx.eventsHub.on("highlight:change",o=>this.changeHighlightDatum(o)),t.ctx.eventsHub.on("layout:complete",o=>this.layoutComplete(o)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.eventsHub.on("zoom:change-complete",()=>this.clearAll()),t.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),n&&this.cleanup.register(n.events.on("drag-move",o=>this.onDragMove(o,a)),n.events.on("click",o=>this.onClick(o,a)),n.events.on("dblclick",o=>this.onClick(o,a)))}get bbox(){return(this.seriesRect??R.zero).clone()}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var t;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.hoverDevice!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.hoverDevice==="setState"&&this.refreshSetState()}updateComplete(){this.isState(68)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.handleFocus(0,0))}update(t,e){this.chart.ctx.updateService.update(t,e)}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let s=e.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[e.declarationOrder,i.declarationOrder]),s<n?-1:s>n?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onAnimationStart(){this.hoverDevice!=="setState"&&this.clearAll()}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(e!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:c,canvasY:h},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=ve.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");c&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=c.matches[0].datum)}const a=s?.series;this.clearAll();const r=t.currentX+e.cssLeft(),o=t.currentY+e.cssTop(),{datumIndex:l}=s??{};a&&s&&l!=null?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:t,canvasX:r,canvasY:o},{pickedSeries:a,pickedNode:{...s,datumIndex:l}},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:t,canvasX:r,canvasY:o},void 0,n)}onLeave(t){!this.isState(82)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll(!0))}onWheel(t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.hoverDevice="pointer")}onDragMove(t,e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e))}onHover(t,e){this.isState(82)&&this.onHoverLikeEvent(t,e)}onHoverLikeEvent(t,e){if(this.isIgnoredTouch(t)||(t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),e!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=t,this.hoverDevice="pointer",this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule();let i;if(this.isState(64)){const{currentX:n,currentY:a}=t;i=this.pickNodes({x:n,y:a},"event");const r=i?.matches,o=r?.[0];o?.series.hasEventListener("seriesNodeClick")||o?.series.hasEventListener("seriesNodeDoubleClick")||r!=null&&r.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const s=!!i?.matches.length;this.emitSeriesAreaHoverEvent(t,s)}onClick(t,e){if(t.device==="keyboard"||(e===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(82)))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e);const i=e===this.chart.ctx.widgets.seriesWidget;if(!this.isState(64)){i&&this.emitSeriesAreaClickEvent(t,!1);return}if(i){if(this.checkSeriesNodeClick(t)){this.emitSeriesAreaClickEvent(t,!0),this.update(Kc.SERIES_UPDATE),t.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(t,!1)}const s={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(s)}emitSeriesAreaHoverEvent(t,e){const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t),n={canvasX:i,canvasY:s,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",n)}emitSeriesAreaClickEvent(t,e){if(!("currentX"in t))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t),n={canvasX:i,canvasY:s,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:click",n)}toCanvasCoordinates(t){return{canvasX:t.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:t.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){this.isState(68)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(t){this.isState(68)&&(this.hoverDevice="pointer",this.maybeEnterInteractiveTooltip(t)||this.clearAll(!0),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(t){if(!this.isState(86))return;const e=d_(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.hoverDevice==="keyboard"),e?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:t});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:t});case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"submit":return this.onSubmit(t)}}onArrow(t,e,i){this.isState(68)&&(this.hoverDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocus(t,e),i.sourceEvent.preventDefault(),this.chart.ctx.eventsHub.emit("series:focus-change",null))}onSubmit(t){if(!this.isState(68))return;const{series:e,datum:i}=this.focus,s=t.sourceEvent;e!=null&&i!=null?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event"),s=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||s.active===void 0)return!1;const{series:n,datum:a}=s.active,r=s.paginationState==null?i.distance:0;if(t.type==="click"){if(n.fireNodeClickEvent(t.sourceEvent,a)){const l=this.pickManager.nextCandidate();if(l.active!==void 0){const{canvasX:c,canvasY:h}=this.toCanvasCoordinates(t);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.active,c,h,l.paginationState)}}return!0}return t.type==="dblclick"?(t.preventZoomDblClick=r===0,n.fireNodeDoubleClickEvent(t.sourceEvent,a),!0):!1}handleFocus(t,e){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(t,e)===0?this.announceMode="when-changed":this.announceMode="always":(this.focusIndicator?.update(i.rect,this.seriesRect,!1),this.swapChain.update(i.text),this.announceMode="always")}handleSeriesFocus(t,e){if(this.chart.chartType==="standalone")return this.handleSoloSeriesFocus(t,e);const{focus:i}=this,s=i.sortedSeries.filter(l=>l.visible&&l.focusable);if(s.length===0)return 1;const n=i.datumIndex-e,a=i.seriesIndex-t;i.seriesIndex=t_(0,i.seriesIndex,s.length-1),i.series=s[i.seriesIndex];const r=this.focus.datumIndex,o=this.focus.seriesIndex;return this.updatePickedFocus(r,e,n,o,t,a)}handleSoloSeriesFocus(t,e){this.focus.series=this.focus.sortedSeries[0];const i=this.focus.datumIndex,s=this.focus.seriesIndex,n=this.focus.datumIndex-e,a=this.focus.seriesIndex-t;return this.updatePickedFocus(i,e,n,s,t,a)}pickFocus(t,e){const i=t.pickFocus(e);return this.hoverDevice==="keyboard"&&this.pickManager.onPickedNodesFocus(i),i}updatePickedFocus(t,e,i,s,n,a){const{focus:r,hoverRect:o,seriesRect:l}=this;if(r.series==null||o==null)return 1;const c={datumIndex:t,datumIndexDelta:e,otherIndex:s,otherIndexDelta:n,seriesRect:l},h=this.pickFocus(r.series,c);if(!h)return 2;const{datum:d}=h;if(r.datum=d,r.datumIndex=h.datumIndex,h.otherIndex!=null&&(r.seriesIndex=h.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const g=p_(h),{x:f,y}=g.computeCenter();if(!o.containsPoint(f,y)&&this.chart.ctx.zoomManager.panToBBox(o,g))return 3;const{x1:m,x2:x,y1:v,y2:S}=Ov.from(g),I=o.containsPoint(m,v),M=o.containsPoint(x,v),D=o.containsPoint(m,S),C=o.containsPoint(x,S);if(!(I||M||D||C)){const A=Ov.from(o);h.movedBounds=g.clone(),m<A.x1&&x<A.x1?(h.movedBounds.x=A.x1-2,h.movedBounds.width=4):m>A.x2&&x>A.x2&&(h.movedBounds.x=A.x2-2,h.movedBounds.width=4),v<A.y1&&S<A.y1?(h.movedBounds.y=A.y1-2,h.movedBounds.height=4):v>A.y2&&S>A.y2&&(h.movedBounds.y=A.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const u=this.getTooltipContent(r.series,d.datumIndex,d,"aria-label"),p=g_(r.series,o,h);if(p!=null&&this.hoverDevice==="keyboard"){this.clearCachedEvents();const g=Dc.makeTooltipMeta(p,r.series,d,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,d),this.isTooltipEnabled(r.series)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,g,u)}return this.maybeAnnouncePickedFocus(e,i,n,a,h,u),0}maybeAnnouncePickedFocus(t,e,i,s,n,a){const{focus:r}=this;let o;this.announceMode==="when-changed"?t===0&&i===0||e!==n.datumIndex||s!==(n.otherIndex??r.seriesIndex)?o="always":o="never":o=this.announceMode,o==="always"&&this.swapChain.update(this.getDatumAriaText(n.datum,a))}getDatumAriaText(t,e){const i=e==null?"":k_(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(t=!1){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,t)}clearTooltip(t=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,t),this.tooltip.lastHover=void 0}clearAll(t=!1){this.pickManager.onClearUI(),this.clearHighlight(t),this.clearTooltip(t),this.focusIndicator?.clear()}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}handleHoverFromState(){const{active:t,paginationState:e}=this.pickManager.onPickedNodesAPIDebounced();if(t===void 0)return;this.chart.ctx.highlightManager.updateHighlight(this.id,t.datum);const i=Wu(t.series,t.datum,void 0);if(this.chart.tooltip.enabled&&i){const{canvasX:s,canvasY:n}=i;this.showTooltip(t,s,n,e)}}handleHoverHighlight(t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const e=this.highlight.appliedHoverEvent;if(!e||!this.isState(82))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,s)){this.clearHighlight();return}const{range:n}=this.chart.highlight,a=n==="tooltip"?"highlight-tooltip":"highlight",r=this.pickNodes({x:e.currentX,y:e.currentY},a),o=this.pickManager.onPickedNodesHighlight(r);o===void 0?this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0):this.chart.ctx.highlightManager.updateHighlight(this.id,o.datum,!1)}handleHoverTooltip(t,e){if(!this.isState(82))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t),n=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,s)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(n&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(n,"canvas-overlay",lt))return;const a=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip"),{active:r,paginationState:o}=this.pickManager.onPickedNodesTooltip(a);r===void 0?this.hoverDevice=="pointer"&&this.clearTooltip(!0):this.showTooltip(r,i,s,o)}showTooltip({series:t,datum:e,datumIndex:i},s,n,a){const r=this.getTooltipContent(t,i,e,"tooltip");if(r!=null){const l=Dc.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},t,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,l,r,a)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(t){return this.chart.tooltip.maybeEnterInteractiveTooltip(t,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})}changeHighlightDatum(t){const e=t.previousHighlight?.series,i=t.currentHighlight?.series;e?.properties.cursor&&t.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(e.id),i?.properties.cursor&&i.properties.cursor!=="default"&&t.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),this.hoverDevice==="setState"||i==null||e==null?this.update(Kc.SERIES_UPDATE,{clearCallbackCache:!0}):this.update(Kc.SERIES_UPDATE,{seriesToUpdate:new Set([e,i].filter(Boolean)),clearCallbackCache:!0})}pickNodes(t,e,i){const s=[...this.series].reverse(),n=e==="event"||e==="context-menu",a=e==="tooltip"||e==="highlight-tooltip",r=u=>{if(n)return u.properties.nodeClickRange;if(a)return u.properties.tooltip.range},{x:o,y:l}=t,c=new Set;for(const u of s)u.visible&&u.contentGroup.visible&&r(u)==="area"&&u.isPointInArea?.(o,l)&&c.add(u);const h=c.size>0;let d;for(const u of s){if(!u.visible||!u.contentGroup.visible||h&&!(r(u)==="area"&&c.has(u)))continue;const p=u.pickNodes(t,e,i);if(p==null||p.datums.length===0)continue;const{datums:g,distance:f}=p;if(p.datums.length!==0){if(f===0){d?.distance!==0&&(d={matches:[],distance:0});for(const y of g){const{datumIndex:m}=y;d.matches.push({series:u,datum:y,datumIndex:m})}}else if(d==null||d.distance>f){const[y]=g,{datumIndex:m}=y;d={matches:[{series:u,datum:y,datumIndex:m}],distance:f}}}}return d}isTooltipEnabled(t){return t.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(t,e,i,s){let n;if(s==="aria-label"||this.isTooltipEnabled(t)){const{cachedTooltipContent:a}=this;if(a?.series===t&&a.datumIndex===e)n=a.content;else{const r=this.chart.getTooltipContent(t,e,i,s);this.cachedTooltipContent={series:t,datumIndex:e,content:r},n=r}}else this.cachedTooltipContent=void 0;return n}onActiveLoadMemento(t){switch(t.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(t.activeItem,t);default:return t.activeItem?.type}}onActiveUpdate(t){t?.type==="legend"&&(this.hoverDevice==="setState"&&(this.clearHighlight(),this.clearTooltip()),this.activeState.lastActive="legend")}onActiveClear(){this.pickManager.onClearAPI(),this.hoverDevice="setState",this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.clearAll();else if(this.activeState.lastActive!=="legend"){const{seriesId:t,itemId:e}=this.activeState.lastActive,i=this.findPickedNodes(t,e);i&&(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(t,e){const{seriesId:i,itemId:s}=t,n=this.findPickedNodes(i,s);if(n===void 0)e.reject(),this.onActiveClear();else{const a=this.pickManager.onPickedNodesAPI(n);e.setDatum(a?.datum),this.hoverDevice="setState",this.activeState.lastActive={seriesId:i,itemId:s},e.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(t,e){const i=this.series.find(a=>a.id===t);if(i==null){kv.warn(`Cannot find seriesId: "${t}"`);return}const s=i.findNodeDatum(e);if(s==null){kv.warn(`Cannot find itemId: ${JSON.stringify(e)}`);return}return{matches:[{datum:s,datumIndex:s.datumIndex,series:i}],distance:0}}};Yv.className="SeriesAreaManager";import{SeriesZIndexMap as $v,clamp as j_}from"ag-charts-core";var Kv=30,U_=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}getGroupIndex(t){const{internalId:e,seriesGrouping:i}=t;return i?.groupIndex??e}getGroupType(t,e){return e?"top":t.type}requestGroup(t){const{internalId:e,contentGroup:i}=t,s=t.bringToFront(),n=this.getGroupType(t,s),a=this.getGroupIndex(t),r=this.series.get(e);if(r!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(r)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=Kv?"aggressive-grouping":"normal");let o=this.groups.get(n);o==null&&(o=new Map,this.groups.set(n,o));const l=this.lookupIdx(a);let c=o.get(l);return c==null&&(c={type:n,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new z({name:`${t.contentGroup.name??n}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},o.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t,bringToFront:s}),c.seriesIds.push(e),c.group.appendChild(i),c.group}changeGroup(t){const{internalId:e,contentGroup:i}=t,s=t.bringToFront(),n=this.getGroupType(t,s),a=this.series.get(e),r=a?this.getGroupType(a.seriesConfig,a.bringToFront):void 0,o=this.getGroupIndex(t),l=this.lookupIdx(o),c=this.groups.get(n)?.get(l);if(!(r===n&&c?.seriesIds.includes(e)===!0))return this.series.has(e)&&this._releaseGroup({internalId:e,contentGroup:i,type:r}),this.requestGroup(t)}releaseGroup(t){const{internalId:e,contentGroup:i}=t,s=this.getGroupType(t,t.bringToFront());this._releaseGroup({internalId:e,contentGroup:i,type:s})}_releaseGroup(t){const{internalId:e,contentGroup:i,type:s}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const n=this.series.get(e)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(a=>a!==e),i.remove()),n?.seriesIds.length===0?(n.group.remove(),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(e)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){for(const t of this.groups.values())for(const e of t.values()){const{group:i,seriesIds:s}=e;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)}}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!Number.isFinite(t))?0:Math.floor(j_(0,t/this.expectedSeriesCount,1)*Kv)}destroy(){for(const t of this.groups.values())for(const e of t.values())e.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){let e;for(const i of t){const n=this.series.get(i)?.seriesConfig.contentGroup.zIndex??$v.ANY_CONTENT;if(e==null||n==null){e=n;continue}e=Ym(e,n)<=0?e:n}return e??$v.ANY_CONTENT}};import{BaseProperties as H_,Property as W_}from"ag-charts-core";var Zv=class extends H_{constructor(){super(...arguments),this.dragAction="drag"}};b([W_],Zv.prototype,"dragAction",2);import{ChartUpdateType as Xv,CleanupRegistry as Y_}from"ag-charts-core";var $_=class{constructor(t,e,i,s,n,a){this.chart=t,this.eventsHub=e,this.dataService=i,this.updateService=s,this.zoomManager=n,this.animationManager=a,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new Y_,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",r=>this.onUpdateComplete(r)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.updateService.update(Xv.UPDATE_DATA)}onDataError(){this.updateService.update(Xv.PERFORM_LAYOUT)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(t){!t.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||t.wasShortcut||this.updateWindow(t)}onZoomChange(){this.dirtyZoom=!0}updateWindow(t){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let i,s=!0;if(e){const n=this.zoomManager.getAxisZoom(e.id);i=this.getAxisWindow(e,n),s=this.shouldRefresh(t,e,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e,i){if(t.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(e.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(e.id,i),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||Number.isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*e.min),a=new Date(Number(i[0])+s*e.max);return{min:n,max:a}}};import{CleanupRegistry as K_,setAttribute as Z_}from"ag-charts-core";import{Logger as qv,getWindow as X_}from"ag-charts-core";var q_=/^((?!chrome|android).)*safari/i,J_=/Version\/(\d+(\.\d+)?)/,Q_=/Chrome/,e2=/Chrome\/(\d+)/,t2=/Edg/,i2=/OPR/;function s2(){const{userAgent:t}=X_("navigator");if(q_.test(t)){const e=J_.exec(t);if(e==null)return!1;const i=Number.parseFloat(e[1]),s=Math.floor(i)>16;return s||qv.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!s}else if(Q_.test(t)&&!t2.test(t)&&!i2.test(t)){const e=e2.exec(t);if(e==null)return!1;const i=Number.parseInt(e[1],10),s=i>126;return s||qv.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!s}return!1}var n2=new Set(["map-shape-background","map-line-background"]),a2=class{constructor(t,e,i,s,n,a,r){this.chartLike=t,this.overlays=e,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=a,this.domManager=r,this.cleanup=new K_,this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(vp),this.cleanup.register(this.eventsHub.on("layout:complete",o=>this.onLayoutComplete(o)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!n2.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(vv):this.overlayElem.classList.remove(vv),this.overlayElem.style.left=`${t.x}px`,this.overlayElem.style.top=`${t.y}px`,this.overlayElem.style.width=`${t.width}px`,this.overlayElem.style.height=`${t.height}px`;const n=e,a=!e&&!i,r=i&&!s,o=this.overlays.unsupportedBrowser.enabled&&s2();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),a?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),r?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),o?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||a||r||o;Z_(this.overlayElem,"aria-hidden",!l)}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.chartLike,this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Ii=Em.create(!0,"opts"),Se=class _C extends xy{constructor(e,i){var s;super(),this.id=dT(this),this.seriesRoot=new gt({name:`${this.id}-series-root`,zIndex:Vd.SERIES_LAYER}),this.annotationRoot=new gt({name:`${this.id}-annotation-root`,zIndex:Vd.SERIES_ANNOTATION}),this.titleGroup=new z({name:"titles",zIndex:Vd.SERIES_LABEL}),this.debug=Em.create(!0,"chart"),this.extraDebugStats={},this.data=ar.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new Om,this._requiredRange=0,this._requiredRangeDirection=_n.X,this.chartCaptions=new lc,this.padding=new cT(20),this.keyboard=new ip,this.touch=new Zv,this.mode="standalone",this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this.cleanup=new lT,this.chartAnimationPhase="initial",this.modulesManager=new wP,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=d=>super.fireEvent(d),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new Om,this.performUpdateType=W.NONE,this.runningUpdateType=W.NONE,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new vL,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=su(({count:d})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,d)).catch(u=>Fn.errorOnce(u))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=d=>{this.fireEvent(d)},this.onSeriesNodeDoubleClick=d=>{this.fireEvent(d)},this.onSeriesVisibilityChange=d=>{this.fireEvent(d)},this.seriesGroupingChanged=d=>{if(!(d instanceof Dp))return;const{series:u,seriesGrouping:p}=d;if(u.contentGroup.isRoot())return;const g=this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,bringToFront:()=>u.bringToFront(),renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:p});g!=null&&u.attachSeries(g,this.seriesRoot,this.annotationRoot)},this.chartOptions=e;const n=i?.scene,a=i?.container??e.processedOptions.container??void 0,r=i?.styleContainer??e.specialOverrides.styleContainer,o=e.specialOverrides.skipCss;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const l=new z({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new _i,this.seriesLayerManager=new U_(this.seriesRoot),this.mode=e.userOptions.mode??this.mode,this.styleNonce=e.processedOptions.styleNonce;const c=this.ctx=new c1(this,{chartType:this.getChartType(),scene:n,root:l,container:a,styleContainer:r,skipCss:o,domMode:e.optionMetadata.domMode,withDragInterpretation:e.optionMetadata.withDragInterpretation??!0,syncManager:new y1(this),fireEvent:d=>this.fireEvent(d),updateCallback:(d,u)=>this.update(d,u),updateMutex:this.updateMutex});e.optionMetadata.presetType==="sparkline"&&(c.highlightManager.unhighlightDelay=0,c.tooltipManager.removeDelay=0),this.cleanup.register(c.eventsHub.on("dom:resize",()=>this.parentResize(c.domManager.containerSize))),this.overlays=new cr,(s=this.overlays.loading).renderer??(s.renderer=()=>FP(this.overlays.loading.getText(c.localeManager),c.animationManager.defaultDuration)),this.processors=[new $_(this,c.eventsHub,c.dataService,c.updateService,c.zoomManager,c.animationManager),new a2(this,this.overlays,c.eventsHub,c.dataService,c.localeManager,c.animationManager,c.domManager)],this.highlight=new Qu,this.container=a;const h=this.getModuleContext();this.background=Rm.createBackground?.(h)??new Xa(h),this.foreground=Rm.createForeground?.(h),this.seriesArea=new _o(h),c.domManager.setDataBoolean("animating",!1),c.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new Yv(this.initSeriesAreaDependencies()),this.cleanup.register(c.layoutManager.registerElement(0,d=>{d.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(d)}),c.eventsHub.on("layout:complete",d=>this.chartCaptions.positionAbsoluteCaptions(d)),c.eventsHub.on("data:load",d=>{this.data=new ar(d.data)}),this.title.registerInteraction(h,"beforebegin"),this.subtitle.registerInteraction(h,"beforebegin"),this.footnote.registerInteraction(h,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),Is.addWindowEvent("page-left",()=>this.destroy()),c.animationManager.addListener("animation-frame",()=>{this.update(W.SCENE_RENDER),c.domManager.setDataNumber("animationTimeMs",c.animationManager.getCumulativeAnimationTime())}),c.animationManager.addListener("animation-start",()=>c.domManager.setDataBoolean("animating",!0)),c.animationManager.addListener("animation-stop",()=>{c.domManager.setDataBoolean("animating",!1),c.domManager.setDataNumber("animationTimeMs",c.animationManager.getCumulativeAnimationTime())}),c.eventsHub.on("zoom:change-complete",()=>{for(const u of this.series)u.animationState?.transition("updateData");const d=this.chartAnimationPhase!=="initial";this.update(W.PERFORM_LAYOUT,{forceNodeDataRefresh:!0,skipAnimations:d})})),this.parentResize(c.domManager.containerSize)}static getInstance(e){return _C.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}fireEvent(e){hT(this,this.fireEventWrapper,e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:a,mode:r}=this,o=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(d,u,p,g)=>this.getTooltipContent(d,u,p,g),chartType:o,ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:a,mode:r}}getModuleContext(){return this.ctx}getTooltipContent(e,i,s,n){const r=n==="aria-label"||e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,s):void 0,o=r==null?[]:[r];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const l=e.getCategoryValue(i);return l==null?o:this.series.flatMap(c=>{if(c===e)return o;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const h=c.datumIndexForCategoryValue(l),d=h==null?void 0:c.getTooltipContent(h,void 0);return d==null?[]:[d]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(e,i){for(let s=0;s<this.series.length;s++){const n=this.series[s],a=e.processedOptions.series?.[s];(i.identifiers.has(n.id)||i.indices.has(s))&&a!==void 0&&"visible"in a&&(a.visible=n.visible)}}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(e){if(this.destroyed)return;const i=e?.keepTransferableResources;let s;this.performUpdateType=W.NONE,this.cleanup.flush();for(const n of this.processors)n.destroy();return this.overlays.destroy(),this.modulesManager.destroy(),this.background.destroy(),this.foreground?.destroy(),this.seriesArea.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.destroy(),this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>Fn.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=W.FULL,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:a=this.series,newAnimationBatch:r,apiUpdate:o=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s)for(const c of this.series)c.markNodeDataDirty();for(const c of a)this.seriesToUpdate.add(c);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),r&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(e===W.FULL||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let c=new Error("Stack trace for update tracking").stack??"<unknown>";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}updateSplits(e){const i=this._performUpdateSplits;i[e]??(i[e]=0),i[e]+=performance.now()-this._previousSplit,this._previousSplit=performance.now()}async tryPerformUpdate(e){try{await this.performUpdate(e)}catch(i){Fn.error("update error",i,i.stack)}}async performUpdate(e){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:a}=this,r=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=W.NONE,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<W.SCENE_RENDER&&(a.animationManager.startBatch(this._performUpdateSkipAnimations),a.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",W[i]),this._previousSplit=performance.now(),n.start??(n.start=this._previousSplit),i){case W.FULL:if(this.checkUpdateShortcut(W.FULL))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case W.UPDATE_DATA:if(this.checkUpdateShortcut(W.UPDATE_DATA))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case W.PROCESS_DATA:if(this.checkUpdateShortcut(W.PROCESS_DATA))break;if(await this.processData(),this.seriesAreaManager.dataChanged(),this.pendingLocaleText){const l=this.modulesManager.getModule("locale");l&&"localeText"in l&&(l.localeText=this.pendingLocaleText),this.pendingLocaleText=void 0}this.updateSplits("\u{1F4CA}");case W.PROCESS_DOMAIN:if(this.checkUpdateShortcut(W.PROCESS_DOMAIN))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case W.PROCESS_RANGE:if(this.checkUpdateShortcut(W.PROCESS_RANGE))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case W.PERFORM_LAYOUT:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(W.PERFORM_LAYOUT))break;await this.processLayout(),this.updateSplits("\u2316");case W.PRE_SERIES_UPDATE:if(this.checkUpdateShortcut(W.PRE_SERIES_UPDATE))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case W.SERIES_UPDATE:{if(this.checkUpdateShortcut(W.SERIES_UPDATE))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(r),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case W.PRE_SCENE_RENDER:if(this.checkUpdateShortcut(W.PRE_SCENE_RENDER))break;a.updateService.dispatchPreSceneRender(),this.updateSplits("\u2196");case W.SCENE_RENDER:if(this.checkUpdateShortcut(W.SCENE_RENDER))break;a.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,a.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect,debugColors:this.getDebugColors()}),this.extraDebugStats={};for(const l of Object.keys(n))delete n[l];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case W.NONE:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,a.animationManager.endBatch()}this.destroyed||(a.updateService.dispatchUpdateComplete(this.apiUpdate,this.updateShortcutCount>0),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=W.NONE,this.syncStatus="ready"),this._performUpdateNotify.notify();const o=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:mT(o-n.start),count:e,performUpdateType:W[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let s=i[0],n=!1,{theme:a}=this.chartOptions.processedOptions;for(;typeof a!="string"&&a!=null;)a=a.baseTheme;typeof a=="string"&&(s=a.replace("ag-",e),n=a.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(Fn.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",W[e]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",W[e]),!1)}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}createChartAxes(){return new oc}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const s=i?.filter(n=>!e.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(e.length);for(const n of e){if(i?.includes(n))continue;const a=this.seriesLayerManager.requestGroup(n);n.attachSeries(a,this.seriesRoot,this.annotationRoot),n.chart={},Object.defineProperty(n.chart,"mode",{get:()=>this.mode}),Object.defineProperty(n.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(n.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(n.chart,"seriesRect",{get:()=>this.seriesRect}),n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n)}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){if(e)for(const i of e)i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const i of this.axes){let s=function(n){return n.axes[i.direction]===i};var e=s;i.boundSeries=this.series.filter(s)}}assignAxesToSeries(){for(const e of this.series)for(const i of e.directions){const s=e.getKeyAxis(i)??i,n=this.axes.findById(s);if(!n){Fn.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}e.axes[i]=n}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=e;const{pixelRatio:n}=e;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[a=0,r=0,o=1]=this._lastAutoSize??[];a===i&&r===s&&o===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:a,inHeight:r,inMinWidth:o,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(o??this.minWidth,l??this.minHeight,a??this.width,r??this.height);const h=a??this.width??this._lastAutoSize?.[0],d=r??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:d,pixelRatio:u,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||d==null||!_m(h)||!_m(d))&&s.resize(h,d,u)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1);let g=W.PERFORM_LAYOUT;for(const f of this.axes){const y=f.getUpdateTypeOnResize();y<g&&(g=y)}this.update(g,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}updateData(){this.ctx.eventsHub.emit("data:update",this.data)}async processData(){this.series.some(s=>s.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new Ix(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const s of this.series)i.push(s.processData(e)??Promise.resolve());for(const s of this.modulesManager.modules())s?.processData&&i.push(s.processData(e)??Promise.resolve());this._cachedData=e.execute(this._cachedData),this.updateSplits("\u{1F3ED}"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}processRanges(){var e;const i={},s={},n=new Map;this._requiredRangeDirection=_n.X;for(const a of this.series)a.visible&&(i[e=a.type]??(i[e]=[]),a.getMinimumRangeSeries(i[a.type]),a.resolveKeyDirection(_n.X)===_n.Y&&(this._requiredRangeDirection=_n.Y),n.has(a.type)||n.set(a.type,a));for(const[a,r]of n)s[a]=r.getMinimumRangeChart(i[a]);Object.keys(s).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(s)));for(const a of this.axes)a.requiredRange=this._requiredRange}updateLegends(e){for(const i of Vn.listModulesByType(lo.Plugin))switch(i.name){case"legend":this.setCategoryLegendData(e);break;case"gradientLegend":const s=this.modulesManager.getModule("gradientLegend");s.data=this.series.filter(n=>n.properties.showInLegend).flatMap(n=>n.getLegendData("gradient"));break}}setCategoryLegendData(e){const{legendManager:i,stateManager:s}=this.ctx;if(e)for(const a of this.series){const r=e.find(o=>o.seriesId===a.id);a.onLegendInitialState("category",r)}const n=this.series.flatMap(a=>{const r=a.getLegendData("category");return i.updateData(a.id,r),r});if(e){s.setStateAndRestore(i,e);return}if(this.mode!=="integrated"){const a={},r=new Map(this.series.map(o=>[o.id,o]));for(const{seriesId:o,symbol:{marker:l},label:c}of n.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=r.get(o);if(!h?.hasData)continue;const d=h.type,u=a[d]??(a[d]=new Map);u.has(c.text)?u.get(c.text)!==l.fill&&Fn.warnOnce(`legend item '${yT(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):u.set(c.text,l.fill)}}i.update()}async processLayout(){const e=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const e=this.background.fill;if(e)try{const i=wm.fromString(e),[s]=wm.RGBtoOKLCH(i.r,i.g,i.b);return{background:e,foreground:s>.5?"black":"white"}}catch{return{background:e}}}preSeriesUpdate(){const{_requiredRange:e,seriesRect:i}=this;if(i==null)return;const s=this._requiredRangeDirection===_n.X?i.width:i.height,n=e/s||0;this.ctx.updateService.dispatchPreSeriesUpdate(n,this._requiredRangeDirection)}async updateSeries(e){const{seriesRect:i}=this;function s(n){return n.update({seriesRect:i})}await Promise.all(e.map(s).filter(n=>n!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(n=>n.visible&&n.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e,i){const s=uT("agChartsDebugTimeout");s==null?(e??(e=1e4),i??(i=!1)):(e=s,i??(i=!0));const n=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==W.NONE||this.runningUpdateType!==W.NONE||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==W.NONE||this.runningUpdateType!==W.NONE||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-n>e){const a=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(a);Fn.warnOnce(a)}pT()&&await Fm(),this.ctx.scene.waitingForUpdate()&&await Fm(50)}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){e.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,e.seriesWithUserVisibility);const i=W.PERFORM_LAYOUT,s=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){Ii("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,a=e.processedOptions;Ii("Chart.applyOptions() - applying delta",s);const r=this.applyModules(),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter","displayNullData"];"listeners"in s&&this.registerListeners(this,s.listeners),Bd(this,s,{skip:o});let l=!1,c="no-op";s.series!=null&&(c=this.applySeries(this,s.series,n?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,a,n,c,[])&&(l=!0);const{userDeltaKeys:h}=e,d=h===void 0||h.has("data");if(s.data&&d){const v=s.data,S=e.userOptions.data,M=Array.isArray(v)&&v!==S?v.slice():v;this.data=new ar(M)}if("legend"in s&&s.legend&&"listeners"in s.legend&&this.modulesManager.isEnabled("legend")){const v=s.legend.listeners;v?Object.assign(this.legend.listeners,v):this.legend.listeners.clear()}s.locale?.localeText&&(this.pendingLocaleText=s.locale?.localeText),this.chartOptions=e;const u=this.modulesManager.getModule("navigator"),p=this.modulesManager.getModule("zoom"),g=this.modulesManager.getModule("scrollbar");!u?.enabled&&!p?.enabled&&!g?.enabled&&this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const f=u?.miniChart,y=a.navigator?.miniChart?.series??a.series;f?.enabled===!0&&y!=null?this.applyMiniChartOptions(f,y,a,n):f?.enabled===!1&&(f.series=[],f.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const x=l||r?W.FULL:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(a,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(a),this.ctx.formatManager.setFormatter(a.formatter),Ii("Chart.applyOptions() - update type",W[x],{seriesStatus:c,forceNodeDataRefresh:l}),e.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=e.optionsProcessingTime;const v=performance.now()-e.optionsProcessingTime;this._performUpdateSplits.start=v}this.update(x,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(e){const{activeManager:i,annotationManager:s,chartTypeOriginator:n,historyManager:a,stateManager:r,zoomManager:o}=this.ctx,{initialState:l}=e;if("annotations"in e&&e.annotations?.enabled&&l?.annotations!=null){const c=l.annotations.map(h=>{const d=s.getAnnotationTypeStyles(h.type);return fT(h,d)});r.setState(s,c)}l?.chartType!=null&&r.setState(n,l.chartType),(e.navigator?.enabled||e.zoom?.enabled||e.scrollbar?.enabled)&&l?.zoom!=null&&r.setState(o,l.zoom),l?.active!=null&&r.setState(i,l.active),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&a.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const s=!!e.data||i==="data-change"||i==="replaced",n=["legend","gradientLegend"].some(r=>e[r]!=null),a=e.title!=null&&e.subtitle!=null||e.formatter!=null;return s||n||a}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-count-changed"||s==="series-grouping-change"||s==="updated"&&(e.series?.length!==i.series?.length||!e.series?.every((r,o)=>r.type===i.series?.[o].type)),a=i.legend!=null&&i.legend.enabled!==!1&&(e.legend==null||e.legend.enabled===!1);return n||a}applyMiniChartOptions(e,i,s,n){const a=n?.navigator?.miniChart?.series??n?.series,r=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(a));this.applyAxes(e,s,n,r,["tick","thickness","title","crosshair","gridLine","label"]);const o=e.series;for(const h of o)h.properties.id=void 0;const l=e.axes,c=l.find(h=>h.direction===_n.X);for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,d=h?.label,u=h?.label?.interval;if(c.line.enabled=!1,c.label.set(bT(d,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let g=1;g<p.length;g++)p[g].label.enabled=!1}else(c.type==="time"||c.type==="unit-time"||c.type==="ordinal-time")&&(c.parentLevel.enabled=!1);c.interval.step=u?.step,c.interval.values=u?.values,c.interval.minSpacing=u?.minSpacing,c.interval.maxSpacing=u?.maxSpacing}}applyModules(){const{type:e}=this.constructor;let i=!1;for(const s of Vn.listModulesByType(lo.Plugin)){const n=!s.chartType||s.chartType===e;if(n!==this.modulesManager.isEnabled(s.name)){if(n){const a=s.create(this.getModuleContext());this.modulesManager.addModule(s.name,a),this[s.name]=a}else this.modulesManager.removeModule(s.name),delete this[s.name];i=!0}}return i}initSeriesDeclarationOrder(e){for(let i=0;i<e.length;i++)e[i].setSeriesIndex(i)}applySeries(e,i,s){if(!i)return"no-change";const n=AP(e.series,i,s);if(n.status==="no-overlap"){Ii(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const d=i.map(u=>this.createSeries(u));return this.initSeriesDeclarationOrder(d),e.series=d,"replaced"}Ii("Chart.applySeries() - matchResult",n);const a=[];let r=!1,o=!1,l=!1,c=!1;const h=n.changes.toSorted((d,u)=>d.targetIdx-u.targetIdx);for(const d of h)switch(o||(o=d.status==="series-grouping"),r||(r=d.diff?.data!=null),l||(l=d.status!=="no-op"),c||(c=d.status==="add"||d.status==="remove"),d.status){case"add":{const u=this.createSeries(d.opts);a.push(u),Ii("Chart.applySeries() - created new series",u);break}case"remove":Ii(`Chart.applySeries() - removing series at previous idx ${d.idx}`,d.series);break;case"no-op":a.push(d.series),Ii(`Chart.applySeries() - no change to series at previous idx ${d.idx}`,d.series);break;case"series-grouping":case"update":default:{const{series:u,diff:p,idx:g}=d;Ii(`Chart.applySeries() - applying series diff previous idx ${g}`,p,u),this.applySeriesValues(u,p),u.markNodeDataDirty(),a.push(u)}}return this.initSeriesDeclarationOrder(a),Ii("Chart.applySeries() - final series instances",a),e.series=a,o?"series-grouping-change":c?"series-count-changed":r?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,a=[]){if(!("axes"in i)||!i.axes)return!1;a=["type",...a];const r=i.axes;if(!(n==="replaced")&&e.axes.matches(r)&&NP(s)){for(const c of e.axes){const h=s.axes?.[c.id]??{},d=gT(h,r[c.id]);Ii(`Chart.applyAxes() - applying axis diff idx ${c.id}`,d),Bd(c,d,{skip:a})}return!0}return Ii(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxes(r,a),!0}createSeries(e){const s=Vn.getSeriesModule(e.type).create(this.getModuleContext());return this.applySeriesOptionModules(s,e),this.applySeriesValues(s,e),s}applySeriesOptionModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const a of Vn.listModulesByType(lo.SeriesPlugin))a.name in i&&(a.seriesTypes?.includes(e.type)??!0)&&n.addModule(a.name,a.create(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:a,listeners:r,seriesGrouping:o,showInMiniChart:l,...c}=i;for(const h of Vn.listModulesByType(lo.SeriesPlugin))if(h.name in c){const d=s.getModule(h.name);if(d){const u=c[h.name];d.properties.set(u),delete c[h.name]}}c.visible!=null&&(e.visible=c.visible),e.properties.set(c),"data"in i&&e.setOptionsData(a==null?void 0:ar.wrap(a)),"listeners"in i&&(this.registerListeners(e,r),this.series.includes(e)&&this.addSeriesListeners(e)),"seriesGrouping"in i&&(o==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...o})}createAxes(e,i){const s=this.createChartAxes(),n=this.getModuleContext();for(const[a,r]of Pm(e)){const o=Vn.getAxisModule(r.type).create(n);o.id=a,this.applyAxisModules(o,r),Bd(o,r,{skip:i}),s.push(o)}return IP(s),s}applyAxisModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const a of Vn.listModulesByType(lo.AxisPlugin)){const r=i[a.name]!=null;r!==n.isEnabled(a.name)&&(r?(n.addModule(a.name,a.create(s)),e[a.name]=n.getModule(a.name)):(n.removeModule(a.name),delete e[a.name]))}}registerListeners(e,i){if(e.clearEventListeners(),i&&typeof i=="object")for(const[s,n]of Pm(i))n!=null&&e.addEventListener(s,n)}async applyTransaction(e){await this.updateMutex.acquire(()=>{this.data.addTransaction(e),this.update(W.UPDATE_DATA,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}};Se.className="Chart",Se.chartsInstances=new WeakMap,b([Ws({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),Se.chartsInstances.set(t,this))},oldValue(t){Se.chartsInstances.delete(t)}})],Se.prototype,"container",2),b([Ws({newValue(t){this.resize("width option",{inWidth:t})}})],Se.prototype,"width",2),b([Ws({newValue(t){this.resize("height option",{inHeight:t})}})],Se.prototype,"height",2),b([Ws({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],Se.prototype,"minWidth",2),b([Ws({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],Se.prototype,"minHeight",2),b([Ws({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],Se.prototype,"overrideDevicePixelRatio",2),b([Ys],Se.prototype,"padding",2),b([Ys],Se.prototype,"keyboard",2),b([Ys],Se.prototype,"touch",2),b([Ys],Se.prototype,"mode",2),b([Ys],Se.prototype,"styleNonce",2),b([Fd("chartCaptions.title")],Se.prototype,"title",2),b([Fd("chartCaptions.subtitle")],Se.prototype,"subtitle",2),b([Fd("chartCaptions.footnote")],Se.prototype,"footnote",2),b([Ys],Se.prototype,"formatter",2),b([Ys],Se.prototype,"suppressFieldDotNotation",2),b([Ys],Se.prototype,"loadGoogleFonts",2),b([Ws({changeValue(t,e){this.onAxisChange(t,e)}})],Se.prototype,"axes",2),b([Ws({changeValue(t,e){this.onSeriesChange(t,e)}})],Se.prototype,"series",2);var Qc=Se;import{ActionOnSet as r2,ChartUpdateType as eh,Debug as Lp,ModuleRegistry as o2,deepClone as l2,getDocument as c2}from"ag-charts-core";import{ChartAxisDirection as Ls,Debug as Np,Logger as oi,ModuleRegistry as Rt,ModuleType as Go,deepClone as jo,deepFreeze as h2,distribute as d2,entries as ra,getDocument as u2,getWindow as p2,groupBy as g2,hasRequiredInPath as kp,isArray as f2,isKeyOf as th,isObject as Op,isPlainObject as Jv,isSymbol as m2,joinFormatted as Qv,jsonDiff as eS,jsonPropertyCompare as y2,jsonWalk as wp,mapValues as b2,merge as tS,mergeDefaults as Uo,setDocument as x2,setWindow as v2,shallowClone as ih,unique as S2,validate as Ho}from"ag-charts-core";import{Logger as I2,ModuleRegistry as rs,ModuleType as Di,deepClone as Ep,deepFreeze as Rp,groupBy as D2,isArray as M2,isDefined as iS,isObject as li,unique as A2}from"ag-charts-core";import{BASE_FONT_SIZE as C2,CARTESIAN_AXIS_TYPE as oa,Color as Pp,DEFAULT_ANNOTATION_HANDLE_FILL as T2,DEFAULT_ANNOTATION_STATISTICS_COLOR as L2,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE as N2,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL as k2,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE as O2,DEFAULT_ANNOTATION_STATISTICS_FILL as w2,DEFAULT_ANNOTATION_STATISTICS_STROKE as E2,DEFAULT_CAPTION_ALIGNMENT as sh,DEFAULT_CAPTION_LAYOUT_STYLE as nh,DEFAULT_FIBONACCI_STROKES as R2,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as P2,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as _2,DEFAULT_POLAR_SERIES_STROKE as F2,DEFAULT_SHADOW_COLOUR as V2,DEFAULT_SPARKLINE_CROSSHAIR_STROKE as B2,DEFAULT_TEXTBOX_COLOR as z2,DEFAULT_TEXTBOX_FILL as G2,DEFAULT_TEXTBOX_STROKE as j2,DEFAULT_TEXT_ANNOTATION_COLOR as U2,DEFAULT_TOOLBAR_POSITION as H2,FONT_SIZE_RATIO as ah,IS_DARK_THEME as _p,ModuleRegistry as Fi,ModuleType as on,PALETTE_ALT_DOWN_FILL as W2,PALETTE_ALT_DOWN_STROKE as Y2,PALETTE_ALT_NEUTRAL_FILL as $2,PALETTE_ALT_NEUTRAL_STROKE as K2,PALETTE_ALT_UP_FILL as Z2,PALETTE_ALT_UP_STROKE as X2,PALETTE_DOWN_FILL as q2,PALETTE_DOWN_STROKE as J2,PALETTE_NEUTRAL_FILL as Q2,PALETTE_NEUTRAL_STROKE as eF,PALETTE_UP_FILL as tF,PALETTE_UP_STROKE as iF,POLAR_AXIS_TYPE as rh,deepClone as Fp,deepFreeze as oh,getSequentialColors as sF,groupBy as nF,isArray as aF,jsonWalk as rF,mergeDefaults as Ns}from"ag-charts-core";function sS(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var Ee={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ks={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Vp="white",oF={"radial-gauge":!0,"linear-gauge":!0};function ur(t){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${t}`,{$lessThan:[{$path:`/series/$index/${t}`},1]},!1]}]},{$path:"/series"}]}}function lF(t){return oF[t]===!0}var ci=class Bl{static getDefaultColors(){return{fills:Ee,fillsFallback:Object.values(Ee),strokes:ks,sequentialColors:sF(Ee),divergingColors:[Ee.ORANGE,Ee.YELLOW,Ee.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Pp.interpolate([Pp.fromHexString(Ee.BLUE),Pp.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[Ee.GREEN,Ee.YELLOW,Ee.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Ee.GREEN,stroke:ks.GREEN},down:{fill:Ee.RED,stroke:ks.RED},neutral:{fill:Ee.GRAY,stroke:ks.GRAY},altUp:{fill:Ee.BLUE,stroke:ks.BLUE},altDown:{fill:Ee.ORANGE,stroke:ks.ORANGE},altNeutral:{fill:Ee.GRAY,stroke:ks.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:Vp,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:C2,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},separationLinesColor:{$foregroundBackgroundMix:.17},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"}}}static getAxisDefaults({title:e,time:i}){return Ns(e&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ah.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},i&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},{left:12,right:12,top:8,bottom:8},void 0]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"},border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ah.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:nh,textAlign:sh},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ah.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:nh,textAlign:sh},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:ah.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:nh,textAlign:sh},highlight:{drawingMode:{$if:[{$or:[ur("highlight/highlightedItem/opacity"),ur("highlight/unhighlightedItem/opacity"),ur("highlight/highlightedSeries/opacity"),ur("highlight/unhighlightedSeries/opacity"),ur("fillOpacity"),ur("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:_p,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:_p},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$path:["/tooltip/range","exact"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(e={}){const{overrides:i,palette:s,params:n}=Fp(e),a=this.createChartConfigPerChartType(this.getDefaults()),r={};i&&this.processOverrides(r,i);const{fills:o,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=oh(Ns(s,{fills:Object.values(o),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=sS(s),this.params=Ns(n,this.getPublicParameters()),this.config=oh(Fp(a)),this.overrides=oh(i),this.presets=oh(r)}processOverrides(e,i){for(const s of Fi.listModulesByType(on.Series)){const n=s.name,a=i[n];lF(n)&&(e[n]=a,delete i[n])}}createChartConfigPerChartType(e){var i;for(const s of Fi.listModulesByType(on.Chart))for(const n of Fi.listModulesByType(on.Series))n.chartType===s.name&&(e[i=n.name]??(e[i]=s.themeTemplate));return e}getDefaults(){const e=(n,a)=>{const r={},o=Ns({axes:{}},...Array.from(Fi.listModulesByType(on.Plugin),l=>({[l.name]:l.themeTemplate})),Fi.getChartModule(n)?.themeTemplate,this.getChartDefaults());for(const l of a){r[l]=Ns(hF(l),r[l]??o);const{axes:c}=r[l];for(const h of Fi.listModulesByType(on.Axis))c[h.name]=Ns(c[h.name],!h.chartType||h.chartType===n?cF(h.name):null,Bl.axisDefault[h.name]);(l==="map-shape-background"||l==="map-line-background")&&delete r[l].series.tooltip}return r},i=[...Fi.listModulesByType(on.Series)],s=nF(i,n=>n.chartType||"unknown");return Ns(...Object.keys(s).map(n=>e(n,s[n]?.map(a=>a.name)??[])))}static applyTemplateTheme(e,i,s){if(aF(e))for(let n=0;n<e.length;n++){const a=e[n];typeof a=="symbol"&&s?.has(a)&&(e[n]=s.get(a))}else for(const n of Object.keys(e)){const a=e[n];typeof a=="symbol"&&s?.has(a)&&(e[n]=s.get(a))}}templateTheme(e,i=!0){const s=i?Fp(e):e,n=this.getTemplateParameters();return rF(s,Bl.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Bl.getDefaultColors()}getPublicParameters(){return Bl.getDefaultPublicParameters()}getTemplateParameters(){const e=new Map;e.set(_p,!1),e.set(V2,"#00000080"),e.set(B2,"#aaa"),e.set(nh,"block"),e.set(sh,"center"),e.set(R2,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),e.set(F2,Vp),e.set(_2,Ee.BLUE),e.set(P2,Ee.BLUE),e.set(U2,Ee.BLUE),e.set(T2,Vp),e.set(w2,"#fafafa"),e.set(E2,"#ddd"),e.set(L2,"#000"),e.set(N2,"#181d1f"),e.set(k2,"#e35c5c"),e.set(O2,"#e35c5c"),e.set(G2,"#fafafa"),e.set(j2,"#ddd"),e.set(z2,"#000"),e.set(H2,"top");const i=this.getDefaultColors();return e.set(iF,this.palette.up?.stroke??i.up.stroke),e.set(tF,this.palette.up?.fill??i.up.fill),e.set(J2,this.palette.down?.stroke??i.down.stroke),e.set(q2,this.palette.down?.fill??i.down.fill),e.set(eF,this.palette.neutral?.stroke??i.neutral.stroke),e.set(Q2,this.palette.neutral?.fill??i.neutral.fill),e.set(X2,this.palette.altUp?.stroke??i.up.stroke),e.set(Z2,this.palette.altUp?.fill??i.up.fill),e.set(Y2,this.palette.altDown?.stroke??i.down.stroke),e.set(W2,this.palette.altDown?.fill??i.down.fill),e.set($2,this.palette.altNeutral?.fill??i.altNeutral.fill),e.set(K2,this.palette.altNeutral?.stroke??i.altNeutral.stroke),e}};ci.axisDefault={[oa.NUMBER]:ci.getAxisDefaults({title:!0,time:!1}),[oa.LOG]:ci.getAxisDefaults({title:!0,time:!1}),[oa.CATEGORY]:ci.getAxisDefaults({title:!0,time:!1}),[oa.GROUPED_CATEGORY]:ci.getAxisDefaults({title:!0,time:!1}),[oa.TIME]:ci.getAxisDefaults({title:!0,time:!0}),[oa.UNIT_TIME]:ci.getAxisDefaults({title:!0,time:!0}),[oa.ORDINAL_TIME]:ci.getAxisDefaults({title:!0,time:!0}),[rh.ANGLE_CATEGORY]:ci.getAxisDefaults({title:!1,time:!1}),[rh.ANGLE_NUMBER]:ci.getAxisDefaults({title:!1,time:!1}),[rh.RADIUS_CATEGORY]:ci.getAxisDefaults({title:!0,time:!1}),[rh.RADIUS_NUMBER]:ci.getAxisDefaults({title:!0,time:!1})};var Vi=ci;function cF(t){let e=Fi.getAxisModule(t)?.themeTemplate??{};for(const i of Fi.listModulesByType(on.AxisPlugin))(i.axisTypes?.includes(t)??!0)&&(e=Ns({[i.name]:i.themeTemplate},e));return e}function hF(t){let e=Fi.getSeriesModule(t)?.themeTemplate??{};for(const i of Fi.listModulesByType(on.SeriesPlugin))(i.seriesTypes?.includes(t)??!0)&&(e=Ns({series:{[i.name]:i.themeTemplate}},e));return e}var dF=new Set(["foreground"]);function nS(t){const e=new Map;for(const[h,{type:d}]of an)rs.hasModule(h)||(e.has(d)?e.get(d).add(h):e.set(d,new Set([h])));if(e.size===0)return t;function i(h){const d=e.get(Di.Plugin);if(!(!li(h)||!d))for(const u of d)u in h&&h[u].enabled!==!0&&delete h[u]}function s(h){const d=e.get(Di.SeriesPlugin);if(!(!li(h)||!d))for(const u of d)u in h&&delete h[u]}function n(h){const d=e.get(Di.AxisPlugin);if(!(!li(h)||!d))for(const u of d)u in h&&h[u].enabled!==!0&&delete h[u]}function a(h){if(li(h))for(const d of Object.keys(h)){if(e.get(Di.Axis)?.has(d)){delete h[d];continue}n(h[d])}}function r(h){li(h)&&(a(h.axes),i(h),s(h.series))}const o=Ep(t.config),l=Ep(t.overrides),c=Ep(t.presets);for(const h of Object.keys(o)){if(e.get(Di.Series)?.has(h)){delete o[h];continue}r(o[h])}if(li(l)){const h=l;li(h.common)&&(a(h.common.axes),i(h.common));for(const d of Object.keys(h))if(d!=="common"){if(e.get(Di.Series)?.has(d)){delete h[d];continue}r(h[d])}}if(li(c)){const h=c;for(const d of Object.keys(h)){if(e.get(Di.Preset)?.has(d)||e.get(Di.Series)?.has(d)){delete h[d];continue}i(h[d]),a(h[d]?.axes)}}return Object.create(t,{config:{value:Rp(o),enumerable:!0},overrides:{value:li(l)?Rp(l):l,enumerable:!0},presets:{value:li(c)?Rp(c):c,enumerable:!0}})}function uF(t,e,i){const s=A2(mF(t,e).concat(i));if(!s.length)return;const n=rs.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/r/module-registry/",a=D2(s,r=>r.enterprise?"enterprise":"community");if(s.length){const r=rs.isEnterprise()||a.enterprise?.length?"enterprise":"community";I2.errorOnce(["required modules are not registered. Check if you have registered the modules:","",rs.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":fF(s.map(pF),r),"",`See ${n} for more details.`].join(`
`))}}function pF(t){return t.moduleId??t.name}function aS(t){return` ${t},`}function gF(t,e){return t.length?`import {
${t.map(aS).join(`
`)}
} from 'ag-charts-${e}';`:null}function fF(t,e){const i=gF(["ModuleRegistry"].concat(t),e),s=t.map(aS).join(`
`);return`${i}
ModuleRegistry.registerModules([
${s}
]);`}function mF(t,e){const i=new Map,s="axes"in e&&li(e.axes)?e.axes:{},n=new Set(Object.values(s).map(o=>o?.type).filter(iS)),a=new Set(e.series?.map(o=>o.type).filter(iS));function r(o){i.set(o.name,o)}for(const o of an.values())if(!rs.hasModule(o.name)&&!dF.has(o.name)&&!(t&&o.chartType&&t!==o.chartType))switch(o.type){case"chart":break;case"axis":if(n.has(o.name)){for(const h of Object.keys(s))s?.[h].type===o.name&&delete s[h];r(o)}break;case"series":a.has(o.name)&&(e.series=e.series.filter(h=>h.type!==o.name),r(o));break;case"plugin":const l=o.name,c=e[l];li(c)&&(c.enabled!==!1&&r(o),delete e[l]);break;case"axis:plugin":for(const h of Object.values(s)){const d=o.name;h?.[d]&&(h[d].enabled!==!1&&r(o),delete h[d])}break;case"series:plugin":for(const h of e.series??[])h[o.name]&&(delete h[o.name],r(o));break}for(const o of a){const l=an.get(o);l?.type===Di.Series&&!rs.hasModule(l.name)&&!i.has(l.name)&&(e.series=e.series.filter(c=>c.type!==l.name),r(l))}return Array.from(i.values())}function rS(t,e){const i="axes"in e&&li(e.axes),s="series"in e&&M2(e.series),n=r=>t==null||!r.chartType||r.chartType===t,a=[];for(const r of rs.listModules())if(rs.isModuleType(Di.Plugin,r))n(r)||(delete e[r.name],a.push(r.name));else if(rs.isModuleType(Di.AxisPlugin,r)){if(i&&!n(r)){for(const o of Object.values(e.axes))delete o[r.name];a.push(r.name)}}else if(rs.isModuleType(Di.SeriesPlugin,r)&&s&&!n(r)){for(const o of e.series)delete o[r.name];a.push(r.name)}return a}import{Debug as yF,Logger as oS,arrayOf as lS,boolean as lh,color as ee,colorUnion as bF,fontFamilyFull as cS,fontWeight as Bp,gradientStrict as zp,isObject as hS,mergeDefaults as xF,number as ch,object as dS,or as Wo,simpleMemorize as hi,string as Gp,union as vF,validate as uS}from"ag-charts-core";import{DEFAULT_ANNOTATION_HANDLE_FILL as SF,DEFAULT_ANNOTATION_STATISTICS_COLOR as IF,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE as DF,DEFAULT_ANNOTATION_STATISTICS_FILL as MF,DEFAULT_ANNOTATION_STATISTICS_STROKE as AF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as CF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as TF,DEFAULT_POLAR_SERIES_STROKE as LF,DEFAULT_TEXTBOX_COLOR as NF,DEFAULT_TEXTBOX_FILL as kF,DEFAULT_TEXTBOX_STROKE as OF,DEFAULT_TEXT_ANNOTATION_COLOR as wF,IS_DARK_THEME as EF,getSequentialColors as RF}from"ag-charts-core";var jp="#192232",mt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},la={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},pr=class extends Vi{getDefaultColors(){return{fills:mt,fillsFallback:Object.values(mt),strokes:la,sequentialColors:RF(mt),divergingColors:[mt.ORANGE,mt.YELLOW,mt.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[mt.GREEN,mt.YELLOW,mt.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:mt.GREEN,stroke:la.GREEN},down:{fill:mt.RED,stroke:la.RED},neutral:{fill:mt.GRAY,stroke:la.GRAY},altUp:{fill:mt.BLUE,stroke:la.BLUE},altDown:{fill:mt.ORANGE,stroke:la.ORANGE},altNeutral:{fill:mt.GRAY,stroke:la.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:jp,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},separationLinesColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(EF,!0),t.set(LF,jp),t.set(TF,mt.BLUE),t.set(wF,"#fff"),t.set(CF,mt.BLUE),t.set(SF,jp),t.set(MF,"#28313e"),t.set(AF,"#4b525d"),t.set(IF,"#fff"),t.set(DF,"#fff"),t.set(kF,"#28313e"),t.set(OF,"#4b525d"),t.set(NF,"#fff"),t}constructor(t){super(t)}};import{DEFAULT_CAPTION_ALIGNMENT as PF,DEFAULT_CAPTION_LAYOUT_STYLE as _F,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as FF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as VF,DEFAULT_TOOLBAR_POSITION as BF,getSequentialColors as zF}from"ag-charts-core";var Yt={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ca={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},GF=class extends pr{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Yt},fillsFallback:Object.values({...Yt}),strokes:{...ca},sequentialColors:zF(Yt),divergingColors:[Yt.GREEN,Yt.BLUE,Yt.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Yt.GREEN,stroke:ca.GREEN},down:{fill:Yt.RED,stroke:ca.RED},neutral:{fill:Yt.BLUE,stroke:ca.BLUE},altUp:{fill:Yt.GREEN,stroke:ca.GREEN},altDown:{fill:Yt.RED,stroke:ca.RED},altNeutral:{fill:Yt.GRAY,stroke:ca.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(VF,Yt.BLUE),t.set(FF,Yt.BLUE),t.set(_F,"overlay"),t.set(PF,"left"),t.set(BF,"bottom"),t}};import{DEFAULT_CAPTION_ALIGNMENT as jF,DEFAULT_CAPTION_LAYOUT_STYLE as UF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as HF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as WF,DEFAULT_TOOLBAR_POSITION as YF,getSequentialColors as $F}from"ag-charts-core";var $t={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ha={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},KF=class extends Vi{getDefaultColors(){return{...super.getDefaultColors(),fills:{...$t},fillsFallback:Object.values({...$t}),strokes:{...ha},sequentialColors:$F($t),divergingColors:[$t.GREEN,$t.BLUE,$t.RED],up:{fill:$t.GREEN,stroke:ha.GREEN},down:{fill:$t.RED,stroke:ha.RED},neutral:{fill:$t.BLUE,stroke:ha.BLUE},altUp:{fill:$t.GREEN,stroke:ha.GREEN},altDown:{fill:$t.RED,stroke:ha.RED},altNeutral:{fill:$t.GRAY,stroke:ha.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(WF,$t.BLUE),t.set(HF,$t.BLUE),t.set(UF,"overlay"),t.set(jF,"left"),t.set(YF,"bottom"),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as ZF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as XF,getSequentialColors as qF}from"ag-charts-core";var yt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},da={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},JF=class extends pr{getDefaultColors(){return{...super.getDefaultColors(),fills:yt,fillsFallback:Object.values(yt),strokes:da,sequentialColors:qF(yt),divergingColors:[yt.ORANGE,yt.YELLOW,yt.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[yt.GREEN,yt.YELLOW,yt.RED],up:{fill:yt.GREEN,stroke:da.GREEN},down:{fill:yt.RED,stroke:da.RED},neutral:{fill:yt.GRAY,stroke:da.GRAY},altUp:{fill:yt.BLUE,stroke:da.BLUE},altDown:{fill:yt.RED,stroke:da.RED},altNeutral:{fill:yt.GRAY,stroke:da.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(XF,yt.BLUE),t.set(ZF,yt.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as QF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as eV,getSequentialColors as tV}from"ag-charts-core";var bt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},ua={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},iV=class extends Vi{getDefaultColors(){return{...super.getDefaultColors(),fills:bt,fillsFallback:Object.values(bt),strokes:ua,sequentialColors:tV(bt),divergingColors:[bt.ORANGE,bt.YELLOW,bt.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[bt.GREEN,bt.YELLOW,bt.RED],up:{fill:bt.GREEN,stroke:ua.GREEN},down:{fill:bt.RED,stroke:ua.RED},neutral:{fill:bt.GRAY,stroke:ua.GRAY},altUp:{fill:bt.BLUE,stroke:ua.BLUE},altDown:{fill:bt.RED,stroke:ua.RED},altNeutral:{fill:bt.GRAY,stroke:ua.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(eV,bt.BLUE),t.set(QF,bt.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as sV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as nV,getSequentialColors as aV}from"ag-charts-core";var De={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},pa={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},rV=class extends pr{getDefaultColors(){return{fills:De,fillsFallback:Object.values(De),strokes:pa,sequentialColors:aV(De),divergingColors:[De.BLUE,De.RED],hierarchyColors:[],secondSequentialColors:[De.BLUE,De.PURPLE,De.MAGENTA,De.PINK,De.RED,De.ORANGE,De.YELLOW,De.GREEN],secondDivergingColors:[De.BLUE,De.RED],secondHierarchyColors:[],up:{fill:De.GREEN,stroke:pa.GREEN},down:{fill:De.RED,stroke:pa.RED},neutral:{fill:De.GRAY,stroke:pa.GRAY},altUp:{fill:De.BLUE,stroke:pa.BLUE},altDown:{fill:De.RED,stroke:pa.RED},altNeutral:{fill:De.GRAY,stroke:pa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(nV,De.BLUE),t.set(sV,De.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as oV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as lV,getSequentialColors as cV}from"ag-charts-core";var Me={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},ga={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},hV=class extends Vi{getDefaultColors(){return{...super.getDefaultColors(),fills:Me,fillsFallback:Object.values(Me),strokes:ga,sequentialColors:cV(Me),divergingColors:[Me.BLUE,Me.RED],hierarchyColors:[],secondSequentialColors:[Me.BLUE,Me.PURPLE,Me.MAGENTA,Me.PINK,Me.RED,Me.ORANGE,Me.YELLOW,Me.GREEN],secondDivergingColors:[Me.BLUE,Me.RED],secondHierarchyColors:[],up:{fill:Me.GREEN,stroke:ga.GREEN},down:{fill:Me.RED,stroke:ga.RED},neutral:{fill:Me.GRAY,stroke:ga.GRAY},altUp:{fill:Me.BLUE,stroke:ga.BLUE},altDown:{fill:Me.RED,stroke:ga.RED},altNeutral:{fill:Me.GRAY,stroke:ga.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(lV,Me.BLUE),t.set(oV,Me.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as dV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as uV,getSequentialColors as pV}from"ag-charts-core";var Ue={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},ln={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},gV=class extends pr{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ue,RED:Ue.ORANGE},fillsFallback:Object.values({...Ue,RED:Ue.ORANGE}),strokes:{...ln,RED:ln.ORANGE},sequentialColors:pV({...Ue,RED:Ue.ORANGE}),divergingColors:[Ue.ORANGE,Ue.YELLOW,Ue.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Ue.GREEN,Ue.YELLOW,Ue.ORANGE],up:{fill:Ue.GREEN,stroke:ln.GREEN},down:{fill:Ue.ORANGE,stroke:ln.ORANGE},neutral:{fill:Ue.GRAY,stroke:ln.GRAY},altUp:{fill:Ue.BLUE,stroke:ln.BLUE},altDown:{fill:Ue.ORANGE,stroke:ln.ORANGE},altNeutral:{fill:Ue.GRAY,stroke:ln.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(uV,Ue.BLUE),t.set(dV,Ue.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as fV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as mV,getSequentialColors as yV}from"ag-charts-core";var qe={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Os={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},bV=class extends Vi{getDefaultColors(){return{...super.getDefaultColors(),fills:{...qe,RED:qe.ORANGE},fillsFallback:Object.values({...qe,RED:qe.ORANGE}),strokes:{...Os,RED:Os.ORANGE},sequentialColors:yV({...qe,RED:qe.ORANGE}),divergingColors:[qe.ORANGE,qe.YELLOW,qe.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[qe.GREEN,qe.YELLOW,qe.ORANGE],secondHierarchyColors:[],up:{fill:qe.GREEN,stroke:Os.GREEN},down:{fill:qe.ORANGE,stroke:Os.ORANGE},neutral:{fill:Os.GRAY,stroke:Os.GRAY},altUp:{fill:qe.BLUE,stroke:Os.BLUE},altDown:{fill:qe.ORANGE,stroke:Os.ORANGE},altNeutral:{fill:qe.GRAY,stroke:Os.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(mV,qe.BLUE),t.set(fV,qe.BLUE),t}};import{array as xV,arrayOf as vV,arrayOfDefs as SV,boolean as Bi,callbackOf as IV,color as hh,commonChartOptionsDefs as X,constant as pS,defined as DV,fillOptionsDef as gS,fontOptionsDef as MV,isFunction as AV,isObject as fS,isSymbol as Up,lineDashOptionsDef as CV,linearGaugeSeriesThemeableOptionsDef as mS,linearGaugeTargetOptionsDef as TV,number as ws,numberFormatValidator as LV,optionsDefs as yS,or as fa,positiveNumber as He,radialGaugeSeriesThemeableOptionsDef as bS,radialGaugeTargetOptionsDef as NV,ratio as gr,required as kV,string as dh,strokeOptionsDef as xS,textOrSegments as OV,themeOperator as vS,undocumented as SS,union as fr,unionSymbol as wV,without as U}from"ag-charts-core";import{and as Pt,arrayLength as EV,arrayOf as mr,arrayOfDefs as Hp,attachDescription as uh,boolean as me,borderOptionsDef as RV,callback as PV,callbackDefs as _V,callbackOf as ph,color as cn,constant as yr,date as hn,defined as Wp,fillOptionsDef as IS,fontOptionsDef as Yo,greaterThan as dn,labelBoxOptionsDef as Yp,lessThan as un,lineDashOptionsDef as $p,number as Je,numberFormatValidator as FV,object as VV,optionsDefs as Kp,or as Kt,positiveNumber as ct,positiveNumberNonZero as $o,ratio as zi,required as ma,string as _t,strokeOptionsDef as Zp,textOrSegments as Xp,themeOperator as BV,undocumented as DS,union as Mi}from"ag-charts-core";var gh=Mi("millisecond","second","minute","hour","day","month","year"),MS={unit:ma(gh),step:$o,epoch:hn,utc:me};MS.every=PV;var qp=Kp(MS,"a time interval object"),br={enabled:me,text:_t,padding:Je,border:RV,cornerRadius:Je,...Yo,...IS},Es=uh({enabled:me,type:ma(Mi("line","range")),range:Pt(uh((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),mr(Wp),EV(2,2)),value:Pt(uh((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),Wp),label:br,fill:cn,fillOpacity:zi,...Zp,...$p},"cross-line options"),AS={...Es,label:{...br,position:Mi("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:Je}},pn={enabled:me,rotation:Je,avoidCollisions:me,minSpacing:ct,spacing:ct,formatter:ph(Xp),itemStyler:_V({...Yo,...Yp,spacing:Je}),...Yo,...Yp},fh={autoRotate:me,autoRotateAngle:Je,wrapping:Mi("never","always","hyphenate","on-space"),truncate:me,...pn},CS={format:FV,...fh},mh={format:Kt(_t,VV),...fh},TS={enabled:me,width:ct,size:ct,stroke:cn},Jp={enabled:me,label:mh,tick:TS},LS={values:mr(Wp),minSpacing:ct},xr={reverse:me,gridLine:{enabled:me,width:ct,style:Hp({fill:cn,fillOpacity:ct,stroke:Kt(cn,BV),strokeWidth:ct,lineDash:mr(ct)},"a grid-line style object array")},interval:LS,label:pn,line:{enabled:me,width:ct,stroke:cn},tick:TS,context:()=>!0};xr.layoutConstraints=DS({stacked:ma(me),align:ma(Mi("start","end")),unit:ma(Mi("percent","px")),width:ma(ct)});var gn={...xr,crossAt:{value:ma(Kt(Je,hn,_t,mr(_t))),sticky:me},crossLines:Hp(AS,"a cross-line options array"),position:Mi("top","right","bottom","left"),thickness:ct,maxThicknessRatio:zi,title:{enabled:me,text:Xp,spacing:ct,formatter:ph(Xp),...Yo}};gn.title._enabledFromTheme=DS(me);var yh={enabled:me,...IS,...Zp,...$p};function ya(t,e){const i={enabled:me,xOffset:Je,yOffset:Je,formatter:ph(_t),renderer:ph(Kt(_t,Kp({text:_t,color:cn,backgroundColor:cn,opacity:zi},"crosshair label renderer result object")))};let s;return t&&(s={...i,format:e?Kt(_t,Kp({millisecond:_t,second:_t,hour:_t,day:_t,month:_t,year:_t})):_t}),{enabled:me,snap:me,label:s??i,...Zp,...$p}}function Ko(t,e){return{min:Pt(t,un("max")),max:Pt(t,dn("min")),preferredMin:Pt(t,un("preferredMax"),un("max")),preferredMax:Pt(t,dn("preferredMin"),dn("min")),nice:me,interval:{step:e?Kt($o,gh,qp):$o,values:mr(t),minSpacing:Pt(ct,un("maxSpacing")),maxSpacing:Pt(ct,dn("minSpacing"))}}}var NS={step:Kt($o,gh,qp),values:mr(Kt(Je,hn)),minSpacing:Pt(ct,un("maxSpacing")),maxSpacing:Pt(ct,dn("minSpacing")),placement:Mi("on","between")},vr={...gn,type:yr("category"),label:fh,paddingInner:zi,paddingOuter:zi,groupPaddingInner:zi,crosshair:ya(),bandAlignment:Mi("justify","start","center","end"),bandHighlight:yh,interval:{...LS,placement:Mi("on","between")}},Sr={...gn,type:yr("grouped-category"),label:fh,crosshair:ya(),bandHighlight:yh,paddingInner:zi,groupPaddingInner:zi,depthOptions:Hp({label:{enabled:me,avoidCollisions:me,wrapping:Mi("never","always","hyphenate","on-space"),truncate:me,rotation:Je,spacing:Je,...Yo,...Yp},tick:{enabled:me,stroke:cn,width:ct}},"depth options objects array")},Ir={...gn,...Ko(Je),type:yr("number"),label:CS,crosshair:ya(!0)},Dr={...gn,...Ko(Je),type:yr("log"),base:Pt($o,uh(t=>t!==1,"not equal to 1")),label:CS,crosshair:ya(!0)},Mr={...gn,...Ko(Kt(Je,hn),!0),type:yr("time"),label:mh,parentLevel:Jp,crosshair:ya(!0,!0)},Ar={...gn,type:yr("unit-time"),unit:Kt(qp,gh),label:mh,parentLevel:Jp,paddingInner:zi,paddingOuter:zi,groupPaddingInner:zi,crosshair:ya(!0,!0),bandAlignment:Mi("justify","start","center","end"),bandHighlight:yh,min:Pt(Kt(Je,hn),un("max")),max:Pt(Kt(Je,hn),dn("min")),preferredMin:Pt(Kt(Je,hn),un("preferredMax"),un("max")),preferredMax:Pt(Kt(Je,hn),dn("preferredMin"),dn("min")),interval:NS};import{arrayOfDefs as bh,boolean as kS,callbackOf as OS,constant as Zo,fontOptionsDef as wS,number as os,numberFormatValidator as ES,positiveNumber as RS,ratio as Gi,textOrSegments as xh,union as Xo}from"ag-charts-core";var Cr={...gn,type:Zo("ordinal-time"),paddingInner:Gi,paddingOuter:Gi,groupPaddingInner:Gi,label:mh,parentLevel:Jp,interval:NS,crosshair:ya(!0,!0),bandHighlight:yh,bandAlignment:Xo("justify","start","center","end")},PS={...xr,...Ko(os),type:Zo("angle-number"),crossLines:bh(Es),startAngle:os,endAngle:os,label:{...pn,orientation:Xo("fixed","parallel","perpendicular"),format:ES}},Qp={...xr,type:Zo("angle-category"),shape:Xo("polygon","circle"),crossLines:bh(Es),startAngle:os,endAngle:os,paddingInner:Gi,groupPaddingInner:Gi,label:{...pn,orientation:Xo("fixed","parallel","perpendicular")}};Qp.innerRadiusRatio=Gi;var _S={...xr,...Ko(os),type:Zo("radius-number"),shape:Xo("polygon","circle"),positionAngle:os,innerRadiusRatio:Gi,crossLines:bh({...Es,label:{...br,positionAngle:os}},"cross-line options"),title:{enabled:kS,text:xh,spacing:RS,formatter:OS(xh),...wS},label:{...pn,format:ES}},FS={...xr,type:Zo("radius-category"),positionAngle:os,innerRadiusRatio:Gi,paddingInner:Gi,paddingOuter:Gi,groupPaddingInner:Gi,label:pn,crossLines:bh({...Es,label:{...br,positionAngle:os}},"cross-line options"),title:{enabled:kS,text:xh,spacing:RS,formatter:OS(xh),...wS}};import{boolean as eg,callbackDefs as zV,commonSeriesOptionsDefs as GV,commonSeriesThemeableOptionsDefs as jV,constant as UV,fillOptionsDef as VS,interpolationOptionsDefs as HV,lineDashOptionsDef as BS,markerOptionsDefs as WV,markerStyleOptionsDefs as YV,multiSeriesHighlightOptionsDef as $V,number as KV,required as tg,seriesLabelOptionsDefs as ZV,shadowOptionsDefs as XV,shapeHighlightOptionsDef as zS,shapeSegmentation as qV,string as Rs,strokeOptionsDef as GS,tooltipOptionsDefsWithArea as JV,undocumented as QV}from"ag-charts-core";var jS=$V(zS,zS),eB=zV({...GS,...VS,...BS,marker:YV}),US={showInMiniChart:eg,connectMissingData:eg,interpolation:HV,label:ZV,styler:eB,marker:WV,tooltip:JV,shadow:XV,...jV,...VS,...GS,...BS,highlight:jS,segmentation:qV},ig={...US,...GV,highlight:jS,type:tg(UV("area")),xKey:tg(Rs),yKey:tg(Rs),xKeyAxis:Rs,yKeyAxis:Rs,xName:Rs,yName:Rs,legendItemName:Rs,stacked:eg,stackGroup:Rs,normalizedTo:KV};ig.yFilterKey=QV(Rs);import{barHighlightOptionsDef as HS,boolean as Tr,callback as tB,callbackDefs as iB,commonSeriesOptionsDefs as sB,commonSeriesThemeableOptionsDefs as nB,constant as aB,errorBarOptionsDefs as rB,errorBarThemeableOptionsDefs as oB,fillOptionsDef as WS,lineDashOptionsDef as YS,multiSeriesHighlightOptionsDef as lB,number as $S,positiveNumber as sg,positiveNumberNonZero as cB,ratio as hB,required as ng,seriesLabelOptionsDefs as dB,shadowOptionsDefs as uB,shapeSegmentation as pB,string as Ps,strokeOptionsDef as KS,tooltipOptionsDefs as gB,undocumented as qo,union as ag}from"ag-charts-core";var ZS=lB(HS,HS),XS=iB({...WS,...KS,...YS,cornerRadius:sg}),rg={direction:ag("horizontal","vertical"),showInMiniChart:Tr,cornerRadius:sg,styler:XS,itemStyler:XS,crisp:Tr,label:{...dB,placement:ag("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:sg},errorBar:oB,shadow:uB,tooltip:gB,...nB,highlight:ZS,...WS,...KS,...YS,segmentation:pB,width:cB,widthRatio:hB};rg.sparklineMode=qo(Tr);var Lr={...rg,...sB,highlight:ZS,type:ng(aB("bar")),xKey:ng(Ps),yKey:ng(Ps),xKeyAxis:Ps,yKeyAxis:Ps,xName:Ps,yName:Ps,direction:ag("horizontal","vertical"),grouped:Tr,stacked:Tr,stackGroup:Ps,normalizedTo:$S,legendItemName:Ps,errorBar:rB};Lr.yFilterKey=qo(Ps),Lr.pickOutsideVisibleMinorAxis=qo(Tr),Lr.focusPriority=qo($S),Lr.simpleItemStyler=qo(tB);import{arrayOf as fB,boolean as mB,callbackDefs as yB,commonSeriesOptionsDefs as bB,commonSeriesThemeableOptionsDefs as xB,constant as vB,markerOptionsDefs as qS,multiSeriesHighlightOptionsDef as JS,number as QS,positiveNumber as e0,required as vh,seriesLabelOptionsDefs as SB,shapeHighlightOptionsDef as Sh,string as Ft,tooltipOptionsDefs as IB,undocumented as og,union as DB,without as MB}from"ag-charts-core";var t0={title:Ft,domain:fB(QS),maxSize:e0,showInMiniChart:mB,label:{placement:DB("top","right","bottom","left"),...SB},tooltip:IB,styler:yB({...qS,maxSize:e0}),maxRenderedItems:QS,...xB,...MB(qS,["enabled"]),highlight:JS(Sh,Sh)},Ih={...t0,...bB,type:vh(vB("bubble")),xKey:vh(Ft),yKey:vh(Ft),sizeKey:vh(Ft),labelKey:Ft,xName:Ft,yName:Ft,sizeName:Ft,labelName:Ft,legendItemName:Ft,xKeyAxis:Ft,yKeyAxis:Ft,highlight:JS(Sh,Sh)};Ih.xFilterKey=og(Ft),Ih.yFilterKey=og(Ft),Ih.sizeFilterKey=og(Ft);import{arrayOf as i0,boolean as s0,commonSeriesOptionsDefs as AB,commonSeriesThemeableOptionsDefs as CB,constant as TB,fillOptionsDef as LB,lineDashOptionsDef as NB,multiSeriesHighlightOptionsDef as kB,number as OB,positiveNumber as n0,required as a0,seriesLabelOptionsDefs as wB,shadowOptionsDefs as EB,shapeHighlightOptionsDef as r0,string as Nr,strokeOptionsDef as RB,tooltipOptionsDefs as PB,union as _B}from"ag-charts-core";var o0={showInMiniChart:s0,cornerRadius:n0,label:wB,tooltip:PB,shadow:EB,...CB,...LB,...RB,...NB,highlight:kB(r0,r0),areaPlot:s0,aggregation:_B("count","sum","mean"),bins:i0(i0(OB)),binCount:n0},FB={...AB,...o0,type:a0(TB("histogram")),xKey:a0(Nr),yKey:Nr,xKeyAxis:Nr,yKeyAxis:Nr,xName:Nr,yName:Nr};import{boolean as Jo,callbackDefs as VB,commonSeriesOptionsDefs as BB,commonSeriesThemeableOptionsDefs as zB,constant as GB,errorBarOptionsDefs as jB,errorBarThemeableOptionsDefs as UB,interpolationOptionsDefs as HB,lineDashOptionsDef as l0,lineHighlightOptionsDef as WB,lineSegmentation as YB,markerOptionsDefs as $B,markerStyleOptionsDefs as KB,multiSeriesHighlightOptionsDef as ZB,number as c0,required as lg,seriesLabelOptionsDefs as XB,shapeHighlightOptionsDef as qB,string as ls,strokeOptionsDef as h0,tooltipOptionsDefs as JB,undocumented as Dh}from"ag-charts-core";var d0=ZB(qB,WB),QB=VB({...h0,...l0,marker:KB}),cg={title:ls,showInMiniChart:Jo,connectMissingData:Jo,interpolation:HB,label:XB,styler:QB,marker:$B,tooltip:JB,errorBar:UB,...zB,...h0,...l0,highlight:d0,segmentation:YB};cg.sparklineMode=Dh(Jo);var Qo={...cg,...BB,highlight:d0,type:lg(GB("line")),xKey:lg(ls),yKey:lg(ls),xKeyAxis:ls,yKeyAxis:ls,xName:ls,yName:ls,stacked:Jo,stackGroup:ls,normalizedTo:c0,legendItemName:ls,errorBar:jB};Qo.yFilterKey=Dh(ls),Qo.pickOutsideVisibleMinorAxis=Dh(Jo),Qo.focusPriority=Dh(c0);import{boolean as ez,callbackDefs as tz,commonSeriesOptionsDefs as iz,commonSeriesThemeableOptionsDefs as sz,constant as nz,errorBarOptionsDefs as az,errorBarThemeableOptionsDefs as rz,markerOptionsDefs as u0,multiSeriesHighlightOptionsDef as p0,number as oz,required as hg,seriesLabelOptionsDefs as lz,shapeHighlightOptionsDef as Mh,string as di,tooltipOptionsDefs as cz,undocumented as dg,union as hz,without as dz}from"ag-charts-core";var g0={title:di,showInMiniChart:ez,label:{placement:hz("top","right","bottom","left"),...lz},tooltip:cz,errorBar:rz,styler:tz(u0),maxRenderedItems:oz,...sz,...dz(u0,["enabled"]),highlight:p0(Mh,Mh)},Ah={...g0,...iz,type:hg(nz("scatter")),xKey:hg(di),yKey:hg(di),labelKey:di,xName:di,yName:di,labelName:di,legendItemName:di,xKeyAxis:di,yKeyAxis:di,errorBar:az,highlight:p0(Mh,Mh)};Ah.xFilterKey=dg(di),Ah.yFilterKey=dg(di),Ah.sizeFilterKey=dg(di);import{arrayOfDefs as uz,constant as pz,fontOptionsDef as f0,labelBoxOptionsDef as m0,number as gz,positiveNumber as y0,ratio as b0,required as x0,string as ug,undocumented as fz}from"ag-charts-core";import{arrayOf as kr,boolean as ji,callbackDefs as Ch,callbackOf as v0,color as el,colorUnion as mz,commonSeriesOptionsDefs as yz,commonSeriesThemeableOptionsDefs as bz,constant as xz,fillOptionsDef as S0,fontOptionsDef as tl,labelBoxOptionsDef as Th,lineDashOptionsDef as I0,multiSeriesHighlightOptionsDef as vz,number as Lh,positiveNumber as Ui,ratio as D0,required as M0,shadowOptionsDefs as Sz,shapeHighlightOptionsDef as A0,string as Vt,strokeOptionsDef as C0,textOrSegments as T0,tooltipOptionsDefs as Iz,undocumented as fn,without as L0}from"ag-charts-core";var N0=vz(A0,A0),pg={...bz,radiusMin:Ui,radiusMax:Ui,rotation:Lh,outerRadiusOffset:Lh,outerRadiusRatio:D0,hideZeroValueSectorsInLegend:ji,sectorSpacing:Ui,cornerRadius:Ui,itemStyler:Ch({...S0,...C0,...I0,cornerRadius:Ui}),title:{enabled:ji,text:Vt,showInLegend:ji,spacing:Ui,...tl},calloutLabel:{enabled:ji,offset:Lh,minAngle:Ui,avoidCollisions:ji,formatter:v0(T0),format:Vt,itemStyler:Ch({enabled:ji,...Th,...tl}),...Th,...tl},sectorLabel:{enabled:ji,positionOffset:Lh,positionRatio:D0,formatter:v0(T0),format:Vt,itemStyler:Ch({enabled:ji,...Th,...tl}),...Th,...tl},calloutLine:{colors:kr(el),length:Ui,strokeWidth:Ui,itemStyler:Ch({color:el,length:Ui,strokeWidth:Ui})},fills:kr(mz),strokes:kr(el),tooltip:Iz,shadow:Sz,highlight:N0,...I0,...L0(S0,["fill"]),...L0(C0,["stroke"])},cs={...pg,...yz,type:M0(xz("pie")),angleKey:M0(Vt),radiusKey:Vt,calloutLabelKey:Vt,sectorLabelKey:Vt,legendItemKey:Vt,angleName:Vt,radiusName:Vt,calloutLabelName:Vt,sectorLabelName:Vt,highlight:N0};cs.angleFilterKey=fn(Vt),cs.defaultColorRange=fn(kr(kr(el))),cs.defaultPatternFills=fn(kr(el)),cs.title._enabledFromTheme=fn(ji),cs.calloutLabel._enabledFromTheme=fn(ji),cs.sectorLabel._enabledFromTheme=fn(ji),cs.angleKeyAxis=fn(Vt),cs.radiusKeyAxis=fn(Vt);var k0={...pg,innerRadiusOffset:gz,innerRadiusRatio:b0,innerCircle:{fill:ug,fillOpacity:b0},innerLabels:{spacing:y0,...f0,...m0}},O0={...k0,...cs,type:x0(pz("donut")),innerLabels:uz({text:x0(ug),spacing:y0,...f0,...m0},"inner label options array")};O0.angleFilterKey=fz(ug);import{array as Dz,arrayOf as w0,arrayOfDefs as Mz,boolean as Q,color as E0,fillOptionsDef as Hi,fontOptionsDef as Or,lineDashOptionsDef as gg,optionsDefs as R0,or as Az,positiveNumber as P0,required as _0,string as F0,strokeOptionsDef as Zt,toolbarButtonOptionsDefs as Nh,undocumented as kh,union as hs}from"ag-charts-core";var wr={lineStyle:hs("solid","dashed","dotted"),...gg},ba={...Hi,...Zt,...gg},il={visible:Q,locked:Q,readOnly:Q,handle:ba,...Or},Oh={position:hs("top","center","bottom"),alignment:hs("left","center","right"),...Or},V0={position:hs("top","inside","bottom"),alignment:hs("left","center","right"),...Or},Cz={enabled:Q,cornerRadius:P0,...Or,...Hi,...Zt,...gg},Tz={visible:Q,...wr,...Zt},B0={divider:Zt,...Hi,...Zt,...Or},z0={handle:ba,statistics:B0,...wr,...Hi,...Zt},wh={visible:Q,locked:Q,readOnly:Q,extendStart:Q,extendEnd:Q,handle:ba,text:Oh,...wr,...Zt},fg={visible:Q,locked:Q,readOnly:Q,axisLabel:Cz,handle:ba,text:Oh,...wr,...Zt},G0={visible:Q,locked:Q,readOnly:Q,extendStart:Q,extendEnd:Q,handle:ba,text:V0,background:Hi,...wr,...Zt},j0={...G0},U0={...G0,middle:Tz},mg={label:Or,showFill:Q,isMultiColor:Q,strokes:w0(E0),rangeStroke:E0,bands:hs(4,6,10),...wh},H0={...Hi,...Zt,...il},W0={...Hi,...Zt,...il},Y0={...Hi,...Zt,...il,background:{...Hi,...Zt}},yg={visible:Q,locked:Q,readOnly:Q,handle:ba,...Hi},Eh={visible:Q,locked:Q,readOnly:Q,extendStart:Q,extendEnd:Q,handle:ba,text:Oh,background:Hi,statistics:B0,...wr,...Zt},$0={visible:Q,up:z0,down:z0},Er={enabled:Q,axesButtons:{enabled:Q,axes:hs("x","y","xy")},toolbar:{enabled:Q,padding:P0,buttons:Mz({...Nh,value:hs("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:Q,buttons:w0(Az(R0({...Nh,value:_0(hs("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),R0({...Nh,value:_0(hs("lock")),checkedOverrides:Nh})))}};Er.data=kh(Dz),Er.xKey=kh(F0),Er.volumeKey=kh(F0),Er.snap=kh(Q);import{and as Lz,arrayOf as We,autoSizedLabelOptionsDefs as Rh,barHighlightOptionsDef as mn,boolean as ht,callbackDefs as Ye,color as Wi,colorUnion as xa,commonSeriesThemeableOptionsDefs as Ae,fillOptionsDef as $,highlightOptionsDef as Nz,interpolationOptionsDefs as kz,lessThanOrEqual as Oz,lineDashOptionsDef as H,lineHighlightOptionsDef as Rr,markerOptionsDefs as Ph,markerStyleOptionsDefs as _h,multiSeriesHighlightOptionsDef as ui,numberFormatValidator as K0,positiveNumber as G,positiveNumberNonZero as bg,ratio as pi,seriesLabelOptionsDefs as Qe,shadowOptionsDefs as sl,shapeHighlightOptionsDef as _s,shapeSegmentation as xg,string as Z0,strokeOptionsDef as V,tooltipOptionsDefs as Ce,union as oe,without as gi}from"ag-charts-core";var ds={...$,...V,opacity:pi},X0={...$,...V,...H,cornerRadius:G,whisker:{...V,...H},cap:{lengthRatio:pi}},q0={...X0,opacity:pi},J0=Ye({...$,...V,...H,cornerRadius:G,whisker:{...V,...H},cap:{lengthRatio:pi}}),Q0={direction:oe("horizontal","vertical"),showInMiniChart:ht,styler:J0,itemStyler:J0,tooltip:Ce,...Ae,...X0,highlight:ui(q0,q0),segmentation:xg,width:bg,widthRatio:pi},vg={cornerRadius:G,wick:{...V,...H},...$,...V,...H},eI={...vg,opacity:pi},tI={item:{up:vg,down:vg},itemStyler:Ye({...$,...V,...H,cornerRadius:G,wick:{...V,...H}}),showInMiniChart:ht,tooltip:Ce,...Ae,highlight:ui(eI,eI)},iI={fills:We(xa),strokes:We(Wi),label:{spacing:G,maxWidth:G,...Qe},link:{tension:pi,itemStyler:Ye({...$,...V,...H,tension:pi}),...$,...V,...H},node:{width:G,spacing:G,itemStyler:Ye({...$,...V,...H}),...$,...V,...H},tooltip:Ce,...Ae},sI={direction:oe("horizontal","vertical"),fills:We(xa),strokes:We(Wi),label:{spacing:G,placement:oe("before","middle","after"),...Qe},stageLabel:{placement:oe("before","after"),format:K0,...pn},tooltip:Ce,...gi(Ae,["showInLegend"]),...gi($,["fill"]),...gi(V,["stroke"]),...H,highlight:Nz(Rr)},nI={direction:oe("horizontal","vertical"),fills:We(xa),strokes:We(Wi),itemStyler:Ye({...$,...V,...H}),spacingRatio:pi,crisp:ht,dropOff:{enabled:ht,...$,...V,...H},stageLabel:{placement:oe("before","after"),format:K0,...pn},label:Qe,tooltip:Ce,shadow:sl,...gi(Ae,["showInLegend"]),...gi($,["fill"]),...gi(V,["stroke"]),...H},aI={title:Z0,textAlign:oe("left","center","right"),verticalAlign:oe("top","middle","bottom"),itemPadding:G,itemStyler:Ye({...$,...V}),showInMiniChart:ht,label:Rh,tooltip:Ce,...Ae,...V},rI={showInMiniChart:ht,itemStyler:Ye({...V,...H}),item:{up:{...V,...H},down:{...V,...H}},tooltip:Ce,...Ae,highlight:ui(Rr,Rr)},oI={maxStrokeWidth:G,itemStyler:Ye({...V,...H}),sizeDomain:We(G),label:Qe,tooltip:Ce,...Ae,...V,...H,highlight:ui(Rr,Rr)},lI={...V,...H},cI={colorRange:We(Wi),maxSize:G,sizeDomain:We(G),label:{placement:oe("top","bottom","left","right"),...Qe},tooltip:Ce,...Ae,...gi(Ph,["enabled"]),highlight:ui(_s,_s)},hI={colorRange:We(Wi),padding:G,itemStyler:Ye({...$,...V,...H}),label:Rh,tooltip:Ce,...Ae,...$,...V,...H,highlight:ui(_s,_s)},dI={...Ae,...$,...V,...H},Pr=Ye({...$,...V,...H,cornerRadius:G}),uI={cornerRadius:G,styler:Pr,itemStyler:Pr,label:Qe,tooltip:Ce,...Ae,...$,...V,...H,highlight:ui(mn,mn)},pI={direction:oe("horizontal","vertical"),aspectRatio:G,spacing:G,reverse:ht,itemStyler:Ye({...$,...V,...H}),fills:We(xa),strokes:We(Wi),label:Qe,stageLabel:{spacing:G,placement:oe("before","after"),...Qe},tooltip:Ce,shadow:sl,...Ae,...gi($,["fill"]),...gi(V,["stroke"]),...H},gI={connectMissingData:ht,marker:Ph,styler:Ye({marker:_h,...$,...V,...H}),label:Qe,tooltip:Ce,...Ae,...$,...V,...H,highlight:ui(_s,_s)},fI={connectMissingData:ht,marker:Ph,styler:Ye({marker:_h,...V,...H}),label:Qe,tooltip:Ce,...Ae,...V,...H,highlight:ui(_s,Rr)},mI={cornerRadius:G,styler:Pr,itemStyler:Pr,label:Qe,tooltip:Ce,...Ae,...$,...V,...H,highlight:ui(mn,mn)},yI={cornerRadius:G,columnWidthRatio:pi,maxColumnWidthRatio:pi,styler:Pr,itemStyler:Pr,label:Qe,tooltip:Ce,...Ae,...$,...V,...H,highlight:ui(mn,mn)},wz={marker:Ph,...V,...H},bI={marker:{enabled:ht,..._h},...V,...H},xI={marker:_h,...V,...H},vI={showInMiniChart:ht,connectMissingData:ht,interpolation:kz,label:{...Qe,placement:oe("inside","outside"),spacing:G},tooltip:Ce,shadow:sl,...Ae,...$,...wz,item:{low:{...bI},high:{...bI}},styler:Ye({...$,item:{low:{...xI},high:{...xI}}}),highlight:ui(_s,_s),segmentation:xg,invertedStyle:{enabled:ht,...$}},SI=Ye({...$,...V,...H,cornerRadius:G}),II={direction:oe("horizontal","vertical"),grouped:ht,showInMiniChart:ht,cornerRadius:G,styler:SI,itemStyler:SI,label:{...Qe,placement:oe("inside","outside"),spacing:G},tooltip:Ce,shadow:sl,...Ae,...$,...V,...H,highlight:ui(mn,mn),segmentation:xg,width:bg,widthRatio:pi},DI={fills:We(xa),strokes:We(Wi),label:{...Qe,spacing:G,placement:oe("left","right","center"),edgePlacement:oe("inside","outside")},link:{itemStyler:Ye({...$,...V,...H}),...$,...V,...H},node:{width:G,spacing:G,minSpacing:Lz(G,Oz("spacing")),alignment:oe("left","center","right","justify"),verticalAlignment:oe("top","bottom","center"),sort:oe("data","ascending","descending","auto"),itemStyler:Ye({...$,...V,...H}),...$,...V,...H},tooltip:Ce,...Ae},MI={fills:We(xa),strokes:We(Wi),colorRange:We(Wi),sectorSpacing:G,cornerRadius:G,padding:G,itemStyler:Ye({...$,...V}),label:{spacing:G,...Rh},secondaryLabel:Rh,tooltip:Ce,...gi(Ae,["highlight","showInLegend"]),...gi($,["fill"]),...gi(V,["stroke"]),highlight:{highlightedItem:ds,highlightedBranch:ds,unhighlightedItem:ds,unhighlightedBranch:ds}},AI={fills:We(xa),strokes:We(Wi),colorRange:We(Wi),itemStyler:Ye({...$,...V}),group:{gap:G,padding:G,cornerRadius:G,textAlign:oe("left","center","right"),interactive:ht,highlight:{highlightedItem:ds,unhighlightedItem:ds},label:{...Qe,spacing:G},...$,...V},tile:{gap:G,padding:G,cornerRadius:G,textAlign:oe("left","center","right"),verticalAlign:oe("top","middle","bottom"),label:{...Qe,spacing:G,lineHeight:G,minimumFontSize:G,wrapping:oe("never","always","hyphenate","on-space"),overflowStrategy:oe("ellipsis","hide")},secondaryLabel:{...Qe,lineHeight:G,minimumFontSize:G,wrapping:oe("never","always","hyphenate","on-space"),overflowStrategy:oe("ellipsis","hide")},highlight:{highlightedItem:ds,highlightedBranch:ds,unhighlightedItem:ds,unhighlightedBranch:ds},...$,...V},tooltip:Ce,...gi(Ae,["highlight","showInLegend"])},Sg={name:Z0,cornerRadius:G,itemStyler:Ye({...$,...V,...H,cornerRadius:G}),label:{...Qe,placement:oe("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:G},tooltip:Ce,shadow:sl,...$,...V,...H},CI={direction:oe("horizontal","vertical"),showInMiniChart:ht,item:{positive:Sg,negative:Sg,total:Sg},line:{enabled:ht,...V,...H},tooltip:Ce,width:bg,widthRatio:pi,...Ae},Fh=yS({__type:kV(pS("date")),value:fa(dh,ws)},"a serializable date object"),TI={width:He,height:He,grip:Bi,fill:hh,stroke:hh,strokeWidth:He,cornerRadius:He},te={enabled:Bi,height:He,spacing:He,cornerRadius:ws,mask:{fill:hh,fillOpacity:gr,stroke:hh,strokeWidth:He},minHandle:TI,maxHandle:TI,miniChart:{enabled:Bi,padding:{top:He,bottom:He},label:{enabled:Bi,avoidCollisions:Bi,spacing:He,format:LV,formatter:IV(OV),interval:{minSpacing:He,maxSpacing:He,values:xV,step:ws},...MV},series:DV}},Ig={...gS,...xS,...CV,cornerRadius:He,opacity:gr},LI={...Ig,minSize:He,hoverStyle:{fill:gS.fill,stroke:xS.stroke}},NI={enabled:Bi,thickness:He,spacing:He,tickSpacing:He,visible:fr("auto","always","never"),placement:fr("outer","inner"),track:Ig,thumb:LI},Ez={...NI,position:fr("top","bottom")},Rz={...NI,position:fr("left","right")},Lt={enabled:Bi,thickness:He,spacing:He,tickSpacing:He,visible:fr("auto","always","never"),placement:fr("outer","inner"),track:Ig,thumb:LI,horizontal:Ez,vertical:Rz},va=U(AS,["type","value","range"]),Nt={number:{...U(Ir,["type","crossLines"]),top:U(Ir,["type","crossLines","position"]),right:U(Ir,["type","crossLines","position"]),bottom:U(Ir,["type","crossLines","position"]),left:U(Ir,["type","crossLines","position"]),crossLines:va},log:{...U(Dr,["type","crossLines"]),top:U(Dr,["type","crossLines","position"]),right:U(Dr,["type","crossLines","position"]),bottom:U(Dr,["type","crossLines","position"]),left:U(Dr,["type","crossLines","position"]),crossLines:va},category:{...U(vr,["type","crossLines"]),top:U(vr,["type","crossLines","position"]),right:U(vr,["type","crossLines","position"]),bottom:U(vr,["type","crossLines","position"]),left:U(vr,["type","crossLines","position"]),crossLines:va},time:{...U(Mr,["type","crossLines"]),top:U(Mr,["type","crossLines","position"]),right:U(Mr,["type","crossLines","position"]),bottom:U(Mr,["type","crossLines","position"]),left:U(Mr,["type","crossLines","position"]),crossLines:va},"unit-time":{...U(Ar,["type","crossLines"]),top:U(Ar,["type","crossLines","position"]),right:U(Ar,["type","crossLines","position"]),bottom:U(Ar,["type","crossLines","position"]),left:U(Ar,["type","crossLines","position"]),crossLines:va},"grouped-category":{...U(Sr,["type"]),top:U(Sr,["type","position"]),right:U(Sr,["type","position"]),bottom:U(Sr,["type","position"]),left:U(Sr,["type","position"]),crossLines:va},"ordinal-time":{...U(Cr,["type","crossLines"]),top:U(Cr,["type","crossLines","position"]),right:U(Cr,["type","crossLines","position"]),bottom:U(Cr,["type","crossLines","position"]),left:U(Cr,["type","crossLines","position"]),crossLines:va}},_r={"angle-category":{...U(Qp,["type","crossLines"]),crossLines:U(Es,["type"])},"angle-number":{...U(PS,["type","crossLines"]),crossLines:U(Es,["type"])},"radius-category":{...U(FS,["type","crossLines"]),crossLines:{...U(Es,["type"]),label:{...br,positionAngle:ws}}},"radius-number":{...U(_S,["type","crossLines"]),crossLines:{...U(Es,["type"]),label:{...br,positionAngle:ws}}}},ie={visible:SS(Bi)},Pz={common:{...X,navigator:te,scrollbar:Lt,axes:{...Nt,..._r},annotations:{...Er,line:wh,"horizontal-line":fg,"vertical-line":fg,"disjoint-channel":j0,"parallel-channel":U0,"fibonacci-retracement":mg,"fibonacci-retracement-trend-based":mg,callout:H0,comment:W0,note:Y0,text:il,arrow:wh,"arrow-up":yg,"arrow-down":yg,"date-range":Eh,"price-range":Eh,"date-price-range":Eh,"quick-date-price-range":$0},chartToolbar:{enabled:Bi},initialState:{legend:SV({visible:Bi,seriesId:dh,itemId:dh,legendItemName:dh},"legend state array"),zoom:{rangeX:{start:fa(ws,Fh),end:fa(ws,Fh)},rangeY:{start:fa(ws,Fh),end:fa(ws,Fh)},ratioX:{start:gr,end:gr},ratioY:{start:gr,end:gr},autoScaledAxes:vV(pS("y"))}}},line:{...X,axes:Nt,series:cg,navigator:te,scrollbar:Lt,...ie},scatter:{...X,axes:Nt,series:g0,navigator:te,scrollbar:Lt,...ie,paired:SS(Bi)},bubble:{...X,axes:Nt,series:t0,navigator:te,scrollbar:Lt,...ie},area:{...X,axes:Nt,series:US,navigator:te,scrollbar:Lt,...ie},bar:{...X,axes:Nt,series:rg,navigator:te,scrollbar:Lt,...ie},"box-plot":{...X,axes:Nt,series:Q0,navigator:te,scrollbar:Lt,...ie},candlestick:{...X,axes:Nt,series:tI,navigator:te,scrollbar:Lt,...ie},"cone-funnel":{...X,axes:Nt,series:sI,navigator:te,scrollbar:Lt,...ie},funnel:{...X,axes:Nt,series:nI,navigator:te,scrollbar:Lt,...ie},ohlc:{...X,axes:Nt,series:rI,navigator:te,scrollbar:Lt,...ie},histogram:{...X,axes:U(Nt,["category","grouped-category","unit-time","ordinal-time"]),series:o0,navigator:te,scrollbar:Lt,...ie},heatmap:{...X,axes:Nt,series:aI,navigator:te,scrollbar:Lt,...ie},waterfall:{...X,axes:Nt,series:CI,navigator:te,scrollbar:Lt,...ie},"range-bar":{...X,axes:Nt,series:II,navigator:te,scrollbar:Lt,...ie},"range-area":{...X,axes:Nt,series:vI,navigator:te,scrollbar:Lt,...ie},donut:{...X,series:k0,navigator:te,...ie},pie:{...X,series:pg,navigator:te,...ie},"radar-line":{...X,axes:_r,series:fI,navigator:te,...ie},"radar-area":{...X,axes:_r,series:gI,navigator:te,...ie},"radial-bar":{...X,axes:_r,series:mI,navigator:te,...ie},"radial-column":{...X,axes:_r,series:yI,navigator:te,...ie},nightingale:{...X,axes:_r,series:uI,navigator:te,...ie},sunburst:{...X,series:MI,navigator:te,...ie},treemap:{...X,series:AI,navigator:te,...ie},"map-shape":{...X,series:hI,navigator:te,...ie},"map-line":{...X,series:oI,navigator:te,...ie},"map-marker":{...X,series:cI,navigator:te,...ie},"map-shape-background":{...X,series:dI,navigator:te,...ie},"map-line-background":{...X,series:lI,navigator:te,...ie},sankey:{...X,series:DI,navigator:te,...ie},chord:{...X,series:iI,navigator:te,...ie},pyramid:{...X,series:pI,navigator:te,...ie},"radial-gauge":{...X,...bS,targets:U(NV,["value"]),tooltip:{...bS.tooltip,...X.tooltip}},"linear-gauge":{...X,...mS,targets:U(TV,["value"]),tooltip:{...mS.tooltip,...X.tooltip}}};function Vh(t,e){const i={};for(const s of Reflect.ownKeys(t))i[s]=e(t[s],s,t);return i}var _z=Vh(Pz,function t(e,i){if(Up(i))return e;if(AV(e))return fa(e,vS,Up);if(fS(e))return fa(yS(wV in e?Vh(e,s=>fS(s)?Vh(s,t):s):Vh(e,t)),vS,Up);throw new Error(`Invalid theme override value: ${String(e)}`)});import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as Fz,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as Vz,getSequentialColors as Bz}from"ag-charts-core";var xt={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Sa={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},zz=class extends pr{getDefaultColors(){return{fills:xt,fillsFallback:Object.values(xt),strokes:Sa,sequentialColors:Bz(xt),divergingColors:[xt.ORANGE,xt.YELLOW,xt.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[xt.GREEN,xt.YELLOW,xt.RED],secondHierarchyColors:[],up:{fill:xt.GREEN,stroke:Sa.GREEN},down:{fill:xt.RED,stroke:Sa.RED},neutral:{fill:xt.GRAY,stroke:Sa.GRAY},altUp:{fill:xt.BLUE,stroke:Sa.BLUE},altDown:{fill:xt.ORANGE,stroke:Sa.ORANGE},altNeutral:{fill:xt.GRAY,stroke:Sa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Vz,xt.BLUE),t.set(Fz,xt.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as Gz,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as jz,getSequentialColors as Uz}from"ag-charts-core";var vt={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ia={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},Hz=class extends Vi{getDefaultColors(){return{...super.getDefaultColors(),fills:vt,fillsFallback:Object.values(vt),strokes:Ia,sequentialColors:Uz(vt),divergingColors:[vt.ORANGE,vt.YELLOW,vt.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[vt.GREEN,vt.YELLOW,vt.RED],secondHierarchyColors:[],up:{fill:vt.GREEN,stroke:Ia.GREEN},down:{fill:vt.RED,stroke:Ia.RED},neutral:{fill:vt.GRAY,stroke:Ia.GRAY},altUp:{fill:vt.BLUE,stroke:Ia.BLUE},altDown:{fill:vt.ORANGE,stroke:Ia.ORANGE},altNeutral:{fill:vt.GRAY,stroke:Ia.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(jz,vt.BLUE),t.set(Gz,vt.BLUE),t}},Dg=hi(()=>new Vi),Wz=yF.create(!0,"perf"),Yi=(t,e,i)=>{Wz("[CACHE] ChartTheme",t,e.name,i)},Mg={"ag-default-dark":hi(()=>new pr),"ag-sheets-dark":hi(()=>new gV,Yi),"ag-polychroma-dark":hi(()=>new rV,Yi),"ag-vivid-dark":hi(()=>new zz,Yi),"ag-material-dark":hi(()=>new JF,Yi),"ag-financial-dark":hi(()=>new GF,Yi),"ag-default":Dg,"ag-sheets":hi(()=>new bV,Yi),"ag-polychroma":hi(()=>new hV,Yi),"ag-vivid":hi(()=>new Hz,Yi),"ag-material":hi(()=>new iV,Yi),"ag-financial":hi(()=>new KF,Yi)},Bh=hi(Yz,Yi);function Yz(t){if(t instanceof Vi)return t;if(!Xz(t))return Dg();if(t==null||typeof t=="string"){const n=Mg[t??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${t}\`.`)}const{cleared:e,invalid:i}=uS($z(t),Kz,"theme");for(const n of i)oS.warnOnce(String(n));const s=e?.baseTheme?Bh(e.baseTheme):Dg();return e?new s.constructor(e):s}function $z(t){if(!hS(t)||!hS(t.baseTheme))return t;let e=t,i,s;const n=[];for(;typeof e=="object";)i??(i=e.palette),s??(s=e.params),e.overrides&&n.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:xF(...n),params:s,palette:i}}var Kz={baseTheme:Wo(Gp,dS),overrides:_z,params:{accentColor:ee,axisColor:ee,backgroundColor:ee,borderColor:ee,borderRadius:ch,chartBackgroundColor:ee,chartPadding:ch,focusShadow:Gp,foregroundColor:ee,fontFamily:cS,fontSize:ch,fontWeight:Bp,gridLineColor:ee,popupShadow:Gp,subtleTextColor:ee,textColor:ee,separationLinesColor:ee,chromeBackgroundColor:ee,chromeFontFamily:cS,chromeFontSize:ch,chromeFontWeight:Bp,chromeSubtleTextColor:ee,chromeTextColor:ee,buttonBackgroundColor:ee,buttonBorder:lh,buttonFontWeight:Bp,buttonTextColor:ee,inputBackgroundColor:ee,inputBorder:lh,inputTextColor:ee,menuBackgroundColor:ee,menuBorder:lh,menuTextColor:ee,panelBackgroundColor:ee,panelSubtleTextColor:ee,tooltipBackgroundColor:ee,tooltipBorder:lh,tooltipTextColor:ee,tooltipSubtleTextColor:ee,crosshairLabelBackgroundColor:ee,crosshairLabelTextColor:ee},palette:{fills:lS(bF),strokes:lS(ee),up:{fill:Wo(ee,zp),stroke:ee},down:{fill:Wo(ee,zp),stroke:ee},neutral:{fill:Wo(ee,zp),stroke:ee}}},Zz=vF("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function Xz(t){const{invalid:e}=uS({theme:t},{theme:Wo(Zz,dS)});for(const i of e)oS.warnOnce(String(i));return e.length===0}import{AdjacencyListGraph as qz,Debug as Jz,ModuleRegistry as Qz,isObject as nl,isObjectLike as kI,isPlainObject as eG,pick as Ag,simpleMemorize as tG,without as Da}from"ag-charts-core";import{Color as fi,Debug as Ma,Logger as Aa,ModuleRegistry as iG,circularSliceArray as us,isArray as sG,isGradientFill as OI,isImageFill as nG,isNumber as aG,isObjectLike as rG,isPatternFill as oG,isPlainObject as al,isString as Fr,without as lG}from"ag-charts-core";import{isNumber as cG,isObjectLike as hG}from"ag-charts-core";var ye="path",Ai="pathArray",ue="default",Xt="override",St="user",yn="userPartial",ps="operation",gs="operationValue",Vr="dependency",Cg="autoEnable",wI="autoEnableValue",EI="prune",RI="childrenSource";function Tg(t){return cG(t)&&t>=0&&t<=1}function rl(t,e){let i=t;for(const s of e){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return!1;i=i[s]}return!0}function dt(t,e){let i=t;for(const s of e){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function Br(t,e,i){const s=e.length;if(s===0)return;let n=t;const a=s-1,r=e[a];for(let o=0;o<a;o++){const l=e[o],c=e[o+1];let h=n[l];(h==null||!hG(h))&&(h=Number.isNaN(Number(c))?{}:[],n[l]=h),n=h}n[r]=i}var dG=/^\d+$/;function uG(t,e=0){let i=0;for(let s=t.length-1;s>=0;s--){const n=t[s];if(dG.test(n)&&(i++,i>e))return s}return-1}function zr(t,e=0){const i=uG(t,e);return Number(t[i])}function Ca(t,e,i){const s=e.split("/");let n=[...t];e.startsWith("/")&&(n=[],s.shift());let a=!1;for(const r of s){if(r==="..")n.pop(),a||n.pop();else if(r===".")n.pop();else if(r==="$index"){const o=zr(t);if(Number.isNaN(o))return fs;n.push(`${o}`)}else if(r==="$prevIndex"){const o=zr(t);if(Number.isNaN(o)||Number(o)<=0)return fs;n.push(`${Number(o)-1}`)}else if(r.startsWith("$")){const o=i?.[r.slice(1)];if(o==null)return fs;n.push(o)}else r.length!==0&&n.push(r);a=r===".."}return n}var fs=Symbol("unresolvable-path"),qt=Symbol("resolved-to-branch");function ol(t,e){if(t==null||typeof t!="object"||Array.isArray(t)||(e??(e=Object.keys(t)),e.length===0))return;const i=e[0];if(VI.has(i))return{operation:i,values:Array.isArray(t[i])?t[i]:[t[i]]}}function pG(t,e,i){const s=ol(t.getVertexValue(i));switch(s?.operation){case"$path":{const[n]=s.values,a=t.getPathArray(e),r=Ca(a,n);return r===fs?void 0:t.findVertexAtPath(r)}case"$value":return e}}var gG={$cacheMax:fG};function fG(t,e,i){const[s]=i,n=t.getPathArray(e),a=t.getCachedValue(n,"$cacheMax"),r=t.resolveVertexValue(e,s);if(typeof r!="number")return a;if(typeof a!="number")return t.setCachedValue(n,"$cacheMax",r),r;const o=Math.max(a,r);return t.setCachedValue(n,"$cacheMax",o),o}var mG={$hasSeriesType:{dependencies:Lg,resolve:yG},$isChartType:{dependencies:Lg,resolve:xG},$isSeriesType:{dependencies:Lg,resolve:bG}};function Lg(t,e,i){const s=t.findVertexAtPath(["series","0","type"]);s&&t.addEdge(e,s,Vr)}function yG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getResolvedPath(["series"]);if(!Array.isArray(a))return!1;for(const r of a)if(r.type===n)return!0;return!1}function bG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return t.getResolvedPath(["series","0","type"])===n}function xG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getResolvedPath(["series","0","type"]);if(typeof a!="string")return!1;const r=iG.getSeriesModule(a);if(r==null)return!1;switch(n){case"cartesian":return r.chartType==="cartesian";case"polar":return r.chartType==="polar";case"standalone":return r.chartType==="standalone"}return!1}var vG={$foregroundBackgroundMix:SG,$foregroundOpacity:IG,$interpolate:DG,$isGradient:MG,$isImage:AG,$isPattern:CG,$mix:TG};function SG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getParamValue("foregroundColor"),r=t.getParamValue("backgroundColor");if(typeof a=="string"&&typeof r=="string"&&Tg(n))return fi.mix(fi.fromString(a),fi.fromString(r),1-n).toString();Ma.inDevelopmentMode(()=>Aa.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function IG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getParamValue("foregroundColor");if(typeof a=="string"&&Tg(n)){const r=fi.fromString(a);return new fi(r.r,r.g,r.b,n).toString()}Ma.inDevelopmentMode(()=>Aa.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function DG(t,e,i){const[s,n]=i,a=t.resolveVertexValue(e,s),r=t.resolveVertexValue(e,n);if(!(!sG(a)||!aG(r)))return fi.interpolate(a.map(o=>fi.fromString(o)),r).map(o=>o.toString())}function MG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return OI(n)}function AG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return nG(n)}function CG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return oG(n)}function TG(t,e,i){const[s,n,a]=i,r=t.resolveVertexValue(e,s),o=t.resolveVertexValue(e,n),l=t.resolveVertexValue(e,a),c=t.getPathArray(e),h=`\`$mix\` json operation failed on [${String(r)}, ${String(o)}, ${String(l)}] at [${c.join(".")}], expecting`,d=`${h} two colors and a number between 0 and 1.`;if(typeof o!="string"||!Tg(l)){Ma.inDevelopmentMode(()=>Aa.warnOnce(d));return}if(typeof r=="string")try{return fi.mix(fi.fromString(r),fi.fromString(o),l).toString()}catch{Ma.inDevelopmentMode(()=>Aa.warnOnce(d));return}if(!OI(r)){Ma.inDevelopmentMode(()=>Aa.warnOnce(d));return}let u=r.colorStops;try{u=u?.map(p=>{let g;return typeof p.color=="string"&&(g=fi.mix(fi.fromString(p.color),fi.fromString(o),l).toString()),{...p,color:g}})}catch{Ma.inDevelopmentMode(()=>Aa.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...r,colorStops:u}}var LG={$rem:NG};function NG(t,e,i){const[s]=i,n=t.getVertexValue(s),a=t.getParamValue("fontSize");if(typeof a=="number"&&typeof n=="number")return Math.round(n*a);Ma.inDevelopmentMode(()=>Aa.warnOnce(`\`$rem\` json operation failed on [${String(n)}] at [${t.getPathArray(e).join(".")}], expecting a number.`))}var kG={$and:OG,$eq:wG,$every:EG,$greaterThan:RG,$if:PG,$lessThan:_G,$not:FG,$or:VG,$some:BG,$switch:zG};function OG(t,e,i){for(const s of i){const n=t.resolveVertexValue(e,s);if(i.length===1&&Array.isArray(n))return n.every(a=>!!a);if(!n)return!1}return!0}function wG(t,e,i){let s,n=!0;for(const a of i){const r=t.resolveVertexValue(e,a);if(n)s=r,n=!1;else if(r!==s)return!1}return!0}function EG(t,e,i){const[s,n]=i,a=t.getVertexValue(s),r=t.resolveVertexValue(e,n);if(!Array.isArray(r))return;let o=0;for(const l of r){if(!t.graftAndResolveOrphanValue(e,`${o}`,a,l))return!1;o++}return!0}function RG(t,e,i){const[s,n]=i;return t.resolveVertexValue(e,s)>t.resolveVertexValue(e,n)}function PG(t,e,i){const[s,n,a]=i,o=t.resolveVertexValue(e,s)?n:a,l=t.neighboursWithEdgeValue(o,ye);if(l)for(const c of l)t.addEdge(e,c,ye);return t.resolveVertexValue(e,o)}function _G(t,e,i){const[s,n]=i;return t.resolveVertexValue(e,s)<t.resolveVertexValue(e,n)}function FG(t,e,i){const[s]=i;if(s)return!t.resolveVertexValue(e,s)}function VG(t,e,i){for(const s of i){const n=t.resolveVertexValue(e,s);if(i.length===1&&Array.isArray(n))return n.some(a=>!!a);if(n)return!0}return!1}function BG(t,e,i){const[s,n]=i,a=t.getVertexValue(s),r=t.resolveVertexValue(e,n);if(!Array.isArray(r))return;let o=0;for(const l of r){if(t.graftAndResolveOrphanValue(e,`${o}`,a,l))return!0;o++}return!1}function zG(t,e,i){const[s,n,...a]=i,r=t.resolveVertexValue(e,s);for(const o of a){const l=t.getVertexValue(o);if(!Array.isArray(l))continue;const[c,h]=l;if(r===c||Array.isArray(c)&&c.includes(r))return h}return t.resolveVertexValue(e,n)}var GG={$isUserOption:jG,$palette:UG,$mapPalette:HG,$path:{dependencies:FI,resolve:WG},$pathString:{dependencies:FI,resolve:YG},$ref:$G};function jG(t,e,i){const[s,n,a]=i,r=t.neighboursWithEdgeValue(s,ye);if(r)for(const o of r){const l=t.findNeighbour(o,ue);if(l&&PI(t,e,l))return t.resolveVertexValue(e,n)}else if(PI(t,e,s))return t.resolveVertexValue(e,n);return t.resolveVertexValue(e,a)}function PI(t,e,i){const s=t.resolveVertexValue(e,i);if(!Fr(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const n=t.getPathArray(e),a=Ca(n,s);return a===fs?!1:t.hasUserOption(a)}var _I=new Set(["fill","fillFallback","stroke","gradient","range2"]);function UG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);if(!Fr(n))return;if(_I.has(n)){const r=t.getPathArray(e),o=zr(r);if(Number.isNaN(o))return;switch(n){case"fill":return us(t.palette.fills,1,o)[0];case"fillFallback":return us(t.palette.fillsFallback,1,o)[0];case"stroke":return us(t.palette.strokes,1,o)[0];case"gradient":return us(t.palette.sequentialColors,1,o)[0];case"range2":return us(t.palette.fills,2,o)}return}if(n==="gradients")return t.palette.sequentialColors;if(n==="type")return t.paletteType;const a=dt(t.palette,n.split("."));return Array.isArray(a)?[...a]:typeof a=="object"?{...a}:a}function HG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);if(!Fr(n))return;if(_I.has(n)){const r=t.getPathArray(e);let o=zr(r),l=0;const c=["series","0","type"];for(let h=0;h<o;h++){c[1]=`${h}`;const d=t.getResolvedPath(c);(d==="map-shape-background"||d==="map-line-background")&&l++}if(o-=l,Number.isNaN(o))return;switch(n){case"fill":return us(t.palette.fills,1,o)[0];case"fillFallback":return us(t.palette.fillsFallback,1,o)[0];case"stroke":return us(t.palette.strokes,1,o)[0];case"gradient":return us(t.palette.sequentialColors,1,o)[0];case"range2":return us(t.palette.fills,2,o)}return}if(n==="gradients")return t.palette.sequentialColors;if(n==="type")return t.paletteType;const a=dt(t.palette,n.split("."));return Array.isArray(a)?[...a]:typeof a=="object"?{...a}:a}function FI(t,e,i){const[s]=i,n=t.getVertexValue(s);if(Fr(n)){const a=t.getPathArray(e),r=Ca(a,n);if(r===fs)return;const o=t.findVertexAtPath(r);o&&t.addEdge(e,o,Vr)}}function WG(t,e,i){const s=i.length>1,n=i.length>2,[a,r,o]=i,l=t.resolveVertexValue(e,a),c=n?t.resolveVertexValue(e,o):null;if(!Fr(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=t.getPathArray(e),d=Ca(h,l);if(d===fs)return;const u=c?dt(c,d):t.getResolvedPath(d);if(u!=null)return u;if(s)return t.resolveVertexValue(e,r)}function YG(t,e,i){const[s,n]=i,a=t.resolveVertexValue(e,s);if(!Fr(a))throw new Error(`\`$path\` json operation failed on [${String(a)}], expecting a string.`);let r;n&&(r=t.graftAndResolveOrphan(e,n));const o=t.getPathArray(e),l=Ca(o,a,r);if(l===fs)throw new Error(`Unresolvable path [${a}] at [${o.join(".")}]`);return l}function $G(t,e,i){const[s]=i,n=t.getVertexValue(s);return t.getParamValue(n)}var KG={$apply:ZG,$applyCycle:XG,$applySwitch:qG,$applyTheme:JG,$clone:QG,$findFirstSiblingNotOperation:ej,$map:tj,$merge:ij,$omit:sj,$size:nj,$shallow:rj,$shallowSimple:aj,$value:oj};function ZG(t,e,i){const[s,n,a,r]=i,o=t.getVertexValue(s);if(!al(o))return;const l=n?t.getVertexValue(n):void 0,c=t.neighboursWithEdgeValue(e,ye),h=c&&c.length>0;if(!h&&l==null)return qt;const d=a?t.resolveVertexValue(e,a):void 0,u=r?t.resolveVertexValue(e,r):void 0;if(!h&&l!=null)if(ol(l)){const p=t.resolveVertexValue(e,n);al(p)&&t.graftObject(e,p,[d,u])}else t.graftObject(e,l,[d,u]);if(!h)return qt;for(const p of c){const g=t.neighboursWithEdgeValue(p,ye);if(!g||g.length===0){const f=t.addVertex({});t.addEdge(p,f,ue)}else t.graftObject(p,o,[d,u])}return qt}function XG(t,e,i){const[s,n,a]=i,r=t.resolveVertexValue(e,s);if(typeof r!="number")return;const o=t.getPathArray(e),l=t.dangerouslyGetUserOption(o),c=t.hasThemeOverride(o),h=l==null?void 0:St,d=l??t.resolveVertexValue(e,n);if(!Array.isArray(d))return;const u=a?t.getVertexValue(a):void 0;for(let p=0;p<r;p++){const g=d[p%d.length];g!=null&&((l||!c)&&t.graftValue(e,`${p}`,g,void 0,h),u&&t.graftValue(e,`${p}`,u,g,h))}return qt}function qG(t,e,i){const[s,n,...a]=i,r=t.resolveVertexValue(e,s);for(const o of a){const l=t.getVertexValue(o);if(!Array.isArray(l))continue;const[c,h]=l;if(r===c||Array.isArray(c)&&c.includes(r))return t.graftObject(e,h,[],ue),qt}return t.resolveVertexValue(e,n)}function JG(t,e,i){const[s,n,a]=i;let r=t.getVertexValue(s);if(typeof r=="string"&&(r=[r]),!Array.isArray(r))return;const o=t.neighboursWithEdgeValue(e,ye),l=a?t.getVertexValue(a):[],c=Array.isArray(l)?new Set(l):new Set;if(!o)return qt;for(const h of o){const d=t.graftAndResolveOrphan(h,n);for(const u of r){const p=Ca([],u,d);p!==fs&&t.graftConfig(h,p,c)}}return qt}function QG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);if(al(n))return t.graftObject(e,n,void 0,St),qt}function ej(t,e,i){const[s]=i,n=t.getPathArray(e),a=Ca(n,"..");if(a===fs)return;const r=t.findVertexAtPath(a);if(!r)return t.resolveVertexValue(e,s);const o=t.neighboursWithEdgeValue(r,ye);if(o)for(const l of o){const c=t.getPathArray(l);if(c[a.length]===n[a.length])continue;const h=c.concat(n.slice(a.length+1)),d=t.findVertexAtPath(h);if(!d)continue;const u=t.findNeighbourValue(d,St);if(u!=null)return u;const p=t.findNeighbourValue(d,Xt);if(p!=null)return p}return t.resolveVertexValue(e,s)}function tj(t,e,i){const[s,n]=i,a=t.getVertexValue(s),r=t.resolveVertexValue(e,n);if(!Array.isArray(r))return;const o=t.neighboursWithEdgeValue(e,ye);if(o&&o.length>0)return;let l=0;for(const c of r)t.graftValue(e,`${l}`,a,c),l++;return qt}function ij(t,e,i){for(const s of i){const n=t.resolveVertexValue(e,s);al(n)&&t.graftObject(e,n)}return qt}function sj(t,e,i){const[s,n]=i;let a=t.getVertexValue(s);if(!Array.isArray(a)){const o=pG(t,e,n);if(!o)return;a=t.resolveVertexValue(o,s)}const r=t.resolveVertexValue(e,n);if(!(!Array.isArray(a)||!al(r)))return lG(r,a)}function nj(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return rG(n)?"length"in n?n.length:Object.keys(n).length:0}function aj(t,e,i){const s=[];for(const n of i)s.push(t.getVertexValue(n));return s}function rj(t,e,i){const s=t.getPathArray(e),n=t.hasUserOption(s);if(!n&&i.length===1)return t.resolveVertexValue(e,i[0]);const a=[];for(const r of i)a.push(t.getVertexValue(r));return n?(t.prune(e,[Xt,ue]),qt):(t.graftObject(e,a),qt)}function oj(t,e,i){const[s]=i,n=t.getVertexValue(s),a=t.getPathArray(e);if(n==="$index")return zr(a);if(n==="$parentIndex")return zr(a,1);if(n==="$1")return t.resolveValue$1(a)}var lj={$isEven:cj};function cj(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return Number.isNaN(Number(n))?!1:Number(n)%2===0}var ll={...gG,...mG,...vG,...LG,...GG,...kG,...lj,...KG},VI=new Set(Object.keys(ll));function cl(t){return VI.has(t)}var le=Jz.create("opts","options-graph"),hj=tG(dj);function dj(t,e){return le.group("OptionsGraph.constructor()",()=>{const i=new BI(t.config,e,t.params,t.palette,t.overrides,t.getTemplateParameters());return{resolve(){return i.resolve()},resolveParams(){return i.resolveParams()},resolveAnnotationThemes(){return i.resolveAnnotationThemes()},resolvePartial(s,n,a){return i.resolvePartial(s,n,a)},clearSafe(){return i.clearSafe()}}})}var bn=class pt extends qz{constructor(e={},i={},s=void 0,n={},a=void 0,r=new Map){super(ye,ps,new Set([yn,St])),this.config=e,this.userOptions=i,this.palette=n,this.overrides=a,this.internalParams=r,this.edgePriority=[...pt.EDGE_PRIORITY],this.graftEdge=pt.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=nl(i?.theme)?sS(i.theme?.palette):"inbuilt";const o=i.series?.[0]?.type??"line";le("build user"),this.buildGraphFromObject(this.root,St,Da(i,["theme"])),le("build defaults"),this.buildGraphFromObject(this.root,ue,Da(e[o],pt.COMPLEX_KEYS));const l=a?Da(a[o],pt.COMPLEX_KEYS):{};Object.keys(l).length>0&&(le("build series overrides"),this.buildGraphFromObject(this.root,Xt,l));const c=a?Da(a.common,pt.COMPLEX_KEYS):{};Object.keys(c).length>0&&(le("build common overrides"),this.buildGraphFromObject(this.root,Xt,Qz.getSeriesModule(o)?.chartType==="cartesian"?c:Da(c,["zoom","navigator"]))),s&&(le("build params"),this.buildGraphFromObject(this.params,ue,s));const h=this.findNeighbourWithValue(this.root,"axes",ye),d=this.findNeighbourWithValue(this.root,"series",ye);h&&(le("build axes"),this.buildGraphFromObject(h,ue,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]})),d&&(le("build series"),this.buildGraphFromObject(d,ue,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const u=Da(e[o]?.annotations??{},pt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(u).length>0&&(le("build annotations type config"),this.buildGraphFromObject(this.annotations,ue,u));const p=Da(a?.common?.annotations??{},pt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&(le("build annotations type overrides"),this.buildGraphFromObject(this.annotations,Xt,p));const g=Ag(e[o]?.annotations??{},pt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&(le("build annotations config"),this.buildGraphFromObject(this.root,ue,{annotations:g}));const f=Ag(a?.common?.annotations??{},pt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(le("build annotations overrides"),this.buildGraphFromObject(this.root,Xt,{annotations:f})),this.buildDependencyGraph()}static clearValueCache(){pt.valueCache.clear()}clear(){le.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,le("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return le.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},le("resolve params"),this.resolveVertex(this.params,this.resolvedParams),le("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),le("resolve root"),this.resolveVertex(this.root),le("resolved root",this.resolved),le("vertex count",this.getVertexCount()),le("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(e){const i=super.addVertex(e);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(e,i,s){const n=(this.neighboursWithEdgeValue(e,s)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!n&&(this.rollbackEdgesFrom.push(e),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(s)),super.addEdge(e,i,s)}resolvePartial(e,i,s){if(!i||!this.root)return;const{permissivePath:n,proxyPaths:a}=s??{},r=Object.keys(i);if(le.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${e.join(".")} [${r}]`),r.length===0)return{};const o=this.findVertexAtPath(e);if(!o){if(n)return;throw new Error(`Could not find vertex in OptionsGraph at path [${e.join(".")}].`)}const l=this.findNeighbour(o,Ai);if(this.userPartialOptions={},Br(this.userPartialOptions,e,i),a)for(const p of Object.keys(a)){const g=a[p],f=dt(i,[p]);f!=null&&(Br(i,g,f),Br(this.userPartialOptions,[...e,...g],f),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=yn,this.edgePriority=[yn,...pt.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(o,yn,i,l);for(const p of r){const g=a?.[p]?this.findVertexAtPath([...e,...a[p]]):this.findNeighbourWithValue(o,p,ye);g&&this.refreshPendingProcessingEdges(g)}this.buildDependencyGraph();const c={};if(this.resolveVertex(o,c),this.rollback(),this.graftEdge=pt.GRAFT_EDGE,this.edgePriority=pt.EDGE_PRIORITY,this.userPartialOptions=void 0,a)for(const p of Object.keys(a)){const g=a[p],f=dt(c,[...e,...g]);Br(c,[...e,p],f)}const h=dt(c,e),u=s?.pick??!0?Ag(dt(c,e),r):h;return le("vertex count",this.getVertexCount()),le("edge count",this.getEdgeCount()),le("resolved partial",u),le.check()&&console.groupEnd(),u}findVertexAtPath(e){const i=e.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,e,ye);if(s)return this.cachedPathVertices.set(i,s),s}hasUserOption(e){if(rl(this.userOptions,e))return!0;const s=this.findVertexAtPath(e);if(s){if(this.findNeighbour(s,St)!=null||this.findNeighbour(s,yn)!=null)return!0;const n=this.findNeighbourValue(s,RI);return n===St||n===yn}return!1}dangerouslyGetUserOption(e){if(this.userPartialOptions){const i=dt(this.userPartialOptions,e);if(i!=null)return i}return dt(this.userOptions,e)}hasThemeOverride(e){if(this.overrides==null)return!1;if(e[0]==="axes"&&e.length>1){const i=this.getResolvedPath(["axes",e[1],"type"]);if(rl(this.overrides,["common","axes",i,...e.slice(2)]))return!0;const s=this.getResolvedPath(["series","0","type"]);return rl(this.overrides,[s,"axes",i,...e.slice(2)])}if(e[0]==="series"&&e.length>1){const i=this.getResolvedPath(["series",e[1],"type"]);return rl(this.overrides,[i,"series",...e.slice(2)])}return rl(this.overrides,e)}getParamValue(e){if(this.resolvedParams[e]!=null)return this.resolvedParams[e];const i=this.findVertexAlongEdge(this.params,[e],ye);if(!i)return;const s=this.findNeighbour(i,ue);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[e]=n,n}getPathArray(e){return this.findNeighbourValue(e,Ai)??[]}getResolvedPath(e){return dt(this.resolved,e)}getCachedValue(e,i){const s=[...e,i].join(".");return pt.valueCache.get(s)}setCachedValue(e,i,s){const n=[...e,i].join(".");pt.valueCache.set(n,s)}prune(e,i){this.addEdge(e,this.addVertex(i),EI)}resolveVertexValue(e,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,ps);if(s&&cl(s)){const a=this.neighboursWithEdgeValue(i,gs),r=ll[s],l=(typeof r=="function"?r:r.resolve)?.(this,e,a??[]);return l===qt?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const a={};this.resolveVertexChildren(i,a),n=dt(a,this.getPathArray(e))}return this.resolveValueOrSymbol(n)}resolveValue$1(e){for(let i=e.length;i>=0;i--){const s=e.slice(0,i).join("."),n=this.value$1.get(s);if(n!=null)return n}}graftConfig(e,i,s){const n=dt(this.config,i),a=this.findNeighbour(e,Ai);if(nl(n)&&this.buildGraphFromObject(e,ue,n,a,void 0,s),this.overrides){const r=dt(this.overrides,i);nl(r)&&this.buildGraphFromObject(e,Xt,r,a,void 0,s);const o=dt(this.overrides,["common",...i.slice(1)]);nl(o)&&this.buildGraphFromObject(e,Xt,o,a,void 0,s)}this.buildDependencyGraph()}graftObject(e,i,s,n=this.graftEdge){const a=this.findNeighbour(e,Ai);if(this.buildGraphFromObject(e,n,i,a),this.overrides&&s)for(const r of s){if(r==null)continue;const o=dt(this.overrides,r);o&&this.buildGraphFromObject(e,Xt,o,a)}this.buildDependencyGraph()}graftValue(e,i,s,n,a=this.graftEdge){const r=[...this.getPathArray(e),i],o=this.findVertexAtPath(r)??this.addVertex(i);this.value$1.set(r.join("."),n),this.buildGraphFromValue(e,o,a,r,s),this.buildDependencyGraph()}graftAndResolveOrphan(e,i){const s={},n=this.addVertex(s),a=this.getPathArray(e);return this.graftAndResolveChildren(i,n,a,[]),this.resolveVertex(n,s),dt(s,a)}graftAndResolveOrphanValue(e,i,s,n,a=this.graftEdge){const r={},o=this.addVertex(r),c=[...this.getPathArray(e),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),n),this.buildGraphFromValue(o,h,a,c,s),this.resolveVertex(o,r),dt(r,c)}buildGraphFromObject(e,i,s,n,a=pt.SHALLOW_KEYS,r){const o=Object.keys(s),l=ol(s,o);if(l){const g=this.addVertex(s);this.addEdge(e,g,i),this.buildGraphFromOperation(g,i,l,n);return}if(o.length===0){this.addEdge(e,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(e,i,s,void 0);return}const c=this.getVertexChildrenByKey(e),h=n?this.getVertexValue(n):[];let d;Array.isArray(s)&&this.addEdge(e,this.addVertex(i),RI);const u=[...h],p=h.length;for(const g of o){if(r?.has(g))continue;const f=c?.get(g)??this.addVertex(g);u[p]=g,a?.has(g)?this.buildShallowGraphFromValue(e,f,i,u,s[g]):this.buildGraphFromValue(e,f,i,u,s[g],a),g==="enabled"&&(d=f)}this.buildGraphAutoEnable(e,i,s,d)}buildGraphAutoEnable(e,i,s,n){if(i===ue&&!n||i===St&&n||i!==ue&&i!==St&&i!==yn&&i!==Xt)return;let a=this.findNeighbour(e,Cg);a||(a=this.addVertex(Cg),this.addEdge(e,a,Cg)),n&&this.addEdge(n,a,wI);const{enabled:r,_enabledFromTheme:o}=s;this.addEdge(a,this.addVertex({enabled:r,_enabledFromTheme:o,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(e){const i=this.neighboursWithEdgeValue(e,ye);if(!i)return;const s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(e,i,s,n,a,r){this.addEdge(e,i,ye);let o=this.findNeighbour(i,Ai);o||(o=this.addVertex([...n]),this.addEdge(i,o,Ai));const l=ol(a);if(l){const c=this.addVertex(a);this.addEdge(i,c,s),this.addEdge(c,o,Ai),this.buildGraphFromOperation(c,s,l,o)}else if(kI(a))this.buildGraphFromObject(i,s,a,o,r);else{const c=this.findNeighbour(i,s);if(c&&this.getVertexValue(c)===a)return;const h=this.addVertex(a);this.addEdge(i,h,s)}}buildShallowGraphFromValue(e,i,s,n,a){this.addEdge(e,i,ye);let r=this.findNeighbour(i,Ai);r||(r=this.addVertex([...n]),this.addEdge(i,r,Ai));const o=this.addVertex(a);this.addEdge(i,o,s)}buildGraphFromOperation(e,i,s,n){const a=this.addVertex(s.operation);this.addEdge(e,a,ps);for(const r of s.values)this.buildGraphFromOperationValue(e,r,i,n)}buildGraphFromOperationValue(e,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const a=this.addVertex(i);this.addEdge(e,n,Ai),this.addEdge(e,a,gs);const r=ol(i);r?this.buildGraphFromOperation(a,s,r,n):kI(i)&&this.buildGraphFromObject(a,s,i,n)}buildDependencyGraph(){for(let e=0;e<this.pendingProcessingEdgesFrom.length;e++){const i=this.pendingProcessingEdgesFrom[e],s=this.pendingProcessingEdgesTo[e],n=this.getVertexValue(s);if(!cl(n))continue;const a=this.neighboursWithEdgeValue(i,gs),r=ll[n];(typeof r=="function"?void 0:r.dependencies)?.(this,i,a??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}refreshPendingProcessingEdges(e){const s=this.findNeighbour(e,ue)??e,n=this.findNeighbour(s,ps);if(n){this.pendingProcessingEdgesFrom.push(s),this.pendingProcessingEdgesTo.push(n);const r=this.neighboursWithEdgeValue(s,gs);if(r)for(const o of r)this.refreshPendingProcessingEdges(o)}const a=this.neighboursWithEdgeValue(e,ye);if(a)for(const r of a)this.refreshPendingProcessingEdges(r)}resolveVertex(e,i=this.resolved,s){const n=this.getPathArray(e),a=n[0];if(n.length===1&&this.resolvedRootAncestorsPaths.add(a),n.length>1&&!this.resolvedRootAncestorsPaths.has(a)){const r=this.findVertexAtPath([a]);if(r){this.resolveVertex(r,i,s);return}}if(this.userPartialOptions==null&&i===this.resolved&&n.length>0){const r=dt(i,n);if(r!=null&&!eG(r))return}this.resolveVertexInEdgePriority(e,i,n,s),this.resolveVertexAutoEnable(e,i,n),this.resolveVertexChildren(e,i,s)}resolveVertexInEdgePriority(e,i,s,n){const a=this.neighboursWithEdgeValue(e,ye),[r]=this.edgePriority;for(const o of this.edgePriority){const l=this.findNeighbour(e,o);if(l==null)continue;const c=this.resolveVertexValueInternal(e,l);if(!(c==null&&o!==r)&&!(a&&a.length>0&&o!==r)&&!(Array.isArray(n)&&n.includes(o))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&pt.UNSAFE_CLEAR_KEYS.has(s.at(-1))),s.length===0){if(c==null)continue;this.resolved=c}else Br(i,s,c);break}}}resolveVertexValueInternal(e,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,ps);if(s&&cl(s)){const n=this.neighboursWithEdgeValue(i,gs),a=ll[s],o=(typeof a=="function"?a:a.resolve)?.(this,e,n??[]);return o===qt?void 0:o}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(e,i,s){const n=this.neighboursWithEdgeValue(e,wI)?.[0];if(!n)return;const a=this.findVertexAtPath(s),r=this.findNeighbourValue(n,ue),o=this.findNeighbourValue(n,Xt),l=this.findNeighbourValue(n,St),h=a&&this.findNeighbour(a,St)!=null?void 0:this.findNeighbourValue(n,yn);(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!r?._enabledFromTheme&&!o?._enabledFromTheme&&Br(i,s,!0)}resolveVertexChildren(e,i,s){const n=this.neighboursWithEdgeValue(e,ye);if(n){s??(s=this.findNeighbourValue(e,EI));for(const a of n){const r=this.getVertexValue(a);n.length>1&&cl(r)||r!=="_enabledFromTheme"&&this.resolveVertex(a,i,s)}}}resolveVertexDependencies(e){const i=this.neighboursWithEdgeValue(e,Vr);if(i)for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(e,i,s,n){const a=this.neighboursWithEdgeValue(e,ye);if(a)for(const r of a){const o=this.getVertexValue(r),l=[...s,o],c=[...n,o],h=this.addVertex(o),d=this.findNeighbourValue(r,ue);this.addEdge(i,h,ye);const u=this.addVertex(l);if(this.addEdge(h,u,Ai),nl(d)){this.buildGraphFromObject(h,ue,d,u);const p=this.findNeighbour(h,ue);this.addEdge(p,this.addVertex(l),Ai);const g=this.findNeighbourValue(p,ps);if(cl(g)){const f=this.neighboursWithEdgeValue(p,gs),y=ll[g];(typeof y=="function"?void 0:y.dependencies)?.(this,p,f??[])}}this.graftAndResolveChildren(r,h,l,c)}}resolveValueOrSymbol(e){return typeof e=="symbol"&&this.internalParams?.has(e)?this.internalParams.get(e):e}snapshot(){le("snapshot"),this.isRollingBack=!0}rollback(){le(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let e=0;e<this.rollbackEdgesFrom.length;e++){const i=this.rollbackEdgesFrom[e],s=this.rollbackEdgesTo[e],n=this.rollbackEdgesValue[e];this.removeEdge(i,s,n)}for(const e of this.rollbackVertices)this.removeVertex(e);this.cachedPathVertices.clear(),this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1}diagram(e,i=2){this.diagramKeys=new Map,this.diagramEdges=new Map;const s=this.findVertexAtPath(e),n=["---","config:"," layout: elk"," look: neo"," theme: redux","---","flowchart TB"];s&&this.diagramVertex(n,s,1,i),n.push("classDef UO fill: #e8f5e8, stroke: #4caf50"),n.push("classDef DE fill: #e3f2fd, stroke: #2196f3"),n.push("classDef DEP fill: #ffe0fd, stroke: #ff00f2"),n.push("classDef OP fill: #fff3e0, stroke: #ff9800"),n.push("classDef OPV fill: #fff3e0, stroke: #ff9800, stroke-width: 1px"),n.push("classDef OV fill: #e8f5ee, stroke: #4caf87"),console.log(n.join(`
`))}diagramKey(e){let i=this.diagramKeys.get(e);return i||(i=`${this.diagramKeys.size}`,this.diagramKeys.set(e,i)),i}diagramLabel(e,i,s){let n=this.diagramKeys.get(e);if(n)return n;n=this.diagramKey(e);const a={[St]:"UO",[ue]:"DE",[Vr]:"DEP",[ps]:"OP",[gs]:"OPV",[Xt]:"OV"};let r=s?a[s]??void 0:void 0;return r=r?`:::${r}`:"",typeof i.value=="symbol"?`${n}[/"[symbol]"\\]${r}`:Array.isArray(i.value)?`${n}[/"[array]"\\]${r}`:typeof i.value=="object"?`${n}[/"[object]"\\]${r}`:s===ue||s===St||s===Xt?`${n}("${i.value}")${r}`:`${n}["${i.value}"]${r}`}diagramVertex(e,i,s,n){const a=this.getPathArray(i),r=a.length>0?a.join("."):"root";this.diagramNeighbours(e,r,i,s+1,n);let o=this.diagramKeys.get(r);o||(o=this.diagramKey(r),e.push(` ${o}["${i.value}"]`))}diagramNeighbours(e,i,s,n,a){for(const p of this.neighboursWithEdgeValue(s,ye)??[]){const g=this.getPathArray(p),f=g.length>0?g.join("."):"root";n<a&&this.diagramVertex(e,p,n+1,a),this.diagramChild(e,ye,i,s,f,s)}const r=this.neighboursWithEdgeValue(s,St)??[];let o=0;for(const p of r)this.diagramChild(e,St,i,s,`${i}.${St}.${o}`,p),o++;const l=this.neighboursWithEdgeValue(s,ue)??[];o=0;for(const p of l)this.diagramChildWithNeighbours(e,ue,i,s,`${i}.${ue}.${o}`,p,n+1,a),o++;const c=this.neighboursWithEdgeValue(s,ps)??[];o=0;const[h]=c;h&&(this.diagramChildWithNeighbours(e,ps,i,s,`${i}.${ps}.${o}`,h,n+1,a),o++);const d=this.neighboursWithEdgeValue(s,gs)??[];o=0;for(const p of d)this.diagramChildWithNeighbours(e,gs,i,s,`${i}.${gs}.${o}`,p,n+1,a),o++;const u=this.neighboursWithEdgeValue(s,Vr)??[];o=0;for(const p of u)this.diagramChildWithNeighbours(e,Vr,i,s,this.getPathArray(p).join("."),p,n+1,a),o++}diagramChild(e,i,s,n,a,r){let o=this.diagramEdges.get(s);if(o?.has(a))return;o||(o=new Set,this.diagramEdges.set(s,o)),o.add(a);const l=i===ye?"":`|${i}|`;e.push(` ${this.diagramLabel(s,n)} -->${l} ${this.diagramLabel(a,r,i)}`)}diagramChildWithNeighbours(e,i,s,n,a,r,o,l){this.diagramChild(e,i,s,n,a,r),this.diagramNeighbours(e,a,r,o+1,l)}};bn.EDGE_PRIORITY=[St,Xt,ue],bn.GRAFT_EDGE=ue,bn.SHALLOW_KEYS=new Set(["context","data","topology"]),bn.COMPLEX_KEYS=["annotations","axes","series"],bn.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],bn.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),bn.valueCache=new Map;var BI=bn,zI=t=>`'${t}'`,Ng="__AXIS_ID_",Ta={top:Ls.X,bottom:Ls.X,left:Ls.Y,right:Ls.Y},La=class st{constructor(e,i,s,n,a,r,o=!1,l){this.themeParameters={},this.optionMetadata=a??{},this.processedOverrides=s??{};let c=null;e instanceof st?(c=e,this.specialOverrides=c.specialOverrides,r&&(this.userDeltaKeys=new Set(Object.keys(r))),r??(r=eS(c.userOptions,i,st.JSON_DIFF_OPTS)),this.userOptions=jo(tS(r,c.userOptions),{...st.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=jo(e??i,{...st.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),this.findSeriesWithUserVisiblity(i,r),o&&this.removeLeftoverSymbols(this.userOptions);const h=e instanceof st&&r?.data!==void 0&&r?.data?.length!==e.userOptions.data?.length;let d,u,p,g,f,y,m;if(!o&&this.seriesWithUserVisibility==null&&r!==void 0&&st.isFastPathDelta(r)&&c!=null&&!h?({activeTheme:d,processedOptions:u,fastDelta:p}=this.fastSetup(r,c),g=c.themeParameters,f=c.annotationThemes):(st.perfDebug("ChartOptions.slowSetup()"),{activeTheme:d,processedOptions:u,themeParameters:g,annotationThemes:f,googleFonts:y,optionsGraph:m}=this.slowSetup(s,r,o)),this.activeTheme=d,this.processedOptions=u,this.fastDelta=p??void 0,this.themeParameters=g,this.annotationThemes=f,this.googleFonts=y,this.optionsGraph=m,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const x=performance.now();this.optionsProcessingTime=x-l}Np.inDevelopmentMode(()=>h2(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return st.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return st.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(e,i){for(const s of[e,i]){const n=s?.series;if(Array.isArray(n))for(let a=0;a<n.length;a++){const r=n[a];"visible"in r&&(this.seriesWithUserVisibility??(this.seriesWithUserVisibility={identifiers:new Set,indices:new Set}),r.id?this.seriesWithUserVisibility.identifiers.add(r.id):this.seriesWithUserVisibility.indices.add(a))}}}fastSetup(e,i){const{activeTheme:s,processedOptions:n}=i,{presetType:a}=this.optionMetadata;if(a!=null&&e?.data!=null){const o=Rt.getPresetModule(a);if(o?.processData){const{series:l,data:c}=o.processData(e.data);e=Uo({series:l,data:c},e)}}this.fastSeriesSetup(e,n);const r=Uo(e,n);return st.debug("ChartOptions.fastSetup() - processed options",r),{activeTheme:s,processedOptions:r,fastDelta:e}}fastSeriesSetup(e,i){e?.series&&(e.series?.every((s,n)=>y2(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>tS(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=jo(this.userOptions,st.OPTIONS_CLONE_OPTS_FAST);i&&(n=Uo(i,n),s&&this.removeLeftoverSymbols(n));let a=nS(Bh(n.theme));const{presetType:r}=this.optionMetadata;if(r!=null){const y=Rt.getPresetModule(r);if(y){const{validate:m=Ho}=y,x=n,v=n.type,S=v==null?void 0:a.presets[v],{cleared:I,invalid:M}=m(x,y.options,"");for(const D of M)oi.warn(D);kp(M,"")?n={}:(st.debug(">>> AgCharts.createOrUpdate() - applying preset",I),n=y.create(I,S,()=>this.activeTheme),a=nS(Bh(n.theme)))}}this.soloSeriesIntegrity(n),r!=null&&a.templateTheme(n,!1),rS(void 0,n);const o=this.validateSeriesOptions(n),l=Eo(n);if(this.chartDef=Rt.getChartModule(l),!this.chartDef.placeholder){const{validate:y=Ho}=this.chartDef,{cleared:m,invalid:x}=y(n,this.chartDef.options,"");for(const v of x)oi.warn(v);n=m}this.validateAxesOptions(n),this.removeDisabledOptions(n);let c=this.processFonts(a.params);c=this.processFonts(n,c),this.processSeriesOptions(n);const h=this.processAxesOptions(n,l),d=hj(a,n),u=d.resolve(),p=d.resolveParams(),g=d.resolveAnnotationThemes();d.clearSafe();const f=Uo(e,u);return rS(this.chartDef.name,f),uF(this.chartDef.name,f,o),this.validateSeriesOptions(f),this.validateAxesOptions(f,h),this.validatePluginOptions(f),this.processMiniChartSeriesOptions(f),f.loadGoogleFonts||c.clear(),st.debug(()=>["ChartOptions.slowSetup() - processed options",jo(f)]),{activeTheme:a,processedOptions:f,themeParameters:p,annotationThemes:g,googleFonts:c,optionsGraph:d}}validatePluginOptions(e){for(const i of Rt.listModulesByType(Go.Plugin)){const s=i.name;if(s in e&&i.options!=null&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:a}=Ho(e[s],i.options,i.name);for(const r of a)oi.warn(r);e[s]=n}}}validateSeriesOptions(e){const i=this.chartDef?.name,s=[],n=e.series?.length??0,a=[];let r;for(let o=0;o<n;o++){const l=`series[${o}]`,c=e.series[o],h=Rt.getSeriesModule(c.type);if(h==null){const g=Rt.isEnterprise();r??(r=Qv(Array.from(an.values()).filter(y=>y.type===Go.Series&&(g||!y.enterprise)&&(!i||y.chartType===i)).map(y=>y.name),"or",zI));const f=an.get(c.type);if(c.type!=null&&f?.type===Go.Series){a.push(f);continue}oi.warn(c.type==null?`Option \`${l}.type\` is required and has not been provided; expecting ${r}, ignoring.`:`Unknown type \`${c.type}\` at \`${l}.type\`; expecting ${r}, ignoring.`);continue}else if(i&&h.chartType!==i){oi.warn(`Series type \`${h.name}\` at \`${l}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}if(h.options==null){s.push(c);continue}const{validate:d=Ho}=h,{cleared:u,invalid:p}=d(c,h.options,l);for(const g of p)oi.warn(g);kp(p,l)||s.push(u)}return e.series=s,a}validateAxesOptions(e,i){if(!("axes"in e)||!e.axes)return;const s=this.chartDef?.name,n={};let a;for(const[r,o]of ra(e.axes)){if(!o)continue;if(o.type==null){n[r]=o;continue}const l=`axes.${i?.get(r)??r}`,c=Rt.getAxisModule(o.type);if(c==null){const p=Rt.isEnterprise();a??(a=Qv(Array.from(an.values()).filter(f=>f.type===Go.Axis&&(p||!f.enterprise)&&f.chartType===s).map(f=>f.name),"or",zI)),an.get(o.type)?.type!==Go.Axis&&oi.warn(`Unknown type \`${o.type}\` at \`${l}.type\`; expecting one of ${a}, ignoring.`);continue}else if(c.chartType!==s){oi.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${s}\`, ignoring.`);break}const{validate:h=Ho}=c,{cleared:d,invalid:u}=h(o,c.options,l);for(const p of u)oi.warn(p);kp(u,l)||(n[r]=d)}e.axes=n}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??eS(e.processedOptions,this.processedOptions,st.JSON_DIFF_OPTS)}optionsType(e){return e.series?.[0]?.type??"line"}processSeriesOptions(e){const i=e.displayNullData,s=e.series?.map(n=>{const r=!!Rt.getSeriesModule(n.type)?.options?.visible,o={};return r&&(o.visible=!0),i!==void 0&&n.allowNullKeys===void 0&&(o.allowNullKeys=i),Uo(this.getSeriesGroupingOptions(n),n,o)});e.series=this.setSeriesGroupingOptions(s??[])}processAxesOptions(e,i){const s=i==="polar"?[Ls.Angle,Ls.Radius]:[Ls.X,Ls.Y],n="axes"in e&&Object.keys(e.axes??{}).length>0,a=this.countNonDefaultSeriesAxisKeys(e,s),r=a>0,o=r&&a<(e?.series?.length??0),l=e.series?.[0],c=this.optionsType(e),h=this.predictAxes(c,s,l,e.data)??this.cloneDefaultAxes(c),d=Op(l)&&"direction"in l&&l.direction==="horizontal"&&Rt.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!n&&!r&&!d){e.axes=h;return}const u="axes"in e?new Set(Object.keys(e.axes??{})):new Set,p=this.getPrimaryAxisKeys(e,s,u,r),g=this.getRemappedAxisKeys(u,p,s,o),f={},y=new Map;for(const[m,x]of g)f[x]="axes"in e?ih(e.axes?.[m]):void 0,y.set(x,m);return this.remapSeriesAxisKeys(e,s,f,g,h,o),this.predictAxesMissingTypesAndPositions(e,s,f,h),this.alternateSecondaryAxisPositions(e,f,y),e.axes=f,y}getSeriesDirectionAxisKey(e,i){const s=Rt.getSeriesModule(e.type);return s?"direction"in e&&e.direction==="horizontal"&&s.axisKeysFlipped?s.axisKeysFlipped[i]:s.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(e,i){let s=0;for(const n of e.series??[])for(const a of i){const r=this.getSeriesDirectionAxisKey(n,a);!r||!th(r,n)||n[r]!==a&&s++}return s}getPrimaryAxisKeys(e,i,s,n){const a=new Map;for(const r of i){let o=!1;if("axes"in e&&e.axes&&!(r in e.axes&&Op(e.axes[r])&&!("position"in e.axes[r]))){for(const[l,c]of ra(e.axes))if("position"in c&&c.position&&r===Ta[c.position]){a.set(r,l),o=!0;break}}if(!o&&n)for(const l of e.series??[]){const c=this.getSeriesDirectionAxisKey(l,r);if(!c)continue;const h=l[c];if(!s.has(h)){if(!h){a.set(r,r);break}a.set(r,h);break}}}if(s.size===0||!("axes"in e)||!e.axes)return a;if(a.size===0)for(const r of i)r in e.axes&&a.set(r,r);if(a.size===0){for(const r of i)for(const[o,l]of ra(e.axes))if(l.type?.startsWith(r)){a.set(r,o);break}}if(a.size===0&&(e.series?.length??0)>0)for(const r of i)for(const o of e.series){const l=this.getSeriesDirectionAxisKey(o,r);if(!l)continue;const c=o[l];if(s.has(c)){a.set(r,c);break}}if(a.size<2){const r=new Set(a.values());for(const[o,l]of ra(e.axes))if(!(r.has(o)||"position"in l)){for(const c of i)if(!a.has(c)){a.set(c,o),r.add(o);break}if(a.size===2)break}}return a}getRemappedAxisKeys(e,i,s,n){const a=new Map;for(const[r,o]of i)a.set(o,r);for(const r of e)a.has(r)||a.set(r,`${Ng}${a.size}`);if(n)for(const r of s)a.has(r)||a.set(r,`${Ng}${a.size}`);return a}remapSeriesAxisKeys(e,i,s,n,a,r){for(const o of e.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(o,l);if(!c)continue;s[l]??(s[l]=ih(a[l]));let h=l;if(c in o){const d=o[c];n.has(d)?h=n.get(d):(h=`${Ng}${n.size}`,n.set(d,h),s[h]=ih(a[l]))}else n.has(l)&&r&&(h=n.get(l),s[h]??(s[h]=ih(a[l])));o[c]=h}}predictAxes(e,i,s,n){if(!s)return;const a=s?.data??n;if(!a?.length)return;const r=Rt.getSeriesModule(e)?.predictAxis;if(!r)return;const o=new Map,l=d2(0,a.length-1,5);for(const c of l){const h=a[c];for(const d of i){const u=r(d,h,s);if(!o.has(d)){o.set(d,u);continue}const p=o.get(d);if(!(!u&&!p)){if(!u||!p)return;for(const g of Object.keys(p))if(p[g]!==u[g])return}}}for(const[c,h]of o)h||o.delete(c);if(o.size!==0){if(o.size===1){const[c]=o.values(),h=this.cloneDefaultAxes(e);return"position"in c?b2(h,d=>"position"in d&&d.position===c.position?c:d):void 0}return Object.fromEntries(o)}}cloneDefaultAxes(e){const i=Rt.getSeriesModule(e);return i?.defaultAxes?jo(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(e,i,s,n){for(const[a,r]of ra(s)){if(!Jv(r)||"type"in r&&"position"in r)continue;if(a in n){r.type??(r.type=n[a].type),r.position??(r.position=n[a].position);continue}this.predictAxisMissingTypeFromPosition(r,n)||(this.predictAxisMissingTypeAndPositionFromSeries(e,i,a,r,n),"type"in r||delete s[a])}}predictAxisMissingTypeFromPosition(e,i){if(!("position"in e)||!th(e.position,Ta))return!1;for(const s of Object.values(i))if(th(s.position,Ta)&&Ta[e.position]===Ta[s.position])return e.type=s.type,!0;for(const[s,n]of ra(Ta))if(e.position!==s&&n===Ta[e.position])return e.type=i[n].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(e,i,s,n,a){for(const r of e.series??[])for(const o of i){const l=this.getSeriesDirectionAxisKey(r,o);if(!(!l||!th(l,r))&&r[l]===s)return n.type??(n.type=a[o].type),n.position??(n.position=a[o].position),o===Ls.Y}return!1}alternateSecondaryAxisPositions(e,i,s){let n=0,a=0;for(const[r,o]of ra(i)){if(!Jv(o)||!("position"in o))continue;const l=s.get(r),c="axes"in e&&e.axes&&l&&l in e.axes?e.axes[l]:void 0,h=c&&"position"in c?c.position:void 0;if(o.position==="top"||o.position==="bottom"?(n+=1,n===2&&h==null&&(o.position="top")):(o.position==="left"||o.position==="right")&&(a+=1,a===2&&h==null&&(o.position="right")),n>1&&a>1)break}}processMiniChartSeriesOptions(e){const i=e.navigator?.miniChart?.series;i!=null&&(e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(e){const{groupable:i,stackable:s,stackedByDefault:n=!1}=Rt.getSeriesModule(e.type);e.grouped&&!i&&oi.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&oi.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:a,stacked:r}=e;return r??(r=(n||e.stackGroup!=null)&&!(i&&a)),a??(a=!0),{stacked:s&&r,grouped:i&&a&&!(s&&r)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);st.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((a,r)=>{var o;return r.groupType==="default"||(a[o=r.seriesType]??(a[o]=0),a[r.seriesType]+=r.groupType==="stack"?1:r.series.length),a},{});return i.flatMap(a=>{var r;switch(s[r=a.seriesType]??(s[r]=0),a.groupType){case"stack":{const o=s[a.seriesType]++;return a.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:a.groupId,groupIndex:o,groupCount:n[a.seriesType],stackIndex:c,stackCount:a.series.length}}))}case"group":return a.series.map(o=>Object.assign(o,{seriesGrouping:{groupId:a.groupId,groupIndex:s[a.seriesType]++,groupCount:n[a.seriesType],stackIndex:0,stackCount:0}}))}return a.series}).map(({stacked:a,grouped:r,...o})=>o)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((s,n)=>{const a=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:a,series:[n],groupId:"__default__"});else{const r=this.getSeriesGroupId(n);if(!i.has(r)){const l={groupType:n.stacked?"stack":"group",seriesType:a,series:[],groupId:r};i.set(r,l),s.push(l)}i.get(r).series.push(n)}return s},[])}soloSeriesIntegrity(e){if(!f2(e.series))return;const i=n=>Rt.getSeriesModule(n)?.solo??!1,s=e.series;if(s&&s.length>1&&s.some(n=>i(n.type))){const n=this.optionsType(e);if(i(n))oi.warn(`series[0] of type '${n}' is incompatible with other series types. Only processing series[0]`),e.series=s.slice(0,1);else{const{solo:a,nonSolo:r}=g2(s,l=>i(l.type)?"solo":"nonSolo"),o=S2(a.map(l=>l.type)).join(", ");oi.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=r}}}static processFontOptions(e,i,s,n=new Set){if(typeof e=="object"&&"fontFamily"in e)if(Array.isArray(e.fontFamily)){const a=[];for(const r of e.fontFamily)typeof r=="object"&&"googleFont"in r?(a.push(r.googleFont),n?.add(r.googleFont)):a.push(r);e.fontFamily=a.join(", ")}else typeof e.fontFamily=="object"&&"googleFont"in e.fontFamily&&(e.fontFamily=e.fontFamily.googleFont,n?.add(e.fontFamily));return n}processFonts(e,i=new Set){return wp(e,st.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(e){if("enabled"in e&&e.enabled===!1)for(const i of Object.keys(e))i!=="enabled"&&delete e[i]}removeDisabledOptions(e){wp(e,st.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!Op(e)))for(const i of Object.keys(e)){const s=e[i];m2(s)&&delete e[i]}}removeLeftoverSymbols(e){wp(e,st.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=p2():v2(e.window),e.document==null?e.document=u2():x2(e.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};La.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},La.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},La.JSON_DIFF_OPTS=new Set(["data","localeText"]),La.perfDebug=Np.create(!0,"perf"),La.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),La.debug=Np.create(!0,"opts");var hl=La,zh=Lp.create(!0,"opts"),xn="AG Charts - Chart was destroyed, cannot perform request.",dl=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){if(!this.chart)throw new Error(xn);return zh.group("AgChartInstance.update()",async()=>{const i=Lp.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(e,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(xn);return zh.group("AgChartInstance.updateDelta()",async()=>{const i=Lp.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,e,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(xn);const e=l2(this.chart.getOptions(),hl.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(xn);return this.chart.waitForUpdate()}applyTransaction(e){const{chart:i}=this;if(!i)throw new Error(xn);if(e==null||typeof e!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:s,addIndex:n,remove:a,update:r}=e;if(s!=null&&!Array.isArray(s))throw new Error('AG Charts - transaction "add" must be an array.');if(n!=null){if(typeof n!="number"||!Number.isSafeInteger(n)||n<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(s==null||s.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(a!=null&&!Array.isArray(a))throw new Error('AG Charts - transaction "remove" must be an array.');if(r!=null&&!Array.isArray(r))throw new Error('AG Charts - transaction "update" must be an array.');return zh.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const o=i.data.deepClone();return o.addTransaction(e),o.commitPendingTransactions(),this.updateDelta({data:o.data})}return zh("transaction",e),await this.chart?.applyTransaction(e)})}async download(e){if(!this.chart)throw new Error(xn);const i=await this.prepareResizedChart(this,this.chart,e);try{i.chart?.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(xn);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(xn);const i=await this.prepareResizedChart(this,this.chart,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(e,s);return}await this.setStateOriginators(e,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(e,[i.ctx.zoomManager])}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,a=s.height??i.height??i.ctx.scene.canvas.height,r=e.getState(),o={...i.chartOptions.processedOverrides,container:c2().createElement("div"),width:n,height:a};s.width!=null&&s.height!=null&&(o.overrideDevicePixelRatio=1);const l=i.getOptions();if(o2.isEnterprise()){o.animation={enabled:!1};const f=this.licenseManager?.getWatermarkForegroundConfigForBrowser();f&&(o.foreground=f)}const c={...i.chartOptions.specialOverrides},h={...i.chartOptions.optionMetadata},d=await this.chart?.ctx.dataService.getData(),u=this.factoryApi.create(l,o,c,h,d);r.legend&&this.syncLegend(i,u,r),u.chart?.update(eh.FULL,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),await u.setState(r);const p={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};u.chart?.ctx.zoomManager.updateZoom(p,i.ctx.zoomManager.getZoom()),u.chart?.update(eh.FULL,{forceNodeDataRefresh:!0}),await u.waitForUpdate();const g=[];for(const f of i.modulesManager.legends())g.push(f.legend.pagination?.currentPage??0);for(const f of u.chart.modulesManager.legends()){const y=g.shift()??0;f.legend.pagination&&f.legend.pagination.setPage(y)}return u.chart?.update(eh.FULL,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}syncLegend(e,i,s){const n=new Map;for(const[a,r]of e.series.entries()){const o=i.chart?.series[a];o&&n.set(r.id,o.id)}s.legend=s.legend?.map(a=>({...a,seriesId:n.get(a.seriesId??"")??a.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:a,legendManager:r},modulesManager:o}=this.chart,l=[];return"annotations"in e&&e.annotations?.enabled&&l.push(s),i.presetType==="price-volume"&&l.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&l.push(a),o.isEnabled("legend")&&e.legend?.enabled!==!1&&l.push(r),l.push(this.chart.ctx.activeManager),l}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.updateService.update(eh.PROCESS_DATA,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};dl.chartInstances=new WeakMap,b([r2({oldValue(t){t.destroyed||(t.publicApi=void 0),dl.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,dl.chartInstances.set(t,this))}})],dl.prototype,"chart",2);var GI=dl;import{Debug as uj}from"ag-charts-core";var pj=1e3,kg=class wn{constructor(e,i,s,n,a,r=pj){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=a,this.cleanupTimeMs=r,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,a){return this.pools.has(e)||this.pools.set(e,new wn(e,i,s,n,a)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),wn.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):wn.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const e=this.freePool.pop();if(e==null)throw new Error("AG Charts - pool has no free instances");return wn.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");wn.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),wn.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const e=this.freePool.splice(0);for(const i of e)this.destroyItem(i);wn.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};kg.pools=new Map,kg.debug=uj.create(!0,"pool");var gj=kg,Fs=_d.create(!0,"opts"),vn=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=oo.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return oo.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return jI.getInstance(t)}static create(t,e){const i=_d.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Fs.group("AgCharts.create()",()=>{t=_d.inDevelopmentMode(()=>aT(Ba(t)))??t,this.licenseCheck(t);const s=jI.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e,apiStartTime:i});return this.licenseManager?.isDisplayWatermark()&&oo.injectWatermark?.(s.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),s})}static createFinancialChart(t){return Fs.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return Fs.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge-preset"}))}static __createSparkline(t){return Fs.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal",withDragInterpretation:!1})})}};vn.licenseChecked=!1;var ms=class zl{static getInstance(e){const i=Qc.getInstance(e);return i?GI.chartInstances.get(i):void 0}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:s,licenseManager:n,processedOverrides:a=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:r=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:o=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:d}=e,u=oo.styles==null?[]:[["ag-charts-enterprise",oo.styles]];if(km.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create().","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join(`
`));Fs(()=>[">>> AgCharts.createOrUpdate() user options",Ba(s)]);const{presetType:p}=o;let g=s;vn.optionsMutationFn&&g&&(g=vn.optionsMutationFn(Ba(g,hl.OPTIONS_CLONE_OPTS_FAST),p),Fs(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ba(g)]));const f=this.getPool(o);let y=!1,m,x=i?.chart;x==null&&f?.hasFree()&&(m=f.obtainFree(),x=m.item);const{document:v,window:S,styleContainer:I,skipCss:M,...D}=g??{},C=x?.getChartOptions(),A=new hl(C,D,a,{...r,document:v,window:S,styleContainer:I,skipCss:M},o,l,h,d);(x==null||Eo(A.processedOptions)!==Eo(x.chartOptions.processedOptions))&&(m?.release(),m=this.getPool(A.optionMetadata)?.obtain(A),m?x=m.item:(y=!0,x=zl.createChartInstance(A,x))),A.optionsGraph&&x.ctx.optionsGraphService.updateCallback((T,L,N)=>A.optionsGraph?.resolvePartial(T,L,N));for(const[T,L]of u)x.ctx.domManager.addStyles(T,L);return x.ctx.fontManager.updateFonts(A.googleFonts),c!=null&&x.ctx.dataService.restoreData(c),i==null?(i=new GI(x,zl.callbackApi,n),i.releaseChart=m?.release):(m||y)&&(i.releaseChart?.(),i.chart=x,i.releaseChart=m?.release),Fs.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[x.id]=x),x.queuedUserOptions.push(A.userOptions),x.queuedChartOptions.push(A),x.requestFactoryUpdate(T=>{Fs.group(">>>> Chart.applyOptions()",()=>{T.applyOptions(A);const L=T.queuedUserOptions.indexOf(A.userOptions)+1;T.queuedUserOptions.splice(0,L),T.queuedChartOptions.splice(0,L)})}),i}static updateUserDelta(e,i,s){i=Ba(i,hl.OPTIONS_CLONE_OPTS_FAST);const n=rT(i,zl.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Fs(()=>[">>> AgCharts.updateUserDelta() user delta",Ba(i)]),zl.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:n,apiStartTime:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0}),n=Eo(e.processedOptions);return km.getChartModule(n).create(e,s)}static getPool(e){if(e.pool===!0)return gj.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};ms.caretaker=new nT(fe),ms.callbackApi={caretaker:ms.caretaker,create(t,e,i,s,n){return ms.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s,data:n})},update(t,e,i,s){return ms.createOrUpdate({userOptions:t,proxy:e,specialOverrides:i,apiStartTime:s})},updateUserDelta(t,e,i){return ms.updateUserDelta(t,e,i)}},ms.markRemovedProperties=(t,e,i,s)=>{let n=s??!1;if(typeof t!="object"||t==null)return n;for(const a of oT(t))t[a]===void 0&&(Object.assign(t,{[a]:Symbol("UNSET")}),n||(n=!0));return n},ms.detachAndClear=t=>t.detachAndClear(),ms.destroy=t=>t.destroy();var jI=ms;import{ModuleRegistry as fj}from"ag-charts-core";var UI={};Pn(UI,{APPROXIMATE_THRESHOLD:()=>HE,AbstractBarSeries:()=>AD,AbstractBarSeriesProperties:()=>bl,AggregationManager:()=>ld,AnchoredPopover:()=>wM,ApproximateOrdinalTimeScale:()=>WH,Arc:()=>xs,Axis:()=>cp,AxisGroupZIndexMap:()=>Vx,AxisInterval:()=>ta,AxisLabel:()=>de,AxisTick:()=>ia,BBox:()=>R,Background:()=>Xa,BandScale:()=>Ei,BaseToolbar:()=>vf,Caption:()=>ge,CartesianAxis:()=>wo,CartesianCrossLine:()=>Tt,CartesianSeries:()=>Sn,CartesianSeriesNodeEvent:()=>Vg,CartesianSeriesProperties:()=>$i,CategoryAxis:()=>fl,CategoryScale:()=>or,Chart:()=>Qc,ChartAxes:()=>oc,ChartOptions:()=>hl,CollapseMode:()=>FD,ColorScale:()=>za,ContextMenuRegistry:()=>Hb,ContinuousScale:()=>se,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Ur,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Hr,DEFAULT_POLAR_DIRECTION_KEYS:()=>sM,DEFAULT_POLAR_DIRECTION_NAMES:()=>nM,DOMManager:()=>Yy,DataController:()=>Ix,DataModel:()=>Bu,DataModelSeries:()=>Fg,DataSet:()=>ar,DiscreteTimeAxis:()=>uM,DraggablePopover:()=>EM,DropShadow:()=>bs,ExtendedPath2D:()=>Ga,FillGradientDefaults:()=>en,FillImageDefaults:()=>Ms,FillPatternDefaults:()=>Ge,FloatingToolbar:()=>x4,FormatManager:()=>tr,Group:()=>z,GroupWidget:()=>Zy,HierarchyHighlightState:()=>oM,HierarchyNode:()=>OH,HierarchySeries:()=>wH,HierarchySeriesProperties:()=>Cn,HighlightManager:()=>Yb,HighlightProperties:()=>Ds,HighlightState:()=>Kb,Image:()=>$r,InteractionManager:()=>db,InteractionState:()=>hb,LARGEST_KEY_INTERVAL:()=>zb,Label:()=>ri,LabelStyle:()=>ai,LayoutElement:()=>Ju,Line:()=>ni,LinearScale:()=>Na,LogScale:()=>Rg,Marker:()=>je,Menu:()=>h4,MercatorScale:()=>EH,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ri,NativeWidget:()=>qa,NiceMode:()=>_x,Node:()=>vs,OrdinalTimeScale:()=>sn,Path:()=>Be,PointerEvents:()=>$m,PolarAxis:()=>ff,PolarSeries:()=>hf,QuadtreeNearest:()=>tD,RadialColumnShape:()=>Zi,Range:()=>ss,Rect:()=>ze,Rotatable:()=>Ua,RotatableText:()=>Py,SMALLEST_KEY_INTERVAL:()=>Bb,Scalable:()=>ql,ScalableGroup:()=>xL,Scene:()=>uc,Sector:()=>Dt,SectorBox:()=>vM,SegmentedPath:()=>Pg,Selection:()=>we,Series:()=>Vo,SeriesItemHighlightStyle:()=>Qs,SeriesMarker:()=>Bt,SeriesNodeEvent:()=>$c,SeriesNodePickMode:()=>Lv,SeriesProperties:()=>wi,SeriesTooltip:()=>zs,Shape:()=>zn,SliderWidget:()=>Iu,StopProperties:()=>qd,SvgPath:()=>bM,Text:()=>Gt,TimeAxisParentLevel:()=>jr,TimeScale:()=>lr,Toolbar:()=>m4,ToolbarButtonWidget:()=>RM,ToolbarWidget:()=>dc,TooltipManager:()=>Dc,Transformable:()=>ve,TransformableGroup:()=>Wa,TransformableText:()=>Za,Translatable:()=>Ha,TranslatableGroup:()=>gt,TranslatableSvgPath:()=>HH,UnitTimeScale:()=>nn,ZoomManager:()=>fx,accumulativeValueProperty:()=>zu,addHitTestersToQuadtree:()=>Kh,adjustLabelPlacement:()=>uD,angleCategoryAxisOptionsDefs:()=>Qp,angleNumberAxisOptionsDefs:()=>PS,animationValidation:()=>Ao,annotationCalloutStylesDefs:()=>H0,annotationChannelTextDefs:()=>V0,annotationCommentStylesDefs:()=>W0,annotationCrossLineStyleDefs:()=>fg,annotationDisjointChannelStyleDefs:()=>j0,annotationFibonacciStylesDefs:()=>mg,annotationLineStyleDefs:()=>wh,annotationLineTextDefs:()=>Oh,annotationMeasurerStylesDefs:()=>Eh,annotationNoteStylesDefs:()=>Y0,annotationOptionsDef:()=>Er,annotationParallelChannelStyleDefs:()=>U0,annotationQuickMeasurerStylesDefs:()=>$0,annotationShapeStylesDefs:()=>yg,annotationTextStylesDef:()=>il,boxPlotSeriesThemeableOptionsDef:()=>Q0,buildResetPathFn:()=>lf,calculateDataDiff:()=>tM,calculateLabelTranslation:()=>FH,calculateSegments:()=>jh,candlestickSeriesThemeableOptionsDef:()=>tI,checkCrisp:()=>XD,chordSeriesThemeableOptionsDef:()=>iI,clippedRoundRect:()=>ic,collapsedStartingBarPosition:()=>Il,computeBarFocusBounds:()=>Qg,computeMarkerFocusBounds:()=>nd,coneFunnelSeriesThemeableOptionsDef:()=>sI,createDatumId:()=>ft,diff:()=>Sc,drawCorner:()=>uo,drawMarkerUnitPolygon:()=>Bo,findNodeDatumInArray:()=>qb,findQuadtreeMatch:()=>Zh,fixNumericExtent:()=>Ut,fromToMotion:()=>Oe,funnelSeriesThemeableOptionsDef:()=>nI,generateTicks:()=>uv,getColorStops:()=>ay,getCrossLineValue:()=>Rx,getItemStyles:()=>Yu,getItemStylesPerItemId:()=>NE,getLabelStyles:()=>ka,getMarkerStyles:()=>ad,getMissCount:()=>Tb,getRadialColumnWidth:()=>MM,getShapeFill:()=>Tv,getShapeStyle:()=>Ip,groupAccumulativeValueProperty:()=>Do,hasDimmedOpacity:()=>$u,heatmapSeriesThemeableOptionsDef:()=>aI,initialStatePickedOptionsDef:()=>Cu,interpolatePoints:()=>Sl,isTooltipValueMissing:()=>aa,keyProperty:()=>Js,makeSeriesTooltip:()=>wa,mapLineBackgroundSeriesThemeableOptionsDef:()=>lI,mapLineSeriesThemeableOptionsDef:()=>oI,mapMarkerSeriesThemeableOptionsDef:()=>cI,mapShapeBackgroundSeriesThemeableOptionsDef:()=>dI,mapShapeSeriesThemeableOptionsDef:()=>hI,markerEnabled:()=>af,markerFadeInAnimation:()=>Al,markerSwipeScaleInAnimation:()=>nf,midpointStartingBarPosition:()=>xH,minimumTimeAxisDatumGranularity:()=>oD,motion:()=>S4,nightingaleSeriesThemeableOptionsDef:()=>uI,normaliseGroupTo:()=>xc,ohlcSeriesThemeableOptionsDef:()=>rI,ordinalTimeAxisOptionsDefs:()=>Cr,pairUpSpans:()=>vl,pathFadeInAnimation:()=>of,pathMotion:()=>cd,pathSwipeInAnimation:()=>rf,plotAreaPathFill:()=>QD,plotInterpolatedLinePathStroke:()=>ed,plotLinePathStroke:()=>Xg,predictCartesianFinancialAxis:()=>bj,predictCartesianNonPrimitiveAxis:()=>pl,prepareAreaFillAnimationFns:()=>eM,prepareBarAnimationFunctions:()=>Dl,prepareLinePathPropertyAnimation:()=>qg,processedDataIsAnimatable:()=>vi,pyramidSeriesThemeableOptionsDef:()=>pI,radarAreaSeriesThemeableOptionsDef:()=>gI,radarLineSeriesThemeableOptionsDef:()=>fI,radialBarSeriesThemeableOptionsDef:()=>mI,radialColumnSeriesThemeableOptionsDef:()=>yI,radiusCategoryAxisOptionsDefs:()=>FS,radiusNumberAxisOptionsDefs:()=>_S,rangeAreaSeriesThemeableOptionsDef:()=>vI,rangeBarSeriesThemeableOptionsDef:()=>II,resetAxisLabelSelectionFn:()=>Fc,resetBarSelectionsDirect:()=>td,resetBarSelectionsFn:()=>Ml,resetLabelFn:()=>Oa,resetMarkerFn:()=>id,resetMarkerPositionFn:()=>Cl,resetMarkerSelectionsDirect:()=>sd,resetMotion:()=>at,sankeySeriesThemeableOptionsDef:()=>DI,sectorBox:()=>fM,seriesLabelFadeInAnimation:()=>Te,seriesLabelFadeOutAnimation:()=>Yh,stackCartesianSeries:()=>hD,standaloneChartOptionsDefs:()=>zO,sunburstSeriesThemeableOptionsDef:()=>MI,toHierarchyHighlightString:()=>Tl,toHighlightString:()=>nr,topologyChartOptionsDefs:()=>BO,trailingAccumulatedValueProperty:()=>iE,treemapSeriesThemeableOptionsDef:()=>AI,updateClipPath:()=>rd,updateLabelNode:()=>dD,upsertNodeDatum:()=>ef,userInteraction:()=>ZE,validateCrossLineValue:()=>Px,valueProperty:()=>he,visibleRangeIndices:()=>Co,waterfallSeriesThemeableOptionsDef:()=>CI});import{CARTESIAN_AXIS_TYPE as ul,CARTESIAN_POSITION as Gh,ChartAxisDirection as Vs,isArray as mj,isDate as HI,isEmptyObject as yj,isNumber as WI,isObject as YI,isString as $I}from"ag-charts-core";function KI(t){return t.isReversed()!==t.range[1]<t.range[0]}function jh(t,e,i,s,n,a=!0){if(e.scale.domain.length===0||i.scale.domain.length===0)return;const r=t.key===Vs.X?e:i,{scale:o,direction:l}=r,c=l===Vs.X,h=o.bandwidth??0,d=a?((o.step??0)-h)/2:0,u=Math.max(s.x,n.width-(s.x+s.width)),p=Math.max(s.y,n.height-(s.y+s.height)),g=()=>KI(c?e:i)?c?s.width+u:s.height+p:c?-u:-p,f=()=>KI(c?e:i)?c?-u:-p:c?s.width+u:s.height+p;return(m=>{const x=[];let v=-1;for(let S=0;S<m.length;S++){const I=m[S];if(yj(I))continue;const{start:M,stop:D,...C}=m[S],A=m[v]?.stop,T=m.slice(S+1).find(k=>k.start!=null)?.start;let L=o.convert(M??A)-d,N=o.convert(D??T)+2*d;const O=M!=null&&Number.isNaN(L),E=D!=null&&Number.isNaN(N);O||E||(Number.isNaN(L)&&(L=g()),Number.isNaN(N)&&(N=f()),D!=null&&(v=S),x.push({start:L,stop:N,...C}))}return x})(t.segments).map(({stop:m,start:x,...v})=>{const S=c?x:-u,I=c?-p:x,M=c?m+h:s.width+u,D=c?s.height+p:m+h;return{clipRect:{x0:S,y0:I,x1:M,y1:D},...v}})}var ZI=new Set(["time","timestamp","date","datetime"]);function Og(t,e,i,{allowPrimitiveTypes:s=!0}={}){if(t!==Vs.X&&t!==Vs.Y||!YI(e))return;const n=XI(t,i);if(n==null||!(n in e))return;const a=e[n],r=qI(t,i),o=xj(a);if(o)return{type:o,position:r};const l=vj(n,a);if(l)return{type:l,position:r};if(s)return typeof a=="number"?{type:ul.NUMBER,position:r}:{type:ul.CATEGORY,position:r}}function pl(t,e,i){return Og(t,e,i,{allowPrimitiveTypes:!1})}function bj(t,e,i){if(t!==Vs.X||!YI(e))return;const s=XI(t,i);if(s==null||!(s in e))return;const n=e[s],a=qI(t,i),r=Sj(s,n);if(r)return{type:r,position:a};if($I(n))return{type:"category",position:a}}function xj(t){if(mj(t)&&t.every(e=>$I(e)||e===null))return ul.GROUPED_CATEGORY}function vj(t,e){if(HI(e)||ZI.has(t)&&WI(e))return ul.TIME}function Sj(t,e){if(HI(e)||ZI.has(t)&&WI(e))return ul.ORDINAL_TIME}function XI(t,e){if(t===Vs.X&&"xKey"in e)return e.xKey;if(t===Vs.Y&&"yKey"in e)return e.yKey}function qI(t,e){return"direction"in e&&e.direction==="horizontal"?t===Vs.X?Gh.LEFT:Gh.BOTTOM:t===Vs.X?Gh.BOTTOM:Gh.LEFT}import{ChartAxisDirection as ne,Debug as Ij,DebugMetrics as Dj,Property as gl,StateMachine as Mj,extractDomain as JI,findMaxIndex as Aj,findMinIndex as Cj,findMinMax as Uh,isFiniteNumber as Hh}from"ag-charts-core";import{createTicks as Tj,findMinMax as QI,findRangeExtent as Lj,isDenseInterval as Nj,isInteger as kj,range as Oj}from"ag-charts-core";var wj={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},Ej=(t,e)=>Math.log(e)/Math.log(t);function wg(t,e,i){const s=Math.min(...e),n=wj[t]??Ej;return s>=0?n(t,i):-n(t,-i)}var Rj={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},Pj=(t,e)=>t**e;function Eg(t,e,i){const s=Math.min(...e),n=Rj[t]??Pj;return s>=0?n(t,i):-n(t,-i)}var Rg=class FC extends se{constructor(e=[1,10],i=[0,1]){super(e,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>wg(this.base,this.domain,s),this.pow=s=>Eg(this.base,this.domain,s)}static is(e){return e instanceof FC}transform(e){const[i,s]=QI(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[i,s]=QI(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.exp(e):-Math.exp(-e)}toDomain(e){return e}niceDomain(e,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,a]=i,r=n>a?Math.ceil:Math.floor,o=n>a?Math.floor:Math.ceil,l=Eg(s,i,r(wg(s,i,n))),c=Eg(s,i,o(wg(s,i,a)));return[e.nice[0]?l:i[0],e.nice[1]?c:i[1]]}ticks({interval:e,tickCount:i=se.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const a=this.base,[r,o]=s,l=Math.min(r,o),c=Math.max(r,o);let h=this.log(l),d=this.log(c);if(e){const y=M=>M>=l&&M<=c,m=Math.min(Math.abs(e),Math.abs(d-h)),{ticks:x,count:v,firstTickIndex:S}=Oj(h,d,m,n),I=x.map(this.pow).filter(y);if(!Nj(I.length,this.getPixelRange()))return{ticks:I,count:v,firstTickIndex:S}}if(!kj(a)||d-h>=i){const y=Math.min(d-h,i),{ticks:m,count:x,firstTickIndex:v}=Tj(h,d,y,void 0,void 0,n);return{ticks:m.map(this.pow),count:x,firstTickIndex:v}}const u=[],p=l>0;h=Math.floor(h)-1,d=Math.round(d)+1;const g=Lj(this.range)/i;let f=1/0;for(let y=h;y<=d;y++){const m=this.convert(this.pow(y+1));for(let x=1;x<a;x++){const v=p?x:a-x+1,S=this.pow(y)*v,I=this.convert(S),M=Math.abs(f-I),D=Math.abs(I-m),C=M>=g&&D>=g;S>=l&&S<=c&&(x===1||C||u.length===0)&&(u.push(S),f=I)}}return ey(u,p,n)}};import{SceneRefChangeDetection as _j,getPath2D as Fj}from"ag-charts-core";import{SceneRefChangeDetection as Vj,getPath2D as Bj}from"ag-charts-core";var Pg=class extends Be{constructor(){super(...arguments),this.segmentPath=new Be}drawPath(t){if(!this.segments||this.segments.length===0){super.drawPath(t);return}t.save();const e=Bj(),i=new e;Gr(i,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const n of this.segments)Gr(i,n.clipRect);t.clip(i),super.drawPath(t),t.restore();const{segmentPath:s}=this;s.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:n,fill:a,stroke:r,...o}of this.segments){t.save(),s.path=this.path,s.setProperties(o),s.fill=this.fill==null?"none":a,s.stroke=this.stroke==null?"none":r;const l=new e;Gr(l,n),t.clip(l),s.drawPath(t),t.restore()}}};b([Vj()],Pg.prototype,"segments",2);function Gr(t,{x0:e,y0:i,x1:s,y1:n},a=!0){const r=Math.min(e,s),o=Math.min(i,n),l=Math.max(e,s),c=Math.max(i,n);t.moveTo(r,o),a?(t.lineTo(l,o),t.lineTo(l,c),t.lineTo(r,c)):(t.lineTo(r,c),t.lineTo(l,c),t.lineTo(l,o)),t.closePath()}var eD=class extends gt{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(ql(Be))}renderInContext(t){if(!this.visible)return;const{ctx:e}=t;if(!this.segments||this.segments?.length===0)return super.renderInContext(t);e.save();const i=Fj(),s=new i;Gr(s,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const a of this.segments)Gr(s,a.clipRect);e.clip(s);for(const a of this.children())a.visible&&a.render(t);e.restore();const{scalablePath:n}=this;for(const{clipRect:a,...r}of this.segments){e.save();const o=new i;Gr(o,a),e.clip(o),n.setProperties(r);for(const l of this.children())!l.visible||!(l instanceof Be)||(n.path=l.path,n.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...bL(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),n.render(t));e.restore()}}};b([_j()],eD.prototype,"segments",2);import{nearestSquared as zj}from"ag-charts-core";var tD=class{constructor(t,e,i){this.root=new Uj(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(s,n)=>t.distanceSquared(s,n)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},Gj=class{constructor(t,e,i,s){this.nw=t,this.ne=e,this.sw=i,this.se=s}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},jj=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??R.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(this.subdivisions===void 0?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:s}=this.boundary,{capacity:n}=this,a=this.maxdepth-1,r=i/2,o=s/2,l=new R(t,e,r,o),c=new R(t+r,e,r,o),h=new R(t,e+o,r,o),d=new R(t+r,e+o,r,o);return new Gj(this.child(n,a,l),this.child(n,a,c),this.child(n,a,h),this.child(n,a,d))}},Uj=class VC extends jj{addCondition(e){const{x:i,y:s}=e.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(e,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(e,i)<n.distanceSquared}findAction(e,i,s){const n=zj(e,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(e,i,s){return new VC(e,i,s)}};import{Property as Wh,normalisedExtentWithMetadata as Hj}from"ag-charts-core";import{createTicks as Wj,isDenseInterval as Yj,niceTicksDomain as $j,range as Kj,tickStep as Zj}from"ag-charts-core";var Na=class vm extends se{constructor(){super([0,1],[0,1]),this.type="number"}static is(e){return e instanceof vm}static getTickStep(e,i,s){const{interval:n,tickCount:a=se.defaultTickCount,minTickCount:r,maxTickCount:o}=s;return n??Zj(e,i,a,r,o)}toDomain(e){return e}ticks({interval:e,tickCount:i=se.defaultTickCount,minTickCount:s,maxTickCount:n},a=this.domain,r){if(!a||a.length<2||i<1||!a.every(Number.isFinite))return{ticks:[],count:0,firstTickIndex:0};const[o,l]=a;if(e){const c=Math.abs(e);if(!Yj((l-o)/c,this.getPixelRange()))return Kj(o,l,c,r)}return Wj(o,l,i,s,n,r)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:s=se.defaultTickCount}=e;let[n,a]=i;if(s===1)[n,a]=$j(n,a);else if(s>1){const r=n>a?Math.ceil:Math.floor,o=n>a?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,d=a,u=vm.getTickStep(n,a,e),[p,g]=i;if(n=r(p/u)*u,a=o(g/u)*u,n===h&&a===d)break}}return[e.nice[0]?n:i[0],e.nice[1]?a:i[1]]}},mi=class extends wo{constructor(t,e=new Na){super(t,e)}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&t<e}normaliseDataDomain(t){const{min:e,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:r}=Hj(t.domain,e,i,s,n,void 0,t.sortMetadata?.sortOrder);return{domain:a,clipped:r}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}getVisibleDomain(t){const[e,i]=t,[s,n]=this.visibleRange,a=i-e;return[e+s*a,i-(1-n)*a]}tickFormatParams(t,e,i){return{type:"number",visibleDomain:this.getVisibleDomain(t),fractionDigits:i}}datumFormatParams(t,e,i){const{datum:s,seriesId:n,legendItemName:a,key:r,source:o,property:l,domain:c,boundSeries:h}=e,d=this.getVisibleDomain(c);return{type:"number",value:t,datum:s,seriesId:n,legendItemName:a,key:r,source:o,property:l,domain:c,visibleDomain:d,boundSeries:h,fractionDigits:i}}};mi.className="NumberAxis",mi.type="number",b([Wh],mi.prototype,"min",2),b([Wh],mi.prototype,"max",2),b([Wh],mi.prototype,"preferredMin",2),b([Wh],mi.prototype,"preferredMax",2);import{BaseProperties as Xj,Logger as qj,Property as Bs,ProxyPropertyOnWrite as Jj,dateTruncationForDomain as Qj,intervalEpoch as iD,intervalFloor as eU,intervalMilliseconds as _g,intervalStep as sD,intervalUnit as nD,lowestGranularityForInterval as aD,lowestGranularityUnitForTicks as tU,lowestGranularityUnitForValue as iU,normalisedTimeExtentWithMetadata as rD}from"ag-charts-core";var jr=class extends Xj{constructor(){super(...arguments),this.enabled=!1,this.label=new de,this.tick=new ia}};b([Bs],jr.prototype,"enabled",2),b([Bs],jr.prototype,"label",2),b([Bs],jr.prototype,"tick",2);var ys=class extends wo{constructor(t){super(t,new lr),this.parentLevel=new jr,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0}get _unit(){}set _unit(t){qj.warnOnce("To use 'unit', use an axis with type 'unit-time' instead of 'time'.")}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&t<e}isCategoryLike(){return!1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(t){const{extent:e,clipped:i}=rD(t,this.min,this.max,this.preferredMin,this.preferredMax);return{domain:e,clipped:i}}processData(){super.processData();const{boundSeries:t,direction:e,min:i,max:s}=this;this.minimumTimeGranularity=oD(t,e,i,s)}tickFormatParams(t,e,i,s){s??(s=tU(e));const n=Qj(t),a=nD(s),r=sD(s),o=iD(s);return{type:"date",unit:a,step:r,epoch:o,truncateDate:n}}datumFormatParams(t,e,i,s,n){if(typeof t=="number"&&(t=new Date(t)),s==null){const{minimumTimeGranularity:y}=this,m=iU(t);y!=null&&_g(y)<_g(m)?s=y:s=m}const{datum:a,seriesId:r,legendItemName:o,key:l,source:c,property:h,domain:d,boundSeries:u}=e,p=nD(s),g=sD(s),f=iD(s);return{type:"date",value:t,datum:a,seriesId:r,legendItemName:o,key:l,source:c,property:h,domain:d,boundSeries:u,unit:p,step:g,epoch:f,style:n}}};ys.className="TimeAxis",ys.type="time",b([Bs],ys.prototype,"parentLevel",2),b([Bs],ys.prototype,"min",2),b([Bs],ys.prototype,"max",2),b([Bs],ys.prototype,"preferredMin",2),b([Bs],ys.prototype,"preferredMax",2),b([Bs,Jj("_unit")],ys.prototype,"unit",2);function oD(t,e,i,s){const n=t.reduce((a,r)=>Math.min(r.minTimeInterval()??1/0,a),1/0);return Number.isFinite(n)?aD(n):lD(t,e,i,s)?.unit}function lD(t,e,i,s){let n=1/0,a=-1/0,r,o=0;const l=[];for(const u of t){if(!u.visible)continue;const{extent:p}=rD(u.getDomain(e));if(p.length===0)continue;const g=p[0].valueOf(),f=p.at(-1).valueOf();l.push(g,f),n=Math.min(n??1/0,g,f),a=Math.max(a??-1/0,g,f);const y=Math.abs(f-g);if(y===0)continue;const m=u.dataCount();if(o=Math.max(o,m),m<=1)continue;const x=y/(m-1);r=Math.min(r??1/0,x)}if(n=Math.min(n,i?.valueOf()??1/0,s?.valueOf()??1/0),a=Math.max(a,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(n)||!Number.isFinite(a))return;r??(r=Math.abs(a-n)),r=Math.min(r,sU(l));const c=aD(r);let h=r/_g(c);o<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const d=h===1?void 0:eU(c,n);return{unit:c,step:h,epoch:d}}function sU(t){t.sort((i,s)=>i-s);let e=1/0;for(let i=1;i<t.length;i++){const s=t[i-1],n=t[i];n-s>0&&(e=Math.min(e,Math.abs(n-s)))}return e}import{ChartAxisDirection as cD,clamp as nU,objectsEqual as aU}from"ag-charts-core";var Fg=class extends Vo{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:t,yScale:e}){const i=se.is(t),s=se.is(e);return{isContinuousX:i,isContinuousY:s,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes[cD.X]?.scale,e=this.axes[cD.Y]?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await t.request(this.id,e??ar.empty(),i);return this.dataModel=s,this.processedData=n,this.events.emit("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const{processedData:t,ctx:e}=this;if(!t)return!1;const i=this.getNodeData();if(i!=null&&i.length>e.animationManager.maxAnimatableItems)return!1;const s=t.reduced?.animationValidation;if(!s)return!0;const{orderedKeys:n,uniqueKeys:a}=s;return n&&a}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return qb(t,this.getNodeData())}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:s}=this,n=e[i],a={...t,datumIndex:i},r=this.computeFocusBounds(a);if(r!==void 0)return{bounds:r,clipFocusBox:s,datum:n,datumIndex:i}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,s)=>i.datumIndex-s.datumIndex),e}isDatumEnabled(t,e){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=t[e];return!i&&s&&n}computeFocusDatumIndex(t,e){const i=(r,o)=>{for(;r>=0&&!this.isDatumEnabled(e,r);)r+=o;return r===-1?void 0:r},s=(r,o)=>{for(;r<e.length&&!this.isDatumEnabled(e,r);)r+=o;return r===e.length?void 0:r};let n;const a=nU(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?n=i(a,t.datumIndexDelta):t.datumIndexDelta>0?n=s(a,t.datumIndexDelta):n=s(a,1)??i(a,-1),n===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:n}dataModelPropertyIsKey(t){const{processedData:e}=this;return e?e.defs.keys.some(i=>i.id===t&&i.idsMap?.get(this.id)?.has(t)===!0):!1}keysOrValues(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:this.dataModelPropertyIsKey(t)?e.resolveKeysById(this,t,i):e.resolveColumnById(this,t,i)}sortOrder(t){const{dataModel:e,processedData:i}=this;if(!(!e||!i))return this.dataModelPropertyIsKey(t)?e.getKeySortOrder(this,t,i):e.getColumnSortOrder(this,t,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();return!e||!i||!s||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(s)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();if(!e||!i||!s)return;t=t.valueOf();const n=e.invalidData?.get(this.id),a=this.keysOrValues(s);for(let r=0;r<a.length;r+=1){if(n?.[r]===!0)continue;const o=a[r]?.valueOf();if(aU(t,o))return r}}},Ur={[ne.X]:["xKey"],[ne.Y]:["yKey"]},Hr={[ne.X]:["xName"],[ne.Y]:["yName"]},Vg=class extends $c{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},$i=class extends wi{constructor(){super(...arguments),this.xKeyAxis="x",this.yKeyAxis="y",this.pickOutsideVisibleMinorAxis=!1,this.segmentation=new Ic}};b([gl],$i.prototype,"xKeyAxis",2),b([gl],$i.prototype,"yKeyAxis",2),b([gl],$i.prototype,"legendItemName",2),b([gl],$i.prototype,"pickOutsideVisibleMinorAxis",2),b([gl],$i.prototype,"segmentation",2);var Bg=100,Sn=class extends Fg{constructor({pathsPerSeries:t=["path"],pathsZIndexSubOrderOffset:e=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:s=!1,animationAlwaysPopulateNodeData:n=!1,segmentedDataNodes:a=!0,animationResetFns:r,propertyKeys:o,propertyNames:l,...c}){if(super({propertyKeys:o,propertyNames:l,canHaveAxes:!0,...c}),this.NodeEvent=Vg,this.dataNodeGroup=this.contentGroup.appendChild(new eD({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new gt({name:`${this.id}-series-labels`})),this.labelSelection=we.select(this.labelGroup,Gt),this.highlightSelection=we.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=we.select(this.highlightLabelGroup,Gt),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=Ij.create(),!o||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,pathsZIndexSubOrderOffset:e,propertyKeys:o,propertyNames:l,animationResetFns:r,animationAlwaysUpdateSelections:s,animationAlwaysPopulateNodeData:n,datumSelectionGarbageCollection:i,segmentedDataNodes:a},this.paths=t.map(h=>new Pg({name:`${this.id}-${h}`})),this.datumSelection=we.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new Mj("empty",{empty:{update:{target:"ready",action:h=>this.animateEmptyUpdateReady(h)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:h=>this.animateReadyHighlight(h),resize:h=>this.animateReadyResize(h),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:h=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(h):this.animateWaitingUpdateReady(h)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:h=>this.resetAllAnimation(h),reset:"empty"},clearing:{update:{target:"empty",action:h=>this.animateClearingUpdateEmpty(h)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",h=>this.onLegendItemClick(h)),this.ctx.eventsHub.on("legend:item-double-click",h=>this.onLegendItemDoubleClick(h)))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(t){if(this.shouldFlipXY()){if(t===ne.X)return this.properties.yKeyAxis;if(t===ne.Y)return this.properties.xKeyAxis}if(t===ne.X)return this.properties.xKeyAxis;if(t===ne.Y)return this.properties.yKeyAxis}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(t){for(const e of t)this.contentGroup.appendChild(e)}detachPaths(t){for(const e of t)e.remove()}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>Bg}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(t){if(!this.properties.highlight.enabled)return!1;const{series:e,legendItemName:i}=t??{},{legendItemName:s}=this.properties;return e===this||s!=null&&s===i}strokewidthChange(){const t=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,e=this.properties.highlight.highlightedSeries.strokeWidth??t,i=this.properties.highlight.highlightedItem?.strokeWidth??t;return t>i||e>i}update({seriesRect:t}){const{_contextNodeData:e}=this,i=this.checkResize(t),s=this.updateHighlightSelection(),n=this;this.contentGroup.batchedUpdate(function(){const o=n.updateSelections(),l=n.contextNodeData?.segments;n.opts.segmentedDataNodes?n.dataNodeGroup.segments=l??n.dataNodeGroup.segments:n.dataNodeGroup.segments=void 0,n.updateNodes(s,i||o)});const a=this.getAnimationData(t,e);a&&(i&&this.animationState.transition("resize",a),this.animationState.transition("update",a),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(t=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!vi(i)||t:!1}trimIncrementalNodeArray(t,e){e<t.length&&(t.length=e)}createNodeData(){const t=this.validateCreateNodeDataPreconditions();if(!t)return;const{xAxis:e,yAxis:i}=t,s=this.createNodeDatumContext(e,i);if(!s)return this.getEmptyResult();const n=this.initializeResult(s);return!this.visible&&(this.seriesGrouping==null&&!this.opts.animationAlwaysPopulateNodeData||!s.animationEnabled)?n:(this.populateNodeData(s),this.finalizeNodeData(s),this.assembleResult(s,n))}createNodeDatumContext(t,e){throw new Error(`${this.constructor.name}: createNodeDatumContext() must be implemented when using the template method pattern`)}populateNodeData(t){throw new Error(`${this.constructor.name}: populateNodeData() must be implemented when using the template method pattern`)}initializeResult(t){throw new Error(`${this.constructor.name}: initializeResult() must be implemented when using the template method pattern`)}validateCreateNodeDataPreconditions(){const t=this.axes[ne.X],e=this.axes[ne.Y];if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getEmptyResult(){}finalizeNodeData(t){t.canIncrementallyUpdate&&this.trimIncrementalNodeArray(t.nodes,t.nodeIndex)}assembleResult(t,e){return e}updateSelections(){var t;const e=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&e)return!1;const{nodeDataRefresh:i}=this;if(!i&&!this.isPathOrSelectionDirty())return!1;if(i){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();if(this._contextNodeData){(t=this._contextNodeData).animationValid??(t.animationValid=s);const r=this._contextNodeData.nodeData?.length;r!=null&&Dj.record(`${this.type}:nodeData`,r)}const{dataModel:n,processedData:a}=this;n!==void 0&&a!==void 0&&this.events.emit("data-update",{dataModel:n,processedData:a}),this.updateSeriesSelections()}return i}updateSeriesSelections(){const{datumSelection:t,labelSelection:e,paths:i}=this,s=this._contextNodeData;if(!s)return;const{nodeData:n,labelData:a,itemId:r}=s;this.updatePaths({itemId:r,contextData:s,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:t}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:e})??e})}getShapeFillBBox(){const{axes:t}=this,e=t[ne.X],i=t[ne.Y],[s,n]=Uh(e?.range??[0,1]),[a,r]=Uh(i?.range??[0,1]),o=JI(this.getSeriesDomain(ne.X)),l=[e?.scale.convert(o.at(0)),e?.scale.convert(o.at(-1))],c=JI(this.getSeriesDomain(ne.Y)),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=Uh(l),[p,g]=Uh(h);return{axis:new R(s,a,n-s,r-a),series:new R(d,p,u-d,g-p)}}updateNodes(t,e){const{highlightSelection:i,datumSelection:s}=this,n=!this.ctx.animationManager.isSkipped(),a=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=n||a,this.highlightGroup.visible=(n||a)&&t,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const r=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:r}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i);const{dataNodeGroup:o,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:d}=this.contextNodeData??{};if(this.updatePathNodes({itemId:d,paths:c,visible:a,animationEnabled:n}),o.visible=n||a,h.visible=a,!o.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:s,isHighlight:!1});const u=this.strokewidthChange()||this.hasChangesOnHighlight;(e||u)&&(this.updateDatumNodes({datumSelection:s,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(t,e){return e?[{...e}]:void 0}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum&&s.itemId===e.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:t,highlightLabelSelection:e,_contextNodeData:i}=this;if(!i)return!1;const s=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(s)&&s?.datum?s:void 0;if(a==null)return!1;const{nodeData:r,labelData:o}=i,l=this.getHighlightData(r,a);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:t});const c=this.getHighlightLabelData(o,a)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:c,labelSelection:e})??e,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const t=this.ctx.scene?.canvas??{width:0,height:0},e=new R(0,0,t.width,t.height);this.quadtree=new tD(100,10,e),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodeDataExactShape(t){const{x:e,y:i}=t,{dataNodeGroup:s}=this,n=s.pickNodes(e,i).filter(a=>a.datum.missing!==!0);if(n.length!==0)return n.map(r=>r.datum)}pickModulesExactShape(t){for(const e of this.moduleMap.modules()){const{datum:i}=e.pickNodeExact(t)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.length!==0?e:this.pickNodeDataExactShape(t)??this.pickModulesExactShape(t)??[]}pickNodeDataClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const a=s[ne.X],r=s[ne.Y],o={x:e,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(u)||!(a?.inRange(d)&&r?.inRange(u)))continue;const g=Math.max((o.x-d)**2+(o.y-u)**2,0);g<l&&(l=g,c=h)}if(l!=null)return{datum:c,distance:Math.sqrt(l)}}pickModulesClosestDatum(t){let e=1/0,i;for(const s of this.moduleMap.modules()){const n=s.pickNodeNearest(t);n!==void 0&&n.distanceSquared<e&&(e=n.distanceSquared,i=n.datum)}if(e!=null)return{datum:i,distance:Math.sqrt(e)}}pickNodeClosestDatum(t){let e=1/0,i;const s=this.pickNodeDataClosestDatum(t);s!=null&&s.distance<e&&(e=s.distance,i=s.datum);const n=this.pickModulesClosestDatum(t);if(n!=null&&n.distance<e&&(e=n.distance,i=n.datum),i){const a=Math.max(e-(i.point?.size??0)/2,0);return{datum:i,distance:a}}}pickNodeMainAxisFirst(t,e){const{x:i,y:s}=t,{axes:n,_contextNodeData:a}=this,{pickOutsideVisibleMinorAxis:r}=this.properties;if(!a)return;const o=n[ne.X],l=n[ne.Y];if(o==null||l==null)return;const c=[o,l].filter(g=>g.isCategoryLike()).map(g=>g.direction);if(e&&c.length===0)return;const[h=ne.X]=c,d=[i,s];h!==ne.X&&d.reverse();const u=[1/0,1/0];let p;for(const g of a.nodeData){const{x:f=Number.NaN,y=Number.NaN}=g.point??g.midPoint??{};if(Number.isNaN(f)||Number.isNaN(y)||g.missing===!0)continue;const m=[o?.inRange(f,1),l?.inRange(y,1)];if(h!==ne.X&&m.reverse(),!m[0]||!r&&!m[1])continue;const x=[f,y];h!==ne.X&&x.reverse();let v=!0;for(let S=0;S<x.length;S++){const I=Math.abs(x[S]-d[S]);if(I>u[S]){v=!1;break}else I<u[S]&&(u[S]=I,u.fill(1/0,S+1,u.length))}v&&(p=g)}if(p){let g=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const f of this.moduleMap.modules()){const y=f.pickNodeMainAxisFirst(t,h);if(y!=null&&y.distanceSquared<g){p=y.datum,g=y.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(t,e,i,s){let n;if(s==null){const{processedData:c,dataModel:h}=this;n=h.getColumnSortOrder(this,t,c)??1}else n=s.sortOrder;const a=this.keysOrValues(t),r=0,[o,l]=Co(n,i?.length??a.length,e,c=>{const h=i?.[c]??c;return this.xCoordinateRange(a[h],r,h)});return o<l?[o,l]:[l,o]}domainForVisibleRange(t,e,i,s,n){const{processedData:a,dataModel:r}=this,[o,l]=s,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const g=this.visibleRangeIndices(i,s,n,{sortOrder:h});return r.getDomainBetweenRange(this,e,g,a)}const d=e.map(g=>this.keysOrValues(g));let u=1/0,p=-1/0;for(const[g,f]of c.entries()){const[y,m]=this.xCoordinateRange(f,0,g);if(!(m<o||y>l))for(let x=0;x<e.length;x++){const v=d[x][g];u=Math.min(u,v),p=Math.max(p,v)}}return u>p?[Number.NaN,Number.NaN]:[u,p]}domainForClippedRange(t,e,i){const{processedData:s,dataModel:n,axes:a}=this,r=t===ne.X?ne.Y:ne.X,o=rU(a[r]);if(!o)return e.flatMap(g=>n.getDomain(this,g,"value",s).domain);const l=this.keysOrValues(i),c=n.getColumnSortOrder(this,i,s);if(c!=null){const g=oU(c,l.length,o,f=>l[f]);return n.getDomainBetweenRange(this,e,g,s)}const h=e.map(g=>this.keysOrValues(g)),d=o[0].valueOf(),u=o[1].valueOf(),p=[];for(const[g,f]of l.entries()){const y=f.valueOf();if(y<d||y>u)continue;const m=h.map(x=>x[g]);y>=d&&p.push(...m),y<=u&&p.push(...m)}return p}zoomFittingVisibleItems(t,e,i,s,n){const{dataModel:a,processedData:r}=this;if(!a||!r)return;const o=this.axes[ne.X];if(s!=null)return;const l=this.sortOrder(t);if(l==null)return;const c=this.keysOrValues(t);if(n>c.length)return{x:[0,1],y:void 0};const h=o.scale,d=h.range;h.range=[0,1];let[u,p]=this.visibleRangeIndices(t,i,void 0,{sortOrder:l});p-=1;const g=0;this.xCoordinateRange(c[u],g,u)[0]<i[0]&&(u+=1),this.xCoordinateRange(c[p],g,p)[1]>i[1]&&(p-=1);let f;if(Math.abs(p-u)>=n-1)f=i;else{const y=(i[0]+i[1])/2;for(;Math.abs(p-u)<n-1&&(u>0||p<c.length-1);)if(u===0)p+=1;else if(p===c.length-1)u-=1;else{const v=this.xCoordinateRange(c[u-1],g,u-1)[0],S=this.xCoordinateRange(c[p+1],g,p+1)[1];Math.abs(v-y)<Math.abs(S-y)?u-=1:p+=1}const m=this.xCoordinateRange(c[u],g,u)[0],x=this.xCoordinateRange(c[p],g,p)[1];f=[Math.min(i[0],m),Math.max(i[1],x)]}return h.range=d,{x:f,y:void 0}}countVisibleItems(t,e,i,s,n){const{dataModel:a,processedData:r}=this;if(!a||!r)return 1/0;const o=this.keysOrValues(t),l=e.map(D=>a.resolveColumnById(this,D,r)),c=this.shouldFlipXY(),h=c?this.axes[ne.Y]:this.axes[ne.X],d=c?this.axes[ne.X]:this.axes[ne.Y],u=c?s??[0,1]:i,p=c?i:s??[0,1];if(s==null){const D=this.sortOrder(t);if(D!=null){const C=h.scale,A=C.range;C.range=[0,1];const T=this.keysOrValues(t);let[L,N]=this.visibleRangeIndices(t,u,void 0,{sortOrder:D});if(N-=1,N<L)return 0;const O=0;this.xCoordinateRange(T[L],O,L)[0]<u[0]&&(L+=1),this.xCoordinateRange(T[N],O,N)[1]>u[1]&&(N-=1);const E=Math.abs(N-L)+1;return C.range=A,E}}const g=(D,C,A)=>D[0]+(A-C[0])/(C[1]-C[0])*(D[1]-D[0]),f=h.range.toSorted(),y=d.range.toSorted(),m=g(f,h.visibleRange,u[0]),x=g(f,h.visibleRange,u[1]),v=g(y,d.visibleRange,Math.min(...p)),S=g(y,d.visibleRange,Math.max(...p)),I=Math.round((u[0]+(u[1]-u[0])/2)*o.length),M=0;return LE(0,o.length-1,I,n,D=>{const[C,A]=this.xCoordinateRange(o[D],M,D),[T,L]=this.yCoordinateRange(l.map(N=>N[D]),M,D);return!Hh(C)||!Hh(A)||!Hh(T)||!Hh(L)?!1:C>=m&&A<=x&&T>=v&&L<=S})}minTimeInterval(){let t;try{t=this.keysOrValues("xValue")}catch{}if(t==null||t.length>1e3)return;let e=1/0,i=t[0],s;for(let n=1;n<t.length;n++){const a=t[n];if(a!=null&&i!=null){const r=a.valueOf()-i.valueOf(),o=Math.sign(r);if(o===0)continue;if(s!==void 0&&o!==s)return;e=Math.min(e,Math.abs(r)),s=o}i=a}if(Number.isFinite(e))return e}updateHighlightSelectionItem(t){const{items:e,highlightSelection:i}=t,s=e??[];return this.updateDatumSelection({nodeData:s,datumSelection:i})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateDatumStyles(t){}updatePaths(t){for(const e of t.paths)e.visible=!1}updatePathNodes(t){const{paths:e,visible:i}=t;for(const s of e)s.visible=i}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};if(e)for(const i of t.paths)at([i],e)}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&at([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&at([t.labelSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),t.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){const{datum:e}=this.opts?.animationResetFns??{};e&&at([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}:void 0}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof Rg){const{range:e,domain:i}=t;return{type:"log",convert:s=>t.convert(s),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof se){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Ei){if(t instanceof nn){const e=t.getLinearParams(),i=t.getBandCountForUpdate();if(e!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:e.firstBandTime,lastBandTime:e.firstBandTime+(i-1)*e.intervalMs,bandCount:i,intervalMs:e.intervalMs,inset:t.inset,step:t.step}}return{type:"category",domain:t.domain,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(ne)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}};function rU(t){let e,i;if((t instanceof mi||t instanceof ys)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function oU(t,e,i,s){const n=i[0].valueOf(),a=i[1].valueOf();let r=Cj(0,e-1,l=>{const c=t===1?l:e-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),o=Aj(0,e-1,l=>{const c=t===1?l:e-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=a});return r==null||o==null?[0,0]:(t===-1&&([r,o]=[e-o,e-r]),r=Math.max(r,0),o=Math.min(o+1,e),[r,o])}function hD(t){const e=new Map;for(const i of t){if(!(i instanceof Sn))continue;const n=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(n==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const a=`${i.type}-${n}`;let r=e.get(a);r==null&&(r=[],e.set(a,r)),r.push(i)}for(const i of e.values()){i.sort((n,a)=>(n.seriesGrouping?.stackIndex??0)-(a.seriesGrouping?.stackIndex??0));let s;for(const n of i)n.seriesBelowStackContext=s,s=n.createStackContext()}}import{mergeDefaults as lU}from"ag-charts-core";function ka(t,e,i,s,n,a,r=["series",`${t.declarationOrder}`,"label"]){if(t.visible&&s.itemStyler){const o=t.getHighlightStateString(a,n||e!=null&&a?.series===e.series&&a?.datumIndex===e.datumIndex,e?.datumIndex),l=typeof e?.datumIndex=="number"?e.datumIndex:e?.itemId,c={border:s.border,color:s.color,cornerRadius:s.cornerRadius,datum:e?.datum,enabled:s.enabled,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,itemId:l,itemType:e?.itemType,seriesId:t.id,padding:s.padding,highlightState:o},h=t.ctx.optionsGraphService.resolvePartial(r,t.cachedCallWithContext(s.itemStyler,{...i,...c}),{pick:!1})??{};return lU(h,c)}return s}function dD(t,e,i,s,n,a,r){if(t.visible&&s.enabled&&n){const o=ka(t,e.datum,i,s,a,r);e.visible=!0,e.x=n.x,e.y=n.y,e.text=n.text,e.fill=o.color,e.setAlign(n),e.setFont(o),e.setBoxing(o)}else e.visible=!1}var cU={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function uD({isUpward:t,isVertical:e,placement:i,spacing:s=0,rect:n}){let a=n.x+n.width/2,r=n.y+n.height/2,o="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:d}=cU[i],u=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,g=n.height*c;r=p+g*u+s*d*c,l=d===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,g=n.width*c;a=p+g*u+s*d*c,o=d===c?"left":"right"}}return{x:a,y:r,textAlign:o,textBaseline:l}}function Te({id:t},e,i,...s){for(const n of s)n.cleanup();As(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Yh({id:t},e,i,...s){As(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Oa(t){return{opacity:1}}import{ChangeDetectableProperties as hU,Property as Ki,SceneChangeDetection as Wr,SceneObjectChangeDetection as zg,TRIPLE_EQ as pD,objectsEqual as dU}from"ag-charts-core";var Bt=class extends hU{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:r,lineDash:o,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:r,lineDash:o,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};b([Ki,Wr()],Bt.prototype,"enabled",2),b([Ki,zg({equals:pD})],Bt.prototype,"shape",2),b([Ki,Wr()],Bt.prototype,"size",2),b([Ki,zg({equals:dU})],Bt.prototype,"fill",2),b([Ki,Wr()],Bt.prototype,"fillOpacity",2),b([Ki,Wr()],Bt.prototype,"stroke",2),b([Ki,Wr()],Bt.prototype,"strokeWidth",2),b([Ki,Wr()],Bt.prototype,"strokeOpacity",2),b([Ki],Bt.prototype,"lineDash",2),b([Ki],Bt.prototype,"lineDashOffset",2),b([Ki,zg({equals:pD})],Bt.prototype,"itemStyler",2);import{BaseProperties as gD,Property as In,callWithContext as uU,isDate as pU,isNumber as gU,isString as fU,mergeDefaults as fD,toTextString as mU}from"ag-charts-core";function yU(t,e){if(t!=null)return{enabled:t.enabled??!0,stroke:t.stroke??e?.stroke??"transparent",strokeWidth:t.strokeWidth??e?.strokeWidth??1,strokeOpacity:t.strokeOpacity??e?.strokeOpacity??1,lineDash:t.lineDash??e?.lineDash??[]}}var mD=class extends gD{constructor(){super(...arguments),this.enabled=!1}};b([In],mD.prototype,"enabled",2);var zs=class extends gD{constructor(){super(...arguments),this.interaction=new mD,this.position=new dr,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const s=this.renderer==null?void 0:uU(t,this.renderer,i);if(fU(s)||gU(s)||pU(s))return{type:"raw",rawHtmlString:mU(s)};if(s!=null){const n=fD(s.symbol?.marker,e.symbol?.marker),a=s.symbol?.line??e.symbol?.line?fD(s.symbol?.line,e.symbol?.line):void 0,r=e.symbol||s.symbol?{marker:n,line:yU(a,n)}:void 0;return{type:"structured",...e,...s,symbol:r}}return{type:"structured",...e}}};b([In],zs.prototype,"enabled",2),b([In],zs.prototype,"showArrow",2),b([In],zs.prototype,"renderer",2),b([In],zs.prototype,"interaction",2),b([In],zs.prototype,"position",2),b([In],zs.prototype,"range",2),b([In],zs.prototype,"class",2);function wa(){return new zs}import{ChartAxisDirection as Dn,Property as Gg,extent as bU,isFiniteNumber as xU}from"ag-charts-core";import{ActionOnSet as vU,ChartUpdateType as SU,Property as jg,ProxyPropertyOnWrite as IU,isFiniteNumber as yD}from"ag-charts-core";var Mn=class BC extends wo{constructor(e,i=new or,s=!0){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=s,this.nice=!1}static is(e){return e instanceof BC}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}getUpdateTypeOnResize(){return this.bandAlignment==null||this.bandAlignment==="justify"?super.getUpdateTypeOnResize():SU.PROCESS_DOMAIN}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!yD(e)||!yD(i)){const s=this.reduceBandScalePadding();e??(e=s.inner),i??(i=s.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}calculateGridLines(e,i,s){const n=super.calculateGridLines(e,i,s);return this.interval.placement==="between"&&e.length>0&&n.push(super.calculateGridLine({index:e.at(-1).index+1,tickId:`after:${e.at(-1).tickId}`,translation:this.range[1]},e.length,i,s,e)),n}calculateGridLine({index:e,tickId:i,translation:s},n,a,r,o){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridLine({index:e,tickId:i,translation:s},n,a,r,o);const u=s<d.step?Math.floor(d.step/2):d.step/2,p=s-u,[g,f,y,m]=c?[p,Math.max(a,r),p,Math.min(a,r)]:[Math.min(a,r),p,Math.max(a,r),p],{style:x}=l,{stroke:v,strokeWidth:S=0,lineDash:I}=x[e%x.length]??{};return{tickId:i,offset:p,x1:g,y1:f,x2:y,y2:m,stroke:v,strokeWidth:S,lineDash:I}}calculateGridFills(e,i,s){const{horizontal:n,range:a,scale:r}=this;if(this.interval.placement!=="between")return super.calculateGridFills(e,i,s);const o=[];if(e.length==0)return o;const l=e[0],c=l.translation>a[0]+r.step/2,h=e.at(-1),d=n&&h.translation<a[1]-r.step/2;if(c){const u={tickId:`before:${l.tickId}`,translation:l.translation-r.step};o.push(this.calculateGridFill(u,-1,l.index-1,i,s,e))}if(o.push(...e.map((u,p)=>this.calculateGridFill(u,p,u.index,i,s,e))),d){const u={tickId:`after:${h.tickId}`,translation:h.translation+r.step};o.push(this.calculateGridFill(u,e.length,h.index+1,i,s,e))}return o}calculateGridFill({tickId:e,translation:i},s,n,a,r,o){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:e,translation:i},s,n,a,r,o);const u=i-d.step/2,p=i+d.step/2,[g,f,y,m]=c?[u,Math.max(a,r),p,Math.min(a,r)]:[Math.min(a,r),u,Math.max(a,r),p],{fill:x,fillOpacity:v}=l.style[n%l.style.length]??{};return{tickId:e,x1:g,y1:f,x2:y,y2:m,fill:x,fillOpacity:v}}calculateTickLines(e,i,s=0){const n=super.calculateTickLines(e,i,s);return this.interval.placement==="between"&&e.length>0&&n.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${e.at(-1)?.tickId}`,translation:this.range[1]},e.length,i,e,s)),n}calculateTickLine({isPrimary:e,tickId:i,translation:s},n,a,r,o=0){const{horizontal:l,interval:c,primaryTick:h,scale:d,tick:u}=this;if(c.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:i,translation:s},n,a,r,o);const p=e&&h?.enabled?h:u,g=-a*this.getTickSize(p),f=s<d.step?Math.floor(d.step/2):d.step/2,y=s-f,m=-a*(o+this.getTickSpacing(p)),[x,v,S,I]=l?[y,m,y,m+g]:[m,y,m+g,y],{stroke:M,width:D}=p;return{tickId:i,offset:y,x1:x,y1:v,x2:S,y2:I,stroke:M,strokeWidth:D,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const s=i.getBandScalePadding?.();return s&&(e.inner>s.inner&&(e.inner=s.inner),e.outer<s.outer&&(e.outer=s.outer)),e},{inner:1/0,outer:-1/0})}tickFormatParams(e,i,s,n){return{type:"category"}}datumFormatParams(e,i,s,n,a){const{datum:r,seriesId:o,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}=i;return Array.isArray(e)&&e.some(g=>typeof g!="string")&&(e=e.map(String)),{type:"category",value:e,datum:r,seriesId:o,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}}};Mn.className="CategoryAxis",Mn.type="category",b([jg],Mn.prototype,"groupPaddingInner",2),b([jg],Mn.prototype,"paddingInner",2),b([jg],Mn.prototype,"paddingOuter",2),b([IU("layoutConstraints","align")],Mn.prototype,"bandAlignment",2),b([vU({newValue(t){t==null||t<=0?(this.layoutConstraints.width=100,this.layoutConstraints.unit="percent"):(this.layoutConstraints.width=t,this.layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}})],Mn.prototype,"requiredRange",2);var fl=Mn;import{BaseProperties as Ug,PropertiesArray as DU,Property as Re,angularPadding as bD,createIdsGenerator as MU,extent as AU,extractDomain as CU,getMaxInnerRectSize as TU,inRange as LU,isArray as NU,isObject as kU,isTruncated as OU,normalizeAngle360FromDegrees as xD,sortBasedOnArray as wU,toArray as EU,toPlainText as RU,wrapTextOrSegments as PU}from"ag-charts-core";var _U=1e3,vD=class zC extends or{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(e){return e instanceof zC}set domain(e){if(e.length<=_U){const i=JSON.stringify(e);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=e}get domain(){return super.domain}normalizeDomains(...e){const{domain:i}=super.normalizeDomains(...e);return{domain:i,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const i=JSON.stringify(e),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}},FU=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){t>this.right&&(this.right=t),t<this.left&&(this.left=t),e>this.bottom&&(this.bottom=e),e<this.top&&(this.top=e)}},VU=class GC{constructor(e="",i,s){this.label=e,this.parent=i,this.refId=s,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screen=0,this.depth=i?i.depth+1:0}insertTick(e,i){let s=this,n;for(let a=0;a<e.length;a++){const r=e[a],o=a!==e.length-1,{children:l}=s,c=l.find(h=>h.label===r);if(c&&o)s=c,n=c;else{const h=new GC(r,s,i);h.index=l.length,l.push(h),o&&(s=h),n=h}}return n}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,i)=>i!==this.index)??[]}};function BU(t){const e=t.reduce((n,a)=>Math.max(n,a.length),0),i=new VU,s=new Map;for(let n=0;n<t.length;n++){const a=t[n];for(;a.length<e;)a.push("");const r=i.insertTick(a,n);r!=null&&s.set(a,r)}return{root:i,tickNodes:s}}function zU(t,e,i){const s=e.index-t.index,n=i/s;e.change-=n,e.shift+=i,t.change+=n,e.prelim+=i,e.mod+=i}function GU(t,e,i){return e.getSiblings().includes(t.ancestor)?t.ancestor:i}function jU({children:t}){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const n=t[s];n.prelim+=e,n.mod+=e,i+=n.change,e+=n.shift+i}}function UU(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,a=i,r=n.getLeftmostSibling(),o=n.mod,l=s.mod,c=a.mod,h=r.mod;for(;a.nextRight()&&n.nextLeft();){a=a.nextRight(),n=n.nextLeft(),r=r.nextLeft(),s=s.nextRight(),s.ancestor=t;const d=a.prelim+c-(n.prelim+o)+1;d>0&&(zU(GU(a,t,e),t,d),o+=d,l+=d),c+=a.mod,o+=n.mod,h+=r.mod,l+=s.mod}a.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!r.nextLeft()&&(r.mod+=o-h),e=t)}return e}function SD(t){const{children:e}=t;if(e.length){let[i]=e;for(const a of e)SD(a),i=UU(a,i);jU(t);const s=(e[0].prelim+e.at(-1).prelim)/2,n=t.getLeftSibling();n?(t.prelim=n.prelim+1,t.mod=t.prelim-s):t.prelim=s}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function ID(t,e,i){t.position=t.prelim+e,i.insertNode(t);for(const s of t.children)ID(s,e+t.mod,i)}function DD(t){const{children:e}=t;let i=0;for(const s of e)DD(s),s.children.length?i+=s.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e.at(-1).subtreeRight,t.position=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.position,t.subtreeRight=t.position)}function HU(t){const e=new WU,{root:i,tickNodes:s}=BU(t);return SD(i),ID(i,-i.prelim,e),DD(i),{layout:e,tickNodes:s}}var WU=class{constructor(){this.dimensions=new FU,this.nodes=[],this.depth=0}insertNode(t){this.depth<t.depth&&(this.depth=t.depth),this.dimensions.update(t.position,t.depth),this.nodes.push(t)}scaling(t,e){let i=1;if(t>0){const{left:s,right:n}=this.dimensions;n!==s&&(i=t/(n-s))}return e&&(i*=-1),i}},ml=5,kt=class extends Ug{constructor(){super(...arguments),this.enabled=!0,this.border=new Qn}};b([Re],kt.prototype,"enabled",2),b([Re],kt.prototype,"avoidCollisions",2),b([Re],kt.prototype,"border",2),b([Re],kt.prototype,"color",2),b([Re],kt.prototype,"cornerRadius",2),b([Re],kt.prototype,"spacing",2),b([Re],kt.prototype,"rotation",2),b([Re],kt.prototype,"wrapping",2),b([Re],kt.prototype,"truncate",2),b([Re],kt.prototype,"fill",2),b([Re],kt.prototype,"fontStyle",2),b([Re],kt.prototype,"fontWeight",2),b([Re],kt.prototype,"fontSize",2),b([Re],kt.prototype,"fontFamily",2),b([Re],kt.prototype,"padding",2);var $h=class extends Ug{constructor(){super(...arguments),this.enabled=!0}};b([Re],$h.prototype,"enabled",2),b([Re],$h.prototype,"width",2),b([Re],$h.prototype,"stroke",2);var Hg=class extends Ug{constructor(){super(...arguments),this.label=new kt,this.tick=new $h}};b([Re],Hg.prototype,"label",2),b([Re],Hg.prototype,"tick",2);var yl=class extends fl{constructor(t){super(t,new vD),this.tickScale=new vD,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.depthOptions=new DU(Hg),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:t}=this.tickTreeLayout,{range:e,step:i,inset:s,bandwidth:n}=this.scale,a=Math.abs(e[1]-e[0])-i,r=this.tickTreeLayout.scaling(a,e[0]>e[1]),o=s+n/2;let l=0;for(const c of t){const h=c.position*r;l>h&&(l=h),c.screen=h+o}for(const c of t)c.screen-=l}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let a=0;a<t;a++)e.push(i[a]?.label.enabled??s.enabled?{enabled:!0,spacing:i[a]?.label.spacing??s.spacing,wrapping:i[a]?.label.wrapping??s.wrapping,truncate:i[a]?.label.truncate??s.truncate,rotation:i[a]?.label.rotation??(a?n:s.rotation),avoidCollisions:i[a]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return e}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((t,e)=>{t.fill=e.color,t.text=e.text,t.textBaseline=e.textBaseline,t.textAlign=e.textAlign??"center",t.pointerEvents=e.textUntruncated==null?1:0,t.setFont(e),t.setBoxing(e)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n,horizontal:a,line:r}=this,o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o);if(this.lineNode.datum=a?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:r.stroke,strokeWidth:r.enabled?r.width:0}),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:R.zero,spacing:0,depthLabelMaxSize:{},tickLabelLayout:[]};const{depth:c,nodes:h}=this.tickTreeLayout,d=a?-i.getSideFlag():i.getSideFlag(),u=[],p=new Map,g=new Map,f=new Za,y=this.getDepthOptionsMap(c),m=d*(y[0].spacing+this.getTickSpacing()+l),x=this.tickFormatter(this.scale.domain,this.scale.domain,!1),v=(k,P)=>{const F=c-k.depth;if(!y[F]?.enabled||!LU(k.screen,s))return!1;let w=(k.leafCount||1)*t;if(w<ml)return!1;const j=x(k.label,P-1);let q=j;const J=this.getLabelStyles({value:k.index,formattedValue:q,depth:F},n[F]?.label);if(i.avoidCollisions){const xe=y[F].rotation;let ti=this.thickness;if(xe!=null){const Et=TU(xe,w,ti);w=Et.width,ti=Et.height}const ae={font:J,textWrap:y[F].wrapping,overflow:y[F].truncate?"ellipsis":"hide",maxWidth:w,maxHeight:ti};q=PU(q,ae)||q}return q!==j&&OU(q)?g.set(P,RU(j)):g.delete(P),f.x=a?k.screen:m,f.y=a?m:k.screen,f.rotation=0,f.fill=J.color,f.text=q,f.textAlign="center",f.textBaseline=i.parallel?"top":"bottom",f.setFont(J),f.setBoxing(J),!0},S={};for(const[k,P]of h.entries()){const F=c-P.depth;if(S[F]??(S[F]=0),!P.children.length&&t<ml||!v(P,k)||!f.getBBox())continue;p.set(k,f.getBBox()),f.rotation=xD(y[F]?.rotation);const{width:q,height:J}=f.getBBox(),xe=a?J:q;S[F]<xe&&(S[F]=xe)}const I=MU(),M=k=>{if(k===0)return 0;let P=S[0];for(let F=1;F<=k;F++)P+=y[F].spacing,F!==k&&(P+=S[F]);return P};for(const[k,P]of h.entries()){if(k===0)continue;const F=v(P,k),w=!P.children.length,j=c-P.depth;if(w&&t<ml||!F)continue;const q=xD(y[j].rotation),J=p.get(k);if(!J)continue;const{width:xe,height:ti}=J,ae=M(j);if(f.textAlign="center",f.textBaseline="middle",f.rotation=q,a?(f.y+=(ae+bD(xe/2,ti/2,q))*d,f.rotationCenterX=P.screen,f.rotationCenterY=f.y):(f.x+=ae*d+bD((y[j].spacing*d+xe)/2,i.mirrored?xe:0,q)-xe/2,f.rotationCenterX=f.x,f.rotationCenterY=P.screen),y[j].avoidCollisions){const{width:Ni,height:Gl}=f.getBBox(),jl=a?Ni:Gl,Ul=w?t:P.leafCount*t;if(jl>Ul){p.delete(k);continue}}const Et=f.getPlainText(),Hs=f.getBoxingProperties();u.push({text:Et,textUntruncated:g.get(k),visible:!0,tickId:I(Et),range:this.scale.range,border:Hs.border,color:f.fill,cornerRadius:Hs.cornerRadius,fill:Hs.fill,fontFamily:f.fontFamily,fontSize:f.fontSize,fontStyle:f.fontStyle,fontWeight:f.fontWeight,padding:Hs.padding,rotation:f.rotation,rotationCenterX:f.rotationCenterX,rotationCenterY:f.rotationCenterY,textAlign:f.textAlign,textBaseline:f.textBaseline,x:f.x,y:f.y}),p.set(k,ve.toCanvas(f))}let D=S[0];for(let k=0;k<c;k++)D+=y[k].spacing,k!==0&&(D+=S[k]);const C=D+l,A=[this.lineNodeBBox(),R.merge(p.values()),new R(0,0,C*d,0)],T=R.merge(A),L=a?T.height:T.width,{spacing:N,scrollbarLayout:O}=this.applyScrollbarLayout(A,L,o);this.layout.labelThickness=L,this.layout.scrollbar=O,e.enabled&&A.push(this.titleBBox(this.scale.domain,N));const E=R.merge(A);return this.layoutCrossLines(),{bbox:E,spacing:N,depthLabelMaxSize:S,tickLabelLayout:u}}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,tick:e,gridLine:i,gridLength:s,visibleRange:n,tickTreeLayout:a}=this;if(!a)return;const{depthLabelMaxSize:r,spacing:o}=this.computedLayout,{depth:l}=a,c=this.getDepthOptionsMap(l),h=this.chartLayout?.scrollbars?.[this.id],d=this.getScrollbarThickness(h),{position:u,horizontal:p,gridPadding:g}=this,f=u==="bottom"||u==="right"?-1:1,y=g,m=f*s-g,x={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},{ticks:v}=t.ticks(x,void 0,n),{tickInfos:S,minSpacingByDepth:I}=$U(v,this.tickNodes,t,l),M=KU(I),D=XU(S,M,l,I),C=D.map(({tickLabel:A,position:T},L)=>({index:t.findIndex(A),tickId:ft(L,...A),translation:Math.round(T)}));this.gridLineGroupSelection.update(i.enabled&&s?this.calculateGridLines(C,y,m):[]),this.gridFillGroupSelection.update(i.enabled&&s?this.calculateGridFills(C,y,m):[]),this.tickLineGroupSelection.update(e.enabled?D.map(({depth:A},T)=>{const{tickId:L,translation:N}=C[T],O=this.depthOptions[A]?.tick;let E=r[0];for(let ae=0;ae<=A;ae++)E+=c[ae].spacing,ae!==0&&(E+=r[ae]);const k=O?.stroke??e.stroke,P=O?.enabled===!1?0:O?.width??e.width,F=-f*E,w=-f*(d+this.getTickSpacing()),[j,q,J,xe]=p?[N,w,N,w+F]:[w,N,w+F,N];return{tickId:L,offset:N,x1:j,y1:q,x2:J,y2:xe,stroke:k,strokeWidth:P,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,o),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(t,e){this.chartLayout=e;const{depthLabelMaxSize:i,tickLabelLayout:s,spacing:n,bbox:a}=this.computeLayout();return this.computedLayout={depthLabelMaxSize:i,tickLabelLayout:s,spacing:n},{bbox:a,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:t}=this,e=this.boundSeries.filter(l=>l.visible).flatMap(l=>CU(l.getDomain(t)));this.dataDomain={domain:AU(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(MD),{layout:s,tickNodes:n}=HU(i);this.tickTreeLayout=s,this.tickNodes=n;const a=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||a.push(this.dataDomain.domain[l.refId]);const r=wU(this.dataDomain.domain,a);this.scale.domain=r;const o=r.map(MD);o.push([""]),this.tickScale.domain=o}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=NU(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}};yl.className="GroupedCategoryAxis",yl.type="grouped-category",b([Re],yl.prototype,"depthOptions",2);function YU(t){let e=0,i=t;for(;i?.index===0;)e+=1,i=i.parent;return e}function $U(t,e,i,s){const n=new Array(t.length),a=new Array(s).fill(1/0),r=new Array(s).fill(Number.NaN);for(let o=0;o<t.length;o++){const l=t[o],c=e?.get(l),h=c==null?s-1:Math.min(YU(c),s-1),d=i.convert(l);if(n[o]={tickLabel:l,depth:h,position:d},!!Number.isFinite(d))for(let u=0;u<=h;u++){const p=r[u];Number.isFinite(p)&&(a[u]=Math.min(a[u],Math.abs(d-p))),r[u]=d}}return{tickInfos:n,minSpacingByDepth:a}}function KU(t){for(let e=0;e<t.length;e++){const i=t[e];if(!Number.isFinite(i)||i>=ml)return e}return t.length}function ZU(t){return!Number.isFinite(t)||t<=0?1:Math.max(1,Math.ceil(ml/t))}function XU(t,e,i,s){if(e<=0)return t;const n=Math.min(e-1,i-1);if(n<0)return t;const a=ZU(s[n]),r=[];let o=0;for(const l of t){if(l.depth>=e){r.push(l);continue}l.depth===n&&(o%a===0&&r.push(l),o++)}return r}function MD(t){return EU(kU(t)&&"value"in t?t.value:t)}import{Logger as qU}from"ag-charts-core";function Kh(t,e){for(const i of e){const s=i.datum;s===void 0?qU.error("undefined datum"):t.addValue(i,s)}}function Zh(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:a}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(a)}}var bl=class extends $i{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};b([Gg],bl.prototype,"direction",2),b([Gg],bl.prototype,"width",2),b([Gg],bl.prototype,"widthRatio",2);var AD=class extends Sn{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=xU(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=bU(t)??[Number.NaN,Number.NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),Ut(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?Dn.X:Dn.Y}getCategoryDirection(){return this.shouldFlipXY()?Dn.Y:Dn.X}getValueAxis(){const t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getMinimumRangeSeries(t){const{width:e}=this.properties;if(e==null||!this.getCategoryAxis())return;const{index:s}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);t[s]=Math.max(t[s]??0,e)}getMinimumRangeChart(t){if(t.length===0)return 0;const e=this.getCategoryAxis();if(!(e instanceof yl||e instanceof fl))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const s=this.getBandScalePadding(),{paddingInner:n=s.inner,paddingOuter:a=s.outer,groupPaddingInner:r}=e,o=t.reduce((u,p)=>u+p,0),l=o/t.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=o+r*l*(c-1),d=(i-n+a*2)/(1-n);return h*d}validateCreateNodeDataPreconditions(){const t=this.getCategoryAxis(),e=this.getValueAxis();if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getBandwidth(t,e){return se.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval,e):t.scale.bandwidth}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e,0)??0,n=se.is(i)?s*-.5:0,a=i.convert(t)+n;return[a,a+s]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,s=t.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}getBarDimensions(){const t=this.getCategoryAxis(),e=this.getBandwidth(t)??0;this.ctx.seriesStateManager.updateGroupScale(this,e,t);const i=this.getGroupOffset(),s=this.getBarWidth(),n=this.getBarOffset(s);return{groupOffset:i,barOffset:n,barWidth:s}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(t){const e=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let s=0;se.is(i.scale)?s=-t/2:this.seriesGrouping==null&&e?s=(this.getGroupScaleRangeWidth(e)-t)/2:e&&this.properties.widthRatio!=null&&(s=(e.bandwidth-t)/2);const n=this.ctx.seriesStateManager.getStackOffset(this,t);return s+n}getBarWidth(){const{seriesGrouping:t}=this,{width:e}=this.properties;let{widthRatio:i}=this.properties;const s=this.ctx.seriesStateManager.getGroupScale(this),n=s?.bandwidth??0;if(t==null&&(i??(i=1)),i!=null){let a=e;return t==null&&a==null&&s&&(a=this.getGroupScaleRangeWidth(s)),a==null&&n<1&&s?s.rawBandwidth:(a??n)*i}return e??(n<1&&s?s.rawBandwidth:n)}getGroupScaleRangeWidth(t){let e=t.range[1]-t.range[0];return t.round&&e>0&&(e=Math.floor(e)),e}resolveKeyDirection(t){return this.getBarDirection()===Dn.X?t===Dn.X?Dn.Y:Dn.X:t}initQuadTree(t){Kh(t,this.datumNodesIter())}pickNodeClosestDatum(t){return Zh(this,t)}};import{SpanJoin as Xh,areScalingEqual as CD,isScaleValid as TD,linearPoints as JU,smoothPoints as QU,spanRange as eH,stepPoints as tH}from"ag-charts-core";import{SpanJoin as Wg,solveBezier as iH,spanRange as Yg,splitBezier2D as sH}from"ag-charts-core";function $e(t,e,i){return(e-t)*i+t}function LD(t,e){const{x0:i,y0:s,x1:n,y1:a}=t,o=(a-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:o,stepX:e,stepY0:o,stepY1:o,rightCp1x:e,rightCp1y:o,rightCp2x:n,rightCp2y:a}}function nH(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:a,cp2x:r,cp2y:o,cp3x:l,cp3y:c}=t,h=iH(i,n,r,l,e),[d,u]=sH(i,s,n,a,r,o,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:e,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function aH(t){const{x0:e,y0:i,x1:s,y1:n,stepX:a}=t;return{leftCp1x:(e+a)/2,leftCp1y:i,leftCp2x:(e+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:n,rightCp1x:(a+s)/2,rightCp1y:n,rightCp2x:(a+s)/2,rightCp2y:n}}function ND(t,e){return t.type==="linear"?LD(t,e):t.type==="cubic"?nH(t,e):t.type==="step"?aH(t):LD(t,e)}function kD(t,e,i,s,n,a,r){switch(e){case Wg.MoveTo:r?t.moveTo(n,a):t.moveTo(i,s);break;case Wg.LineTo:r?t.lineTo(n,a):t.lineTo(i,s);break;case Wg.Skip:break}}function OD(t,e,i,s,n,a){a?t.lineTo(e,i):t.lineTo(s,n)}function wD(t,e,i,s,n,a,r,o,l,c){c?t.cubicCurveTo(a,r,s,n,e,i):t.cubicCurveTo(s,n,a,r,o,l)}function ED(t,e,i,s,n,a,r){r?(t.lineTo(a,n),t.lineTo(a,i),t.lineTo(e,i)):(t.lineTo(a,i),t.lineTo(a,n),t.lineTo(s,n))}function rH(t,e,i,s,n,a,r){if(r){for(let o=a.length-1;o>=0;o--){const{x:l,y:c}=a[o];t.lineTo(l,c)}t.lineTo(e,i)}else{for(const{x:o,y:l}of a)t.lineTo(o,l);t.lineTo(s,n)}}function xl(t,e,i,s){const[n,a]=Yg(e);switch(kD(t,i,n.x,n.y,a.x,a.y,s),e.type){case"linear":OD(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":wD(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":ED(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break;case"multi-line":rH(t,e.x0,e.y0,e.x1,e.y1,e.midPoints,s);break}}function RD(t,e,i){const[s,n]=Yg(t),[a,r]=Yg(e),o=$e(s.x,a.x,i),l=$e(s.y,a.y,i),c=$e(n.x,r.x,i),h=$e(n.y,r.y,i);return[{x:o,y:l},{x:c,y:h}]}function $g(t,e,i,s,n,a){const[{x:r,y:o},{x:l,y:c}]=RD(e,i,s);if(kD(t,n,r,o,l,c,a),e.type==="cubic"&&i.type==="cubic"){const h=$e(e.cp1x,i.cp1x,s),d=$e(e.cp1y,i.cp1y,s),u=$e(e.cp2x,i.cp2x,s),p=$e(e.cp2y,i.cp2y,s);wD(t,r,o,h,d,u,p,l,c,a)}else if(e.type==="step"&&i.type==="step"){const h=$e(e.stepX,i.stepX,s);ED(t,r,o,l,c,h,a)}else if(e.type==="linear"&&i.type==="linear")OD(t,r,o,l,c,a);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(r+l)/2;const d=ND(e,h),u=ND(i,h),p=$e(d.leftCp1x,u.leftCp1x,s),g=$e(d.leftCp1y,u.leftCp1y,s),f=$e(d.leftCp2x,u.leftCp2x,s),y=$e(d.leftCp2y,u.leftCp2y,s),m=$e(d.stepX,u.stepX,s),x=$e(d.stepY0,u.stepY0,s),v=$e(d.stepY1,u.stepY1,s),S=$e(d.rightCp1x,u.rightCp1x,s),I=$e(d.rightCp1y,u.rightCp1y,s),M=$e(d.rightCp2x,u.rightCp2x,s),D=$e(d.rightCp2y,u.rightCp2y,s);a?(t.cubicCurveTo(M,D,S,I,m,v),t.lineTo(m,x),t.cubicCurveTo(f,y,p,g,r,o)):(t.cubicCurveTo(p,g,f,y,m,x),t.lineTo(m,v),t.cubicCurveTo(S,I,M,D,l,c))}}import{clipSpanX as PD,collapseSpanToPoint as oH,isUnitTimeCategoryScaling as qh,rescaleSpan as Kg,spanRange as Jh,transformIntegratedCategoryValue as lH}from"ag-charts-core";var _D=1e3,FD=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(FD||{});function cH(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function Ot(t){return lH(t).valueOf()}function It(t,e){if(!e)return Number.NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return Number.NaN;if(qh(e)){if(typeof t=="number"){const{firstBandTime:n,intervalMs:a,bandCount:r,inset:o,step:l}=e,c=Math.round((t-n)/a);if(c>=0&&c<r)return o+l*c}return Number.NaN}const i=Ot(t);let s=e.domain.findIndex(n=>Ot(n)===i);return s===-1&&(s=e.domain.findIndex(n=>cH(t,n))),s>=0?e.inset+e.step*s:Number.NaN}function VD({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(Ot(i.xValue0)),xValue1Index:e.indexOf(Ot(i.xValue1)),datumIndex:s}))}function BD(t){return Object.values(t.scales).every(e=>e.type==="category"?qh(e)?e.bandCount<_D:e.domain.length<_D:!0)}function hH(t,e){const i=e.scales.x,s=t.scales.x;if(i?.type!=="category"||s?.type!=="category"||qh(i)||qh(s))return!0;let n=-1/0;for(const a of i.domain){const r=It(a,s);if(Number.isFinite(r)){if(r<n)return!1;n=r}}return!0}function dH(t,e){let i=-1/0;for(const s of t){const n=It(s.value,e.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function uH(t,e){const i=new Map;for(const{xValue0:h,xValue1:d}of t.data){const u=Ot(h),p=Ot(d);i.set(u,h).set(p,d)}const s=Array.from(i,([h,d])=>({axisValue:h,value:d}));s.sort((h,d)=>It(h.value,t.scales.x)-It(d.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of e.data){const u=Ot(h),p=Ot(d);i.has(u)||(i.set(u,h),n.push({axisValue:u,value:h})),i.has(p)||(i.set(p,d),n.push({axisValue:p,value:d}))}n.sort((h,d)=>It(h.value,e.scales.x)-It(d.value,e.scales.x));const a=s;let r=0;for(const h of n){for(let d=a.length-1;d>=r;d-=1){const u=It(h.value,e.scales.x),p=It(a[d].value,e.scales.x);if(u>p){r=d+1;break}}a.splice(r,0,h),r+=1}if(!dH(a,e))return;const o=a.map(h=>h.axisValue),l=VD(e,o),c=VD(t,o);return{axisValues:o,oldDataAxisIndices:l,newDataAxisIndices:c}}function zD(t,e,i,s,n){if(n.xValue1Index===n.xValue0Index+1)return t;const a=Jh(t);let r,o;if(e.scales.x?.type==="category"){const l=(a[1].x-a[0].x)/(n.xValue1Index-n.xValue0Index);r=a[0].x+(s-n.xValue0Index)*l,o=r+l}else{const l=i[s],c=i[s+1];r=It(l,e.scales.x),o=It(c,e.scales.x)}return PD(t,r,o)}function GD(t,e){const[i,s]=Jh(t),n=It(0,e.scales.y);return Kg(t,{x:i.x,y:n},{x:s.x,y:n})}function jD(t){const[e,i]=Jh(t);return oH(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function UD(t,e,i,s,n,a){let r,o;if(n.xValue0Index>=a.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=a.xValue1Index)?.datumIndex,u=d==null?void 0:i.data[d];r=u?.xValue1,o=u?.yValue1}else if(n.xValue0Index<=a.xValue0Index){const d=s.find(p=>p.xValue0Index>=a.xValue0Index)?.datumIndex,u=d==null?void 0:i.data[d];r=u?.xValue0,o=u?.yValue0}if(r==null||o==null)switch(e){case 0:return GD(t,i);case 1:return jD(t)}const l=It(r,i.scales.x),c=It(o,i.scales.y),h={x:l,y:c};return Kg(t,h,h)}function Zg(t,e){if(e==null)return;const i=Ot(t.xValue0),s=Ot(t.xValue1);return e.find(n=>Ot(n.xValue0)===i&&Ot(n.xValue1)===s)?.span}function HD(t,e,i,s,n,a,r){const o=t.data[s.datumIndex],l=o.span,c=Zg(o,n);if(c==null){const h=UD(l,e,t,i,s,a);r.added.push({from:h,to:l})}else r.removed.push({from:c,to:c}),r.moved.push({from:c,to:l}),r.added.push({from:l,to:l})}function WD(t,e,i,s,n,a,r){const o=t.data[s.datumIndex],l=o.span,c=Zg(o,n);if(c==null){const h=UD(l,e,t,i,s,a);r.removed.push({from:l,to:h})}else r.removed.push({from:l,to:l}),r.moved.push({from:l,to:c}),r.added.push({from:c,to:c})}function YD(t,e,i,s,n){const a=s.scales.x,r=e[n.xValue0Index],o=e[n.xValue1Index];let l,c;if(a?.type==="continuous"||a?.type==="log"?(l=i.data.findLast(m=>Ot(m.xValue0)<=r),c=i.data.find(m=>Ot(m.xValue1)>=o)):(l=i.data.find(m=>Ot(m.xValue0)===r),c=i.data.find(m=>Ot(m.xValue1)===o)),l==null||c==null)return;const[{x:h},{x:d}]=Jh(t),u=It(l.xValue0,i.scales.x),p=It(l.yValue0,i.scales.y),g=It(c.xValue1,i.scales.x),f=It(c.yValue1,i.scales.y);let y=s.data[n.datumIndex].span;return y=Kg(y,{x:u,y:p},{x:g,y:f}),y=PD(y,h,d),y}function pH(t,e,i,s,n,a,r,o,l){const c=n+1,h=r.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),d=a.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),u=e.zeroData,p=t.zeroData;if(h==null&&d!=null){HD(t,i,a,d,u,o,l);return}else if(h!=null&&d==null){WD(e,i,r,h,p,o,l);return}else if(h==null||d==null)return;let g;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?g=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?g=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?g=1:g=0;const f=e.data[h.datumIndex],y=zD(f.span,e,s,n,h),m=t.data[d.datumIndex],x=zD(m.span,t,s,n,d);if(g===1){const v=YD(y,s,e,t,d);v==null?WD(e,i,r,h,p,o,l):(l.removed.push({from:y,to:v}),l.moved.push({from:v,to:x}),l.added.push({from:x,to:x}))}else if(g===-1){const v=YD(x,s,t,e,h);v==null?HD(t,i,a,d,u,o,l):(l.removed.push({from:y,to:y}),l.moved.push({from:y,to:v}),l.added.push({from:v,to:x}))}else l.removed.push({from:y,to:y}),l.moved.push({from:y,to:x}),l.added.push({from:x,to:x})}function gH(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:r,newDataAxisIndices:o}=t,l={xValue0Index:Math.max(r.at(0)?.xValue0Index??-1/0,o.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(r.at(-1)?.xValue1Index??1/0,o.at(-1)?.xValue1Index??1/0)};for(let c=0;c<a.length-1;c+=1)pH(e,i,s,a,c,o,r,l,n);return n}function fH(t,e){const i=[],s=[],n=[];for(let a=0;a<e.data.length;a+=1){const r=e.data[a].span,o=t.data[a].span;i.push({from:r,to:r}),s.push({from:r,to:o}),n.push({from:o,to:o})}return{removed:i,moved:s,added:n}}function $D(t,e,i){const{span:s}=e;switch(i){case 0:return Zg(e,t.zeroData)??GD(s,t);case 1:return jD(s)}}function mH(t,e,i){const s=[],n=[];for(const a of e.data){const r=a.span,o=$D(e,a,i);n.push({from:r,to:o})}for(const a of t.data){const r=a.span,o=$D(t,a,i);s.push({from:o,to:r})}return{removed:n,moved:[],added:s}}function vl(t,e,i){if(!BD(t)||!BD(e)||!hH(t,e))return;const s=uH(t,e);return s==null?mH(t,e,i):s.axisValues.length===s.oldDataAxisIndices.length+s.newDataAxisIndices.length+2?fH(t,e):gH(s,t,e,i)}function Sl(t,e){const i=t.map(n=>n.point);let s=JU(i);switch(e.type){case"linear":break;case"smooth":s=QU(i,e.tension);break;case"step":s=tH(i,e.position);break}return s.map(function(a,r){return{span:a,xValue0:t[r].xDatum,yValue0:t[r].yDatum,xValue1:t[r+1].xDatum,yValue1:t[r+1].yDatum}})}function Qh(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function Xg({path:t},e){let i;for(const{span:s}of e){const[n,a]=eH(s),r=i!=null&&Qh(i,n)?Xh.Skip:Xh.MoveTo;xl(t,s,r,!1),i=a}}function ed(t,e,i){let s;for(const n of i){const[a,r]=RD(n.from,n.to,t),o=s!=null&&Qh(s,a)?Xh.Skip:Xh.MoveTo;$g(e.path,n.from,n.to,t,o,!1),s=r}}function KD(t,e,i,s=1){const n=(l,c)=>ed(l,c,e.removed),a=(l,c)=>ed(l,c,e.moved),r=(l,c)=>ed(l,c,e.added),o=qg(t,i,s);return{status:t,path:{addPhaseFn:r,updatePhaseFn:a,removePhaseFn:n},pathProperties:o}}function qg(t,e,i=1){const s=e==="none"?"updated":t,n={fromFn(a,r){const o={phase:Ri[s]},l=a.previousDatum??r;return l!=null&&(o.segments=l),t==="removed"?o.finish={visible:!1}:t==="added"&&(o.start={visible:!0}),o},toFn(a,r){const o={phase:Ri[s]},l=r;return l!=null&&(o.segments=l),o}};return e==="fade"?{fromFn(a,r){const o=t==="added"?0:i,l=t==="removed"?a.previousDatum??r:r;return{...n.fromFn(a,r),opacity:o,segments:l}},toFn(a,r){const o=t==="removed"?0:i,l=t==="removed"?a.previousDatum??r:r;return{...n.toFn(a,r),opacity:o,segments:l}}}:n}function yH(t,e,i,s=1){const n=t.scales.x?.type==="category",a=e.scales.x?.type==="category";if(n!==a||!TD(t.scales.x)||!TD(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let r="updated";e.visible&&!t.visible?r="removed":!e.visible&&t.visible&&(r="added");const o=vl({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(o==null)return;const l=KD(r,o,"fade",s),c=(i?.changed??!0)||!CD(t.scales.x,e.scales.x)||!CD(t.scales.y,e.scales.y)||r!=="updated";return{status:r,stroke:l,hasMotion:c}}import{ChartAxisDirection as ZD,isNegative as bH}from"ag-charts-core";function XD(t,e,i,s){if(e!=null){const[n,a]=e;if(n!==0||a!==1)return!1}if(se.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}if(Ei.is(t)){const{bandwidth:n,step:a}=t;if(n>0&&n<1)return!1;const r=a-n;if(r>0&&r<1)return!1}return!0}var Jg=t=>bH(t.yValue??0);function Il(t,e,i){const{startingX:s,startingY:n}=vH(t,e);return{isVertical:t,calculate:(r,o)=>{let l=t?r.x:s,c=t?n:r.y,h=t?r.width:0,d=t?0:r.height;const{opacity:u=1}=r;o&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=o,h=t?o.width:0,d=t?0:o.height,t&&!Jg(o)?c+=o.height:!t&&Jg(o)&&(l+=o.width));let p;return r.clipBBox==null?p=void 0:Jg(r)?p=t?new R(l,c-d,h,d):new R(l-h,c,h,d):p=new R(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function xH(t,e){return{isVertical:t,calculate:i=>({x:t?i.x:i.x+i.width/2,y:t?i.y+i.height/2:i.y,width:t?i.width:0,height:t?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:e}}function Dl(t,e){const i=r=>r==null||Number.isNaN(r.x)||Number.isNaN(r.y);return{toFn:(r,o,l)=>l==="removed"&&r.datum==null&&t.mode==="fade"?{...Ml(r,o),opacity:0}:l==="removed"||i(o)?t.calculate(o,r.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(r,o,l)=>{l==="updated"&&i(o)?l="removed":l==="updated"&&i(r.previousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(r.previousDatum==null&&t.mode==="fade"?c={...Ml(r,o),opacity:0}:c=t.calculate(o,r.previousDatum),l==="unknown"&&(l=e)):c={x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1};const h=Ri[l];return{...c,phase:h}},applyFn:(r,o,l)=>{r.resetAnimationProperties(o.x,o.y,o.width,o.height,o.opacity??1,o.clipBBox),r.crisp=l==="end"&&(r.datum?.crisp??!1)}}}function vH(t,e){const i=e[t?ZD.Y:ZD.X];let s=1/0,n=0;return i?(t?n=i.scale.convert(se.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(se.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function Ml(t,{x:e,y:i,width:s,height:n,clipBBox:a,opacity:r=1}){return{x:e,y:i,width:s,height:n,clipBBox:a,opacity:r,crisp:t.datum?.crisp??!1}}function td(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const n of i){const a=n.datum;a!=null&&(n.resetAnimationProperties(a.x,a.y,a.width,a.height,a.opacity??1,a.clipBBox),n.crisp=a.crisp??!1)}e.cleanup()})}}function Qg(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:a}=e;return ve.toCanvas(t.contentGroup,new R(i,s,n,a))}function ef(t,e,i,s){const n=t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length;let a;return n?(a=t.nodes[t.nodeIndex],s(t,a,e)):(a=i(t,e),a!=null&&t.nodes.push(a)),t.nodeIndex++,a}import{SpanJoin as Yr,isScaleValid as qD,spanRange as JD}from"ag-charts-core";function QD({path:t},{spans:e,phantomSpans:i}){let s=0,n={x:Number.NaN,y:Number.NaN},a={x:Number.NaN,y:Number.NaN};for(let r=0;r<e.length;r+=1){const{span:o}=e[r],{span:l}=i[r],{0:c,1:h}=JD(o),{0:d,1:u}=JD(l);if(Qh(n,c)&&Qh(a,d))xl(t,o,Yr.Skip,!1);else{for(let p=r-1;p>=s;p-=1)xl(t,i[p].span,Yr.LineTo,!0);t.closePath(),xl(t,o,Yr.MoveTo,!1),s=r}n=h,a=u}for(let r=e.length-1;r>=s;r-=1)xl(t,i[r].span,Yr.LineTo,!0);t.closePath()}function tf(t,{path:e},i,s){for(let n=0;n<i.length;n+=1){const a=i[n],r=s[n];$g(e,a.from,a.to,t,Yr.MoveTo,!1),$g(e,r.from,r.to,t,Yr.LineTo,!0),e.closePath()}}function eM(t,e,i,s){const n=(l,c)=>tf(l,c,e.removed,i.removed),a=(l,c)=>tf(l,c,e.moved,i.moved),r=(l,c)=>tf(l,c,e.added,i.added),o=qg(t,s);return{status:t,path:{addPhaseFn:r,updatePhaseFn:a,removePhaseFn:n},pathProperties:o}}function SH(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!qD(t.scales.x)||!qD(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const a=vl({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(a==null)return;const r=vl({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(r==null)return;const o=vl({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(o==null)return;const l="none",c=eM(n,a,r,l),h=KD(n,o,l);return{status:n,fill:c,stroke:h}}import{areScalingEqual as sf}from"ag-charts-core";function tM(t,e,i,s,n,a,r){let o=a?.reduced?.diff?.[t];if(o?.changed)return o;if(!r)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=IH(s,n);return o==null&&a?.reduced?.diff!=null?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?o.updated=new Set(Array.from(e,({datum:c})=>i(c))):o.added=new Set(Array.from(e,({datum:c})=>i(c)))):l&&(o={changed:!0,added:new Set,updated:new Set(Array.from(e,({datum:c})=>i(c))),removed:new Set,moved:new Set}),o}function iM(t){return typeof t=="object"&&t!==null&&"groupScale"in t}function IH(t,e){if(!e)return!1;const i=t.scales,s=e.scales;if(!sf(i.x,s.x)||!sf(i.y,s.y))return!0;if(!iM(t)||!iM(e))return!1;const n=t.groupScale,a=e.groupScale;return!sf(n,a)}import{clamp as DH,findRangeExtent as MH,inverseEaseOut as AH}from"ag-charts-core";function Al({id:t},e,i,s,...n){const a={...s,phase:s?.phase??(i?Ri[i]:"trailing")};As(t,"markers",e,n,{opacity:0},{opacity:1},a);for(const r of n)r.cleanup()}function CH({id:t},e,...i){As(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const s of i)s.cleanup()}function nf({id:t,nodeDataDependencies:e},i,s,...n){const a=e.seriesRectWidth;Oe(t,"markers",i,n,{fromFn:(l,c)=>{const h=c.midPoint?.x??a;let d=DH(0,AH(h/a),1);return Number.isNaN(d)&&(d=0),{scalingX:0,scalingY:0,delay:s?.delay??d,duration:s?.duration??Tu,phase:s?.phase??"initial",start:s?.start,finish:s?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function id(t){return{opacity:1,scalingX:1,scalingY:1}}function sd(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const n of i){const a=n.datum;if(a?.point==null)continue;const{x:r,y:o}=a.point;!Number.isFinite(r)||!Number.isFinite(o)||n.resetAnimationProperties(r,o,n.size,1,1,1)}e.cleanup()})}}function Cl(t,e){return{x:e.point?.x??Number.NaN,y:e.point?.y??Number.NaN,scalingCenterX:e.point?.x??Number.NaN,scalingCenterY:e.point?.y??Number.NaN}}function nd(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const s=i[e],{point:n}=s??{};if(s==null||n==null)return;const a=t.getFormattedMarkerStyle(s),r=je.anchor(a.shape),o=n.focusSize??a.size,l=4+o,c=l/2,h=(r.x-.5)*o,d=(r.y-.5)*o,u=s.point.x-c-h,p=s.point.y-c-d;return ve.toCanvas(t.contentGroup,new R(u,p,l,l))}function af(t,e,i,s=i){if(!(s.enabled??i.enabled))return!1;const a=1;return(e.step??MH(e.range)/Math.max(1,t))>a}function ad(t,e,i,s){return s??(s={stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}),Uu.reduce((n,a)=>(n[a]=t.getMarkerStyle(i,{},void 0,{highlightState:a},void 0,s),n),{})}function rf({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:r}=i;As(t,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:r,visible:e},finish:{clip:!1,visible:e}})}function of({id:t},e,i,s="add",...n){As(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function lf(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function rd({nodeDataDependencies:t},e){const i=s=>Number.isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}import{ChartAxisDirection as An,PolarZIndexMap as cf,StateMachine as TH}from"ag-charts-core";var sM={[An.Angle]:["angleKey"],[An.Radius]:["radiusKey"]},nM={[An.Angle]:["angleName"],[An.Radius]:["radiusName"]},hf=class extends Fg{constructor({categoryKey:t,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:t,pickModes:e,canHaveAxes:i}),this.directions=[An.Angle,An.Radius],this.itemGroup=this.contentGroup.appendChild(new z({name:"items"})),this.nodeData=[],this.itemSelection=we.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=we.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=we.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=we.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=s,this.animationState=new TH("empty",{empty:{update:{target:"ready",action:a=>this.animateEmptyUpdateReady(a)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:a=>this.animateReadyHighlight(a),highlightMarkers:a=>this.animateReadyHighlightMarkers(a),resize:a=>this.animateReadyResize(a),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:a=>this.animateWaitingUpdateReady(a)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:a=>this.animateClearingUpdateEmpty(a)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",a=>this.onLegendItemClick(a)),this.ctx.eventsHub.on("legend:item-double-click",a=>this.onLegendItemDoubleClick(a)))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(t){if(t===An.Angle)return this.properties.angleKeyAxis;if(t===An.Radius)return this.properties.radiusKeyAxis}setZIndex(t){super.setZIndex(t),this.contentGroup.zIndex=[t,cf.FOREGROUND],this.highlightGroup.zIndex=[t,cf.HIGHLIGHT],this.labelGroup.zIndex=[t,cf.LABEL]}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new Gt;return t.pointerEvents=1,t}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new R(-t,-t,t*2,t*2),axis:new R(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&at([this.itemSelection,this.highlightSelection],t),e&&at([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&at([this.highlightSelection],e),i&&at([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof Be&&i.datum===e)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(t,e){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:s,datumIndex:n}=t??{},a=typeof n=="number"?e?.[n]:void 0;return i===this||a!=null&&a===s}};import{Logger as LH,StateMachine as NH,arraysEqual as kH,clamp as aM,mergeDefaults as rM}from"ag-charts-core";import{Property as Ea}from"ag-charts-core";var oM=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.Branch=3]="Branch",t[t.OtherBranch=4]="OtherBranch",t))(oM||{});function Tl(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return e(t)}}var Cn=class extends wi{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Ee),this.strokes=Object.values(ks)}};b([Ea],Cn.prototype,"childrenKey",2),b([Ea],Cn.prototype,"sizeKey",2),b([Ea],Cn.prototype,"colorKey",2),b([Ea],Cn.prototype,"colorName",2),b([Ea],Cn.prototype,"fills",2),b([Ea],Cn.prototype,"strokes",2),b([Ea],Cn.prototype,"colorRange",2);var lM=class Ed{constructor(e,i,s,n,a,r,o,l,c,h,d){this.series=e,this.itemId=i,this.datumIndex=s,this.datum=n,this.sizeValue=a,this.colorValue=r,this.sumSize=o,this.depth=l,this.parent=c,this.children=h,this.style=d,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=Ed.Walk.PreOrder){i===Ed.Walk.PreOrder&&e(this);for(const s of this.children)s.walk(e,i);i===Ed.Walk.PostOrder&&e(this)}find(e){if(e(this))return this;for(const i of this.children){const s=i.find(e);if(s!=null)return s}}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};lM.Walk={PreOrder:0,PostOrder:1};var OH=lM,wH=class extends Vo{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new za,this.animationState=new NH("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let a=0,r=1/0,o=-1/0;const l=(u,p,g)=>{const f=g.depth==null?0:g.depth+1,y=e==null?void 0:u[e],m=y==null||y.length===0;let x=i==null?void 0:u[i];Number.isFinite(x)?x=Math.max(x,0):x=m?1:0;const v=x;a=Math.max(a,f);const S=s==null?void 0:u[s];typeof S=="number"&&(r=Math.min(r,S),o=Math.max(o,S));const I=this.getItemStyle({datumIndex:p,datum:u,depth:f,colorValue:S},m,!1);return c(new t(this,ft(p.join(";")),p,u,x,S,v,f,g,[],I),y)},c=(u,p)=>{const{datumIndex:g}=u;if(p)for(const[f,y]of p.entries()){const m=l(y,g.concat(f),u);u.children.push(m),u.sumSize+=m.sumSize}return u},h=c(new t(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),d=[r,o];this.colorScale.domain=r<o?[r,o]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=a,this.colorDomain=d}update({seriesRect:t}){this.updateSelections(),this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return this.rootNode?.find(e=>e.itemId===t)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(t){const{colorKey:e,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:a}=this;return t==="gradient"&&e!=null&&i!=null?[{legendType:"gradient",enabled:a&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if(kH(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=aM(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=t;let n=this.removeMeIndexPathForIndex(e);const a=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&a.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=a.parent.children.length-1;n=n.slice(),n[n.length-1]=aM(0,n.at(-1)+i,l)}const r=n.reduce((l,c)=>l.children[c],this.rootNode),o=this.computeFocusBounds(this.datumSelection.at(e+1));if(o!=null)return{datum:r,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:r.depth,bounds:o,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){LH.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}getCategoryValue(t){}datumIndexForCategoryValue(t){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const t=this.ctx.highlightManager?.getActiveHighlight();if(t?.series===this)return t}getHierarchyHighlightState(t,e,i){if(t)return 1;if(e==null)return 0;const s=i.datumIndex?.[0],n=e.datumIndex?.[0];return s==null||n==null?0:s===n?3:4}getHierarchyHighlightStyles(t,e){switch(t){case 1:return rM(e.highlightedItem,e.highlightedBranch);case 3:return rM(e.unhighlightedItem,e.highlightedBranch);case 4:return e.unhighlightedBranch;default:return}}getHighlightStateString(t,e,i,s){if(!this.properties.highlight.enabled||i==null)return Tl(0);const n=i.reduce((o,l)=>o?.children[l],this.rootNode),a=this.getActiveHighlightNode();if(n==null)return Tl(0);const r=this.getHierarchyHighlightState(e??!1,a,n);return Tl(r)}},od=Math.PI/180,df=t=>t*od,uf=t=>-Math.log(Math.tan(Math.PI*.25+t*od*.5)),pf=t=>t/od,gf=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(od*.5),EH=class Sm extends $l{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=Sm.bounds(e)}static bounds(e){const[[i,s],[n,a]]=e,r=df(i),o=uf(s),l=df(n),c=uf(a);return new R(Math.min(r,l),Math.min(o,c),Math.abs(l-r),Math.abs(c-o))}static fixedScale(){return new Sm([[pf(0),gf(0)],[pf(1),gf(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,a=1/0;for(const r of e){const o=r.domain;for(const[l,c]of o)i=Math.min(l,i),s=Math.max(l,s),n=Math.min(c,n),a=Math.max(c,a)}return{domain:[[i,n],[s,a]],animatable:!0}}convert([e,i]){const[[s,n],[a,r]]=this.range,o=(a-s)/this.bounds.width,l=(r-n)/this.bounds.height;return[(df(e)-this.bounds.x)*o+s,(uf(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[a,r]]=this.range,o=(a-s)/this.bounds.width,l=(r-n)/this.bounds.height;return[pf((e-s)/o+this.bounds.x),gf((i-n)/l+this.bounds.y)]}getDomainMinMax(){return Zl(this.domain)}};import{getWindow as cM}from"ag-charts-core";var RH=class{constructor(t){this.minimumDelay=t?.minimumDelay??50,this.timeout=t?.timeout??100}schedule(t,e){this.cancel(),this.pending={computation:t,onComplete:e},this.minimumDelay>0?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()},this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return this.pending!=null}scheduleIdleCallback(){const t=cM(),e=Math.max(0,this.timeout-this.minimumDelay);typeof t.requestIdleCallback=="function"?this.idleCallbackId=t.requestIdleCallback(this.execute.bind(this),{timeout:e}):this.idleCallbackId=setTimeout(()=>this.execute(),e)}cancelScheduled(){if(this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId==null)return;const t=cM();typeof t.cancelIdleCallback=="function"?t.cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0}execute(){const t=this.pending;if(!t)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const e=t.computation();return t.onComplete(e),e}},ld=class{constructor(){this._dataLength=0,this.executor=new RH}get filters(){return this._filters}aggregate(t){if(this.executor.cancel(),t.targetRange>1&&t.computePartial){const e=t.computePartial(this._filters);if(e){const{immediate:i,computeRemaining:s}=e;return s&&this.executor.schedule(s,n=>{this.mergeFilters(n)}),this._filters=i,i}}return this._filters=t.computeFull(this._filters),this._filters}ensureLevelForRange(t){if(!this._filters?.some(i=>i.maxRange>t)&&this.executor.isPending()){const i=this.executor.demand();i&&this.mergeFilters(i)}}getFilterForRange(t){return this._filters?.find(e=>e.maxRange>t)}cancel(){this.executor.cancel()}markStale(t){const e=this._dataLength>0?t/this._dataLength:0;if(e>10||e<.1||this._dataLength===0)this._filters=void 0,this._dataLength=t;else if(this._filters)for(const i of this._filters)i.stale=!0;else this._dataLength=t;this.executor.cancel()}mergeFilters(t){if(!this._filters||t.length===0)return;const e=[...this._filters,...t];e.sort((i,s)=>i.maxRange-s.maxRange),this._filters=e}};import{ChartAxisDirection as hM,Property as dM}from"ag-charts-core";var ff=class extends cp{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}update(){super.update(),this.tickLineGroup.visible=this.tick.enabled,this.tickLabelGroup.visible=this.label.enabled}layoutCrossLines(){const t=this.label.getSideFlag(),e=this.hasDefinedDomain()||this.hasVisibleSeries(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();for(const a of this.crossLines)a.sideFlag=-t,a.direction=i===-Math.PI/2?hM.Angle:hM.Radius,a.parallelFlipRotation=s,a.regularFlipRotation=n,a.calculateLayout?.(e,this.reverse)}updatePosition(){super.updatePosition();const t=Math.floor(this.translation.x),e=Math.floor(this.translation.y);this.tickLineGroup.translationX=t,this.tickLineGroup.translationY=e,this.tickLabelGroup.translationX=t,this.tickLabelGroup.translationY=e,this.crossLineRangeGroup.translationX=t,this.crossLineRangeGroup.translationY=e,this.crossLineLineGroup.translationX=t,this.crossLineLineGroup.translationY=e,this.crossLineLabelGroup.translationX=t,this.crossLineLabelGroup.translationY=e,this.tickLabelGroupSelection.each(Fc())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};b([dM],ff.prototype,"shape",2),b([dM],ff.prototype,"innerRadiusRatio",2);var uM=class extends fl{calculateGridLine({index:t,tickId:e,translation:i},s,n,a,r){const{gridLine:o,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:t,tickId:e,translation:i},s,n,a,r);const d=r[s-1],u=d?i-(i-d.translation)/2:h[0],[p,g,f,y]=l?[u,Math.max(n,a),u,Math.min(n,a)]:[Math.min(n,a),u,Math.max(n,a),u],{style:m}=o,{stroke:x,strokeWidth:v=0,lineDash:S}=m[t%m.length]??{};return{tickId:e,offset:u,x1:p,y1:g,x2:f,y2:y,stroke:x,strokeWidth:v,lineDash:S}}calculateGridFills(t,e,i){return this.interval.placement!=="between"?super.calculateGridFills(t,e,i):t.map((s,n)=>this.calculateGridFill(s,n,s.index,e,i,t))}calculateGridFill({tickId:t,translation:e},i,s,n,a,r){const{gridLine:o,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:t,translation:e},i,s,n,a,r);const d=r[i-1],u=r[i+1],p=d?e-(e-d.translation)/2:h[0],g=u?e+(u.translation-e)/2:h[1],[f,y,m,x]=l?[p,Math.max(n,a),g,Math.min(n,a)]:[Math.min(n,a),p,Math.max(n,a),g],{fill:v,fillOpacity:S}=o.style[s%o.style.length]??{};return{tickId:t,x1:f,y1:y,x2:m,y2:x,fill:v,fillOpacity:S}}calculateTickLine({isPrimary:t,tickId:e,translation:i},s,n,a,r=0){const{horizontal:o,interval:l,primaryTick:c,range:h,tick:d}=this;if(l.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:e,translation:i},s,n,a,r);const u=t&&c?.enabled?c:d,p=-n*this.getTickSize(u),g=a[s-1],f=g?i-(i-g.translation)/2:h[0],y=-n*(r+this.getTickSpacing(u)),[m,x,v,S]=o?[f,y,f,y+p]:[y,f,y+p,f],{stroke:I,width:M}=u;return{tickId:e,offset:f,x1:m,y1:x,x2:v,y2:S,stroke:I,strokeWidth:M,lineDash:void 0}}},PH={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},_H={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function FH({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?PH:_H,{xTranslationDirection:a,yTranslationDirection:r}=n[i],o=a*(e+s.width/2),l=r*(e+s.height/2);return{xTranslation:o,yTranslation:l}}import{easeOut as VH}from"ag-charts-core";function cd(t,e,i,s,n){const a=(d,u,p,g)=>{i.animate({id:`${t}_${e}_${u.id}_${d}`,groupId:t,from:p?1:0,to:1,ease:VH,collapsable:p,onUpdate(f,y){y&&d!=="removed"||(u.path.clear(!0),g(f,u),u.checkPathDirty())},onStop(){d==="added"&&(u.path.clear(!0),g(1,u),u.checkPathDirty())},phase:Ri[d]})},r=new Be,o=d=>(r.resetPathDirty(),d(0,r),r.resetPathDirty(),d(1,r),r.checkPathDirty(),r.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const d of s)i.isSkipped()||(a("removed",d,!o(h),h),a("updated",d,!o(c),c)),a("added",d,!o(l),l)}import{ChangeDetectableProperties as BH,Property as Ll}from"ag-charts-core";var bs=class extends BH{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};b([Ll,K()],bs.prototype,"enabled",2),b([Ll,K()],bs.prototype,"color",2),b([Ll,K()],bs.prototype,"xOffset",2),b([Ll,K()],bs.prototype,"yOffset",2),b([Ll,K()],bs.prototype,"blur",2);import{angleBetween as zH,isBetweenAngles as Nl,normalizeAngle180 as pM,normalizeAngle360 as gM}from"ag-charts-core";function fM({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,a=1/0,r=-1/0,o=-1/0;const l=(c,h)=>{n=Math.min(c,n),a=Math.min(h,a),r=Math.max(c,r),o=Math.max(h,o)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),Nl(0,t,e)&&l(s,0),Nl(Math.PI*.5,t,e)&&l(0,s),Nl(Math.PI,t,e)&&l(-s,0),Nl(Math.PI*1.5,t,e)&&l(0,-s),new R(n,a,r-n,o-a)}function mf(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||s<Math.min(n,a)||s>Math.max(n,a))return!1;const r=pM(i.startAngle),o=pM(i.endAngle),l=Math.atan2(e,t);return r<o?l<=o&&l>=r:l<=o&&l>=-Math.PI||l>=r&&l<=Math.PI}function GH(t,e,i,s,n,a,r,o,l,c){if(Number.isNaN(t)||Number.isNaN(e))return 0;a&&([n,s]=[s,n]);const h=(c-o)/(l-r),d=o-h*r,u=Math.pow(h,2)+1,p=2*(h*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),f=Math.pow(p,2)-4*u*g;if(f<0)return 0;const y=(-p+Math.sqrt(f))/2/u,m=(-p-Math.sqrt(f))/2/u;let x=0;for(const v of[y,m]){if(!(v>=Math.min(r,l)&&v<=Math.max(r,l)))continue;const I=h*v+d,M=v-t,D=I-e,C=Math.atan2(D,M);Nl(C,s,n)&&x++}return x}function mM(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=e,r={x:a*Math.cos(i),y:a*Math.sin(i)},o={x:a*Math.cos(s),y:a*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return ho(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,l.x,l.y)||ho(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,c.x,c.y)||GH(0,0,a,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function jH(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return mM({start:i,end:s},e)||mM({start:n,end:a},e)}function yM(t,e,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*s)/(t+1*s))-e<0)return 1;let a=0,r=1;for(let o=0;o<8;o+=1){const l=(a+r)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?a=l:r=l}return a}var UH=1e-6;function Tn(t,e){return zH(t,e)<UH?e:gM(t-e)+e}function hd(t,e,i=0){const n=Math.abs(e-t)>=2*Math.PI?2*Math.PI:gM(e-t);return t=Tn(t,i),e=t+n,{startAngle:t,endAngle:e}}function dd(t,e,i,s,n,a){const r=Math.sin(a),o=Math.cos(a),l=t**2+e**2-i**2;let c,h,d,u;if(o>.5){const v=r/o,S=1+v**2,I=-2*(t+e*v),M=I**2-4*S*l;if(M<0)return;const D=(-I+Math.sqrt(M))/(2*S),C=(-I-Math.sqrt(M))/(2*S);c=D,h=D*v,d=C,u=C*v}else{const v=o/r,S=1+v**2,I=-2*(e+t*v),M=I**2-4*S*l;if(M<0)return;const D=(-I+Math.sqrt(M))/(2*S),C=(-I-Math.sqrt(M))/(2*S);c=D*v,h=D,d=C*v,u=C}const p=o,g=r,f=c*p+h*g,y=d*p+u*g,m=f>0?Tn(Math.atan2(h-e,c-t),s):Number.NaN,x=y>0?Tn(Math.atan2(u-e,d-t),s):Number.NaN;if(m>=s&&m<=n)return m;if(x>=s&&x<=n)return x}function ud(t,e,i,s,n,a){const r=Math.hypot(t,e),o=(r**2-i**2+a**2)/(2*r),l=r-o,c=Math.atan2(e,t),h=Math.acos(-l/i),d=Tn(c+h,s),u=Tn(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var bM=class extends Be{constructor(t=""){super(),this._d="",this.d=t}get d(){return this._d}set d(t){t!==this._d&&(this._d=t,this.path.clear(),this.path.appendSvg(t),this.checkPathDirty())}},HH=class extends Ha(bM){isPointInPath(t,e){return super.isPointInPath(t-this.translationX,e-this.translationY)}};import{ScaleAlignment as xM}from"ag-charts-core";var WH=class jC extends sn{static is(e){return e instanceof jC}setSourceScale(e){this._sourceScale=e;const i=n=>{Object.defineProperty(this,n,{get:()=>e[n],set:a=>{e[n]=a},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const s=n=>{Object.defineProperty(this,n,{get:()=>e[n],configurable:!0})};s("bandwidth"),s("step"),s("inset"),s("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(e){return this._sourceScale?this._sourceScale.ordinalRange(e):super.ordinalRange(e)}convert(e,i){this.refresh();const s=this.findIndex(e,i?.alignment);return s==null||s<0||s>=this.bands.length?Number.NaN:this.ordinalRange(s)}findIndex(e,i=xM.Leading){if(e==null)return;const{bands:s,reversed:n}=this,a=s.length;if(a===0)return;if(a===1)return 0;const r=s[0],o=s[a-1];if(r==null||o==null)return this._sourceScale?.findIndex(e,i);const l=e.valueOf(),c=r.valueOf(),h=o.valueOf(),d=(l-c)/(h-c),u=n?(1-d)*(a-1):d*(a-1);return i===xM.Leading?Math.max(0,Math.min(a-1,Math.floor(u))):Math.max(0,Math.min(a-1,Math.ceil(u)))}},vM=class Im{constructor(e,i,s,n){this.startAngle=e,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new Im(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[Hl](e,i){return new Im(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}},$r=class extends vs{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};b([K()],$r.prototype,"x",2),b([K()],$r.prototype,"y",2),b([K()],$r.prototype,"width",2),b([K()],$r.prototype,"height",2),b([K()],$r.prototype,"opacity",2);import{SceneChangeDetection as Ra,isNumberEqual as YH,normalizeAngle360 as SM}from"ag-charts-core";var xs=class extends Be{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return YH(SM(this.startAngle),SM(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new R(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};xs.className="Arc",b([Ra()],xs.prototype,"centerX",2),b([Ra()],xs.prototype,"centerY",2),b([Ra()],xs.prototype,"radius",2),b([Ra()],xs.prototype,"startAngle",2),b([Ra()],xs.prototype,"endAngle",2),b([Ra()],xs.prototype,"counterClockwise",2),b([Ra()],xs.prototype,"type",2);import{SceneChangeDetection as Ln,angleBetween as IM,isNumberEqual as DM,normalizeAngle360 as $H}from"ag-charts-core";function pd(t,e,i){const s=Math.hypot(t,e),a=Math.atan2(e,t)+i;return{x:Math.cos(a)*s,y:Math.sin(a)*s}}var Zi=class extends Be{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0}set cornerRadius(t){}computeBBox(){const{columnWidth:t}=this,[e,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=this.getRotation(),n=-t/2,a=t/2,r=-i,o=-e;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:p,y:g}=pd(u%2===0?n:a,u<2?r:o,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),d=Math.max(g,d)}return new R(l,c,h-l,d-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=IM(t,e);return $H(t+i/2+Math.PI/2)}normalizeRadii(t,e){return t>e?[e,t]:[t,e]}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,path:e}=this,[i,s]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=-t/2,a=t/2,r=-s,o=-i,l=this.getRotation(),c=[[n,o],[n,r],[a,r],[a,o]].map(([h,d])=>pd(h,d,l));e.clear(!0),e.moveTo(c[0].x,c[0].y),e.lineTo(c[1].x,c[1].y),e.lineTo(c[2].x,c[2].y),e.lineTo(c[3].x,c[3].y),e.closePath()}calculateCircleIntersection(t,e){const i=t*t;if(e<i)return null;const s=-Math.sqrt(e-i),n=Math.atan2(s,t);return{y:s,angle:n}}calculateBothIntersections(t,e,i){const s=i*i,n=this.calculateCircleIntersection(t,s),a=this.calculateCircleIntersection(e,s);return!n||!a?null:{left:n,right:a}}calculateAxisOuterIntersections(t,e,i){const s=i*i,n=this.calculateCircleIntersection(t,s),a=this.calculateCircleIntersection(e,s);return!n||!a?null:{left:n,right:a,radiusSquared:s}}moveToRotated(t,e,i){const s=pd(t,e,i);this.path.moveTo(s.x,s.y)}lineToRotated(t,e,i){const s=pd(t,e,i);this.path.lineTo(s.x,s.y)}renderTopWithCornerClipping(t,e,i){const{path:s}=this,{right:n,top:a,rotation:r}=i,o=a*a,l=e.radiusSquared-o;if(l<=0)this.lineToRotated(n,e.right.y,r),s.arc(0,0,t,r+e.right.angle,r+e.left.angle,!0);else{const c=Math.sqrt(l),h=Math.atan2(a,c),d=Math.atan2(a,-c);this.lineToRotated(n,e.right.y,r),s.arc(0,0,t,r+e.right.angle,r+h,!0),this.lineToRotated(-c,a,r),s.arc(0,0,t,r+d,r+e.left.angle,!0)}}updateBeveledPath(){const{columnWidth:t,path:e,axisInnerRadius:i,axisOuterRadius:s}=this,[n,a]=this.normalizeRadii(this.innerRadius,this.outerRadius),r=-t/2,o=t/2,l=-a,c=-n,h=this.getRotation(),d=DM(n,i),u=DM(a,s),p=Math.hypot(r,l)>s||Math.hypot(o,l)>s;if(!d&&!u&&!p){this.updateRectangularPath();return}const g=d?this.calculateBothIntersections(r,o,n):null,f=u?this.calculateBothIntersections(r,o,a):null,y=p?this.calculateAxisOuterIntersections(r,o,s):null;if(d&&!g||u&&!f||p&&!y){this.updateRectangularPath();return}e.clear(!0);const m={left:r,right:o,top:l,bottom:c,rotation:h};g?this.moveToRotated(r,g.left.y,h):this.moveToRotated(r,c,h),g?e.arc(0,0,n,h+g.left.angle,h+g.right.angle,!1):this.lineToRotated(o,c,h),f?(this.lineToRotated(o,f.right.y,h),e.arc(0,0,a,h+f.right.angle,h+f.left.angle,!0)):y?this.renderTopWithCornerClipping(s,y,m):(this.lineToRotated(o,l,h),this.lineToRotated(r,l,h)),e.closePath()}};Zi.className="RadialColumnShape",b([Ln()],Zi.prototype,"isBeveled",2),b([Ln()],Zi.prototype,"columnWidth",2),b([Ln()],Zi.prototype,"startAngle",2),b([Ln()],Zi.prototype,"endAngle",2),b([Ln()],Zi.prototype,"outerRadius",2),b([Ln()],Zi.prototype,"innerRadius",2),b([Ln()],Zi.prototype,"axisInnerRadius",2),b([Ln()],Zi.prototype,"axisOuterRadius",2);function MM(t,e,i,s,n){const a=IM(t,e),r=a*(1-s)/2;if(t+=r,e-=r,a<.001)return 2*i*n;if(a>=2*Math.PI){const p=t+a/2;t=p-Math.PI,e=p+Math.PI}const o=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),d=Math.floor(Math.hypot(o-c,l-h)),u=2*i*n;return Math.max(1,Math.min(u,d))}import{SceneChangeDetection as Ci,SceneObjectChangeDetection as KH}from"ag-charts-core";var yf=class{constructor(t,e,i,s,n){this.cx=t,this.cy=e,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},Dt=class extends Be{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return fM(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=hd(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=hd(t.startAngle,t.endAngle,e);return new vM(Math.max(e,a.startAngle),Math.min(i,a.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,a,r,o){if(t<=0)return;const{startAngle:l,endAngle:c}=hd(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(o&&h<=0)return;const p=o?this.getAngleOffset(h+t):this.getAngleOffset(d-t),g=r?l+p+e:c-p-e,f=o?h+t:d-t,y=f*Math.cos(g),m=f*Math.sin(g);if(u!=null&&(!r&&!(g>=l-1e-6&&g<=u.endAngle-1e-6)||r&&!(g>=u.startAngle+1e-6&&g<=c-1e-6)||o&&f<u.innerRadius-1e-6||!o&&f>u.outerRadius+1e-6))return;const x=new yf(y,m,t,i,s);if(u!=null){o?(x.clipStart(dd(y,m,t,i,s,u.endAngle)),x.clipEnd(dd(y,m,t,i,s,u.startAngle))):(x.clipStart(dd(y,m,t,i,s,u.startAngle)),x.clipEnd(dd(y,m,t,i,s,u.endAngle)));let D,C;if(r?(D=ud(y,m,t,i,s,u.innerRadius),C=ud(y,m,t,i,s,u.outerRadius)):(D=ud(y,m,t,i,s,u.outerRadius),C=ud(y,m,t,i,s,u.innerRadius)),x.clipStart(D),x.clipEnd(C),D!=null){const{x:A,y:T}=x.pointAt(D),L=Tn(Math.atan2(T,A),l);r?a?.clipStart(L):n.clipEnd(L)}if(C!=null){const{x:A,y:T}=x.pointAt(C),L=Tn(Math.atan2(T,A),l);r?n.clipStart(L):a?.clipEnd(L)}}if(u!=null){const{x:D,y:C}=x.pointAt((x.a0+x.a1)/2);if(!mf(D,C,u))return}const{x:v,y:S}=x.pointAt(r===o?x.a0:x.a1),I=Tn(Math.atan2(S,v),l),M=o?a:n;return r?M?.clipStart(I):M?.clipEnd(I),x}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:a}=this;let{startOuterCornerRadius:r,endOuterCornerRadius:o,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=hd(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=d-h,y=f>=2*Math.PI-1e-6;e.clear();const m=this.getAngleOffset(u),x=f-2*m,v=p-u,S=u>0&&x>0?2*u*Math.sin(x/2):0,I=p>0&&x>0?2*p*Math.sin(x/2):0;if(r=Math.floor(Math.max(0,Math.min(r,I/2,v/2))),o=Math.floor(Math.max(0,Math.min(o,I/2,v/2))),l=Math.floor(Math.max(0,Math.min(l,S/2,v/2))),c=Math.floor(Math.max(0,Math.min(c,S/2,v/2))),u===0&&p===0||u>p||S<0||I<=0)return;if((g?.startAngle??h)===(g?.endAngle??d))return;if(y&&this.clipSector==null&&r===0&&o===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,d),u>n&&(e.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),e.arc(i,s,u,d,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){e.arc(i,s,p,h,d,!1),e.arc(i,s,p,d,h,!0),e.closePath();return}const D=this.getAngleOffset(p);if(f<2*D)return;const A=(g?.innerRadius??u)>n,T=u<n||f<2*m,L=Math.max(r,l,o,c),N=L>0?Math.min(v/L,1):1;r*=N,o*=N,l*=N,c*=N;const O=yM(p,f-2*D,-r,-o);if(r*=O,o*=O,!T&&A){const pe=yM(u,f-2*m,l,c);l*=pe,c*=pe}else l=0,c=0;const E=Math.max(r+l,o+c),k=E>0?Math.min(v/E,1):1;r*=k,o*=k,l*=k,c*=k;let P=0,F=0;const w=r/(p-r),j=o/(p-o);if(w>=0&&w<1-1e-6)P=Math.asin(w);else{P=f/2;const pe=p/(1/Math.sin(P)+1);r=Math.min(pe,r)}if(j>=0&&j<1-1e-6)F=Math.asin(j);else{F=f/2;const pe=p/(1/Math.sin(F)+1);o=Math.min(pe,o)}const q=Math.asin(l/(u+l)),J=Math.asin(c/(u+c)),xe=g?.outerRadius??p,ti=this.getAngleOffset(xe),ae=new yf(0,0,xe,h+ti,d-ti),Et=g?.innerRadius??u,Hs=this.getAngleOffset(Et),Ni=A?new yf(0,0,Et,h+Hs,d-Hs):void 0;g!=null&&(ae.clipStart(g.startAngle),ae.clipEnd(g.endAngle),Ni?.clipStart(g.startAngle),Ni?.clipEnd(g.endAngle));const Gl=this.arc(r,P,h-Math.PI*.5,h+P,ae,Ni,!0,!1),jl=this.arc(o,F,d-F,d+Math.PI*.5,ae,Ni,!1,!1),Ul=this.arc(c,J,d+Math.PI*.5,d+Math.PI-J,ae,Ni,!1,!0),Rd=this.arc(l,q,h+Math.PI+q,h+Math.PI*1.5,ae,Ni,!0,!0);if(!(T&&A)){if(T){const pe=f<Math.PI*.5?a*(1+Math.cos(f))/Math.sin(f):Number.NaN;let Ve;pe>0&&pe<p?Ve=Math.max(Math.hypot(a,pe),u):Ve=a,Ve=Math.max(Ve,u);const Mt=h+f*.5;e.moveTo(i+Ve*Math.cos(Mt),s+Ve*Math.sin(Mt))}else if(!(Rd?.isValid()===!0||Ni?.isValid()===!0)){const pe=h+f/2,Ve=u*Math.cos(pe),Mt=u*Math.sin(pe);e.moveTo(i+Ve,s+Mt)}}if(Gl?.isValid()===!0){const{cx:pe,cy:Ve,r:Mt,a0:En,a1:Rn}=Gl;e.arc(i+pe,s+Ve,Mt,En,Rn)}if(ae.isValid()){const{r:pe,a0:Ve,a1:Mt}=ae;e.arc(i,s,pe,Ve,Mt)}if(jl?.isValid()===!0){const{cx:pe,cy:Ve,r:Mt,a0:En,a1:Rn}=jl;e.arc(i+pe,s+Ve,Mt,En,Rn)}if(!T){if(Ul?.isValid()===!0){const{cx:pe,cy:Ve,r:Mt,a0:En,a1:Rn}=Ul;e.arc(i+pe,s+Ve,Mt,En,Rn)}if(Ni?.isValid()===!0){const{r:pe,a0:Ve,a1:Mt}=Ni;e.arc(i,s,pe,Mt,Ve,!0)}if(Rd?.isValid()===!0){const{cx:pe,cy:Ve,r:Mt,a0:En,a1:Rn}=Rd;e.arc(i+pe,s+Ve,Mt,En,Rn)}}e.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=this.clipSector??this;return mf(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,a),outerRadius:Math.max(n,a)})}};Dt.className="Sector",b([Ci()],Dt.prototype,"centerX",2),b([Ci()],Dt.prototype,"centerY",2),b([Ci()],Dt.prototype,"innerRadius",2),b([Ci()],Dt.prototype,"outerRadius",2),b([Ci()],Dt.prototype,"startAngle",2),b([Ci()],Dt.prototype,"endAngle",2),b([KH({equals:(t,e)=>t.equals(e)})],Dt.prototype,"clipSector",2),b([Ci()],Dt.prototype,"concentricEdgeInset",2),b([Ci()],Dt.prototype,"radialEdgeInset",2),b([Ci()],Dt.prototype,"startOuterCornerRadius",2),b([Ci()],Dt.prototype,"endOuterCornerRadius",2),b([Ci()],Dt.prototype,"startInnerCornerRadius",2),b([Ci()],Dt.prototype,"endInnerCornerRadius",2);import{createElement as AM,getIconClassNames as ZH}from"ag-charts-core";import{createElement as CM,setAttribute as XH}from"ag-charts-core";var bf=class extends bu{constructor(){super(CM("div"),"menuitem")}},TM=class extends bu{constructor(){super(CM("div"),"menuitemradio")}setChecked(t){XH(this.elem,"aria-checked",t)}};import{CleanupRegistry as qH,addEscapeEventListener as JH,addMouseCloseListener as QH,addOverrideFocusVisibleEventListener as e4,addTouchCloseListener as t4,createElementId as i4,getDocument as s4,getLastFocus as n4,hasNoModifiers as a4,setAttribute as xf}from"ag-charts-core";var r4=["Escape","ArrowLeft"],LM=class UC extends vu{constructor(e="vertical"){super(e,"menu"),this.handleMouseEnter=(i,s)=>{s.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,s)=>{s.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const e=s4().createElement("div");return xf(e,"role","separator"),this.elem.appendChild(e),e}onChildAdded(e){super.onChildAdded(e),e.addListener("mouseenter",this.handleMouseEnter),e.addListener("mousemove",this.handleMouseMove)}onChildRemoved(e){super.onChildRemoved(e),e.removeListener("mouseenter",this.handleMouseEnter),e.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const e=new bf,i=new UC(this.orientation);i.id=i4();const s=()=>{this.collapseExpandedSubMenu(i),e.expandControlled()},n=a=>{a4(a.sourceEvent)&&a.sourceEvent.code==="ArrowRight"&&(this.collapseExpandedSubMenu(i),e.expandControlled())};return e.setControlled(i),e.setAriaHasPopup("menu"),e.addListener("click",s),e.addListener("mouseenter",s),e.addListener("keydown",n),this.addChild(e),{subMenuButton:e,subMenu:i}}expandSubMenu(e,i){const{expansionScope:s}=this;s&&(this.collapseExpandedSubMenu(i),i?.expand(e))}collapseExpandedSubMenu(e){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=e)}expand(e){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:n4(e.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new qH};const i=this.expansionScope,s=this.children.map(n=>n.getElement());xf(i.lastFocus,"aria-expanded",!0),i.removers.register(QH(this.elem,i.abort),t4(this.elem,i.abort),...this.children.map(n=>JH(n.getElement(),i.close,r4)),e?.overrideFocusVisible&&e4(this.elem,s,e.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(e){const{mode:i="0"}=e??{};if(this.expansionScope===void 0)return;const{lastFocus:s,removers:n,expandedSubMenu:a}=this.expansionScope;this.expansionScope=void 0,a?.collapse({mode:"3"}),xf(s,"aria-expanded",!1),i==="0"&&s?.focus({preventScroll:!0}),n.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}};import{clamp as gd,getWindow as o4}from"ag-charts-core";import{AbstractModuleInstance as l4,createElement as NM,getLastFocus as c4}from"ag-charts-core";var kM="canvas-overlay",OM=class extends l4{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.setOwnedWidget=(()=>{let s;return n=>{s?.destroy(),s=n}})(),this.moduleId=`popover-${e}`,i?.detached?this.element=NM("div"):this.element=t.domManager.addChild(kM,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>t.domManager.removeChild(kM,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();e?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return t??(t=NM("div","ag-charts-popover")),t.classList.toggle("ag-charts-popover",!0),e.ariaLabel!=null&&t.setAttribute("aria-label",e.ariaLabel),e.class!=null&&t.classList.add(e.class),this.element.replaceChildren(t),t}showWidget(t,e,i){this.setOwnedWidget(e),this.initPopoverElement(e.getElement(),i),e.addListener("collapse-widget",()=>{t.setControlled(void 0),this.setOwnedWidget(void 0)}),t.setControlled(e),t.expandControlled()}showWithChildren(t,e){const i=this.initPopoverElement(void 0,e);if(i.replaceChildren(...t),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const s=c4(e.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${Math.floor(t.x)}px`),t.y!=null&&e.style.setProperty("top",`${Math.floor(t.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},wM=class extends OM{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}updateAnchor(t){const e=t.anchor??this.anchor,i=t.fallbackAnchor??this.fallbackAnchor;e&&this.setAnchor(e,i)}showWidget(t,e,i){super.showWidget(t,e,i),this.updateAnchor(i)}showWithChildren(t,e){const i=super.showWithChildren(t,e);return this.updateAnchor(e),o4().requestAnimationFrame(()=>{this.repositionWithinBounds()}),i}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=e.domManager.getBoundingClientRect(),{offsetWidth:a,offsetHeight:r}=s;let o=gd(0,t.x,n.width-a),l=gd(0,t.y,n.height-r);o!==t.x&&i?.x!=null&&(o=gd(0,i.x-a,n.width-a)),l!==t.y&&i?.y!=null&&(l=gd(0,i.y-r,n.height-r)),this.updatePosition({x:o,y:l})}},h4=class extends wM{show(t,e){const i=new LM("vertical");for(const s of e.items)i.addChild(this.createRow(e,s,i));i.addClass("ag-charts-menu"),this.showWidget(t,i,e)}allocRow(t,e){if(t.menuItemRole==null||t.menuItemRole==="menuitem")return new bf;{t.menuItemRole;const i=new TM;return i.setChecked(t.value===e.value),i}}createRow(t,e,i){const s=e.value===t.value,n=this.allocRow(t,e);if(n.addClass("ag-charts-menu__row"),n.toggleClass("ag-charts-menu__row--active",s),typeof e.value=="string"&&(n.getElement().dataset.popoverId=e.value),e.icon!=null){const r=AM("span",`ag-charts-menu__icon ${ZH(e.icon)}`);n.getElement().appendChild(r)}const a=e.strokeWidth!=null;if(a&&(n.toggleClass("ag-charts-menu__row--stroke-width-visible",a),n.setCSSVariable("--strokeWidth",a?`${e.strokeWidth}px`:null)),e.label!=null){const r=AM("span","ag-charts-menu__label");r.textContent=this.ctx.localeManager.t(e.label),n.getElement().appendChild(r)}return"altText"in e&&n.setAriaLabel(this.ctx.localeManager.t(e.altText)),n.addListener("click",({sourceEvent:r})=>{t.onPress?.(e),r.preventDefault(),r.stopPropagation(),i.collapse()}),n}};import{Vec2 as kl}from"ag-charts-core";var EM=class extends OM{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:kl.from(t.clientX,t.clientY),position:kl.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const s=kl.sub(kl.from(t.clientX,t.clientY),e.client),n=kl.add(e.position,s),a=this.ctx.domManager.getBoundingClientRect(),r={};n.x>=0&&n.x+i.offsetWidth<=a.width&&(r.x=n.x),n.y>=0&&n.y+i.offsetHeight<=a.height&&(r.y=n.y),this.updatePosition(r)}onDragEnd(){this.dragStartState=void 0}};import{getIconClassNames as d4,setAttribute as u4}from"ag-charts-core";var p4={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false"};function g4(t){return typeof t!="string"?"false":p4[t]}var RM=class extends hc{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;if(t.tooltip){const n=e.t(t.tooltip);n!==this.lastTooltip&&(this.elem.title=n,this.lastTooltip=n)}let i="";if(t.icon!=null&&(i=`<span class="${d4(t.icon)} ag-charts-toolbar__icon"></span>`),t.label!=null){const n=e.t(t.label);i=`${i}<span class="ag-charts-toolbar__label">${n}</span>`}const s=g4(t.value);s=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0)):(this.setAriaHasPopup(s),this.setAriaExpanded(!1)),i!==this.lastInnerHTML&&(this.elem.innerHTML=i,this.lastInnerHTML=i)}setChecked(t){u4(this.elem,"aria-checked",t)}};import{BaseProperties as f4}from"ag-charts-core";var PM="ag-charts-toolbar__button--active",vf=class extends dc{constructor({eventsHub:t,localeManager:e},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new ab,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=t,this.localeManager=e,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(t){this.ariaLabelId=t,this.updateAriaLabel()}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,s]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=t.length;i<e.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(t.length),this.refreshButtonClasses()}updateButtonByIndex(t,e){this.buttonWidgets.at(t)?.update(e)}clearActiveButton(){for(const t of this.buttonWidgets)t.toggleClass(PM,!1)}toggleActiveButtonByIndex(t){if(t!==-1)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(PM,t!=null&&t===e)}toggleButtonEnabledByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setEnabled(e)}toggleSwitchCheckedByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setChecked(e)}getButtonBounds(){return this.buttonWidgets.map(t=>this.getButtonWidgetBounds(t))}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds();return new R(i.x+e.x,i.y+e.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[a,r]of t.entries())i=!e&&a===0||n!=r.section,s=a===t.length-1||r.section!=t.at(a+1)?.section,r.toggleClass("ag-charts-toolbar__button--first",i),r.toggleClass("ag-charts-toolbar__button--last",s),r.toggleClass("ag-charts-toolbar__button--gap",a>0&&i),n=r.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof f4?e.toJson():e},a=this.getButtonWidgetBounds(i),r={event:s,button:n,buttonBounds:a,buttonWidget:i};this.events.dispatch("button-pressed",r)}),i.addListener("focus",()=>{const s={button:{index:t}};this.events.dispatch("button-focused",s)}),i.addListener("expand-controlled-widget",s=>{this.expanded?.collapse({mode:"4"}),this.expanded=s.controlled;const n=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,n()})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},m4=class extends vf{createButtonWidget(){return new RM(this.localeManager)}};import{clamp as _M,createElement as FM,getIconClassNames as y4}from"ag-charts-core";var b4=class extends EM{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new R(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:a,offsetHeight:r}=s;let o=t.y-r-i,l=t.x-a/2;n==="below"?o=t.y+i:n==="right"?(o=t.y-r/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:o})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(_M(0,t.x,i.width-e.width)),t.y=Math.floor(_M(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},x4=class extends vf{constructor(t,e,i){super(t,e,"horizontal"),this.hasPrefix=!0,this.popover=new b4(t,i,this.onPopoverMoved.bind(this)),this.dragHandle=new v4(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),s=this.dragHandle.getBounds();return new R(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},v4=class extends qa{constructor(t){super(FM("div","ag-charts-floating-toolbar__drag-handle"));const e=new qa(FM("span",`${y4("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},S4={...Cx,...Tx},VM={};Pn(VM,{ButtonWidget:()=>hc,MenuItemRadioWidget:()=>TM,MenuItemWidget:()=>bf,MenuWidget:()=>LM,NativeWidget:()=>qa,SliderWidget:()=>Iu,ToolbarWidget:()=>dc,WIDGET_HTML_EVENTS:()=>Dy,Widget:()=>Is,WidgetEventUtil:()=>Ks});import{and as Kr,boolean as fd,color as I4,date as BM,defined as yi,greaterThan as Sf,lessThan as If,lineDashOptionsDef as D4,number as Pa,or as zM,positiveNumber as M4,ratio as GM,string as Df,strokeOptionsDef as A4,typeUnion as jM,undocumented as UM,without as Mf}from"ag-charts-core";import{DEFAULT_SPARKLINE_CROSSHAIR_STROKE as C4,isDate as T4,isNumber as L4,isString as N4,simpleMemorize as HM,toTextString as k4}from"ag-charts-core";var WM={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:C4,lineDash:[0],label:{enabled:!1}}},Af={...WM,nice:!1},md={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Cf={style:[{stroke:{$ref:"gridLineColor"}}],width:2},O4={number:{gridLine:Cf},time:{gridLine:Cf},category:{gridLine:Cf}},w4={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Af,interval:{values:[0]}},log:{...Af},time:{...Af},category:{...WM}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...md,position:{...md.position,anchorTo:"pointer"},range:"nearest"},axes:O4},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:md},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:md}}},YM=HM(E4);function E4(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:YM(t.baseTheme,e)}:e}function $M(t){if(Array.isArray(t)&&t.length!==0){const e=t.find(i=>i!=null);if(typeof e=="number")return{data:t.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(s=>({x:s?.[0],y:s?.[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(t?.length===0)return{data:t,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:t}}function R4(t){switch(t?.type){case"number":{const{reverse:e,min:i,max:s}=t??{};return{type:"number",reverse:e,min:i,max:s}}case"time":{const{reverse:e,min:i,max:s}=t??{};return{type:"time",reverse:e,min:i,max:s}}case"category":default:{if(t==null)return{type:"category"};const{reverse:e,paddingInner:i,paddingOuter:s}=t;return{type:"category",reverse:e,paddingInner:i,paddingOuter:s}}}}function P4(t,e,i){const s={};return t?.stroke!=null&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),t?.strokeWidth!=null&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),t?.visible!=null&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}var _4=HM((t,e,i)=>s=>{const n=s.datum[s.xKey],a=s.datum[s.yKey],r=i==null?s.datum:s.datum[i],o=e?.renderer?.({context:t,datum:r,xValue:n,yValue:a});if(N4(o)||L4(o)||T4(o))return k4(o);const l=o?.content??a.toFixed(2);return o?.title?{heading:void 0,title:void 0,data:[{label:o.title,value:l}]}:{heading:void 0,title:l,data:[]}});function F4(t){const{background:e,container:i,foreground:s,height:n,listeners:a,locale:r,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,theme:u,data:p,crosshair:g,axis:f,min:y,max:m,tooltip:x,context:v,styleNonce:S,...I}=t,M={background:e,container:i,foreground:s,height:n,listeners:a,locale:r,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,styleNonce:S},{data:D,series:[C]=[],datumKey:A}=$M(p),T=I;C!=null&&Object.assign(T,C),T.tooltip={...x,renderer:_4(v,x,A)},M.theme=YM(u,w4),M.data=D,M.series=[T];const L=T.type==="bar"&&T.direction==="horizontal",[N,O]=L?["left","bottom"]:["bottom","left"],E={...R4(f),position:N,...g==null?{}:{crosshair:g}},k={type:"number",gridLine:P4(f,!1,t),position:O,...y==null?{}:{min:y},...m==null?{}:{max:m}};return M.axes=L?{x:k,y:E}:{x:E,y:k},M}var Tf=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Lf={visible:fd,reverse:fd,stroke:I4,strokeWidth:M4},Ol={context:()=>!0,tooltip:yi,theme:yi,background:yi,container:yi,width:yi,height:yi,minWidth:yi,minHeight:yi,padding:yi,listeners:yi,locale:yi,data:yi,styleNonce:Df,axis:jM({number:{...Lf,min:Kr(Pa,If("max")),max:Kr(Pa,Sf("min"))},category:{...Lf,paddingInner:GM,paddingOuter:GM},time:{...Lf,min:Kr(zM(Pa,BM),If("max")),max:Kr(zM(Pa,BM),Sf("min"))}},"axis options","category"),min:Kr(Pa,If("max")),max:Kr(Pa,Sf("min")),crosshair:{enabled:fd,snap:fd,...A4,...D4},xKey:Df,yKey:Df};Ol.overrideDevicePixelRatio=UM(Pa),Ol.foreground=UM(yi);var KM={type:"preset",name:"sparkline",version:fe,options:jM({area:{...Ol,...Mf(ig,Tf)},bar:{...Ol,...Mf(Lr,Tf)},line:{...Ol,...Mf(Qo,Tf)}},"sparkline options"),create:F4,processData:$M};import{ValidationError as V4,isObject as B4,validate as z4,without as G4}from"ag-charts-core";import{ActionOnSet as j4,ChartAxisDirection as Zr,Logger as U4,clampArray as H4,entries as Nf,fromPairs as W4,groupBy as Y4}from"ag-charts-core";var $4=["top","right","bottom","left"],wl=class HC extends Qc{constructor(e,i){super(e,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new AN}onAxisChange(e,i){super.onAxisChange(e,i),this.syncAxisChanges(e,i),this.ctx!=null&&this.ctx.zoomManager.setAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(e),s.setClipRect(e)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const i=await this.getSyncedDomain(e);i!=null&&e.setDomains({domain:i})}}performLayout(e){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:a,visible:r}=this.updateAxes(e);this.seriesRoot.visible=r,this.seriesRect=a,this.animationRect=e.layoutBox;const{x:o,y:l}=a;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const g of[i,s])g.translationX=Math.floor(o),g.translationY=Math.floor(l);else{const{translationX:g,translationY:f}=i;As(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:g,translationY:f},{translationX:Math.floor(o),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=a.clone().grow(this.seriesArea.getPadding()),u=this.series.some(g=>g.alwaysClip)||(this.seriesArea.clip??!1)||n?c:void 0,{lastUpdateClipRect:p}=this;this.lastUpdateClipRect=u,this.ctx.animationManager.isActive()&&p!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:p,to:c,onUpdate:g=>this.setRootClipRects(g),onStop:()=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(u)}):this.setRootClipRects(u),this.ctx.layoutManager.emitLayoutComplete(e,{axes:W4(this.axes.map(g=>[g.id,g.getLayoutState()])),series:{visible:r,rect:a,paddedRect:c},clipSeries:n}),hD(this.series)}updateAxes(e){const{layoutBox:i,scrollbars:s}=e,{clipSeries:n,seriesRect:a,overflows:r}=this.resolveAxesLayout(i,s);for(const o of this.axes)o.update(),o.setCrossLinesVisible(!r),this.clipAxis(o,a,i);return{clipSeries:n,seriesRect:a,visible:!r}}resolveAxesLayout(e,i){let s,n,a=0;const r=10,o=this.axes.filter(l=>l.crossAt?.value!=null);do if(n=s??this.getDefaultState(),s=this.updateAxesPass(new Map(n.axisAreaWidths),e.clone(),o,i),a++>r){U4.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(s,n));return this.lastAreaWidths=s.axisAreaWidths,s}updateAxesPass(e,i,s,n){const a=new Map,r={};let o=!1,l=!1;const c=this.seriesArea.getPadding();for(const I of $4){const M=c[I]??0,D=this.axes.findLast(C=>C.position===I);D?D.seriesAreaPadding=M:i.shrink(M,I)}const h=(e.get("left")??0)+(e.get("right")??0),d=(e.get("top")??0)+(e.get("bottom")??0),u=this.buildCrossLinePadding(e),p=u.left+u.right,g=u.top+u.bottom;i.width<=h+p||i.height<=d+g?o=!0:i.shrink(u);const{scene:f}=this.ctx,y=i.clone().shrink(Object.fromEntries(e));for(const I of this.axes){const{position:M="left",direction:D}=I,C=D===Zr.Y;let A;this.sizeAxis(I,y,M),I.thickness==null?A=kf(C,f)*(I.maxThicknessRatio??1):A=I.thickness;const T={sizeLimit:A-I.label.spacing,padding:this.padding,scrollbars:n},{primaryTickCount:L,bbox:N}=I.calculateLayout(I.nice?r[D]:void 0,T);r[D]??(r[D]=L),l||(l=I.dataDomain.clipped||I.visibleRange[0]>0||I.visibleRange[1]<1),I.thickness==null&&(A=Math.min(kf(C,N)??0,A)),a.set(I.id,Math.ceil(A))}let m;s.length>0&&(m=this.calculateAxesCrossPositions(a,y,s));const x=Y4(this.axes,I=>I.position??"left"),v=new Map,S=new Map;for(const[I,M]of Nf(x)){let D=kf(I!=="left"&&I!=="right",f)%f.pixelRatio,C=0;for(const A of M??[]){S.set(A.id,D);const T=a.get(A.id)??0;C=Math.max(C,D+T),A.layoutConstraints.stacked&&(D+=T+HC.AxesPadding)}v.set(I,Math.ceil(C))}for(const[I,M]of Nf(x))this.positionAxes({axes:M??[],position:I,axisWidths:a,axisOffsets:S,axisAreaWidths:v,axisBound:i,seriesRect:y});return m!=null&&this.applyAxisCrossing(y,m),{clipSeries:l,seriesRect:y,axisAreaWidths:v,overflows:o}}calculateAxesCrossPositions(e,i,s){const n=new Map;for(const a of s){const{crossPosition:r,visible:o}=this.calculateAxisCrossPosition(a);a.setAxisVisible(o),this.adjustAxisWidth(a,e,r,i,o),r!=null&&n.set(a.id,r)}return n}calculateAxisCrossPosition(e){const i=this.axes.perpendicular(e),{scale:{domain:s,bandwidth:n},range:a}=i,r=(n??0)/2,o=i.scale.convert(e.crossAt?.value,{clamp:!1})+r;return i.inRange(o)?{crossPosition:o,visible:!0}:e.crossAt?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(o)?a[s[0]]:H4(o,a),visible:!0}}adjustAxisWidth(e,i,s,n,a){if(e.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager.createMemento().some(d=>{switch(d.type){case"vertical-line":return e.direction===Zr.X;case"horizontal-line":return e.direction===Zr.Y}}))return;const c=i.get(e.id)??0,h=a?this.calculateAxisBleedingWidth(e,c,s,n):0;i.set(e.id,h)}calculateAxisBleedingWidth(e,i,s,n){if(s==null)return i;switch(e.position){case"left":case"top":return Math.max(0,i-s);case"right":return Math.max(0,s+i-n.width);case"bottom":return Math.max(0,s+i-n.height);default:return i}}applyAxisCrossing(e,i){for(const s of this.axes){const n=i.get(s.id);if(n==null){s.crossAxisTranslation.x=0,s.crossAxisTranslation.y=0;continue}const a=s.direction===Zr.X;s.crossAxisTranslation.x=a?0:e.x+n-s.translation.x,s.crossAxisTranslation.y=a?e.y+n-s.translation.y:0}}buildCrossLinePadding(e){var i;const s={top:0,right:0,bottom:0,left:0};for(const n of this.axes){const{position:a,label:r}=n;if(n.crossLines)for(const o of n.crossLines)o instanceof Tt&&(o.position=a??"top",(i=o.label).parallel??(i.parallel=r.parallel)),o.calculatePadding?.(s)}for(const[n,a=0]of Nf(s))s[n]=Math.max(a-(e.get(n)??0),0);return s}clampToOutsideSeriesRect(e,i,s,n){const a=s==="x"?e.x:e.y,r=s==="x"?e.width:e.height;return n===1?Math.min(i,a+r):Math.max(i,a)}async getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(e)}syncAxisChanges(e,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const a of e)n.delete(a);for(const a of n)s.removeAxis(a)}sizeAxis(e,i,s){const n=e instanceof mi,a=s==="left"||s==="right",{width:r,height:o}=i,l=a?o:r;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:p,unit:g,align:f}=e.layoutConstraints;g==="px"?h=c+p:h=h*p/100;const y=h-c;if(f==="end")c=l-y,h=l;else if(f==="center"){const m=c+(l-c)/2;c=m-y/2,h=m+y/2}else f==="justify"&&(h=l);a&&(n?[c,h]=[h,c]:[d,u]=[1-u,1-d]),e.range=[c,h],e.visibleRange=[d,u],e.gridLength=a?r:o,e.lineRange=a?[o,0]:[0,r]}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:a,axisAreaWidths:r,seriesRect:o,position:l}=e,c=r.get(l)??0;let h="x",d="y",u=1;(l==="top"||l==="bottom")&&(h="y",d="x");let p=s[h];(l==="right"||l==="bottom")&&(u=-1,p+=h==="x"?s.width:s.height);for(const g of i){const f=r.get(d==="x"?"left":"top")??0,y=n.get(g.id)??0,m=a.get(g.id)??0;g.gridPadding=c-m-y,g.translation[d]=s[d]+f,g.translation[h]=this.clampToOutsideSeriesRect(o,p+u*(m+y),h,u)}}shouldFlipXY(){return this.series.every(e=>e instanceof Sn&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&e.set(i,s)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const s of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const a=e.axisAreaWidths.get(s);if((n!=null||a!=null)&&n!==a)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),a=Math.ceil(e.line?.width??0);let{width:r,height:o}=i;switch(r+=e.direction===Zr.X?n:a,o+=e.direction===Zr.Y?n:a,e.clipGrid(i.x,i.y,r,o),e.position){case"left":case"right":e.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":e.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};wl.className="CartesianChart",wl.type="cartesian",wl.AxesPadding=15,b([j4({changeValue(t,e){this.onAxisChange(t,e)}})],wl.prototype,"axes",2);var K4=wl;function kf(t,e){return t?e?.width:e?.height}var Z4=new Set(["number","log","time"]),X4=t=>B4(t)&&t.type!=null&&!Z4.has(t.type),bi={type:"chart",name:"cartesian",version:fe,options:FO,create(t,e){return new K4(t,e)},validate(t,e,i){const s=[];t?.series?.[0]?.type==="histogram"&&Object.values(t?.axes??{}).some(X4)&&(s.push(new V4("invalid","only continuous axis types when histogram series is used",t.axes,i,"axes")),t=G4(t,["axes"]));const n=z4(t,e,i);return n.invalid.push(...s),n}};import{UnknownError as q4,validate as J4,without as Q4}from"ag-charts-core";import{ChartAxisDirection as ZM,Padding as eW,ZIndexMap as tW,iterate as XM}from"ag-charts-core";var Of=class extends Qc{constructor(t,e){super(t,e),this.axes=this.createChartAxes(),this.padding=new eW(40),this.ctx.axisManager.axisGroup.zIndex=tW.AXIS_FOREGROUND}createChartAxes(){return new CN}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(t=>t.type==="pie"||t.type==="donut")}async performLayout(t){const e=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=e,this.animationRect=e,this.seriesRoot.translationX=e.x,this.seriesRoot.translationY=e.y,await this.computeCircle(e);for(const s of this.axes)s.update();let i=0;for(const s of this.series)i=Math.max(i,s.properties.marker?.size??0);for(const s of this.series.filter(qM))s.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:e,paddedRect:t.layoutBox}})}updateAxes(t,e,i,s){if(this.axes.length===0)return;const n=this.axes[ZM.Angle],a=this.axes[ZM.Radius],r=n.scale,o=a.innerRadiusRatio;n.innerRadiusRatio=o,n.computeRange(),n.gridLength=s,a.gridAngles=r.ticks({nice:[n.nice,n.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>r.convert(l)),a.gridRange=n.range,a.range=[s,s*o];for(const l of[n,a])l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()}async computeCircle(t){const e=this.series.filter(qM),i=(l,c,h)=>{this.updateAxes(t,l,c,h);for(const u of e)u.centerX=l,u.centerY=c,u.radius=h;const d=e.filter(u=>u.type==="donut"||u.type==="pie");if(d.length>1){const u=d.map(p=>{const g=p.getInnerRadius();return{series:p,innerRadius:g}}).sort((p,g)=>p.innerRadius-g.innerRadius);u.at(-1).series.surroundingRadius=void 0;for(let p=0;p<u.length-1;p++)u[p].series.surroundingRadius=u[p+1].innerRadius}},s=t.width/2,n=t.height/2,a=Math.max(0,Math.min(t.width,t.height)/2);let r=a;i(s,n,r);const o=async({hideWhenNecessary:l=!1}={})=>{const c=[];for(const u of XM(this.axes,e)){const p=await u.computeLabelsBBox({hideWhenNecessary:l},t);p&&c.push(p)}if(c.length===0){i(s,n,a);return}const h=R.merge(c),d=this.refineCircle(h,r,t);i(d.centerX,d.centerY,d.radius),r=d.radius};await o(),await o(),await o(),await o({hideWhenNecessary:!0}),await o({hideWhenNecessary:!0});for(const l of XM(this.axes,e))await l.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:r,centerX:s,centerY:n}}refineCircle(t,e,i){const n=-e,a=-e,r=e,o=e;let l=Math.max(0,n-t.x),c=Math.max(0,a-t.y),h=Math.max(0,t.x+t.width-r),d=Math.max(0,t.y+t.height-o);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let g=Math.min(u,p)/2;const f=.5*i.width/2,y=.5*i.height/2,m=Math.min(f,y);if(g<m){g=m;const S=l+h,I=c+d;if(2*g+I>i.height){const M=i.height-2*g;Math.min(c,d)*2>M?(c=M/2,d=M/2):c>d?c=M-d:d=M-c}if(2*g+S>i.width){const M=i.width-2*g;Math.min(l,h)*2>M?(l=M/2,h=M/2):l>h?l=M-h:h=M-l}}const x=l+2*g+h,v=c+2*g+d;return{centerX:(i.width-x)/2+l+g,centerY:(i.height-v)/2+c+g,radius:g}}};Of.className="PolarChart",Of.type="polar";function qM(t){return t instanceof hf}var yd={type:"chart",name:"polar",version:fe,options:VO,create(t,e){return new Of(t,e)},validate(t,e,i){const s=[],n=t?.series?.[0]?.type;(n==="pie"||n==="donut")&&t?.axes&&(s.push(new q4([],t.axes,i,"axes")),t=Q4(t,["axes"]));const a=J4(t,e,i);return a.invalid.push(...s),a}};import{CARTESIAN_POSITION as xi,FONT_SIZE_RATIO as iW,LEGEND_CONTAINER_THEME as sW,boolean as El,borderOptionsDef as nW,callback as wf,colorUnion as aW,fillOptionsDef as Ef,fontOptionsDef as JM,legendPositionValidator as rW,number as oW,padding as lW,positiveNumber as Jt,ratio as cW,shapeValidator as QM,strokeOptionsDef as Rf,union as hW}from"ag-charts-core";import{BaseProperties as Xr,Border as dW,ChartUpdateType as Pf,CleanupRegistry as uW,FONT_SIZE as pW,LineSplitter as gW,Logger as _f,ObserveChanges as fW,Property as Y,ZIndexMap as mW,cachedTextMeasurer as yW,callWithContext as eA,clamp as bW,createId as xW,deepClone as vW,expandLegendPosition as Ff,isImageFill as SW,isPatternFill as IW,isTextTruncated as DW,objectsEqual as MW,toPlainText as AW,truncateLine as CW}from"ag-charts-core";function TW({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:r=!1}){const o=t==="horizontal",l={max:o?s:i,fn:o?u=>u.width:u=>u.height,padding:o?a:n},c={max:o?i:s,fn:o?u=>u.height:u=>u.width,padding:o?n:a};let h=0;const d=[];for(;h<e.length;){const u=e.slice(h),p=LW(u,h,l,c,r);if(!p)return;h+=p.processedBBoxCount,d.push(p.pageIndices)}return kW(d,t,e,n,a)}function LW(t,e,i,s,n){let r=wW(t,i);if(r<1){if(!n)return;r=1}let o=r;for(;o>=1;){const l=NW(t,e,o,i,s,n);if(l==null&&o<=1)return;if(l==null){o--;continue}if(typeof l=="number"){if(l<=1)return;o=l<o&&l>1?l:o,o--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function NW(t,e,i,s,n,a){const r=[];let o=0,l=0,c=[];const h=[];for(let d=0;d<t.length;d++){const u=(d+i)%i;u===0&&(o+=l,l=0,c.length>0&&r.push(c),c=[]);const p=s.fn(t[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(t[d])+n.padding);const g=o+l,f=!a||r.length>0;if(g>n.max&&f){c=[];break}if(h.reduce((m,x)=>m+x,0)>s.max&&!a)return h.length<i?h.length:void 0;c.push(d+e)}return c.length>0&&r.push(c),r.length>0?r:void 0}function kW(t,e,i,s,n){let a=0,r=0;return{pages:t.map(l=>{e==="horizontal"&&(l=OW(l));let c=0;const h=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let f=0,y=0;for(const m of g)f+=m.height+s,y=Math.max(y,m.width+n);return{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(y)}});let d=0,u=0;for(const p of h)d+=p.columnWidth,u=Math.max(u,p.columnHeight);return a=Math.max(d,a),r=Math.max(u,r),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:a,maxPageHeight:r}}function OW(t){const e=[];for(const i of t[0])e.push([]);for(const[i,s]of t.entries())for(const[n,a]of s.entries())e[n][i]=a;return e}function wW(t,e){const i=t.length;let s=0;for(let n=0;n<i;n++)if(s+=e.fn(t[n])+e.padding,s>e.max)return i/n<2?Math.ceil(i/2):n;return i}import{ActionOnSet as EW,BaseProperties as bd,ChartUpdateType as tA,FONT_SIZE as iA,Property as ut,clamp as RW,createId as PW}from"ag-charts-core";var qr=class extends bd{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=iA.SMALL,this.fontFamily="Verdana, sans-serif"}};b([ut],qr.prototype,"color",2),b([ut],qr.prototype,"fontStyle",2),b([ut],qr.prototype,"fontWeight",2),b([ut],qr.prototype,"fontSize",2),b([ut],qr.prototype,"fontFamily",2);var Gs=class extends bd{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};b([ut],Gs.prototype,"size",2),b([ut],Gs.prototype,"fill",2),b([ut],Gs.prototype,"fillOpacity",2),b([ut],Gs.prototype,"stroke",2),b([ut],Gs.prototype,"strokeWidth",2),b([ut],Gs.prototype,"strokeOpacity",2);var xd=class extends bd{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};b([EW({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],xd.prototype,"shape",2),b([ut],xd.prototype,"size",2),b([ut],xd.prototype,"padding",2);var _a=class extends bd{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=PW(this),this.marker=new xd(this),this.activeStyle=new Gs,this.inactiveStyle=new Gs,this.highlightStyle=new Gs,this.label=new qr,this.group=new gt({name:"pagination"}),this.labelNode=new Gt,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new je,this.previousButton=new je,this.labelNode.setProperties({textBaseline:"middle",fontSize:iA.SMALL,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(t){switch(this._orientation=t,t){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateNextButtonPosition(){const t=this.labelNode.getBBox();this.nextButton.translationX=t.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:a,fontSize:r,fontFamily:o}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=a,i.fontSize=r,i.fontFamily=o}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:r,highlightActive:o}=this,l=(c,h)=>h?a:c===o?r:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){const{shape:i,size:s}=this.marker;t.shape=i,t.size=s,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,s=t===e-1,n=t===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=RW(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback(tA.SCENE_RENDER)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(tA.SCENE_RENDER)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=ve.toCanvas(this.previousButton),e=ve.toCanvas(this.nextButton);return{prev:t,next:e}}};_a.className="Pagination",b([ut],_a.prototype,"marker",2),b([ut],_a.prototype,"activeStyle",2),b([ut],_a.prototype,"inactiveStyle",2),b([ut],_a.prototype,"highlightStyle",2),b([ut],_a.prototype,"label",2);import{createElement as _W,createElementId as FW,toPlainText as sA}from"ag-charts-core";var VW=class{constructor(t,e){this.dirty=!0,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=_W("p"),this.itemDescription.style.display="none",this.itemDescription.id=FW(),this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:s,itemListener:n}=t,a=e.localeManager,r=i.length;i.each((o,l,c)=>{o.proxyButton?.destroy(),o.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(a,sA(s.getItemLabel(l)),c,r),ariaChecked:!!o.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=o.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,o.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,o.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,o)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d,o)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>n.onHover(d.sourceEvent,o)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:s}){const n=ve.toCanvas(e);this.itemList.setBounds(n);const a=Math.max(...t.nodes().map(r=>r.getTextMeasureBBox().height));t.each((r,o)=>{if(r.proxyButton){const l=r.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=ve.toCanvas(r,r.getTextMeasureBBox()),p=(a-d)/2,g={x:c-n.x,y:h-p-n.y,height:a,width:u},f=s&&l;r.proxyButton.setCursor("pointer"),r.proxyButton.setEnabled(f),r.proxyButton.setPointerEvents(f?void 0:"none"),r.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{oldPages:s,newPages:n}=t,a=(s?.length??n.length)>1,r=n.length>1;a!==r&&(r?this.createPaginationButtons(t):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(r?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:s,next:n}=i.computeCSSBounds(),a=R.merge([s,n]);s.x-=a.x,s.y-=a.y,n.x-=a.x,n.y-=a.y,this.paginationGroup.setBounds(a),this.prevButton.setBounds(s),this.nextButton.setBounds(n),this.prevButton.setEnabled(i.currentPage!==0),this.nextButton.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton.setCursor(i.getCursor("next")),this.prevButton.setCursor(i.getCursor("previous"))}}createPaginationButtons(t){const{ctx:e,pagination:i}=t;this.prevButton||(this.prevButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",s=>this.onPageButton(t,s,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",s=>this.onPageButton(t,s,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0)))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,s,n)=>{const[a,r]=[e[s],t[s]];return a.id!==r.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},a,r)=>{const o=n?.getElement();if(o!=null){const l=sA(i.getItemLabel(a));o.textContent=this.getItemAriaText(t,l,r,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,s){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:s})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}};import{toPlainText as BW}from"ag-charts-core";function nA(t,{itemId:e,seriesId:i,label:{text:s}},n){const a={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:n,text:BW(s),preventDefault:()=>a.defaultPrevented=!0}};return a}import{ObserveChanges as aA,ProxyPropertyOnWrite as Jr,SceneChangeDetection as zW}from"ag-charts-core";var Xi=class extends gt{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new z({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Gt),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new je({zIndex:1})),this.line=this.symbolsGroup.appendChild(new ni({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),R.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,a=0;if(t.visible){const{size:r}=t,o=je.anchor(t.shape);n=(o.x-.5)*r+i/2,a=(o.y-.5)*r,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=a):(t.x=n,t.y=a,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e}=this;this.label.x=t+e}computeBBox(){return this.layout(),super.computeBBox()}};Xi.className="MarkerLabel",b([Jr("label")],Xi.prototype,"text",2),b([Jr("label")],Xi.prototype,"fontStyle",2),b([Jr("label")],Xi.prototype,"fontWeight",2),b([Jr("label")],Xi.prototype,"fontSize",2),b([Jr("label")],Xi.prototype,"fontFamily",2),b([Jr("label","fill")],Xi.prototype,"color",2),b([aA(t=>t.layoutLabel())],Xi.prototype,"spacing",2),b([aA(t=>t.layoutLabel())],Xi.prototype,"length",2),b([zW()],Xi.prototype,"isCustomMarker",2);function GW(t,e){switch(typeof e.itemId){case"number":return{series:t,itemId:void 0,datum:void 0,datumIndex:e.itemId,legendItemName:e.legendItemName};case"string":return{series:t,itemId:e.itemId,datum:void 0,datumIndex:void 0,legendItemName:e.legendItemName};default:return e.itemId}}var Nn=class extends Xr{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=pW.SMALL,this.fontFamily="Verdana, sans-serif"}};b([Y],Nn.prototype,"maxLength",2),b([Y],Nn.prototype,"color",2),b([Y],Nn.prototype,"fontStyle",2),b([Y],Nn.prototype,"fontWeight",2),b([Y],Nn.prototype,"fontSize",2),b([Y],Nn.prototype,"fontFamily",2),b([Y],Nn.prototype,"formatter",2);var Qr=class extends Xr{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};b([Y],Qr.prototype,"shape",2),b([Y],Qr.prototype,"size",2),b([Y],Qr.prototype,"padding",2),b([Y],Qr.prototype,"strokeWidth",2),b([Y],Qr.prototype,"enabled",2);var Vf=class extends Xr{};b([Y],Vf.prototype,"strokeWidth",2),b([Y],Vf.prototype,"length",2);var kn=class extends Xr{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new Qr,this.label=new Nn,this.line=new Vf}};b([Y],kn.prototype,"maxWidth",2),b([Y],kn.prototype,"paddingX",2),b([Y],kn.prototype,"paddingY",2),b([Y],kn.prototype,"showSeriesStroke",2),b([Y],kn.prototype,"marker",2),b([Y],kn.prototype,"label",2),b([Y],kn.prototype,"line",2);var Bf=class extends Xr{};b([Y],Bf.prototype,"legendItemClick",2),b([Y],Bf.prototype,"legendItemDoubleClick",2);var rA={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},oA={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},lA={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},Pe=class extends Xr{constructor(t){super(),this.ctx=t,this.id=xW(this),this.group=new gt({name:"legend",zIndex:mW.LEGEND}),this.itemSelection=we.select(this.group,Xi),this.containerNode=this.group.appendChild(new ze({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new kn,this.listeners=new Bf,this.enabled=!1,this.position="bottom",this.border=new dW(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new uW,this.size=[0,0],this._visible=!0,this.pagination=new _a(i=>t.updateService.update(i),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:e}=t.contextMenuRegistry.builtins;e["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),e["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(t.eventsHub.on("active:load-memento",i=>this.onActiveLoadMemento(i)),t.eventsHub.on("active:update",i=>this.onActiveUpdate(i)),t.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),t.eventsHub.on("legend:change-partial",this.onLegendDataChangePartial.bind(this)),t.layoutManager.registerElement(1,i=>this.positionLegend(i)),t.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete e["toggle-series-visibility"].action,()=>delete e["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new VW(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){MW(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.enabled&&(this.data=t.filter(e=>!e.hideInLegend))}onLegendDataChangePartial(t){this.itemSelection.each(({proxyButton:e},{itemId:i})=>{if(e!=null)for(const s of t.legendData)s.itemId===i&&e.setChecked(s.enabled)})}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}getOrientation(){return this.orientation??"horizontal"}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}updateItemSelection(){const t=[...this.data];this.reverseOrder&&t.reverse(),this.itemSelection.update(t)}isInteractive(){const{toggleSeries:t,listeners:{legendItemClick:e,legendItemDoubleClick:i}}=this;return t||i!=null||e!=null}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{formatter:e}=this.item.label;if(e){const i=t.datum;return this.cachedCallWithContext(e,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...i&&{datum:i}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:a,label:{maxLength:r=1/0,fontStyle:o,fontWeight:l,fontSize:c,fontFamily:h}}=this.item;this.updateItemSelection();const d=[],u=yW(n),g=a??t*.8,{markerWidth:f,anyLineEnabled:y}=this.calculateMarkerWidth();if(this.itemSelection.each((A,T)=>{A.fontStyle=o,A.fontWeight=l,A.fontSize=c,A.fontFamily=h;const L=this.updateMarkerLabel(A,T,f,y),N=T.itemId??T.id,O=this.getItemLabel(T),E=AW(O,"<unknown>").replace(gW," ");A.text=this.truncate(E,r,g,L,u,N),d.push(A.getTextMeasureBBox())}),t=Math.max(1,t),e=Math.max(1,e),!Number.isFinite(t))return{};[t,e]=this.updateContainer(t,e);const m=this.size,x=this.oldSize;m[0]=t,m[1]=e,(m[0]!==x[0]||m[1]!==x[1])&&(x[0]=m[0],x[1]=m[1]);const{pages:v,maxPageHeight:S,maxPageWidth:I}=this.updatePagination(d,t,e),M=this.pages;this.pages=v,this.maxPageSize=[I-i,S-s];const D=this.pagination.currentPage,C=this.pages[D];return this.pages.length<1||!C?(this.visible=!1,{oldPages:M}):(this.visible=!0,this.updatePositions(D),this.update(),{oldPages:M})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0),n=!!(t.line&&e),a=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:a}}calcSymbolsLengths(t,e,i){const{marker:s,line:n}=this.item;let a;const{shape:r}=t.marker;if(this.isCustomMarker(e,r)){const c=new je;c.shape=r,c.updatePath();const h=c.getBBox();a=Math.max(h.width,h.height)}const o=e?s.size:0,l=i?n.length??25:0;return{markerLength:o,lineLength:l,customMarkerSize:a}}calculateMarkerWidth(){let t=0,e=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:a,markerEnabled:r}=this.calcSymbolsEnabled(n),{markerLength:o,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,r,a);t=Math.max(t,l,c,o),e||(e=a)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,s){const{marker:n,paddingX:a}=this.item,{symbol:r}=e;let o=a;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(r),h=n.padding;(l||s)&&(o+=h+i);const{marker:d,line:u}=t;return d.visible=l,d.visible&&(d.shape=n.shape??r.marker.shape??"square",d.size=n.size,d.setStyleProperties(this.getMarkerStyles(vW(r)))),u.visible=s,u.visible&&u.setStyleProperties(this.getLineStyles(r)),t.length=i,t.spacing=h,t.isCustomMarker=c,o}updateContainer(t,e){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,t-=i.strokeWidth*2+i.padding.left+i.padding.right,e-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[t,e]}truncate(t,e,i,s,n,a){let r=!1;t.length>e&&(t=t.substring(0,e),r=!0);const o=CW(t,n,i-s,r);return DW(o)?this.truncatedItems.add(a):this.truncatedItems.delete(a),o}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:r,maxPageWidth:o,paginationBBox:l,paginationVertical:c}=this.calculatePagination(t,e,i),h=a.findIndex(v=>v.endIndex>=n);this.pagination.currentPage=bW(0,h,a.length-1);const{paddingX:d,paddingY:u}=this.item,p=8,g=o-d,f=r-u;let y=0,m=-l.y-this.item.marker.size/2;c?m+=f+p:(y+=-l.x+g+p,m+=(f-l.height)/2),this.pagination.translationX=y,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let x=0;return this.itemSelection.each((v,S,I)=>{I>(a[x]?.endIndex??1/0)&&x++,v.pageIndex=x}),{maxPageHeight:r,maxPageWidth:o,pages:a}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,a=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:r}=Ff(this.position),o=this.getOrientation(),l=a.includes(r);let c=this.pagination.getBBox(),h=new R(0,0,0,0),d=[],u=0,p=0,g=0;const f=m=>m.width===c.width&&m.height===c.height,y=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(g++>10){_f.warn("unable to find stable legend layout.");break}c=h;const m=e-(l?0:c.width),x=i-(l?c.height:0),v=TW({orientation:o,bboxes:t,maxHeight:x,maxWidth:m,itemPaddingY:n,itemPaddingX:s,forceResult:y});d=v?.pages??[],u=v?.maxPageWidth??0,p=v?.maxPageHeight??0;const S=d.length;if(this.pagination.visible=S>1,this.pagination.totalPages=S,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!f(h));return{maxPageWidth:u,maxPageHeight:p,pages:d,paginationBBox:h,paginationVertical:l}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:a,endIndex:r}=s[t];let o=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+e,p=[];i.each((g,f,y)=>{if(y<a||y>r){g.visible=!1;return}const m=y-a;let x,v;d?(x=m%c,v=Math.floor(m/c)):(x=Math.floor(m/h),v=m%h),g.visible=!0;const S=n[x];S&&(l=Math.floor(u*v),o=Math.floor(p[v]??0),p[v]=(p[v]??0)+S.columnWidth,g.translationX=o,g.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n}=this,{startIndex:a,endIndex:r}=n[t];a===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((a+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:this.isInteractive()}),this.ctx.updateService.update(Pf.SCENE_RENDER)}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const t=this.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-series-visibility",t),this.ctx.contextMenuRegistry.toggle("toggle-other-series",t)}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},a=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??a,lineDash:n}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:a,lineDash:r,lineDashOffset:o}=t,l=Math.min(2,a??1);return IW(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),SW(e)&&(e.fit="contain",e.width=void 0,e.height=void 0,e.repeat="no-repeat"),Ip({fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:r,lineDashOffset:o},rA,oA,lA)}getContainerStyles(){const{stroke:t,strokeOpacity:e,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:a,padding:r}=this,o=typeof r=="number";return Ip({cornerRadius:s,fill:n,fillOpacity:a,padding:{top:o?r:r.top??0,right:o?r:r.right??0,bottom:o?r:r.bottom??0,left:o?r:r.left??0},stroke:t,strokeOpacity:e,strokeWidth:this.border.enabled?i:0},rA,oA,lA)}computePagedBBox(){const t=z.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[s,n]=this.maxPageSize;t.height=Math.max(n,t.height),t.width=Math.max(s,t.width)}const{strokeWidth:e,padding:i}=this.getContainerStyles();return t.grow(i).grow(e),t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i),this.clearHighlight()}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum),this.clearHighlight()}onContextClick(t,e){if(this.checkInteractionState())return;const{sourceEvent:i}=t,s=e.datum;this.clearHighlight(),this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const a=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-other-series",a);const{offsetX:r,offsetY:o}=i,{x:l,y:c}=ve.toCanvasPoint(e,r,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:t,canvasX:l,canvasY:c},{legendItem:s})}onClick(t,e,i){this.checkInteractionState()||this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:s},ctx:{chartService:n},preventHidingAll:a,toggleSeries:r}=this;if(!e)return!1;const{legendType:o,seriesId:l,itemId:c,enabled:h,legendItemName:d}=e,u=n.series.find(f=>f.id===l);if(!u)return!1;let p=h;const g=nA("click",e,t);return s&&eA([u.properties,this.ctx.chartService],s,g.apiEvent),g.defaultPrevented||(r&&(p=!h,a&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.eventsHub.emit("legend:item-click",{legendType:o,series:u,itemId:c,enabled:p,legendItemName:d})),this.updateHighlight(p,e,u),this.ctx.legendManager.update(),this.ctx.updateService.update(Pf.PROCESS_DATA,{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1})),!0}onDoubleClick(t,e){this.checkInteractionState()||this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!e)return!1;const{legendType:a,id:r,itemId:o,seriesId:l}=e,c=s.series.find(d=>d.id===r);if(!c)return!1;const h=nA("dblclick",e,t);if(i&&eA([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(f=>f.getLegendData("category"));let u=0;const p=new Set;for(const f of d)f.enabled&&(u+=1,f.legendItemName!=null&&p.add(f.legendItemName));p.size>0&&(u=p.size);const g=d.find(f=>f.itemId===o&&f.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:a,series:c,itemId:o,numVisibleItems:u,enabled:g?.enabled??!1,legendItemName:g?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.updateService.update(Pf.PROCESS_DATA,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=ve.toCanvas(e).computeCenter():(t.preventDefault(),i=ve.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(t,e){if(this.checkInteractionState())return;if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(i?.enabled,i,s)}onLeave(){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight())}clearHighlight(){this.updateHighlight(void 0,void 0,void 0)}updateHighlight(t,e,i,s){const n=r=>{if(r===void 0)this.ctx.activeManager.clear();else{const o=r.nodeDatum.series.id,l=r.itemId;this.ctx.activeManager.update({type:"legend",seriesId:o,itemId:l},void 0)}this.ctx.highlightManager.updateHighlight(this.id,r?.nodeDatum)},a=r=>{this.ctx.interactionManager.isState(64)||s?.initialState?n(r):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{n(r)}):r===void 0&&n(r)};if(t===!0&&i!==void 0&&e!==void 0){const r=e.itemId,o=GW(i,e);a({itemId:r,nodeDatum:o})}else a(void 0)}onActiveUpdate(t){t?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id,void 0)}onActiveLoadMemento(t){const{activeItem:e}=t;if(e?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id,void 0);const i=this.data.find(n=>n.seriesId===e.seriesId&&n.itemId===e.itemId),s=this.ctx.chartService.series.find(n=>n.id===e.seriesId);if(s===void 0)_f.warn(`Cannot find seriesId: "${e.seriesId}"`),t.reject();else if(i===void 0){const n=JSON.stringify({seriesId:e.seriesId,itemId:e.itemId});_f.warn(`cannot find legend item: ${n}`),t.reject()}else this.updateHighlight(i.enabled,i,s,t)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{placement:e,floating:i,xOffset:s,yOffset:n}=Ff(this.position),a=i?new R(0,0,t.width,t.height):t.layoutBox,{x:r,y:o,width:l,height:c}=a,[h,d]=this.calculateLegendDimensions(a),{oldPages:u}=this.calcLayout(h,d),p=this.computePagedBBox();if(this.visible){let f=function(v){};var g=f;const y=this.spacing;let m,x;switch(e){case"top":m=(l-p.width)/2,x=0;break;case"bottom":m=(l-p.width)/2,x=c-p.height;break;case"right":m=l-p.width,x=(c-p.height)/2;break;case"left":m=0,x=(c-p.height)/2;break;case"top-right":case"right-top":m=l-p.width,x=0;break;case"top-left":case"left-top":m=0,x=0;break;case"bottom-right":case"right-bottom":m=l-p.width,x=c-p.height;break;case"bottom-left":case"left-bottom":m=0,x=c-p.height;break;default:f(e)}if(!i){let v,S;switch(e){case"top":case"top-right":case"top-left":v=p.height+y,S="top";break;case"bottom":case"bottom-right":case"bottom-left":v=p.height+y,S="bottom";break;case"left":case"left-top":case"left-bottom":v=p.width+y,S="left";break;case"right":case"right-top":case"right-bottom":v=p.width+y,S="right";break;default:f(e)}a.shrink(v,S)}m+=s,x+=n,this.group.translationX=Math.floor(r+m-p.x),this.group.translationY=Math.floor(o+x-p.y),this.containerNode.x=p.x,this.containerNode.y=p.y,this.containerNode.width=p.width,this.containerNode.height=p.height}return u}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:s,pages:n,group:a}=this,r=this.visible&&this.enabled,o=this.isInteractive();this.domProxy.update({visible:r,interactive:o,ctx:e,itemSelection:i,group:a,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,{placement:s}=Ff(this.position),n=e/i,a=.5,r=.2,o=.25;let l,c;function h(d){}switch(s){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const d=n<1?Math.min(a,r*(1/n)):r;l=this.maxWidth?Math.min(this.maxWidth,e):e,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*d);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const d=n>1?Math.min(a,o*n):o;l=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*d),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(t,e){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],t,e)}};Pe.className="Legend",b([Y],Pe.prototype,"toggleSeries",2),b([Y],Pe.prototype,"pagination",2),b([Y],Pe.prototype,"item",2),b([Y],Pe.prototype,"listeners",2),b([fW((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),Y],Pe.prototype,"enabled",2),b([Y],Pe.prototype,"position",2),b([Y],Pe.prototype,"maxWidth",2),b([Y],Pe.prototype,"maxHeight",2),b([Y],Pe.prototype,"reverseOrder",2),b([Y],Pe.prototype,"orientation",2),b([Y],Pe.prototype,"preventHidingAll",2),b([Y],Pe.prototype,"border",2),b([Y],Pe.prototype,"cornerRadius",2),b([Y],Pe.prototype,"fill",2),b([Y],Pe.prototype,"fillOpacity",2),b([Y],Pe.prototype,"padding",2),b([Y],Pe.prototype,"spacing",2),b([Y],Pe.prototype,"xOffset",2),b([Y],Pe.prototype,"yOffset",2);var zf={type:"plugin",name:"legend",version:fe,options:{enabled:El,position:rW,orientation:hW("horizontal","vertical"),maxWidth:Jt,maxHeight:Jt,spacing:Jt,border:nW,cornerRadius:oW,padding:lW,fill:aW,fillOpacity:cW,preventHidingAll:El,reverseOrder:El,toggleSeries:El,item:{marker:{size:Jt,shape:QM,padding:Jt,strokeWidth:Jt},line:{length:Jt,strokeWidth:Jt},label:{maxLength:Jt,formatter:wf,...JM},maxWidth:Jt,paddingX:Jt,paddingY:Jt,showSeriesStroke:El},pagination:{marker:{size:Jt,shape:QM,padding:Jt},activeStyle:{...Ef,...Rf},inactiveStyle:{...Ef,...Rf},highlightStyle:{...Ef,...Rf},label:JM},listeners:{legendItemClick:wf,legendItemDoubleClick:wf}},themeTemplate:{...sW,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:xi.BOTTOM,orientation:{$if:[{$or:[{$eq:[{$path:"./position"},xi.LEFT]},{$eq:[{$path:"./position"},xi.LEFT_TOP]},{$eq:[{$path:"./position"},xi.LEFT_BOTTOM]},{$eq:[{$path:"./position"},xi.RIGHT]},{$eq:[{$path:"./position"},xi.RIGHT_TOP]},{$eq:[{$path:"./position"},xi.RIGHT_BOTTOM]},{$eq:[{$path:"./position/placement"},xi.LEFT]},{$eq:[{$path:"./position/placement"},xi.LEFT_TOP]},{$eq:[{$path:"./position/placement"},xi.LEFT_BOTTOM]},{$eq:[{$path:"./position/placement"},xi.RIGHT]},{$eq:[{$path:"./position/placement"},xi.RIGHT_TOP]},{$eq:[{$path:"./position/placement"},xi.RIGHT_BOTTOM]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:iW.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:t=>{const e=new Pe(t);return e.attachLegend(t.scene),e}};import{CARTESIAN_AXIS_TYPE as cA,CARTESIAN_POSITION as hA,ChartAxisDirection as dA,DEFAULT_SHADOW_COLOUR as jW,FILL_GRADIENT_LINEAR_DEFAULTS as UW,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as HW,FILL_IMAGE_DEFAULTS as WW,FILL_PATTERN_DEFAULTS as uA,LABEL_BOXING_DEFAULTS as YW,MARKER_SERIES_HIGHLIGHT_STYLE as $W,SEGMENTATION_DEFAULTS as KW}from"ag-charts-core";import{ChartAxisDirection as et,DebugMetrics as ZW,SeriesContentZIndexMap as Gf,SeriesZIndexMap as Rl,extent as XW,isContinuous as qW,isDefined as jf,mergeDefaults as JW}from"ag-charts-core";import{Logger as pA,normalisedExtentWithMetadata as QW}from"ag-charts-core";var eo=class extends mi{getVisibleDomain(t){const[e,i]=t,[s,n]=this.visibleRange;if(t.length<2)return[e,i];const a=Math.min(e,i),r=Math.max(e,i);if(a>=0){const o=Math.log(e),c=Math.log(i)-o;return[Math.exp(o+s*c),Math.exp(o+n*c)]}if(r<=0){const o=-Math.log(-e),c=-Math.log(-i)-o;return[-Math.exp(-(o+s*c)),-Math.exp(-(o+n*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(t){const{min:e,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:r}=QW(t.domain,e,i,s,n,void 0,t.sortMetadata?.sortOrder);return a[0]<0&&a[1]>0||t.domain[0]<0&&t.domain[1]>0?(pA.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):a[0]===0||a[1]===0||t.domain[0]===0||t.domain[1]===0?(pA.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):{domain:a,clipped:r}}set base(t){this.scale.base=t}get base(){return this.scale.base}constructor(t){super(t,new Rg)}};eo.className="LogAxis",eo.type="log";import{AGGREGATION_INDEX_X_MAX as e3,AGGREGATION_INDEX_X_MIN as t3,AGGREGATION_INDEX_Y_MAX as i3,AGGREGATION_INDEX_Y_MIN as s3,AGGREGATION_MIN_RANGE as gA,AGGREGATION_THRESHOLD as fA,aggregationDomain as Uf,aggregationIndexForXRatio as n3,aggregationRangeFittingPoints as mA,aggregationXRatioForDatumIndex as a3,aggregationXRatioForXValue as r3,compactAggregationIndices as o3,createAggregationIndices as yA,nextPowerOf2 as l3,simpleMemorize2 as c3}from"ag-charts-core";var h3=10;function vd(t,e,i,s,n,a,r){const o=t[a];if(o===void 0)return-1;const l=Number.isFinite(e)?r3(o,e,i,r):a3(a,t.length),c=n3(l,n);return a===s[c+t3]||a===s[c+e3]||a===s[c+s3]||a===s[c+i3]?c:-1}function bA(t,e,i,s,n,a,r,o,l){let c=0,h=0,d=-1;for(let y=0;y<r;y++){const m=vd(t,e,i,s,n,y,a);m!==-1&&(c++,m!==d&&(h++,d=m))}h++;const u=o?.length===c?o:new Uint32Array(c),p=l?.length===h?l:new Uint32Array(h);let g=0,f=0;d=-1;for(let y=0;y<r;y++){const m=vd(t,e,i,s,n,y,a);m!==-1&&(m!==d&&(p[f++]=g,d=m),u[g++]=y)}return p[f]=c-1,{indices:u,metaIndices:p}}function Hf(t,e,i,s){const n=e.length;if(n<fA)return;const[a,r]=t,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:c}=s;let h=mA(e,a,r,{xNeedsValueOf:o});const d=c?.find(m=>m.maxRange===h);let{indexData:u,valueData:p}=yA(e,i,i,a,r,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),{indices:g,metaIndices:f}=bA(e,a,r,u,h,o,n,d?.indices,d?.metaIndices);const y=[{maxRange:h,metaIndices:f,indices:g,indexData:u,valueData:p}];for(;g.length>h3&&h>gA;){const m=h,x=Math.trunc(m/2),v=c?.find(O=>O.maxRange===x),S=o3(u,p,m,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=S.maxRange,u=S.indexData,p=S.valueData;const I=g;let M=0,D=0,C=-1;for(const O of I){const E=vd(e,a,r,u,h,O,o);E!==-1&&(M++,E!==C&&(D++,C=E))}D++;const A=v?.indices?.length===M?v.indices:new Uint32Array(M),T=v?.metaIndices?.length===D?v.metaIndices:new Uint32Array(D);let L=0,N=0;C=-1;for(const O of I){const E=vd(e,a,r,u,h,O,o);E!==-1&&(E!==C&&(T[N++]=L,C=E),A[L++]=O)}T[N]=M-1,g=A,f=T,y.push({maxRange:h,metaIndices:f,indices:g,indexData:u,valueData:p})}return y.reverse(),y}function d3(t,e,i,s){const n=e.length;if(n<fA)return;const[a,r]=t,{xNeedsValueOf:o,yNeedsValueOf:l,targetRange:c,existingFilters:h}=s,d=mA(e,a,r,{xNeedsValueOf:o}),u=Math.min(d,l3(Math.max(c,gA))),p=h?.find(S=>S.maxRange===u),{indexData:g,valueData:f}=yA(e,i,i,a,r,u,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),{indices:y,metaIndices:m}=bA(e,a,r,g,u,o,n,p?.indices,p?.metaIndices),x={maxRange:u,indices:y,metaIndices:m,indexData:g,valueData:f};function v(){return Hf([a,r],e,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(I=>I.maxRange!==u)??[]}return{immediate:[x],computeRemaining:v}}function u3(t,e,i,s,n,a){const[r,o]=Uf(t,s);return Hf([r,o],e,i,{xNeedsValueOf:n,yNeedsValueOf:a})}var p3=c3(u3);function g3(t,e,i,s,n,a){const r=e.resolveKeysById(n,"xValue",i),o=e.resolveColumnById(n,s,i),l=e.getDomain(n,"xValue","key",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),h=e.resolveColumnNeedsValueOf(n,s,i);if(a){const[d,u]=Uf(t,l);return Hf([d,u],r,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:a})}return p3(t,r,o,l,c,h)}function f3(t,e,i,s,n,a,r){const o=e.resolveKeysById(n,"xValue",i),l=e.resolveColumnById(n,s,i),c=e.getDomain(n,"xValue","key",i),h=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,s,i),[u,p]=Uf(t,c);return d3([u,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:a,existingFilters:r})}import{InterpolationProperties as m3,Property as _e}from"ag-charts-core";var Ne=class extends $i{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new m3,this.shadow=new bs,this.marker=new Bt,this.label=new ri,this.tooltip=wa(),this.connectMissingData=!1}};b([_e],Ne.prototype,"xKey",2),b([_e],Ne.prototype,"xName",2),b([_e],Ne.prototype,"yKey",2),b([_e],Ne.prototype,"yName",2),b([_e],Ne.prototype,"yFilterKey",2),b([_e],Ne.prototype,"stackGroup",2),b([_e],Ne.prototype,"normalizedTo",2),b([_e],Ne.prototype,"fill",2),b([_e],Ne.prototype,"fillOpacity",2),b([_e],Ne.prototype,"stroke",2),b([_e],Ne.prototype,"strokeWidth",2),b([_e],Ne.prototype,"strokeOpacity",2),b([_e],Ne.prototype,"lineDash",2),b([_e],Ne.prototype,"lineDashOffset",2),b([_e],Ne.prototype,"interpolation",2),b([_e],Ne.prototype,"styler",2),b([_e],Ne.prototype,"shadow",2),b([_e],Ne.prototype,"marker",2),b([_e],Ne.prototype,"label",2),b([_e],Ne.prototype,"tooltip",2),b([_e],Ne.prototype,"connectMissingData",2);var y3=.125,b3=.25,Wf=class extends Sn{constructor(t){super({moduleCtx:t,propertyKeys:Ur,propertyNames:Hr,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:lf({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Oa,datum:(e,i)=>({...id(e),...Cl(e,i)})},clipFocusBox:!1}),this.properties=new Ne,this.connectsToYAxis=!0,this.aggregationManager=new ld,this.backgroundGroup=new z({name:`${this.id}-background`,zIndex:Rl.BACKGROUND}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const t=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||t&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Bg||this.contextNodeData.strokeData.spans.length>Bg)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){t.remove(),e.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(t){const i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(t,i)}setZIndex(t){super.setZIndex(t),this.isStacked()?(this.backgroundGroup.zIndex=[Rl.BACKGROUND,t],this.contentGroup.zIndex=[Rl.ANY_CONTENT,t,Gf.FOREGROUND]):(this.backgroundGroup.zIndex=[Rl.ANY_CONTENT,t,Gf.FOREGROUND,0],this.contentGroup.zIndex=[Rl.ANY_CONTENT,t,Gf.FOREGROUND,1])}async processData(t){if(this.data==null)return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:a,yKey:r,yFilterKey:o,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes[et.X]?.scale,u=this.axes[et.Y]?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:d,yScale:u}),f=n>1||c!=null,y={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},m={invalidValue:null};(jf(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0);const x=this.properties.allowNullKeys??!1,v=[Js(a,p,{id:"xValue",allowNullKey:x}),he(r,g,{id:"yValueRaw",...m}),...o==null?[]:[he(o,g,{id:"yFilterRaw"})]];f&&v.push(...Do(r,"normal",{id:"yValueCumulative",...m,groupId:y.marker},g)),jf(c)&&v.push(he(r,g,{id:"yValue",...m,groupId:y.value}),xc(Object.values(y),c)),h&&v.push(Ao());const{dataModel:S,processedData:I}=await this.requestDataModel(t,e,{props:v,groupByKeys:f,groupByData:!f});this.aggregateData(S,I),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[et.X].scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[et.Y].scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(t){return t.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(t){const{dataModel:e,processedData:i,axes:s}=this;if(!e||!i)return{domain:[]};const n=s[et.Y];if(t===et.X){const r=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","key",i);return r?.def.type==="key"&&r.def.valueType==="category"?o:{domain:Ut(XW(o.domain))}}const a=this.domainForClippedRange(et.Y,[this.yCumulativeKey(i)],"xValue");if(n instanceof mi&&!(n instanceof eo)){const r=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:Ut(r)}}else return{domain:Ut(a)}}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange(et.Y,[this.yCumulativeKey(this.processedData)],"xValue",e);return[Math.min(i,0),Math.max(s,0)]}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),vi(e))return;const i=this.axes[et.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>f3(i.scale.type,t,e,this.yCumulativeKey(e),this,s,a),computeFull:a=>g3(i.scale.type,t,e,this.yCumulativeKey(e),this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ZW.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[et.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(t){const{indices:e,metaIndices:i}=t,{visible:s,axes:n,dataModel:a,processedData:r,seriesBelowStackContext:o}=this,l=n[et.X],c=n[et.Y];if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],o;if(l==null||c==null||a==null||r==null)return;const{scale:h}=l,{scale:d}=c,u=(h.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,g=r.invalidData?.get(this.id),f=a.resolveKeysById(this,"xValue",r),y=a.resolveColumnById(this,this.yCumulativeKey(r),r);let[m,x]=Co(1,i.length-1,l.range,D=>{const C=i[D],A=i[D+1],T=e[C],L=e[A],N=f[T],O=f[L],{0:E}=this.xCoordinateRange(N,0),{1:k}=this.xCoordinateRange(O,0);return[E,k]});m=Math.max(m-1,0),x=Math.min(x+1,i.length-1);let v=[];if(o?.fillSpans)v=o?.fillSpans;else for(let D=m;D<x;D+=1){const C=i[D],A=i[D+1],T=e[C],L=e[A],N=f[T],O=f[L],E={type:"linear",moveTo:!1,x0:h.convert(N)+u,y0:d.convert(0),x1:h.convert(O)+u,y1:d.convert(0)};v.push({span:E,xValue0:N,xValue1:O,yValue0:0,yValue1:0})}this.phantomSpans=v;const S=[],I=[];let M=0;for(let D=m;D<x;D+=1){const C=i[D],A=i[D+1],T=e[C],L=e[A],N=!p&&this.hasInvalidDatumsInRange(g,y,T,L),O=v[M++];if(N){S.push(O),I.push(O);continue}const E=[];for(let q=C;q<=A;q++){const J=e[q];if(g?.[J])continue;const xe=y[J];if(!Number.isFinite(xe))continue;const ti=f[J];E.push({point:{x:h.convert(ti)+u,y:d.convert(xe)},xDatum:ti,yDatum:xe})}if(E.length<2){S.push(O),I.push(O);continue}const k=E[0],P=E.at(-1),F=E.slice(1,-1).map(q=>q.point),j={span:{type:"multi-line",moveTo:!1,x0:k.point.x,y0:k.point.y,x1:P.point.x,y1:P.point.y,midPoints:F},xValue0:k.xDatum,xValue1:P.xDatum,yValue0:k.yDatum,yValue1:P.yDatum};S.push(j),I.push(j)}return this.fillSpans=S,this.strokeSpans=I,{stack:[],fillSpans:S,strokeSpans:I}}hasInvalidDatumsInRange(t,e,i,s){const n=Math.min(i,s),a=Math.max(i,s);for(let r=n;r<=a;r++){if(t?.[r])return!0;const o=e[r];if(!Number.isFinite(o))return!0}return!1}stackYValueData(){const{visible:t,axes:e,dataModel:i,processedData:s,seriesBelowStackContext:n,properties:a}=this,r=e[et.X],o=e[et.Y];if(r==null||o==null||i==null||s==null)return;const{interpolation:l}=a,{scale:c}=r,{scale:h}=o,d=(c.bandwidth??0)/2;let u=i.resolveKeysById(this,"xValue",s),p=i.resolveColumnById(this,this.yValueKey(),s);const g=!this.isStacked()&&this.properties.connectMissingData,f=s.invalidKeys?.get(this.id),m=(g?s.invalidData?.get(this.id):void 0)??f;m!=null&&(u=u.filter((L,N)=>m[N]===!1),p=p.filter((L,N)=>m[N]===!1));let[x,v]=Co(1,u.length,r.range,L=>this.xCoordinateRange(u[L],0));x=Math.max(x-2,0),v=Math.min(v+2,u.length);let S;if(n?.fillSpans)S=n?.fillSpans;else{const L=[];for(let N=x;N<v;N+=1){const O=u[N];L.push({point:{x:c.convert(O)+d,y:h.convert(0)},xDatum:O,yDatum:0})}S=Sl(L,{type:"linear"})}if(this.phantomSpans=S,!t)return this.fillSpans=S,this.strokeSpans=[],n;let I=n?.stack;if(I==null){I=[];for(let L=x;L<v-1;L+=1)I.push({leading:0,trailing:0,dataValid:!0,breakBefore:!1})}const M=I.slice();let D=!1;for(let L=0;L<M.length;L+=1){const N=x+L,O=x+L+1;let{leading:E,trailing:k,breakBefore:P}=I[L];const F=p[N],w=p[O],j=!Number.isFinite(F),q=!Number.isFinite(w),J=!j&&!q;J&&(E+=F,k+=w),L!==0&&J!==D&&(P=!0),D=J,M[L]={leading:E,trailing:k,dataValid:J,breakBefore:P}}const C=[],A=[],T=[];for(let L=0;L<M.length;L+=1){const{leading:N,dataValid:O,breakBefore:E}=M[L],k=x+L;if(E){if(T.length!==0){const P=M[L-1],F={point:{x:c.convert(u[k])+d,y:h.convert(P.trailing)},xDatum:u[k],yDatum:P.trailing};T.push(F);const w=Sl(T,l);C.push(...w),A.push(...w)}T.length=0}if(O){const P={point:{x:c.convert(u[k])+d,y:h.convert(N)},xDatum:u[k],yDatum:N};T.push(P)}else C.push(S[L])}if(T.length!==0){const L=M.at(-1),N=x+M.length,O={point:{x:c.convert(u[N])+d,y:h.convert(L.trailing)},xDatum:u[N],yDatum:L.trailing};T.push(O);const E=Sl(T,l);C.push(...E),A.push(...E),T.length=0}return this.fillSpans=C,this.strokeSpans=A,{stack:M,fillSpans:C,strokeSpans:A}}createStackContext(){const t=this.axes[et.X];if(t==null)return;const{scale:e}=t,[i,s]=e.range,n=Math.abs(s-i);this.aggregationManager.ensureLevelForRange(n);const a=this.aggregationManager.getFilterForRange(n);return a?this.stackAggregatedData(a):this.stackYValueData()}createNodeDatumContext(t,e){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const{xKey:n,xName:a,yFilterKey:r,yKey:o,yName:l,legendItemName:c,marker:h,label:d,fill:u,stroke:p,normalizedTo:g}=this.properties,f=t.scale,y=e.scale,{isContinuousY:m}=this.getScaleInformation({xScale:f,yScale:y}),x=s.type==="grouped",[v,S]=f.range,I=Math.abs(S-v);this.aggregationManager.ensureLevelForRange(I);const M=this.aggregationManager.getFilterForRange(I),D=this.contextNodeData?.nodeData,C=D!=null&&this.canIncrementallyUpdateNodes(M!=null);return{xAxis:t,yAxis:e,rawData:s.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:x?i.resolveColumnById(this,"yValueCumulative",s):i.resolveColumnById(this,"yValueRaw",s),yFilterValues:r==null?void 0:i.resolveColumnById(this,"yFilterRaw",s),invalidData:s.invalidData?.get(this.id),xScale:f,yScale:y,xOffset:(f.bandwidth??0)/2,yOffset:0,indices:M?.indices,isContinuousY:m,labelsEnabled:d.enabled,normalizedTo:g,canIncrementallyUpdate:C,animationEnabled:!this.ctx.animationManager.isSkipped(),xKey:n,yKey:o,xName:a,yName:l,legendItemName:c,markerSize:h.size,markerFill:h.fill??u,markerStroke:h.stroke??p,markerStrokeWidth:h.strokeWidth??this.properties.strokeWidth,yDomain:this.getSeriesDomain(et.Y).domain,nodes:C?D:[],labelData:[],nodeIndex:0,crossFiltering:!1}}computeMarkerCoordinate(t,e){let i;(jf(t.normalizedTo)?t.isContinuousY&&qW(e.yDatum):!Number.isNaN(e.yDatum))&&(i=e.yCumulative),e.x=t.xScale.convert(e.xDatum)+t.xOffset,e.y=t.yScale.convert(i),Number.isFinite(e.x)||(e.validPoint=!1)}handleDatum(t,e,i){if(e.xDatum=t.xValues[i],!(e.xDatum===void 0&&!this.properties.allowNullKeys)){if(e.datum=t.rawData[i],e.yDatum=t.yRawValues[i],e.yCumulative=+t.yCumulativeValues[i],e.validPoint=Number.isFinite(e.yDatum)&&t.invalidData?.[i]!==!0,this.computeMarkerCoordinate(t,e),e.selected=t.yFilterValues==null?void 0:t.yFilterValues[i]===e.yDatum,e.selected===!1&&(t.crossFiltering=!0),e.validPoint){if(t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length){const n=t.nodes[t.nodeIndex];n.datum=e.datum,n.datumIndex=i,n.midPoint={x:e.x,y:e.y},n.cumulativeValue=e.yCumulative,n.yValue=e.yDatum,n.xValue=e.xDatum,n.point={x:e.x,y:e.y,size:t.markerSize},n.selected=e.selected}else t.nodes.push({series:this,datum:e.datum,datumIndex:i,midPoint:{x:e.x,y:e.y},cumulativeValue:e.yCumulative,yValue:e.yDatum,xValue:e.xDatum,yKey:t.yKey,xKey:t.xKey,point:{x:e.x,y:e.y,size:t.markerSize},fill:t.markerFill,stroke:t.markerStroke,strokeWidth:t.markerStrokeWidth,selected:e.selected});t.nodeIndex++}if(t.labelsEnabled&&e.validPoint){const s=this.getLabelText(e.yDatum,e.datum,t.yKey,"y",t.yDomain,this.properties.label,{value:e.yDatum,datum:e.datum,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName});t.labelData.push({series:this,datum:e.datum,datumIndex:i,x:e.x,y:e.y,labelText:s})}}}populateNodeData(t){const e={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0,validPoint:!1};let[i,s]=this.visibleRangeIndices("xValue",t.xAxis.range,t.indices);i=Math.max(i-2,0),s=Math.min(s+2,t.indices?.length??t.xValues.length),this.processedData.input.count<1e3&&(i=0,s=this.processedData.input.count);for(let n=i;n<s;n+=1){const a=t.indices?.[n]??n;this.handleDatum(t,e,a)}}initializeResult(t){const{visibleSameStackCount:e}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return{itemId:t.yKey,fillData:{spans:this.fillSpans,phantomSpans:this.phantomSpans},strokeData:{spans:this.strokeSpans},labelData:t.labelData,nodeData:t.nodes,scales:this.calculateScaling(),visible:this.visible,stackVisible:e>0,crossFiltering:t.crossFiltering,styles:ad(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(t,e){return e.segments=jh(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene,!1),e}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e,i],visible:s,animationEnabled:n}=t,a=this.contextNodeData?.crossFiltering===!0,r=this.contextNodeData?.segments,o=JW(this.getHighlightStyle(),this.getStyle()),{strokeWidth:l,stroke:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,fill:p,fillOpacity:g,opacity:f}=o;i.setProperties({segments:r,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:c,strokeWidth:l,strokeOpacity:h*(a?b3:1),lineDash:d,lineDashOffset:u,opacity:f,visible:s||n}),i.datum=r,e.setStyleProperties({fill:p,stroke:void 0,fillOpacity:g*(a?y3:1)},this.getShapeFillBBox()),e.setProperties({segments:r,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:f,visible:s||n}),e.datum=r,rd(this,i),rd(this,e)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(t,e){const[i]=t;i.path.clear(),QD(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),Xg(s,i),s.markDirty("AreaSeries")}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,{contextNodeData:s,processedData:n,axes:a,properties:r}=this,{marker:o,styler:l}=r,c=l?this.getStyle().marker:void 0,h=s?.crossFiltering===!0||af(n.input.count,a[et.X].scale,o,c);o.isDirty()&&(i.clear(),i.cleanup());const d=h?e:[];return vi(this.processedData)?i.update(d,void 0,u=>ft(u.xValue)):i.update(d)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();e.each((a,r)=>{if(!e.isGarbage(a)){const o=this.getHighlightState(n,t.isHighlight,r.datumIndex),l=this.getStyle(o),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,r.datumIndex,l.marker);r.style=this.getMarkerStyle(s,r,u,{isHighlight:i,highlightState:o},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:s}=t,n=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(s,t.drawingMode);i.each((o,l)=>{const c=this.getHighlightState(a,s,l.datumIndex),h=l.style??e.styles[c];this.applyMarkerStyle(h,o,l.point,n,{selected:l.selected}),o.drawingMode=this.resolveMarkerDrawingModeForState(r,h)}),s||this.properties.marker.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();t.labelSelection.each((n,a)=>{const r=ka(this,a,s,this.properties.label,e,i),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=r;o&&a?.labelText?(n.fontStyle=l,n.fontWeight=c,n.fontSize=h,n.fontFamily=d,n.textAlign="center",n.textBaseline="bottom",n.text=a.labelText,n.x=a.x,n.y=a.y-10,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,n.setBoxing(r)):n.visible=!1})}makeStylerParams(t){const{id:e}=this,{marker:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}=this.properties,u=nr(t??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:u,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,seriesId:e,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}}makeItemStylerParams(t,e,i,s){const{xKey:n,yKey:a}=this.properties,r=t.resolveKeysById(this,"xValue",e)[i],o=t.resolveColumnById(this,"yValueRaw",e)[i],l=t.getDomain(this,"xValue","key",e).domain,c=t.getDomain(this,this.yCumulativeKey(e),"value",e).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...Hu(r,o,n,a,l,c),xValue:r,yValue:o,...s,fill:h}}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:r,xName:o,yKey:l,yName:c,tooltip:h,legendItemName:d}=a,u=a.allowNullKeys??!1,p=n[et.X],g=n[et.Y];if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.data?.[t],y=i.resolveKeysById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yValueRaw",s)[t];if(y===void 0&&!u)return;const x=this.getStyle(),v=this.makeItemStylerParams(i,s,t,x.marker),S=this.getMarkerStyle(this.properties.marker,{datumIndex:t,datum:f},v,{isHighlight:!1},x.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",y,f,r,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",m,f,l,d),missing:aa(m)}]},{seriesId:e,datum:f,title:c,xKey:r,xName:o,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,marker:r}=this.getStyle(),o=!r.enabled||r.fill==null,l=o?t:r.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:r.size,shape:r.shape,fill:l,fillOpacity:o?i:r.fillOpacity,stroke:r.stroke}),enabled:r.enabled||n<=0},line:{enabled:!0,stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,legendItemName:r,showInLegend:o}=this.properties;return[{legendType:t,id:e,itemId:n,legendItemName:r,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??a??n},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(t){sd([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),rf(this,a,...n),at([e],Cl),nf(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},e),Te(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:r}=t,[o,l]=a;if(n.visible===!1&&r?.visible===!1||o==null&&l==null)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||r==null){c(),Al(this,e,"added",this.getAnimationDrawingModes(),i),of(this,"fill_path_properties",e,"add",o),of(this,"stroke_path_properties",e,"add",l),Te(this,"labels",e,s);return}if(n.crossFiltering!==r.crossFiltering){h();return}const d=SH(n,r);if(d===void 0){h();return}else if(d.status==="no-op")return;Al(this,e,void 0,this.getAnimationDrawingModes(),i),Oe(this.id,"fill_path_properties",e,[o],d.fill.pathProperties),cd(this.id,"fill_path_update",e,[o],d.fill.path),Oe(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),cd(this.id,"stroke_path_update",e,[l],d.stroke.path),Te(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new je}getStyle(t){const{styler:e,marker:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stroke:o,strokeOpacity:l,strokeWidth:c}=this.properties,{size:h,shape:d,fill:u="transparent",fillOpacity:p}=i;let g={};if(e){const f=this.makeStylerParams(t),y=this.cachedCallWithContext(e,f)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],y,{pick:!1})??{}}return g.marker??(g.marker={}),{fill:g.fill??s,fillOpacity:g.fillOpacity??n,lineDash:g.lineDash??a,lineDashOffset:g.lineDashOffset??r,stroke:g.stroke??o,strokeOpacity:g.strokeOpacity??l,strokeWidth:g.strokeWidth??c,marker:{enabled:g.marker.enabled??i.enabled,fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??d,size:g.marker.size??h,lineDash:g.marker.lineDash??i.lineDash??a,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??r,stroke:g.marker.stroke??i.stroke??o,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:g.marker.strokeWidth??i.strokeWidth??c}}}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,t.datumIndex,e.marker);return this.getMarkerStyle(this.properties.marker,t,i,{isHighlight:!0},void 0,e)}isPointInArea(t,e){let i;for(const s of this.backgroundGroup.children())if(s instanceof Be){i=s;break}return i?.getBBox().containsPoint(t,e)?i.isPointInPath(t,e):!1}computeFocusBounds(t){return nd(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Wf.className="AreaSeries",Wf.type="area";var x3={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",UW],["image",WW],["pattern",uA]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:jW,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",HW],["pattern",uA]]},stroke:{$palette:"stroke"}},label:{...YW,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:$W,segmentation:KW}},xA={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:fe,dependencies:[bi],options:ig,predictAxis:pl,defaultAxes:{y:{type:cA.NUMBER,position:hA.LEFT},x:{type:cA.CATEGORY,position:hA.BOTTOM}},axisKeys:{[dA.X]:"xKeyAxis",[dA.Y]:"yKeyAxis"},themeTemplate:x3,create:t=>new Wf(t)};import{ChartAxisDirection as Sd,DEFAULT_SHADOW_COLOUR as v3,DIRECTION_SWAP_AXES as S3,FILL_GRADIENT_LINEAR_DEFAULTS as I3,FILL_IMAGE_DEFAULTS as D3,FILL_PATTERN_DEFAULTS as M3,LABEL_BOXING_DEFAULTS as A3,MULTI_SERIES_HIGHLIGHT_STYLE as C3,SEGMENTATION_DEFAULTS as T3}from"ag-charts-core";import{AGGREGATION_INDEX_UNSET as L3,AGGREGATION_INDEX_X_MAX as N3,AGGREGATION_INDEX_X_MIN as k3,AGGREGATION_INDEX_Y_MAX as vA,AGGREGATION_INDEX_Y_MIN as SA,AGGREGATION_SPAN as O3,ChartAxisDirection as On,DebugMetrics as w3,areScalingEqual as E3,isFiniteNumber as R3,mergeDefaults as Yf}from"ag-charts-core";import{DeclaredSceneChangeDetection as IA}from"ag-charts-core";var P3=.001,$f=class extends ze{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(t,e,i,s,n,a,r,o,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(t,e,i,s,n,a,r,o)}get feathered(){return Math.abs(this.featherRatio)>P3}isPointInPath(t,e){return this.feathered?this.getBBox().containsPoint(t,e):super.isPointInPath(t,e)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:t,borderPath:e,__direction:i,__featherRatio:s,__x:n,__y:a,__width:r,__height:o}=this;if(t.clear(),e.clear(),i==="x"){const l=Math.abs(s)*r;s>0?(t.moveTo(n,a),t.lineTo(n+r-l,a),t.lineTo(n+r,a+o/2),t.lineTo(n+r-l,a+o),t.lineTo(n,a+o),t.closePath()):(t.moveTo(n+l,a),t.lineTo(n+r,a),t.lineTo(n+r,a+o),t.lineTo(n+l,a+o),t.lineTo(n,a+o/2),t.closePath())}else{const l=Math.abs(s)*o;s>0?(t.moveTo(n,a+l),t.lineTo(n+r/2,a),t.lineTo(n+r,a+l),t.lineTo(n+r,a+o),t.lineTo(n,a+o),t.closePath()):(t.moveTo(n,a),t.lineTo(n+r,a),t.lineTo(n+r,a+o-l),t.lineTo(n+r/2,a+o),t.lineTo(n,a+o-l),t.closePath())}}renderStroke(t){if(!this.feathered){super.renderStroke(t);return}const{__stroke:e,__strokeWidth:i,__lineDash:s,__lineDashOffset:n,__lineCap:a,__lineJoin:r,path:o}=this;if(e&&i){const{globalAlpha:l}=t;this.applyStrokeAndAlpha(t),t.lineWidth=i,s&&t.setLineDash(s),n&&(t.lineDashOffset=n),a&&(t.lineCap=a),r&&(t.lineJoin=r),t.stroke(o.getPath2D()),t.globalAlpha=l}}};b([IA()],$f.prototype,"direction",2),b([IA()],$f.prototype,"featherRatio",2);import{AGGREGATION_MIN_RANGE as _3,AGGREGATION_THRESHOLD as DA,aggregationDomain as Kf,aggregationRangeFittingPoints as MA,compactAggregationIndices as AA,createAggregationIndices as CA,getMidpointsForIndices as to,nextPowerOf2 as F3,simpleMemorize2 as V3}from"ag-charts-core";function Zf(t,e,i,s,n){if(e.length<DA)return;const[a,r]=t,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=n;let d=MA(e,a,r,{smallestKeyInterval:o,xNeedsValueOf:l});const u=h?.find(S=>S.maxRange===d);let{indexData:p,valueData:g,negativeIndexData:f,negativeValueData:y}=CA(e,s,i??s,a,r,d,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:u?.positiveIndexData,reuseValueData:u?.positiveValueData,reuseNegativeIndexData:u?.negativeIndexData,reuseNegativeValueData:u?.negativeValueData});if(!f||!y)throw new Error("Negative aggregation data missing in split mode");let m=to(d,p,u?.positiveIndices),x=to(d,f,u?.negativeIndices);const v=[{maxRange:d,positiveIndices:m,positiveIndexData:p,positiveValueData:g,negativeIndices:x,negativeIndexData:f,negativeValueData:y}];for(;d>64;){const S=d,I=Math.trunc(S/2),M=h?.find(A=>A.maxRange===I),D=AA(p,g,S,{reuseIndexData:M?.positiveIndexData,reuseValueData:M?.positiveValueData}),C=AA(f,y,S,{reuseIndexData:M?.negativeIndexData,reuseValueData:M?.negativeValueData});d=D.maxRange,p=D.indexData,g=D.valueData,m=D.midpointData??to(d,p,M?.positiveIndices),f=C.indexData,y=C.valueData,x=C.midpointData??to(d,f,M?.negativeIndices),v.push({maxRange:d,positiveIndices:m,positiveIndexData:p,positiveValueData:g,negativeIndices:x,negativeIndexData:f,negativeValueData:y})}return v.reverse(),v}function B3(t,e,i,s,n){if(e.length<DA)return;const[a,r]=t,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,targetRange:h,existingFilters:d}=n,u=MA(e,a,r,{smallestKeyInterval:o,xNeedsValueOf:l}),p=Math.min(u,F3(Math.max(h,_3))),g=d?.find(I=>I.maxRange===p),{indexData:f,valueData:y,negativeIndexData:m,negativeValueData:x}=CA(e,s,i??s,a,r,p,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:g?.positiveIndexData,reuseValueData:g?.positiveValueData,reuseNegativeIndexData:g?.negativeIndexData,reuseNegativeValueData:g?.negativeValueData});if(!m||!x)throw new Error("Negative aggregation data missing in split mode");const v={maxRange:p,positiveIndices:to(p,f,g?.positiveIndices),positiveIndexData:f,positiveValueData:y,negativeIndices:to(p,m,g?.negativeIndices),negativeIndexData:m,negativeValueData:x};function S(){return Zf([a,r],e,i,s,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:d})?.filter(M=>M.maxRange!==p)??[]}return{immediate:[v],computeRemaining:S}}function z3(t,e,i,s,n,a,r,o){const[l,c]=Kf(t,n);return Zf([l,c],e,i,s,{smallestKeyInterval:a,xNeedsValueOf:r,yNeedsValueOf:o})}var G3=V3(z3);function j3(t,e,i,s,n){const a=e.resolveKeysById(s,"xValue",i),r=e.hasColumnById(s,"yValue-start"),o=r?e.resolveColumnById(s,"yValue-start",i):void 0,l=r?e.resolveColumnById(s,"yValue-end",i):e.resolveColumnById(s,"yValue-raw",i),c=e.getDomain(s,"xValue","key",i),h=e.resolveColumnNeedsValueOf(s,"xValue",i),d=e.resolveColumnNeedsValueOf(s,r?"yValue-end":"yValue-raw",i);if(n){const[u,p]=Kf(t,c);return Zf([u,p],a,o,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:n})}return G3(t,a,o,l,c,i.reduced?.smallestKeyInterval,h,d)}function U3(t,e,i,s,n,a){const r=e.resolveKeysById(s,"xValue",i),o=e.hasColumnById(s,"yValue-start"),l=o?e.resolveColumnById(s,"yValue-start",i):void 0,c=o?e.resolveColumnById(s,"yValue-end",i):e.resolveColumnById(s,"yValue-raw",i),h=e.getDomain(s,"xValue","key",i),d=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,o?"yValue-end":"yValue-raw",i),[p,g]=Kf(t,h);return B3([p,g],r,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:d,yNeedsValueOf:u,targetRange:n,existingFilters:a})}import{Property as be}from"ag-charts-core";var Xf=class extends ri{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};b([be],Xf.prototype,"placement",2),b([be],Xf.prototype,"spacing",2);var Ie=class extends bl{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new bs,this.label=new Xf,this.tooltip=wa(),this.sparklineMode=!1}};b([be],Ie.prototype,"xKey",2),b([be],Ie.prototype,"xName",2),b([be],Ie.prototype,"yKey",2),b([be],Ie.prototype,"yName",2),b([be],Ie.prototype,"yFilterKey",2),b([be],Ie.prototype,"stackGroup",2),b([be],Ie.prototype,"normalizedTo",2),b([be],Ie.prototype,"fill",2),b([be],Ie.prototype,"fillOpacity",2),b([be],Ie.prototype,"stroke",2),b([be],Ie.prototype,"strokeWidth",2),b([be],Ie.prototype,"strokeOpacity",2),b([be],Ie.prototype,"lineDash",2),b([be],Ie.prototype,"lineDashOffset",2),b([be],Ie.prototype,"cornerRadius",2),b([be],Ie.prototype,"crisp",2),b([be],Ie.prototype,"styler",2),b([be],Ie.prototype,"itemStyler",2),b([be],Ie.prototype,"simpleItemStyler",2),b([be],Ie.prototype,"shadow",2),b([be],Ie.prototype,"label",2),b([be],Ie.prototype,"tooltip",2),b([be],Ie.prototype,"sparklineMode",2);var qf=class extends AD{constructor(t){super({moduleCtx:t,propertyKeys:Ur,propertyNames:Hr,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Ml,label:Oa}}),this.properties=new Ie,this.connectsToYAxis=!0,this.aggregationManager=new ld,this.phantomGroup=this.contentGroup.appendChild(new z({name:"phantom",zIndex:-1})),this.phantomSelection=we.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new z({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=we.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(t){if(!this.data)return;const{xKey:e,yKey:i,yFilterKey:s,normalizedTo:n}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:r}=this,l=(this.seriesGrouping?.stackCount??0)>1||n!=null,c=l,h=!this.ctx.animationManager.isSkipped(),d=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),y=`bar-stack-${a}-yValues`,m=`${y}-trailing`,x=this.visible?{}:{forceValue:0},v=this.properties.allowNullKeys??!1,S=[Js(e,g,{id:"xValue",allowNullKey:v}),he(i,f,{id:"yValue-raw",invalidValue:null,...x})];this.crossFilteringEnabled()&&S.push(he(s,f,{id:"yFilterValue",invalidValue:null,...x})),l&&S.push(...Do(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0,...x},f),...Do(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:m,separateNegative:!0,...x},f)),p&&S.push(Bb,zb),R3(n)&&S.push(xc([y,m],Math.abs(n))),this.needsDataModelDiff()&&this.processedData&&S.push(Sc(this.id,this.processedData)),(h||!c)&&S.push(Ao());const{dataModel:I,processedData:M}=await this.requestDataModel(t,r,{props:S,groupByKeys:c,groupByData:!c});this.aggregateData(I,M),this.smallestDataInterval=M.reduced?.smallestKeyInterval,this.largestDataInterval=M.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(t){return t.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return{domain:[]};if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","key",e);return o?.def.type==="key"&&o.def.valueType==="category"?l:{domain:this.padBandExtent(l.domain)}}const s=this.yCumulativeKey(i);let n=this.domainForClippedRange(t,[s],"xValue");const a=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e).domain:void 0;a!=null&&(n=[Math.min(n[0],a[0]),Math.max(n[1],a[1])]);const r=this.getValueAxis();if(r instanceof mi&&!(r instanceof eo)){const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return{domain:Ut(o)}}else return{domain:Ut(n)}}getSeriesRange(t,e){if((this.properties.direction==="horizontal"?On.X:On.Y)!==t)return[];const s=this.yCumulativeKey(this.dataModel),[n,a]=this.domainForVisibleRange(On.Y,[s],"xValue",e);return[Math.min(n,0),Math.max(a,0)]}getZoomRangeFittingItems(t,e,i){const s=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[s],t,e,i)}getVisibleItems(t,e,i){const s=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),vi(e))return;const i=this.axes[On.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>U3(i.scale.type,t,e,this,s,a),computeFull:a=>j3(i.scale.type,t,e,this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&w3.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[On.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources?.get(this.id);if(n==null)return;const a=t.scale,r=e.scale,o=Math.abs(a.range[1]-a.range[0]);this.aggregationManager.ensureLevelForRange(o);const l=this.aggregationManager.getFilterForRange(o),c=i.hasColumnById(this,"yValue-start"),{label:h}=this.properties,d=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:u,barOffset:p,barWidth:g}=this.getBarDimensions();return{dataSource:n,rawData:n.data,xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValue-raw",s),yFilterValues:this.crossFilteringEnabled()?i.resolveColumnById(this,"yFilterValue",s):void 0,yStartValues:c?i.resolveColumnById(this,"yValue-start",s):void 0,yEndValues:c?i.resolveColumnById(this,"yValue-end",s):void 0,xScale:a,yScale:r,xAxis:t,yAxis:e,groupOffset:u,barOffset:p,barWidth:g,range:o,yReversed:e.isReversed(),bboxBottom:r.convert(0),labelSpacing:h.spacing+(typeof h.padding=="number"?h.padding:0),crisp:l==null&&(this.properties.crisp??XD(t?.scale,t?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:d,phantomNodes:d?this.contextNodeData.phantomNodeData??[]:[],nodes:d?this.contextNodeData.nodeData:[],labels:d?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()===On.X,shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:h,yDomain:this.getSeriesDomain(On.Y).domain}}computeXPosition(t,e){const i=t.xScale.convert(t.xValues[e]);return Number.isFinite(i)?i+t.groupOffset+t.barOffset:Number.NaN}prepareNodeDatumState(t,e,i,s,n){if(!Number.isFinite(n))return;const a=t.xValues[i];if(a===void 0&&!this.properties.allowNullKeys)return;const r=t.dataSource?.data[i],o=t.yRawValues[i],l=t.yFilterValues==null?void 0:Number(t.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=t.label.enabled&&o!=null?this.getLabelText(l??o,r,t.yKey,"y",t.yDomain,t.label,{datum:r,value:l??o,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0,h=o>=0&&!Object.is(o,-0);return e.datum=r,e.xValue=a,e.yRawValue=o,e.yFilterValue=l,e.labelText=c,e.inset=l!=null&&l>o,e.isPositive=h,e.precomputedBottomY=l==null?void 0:t.yScale.convert(s),e.precomputedIsUpward=l==null?void 0:h!==t.yReversed,e}createSkeletonNodeDatum(t,e,i){const s=e.nodeDatumScratch;return{series:this,datum:s.datum,datumIndex:e.datumIndex,cumulativeValue:0,phantom:i,xValue:s.xValue??"",yValue:0,yKey:t.yKey,xKey:t.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:e.opacity,featherRatio:e.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:t.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(t,e){const i=this.prepareNodeDatumState(t,e.nodeDatumScratch,e.datumIndex,e.yStart,e.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const s=this.createSkeletonNodeDatum(t,e,!1);this.updateNodeDatum(t,s,e,i);let n;return i.yFilterValue!=null&&(n=this.createSkeletonNodeDatum(t,e,!0),this.updateNodeDatum(t,n,e)),{nodeData:s,phantomNodeData:n}}updateNodeDatum(t,e,i,s){if(s??(s=this.prepareNodeDatumState(t,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!s)return;const n=e,a=e.phantom,r=i.yStart,o=a?s.yFilterValue:s.yFilterValue??s.yRawValue,l=a?s.yFilterValue:s.yFilterValue??i.yEnd,c=a?void 0:s.labelText;let h;a||s.yFilterValue==null?h=i.yEnd:h=i.yStart+s.yFilterValue;let d;a?d=i.yRange:d=Math.max(i.yStart+(s.yFilterValue??-1/0),i.yRange);let u;a?u=void 0:s.inset?u=.6:u=void 0;const p=s.precomputedIsUpward??s.isPositive!==t.yReversed,g=t.yScale.convert(h),f=s.precomputedBottomY??t.yScale.convert(r),y=t.yScale.convert(d),m=i.width*.5*(1-(u??1)),x=t.barAlongX?Math.min(g,f):i.x+m,v=t.barAlongX?i.x+m:Math.min(g,f),S=t.barAlongX?Math.abs(f-g):i.width*(u??1),I=t.barAlongX?i.width*(u??1):Math.abs(f-g),M=t.barAlongX?Math.min(t.bboxBottom,y):i.x+m,D=t.barAlongX?i.x+m:Math.min(t.bboxBottom,y),C=t.barAlongX?Math.abs(t.bboxBottom-y):i.width*(u??1),A=t.barAlongX?i.width*(u??1):Math.abs(t.bboxBottom-y);n.datum=s.datum,n.datumIndex=i.datumIndex,n.cumulativeValue=l,n.xValue=s.xValue,n.yValue=o,n.x=M,n.y=D,n.width=C,n.height=A;const T=n.midPoint;T.x=x+S/2,T.y=v+I/2;const L=t.shouldFlipXY?I:S;n.capDefaults.lengthRatioMultiplier=L,n.capDefaults.lengthMax=L,n.opacity=i.opacity,n.featherRatio=i.featherRatio,n.topLeftCornerRadius=t.barAlongX!==p,n.topRightCornerRadius=p,n.bottomRightCornerRadius=t.barAlongX===p,n.bottomLeftCornerRadius=!p;const N=n.clipBBox;if(N?(N.x=x,N.y=v,N.width=S,N.height=I):n.clipBBox=new R(x,v,S,I),n.crisp=t.crisp,c==null)n.label=void 0;else{const O=uD({isUpward:p,isVertical:!t.barAlongX,placement:t.label.placement,spacing:t.labelSpacing,rect:{x,y:v,width:S,height:I}}),E=n.label;E?(E.text=c,E.x=O.x,E.y=O.y,E.textAlign=O.textAlign,E.textBaseline=O.textBaseline):n.label={text:c,...O}}n.missing=aa(o)}createNodeDataWithAggregation(t,e,i){const s=t.yReversed?-1:1;for(let n=0;n<2;n+=1){const a=n===0,r=a?t.dataAggregationFilter.positiveIndices:t.dataAggregationFilter.negativeIndices,o=a?t.dataAggregationFilter.positiveIndexData:t.dataAggregationFilter.negativeIndexData,l=a?SA:vA,c=a?vA:SA,h=this.visibleRangeIndices("xValue",t.xAxis.range,r),d=h[0],u=h[1];for(let p=d;p<u;p+=1){const g=p*O3,f=o[g+k3],y=o[g+N3],m=o[g+l],x=o[g+c];if(f===L3||t.xValues[x]==null||t.xValues[m]==null)continue;const v=e(Math.trunc((f+y)/2)),S=Math.abs(e(y)-e(f))+t.barWidth;if(v-S<0||v>t.range)continue;const I=Math.abs(y-f)+1,M=Ei.is(t.xScale)?Math.min(t.xScale.bandwidth*Math.max(I-1,1)/(t.xScale.step*I),1):1;if(i.datumIndex=x,i.x=v,i.width=S,i.opacity=M,t.isStacked)i.yStart=Number(t.yStartValues[m]),i.yEnd=Number(t.yEndValues[x]),i.featherRatio=0;else{const D=Number(t.yRawValues[x]),C=Number(t.yRawValues[m]);i.yStart=0,i.yEnd=D,i.featherRatio=(a?1:-1)*s*(1-C/D)}i.yRange=i.yEnd,this.upsertNodeDatum(t,i)}}}createNodeDataGrouped(t,e,i){const s=this.processedData,n=s.invalidData?.get(this.id),a=t.barWidth,r=t.isStacked?this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):-1,o=s.columnScopes.findIndex(u=>u.has(this.id)),l=s.groups,c=Co(1,l.length,t.xAxis.range,u=>{const g=l[u].keys[0];return this.xCoordinateRange(g)}),h=c[0],d=c[1];for(let u=h;u<d;u+=1){const p=l[u],g=p.aggregation,f=p.datumIndices[o];if(f!=null)for(const y of f){const m=u+y,x=e(m);if(n?.[m]===!0)continue;const v=t.yRawValues[m];if(v==null)continue;const S=v>=0&&!Object.is(v,-0),I=t.isStacked?Number(t.yStartValues?.[m]):0,M=t.isStacked?Number(t.yEndValues?.[m]):v;let D=M;t.isStacked&&(D=g[r][S?1:0]),i.datumIndex=m,i.x=x,i.width=a,i.yStart=I,i.yEnd=M,i.yRange=D,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}}createNodeDataSimple(t,e,i){const s=this.processedData.invalidData?.get(this.id),n=t.barWidth,a=this.visibleRangeIndices("xValue",t.xAxis.range);let r=a[0],o=a[1];this.processedData.input.count<1e3&&(r=0,o=this.processedData.input.count);for(let l=r;l<o;l+=1){if(s?.[l]===!0)continue;const c=t.yRawValues[l];if(c==null)continue;const h=e(l),d=Number(c);i.datumIndex=l,i.x=h,i.width=n,i.yStart=0,i.yEnd=d,i.yRange=d,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}upsertNodeDatum(t,e){const i=t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length,s=t.yFilterValues!=null,n=s&&t.canIncrementallyUpdate&&t.phantomIndex<t.phantomNodes.length;let a,r;if(i)a=t.nodes[t.nodeIndex],this.updateNodeDatum(t,a,e),t.nodeIndex>=t.labels.length&&t.labels.push(a);else{const o=this.createNodeDatum(t,e);o.nodeData&&(t.nodes.push(o.nodeData),t.labels.push(o.nodeData)),r=o.phantomNodeData}if(t.nodeIndex++,!s)return{nodeData:t.nodes[t.nodeIndex]};if(n)r=t.phantomNodes[t.phantomIndex],this.updateNodeDatum(t,r,e);else if(r)t.phantomNodes.push(r);else{const o=this.createNodeDatum(t,e);o.phantomNodeData&&t.phantomNodes.push(o.phantomNodeData)}return t.phantomIndex++,{nodeData:a,phantomNodeData:r}}populateNodeData(t){const e=s=>this.computeXPosition(t,s),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};t.dataAggregationFilter!=null?this.createNodeDataWithAggregation(t,e,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(t,e,i):this.createNodeDataSimple(t,e,i)}initializeResult(t){return{itemId:this.properties.yKey,nodeData:t.nodes,phantomNodeData:t.phantomNodes,labelData:t.labels,scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:Yu(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(t){t.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(t.nodes,t.nodeIndex),this.trimIncrementalNodeArray(t.phantomNodes,t.phantomIndex),this.trimIncrementalNodeArray(t.labels,t.nodes.length))}assembleResult(t,e){return e.segments=jh(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene),e}nodeFactory(){return new $f}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(t){const e=super.updateHighlightSelectionItem(t),i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:n?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],n)??[]:[],datumSelection:this.phantomHighlightSelection}),e}updateNodes(t,e){super.updateNodes(t,e),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(t,e){const i=t.find(s=>s.datum===e.datum);return i==null?void 0:[{...i}]}updateDatumSelection(t){return vi(this.processedData)?t.datumSelection.update(t.nodeData,void 0,this.getDatumId.bind(this)):t.datumSelection.update(t.nodeData)}makeStylerParams(t){const{id:e}=this,{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stackGroup:o,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}=this.properties,p=nr(t??0);return{cornerRadius:i,fill:s,fillOpacity:n,highlightState:p,lineDash:a,lineDashOffset:r,seriesId:e,stackGroup:o,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}}makeItemStylerParams(t,e,i,s,n,a){const{id:r}=this,{xKey:o,yKey:l,stackGroup:c}=this.properties,h=e.dataSources.get(r)?.data?.[i],d=t.resolveColumnById(this,"yValue-raw",e)[i],u=t.getDomain(this,"xValue","key",e).domain,p=t.getDomain(this,this.yCumulativeKey(t),"value",e).domain,g=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(g,n,i),y=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:r,...Hu(s,d,o,l,u,p),datum:h,xValue:s,yValue:d,stackGroup:c,highlightState:f,...a,fill:y}}getStyle(t,e){const{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stroke:o,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!t&&h){const u=this.makeStylerParams(e);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,u)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??s,fillOpacity:d.fillOpacity??n,lineDash:d.lineDash??a,lineDashOffset:d.lineDashOffset??r,opacity:1,stroke:d.stroke??o,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}getItemStyle(t,e,i){const{properties:s,dataModel:n,processedData:a}=this,{itemStyler:r,simpleItemStyler:o}=s,l=this.getHighlightStyle(e,t,i);if(o&&a!=null&&t!=null){const h=a.dataSources.get(this.id)?.data?.[t],d=o(h);return Yf(d,l,this.getStyle(!1,i))}let c=Yf(l,this.getStyle(t===void 0,i));if(r&&n!=null&&a!=null&&t!=null){const h=n.resolveKeysById(this,"xValue",a)[t],d=this.cachedDatumCallback(ft(this.getDatumId({xValue:h,phantom:!1}),e?"highlight":"node"),()=>{const u=this.makeItemStylerParams(n,a,t,h,e,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,u))});d&&(c=Yf(d,c))}return c}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight(),i=this;function s(n,a){if(!t.datumSelection.isGarbage(n)){const r=i.getHighlightState(e,t.isHighlight,a.datumIndex);a.style=i.getItemStyle(a.datumIndex,t.isHighlight,r)}}t.datumSelection.each(s)}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getCategoryDirection()===On.X,a=this.getShapeFillBBox(),r=this.getBarDirection(),{drawingMode:o,isHighlight:l}=t,c=this,h=e.styles;function d(u,p){const g=p.style??h[c.getHighlightState(i,l,p.datumIndex)];u.setStyleProperties(g,a);const f=g.cornerRadius??0,y=n?(p.clipBBox?.width??p.width)>0:(p.clipBBox?.height??p.height)>0;u.setStaticProperties(o,p.topLeftCornerRadius?f:0,p.topRightCornerRadius?f:0,p.bottomRightCornerRadius?f:0,p.bottomLeftCornerRadius?f:0,y,p.crisp,s,r,p.featherRatio)}t.datumSelection.each(d)}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey},s=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((n,a)=>{n.fillOpacity=this.getHighlightStyle(e,a?.datumIndex).opacity??1,dD(this,n,i,this.properties.label,a.label,e,s)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:r,yKey:o,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=n.allowNullKeys??!1,p=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.data?.[t],y=i.resolveKeysById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yValue-raw",s)[t];if(y===void 0&&!u)return;const x=this.getItemStyle(t,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",y,f,a,c,u),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:o,value:this.getAxisValueText(g,"tooltip",m,f,o,c),missing:aa(m)}]},{seriesId:e,datum:f,title:l,xKey:a,xName:r,yKey:o,yName:l,legendItemName:c,stackGroup:h,...x,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=this.getStyle(!1,0);return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:a,yName:r,legendItemName:o}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:a}),label:{text:o??r??a},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!e}]}resetDatumAnimation(t){td([t.datumSelection,this.phantomSelection])}animateReadyHighlight(t){td([t,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const{phantomSelection:s}=this,n=Dl(Il(this.isVertical(),this.axes,"normal"),"unknown");Oe(this.id,"nodes",this.ctx.animationManager,[t,s],n),Te(this,"labels",this.ctx.animationManager,e),Te(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{phantomSelection:e}=this,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:a,previousContextData:r}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=tM(this.id,i,this.getDatumId.bind(this),t.contextData,r,this.processedData,this.processedDataUpdated),l=r==null?"fade":"normal",c=Dl(Il(this.isVertical(),this.axes,l),"added");Oe(this.id,"nodes",this.ctx.animationManager,[i,e],c,(h,d)=>this.getDatumId(d),o),(!o||o?.changed||!E3(a.groupScale,r?.groupScale))&&(Te(this,"labels",this.ctx.animationManager,s),Te(this,"annotations",this.ctx.animationManager,...n))}getDatumId(t){return ft(t.xValue,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return Qg(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};qf.className="BarSeries",qf.type="bar";var H3={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",I3],["image",D3],["pattern",M3]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...A3,padding:{$isUserOption:["./spacing",0,8]},enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:v3,xOffset:3,yOffset:3,blur:5},highlight:C3,segmentation:T3}},TA={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:fe,dependencies:[bi],options:Lr,predictAxis:pl,defaultAxes:S3,axisKeys:{[Sd.X]:"xKeyAxis",[Sd.Y]:"yKeyAxis"},axisKeysFlipped:{[Sd.X]:"yKeyAxis",[Sd.Y]:"xKeyAxis"},themeTemplate:H3,create:t=>new qf(t)};import{CARTESIAN_AXIS_TYPE as LA,CARTESIAN_POSITION as NA,ChartAxisDirection as kA,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as W3,FILL_IMAGE_DEFAULTS as Y3,FILL_PATTERN_DEFAULTS as $3,LABEL_BOXING_DEFAULTS as K3,MULTI_SERIES_HIGHLIGHT_STYLE as Z3}from"ag-charts-core";import{ChartAxisDirection as wt,cachedTextMeasurer as X3,clamp as q3,dateToNumber as Id,extent as J3,formatValue as OA,isArray as Q3,measureTextSegments as eY,rescaleVisibleRange as wA,toPlainText as tY}from"ag-charts-core";import{aggregationDomain as EA,aggregationXRatioForXValue as io,clamp as iY}from"ag-charts-core";var Dd=3,sY=5,RA=.05;function nY(t,e,i){const{xValues:s,yValues:n,xDomain:a,yDomain:r,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:d,y1:u}=i;let p=0,g=1/0;const f=(c+d)/2,y=(h+u)/2;for(const m of e){const x=s[m],v=n[m];if(x==null||v==null)continue;const S=io(x,a.min,a.max,o),I=io(v,r.min,r.max,l),M=(S-f)**2+(I-y)**2;M<g&&(g=M,p=m)}return p}function aY(t,e,i){const{xValues:s,yValues:n,xDomain:a,yDomain:r,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:d,y1:u}=i;let p=0;for(const g of e){const f=s[g],y=n[g];if(f==null||y==null)continue;const m=io(f,a.min,a.max,o),x=io(y,r.min,r.max,l);m>=c&&m<=d&&x>=h&&x<=u&&(p+=1)}return p}function rY(t,e,i){const{xValues:s,yValues:n,xDomain:a,yDomain:r,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:d,y1:u}=i,p=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],g=(c+d)/2,f=(h+u)/2;for(const m of e){const x=s[m],v=n[m];if(x==null||v==null)continue;const S=io(x,a.min,a.max,o),I=io(v,r.min,r.max,l),M=(S>g?1:0)+(I>f?2:0),D=p[M];D.indices.push(m),D.x0=Math.min(D.x0,S),D.y0=Math.min(D.y0,I),D.x1=Math.max(D.x1,S),D.y1=Math.max(D.y1,I)}const y=[];for(const m of p){const{indices:x,x0:v,x1:S,y0:I,y1:M}=m;if(x.length===0)continue;const D=Jf(t,x,{x0:v,y0:I,x1:S,y1:M});y.push(D)}return y}function Jf(t,e,i){const{x0:s,y0:n,x1:a,y1:r}=i;let l=e.length<sY&&a-s<RA&&r-n<RA||s===a&&n===r?null:rY(t,e,i);if(l?.length===1)return l[0];l?.length===0&&(l=null);const c=Math.hypot(a-s,r-n),h=nY(t,e,i);return{scale:c,x0:s,y0:n,x1:a,y1:r,indices:e,primaryDatumIndex:h,children:l}}function oY(t,e,i,s,n,a,r){const[o,l]=t,[c,h]=e,[d,u]=a,{xNeedsValueOf:p,yNeedsValueOf:g}=r,f={xValues:i,yValues:s,xDomain:{min:o,max:l},yDomain:{min:c,max:h},xNeedsValueOf:p,yNeedsValueOf:g},y=[];if(n!=null&&u>d){const m=Array.from({length:Dd},()=>[]);for(let x=0;x<n.length;x+=1){const S=(n[x]-d)/(u-d),I=Math.trunc(S*Dd);I>=0&&I<Dd&&m[I].push(x)}for(let x=0;x<m.length;x+=1){const v=m[x],S=Jf(f,v,{x0:0,y0:0,x1:1,y1:1});if(S!=null){const I=x/Dd;y.push({sizeRatio:I,node:S})}}}else{const m=i.map((v,S)=>S),x=Jf(f,m,{x0:0,y0:0,x1:1,y1:1});x!=null&&y.push({sizeRatio:0,node:x})}return y.length>0?{xValues:i,yValues:s,xd0:o,xd1:l,yd0:c,yd1:h,filters:y,xNeedsValueOf:p,yNeedsValueOf:g}:void 0}function lY(t,e,i,s,n,a,r,o,l,c){const[h,d]=EA(t,a),[u,p]=EA(e,r);return oY([h,d],[u,p],i,s,n,[o[0],o[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function cY(t,e,i,s,n,a,r){const o=i.resolveColumnById(r,"xValue",s),l=i.resolveColumnById(r,"yValue",s),c=a?i.resolveColumnById(r,"sizeValue",s):void 0,h=i.getDomain(r,"xValue","value",s),d=i.getDomain(r,"yValue","value",s),u=a?n.domain:[0,0],p=i.resolveColumnNeedsValueOf(r,"xValue",s),g=i.resolveColumnNeedsValueOf(r,"yValue",s);return lY(t,e,o,l,c,h,d,u,p,g)}function PA(t,e,i,s,n,a){const{xRange:r,yRange:o,xVisibleRange:[l,c],yVisibleRange:[h,d],minSize:u,maxSize:p}=i,{xValues:g,yValues:f,xd0:y,xd1:m,yd0:x,yd1:v,xNeedsValueOf:S,yNeedsValueOf:I}=e,M=1/Math.min(r/(c-l),o/(d-h)),D={xValues:g,yValues:f,xDomain:{min:y,max:m},yDomain:{min:x,max:v},xNeedsValueOf:S,yNeedsValueOf:I};for(const{sizeRatio:C,node:A}of e.filters){const T=.5*(u+C*(p-u)),L=T*M,N=t*L,O=l-T/r,E=c+T/r,k=h-T/o,P=d+T/o,F=[A];for(;F.length>0;){const w=F.pop();if(!(w.x1<O||w.x0>E||w.y1<k||w.y0>P))if(t!==1&&w.scale<=N)s!=null&&(s.count+=1),n?.push({datumIndex:w.primaryDatumIndex,count:w.indices.length,area:(w.x1-w.x0)*(w.y1-w.y0),dilation:iY(1,w.scale/L,t)});else if(w.children==null){const{indices:j}=w;if(s!=null){const J=w.x0>=l&&w.x1<=c&&w.y0>=h&&w.y1<=d?j.length:aY(D,j,{x0:l,y0:h,x1:c,y1:d});s.count+=J}a?.push(...j)}else F.push(...w.children)}}}function Md(t,e,i){const s={count:0};return PA(t,e,i,s,void 0,void 0),s.count}var hY=100,dY=12;function uY(t,e,i){if(Md(1,t,e)<=i)return 1;let s=1,n=2;for(;Md(n,t,e)>i&&n<hY;)s*=2,n*=2;for(let a=0;a<dY;a+=1){const r=(n+s)/2;Md(r,t,e)>i?s=r:n=r}return(s+n)/2}function pY(t,e,i){const s=[],n=[];return PA(t,e,i,void 0,s,n),{groupedAggregation:s,singleDatumIndices:n}}import{Property as tt,ProxyProperty as Ti,SceneArrayChangeDetection as gY,SceneChangeDetection as fY}from"ag-charts-core";var Qf=class extends Bt{constructor(){super(...arguments),this.maxSize=30}};b([tt,fY()],Qf.prototype,"maxSize",2),b([tt,gY()],Qf.prototype,"domain",2);var _A=class extends ri{constructor(){super(...arguments),this.placement="top"}};b([tt],_A.prototype,"placement",2);var re=class extends $i{constructor(){super(...arguments),this.label=new _A,this.tooltip=wa(),this.maxRenderedItems=1/0,this.marker=new Qf}};b([tt],re.prototype,"xKey",2),b([tt],re.prototype,"yKey",2),b([tt],re.prototype,"sizeKey",2),b([tt],re.prototype,"labelKey",2),b([tt],re.prototype,"xFilterKey",2),b([tt],re.prototype,"yFilterKey",2),b([tt],re.prototype,"sizeFilterKey",2),b([tt],re.prototype,"xName",2),b([tt],re.prototype,"yName",2),b([tt],re.prototype,"sizeName",2),b([tt],re.prototype,"labelName",2),b([tt],re.prototype,"title",2),b([Ti("marker.shape")],re.prototype,"shape",2),b([Ti("marker.size")],re.prototype,"size",2),b([Ti("marker.maxSize")],re.prototype,"maxSize",2),b([Ti("marker.domain")],re.prototype,"domain",2),b([Ti("marker.fill")],re.prototype,"fill",2),b([Ti("marker.fillOpacity")],re.prototype,"fillOpacity",2),b([Ti("marker.stroke")],re.prototype,"stroke",2),b([Ti("marker.strokeWidth")],re.prototype,"strokeWidth",2),b([Ti("marker.strokeOpacity")],re.prototype,"strokeOpacity",2),b([Ti("marker.lineDash")],re.prototype,"lineDash",2),b([Ti("marker.lineDashOffset")],re.prototype,"lineDashOffset",2),b([Ti("marker.itemStyler")],re.prototype,"itemStyler",2),b([tt],re.prototype,"styler",2),b([tt],re.prototype,"label",2),b([tt],re.prototype,"tooltip",2),b([tt],re.prototype,"maxRenderedItems",2);var mY=class extends Vg{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},Ad=class extends Sn{constructor(t){super({moduleCtx:t,propertyKeys:{...Ur,label:["labelKey"],size:["sizeKey"]},propertyNames:{...Hr,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:Oa,datum:id},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=mY,this.properties=new re,this.dataAggregation=void 0,this.sizeScale=new Na,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(t){if(this.data==null||!this.visible)return;const e=this.axes[wt.X]?.scale,i=this.axes[wt.Y]?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),a=this.sizeScale.type,{xKey:r,yKey:o,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,g=this.properties.allowNullKeys??!1,{dataModel:f,processedData:y}=await this.requestDataModel(t,this.data,{props:[he(r,s,{id:"xValue",allowNullKey:g}),he(o,n,{id:"yValue",allowNullKey:g}),...c==null?[]:[he(c,s,{id:"xFilterValue"})],...h==null?[]:[he(h,n,{id:"yFilterValue"})],...d==null?[]:[he(d,a,{id:"sizeFilterValue"})],...l?[he(l,a,{id:"sizeValue"})]:[],...u?[he(u,"category",{id:"labelValue"})]:[]]}),m=l?f.resolveProcessedDataIndexById(this,"sizeValue"):void 0,x=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=x??(m==null?void 0:y.domain.values[m])??[],this.dataAggregation=this.aggregateData(f,y),this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:r}=s,o=this.axes[wt.X].scale.convert(t),l=r==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?a:n.convert(l[i]))*e;return[o-h,o+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:r}=s,o=this.axes[wt.Y].scale.convert(t[0]),l=r==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?a:n.convert(l[i]))*e;return[o-h,o+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return{domain:[]};const s={[wt.X]:"xValue",[wt.Y]:"yValue"},n=s[t],a=e.resolveProcessedDataDefById(this,n),r=e.getDomain(this,n,"value",i);if(a?.def.type==="value"&&a?.def.valueType==="category")return{domain:r.domain};const o=t===wt.X?wt.Y:wt.X,l=s[o],c=this.domainForClippedRange(t,[n],l);return{domain:Ut(J3(c))}}getSeriesRange(t,e){return this.domainForVisibleRange(wt.Y,["yValue"],"xValue",e)}getVisibleItems(t,e,i){const{dataAggregation:s,axes:n}=this,a=n[wt.X],r=n[wt.Y];if(s==null||a==null||r==null)return this.countVisibleItems("xValue",["yValue"],t,e,i);const o=this.aggregationOptions(a,r,t,e??[0,1]);return Md(0,s,o)}aggregateData(t,e){if(e.type==="grouped"||e.input.count<=this.properties.maxRenderedItems)return;const i=this.axes[wt.X],s=this.axes[wt.Y];if(i==null||s==null)return;const n=i.scale,a=s.scale;if(!(!se.is(n)||!se.is(a)))return cY(n.type,a.type,t,e,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(t,e,i=t.visibleRange,s=e.visibleRange){const{processedData:n,dataModel:a}=this,{sizeKey:r}=this.properties,[o,l]=this.getSizeRange(),c=Math.abs(t.range[1]-t.range[0]),h=Math.abs(e.range[1]-e.range[0]),d=Math.max(o,1),u=r?Math.max(l,1):d,p=t.scale,g=e.scale;return n!=null&&a!=null&&(se.is(p)&&(i=wA(i,p.domain.map(Id),a.getDomain(this,"xValue","value",n).domain.map(Id))),se.is(g)&&(s=wA(s,g.domain.map(Id),a.getDomain(this,"yValue","value",n).domain.map(Id)))),{xRange:c,yRange:h,minSize:d,maxSize:u,xVisibleRange:i,yVisibleRange:s}}createNodeDatumContext(t,e){const{dataModel:i,processedData:s,sizeScale:n,visible:a}=this;if(!i||!s)return;const r=s.dataSources.get(this.id)?.data;if(r==null)return;const{xKey:o,yKey:l,sizeKey:c,xFilterKey:h,yFilterKey:d,sizeFilterKey:u,labelKey:p,xName:g,yName:f,sizeName:y,labelName:m,label:x,legendItemName:v,marker:S}=this.properties,I=t.scale,M=e.scale,D=s.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let C;p?C=[]:c?C=i.getDomain(this,"sizeValue","value",s).domain:C=[];const A=i.resolveColumnById(this,"xValue",s);return{xAxis:t,yAxis:e,rawData:r,xValues:A,xDataValues:A,yDataValues:i.resolveColumnById(this,"yValue",s),sizeDataValues:c==null?void 0:i.resolveColumnById(this,"sizeValue",s),labelDataValues:p==null?void 0:i.resolveColumnById(this,"labelValue",s),xFilterDataValues:h==null?void 0:i.resolveColumnById(this,"xFilterValue",s),yFilterDataValues:d==null?void 0:i.resolveColumnById(this,"yFilterValue",s),sizeFilterDataValues:u==null?void 0:i.resolveColumnById(this,"sizeFilterValue",s),xScale:I,yScale:M,sizeScale:n,xOffset:(I.bandwidth??0)/2,yOffset:(M.bandwidth??0)/2,xKey:o,yKey:l,sizeKey:c,labelKey:p,xName:g,yName:f,sizeName:y,labelName:m,legendItemName:v,labelsEnabled:x.enabled,labelPlacement:x.placement,labelAnchor:je.anchor(S.shape),labelTextDomain:C,labelPadding:rr(x),labelTextMeasurer:X3(x),label:x,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:a,canIncrementallyUpdate:D,nodes:D?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(t){this.sizeScale.range=this.getSizeRange();const e={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,x:0,y:0,selected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0},{dataAggregation:i}=this;i==null?this.createNodeDataSimple(t,e):this.createNodeDataWithAggregation(t,e,t.xAxis,t.yAxis,i)}initializeResult(t){const{marker:e}=this.properties;return{itemId:t.yKey,nodeData:t.nodes,labelData:t.labelsEnabled?t.nodes:[],scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,styles:ad(this,this.properties,e)}}upsertBubbleNodeDatum(t,e,i){this.prepareNodeDatumState(t,e,i)&&ef(t,{scratch:e,datumIndex:i},(s,n)=>{const a=this.createSkeletonNodeDatum(s,n.scratch,n.datumIndex);return this.updateNodeDatum(s,a,n.scratch,n.datumIndex),a},(s,n,a)=>this.updateNodeDatum(s,n,a.scratch,a.datumIndex))}createNodeDataSimple(t,e){const i=t.rawData.length;for(let s=0;s<i;s++)e.count=1,e.dilation=1,e.area=0,this.upsertBubbleNodeDatum(t,e,s)}createNodeDataWithAggregation(t,e,i,s,n){const{maxRenderedItems:a}=this.properties,r=this.aggregationOptions(i,s),o=uY(n,r,a),{groupedAggregation:l,singleDatumIndices:c}=pY(o,n,r);for(const{datumIndex:h,count:d,dilation:u,area:p}of l)e.count=d,e.dilation=u,e.area=p,this.upsertBubbleNodeDatum(t,e,h);for(const h of c)e.count=1,e.dilation=1,e.area=0,this.upsertBubbleNodeDatum(t,e,h)}prepareNodeDatumState(t,e,i){const s=t.rawData[i],n=t.xDataValues[i],a=t.yDataValues[i],r=this.properties.allowNullKeys??!1;if((n===void 0||a===void 0)&&!r)return;const o=t.sizeDataValues?.[i],l=t.xScale.convert(n)+t.xOffset,c=t.yScale.convert(a)+t.yOffset;if(!Number.isFinite(l)||!Number.isFinite(c))return;let h;t.xFilterDataValues!=null&&t.yFilterDataValues!=null&&(h=t.xFilterDataValues[i]===n&&t.yFilterDataValues[i]===a,t.sizeFilterDataValues!=null&&h&&(h=t.sizeFilterDataValues[i]===o));let d;t.labelsEnabled?d=this.computeLabel(t,s,a,o,i):d={text:"",width:0,height:0};const u=o==null?t.sizeScale.range[0]:t.sizeScale.convert(o);return e.datum=s,e.xDatum=n,e.yDatum=a,e.sizeValue=o,e.x=l,e.y=c,e.selected=h,e.nodeLabel=d,e.markerSize=u,e}computeLabel(t,e,i,s,n){let a,r,o;t.labelKey&&t.labelDataValues?(a=t.labelDataValues[n],r=t.labelKey,o="label"):t.sizeKey?(a=s,r=t.sizeKey,o="size"):(a=i,r=t.yKey,o="y");const l=this.getLabelText(a,e,r,o,t.labelTextDomain,t.label,{value:a,datum:e,xKey:t.xKey,yKey:t.yKey,sizeKey:t.sizeKey,labelKey:t.labelKey,xName:t.xName,yName:t.yName,sizeName:t.sizeName,labelName:t.labelName,legendItemName:t.legendItemName});let{width:c,height:h}=Q3(l)?eY(l,t.label):t.labelTextMeasurer.measureLines(String(l));return c+=t.labelPadding.left+t.labelPadding.right,h+=t.labelPadding.bottom+t.labelPadding.top,{text:l,width:c,height:h}}createSkeletonNodeDatum(t,e,i){return{series:this,yKey:t.yKey,xKey:t.xKey,datum:void 0,datumIndex:0,xValue:void 0,yValue:void 0,sizeValue:void 0,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},point:{x:0,y:0,size:0},midPoint:{x:0,y:0},label:{text:"",width:0,height:0},anchor:t.labelAnchor,placement:t.labelPlacement,count:1,dilation:1,area:0,selected:void 0}}updateNodeDatum(t,e,i,s){const n=e,{x:a,y:r,markerSize:o,dilation:l}=i;n.datum=i.datum,n.datumIndex=s,n.xValue=i.xDatum,n.yValue=i.yDatum,n.sizeValue=i.sizeValue,n.selected=i.selected,n.count=i.count,n.dilation=i.dilation,n.area=i.area,n.label=i.nodeLabel,n.anchor=t.labelAnchor,n.placement=t.labelPlacement;const c=n.point;c.x=a,c.y=r,c.size=Math.sqrt(l)*o;const h=n.midPoint;h.x=a,h.y=r}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;if(this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),!vi(this.processedData))return i.update(e);const{sizeKey:s}=this.properties;let n;return s&&(n=a=>ft(a.xValue,a.yValue,a.sizeValue,tY(a.label.text))),i.update(e,void 0,n)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:a,labelKey:r,marker:o}=this.properties,l={xKey:s,yKey:n,sizeKey:a,labelKey:r},c=this.ctx.highlightManager.getActiveHighlight();e.each((h,d)=>{if(!e.isGarbage(h)){const u=this.getHighlightState(c,t.isHighlight,d.datumIndex),p=this.getStyle(u);d.style=this.getMarkerStyle(o,d,l,{isHighlight:i,highlightState:u,resolveMarkerSubPath:[]},p)}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:s,drawingMode:n}=t;this.sizeScale.range=this.getSizeRange();const a=this.getShapeFillBBox(),r=this.dataAggregation!=null,o=this.ctx.highlightManager.getActiveHighlight();i.each((l,c,h)=>{const{point:{size:d},count:u,area:p,dilation:g}=c,f=this.getHighlightState(o,s,c.datumIndex),y={...c.style??e.styles[f]};if(y.size=d,g>1){const m=y.fillOpacity??0,x=.269669+683e-6*u+-37.534348*p+.004449*u*p+-0*u**2+44.428603*p**2;y.fillOpacity=q3(m/g,m/.1*x,1)}this.applyMarkerStyle(y,l,c.point,a,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(n,y),l.zIndex=r?[-u,h]:0}),s||this.properties.marker.markClean()}updatePlacedLabelData(t){this.placedLabelData=t,this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const t=this.ctx.highlightManager?.getActiveHighlight(),e=this.isSeriesHighlighted(t)&&t?.datum?t:void 0,i=e==null?[]:this.placedLabelData.filter(s=>s.datum.datumIndex===e.datumIndex).map(s=>({...s.datum,point:{x:s.x,y:s.y,size:s.datum.point.size}}));this.highlightLabelSelection=this.updateLabelSelection({labelData:i,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=i.length>0,this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();t.labelSelection.each((n,a)=>{const r=ka(this,a,s,this.properties.label,e,i);n.text=a.label.text,n.fill=r.color,n.x=a.point?.x??0,n.y=a.point?.y??0,n.fontStyle=r.fontStyle,n.fontWeight=r.fontWeight,n.fontSize=r.fontSize,n.fontFamily=r.fontFamily,n.textBaseline="top",n.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,n.setBoxing(r)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1})}makeStylerParams(t){const{id:e,properties:{size:i,maxSize:s,shape:n,fill:a,fillOpacity:r,lineDash:o,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,sizeKey:g,labelKey:f}}=this,y=nr(t??0);return this.type==="bubble"?{highlightState:y,size:i,maxSize:s,shape:n,fill:a,fillOpacity:r,lineDash:o,lineDashOffset:l,seriesId:e,sizeKey:g,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:f}:this.type==="scatter"?{highlightState:y,size:i,shape:n,fill:a,fillOpacity:r,lineDash:o,lineDashOffset:l,seriesId:e,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:f}:this.type}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:s,sizeKey:n,sizeName:a,labelKey:r,labelName:o,legendItemName:l}=this.properties;return{xKey:t,xName:e,yKey:i,yName:s,sizeKey:n,sizeName:a,labelKey:r,labelName:o,legendItemName:l}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,ctx:r}=this,{formatManager:o}=r,{xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:g,labelName:f,title:y,tooltip:m,marker:x,legendItemName:v}=a,S=n[wt.X],I=n[wt.Y];if(!i||!s||!S||!I)return;const M=s.dataSources.get(this.id)?.data?.[t],D=i.resolveColumnById(this,"xValue",s)[t],C=i.resolveColumnById(this,"yValue",s)[t],A=this.properties.allowNullKeys??!1;if(D===void 0&&!A)return;const T=[];if(this.isLabelEnabled()&&g!=null){const N=i.resolveColumnById(this,"labelValue",s)[t],O=o.format(this.callWithContext.bind(this),{type:"category",value:N,datum:M,seriesId:e,legendItemName:v,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});T.push({label:f,fallbackLabel:g,value:O??OA(N)})}if(T.push({label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",D,M,l,v,A),missing:aa(D,A)},{label:d,fallbackLabel:h,value:this.getAxisValueText(I,"tooltip",C,M,h,v,A),missing:aa(C,A)}),u!=null){const N=i.resolveColumnById(this,"sizeValue",s)[t];if(N!=null){const O=i.getDomain(this,"sizeValue","value",s).domain,E=o.format(this.callWithContext.bind(this),{type:"number",value:N,datum:M,seriesId:e,legendItemName:v,key:u,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:O,fractionDigits:void 0,visibleDomain:void 0});T.push({label:p,fallbackLabel:u,value:E??OA(N)})}}const L=this.getMarkerStyle(x,{datum:M,datumIndex:t},{xKey:l,yKey:h,sizeKey:u,labelKey:g},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(m,{title:y,symbol:this.legendItemSymbol(),data:T},{seriesId:e,datum:M,title:h,xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:g,labelName:f,legendItemName:v,...L,...this.getModuleTooltipParams()})}legendItemSymbol(){const t=this.getStyle();return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},t)}}getLegendData(){const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,legendItemName:a,title:r,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:a??r??n??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){CH(this,this.ctx.animationManager,t),Te(this,"labels",this.ctx.animationManager,e)}resetDatumAnimation(t){sd([t.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new je}getStyle(t){const{properties:e}=this;let i={};if(e.styler){const s=this.makeStylerParams(t),n=this.cachedCallWithContext(e.styler,s)??{};i=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],n,{pick:!1})??{}}return{fill:i.fill??e.fill,fillOpacity:i.fillOpacity??e.fillOpacity,lineDash:i.lineDash??e.lineDash,lineDashOffset:i.lineDashOffset??e.lineDashOffset,shape:i.shape??e.shape,size:i.size??e.size,maxSize:i.maxSize??e.maxSize,stroke:i.stroke??e.stroke,strokeOpacity:i.strokeOpacity??e.strokeOpacity,strokeWidth:i.strokeWidth??e.strokeWidth}}getSizeRange(){const{size:t,maxSize:e}=this.getStyle();return[t,e]}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n,marker:a}=this.properties;return this.getMarkerStyle(a,t,{xKey:e,yKey:i,sizeKey:s,labelKey:n},{resolveMarkerSubPath:[]})}computeFocusBounds(t){return nd(this,t)}hasItemStylers(){const{styler:t,itemStyler:e,marker:i,label:s}=this.properties;return!!(t??e??i.itemStyler??s.itemStyler)}initQuadTree(t){Kh(t,this.datumNodesIter())}pickNodeDataClosestDatum(t){return Zh(this,t)}};Ad.className="BubbleSeries",Ad.type="bubble";var yY={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",W3],["image",Y3],["pattern",$3]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...K3,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Z3}},FA={type:"series",name:"bubble",chartType:"cartesian",version:fe,dependencies:[bi],options:Ih,predictAxis:Og,defaultAxes:{x:{type:LA.NUMBER,position:NA.BOTTOM},y:{type:LA.NUMBER,position:NA.LEFT}},axisKeys:{[kA.X]:"xKeyAxis",[kA.Y]:"yKeyAxis"},themeTemplate:yY,create:t=>new Ad(t)};import{CARTESIAN_AXIS_TYPE as VA,CARTESIAN_POSITION as BA,ChartAxisDirection as zA,DEFAULT_SHADOW_COLOUR as bY,FILL_GRADIENT_LINEAR_DEFAULTS as xY,FILL_IMAGE_DEFAULTS as vY,FILL_PATTERN_DEFAULTS as SY,LABEL_BOXING_DEFAULTS as IY,MULTI_SERIES_HIGHLIGHT_STYLE as DY}from"ag-charts-core";import{ChartAxisDirection as so,createTicks as MY,deepClone as AY,findMinMax as CY,isDate as TY,isNumber as GA,mergeDefaults as LY,tickStep as NY}from"ag-charts-core";import{Property as it}from"ag-charts-core";var Ke=class extends $i{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new bs,this.label=new ri,this.tooltip=wa()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,cornerRadius:o}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,cornerRadius:o,opacity:1}}};b([it],Ke.prototype,"xKey",2),b([it],Ke.prototype,"yKey",2),b([it],Ke.prototype,"xName",2),b([it],Ke.prototype,"yName",2),b([it],Ke.prototype,"fill",2),b([it],Ke.prototype,"fillOpacity",2),b([it],Ke.prototype,"stroke",2),b([it],Ke.prototype,"strokeWidth",2),b([it],Ke.prototype,"strokeOpacity",2),b([it],Ke.prototype,"lineDash",2),b([it],Ke.prototype,"lineDashOffset",2),b([it],Ke.prototype,"cornerRadius",2),b([it],Ke.prototype,"areaPlot",2),b([it],Ke.prototype,"bins",2),b([it],Ke.prototype,"aggregation",2),b([it],Ke.prototype,"binCount",2),b([it],Ke.prototype,"shadow",2),b([it],Ke.prototype,"label",2),b([it],Ke.prototype,"tooltip",2);var jA=10,em=class extends Sn{constructor(t){super({moduleCtx:t,propertyKeys:Ur,propertyNames:Hr,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:Ml,label:Oa}}),this.properties=new Ke,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(t){const e=MY(t[0],t[1],jA).ticks,i=NY(t[0],t[1],jA),[s]=e,n=a=>[a,a+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:a,binSize:r}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,r,n)}getBins(t,e,i,s){const n=[],a=this.calculatePrecision(i);for(let r=0;r<s;r++){const o=Math.round((t+r*i)*a)/a;let l=Math.round((t+(r+1)*i)*a)/a;r===s-1&&(l=Math.max(l,e)),n[r]=[o,l]}return n}calculatePrecision(t){let e=10;if(Number.isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(t/a)*a,binSize:s}}async processData(t){const{visible:e}=this,{xKey:i,yKey:s,areaPlot:n,aggregation:a}=this.properties,r=this.axes[so.X]?.scale,o=this.axes[so.Y]?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:o,xScale:r}),h=e?{}:{forceValue:0},d=[Js(i,l),sE];if(s){let x=Ib("groupAgg",{visible:e});a==="count"||(a==="sum"?x=cw("groupAgg",{visible:e}):a==="mean"&&(x=dw("groupAgg",{visible:e}))),n&&(x=Db("groupAgg",x)),d.push(he(s,c,{invalidValue:void 0,...h}),x)}else{d.push(Qw("count"));let x=Ib("groupAgg",{visible:e});n&&(x=Db("groupAgg",x)),d.push(x)}let u=[];const p=x=>{const v=Ut(x.domain.keys[0]);if(v.length===0)return x.domain.groups=[],()=>[];const S=GA(this.properties.binCount)?this.calculateNiceBins(v,this.properties.binCount):this.properties.bins??this.deriveBins(v),I=S.length;return u=[...S],M=>{let D=M[0];if(TY(D)&&(D=D.getTime()),!GA(D))return[];for(let C=0;C<I;C++){const A=S[C];if(D>=A[0]&&D<A[1]||C===I-1&&D<=A[1])return A}return[]}},{dataModel:g,processedData:f}=await this.requestDataModel(t,this.data,{props:d,groupByFn:p}),y=f,m=new Map;for(const[x,v]of y.groups.entries()){const S=v.keys;m.set(ft(...S),{group:v,groupIndex:x})}this.calculatedBins=u.map(x=>{const v=m.get(ft(...x));if(v){const{group:S,groupIndex:I}=v,[[M,D]=[0,0]]=S.aggregation,C=[...g.forEachDatum(this,y,S,I)],A=this.frequency(S),T=M+D;return{domain:x,datum:C,groupIndex:I,frequency:A,total:T}}else return{domain:x,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return{domain:[]};const s=i.getDomain(this,"groupAgg","aggregate",e).domain,n=this.calculatedBins[0].domain[0],a=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return t===so.X?{domain:Ut([n,a])}:{domain:Ut(s)}}getSeriesRange(t,[e,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[Number.NaN,Number.NaN];const a=this.axes[so.X].scale,r=0;let o=-1/0;for(const{keys:l,aggregation:c}of n.groups){const[[h,d]=[0,0]]=c,[u,p]=l,[g,f]=CY([a.convert(u),a.convert(p)]);if(f>=e&&g<=i){const y=h+d;o=Math.max(o,y)}}return r>o?[Number.NaN,Number.NaN]:[r,o]}frequency(t){return t.datumIndices.reduce((e,i)=>e+i.length,0)}createNodeDatumContext(t,e){const{xKey:i,yKey:s,xName:n,yName:a,label:r}=this.properties,{contextNodeData:o,processedData:l}=this,c=o?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:t,yAxis:e,xScale:t.scale,yScale:e.scale,yAxisReversed:e.isReversed(),rawData:[],xValues:[],xKey:i,yKey:s,xName:n,yName:a,label:r,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?o.nodeData:[],nodeIndex:0}}createLabelData(t,e,i,s,n,a){const{label:r,yKey:o,xKey:l,xName:c,yName:h}=t,{total:d,datum:u}=e;if(!(!r.enabled||d===0))return{x:i+n/2,y:s+a/2,text:this.getLabelText(d,u,o,"y",[],r,{value:d,datum:u,xKey:l,yKey:o,xName:c,yName:h})}}createSkeletonNodeDatum(t,e){const{xKey:i,yKey:s}=t,{domain:n,datum:a,groupIndex:r,frequency:o,total:l}=e;return{series:this,datumIndex:r,datum:a,aggregatedValue:l,frequency:o,domain:n,yKey:s,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(t,e,i){const{xScale:s,yScale:n,yAxisReversed:a}=t,{domain:r,datum:o,groupIndex:l,frequency:c,total:h}=i,d=e,[u,p]=r,g=s.convert(u),f=s.convert(p),y=n.convert(0),m=n.convert(h),x=Math.abs(f-g),v=Math.abs(m-y),S=Math.min(g,f),I=Math.min(y,m);d.datumIndex=l,d.datum=o,d.aggregatedValue=h,d.frequency=c,d.domain=r,d.x=S,d.y=I,d.xValue=g,d.yValue=m,d.width=x,d.height=v,d.midPoint?(d.midPoint.x=S+x/2,d.midPoint.y=I+v/2):d.midPoint={x:S+x/2,y:I+v/2},d.topLeftCornerRadius=!a,d.topRightCornerRadius=!a,d.bottomRightCornerRadius=a,d.bottomLeftCornerRadius=a,d.label=this.createLabelData(t,i,S,I,x,v)}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}populateNodeData(t){const{processedData:e}=this;if(e?.type==="grouped")for(const i of this.calculatedBins)ef(t,i,(s,n)=>this.createNodeDatum(s,n),(s,n,a)=>this.updateNodeDatum(s,n,a))}initializeResult(t){return{itemId:this.properties.yKey??this.id,nodeData:t.nodes,labelData:t.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||t.animationEnabled,styles:Yu(this.getItemStyle.bind(this))}}finalizeNodeData(t){super.finalizeNodeData(t),t.nodes.sort((e,i)=>e.x-i.x)}nodeFactory(){return new ze}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return vi(this.processedData)?i.update(e,void 0,s=>ft(...s.domain)):i.update(e)}getItemStyle(t,e,i){const{properties:s}=this,n=this.getHighlightStyle(e,t,i);return LY(n,s.getStyle())}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t;e.each((s,n)=>{e.isGarbage(s)||(n.style=this.getItemStyle(n.datumIndex,i))})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getShapeFillBBox();t.datumSelection.each((a,r)=>{const o=r.style??e.styles[this.getHighlightState(i,t.isHighlight,r.datumIndex)],{cornerRadius:l=0}=o,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:d,bottomLeftCornerRadius:u}=r;a.setStyleProperties(o,n),a.topLeftCornerRadius=c?l:0,a.topRightCornerRadius=h?l:0,a.bottomRightCornerRadius=d?l:0,a.bottomLeftCornerRadius=u?l:0,a.crisp=r.crisp,a.fillShadow=s})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(t){const e=this.isLabelEnabled(),{isHighlight:i=!1}=t,s=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((n,a)=>{const r=ka(this,a,this.properties,this.properties.label,i,s),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=r;o&&e&&a?.label?(n.text=a.label.text,n.x=a.label.x,n.y=a.label.y,n.fontStyle=l,n.fontWeight=c,n.fontFamily=d,n.fontSize=h,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(i,a.datumIndex).opacity??1,n.setBoxing(r)):n.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e instanceof z&&Kh(t,e.children())}pickNodeClosestDatum(t){return Zh(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,ctx:{localeManager:r}}=this,{xKey:o,xName:l,yKey:c,yName:h,tooltip:d,legendItemName:u}=a,p=n[so.X],g=n[so.Y];if(!i||s?.type!=="grouped"||!p||!g)return;const f=s.groups[t],{aggregation:y,keys:m}=f,[[x,v]=[0,0]]=y,S=this.frequency(f),I=m,[M,D]=I,C=x+v,A={data:[...i.forEachDatum(this,s,f,t)],aggregatedValue:C,frequency:S,domain:I},T=[{label:l,fallbackLabel:o,value:`${this.getAxisValueText(p,"tooltip",M,A,o,u)} - ${this.getAxisValueText(p,"tooltip",D,A,o,u)}`},{label:r.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(g,"tooltip",S,A,c,u)}];if(c!=null){let L;switch(a.aggregation){case"sum":L=r.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":L=r.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":L=r.t("seriesHistogramTooltipCount",{yName:h??c});break}T.push({label:L,value:this.getAxisValueText(g,"tooltip",C,A,c,u)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:T},{seriesId:e,datum:A,title:h,xKey:o,xName:l,yKey:c,yName:h,xRange:[M,D],frequency:S,...this.getItemStyle(t,!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=this.properties;return{marker:{fill:AY(t)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:r}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!r}]}resetDatumAnimation(t){td([t.datumSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Dl(Il(!0,this.axes,"normal"),"unknown");Oe(this.id,"datums",this.ctx.animationManager,[t],i),Te(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=Dl(Il(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};Oe(this.id,"datums",this.ctx.animationManager,[t.datumSelection],e,(s,n)=>ft(...n.domain),i),i?.changed&&Te(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Qg(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.label.itemStyler!=null}};em.className="HistogramSeries",em.type="histogram";var kY={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",xY],["image",vY],["pattern",SY]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...IY,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:bY,xOffset:3,yOffset:3,blur:5},highlight:DY}},UA={type:"series",name:"histogram",chartType:"cartesian",version:fe,dependencies:[bi],options:FB,predictAxis:pl,defaultAxes:{x:{type:VA.NUMBER,position:BA.BOTTOM},y:{type:VA.NUMBER,position:BA.LEFT}},axisKeys:{[zA.X]:"xKeyAxis",[zA.Y]:"yKeyAxis"},themeTemplate:kY,create:t=>new em(t)};import{CARTESIAN_AXIS_TYPE as HA,CARTESIAN_POSITION as WA,ChartAxisDirection as YA,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as OY,FILL_IMAGE_DEFAULTS as wY,FILL_PATTERN_DEFAULTS as EY,LABEL_BOXING_DEFAULTS as RY,MARKER_SERIES_HIGHLIGHT_STYLE as PY,SAFE_STROKE_FILL_OPERATION as _Y,SEGMENTATION_DEFAULTS as FY}from"ag-charts-core";import{ChartAxisDirection as Qt,DebugMetrics as VY,extent as BY,isDefined as zY,mergeDefaults as GY}from"ag-charts-core";import{AGGREGATION_INDEX_X_MAX as jY,AGGREGATION_INDEX_X_MIN as UY,AGGREGATION_INDEX_Y_MAX as HY,AGGREGATION_INDEX_Y_MIN as WY,AGGREGATION_MIN_RANGE as YY,AGGREGATION_THRESHOLD as $A,aggregationDomain as tm,aggregationIndexForXRatio as $Y,aggregationRangeFittingPoints as KA,aggregationXRatioForDatumIndex as KY,aggregationXRatioForXValue as ZY,compactAggregationIndices as XY,createAggregationIndices as ZA,nextPowerOf2 as qY,simpleMemorize2 as JY}from"ag-charts-core";var QY=10;function Cd(t,e,i,s,n,a,r,o){const l=t[a];if(l===void 0)return!1;const c=Number.isFinite(e)?ZY(l,e,i,r):KY(a,o),h=$Y(c,n);return a===s[h+UY]||a===s[h+jY]||a===s[h+WY]||a===s[h+HY]}function XA(t,e,i,s,n,a,r,o){let l=0;for(let d=0;d<r;d++)Cd(t,e,i,s,n,d,a,r)&&l++;const c=o?.length===l?o:new Uint32Array(l);let h=0;for(let d=0;d<r;d++)Cd(t,e,i,s,n,d,a,r)&&(c[h++]=d);return c}function e$(t,e,i,s,n,a,r,o,l){let c=0;for(const u of t)Cd(e,i,s,n,a,u,r,o)&&c++;const h=l?.length===c?l:new Uint32Array(c);let d=0;for(const u of t)Cd(e,i,s,n,a,u,r,o)&&(h[d++]=u);return h}function im(t,e,i,s){const n=e.length;if(n<$A)return;const[a,r]=t,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:c}=s;let h=KA(e,a,r,{xNeedsValueOf:o});const d=c?.find(y=>y.maxRange===h);let{indexData:u,valueData:p}=ZA(e,i,i,a,r,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),g=XA(e,a,r,u,h,o,n,d?.indices);const f=[{maxRange:h,indices:g,indexData:u,valueData:p}];for(;g.length>QY&&h>64;){const y=h,m=Math.trunc(y/2),x=c?.find(S=>S.maxRange===m),v=XY(u,p,y,{reuseIndexData:x?.indexData,reuseValueData:x?.valueData});h=v.maxRange,u=v.indexData,p=v.valueData,g=e$(g,e,a,r,u,h,o,n,x?.indices),f.push({maxRange:h,indices:g,indexData:u,valueData:p})}return f.reverse(),f}function t$(t,e,i,s){const n=e.length;if(n<$A)return;const[a,r]=t,{xNeedsValueOf:o,yNeedsValueOf:l,targetRange:c,existingFilters:h}=s,d=KA(e,a,r,{xNeedsValueOf:o}),u=Math.min(d,qY(Math.max(c,YY))),p=h?.find(v=>v.maxRange===u),{indexData:g,valueData:f}=ZA(e,i,i,a,r,u,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),y=XA(e,a,r,g,u,o,n,p?.indices),m={maxRange:u,indices:y,indexData:g,valueData:f};function x(){return im([a,r],e,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(S=>S.maxRange!==u)??[]}return{immediate:[m],computeRemaining:x}}function i$(t,e,i,s,n,a){const[r,o]=tm(t,s);return im([r,o],e,i,{xNeedsValueOf:n,yNeedsValueOf:a})}var s$=JY(i$);function n$(t,e,i,s,n,a){const r=e.resolveColumnById(n,"xValue",i),o=e.resolveColumnById(n,s,i),l=e.getDomain(n,"xValue","value",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),h=e.resolveColumnNeedsValueOf(n,s,i);if(a){const[d,u]=tm(t,l);return im([d,u],r,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:a})}return s$(t,r,o,l,c,h)}function a$(t,e,i,s,n,a,r){const o=e.resolveColumnById(n,"xValue",i),l=e.resolveColumnById(n,s,i),c=e.getDomain(n,"xValue","value",i),h=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,s,i),[u,p]=tm(t,c);return t$([u,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:a,existingFilters:r})}import{InterpolationProperties as r$,Property as Ze}from"ag-charts-core";var Fe=class extends $i{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new r$,this.marker=new Bt,this.label=new ri,this.tooltip=wa(),this.connectMissingData=!1,this.sparklineMode=!1}};b([Ze],Fe.prototype,"xKey",2),b([Ze],Fe.prototype,"yKey",2),b([Ze],Fe.prototype,"xName",2),b([Ze],Fe.prototype,"yName",2),b([Ze],Fe.prototype,"yFilterKey",2),b([Ze],Fe.prototype,"stackGroup",2),b([Ze],Fe.prototype,"normalizedTo",2),b([Ze],Fe.prototype,"title",2),b([Ze],Fe.prototype,"stroke",2),b([Ze],Fe.prototype,"strokeWidth",2),b([Ze],Fe.prototype,"strokeOpacity",2),b([Ze],Fe.prototype,"lineDash",2),b([Ze],Fe.prototype,"lineDashOffset",2),b([Ze],Fe.prototype,"interpolation",2),b([Ze],Fe.prototype,"styler",2),b([Ze],Fe.prototype,"marker",2),b([Ze],Fe.prototype,"label",2),b([Ze],Fe.prototype,"tooltip",2),b([Ze],Fe.prototype,"connectMissingData",2),b([Ze],Fe.prototype,"sparklineMode",2);var o$=.25,sm=class extends Sn{constructor(t){super({moduleCtx:t,propertyKeys:Ur,propertyNames:Hr,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:lf({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Oa,datum:(e,i)=>({...id(e),...Cl(e,i)})},clipFocusBox:!1}),this.properties=new Fe,this.aggregationManager=new ld}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return this.properties.normalizedTo!=null}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(t){if(this.data==null)return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:a,yKey:r,yFilterKey:o,connectMissingData:l,normalizedTo:c}=this.properties,h=this.axes[Qt.X]?.scale,d=this.axes[Qt.Y]?.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:d}),f=n>1||c!=null,y={invalidValue:null};l&&f&&(y.invalidValue=0),f&&!i&&(y.forceValue=0);const m={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},x=[],v=this.properties.allowNullKeys??!1;(!u||f)&&x.push(Js(a,p,{id:"xKey",allowNullKey:v})),x.push(he(a,p,{id:"xValue",allowNullKey:v}),he(r,g,{id:"yValueRaw",...y,invalidValue:void 0})),o!=null&&x.push(he(o,g,{id:"yFilterRaw"})),f&&x.push(...Do(r,"normal",{id:"yValueCumulative",...y,groupId:m.marker},g)),zY(c)&&x.push(he(r,g,{id:"yValue",...y,groupId:m.value}),xc(Object.values(m),c)),this.needsDataModelDiff()&&(x.push(Ao(u?["xValue"]:void 0)),this.processedData&&x.push(Sc(this.id,this.processedData)));const{dataModel:S,processedData:I}=await this.requestDataModel(t,e,{props:x,groupByKeys:f,groupByData:!f});this.aggregateData(S,I),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(t){return t.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[Qt.X].scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[Qt.Y].scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i,axes:s}=this;if(!e||!i)return{domain:[]};const n=s[Qt.Y];if(t===Qt.X){const r=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","value",i);if(r?.def.type==="value"&&r.def.valueType==="category"){const l=e.getKeySortMetadata(this,"xValue",i);return{domain:o.domain,sortMetadata:l}}return{domain:Ut(BY(o.domain))}}const a=this.domainForClippedRange(Qt.Y,[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&n instanceof mi&&!(n instanceof eo)){const r=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:Ut(r)}}else return{domain:Ut(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(Qt.Y,[this.yCumulativeKey(this.processedData)],"xValue",e)}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),e.type!=="ungrouped"||vi(e))return;const i=this.axes[Qt.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>a$(i.scale.type,t,e,this.yCumulativeKey(e),this,s,a),computeFull:a=>n$(i.scale.type,t,e,this.yCumulativeKey(e),this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&VY.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[Qt.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=t.scale,a=e.scale,r=s.dataSources.get(this.id)?.data??[],[o,l]=n.range,c=Math.abs(l-o);this.aggregationManager.ensureLevelForRange(c);const h=this.aggregationManager.getFilterForRange(c),d=this.canIncrementallyUpdateNodes(h!=null);return{xAxis:t,yAxis:e,rawData:r,xValues:i.resolveColumnById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:i.resolveColumnById(this,this.yCumulativeKey(s),s),selectionValues:this.properties.yFilterKey?i.resolveColumnById(this,"yFilterRaw",s):void 0,xScale:n,yScale:a,xOffset:(n.bandwidth??0)/2,yOffset:(a.bandwidth??0)/2,size:this.properties.marker.enabled?this.properties.marker.size:0,yDomain:this.getSeriesDomain(Qt.Y).domain,labelsEnabled:this.properties.label.enabled,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:d,dataAggregationFilter:h,range:c,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:d?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(t,e,i){if(e.datum=t.rawData[i],e.xDatum=t.xValues[i],e.yDatum=t.yRawValues[i],e.yCumulative=t.yCumulativeValues[i],e.selected=t.selectionValues?.[i],e.x=t.xScale.convert(e.xDatum)+t.xOffset,e.y=t.yScale.convert(e.yCumulative)+t.yOffset,!!Number.isFinite(e.x)){if(e.yDatum!=null){const s=t.labelsEnabled?this.getLabelText(e.yDatum,e.datum,t.yKey,"y",t.yDomain,this.properties.label,{value:e.yDatum,datum:e.datum,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0;if(t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length){const a=t.nodes[t.nodeIndex];a.datum=e.datum,a.datumIndex=i,a.point={x:e.x,y:e.y,size:t.size},a.midPoint={x:e.x,y:e.y},a.cumulativeValue=e.yCumulative,a.yValue=e.yDatum,a.xValue=e.xDatum,a.labelText=s,a.selected=e.selected}else t.nodes.push({series:this,datum:e.datum,datumIndex:i,yKey:t.yKey,xKey:t.xKey,point:{x:e.x,y:e.y,size:t.size},midPoint:{x:e.x,y:e.y},cumulativeValue:e.yCumulative,yValue:e.yDatum,xValue:e.xDatum,capDefaults:t.capDefaults,labelText:s,selected:e.selected});t.nodeIndex++}this.updateSpanPoints(t,e)}}updateSpanPoints(t,e){const i=t.spanPoints.at(-1);if(e.yDatum!=null){const s={point:{x:e.x,y:e.y},xDatum:e.xDatum,yDatum:e.yCumulative};Array.isArray(i)?i.push(s):i==null?t.spanPoints.push([s]):(i.skip+=1,t.spanPoints.push([s]))}else t.connectMissingData||(Array.isArray(i)||i==null?t.spanPoints.push({skip:0}):i.skip+=1)}populateNodeData(t){const e={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0},i=t.dataAggregationFilter?.indices;let[s,n]=this.visibleRangeIndices("xValue",t.xAxis.range,i);s=Math.max(s-1,0),n=Math.min(n+1,i?.length??t.xValues.length),this.processedData.input.count<1e3&&(s=0,n=this.processedData.input.count);for(let a=s;a<n;a+=1)this.handleDatum(t,e,i?.[a]??a)}initializeResult(t){return{itemId:t.yKey,nodeData:t.nodes,labelData:t.nodes,strokeData:{itemId:t.yKey,spans:[]},scales:this.calculateScaling(),visible:this.visible,crossFiltering:!1,styles:ad(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(t,e){const i=t.spanPoints.flatMap(s=>Array.isArray(s)?Sl(s,this.properties.interpolation):[]);return e.strokeData={itemId:t.yKey,spans:i},e.crossFiltering=t.selectionValues?.some((s,n)=>s===t.yRawValues[n])??!1,e.segments=jh(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene,!1),e}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],visible:i,animationEnabled:s}=t,n=this.contextNodeData?.crossFiltering===!0,a=GY(this.getHighlightStyle(),this.getStyle()),{strokeWidth:r,stroke:o,strokeOpacity:l,lineDash:c,lineDashOffset:h,opacity:d}=a,u=this.contextNodeData?.segments;e.setProperties({segments:u,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:d,stroke:o,strokeWidth:r,strokeOpacity:l*(n?o$:1),lineDash:c,lineDashOffset:h}),e.datum=u,s||(e.visible=i),rd(this,e)}updateDatumSelection(t){let{nodeData:e}=t;const{datumSelection:i}=t,{contextNodeData:s,processedData:n,axes:a,properties:r}=this,{marker:o}=r;return e=s?.crossFiltering===!0||af(n.input.count,a[Qt.X].scale,o)?e:[],o.isDirty()&&(i.clear(),i.cleanup()),vi(this.processedData)?i.update(e,void 0,c=>ft(c.xValue)):i.update(e)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();e.each((a,r)=>{if(!e.isGarbage(a)){const o=this.getHighlightState(n,t.isHighlight,r.datumIndex),l=this.getStyle(o),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,r.datumIndex,l.marker);r.style=this.getMarkerStyle(s,r,u,{isHighlight:i,highlightState:o},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:s}=t,n=this.ctx.animationManager.isSkipped(),a=this.getShapeFillBBox(),r=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(s,t.drawingMode);i.each((l,c)=>{const h=this.getHighlightState(r,s,c.datumIndex),d=c.style??e.styles[h];this.applyMarkerStyle(d,l,c.point,a,{applyTranslation:n,selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(o,d)}),s||this.properties.marker.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();t.labelSelection.each((n,a)=>{const r=ka(this,a,s,this.properties.label,e,i),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=r;o&&a?.labelText?(n.fontStyle=l,n.fontWeight=c,n.fontSize=h,n.fontFamily=d,n.textAlign="center",n.textBaseline="bottom",n.text=a.labelText,n.x=a.point.x,n.y=a.point.y-10,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,n.setBoxing(r)):n.visible=!1})}makeStylerParams(t){const{id:e}=this,{marker:i,lineDash:s,lineDashOffset:n,stroke:a,strokeOpacity:r,strokeWidth:o,xKey:l,yKey:c}=this.properties,h=nr(t??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:h,lineDash:s,lineDashOffset:n,seriesId:e,stroke:a,strokeOpacity:r,strokeWidth:o,xKey:l,yKey:c}}makeItemStylerParams(t,e,i,s){const{xKey:n,yKey:a}=this.properties,r=t.resolveColumnById(this,"xValue",e)[i],o=t.resolveColumnById(this,"yValueRaw",e)[i],l=t.getDomain(this,"xValue","key",e).domain,c=t.getDomain(this,this.yCumulativeKey(e),"value",e).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...Hu(r,o,n,a,l,c),xValue:r,yValue:o,...s,fill:h}}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:r,xName:o,yKey:l,yName:c,tooltip:h,legendItemName:d}=a,u=a.allowNullKeys??!1,p=n[Qt.X],g=n[Qt.Y];if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.data?.[t],y=i.resolveColumnById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yValueRaw",s)[t];if(y===void 0&&!u)return;const x=this.getStyle(),v=this.makeItemStylerParams(i,s,t,x.marker),S=this.getMarkerStyle(this.properties.marker,{datumIndex:t,datum:f},v,{isHighlight:!1},x.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",y,f,r,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",m,f,l,d),missing:aa(m)}]},{seriesId:e,datum:f,title:c,xKey:r,xName:o,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:s,marker:n}=this.getStyle();return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:n.size,shape:n.shape,fill:n.fill,fillOpacity:n.fillOpacity,stroke:n.stroke,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:s}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,title:r,legendItemName:o,showInLegend:l}=this.properties;return[{legendType:t,id:e,itemId:n,legendItemName:o,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??r??a??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}updateLinePaths(t,e){const i=e.strokeData.spans,[s]=t;s.path.clear(),Xg(s,i),s.markDirty("LineSeries")}resetDatumAnimation(t){sd([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:a}=t,{animationManager:r}=this.ctx;this.updateLinePaths(a,n),rf(this,r,...a),at([e],Cl),nf(this,r,{...this.getAnimationDrawingModes(),phase:"initial"},e),Te(this,"labels",r,i),Te(this,"annotations",r,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:a,paths:r,previousContextData:o}=t,[l]=r;if(a.visible===!1&&o?.visible===!1)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateLinePaths(r,a)},h=()=>{e.skipCurrentBatch(),c()};if(a==null||o==null){c(),Al(this,e,"added",this.getAnimationDrawingModes(),i),As(this.id,"path_properties",e,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),Te(this,"labels",e,s),Te(this,"annotations",e,...n);return}if(a.crossFiltering!==o.crossFiltering){h();return}const d=yH(a,o,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){h();return}else if(d.status==="no-op")return;Oe(this.id,"path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(r,a):d.status==="removed"?this.updateLinePaths(r,o):cd(this.id,"path_update",e,[l],d.stroke.path),d.hasMotion&&(Al(this,e,void 0,this.getAnimationDrawingModes(),i),Te(this,"labels",e,s),Te(this,"annotations",e,...n)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(r,a)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new je}getStyle(t){const{styler:e,marker:i,lineDash:s,lineDashOffset:n,stroke:a,strokeOpacity:r,strokeWidth:o}=this.properties,{size:l,shape:c,fill:h="transparent",fillOpacity:d}=i;let u={};if(e){const p=this.makeStylerParams(t),g=this.cachedCallWithContext(e,p)??{};u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],g,{pick:!1})??{}}return u.marker??(u.marker={}),{lineDash:u.lineDash??s,lineDashOffset:u.lineDashOffset??n,stroke:u.stroke??a,strokeOpacity:u.strokeOpacity??r,strokeWidth:u.strokeWidth??o,marker:{fill:u.marker.fill??h,fillOpacity:u.marker.fillOpacity??d,shape:u.marker.shape??c,size:u.marker.size??l,lineDash:u.marker.lineDash??i.lineDash??s,lineDashOffset:u.marker.lineDashOffset??i.lineDashOffset??n,stroke:u.marker.stroke??i.stroke??a,strokeOpacity:u.marker.strokeOpacity??i.strokeOpacity??r,strokeWidth:u.marker.strokeWidth??i.strokeWidth??o}}}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,t.datumIndex,e.marker);return this.getMarkerStyle(this.properties.marker,t,i,{isHighlight:!0},void 0,e)}computeFocusBounds(t){return nd(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};sm.className="LineSeries",sm.type="line";var l$={series:{stroke:_Y,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",OY],["image",wY],["pattern",EY]]},stroke:{$palette:"stroke"}},label:{...RY,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:PY,segmentation:FY}},qA={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:fe,dependencies:[bi],options:Qo,predictAxis:pl,defaultAxes:{y:{type:HA.NUMBER,position:WA.LEFT},x:{type:HA.CATEGORY,position:WA.BOTTOM}},axisKeys:{[YA.X]:"xKeyAxis",[YA.Y]:"yKeyAxis"},themeTemplate:l$,create:t=>new sm(t)};import{CARTESIAN_AXIS_TYPE as JA,CARTESIAN_POSITION as QA,ChartAxisDirection as eC,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as c$,FILL_IMAGE_DEFAULTS as h$,FILL_PATTERN_DEFAULTS as d$,LABEL_BOXING_DEFAULTS as u$,MULTI_SERIES_HIGHLIGHT_STYLE as p$}from"ag-charts-core";var nm=class extends Ad{};nm.className="ScatterSeries",nm.type="scatter";var g$={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",c$],["image",h$],["pattern",d$]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...u$,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:p$}},tC={type:"series",name:"scatter",chartType:"cartesian",version:fe,dependencies:[bi],options:Ah,predictAxis:Og,defaultAxes:{x:{type:JA.NUMBER,position:QA.BOTTOM},y:{type:JA.NUMBER,position:QA.LEFT}},axisKeys:{[eC.X]:"xKeyAxis",[eC.Y]:"yKeyAxis"},themeTemplate:g$,create:t=>new nm(t)};import{ChartAxisDirection as f$,ChartUpdateType as m$,DebugMetrics as y$,Logger as b$,PolarZIndexMap as iC,extractDomain as x$,formatValue as v$,isGradientFill as sC,isStringFillArray as S$,jsonDiff as I$,mergeDefaults as D$,modulus as M$,normalizeAngle180 as A$,toPlainText as nC,toRadians as am,wrapTextOrSegments as C$}from"ag-charts-core";import{BaseProperties as aC,PropertiesArray as T$,Property as B}from"ag-charts-core";var rC=class extends ge{constructor(){super(...arguments),this.showInLegend=!1}};b([B],rC.prototype,"showInLegend",2);var rm=class extends ri{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};b([B],rm.prototype,"text",2),b([B],rm.prototype,"spacing",2);var om=class extends aC{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};b([B],om.prototype,"fill",2),b([B],om.prototype,"fillOpacity",2);var no=class extends ri{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([B],no.prototype,"offset",2),b([B],no.prototype,"minAngle",2),b([B],no.prototype,"minSpacing",2),b([B],no.prototype,"maxCollisionOffset",2),b([B],no.prototype,"avoidCollisions",2);var lm=class extends ri{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([B],lm.prototype,"positionOffset",2),b([B],lm.prototype,"positionRatio",2);var Pl=class extends aC{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([B],Pl.prototype,"colors",2),b([B],Pl.prototype,"length",2),b([B],Pl.prototype,"strokeWidth",2),b([B],Pl.prototype,"itemStyler",2);var Z=class extends wi{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Ee),this.strokes=Object.values(ks),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new T$(rm),this.title=new rC,this.innerCircle=new om,this.shadow=new bs,this.calloutLabel=new no,this.sectorLabel=new lm,this.calloutLine=new Pl,this.tooltip=wa()}};b([B],Z.prototype,"angleKey",2),b([B],Z.prototype,"angleName",2),b([B],Z.prototype,"angleFilterKey",2),b([B],Z.prototype,"radiusKey",2),b([B],Z.prototype,"radiusName",2),b([B],Z.prototype,"radiusMin",2),b([B],Z.prototype,"radiusMax",2),b([B],Z.prototype,"calloutLabelKey",2),b([B],Z.prototype,"calloutLabelName",2),b([B],Z.prototype,"sectorLabelKey",2),b([B],Z.prototype,"sectorLabelName",2),b([B],Z.prototype,"legendItemKey",2),b([B],Z.prototype,"defaultColorRange",2),b([B],Z.prototype,"defaultPatternFills",2),b([B],Z.prototype,"fills",2),b([B],Z.prototype,"strokes",2),b([B],Z.prototype,"fillOpacity",2),b([B],Z.prototype,"strokeOpacity",2),b([B],Z.prototype,"lineDash",2),b([B],Z.prototype,"lineDashOffset",2),b([B],Z.prototype,"cornerRadius",2),b([B],Z.prototype,"itemStyler",2),b([B],Z.prototype,"rotation",2),b([B],Z.prototype,"outerRadiusOffset",2),b([B],Z.prototype,"outerRadiusRatio",2),b([B],Z.prototype,"innerRadiusOffset",2),b([B],Z.prototype,"innerRadiusRatio",2),b([B],Z.prototype,"strokeWidth",2),b([B],Z.prototype,"sectorSpacing",2),b([B],Z.prototype,"hideZeroValueSectorsInLegend",2),b([B],Z.prototype,"innerLabels",2),b([B],Z.prototype,"title",2),b([B],Z.prototype,"innerCircle",2),b([B],Z.prototype,"shadow",2),b([B],Z.prototype,"calloutLabel",2),b([B],Z.prototype,"sectorLabel",2),b([B],Z.prototype,"calloutLine",2),b([B],Z.prototype,"tooltip",2);import{isBetweenAngles as L$,toRadians as N$}from"ag-charts-core";function cm(t,e,i,s){const n=[i.convert(0),i.convert(1)],a=[s.convert(0),s.convert(1)],r=Math.PI/-2+N$(e),o=t?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*g});return{nodes:{toFn:(g,f,y,{prevLive:m})=>{let{startAngle:x,endAngle:v,innerRadius:S,outerRadius:I}=f;const{stroke:M,fill:D}=f.sectorFormat;if(y==="removed"&&m?(x=m.datum?.endAngle,v=m.datum?.endAngle):y==="removed"&&!m&&(x=r,v=r),y==="removed"){const A=l(f);S=A.innerRadius,I=A.outerRadius}return{startAngle:x,endAngle:v,outerRadius:I,innerRadius:S,stroke:M,...typeof D=="string"?{fill:D}:{}}},fromFn:(g,f,y,{prevFromProps:m})=>{let{startAngle:x,endAngle:v,innerRadius:S,outerRadius:I}=g,{fill:M,stroke:D}=f.sectorFormat;if(y==="updated"&&g.previousDatum==null&&(y="added"),y==="unknown"||y==="added"&&!m?(x=r,v=r,S=f.innerRadius,I=f.outerRadius):y==="added"&&m&&(x=m.endAngle??r,v=m.endAngle??r,S=m.innerRadius??f.innerRadius,I=m.outerRadius??f.outerRadius),y==="added"&&!t){const A=c(f);S=A.innerRadius,I=A.outerRadius}return y==="updated"&&(M=g.fill??M,D=(typeof g.stroke=="string"?g.stroke:void 0)??D),{startAngle:x,endAngle:v,innerRadius:S,outerRadius:I,stroke:D,phase:o,...typeof M=="string"?{fill:M}:{}}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:o}),toFn:(g,f)=>({size:f.radius??0})}}}function k$(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function O$(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),a=t.getItemNodes();for(const r of a)if(r.datum.missing!==!0&&L$(n,r.startAngle,r.endAngle)){const o=Math.hypot(s,i);let l=0;return o<r.innerRadius?l=r.innerRadius-o:o>r.outerRadius&&(l=o-r.outerRadius),{datum:r.datum,distance:l}}}var w$=class extends $c{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Td=class extends hf{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{...sM,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...nM,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:k$,label:Oa}}),this.properties=new Z,this.phantomNodeData=void 0,this.backgroundGroup=new gt({name:`${this.id}-background`,zIndex:iC.BACKGROUND}),this.noVisibleData=!1,this.previousRadiusScale=new Na,this.radiusScale=new Na,this.phantomGroup=this.contentGroup.appendChild(new z({name:"phantom",zIndex:-1})),this.phantomSelection=we.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new z({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=we.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new z({name:"pieCalloutLabels"})),this.calloutLabelSelection=new we(this.calloutLabelGroup,z),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new z({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new je({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new je({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new z({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new z({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=we.select(this.innerLabelsGroup,Gt),this.innerCircleSelection=we.select(this.innerCircleGroup,()=>new je({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=w$,this.angleScale=new Na,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}setZIndex(t){super.setZIndex(t),this.backgroundGroup.zIndex=[iC.BACKGROUND,t]}nodeFactory(){const t=new Dt;return t.miterLimit=1e9,t}getSeriesDomain(t){return t===f$.Angle?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(t){if(this.data==null)return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:a,radiusKey:r,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(m,x)=>e&&s.getItemEnabled({seriesId:i,itemId:x})?m:0,d=!this.ctx.animationManager.isSkipped(),u=this.properties.allowNullKeys??!1,p=[],g=[];c?p.push(Js(c,"category",{id:"legendItemKey",allowNullKey:u})):o?p.push(Js(o,"category",{id:"calloutLabelKey",allowNullKey:u})):l&&p.push(Js(l,"category",{id:"sectorLabelKey",allowNullKey:u}));const f=this.radiusScale.type,y=this.angleScale.type;r&&g.push(tE(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),he(r,f,{id:"radiusRaw",processor:h}),Gu("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&g.push(he(o,"category",{id:"calloutLabelValue",allowNullKey:u})),l&&g.push(he(l,"category",{id:"sectorLabelValue",allowNullKey:u})),c&&g.push(he(c,"category",{id:"legendItemValue",allowNullKey:u})),a&&g.push(zu(a,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),he(a,y,{id:"angleFilterRaw"}),Gu("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(Sc(this.id,this.processedData)),g.push(Ao()),await this.requestDataModel(t,this.data,{props:[...p,zu(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),he(n,y,{id:"angleRaw"}),Gu("angleValue",[0,1],0,0),...g]});for(const m of this.processedData?.defs?.values??[]){const{id:x,missing:v,property:S}=m,I=Tb(this,v);x!=="angleRaw"&&I>0&&b$.warnOnce(`no value was found for the key '${String(S)}' on ${I} data element${I>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,t.length>0&&y$.record(`${this.type}:nodeData`,t.length),this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterValue",e),a=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterRaw",e),r=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:a,radiusValues:r,radiusRawValues:o,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:r,innerRadiusRatio:o}=this.properties;if(!i||e?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,e),{angleValues:c,angleRawValues:h,angleFilterValues:d,angleFilterRawValues:u,radiusValues:p,radiusRawValues:g,legendItemValues:f}=l,y=u?.some((D,C)=>D>h[C])??!1;let m=0,x=0;const v=[],S=u==null?void 0:[],I=e.dataSources.get(this.id)?.data??[],M=e.invalidData?.get(this.id);for(const[D,C]of I.entries()){if(M?.[D]===!0)continue;const A=y?d[D]:c[D],T=u!=null&&!y?Math.sqrt(u[D]/h[D]):1,L=s.convert(m)+am(r);m=A,x+=A;const N=s.convert(m)+am(r),O=Math.abs(N-L),E=L+O/2,k=h[D],F=(p?.[D]??1)*T,w=g?.[D],j=f?.[D],q=this.getLabels(D,C,E,O,l),J=this.getItemStyle({datum:C,datumIndex:D},!1),xe={series:this,datum:C,datumIndex:D,angleValue:k,midAngle:E,midCos:Math.cos(E),midSin:Math.sin(E),startAngle:L,endAngle:N,radius:F,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(F),0),sectorFormat:J,radiusValue:w,legendItemValue:j,enabled:a&&n.getItemEnabled({seriesId:t,itemId:D}),focusable:!0,...q};v.push(xe),S?.push({...xe,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=x===0,this.zerosumInnerRing.visible=x===0&&o!=null&&o!==1&&o>0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(t,e,i){const{id:s,ctx:n,properties:a}=this,{formatManager:r}=n,{calloutLabel:o,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:d}=a,u=a.allowNullKeys??!1,p=i.calloutLabelValues?.[t],g=i.sectorLabelValues?.[t],f=i.legendItemValues?.[t],y={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},m={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(m.callout=this.getLabelText(p,e,c,"calloutLabel",[],o,{...y,value:p},u)),h&&(m.sector=this.getLabelText(g,e,h,"sectorLabel",[],l,{...y,value:g},u)),d!=null&&(f!=null||u)){const x=f??"";m.legendItem=r.format(this.callWithContext.bind(this),{type:"category",value:u?f:x,datum:e,seriesId:s,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??x}return m}getLabels(t,e,i,s,n){const{properties:a}=this,{calloutLabel:r,sectorLabel:o,legendItemKey:l}=a,c=this.getLabelContent(t,e,n),h={};return r.enabled&&c.callout&&s>=am(r.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),o.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=A$(t),s=-.75*Math.PI,n=i-s,a=Math.floor(n/(Math.PI/2)),r=M$(a,e.length);return e[r]}getFillParams(t,e,i){if(!(!sC(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getItemStyle({datum:t,datumIndex:e},i,s,n){const{fills:a,strokes:r,itemStyler:o}=this.properties,l=r[e],c=a[e],{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:y,cornerRadius:m,opacity:x}=D$(this.getHighlightStyle(i,e,s,n),{fill:c,stroke:l},this.properties);let v;return o&&(v=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>{const S=this.makeItemStylerParams(t,e,i,{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:y,cornerRadius:m});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,S),{proxyPaths:{fill:["fills",`${e}`],stroke:["strokes",`${e}`]}})})),{fill:v?.fill??h,fillOpacity:v?.fillOpacity??d,stroke:v?.stroke??u,strokeWidth:v?.strokeWidth??p,strokeOpacity:v?.strokeOpacity??g,lineDash:v?.lineDash??f,lineDashOffset:v?.lineDashOffset??y,cornerRadius:v?.cornerRadius??m,opacity:x}}makeItemStylerParams(t,e,i,s){const{angleKey:n,radiusKey:a,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(s.fill)??s.fill;return{datum:t,angleKey:n,radiusKey:a,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:l,...s,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,e),seriesId:this.id}}getCalloutLineStyle(t,e){const{properties:i}=this;let s={};if(i.calloutLine.itemStyler){const n=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),e,t.datumIndex),a={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:t.datum,highlightState:n,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};s=this.cachedCallWithContext(i.calloutLine.itemStyler,a)??{}}return{length:s.length??i.calloutLine.length,strokeWidth:s.strokeWidth??i.calloutLine.strokeWidth,color:s.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,s=t*e+i;return s===t||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return Number.NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=I$(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=Number.isFinite(n)?n:0;const a=e.node.getBBox();e.node.visible=e.enabled&&Number.isFinite(n)&&!this.bboxIntersectsSurroundingSeries(a)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&t.node.remove(),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};for(const e of this.nodeData)t(e);if(this.phantomNodeData)for(const e of this.phantomNodeData)t(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:s,calloutLabelSelection:n,labelSelection:a,highlightLabelSelection:r,innerLabelsSelection:o}=this,l=this.nodeData.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),c=this.phantomNodeData?.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),h=(d,u)=>{d.update(u,void 0,p=>this.getDatumId(p.datumIndex)),this.ctx.animationManager.isSkipped()&&d.cleanup()};h(t,this.nodeData),h(e,l),h(i,this.phantomNodeData??[]),h(s,c??[]),n.update(this.calloutNodeData,d=>{const u=new ni;u.tag=0,u.pointerEvents=1,d.appendChild(u);const p=new Gt;p.tag=1,p.pointerEvents=1,d.appendChild(p)}),a.update(this.nodeData),r.update(l),o.update(this.properties.innerLabels,d=>{d.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),a=1;e=Math.ceil(n*2+a)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:a}=this.getProcessedDataValues(s,n),r=this.isSeriesHighlighted(e,a),o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&r,this.labelGroup.visible=i,this.innerCircleSelection.each((p,{radius:g})=>{p.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:g})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),d=this.ctx.animationManager.isSkipped(),u=(p,g,f,y,m)=>{const x=this.getItemStyle(g,y,void 0,a);g.sectorFormat.fill=x.fill,g.sectorFormat.stroke=x.stroke,d&&(p.startAngle=g.startAngle,p.endAngle=g.endAngle,p.innerRadius=g.innerRadius,p.outerRadius=g.outerRadius),(y||d)&&(p.fill=x.fill,p.stroke=x.stroke);const v=this.getFillParams(x.fill,l,c);p.setStyleProperties(x,h,v),p.drawingMode=m,p.cornerRadius=x.cornerRadius,p.fillShadow=this.properties.shadow;const S=Math.max((this.properties.sectorSpacing+(x.stroke==null?0:x.strokeWidth))/2,0);p.inset=S,p.lineJoin=this.properties.sectorSpacing>=0||S>0?"miter":"round"};this.itemSelection.each((p,g,f)=>u(p,g,f,!1,"overlay")),this.phantomSelection.each((p,g,f)=>u(p,g,f,!1,"overlay")),this.highlightSelection.each((p,g,f)=>{u(p,g,f,!0,o),p.visible=g.datumIndex===e?.datumIndex}),this.phantomHighlightSelection.each((p,g,f)=>{u(p,g,f,!0,o),p.visible=g.datumIndex===e?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:t}=this.properties,{offset:e}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i);for(const n of this.calloutLabelSelection.selectByTag(0)){const a=n.closestDatum(),r=s&&this.isItemHighlighted(i,a.datumIndex)===!0,{length:o,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(a,!1),d=l,u=S$(h)?h:t,{calloutLabel:p,outerRadius:g,datumIndex:f}=a;if(p?.text&&!p.hidden&&g!==0){n.visible=!0,n.strokeWidth=d,n.stroke=c??u[f%u.length],n.strokeOpacity=this.getHighlightStyle(r,a.datumIndex).opacity??1,n.fill=void 0;const y=a.midCos*g,m=a.midSin*g;let x=a.midCos*(g+o),v=a.midSin*(g+o);if((p.collisionTextAlign??p.collisionOffsetY!==0)&&p.box!=null){const I=p.box;let M=x,D=v;x<I.x?M=I.x:x>I.x+I.width&&(M=I.x+I.width),v<I.y?D=I.y:v>I.y+I.height&&(D=I.y+I.height);const C=M-x,A=D-v,T=Math.sqrt(Math.pow(C,2)+Math.pow(A,2)),L=T-e;L>0&&(x=x+C*L/T,v=v+A*L/T)}n.x1=y,n.y1=m,n.x2=x,n.y2=v}else n.visible=!1}}getLabelOverflow(t,e){const i=-this.centerX,s=i+e.width,n=-this.centerY,a=n+e.height,r=1;let o=t.width;t.x+r<i?o=(t.x+t.width-i)/t.width:t.x+t.width-r>s&&(o=(s-t.x)/t.width);const l=t.y+r<n||t.y+t.height-r>a,c=this.bboxIntersectsSurroundingSeries(t);return{maxWidth:o,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e}=this.properties,{offset:i,minSpacing:s}=e,n=t.convert(0),a=y=>!y.calloutLabel||y.outerRadius===0,r=this.calloutNodeData,o=r.filter(y=>!a(y));for(const y of o){const m=y.calloutLabel;m!=null&&(m.hidden=!1,m.collisionTextAlign=void 0,m.collisionOffsetY=0)}if(o.length<=1)return;const l=o.filter(y=>y.midCos<0).sort((y,m)=>y.midSin-m.midSin),c=o.filter(y=>y.midCos>=0).sort((y,m)=>y.midSin-m.midSin),h=o.filter(y=>y.midSin<0&&y.calloutLabel?.textAlign==="center").sort((y,m)=>y.midCos-m.midCos),d=o.filter(y=>y.midSin>=0&&y.calloutLabel?.textAlign==="center").sort((y,m)=>y.midCos-m.midCos),u=y=>{const m=y.calloutLabel;if(m==null)return R.zero.clone();const x=this.getLabelStyle(y,e,"calloutLabel"),v=rr(x),S=this.getCalloutLineStyle(y,!1).length,I=y.outerRadius+S+i,M=y.midCos*I,D=y.midSin*I+m.collisionOffsetY,C=m.collisionTextAlign??m.textAlign,A=m.textBaseline;return Gt.measureBBox(m.text,M,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:A}).grow(v)},p=(y,m,x)=>{const v=u(y).grow(s/2),S=u(m).grow(s/2);v.x<S.x+S.width&&v.x+v.width>S.x&&(x==="to-top"?v.y<S.y+S.height:v.y+v.height>S.y)&&(m.calloutLabel.collisionOffsetY=x==="to-top"?v.y-S.y-S.height:v.y+v.height-S.y)},g=y=>{const m=y.slice().sort((v,S)=>Math.abs(v.midSin)-Math.abs(S.midSin))[0],x=y.indexOf(m);for(let v=x-1;v>=0;v--){const S=y[v+1],I=y[v];p(S,I,"to-top")}for(let v=x+1;v<y.length;v++){const S=y[v-1],I=y[v];p(S,I,"to-bottom")}},f=y=>{const m=o.some(D=>D.calloutLabel.collisionOffsetY!==0),x=y.map(D=>u(D)),v=x.map(D=>D.clone().grow(s/2));let S=!1;for(let D=0;D<v.length&&!S;D++){const C=v[D];for(let A=D+1;A<y.length;A++){const T=v[A];if(C.collidesBBox(T)){S=!0;break}}}const I=r.map(D=>{const{startAngle:C,endAngle:A,outerRadius:T}=D;return{startAngle:C,endAngle:A,innerRadius:n,outerRadius:T}}),M=x.some(D=>I.some(C=>jH(D,C)));if(!(!S&&!m&&!M))for(const D of y){if(D.calloutLabel.textAlign!=="center")continue;const C=D.calloutLabel;D.midCos<0?C.collisionTextAlign="right":D.midCos>0?C.collisionTextAlign="left":C.collisionTextAlign="center"}};g(l),g(c),f(h),f(d)}getLabelStyle(t,e,i,s=!1){const n=this.ctx.highlightManager?.getActiveHighlight();return ka(this,t,this.properties,e,s,n,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i}=this.properties,s=new Gt,n=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(n);for(const r of this.calloutLabelSelection.selectByTag(1)){const o=r.closestDatum(),l=o.calloutLabel,c=e.convert(o.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){r.visible=!1;continue}const d=a&&this.isItemHighlighted(n,o.datumIndex)===!0,u=this.getLabelStyle(o,i,"calloutLabel",d),p=this.getCalloutLineStyle(o,!1).length,g=h+p+i.offset,f=o.midCos*g,y=o.midSin*g+l.collisionOffsetY,m={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};s.text=l.text,s.x=f,s.y=y,s.setFont(u),s.setAlign(m),s.setBoxing(u);const x=s.getBBox();let v=l.text,S=!0;if(i.avoidCollisions){const{maxWidth:I,hasVerticalOverflow:M}=this.getLabelOverflow(x,t);if(x.width>I){const D={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:I};v=C$(l.text,D)}S=!M}r.text=v,r.x=f,r.y=y,r.setFont(u),r.setAlign(m),r.setBoxing(u),r.fill=u.color,r.fillOpacity=this.getHighlightStyle(d,o.datumIndex).opacity??1,r.visible=S}}computeLabelsBBox(t,e){const{calloutLabel:i}=this.properties,{offset:s,maxCollisionOffset:n,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const r=[],o=new Gt;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(o.text=c.text,o.x=0,o.y=h,o.setFont(c),o.setAlign({textBaseline:"bottom",textAlign:"center"}),l=o.getBBox(),r.push(l))}for(const h of this.calloutNodeData){const d=h.calloutLabel;if(!d||h.outerRadius===0)continue;const u=this.getLabelStyle(h,i,"calloutLabel"),p=this.getCalloutLineStyle(h,!1).length,g=h.outerRadius+p+s,f=h.midCos*g,y=h.midSin*g+d.collisionOffsetY;o.text=d.text,o.x=f,o.y=y,o.setFont(u),o.setAlign({textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline}),o.setBoxing(u);const m=o.getBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>n){d.hidden=!0;continue}if(l){const x=-this.centerY,v=new R(l.x-a,x,l.width+2*a,l.y+l.height+a-x);if(m.collidesBBox(v)){d.hidden=!0;continue}}if(t.hideWhenNecessary){const{maxWidth:x,hasVerticalOverflow:v,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(m,e),I=m.width>x;if(v||I||S){d.hidden=!0;continue}}d.hidden=!1,r.push(m)}return r.length===0?null:R.merge(r)}updateSectorLabelNodes(){const{properties:t}=this,{positionOffset:e,positionRatio:i}=this.properties.sectorLabel,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(s),a=this.radiusScale.convert(0),r=a<=0&&this.ctx.legendManager.getData(this.id)?.filter(c=>c.enabled).length===1,o={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,d)=>{const{outerRadius:u,startAngle:p,endAngle:g}=d,f=n&&this.isItemHighlighted(s,d.datumIndex)===!0;let y=!1;if(d.sectorLabel&&u!==0){const m=this.getLabelStyle(d,t.sectorLabel,"sectorLabel",f),x=a*(1-i)+u*i+e;h.fill=m.color,h.fillOpacity=this.getHighlightStyle(f,d.datumIndex).opacity??1,h.text=d.sectorLabel.text,r?(h.x=0,h.y=0):(h.x=d.midCos*x,h.y=d.midSin*x),h.setFont(m),h.setAlign(o),h.setBoxing(m);const v=h.getBBox(),S=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],I={startAngle:p,endAngle:g,innerRadius:a,outerRadius:u};S.every(([M,D])=>mf(M,D,I))&&(y=!0)}h.visible=y});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:y}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=d.text,h.x=0,h.y=0,h.fill=y,h.textAlign="center",t.push(h.getBBox()),e.push(d.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,d)=>Math.max(h,d.width),0),a=t.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),r=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(a/2,2))<=(r>0?r:this.getOuterRadius()),c=[];for(let h=0,d=-a/2;h<t.length;h++){const p=t[h].height+d+i(h);c.push(p),d=p+s(h)}this.innerLabelsSelection.each((h,d,u)=>{h.visible=l,Array.isArray(h.text)?h.y=c[u]-t[u].height:h.y=c[u]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return O$(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n,ctx:{formatManager:a}}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:g,tooltip:f}=n,y=this.properties.title.node.getPlainText();if(!i||!s)return;const m=s.dataSources.get(this.id)?.data?.[t],x=this.getProcessedDataValues(i,s),{angleRawValues:v}=x,S=v[t],I=this.getLabelContent(t,m,x),M=I.legendItem??I.callout??I.sector??u,D=x$(i.getDomain(this,"angleRaw","value",s)),C=a.format(this.callWithContext.bind(this),{type:"number",value:S,datum:m,seriesId:e,legendItemName:void 0,key:d,source:"tooltip",property:"angle",domain:D,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??v$(S,3);return this.formatTooltipWithContext(f,{title:y,symbol:this.legendItemSymbol(t),data:[{label:nC(M),fallbackLabel:d,value:C}]},{seriesId:e,datum:m,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:g,...this.getItemStyle({datum:m,datumIndex:t},!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.data?.[t],i=this.getItemStyle({datum:e,datumIndex:t},!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:o}=this.properties;let{fill:l}=i;const{stroke:c}=i;return sC(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:o}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:a}}=this;if(!s||!i||t!=="category")return[];const{angleKey:r,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!o||o===r)&&(!l||l===r))return[];const d=this.getProcessedDataValues(s,i),{angleRawValues:u}=d,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],f=this.properties.hideZeroValueSectorsInLegend,y=i.dataSources.get(this.id)?.data,m=i.invalidData?.get(this.id);for(let x=0;x<i.input.count;x++){const v=y?.[x],S=u[x];if(m?.[x]===!0||f&&S===0)continue;const I=[];p&&I.push(p);const M=this.getLabelContent(x,v,d);c&&M.legendItem!==void 0?I.push(M.legendItem):o&&o!==r&&M.callout!==void 0?I.push(M.callout):l&&l!==r&&M.sector!==void 0&&I.push(M.sector),I.length!==0&&g.push({legendType:"category",id:n,datum:v,itemId:x,seriesId:n,hideToggleOtherSeries:!0,enabled:e&&a.getItemEnabled({seriesId:n,itemId:x}),label:{text:I.map(D=>nC(D)).join(" - ")},symbol:this.legendItemSymbol(x),legendItemName:c==null?void 0:v[c],hideInLegend:!h})}return g}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;for(const[n,a]of t.entries())i.toggleItem(a,e,n);i.update(),s.update(m$.SERIES_UPDATE)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=cm(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Oe(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Oe(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Te(this,"callout",e,this.calloutLabelSelection),Te(this,"sector",e,this.labelSelection,this.highlightLabelSelection),Te(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:s,processedData:n,radiusScale:a,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,l=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,h=(n?.defs.keys.length??0)>0,d=n?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!h||!d)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(g=>g.enabled),p=cm(!1,this.properties.rotation,a,r);Oe(this.id,"nodes",o,[t,e,i,s],p.nodes,(g,f)=>this.getDatumId(f.datumIndex),l),Oe(this.id,"innerCircle",o,[this.innerCircleSelection],p.innerCircle),Te(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Te(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,Te(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:r}=this.ctx,o=cm(!1,this.properties.rotation,n,a);Oe(this.id,"nodes",r,[t,e,i,s],o.nodes,(l,c)=>this.getDatumId(c.datumIndex)),Oe(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),Yh(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Yh(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),Yh(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return`${t}`;const{calloutLabelKey:s,sectorLabelKey:n,legendItemKey:a}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${t}`;if(a){const r=e.resolveKeysById(this,"legendItemKey",i);return ft(r[t])}else if(s){const r=e.resolveKeysById(this,"calloutLabelKey",i);return ft(r[t])}else if(n){const r=e.resolveKeysById(this,"sectorLabelKey",i);return ft(r[t])}return`${t}`}hasItemStylers(){return!(this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(t=>t.itemStyler==null))}};Td.className="DonutSeries",Td.type="donut";import{LABEL_BOXING_DEFAULTS as E$,PART_WHOLE_HIGHLIGHT_STYLE as R$}from"ag-charts-core";import{DEFAULT_SHADOW_COLOUR as P$,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS as _$,FILL_IMAGE_DEFAULTS as F$,FILL_PATTERN_DEFAULTS as V$,FONT_SIZE_RATIO as B$,LABEL_BOXING_DEFAULTS as oC,PART_WHOLE_HIGHLIGHT_STYLE as z$}from"ag-charts-core";var hm={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:B$.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...oC,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...oC,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",_$],["pattern",V$],["image",F$]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:P$,xOffset:3,yOffset:3,blur:5},highlight:z$},legend:{enabled:!0}},G$={...hm,series:{...hm.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...E$,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:R$}},lC={type:"series",name:"donut",chartType:"polar",version:fe,dependencies:[yd],options:O0,themeTemplate:G$,create:t=>new Td(t)},dm=class extends Td{};dm.className="PieSeries",dm.type="pie";var cC={type:"series",name:"pie",chartType:"polar",version:fe,dependencies:[yd],options:cs,themeTemplate:hm,create:t=>new dm(t)};import{callbackOf as j$,object as U$,string as H$}from"ag-charts-core";import{AbstractModuleInstance as W$,ObserveChanges as hC,Property as dC}from"ag-charts-core";var um=class extends W${constructor(t){super(),this.ctx=t,this.localeText=void 0}};b([hC(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),dC],um.prototype,"localeText",2),b([hC(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),dC],um.prototype,"getLocaleText",2);var pm={type:"plugin",name:"locale",version:fe,options:{localeText:U$,getLocaleText:j$(H$)},create:t=>new um(t)};import"ag-charts-core";var uC={type:"axis",name:"number",chartType:"cartesian",version:fe,dependencies:[bi],options:Ir,themeTemplate:{line:{enabled:!1}},create:t=>new mi(t)};import"ag-charts-core";var pC={type:"axis",name:"log",chartType:"cartesian",version:fe,dependencies:[bi],options:Dr,themeTemplate:{base:10,line:{enabled:!1}},create:t=>new eo(t)};import"ag-charts-core";var gC={type:"axis",name:"time",chartType:"cartesian",version:fe,dependencies:[bi],options:Mr,themeTemplate:{gridLine:{enabled:!1}},create:t=>new ys(t)};import"ag-charts-core";var fC={type:"axis",name:"category",chartType:"cartesian",version:fe,dependencies:[bi],options:vr,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:t=>new fl(t)};import"ag-charts-core";var mC={type:"axis",name:"grouped-category",chartType:"cartesian",version:fe,dependencies:[bi],options:Sr,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:t=>new yl(t)};import"ag-charts-core";import{Property as ao,dateTruncationForDomain as Y$,intervalEpoch as yC,intervalFloor as $$,intervalStep as bC,intervalUnit as xC,lowestGranularityUnitForTicks as K$,lowestGranularityUnitForValue as Z$,normalisedTimeExtentWithMetadata as X$,objectsEqual as q$}from"ag-charts-core";var js=class extends uM{constructor(t){super(t,new nn,!1),this.parentLevel=new jr,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&t<e}isCategoryLike(){return!0}processData(){super.processData();let t;const{domain:e}=this.dataDomain;if(e.length===2&&e[0].valueOf()===e[1].valueOf())t=Z$(e[0]);else{const{boundSeries:i,direction:s,min:n,max:a}=this;t=lD(i,s,n,a)}q$(this.defaultUnit,t)||(this.defaultUnit=t)}updateScale(){super.updateScale(),this.scale.interval=this.unit??this.defaultUnit}normaliseDataDomain(t){const{extent:e,clipped:i}=X$(t,this.min,this.max,this.preferredMin,this.preferredMax);return{domain:e,clipped:i}}tickFormatParams(t,e,i,s){s??(s=K$(e));const n=Y$(t),a=xC(s),r=bC(s),o=yC(s);return{type:"date",unit:a,step:r,epoch:o,truncateDate:n}}datumFormatParams(t,e,i,s,n){const a=this.unit??this.defaultUnit??"millisecond";s??(s=a);const{datum:r,seriesId:o,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}=e,g=xC(s),f=bC(s),y=yC(s);return{type:"date",value:$$(a,t),datum:r,seriesId:o,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p,unit:g,step:f,epoch:y,style:n}}};js.className="UnitTimeAxis",js.type="unit-time",b([ao],js.prototype,"parentLevel",2),b([ao],js.prototype,"min",2),b([ao],js.prototype,"max",2),b([ao],js.prototype,"preferredMin",2),b([ao],js.prototype,"preferredMax",2),b([ao],js.prototype,"unit",2);var vC={type:"axis",name:"unit-time",chartType:"cartesian",version:fe,dependencies:[bi],options:Ar,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:!1},parentLevel:{enabled:!0},interval:{placement:"between"}},create:t=>new js(t)};import"ag-charts-core";var SC=[uC,pC,gC,fC,mC,vC],IC=[xA,TA,FA,UA,qA,tC],DC=[SC,IC,zf,pm].flat(),MC=[yd,lC,cC,zf,pm],AC=[DC,MC,KM].flat();import{ModuleRegistry as gm}from"ag-charts-core";var fm={};Pn(fm,{Arc:()=>xs,BBox:()=>R,Caption:()=>ge,CategoryScale:()=>or,Group:()=>z,Line:()=>ni,LinearScale:()=>Na,Marker:()=>je,Path:()=>Be,RadialColumnShape:()=>Zi,Rect:()=>ze,Scene:()=>uc,Sector:()=>Dt,Shape:()=>zn,TranslatableGroup:()=>gt,getRadialColumnWidth:()=>MM,toRadians:()=>J$});import{toRadians as J$}from"ag-charts-core";var Ld={};Pn(Ld,{ChartTheme:()=>Vi,getChartTheme:()=>Bh,resolveOperation:()=>PK,themeNames:()=>RK,themeSymbols:()=>EK,themes:()=>Mg});import{DEFAULT_ANNOTATION_HANDLE_FILL as Q$,DEFAULT_ANNOTATION_STATISTICS_COLOR as eK,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE as tK,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL as iK,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE as sK,DEFAULT_ANNOTATION_STATISTICS_FILL as nK,DEFAULT_ANNOTATION_STATISTICS_STROKE as aK,DEFAULT_CAPTION_ALIGNMENT as rK,DEFAULT_CAPTION_LAYOUT_STYLE as oK,DEFAULT_FIBONACCI_STROKES as lK,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as cK,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as hK,DEFAULT_POLAR_SERIES_STROKE as dK,DEFAULT_SHADOW_COLOUR as uK,DEFAULT_SPARKLINE_CROSSHAIR_STROKE as pK,DEFAULT_TEXTBOX_COLOR as gK,DEFAULT_TEXTBOX_FILL as fK,DEFAULT_TEXTBOX_STROKE as mK,DEFAULT_TEXT_ANNOTATION_COLOR as yK,DEFAULT_TOOLBAR_POSITION as bK,IS_DARK_THEME as xK,PALETTE_ALT_DOWN_FILL as vK,PALETTE_ALT_DOWN_STROKE as SK,PALETTE_ALT_NEUTRAL_FILL as IK,PALETTE_ALT_NEUTRAL_STROKE as DK,PALETTE_ALT_UP_FILL as MK,PALETTE_ALT_UP_STROKE as AK,PALETTE_DOWN_FILL as CK,PALETTE_DOWN_STROKE as TK,PALETTE_NEUTRAL_FILL as LK,PALETTE_NEUTRAL_STROKE as NK,PALETTE_UP_FILL as kK,PALETTE_UP_STROKE as OK}from"ag-charts-core";$C(Ld,wK);import*as wK from"ag-charts-core";var EK={DEFAULT_ANNOTATION_HANDLE_FILL:Q$,DEFAULT_ANNOTATION_STATISTICS_COLOR:eK,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:tK,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:iK,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:sK,DEFAULT_ANNOTATION_STATISTICS_FILL:nK,DEFAULT_ANNOTATION_STATISTICS_STROKE:aK,DEFAULT_CAPTION_ALIGNMENT:rK,DEFAULT_CAPTION_LAYOUT_STYLE:oK,DEFAULT_FIBONACCI_STROKES:lK,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:cK,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:hK,DEFAULT_POLAR_SERIES_STROKE:dK,DEFAULT_SHADOW_COLOUR:uK,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:pK,DEFAULT_TEXTBOX_COLOR:gK,DEFAULT_TEXTBOX_FILL:fK,DEFAULT_TEXTBOX_STROKE:mK,DEFAULT_TEXT_ANNOTATION_COLOR:yK,DEFAULT_TOOLBAR_POSITION:bK,IS_DARK_THEME:xK,PALETTE_ALT_DOWN_FILL:vK,PALETTE_ALT_DOWN_STROKE:SK,PALETTE_ALT_NEUTRAL_FILL:IK,PALETTE_ALT_NEUTRAL_STROKE:DK,PALETTE_ALT_UP_FILL:MK,PALETTE_ALT_UP_STROKE:AK,PALETTE_DOWN_FILL:CK,PALETTE_DOWN_STROKE:TK,PALETTE_NEUTRAL_FILL:LK,PALETTE_NEUTRAL_STROKE:NK,PALETTE_UP_FILL:kK,PALETTE_UP_STROKE:OK},RK=Object.keys(Mg);function PK(t){const e=Vi.getDefaultPublicParameters(),i=Vi.getDefaultColors();return new BI({line:{operation:t}},{series:[{type:"line"}]},e,i).resolve().operation}var mm={};Pn(mm,{Color:()=>_K,interpolateColor:()=>gb});import{Color as _K}from"ag-charts-core";var FK={VERSION:fe,_Scene:fm,_Theme:Ld,_Util:mm,create:vn.create.bind(vn),createSparkline:vn.__createSparkline.bind(vn),setup:()=>{gm.setRegistryMode(gm.RegistryMode.Integrated),gm.registerModules(AC)},isEnterprise:!1};export{Am as AG_CHARTS_LOCALE_EN_US,vn as AgCharts,FK as AgChartsCommunityModule,Cm as AgTooltipAnchorToType,Tm as AgTooltipPlacementType,SC as AllCartesianAxesModule,DC as AllCartesianModule,IC as AllCartesianSeriesModule,AC as AllCommunityModule,MC as AllPolarModule,xA as AreaSeriesModule,TA as BarSeriesModule,FA as BubbleSeriesModule,bi as CartesianChartModule,fC as CategoryAxisModule,lC as DonutSeriesModule,mC as GroupedCategoryAxisModule,UA as HistogramSeriesModule,zf as LegendModule,qA as LineSeriesModule,pm as LocaleModule,pC as LogAxisModule,fj as ModuleRegistry,uC as NumberAxisModule,cC as PieSeriesModule,yd as PolarChartModule,tC as ScatterSeriesModule,KM as SparklinePresetModule,gC as TimeAxisModule,vC as UnitTimeAxisModule,fe as VERSION,UI as _ModuleSupport,fm as _Scene,Ld as _Theme,mm as _Util,VM as _Widget,sT as time};