Files
sigpro-grid/node_modules/ag-charts-enterprise/dist/umd/ag-charts-enterprise.min.js
2026-03-17 08:44:54 +01:00

35 lines
1.9 MiB
Executable File

(function(jp,ho){typeof exports=="object"&&typeof module=="object"?module.exports=ho():typeof define=="function"&&define.amd?define("agCharts",[],ho):typeof exports=="object"?exports.agCharts=ho():jp.agCharts=ho()})(this,()=>{var jp={},ho={exports:jp};if(typeof mne>"u")var mne=function(t){throw new Error("Unknown module: "+t)};var zm=Object.defineProperty,gL=Object.getOwnPropertyDescriptor,w_=Object.getOwnPropertyNames,L_=Object.prototype.hasOwnProperty,Ws=(e,t)=>{for(var i in t)zm(e,i,{get:t[i],enumerable:!0})},N_=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of w_(t))!L_.call(e,n)&&n!==i&&zm(e,n,{get:()=>t[n],enumerable:!(s=gL(t,n))||s.enumerable});return e},T_=e=>N_(zm({},"__esModule",{value:!0}),e),g=(e,t,i,s)=>{for(var n=s>1?void 0:s?gL(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(n=(s?o(t,i,n):o(n))||n);return s&&n&&zm(t,i,n),n},fL={};Ws(fL,{AG_CHARTS_LOCALE_EN_US:()=>HN,AgCharts:()=>Da,AgChartsCommunityModule:()=>j5,AgChartsEnterpriseModule:()=>gne,AgTooltipAnchorToType:()=>AL,AgTooltipPlacementType:()=>CL,AllCartesianAxesModule:()=>FV,AllCartesianModule:()=>iB,AllCartesianSeriesModule:()=>tB,AllCommunityModule:()=>UI,AllEnterpriseModule:()=>Jw,AllGaugeModule:()=>GB,AllMapSeriesModule:()=>qF,AllPolarModule:()=>DF,AngleCategoryAxisModule:()=>UB,AngleNumberAxisModule:()=>YB,AnimationModule:()=>Uf,AnnotationsModule:()=>UA,AreaSeriesModule:()=>DI,BandHighlightModule:()=>YA,BarSeriesModule:()=>_b,BoxPlotSeriesModule:()=>oC,BubbleSeriesModule:()=>NI,CandlestickSeriesModule:()=>jv,CartesianChartModule:()=>ri,CategoryAxisModule:()=>aE,ChartToolbarModule:()=>Vv,ChordSeriesModule:()=>yE,ConeFunnelSeriesModule:()=>ZV,ContextMenuModule:()=>am,CrosshairModule:()=>QA,DataSourceModule:()=>Bv,DonutSeriesModule:()=>iE,ErrorBarsModule:()=>JA,FinancialChartModule:()=>cB,FlashOnUpdateModule:()=>dz,FunnelSeriesModule:()=>eB,GradientLegendModule:()=>cS,GroupedCategoryAxisModule:()=>oE,HeatmapSeriesModule:()=>fC,HistogramSeriesModule:()=>OI,LegendModule:()=>vI,LicenseManager:()=>pne,LineSeriesModule:()=>$b,LinearGaugeModule:()=>LB,LocaleModule:()=>WI,LogAxisModule:()=>nE,MapLineBackgroundSeriesModule:()=>LF,MapLineSeriesModule:()=>RF,MapMarkerSeriesModule:()=>jF,MapShapeBackgroundSeriesModule:()=>$F,MapShapeSeriesModule:()=>XF,ModuleRegistry:()=>fe,NavigatorModule:()=>BC,NightingaleSeriesModule:()=>cF,NumberAxisModule:()=>$I,OhlcSeriesModule:()=>Wv,OrdinalTimeAxisModule:()=>tw,PieSeriesModule:()=>sE,PolarChartModule:()=>Wr,PyramidSeriesModule:()=>IE,RadarAreaSeriesModule:()=>gF,RadarLineSeriesModule:()=>fF,RadialBarSeriesModule:()=>SF,RadialColumnSeriesModule:()=>MF,RadialGaugeModule:()=>HB,RadiusCategoryAxisModule:()=>eF,RadiusNumberAxisModule:()=>tF,RangeAreaSeriesModule:()=>Zv,RangeBarSeriesModule:()=>Xv,RangesModule:()=>HC,SankeySeriesModule:()=>TE,ScatterSeriesModule:()=>zI,ScrollbarModule:()=>bV,SparklinePresetModule:()=>jP,StatusBarModule:()=>$C,SunburstSeriesModule:()=>BE,SyncModule:()=>YC,TimeAxisModule:()=>KI,TreemapSeriesModule:()=>jE,UnitTimeAxisModule:()=>rE,VERSION:()=>ue,WaterfallSeriesModule:()=>VC,ZoomModule:()=>Ep,_ModuleSupport:()=>N,_Scene:()=>Ub,_Theme:()=>Yb,_Util:()=>Zb,_Widget:()=>Bf,time:()=>PG}),ho.exports=T_(fL);var mL={};Ws(mL,{AGGREGATION_INDEX_UNSET:()=>Dl,AGGREGATION_INDEX_X_MAX:()=>Zs,AGGREGATION_INDEX_X_MIN:()=>Ys,AGGREGATION_INDEX_Y_MAX:()=>qs,AGGREGATION_INDEX_Y_MIN:()=>Xs,AGGREGATION_MAX_POINTS:()=>HL,AGGREGATION_MIN_RANGE:()=>br,AGGREGATION_SPAN:()=>Vn,AGGREGATION_THRESHOLD:()=>bo,AbstractModuleInstance:()=>hi,ActionOnSet:()=>_e,AdjacencyListGraph:()=>uM,AsyncAwaitQueue:()=>Lg,BASE_FONT_SIZE:()=>Va,BREAK_TRANSFORM_CHAIN:()=>dg,BaseProperties:()=>X,Border:()=>Mr,CANVAS_HEIGHT:()=>qL,CANVAS_TO_BUFFER_DEFAULTS:()=>QL,CANVAS_WIDTH:()=>XL,CARTESIAN_AXIS_TYPE:()=>R0,CARTESIAN_POSITION:()=>E0,CallbackCache:()=>eM,ChangeDetectableProperties:()=>Zc,ChartAxisDirection:()=>Sg,ChartUpdateType:()=>xr,CleanupRegistry:()=>pt,Color:()=>Oe,ConfiguredCanvasMixin:()=>JL,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Od,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>Rd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>zd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Vd,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Bd,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Pd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Ed,DEFAULT_CAPTION_ALIGNMENT:()=>Sr,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Do,DEFAULT_FIBONACCI_STROKES:()=>Td,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>rs,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ls,DEFAULT_POLAR_SERIES_STROKE:()=>kg,DEFAULT_SHADOW_COLOUR:()=>Mo,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Ig,DEFAULT_TEXTBOX_COLOR:()=>Hd,DEFAULT_TEXTBOX_FILL:()=>Fd,DEFAULT_TEXTBOX_STROKE:()=>_d,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Ag,DEFAULT_TOOLBAR_POSITION:()=>Gd,DIRECTION_SWAP_AXES:()=>Ld,Debug:()=>be,DebugMetrics:()=>ha,DeclaredSceneChangeDetection:()=>Ee,DeclaredSceneObjectChangeDetection:()=>du,Deprecated:()=>sN,DeprecatedAndRenamedTo:()=>nN,EllipsisChar:()=>pd,ErrorType:()=>l0,EventEmitter:()=>Pn,FILL_GRADIENT_BLANK_DEFAULTS:()=>G0,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>W0,FILL_GRADIENT_LINEAR_DEFAULTS:()=>Vi,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>j0,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>fy,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>gy,FILL_GRADIENT_RADIAL_DEFAULTS:()=>vg,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Ba,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>yy,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>my,FILL_IMAGE_BLANK_DEFAULTS:()=>U0,FILL_IMAGE_DEFAULTS:()=>it,FILL_PATTERN_BLANK_DEFAULTS:()=>$0,FILL_PATTERN_DEFAULTS:()=>tt,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>K0,FILL_PATTERN_KEYED_DEFAULTS:()=>by,FILL_PATTERN_SINGLE_DEFAULTS:()=>xy,FONT_SIZE:()=>P0,FONT_SIZE_RATIO:()=>ki,IS_DARK_THEME:()=>Il,InterpolationProperties:()=>Ml,LABEL_BOXING_DEFAULTS:()=>Ye,LEGEND_CONTAINER_THEME:()=>My,LRUCache:()=>Wp,LineSplitter:()=>sr,Logger:()=>K,MARKER_SERIES_HIGHLIGHT_STYLE:()=>Nd,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Us,MementoCaretaker:()=>Dy,ModuleRegistry:()=>fe,ModuleType:()=>VS,ObserveChanges:()=>Xt,PALETTE_ALT_DOWN_FILL:()=>Ey,PALETTE_ALT_DOWN_STROKE:()=>Oy,PALETTE_ALT_NEUTRAL_FILL:()=>Ry,PALETTE_ALT_NEUTRAL_STROKE:()=>zy,PALETTE_ALT_UP_FILL:()=>Py,PALETTE_ALT_UP_STROKE:()=>Ty,PALETTE_DOWN_FILL:()=>wy,PALETTE_DOWN_STROKE:()=>Ay,PALETTE_NEUTRAL_FILL:()=>Ny,PALETTE_NEUTRAL_STROKE:()=>Ly,PALETTE_UP_FILL:()=>Cy,PALETTE_UP_STROKE:()=>Iy,PART_WHOLE_HIGHLIGHT_STYLE:()=>vy,POLAR_AXIS_SHAPE:()=>V0,POLAR_AXIS_TYPE:()=>z0,PREV_NEXT_KEYS:()=>Ud,Padding:()=>Cr,ParallelStateMachine:()=>wM,PolarZIndexMap:()=>q0,PropertiesArray:()=>Bi,Property:()=>m,ProxyOnWrite:()=>YL,ProxyProperty:()=>Gt,ProxyPropertyOnWrite:()=>Dt,SAFE_FILLS_OPERATION:()=>H0,SAFE_FILL_OPERATION:()=>_0,SAFE_RANGE2_OPERATION:()=>yo,SAFE_STROKE_FILL_OPERATION:()=>yr,SEGMENTATION_DEFAULTS:()=>vl,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>Sy,SKIP_JS_BUILTINS:()=>hy,ScaleAlignment:()=>BS,SceneArrayChangeDetection:()=>hu,SceneChangeDetection:()=>$,SceneObjectChangeDetection:()=>Or,SceneRefChangeDetection:()=>Kg,SeriesContentZIndexMap:()=>X0,SeriesZIndexMap:()=>Z0,SimpleCache:()=>iN,SpanJoin:()=>YM,StateMachine:()=>de,StateMachineProperty:()=>Je,TRIPLE_EQ:()=>qc,TextMeasurer:()=>sx,TickIntervals:()=>_g,TrimCharsRegex:()=>QS,TrimEdgeGuard:()=>gd,UNIT_MAX:()=>Yi,UNIT_MIN:()=>ba,UnknownError:()=>Jp,ValidationError:()=>go,Vec2:()=>H,Vec4:()=>ve,Vertex:()=>pM,WeakCache:()=>lM,ZIndexMap:()=>Y0,addEscapeEventListener:()=>Xy,addFakeTransformToInstanceProperty:()=>m,addMouseCloseListener:()=>yM,addObserverToInstanceProperty:()=>oy,addOverrideFocusVisibleEventListener:()=>bM,addTouchCloseListener:()=>xM,addTransformToInstanceProperty:()=>gr,aggregationBucketForDatum:()=>GL,aggregationDatumMatchesIndex:()=>jL,aggregationDomain:()=>oi,aggregationIndexForXRatio:()=>Mg,aggregationRangeFittingPoints:()=>vo,aggregationXRatioForDatumIndex:()=>_c,aggregationXRatioForXValue:()=>Bn,and:()=>Fe,angleBetween:()=>_a,angularPadding:()=>Hy,appendEllipsis:()=>jm,applySkiaPatches:()=>tN,arcDistanceSquared:()=>aN,areScalingEqual:()=>Ka,array:()=>pn,arrayLength:()=>rr,arrayOf:()=>me,arrayOfDefs:()=>Ft,arraysEqual:()=>En,assignIfNotStrictlyEqual:()=>uy,attachDescription:()=>ze,attachListener:()=>st,autoSizedLabelOptionsDefs:()=>pr,barHighlightOptionsDef:()=>pa,bezier2DDistance:()=>WM,bezier2DExtrema:()=>GM,boolean:()=>R,borderOptionsDef:()=>cr,boxCollides:()=>jy,boxContains:()=>Ng,boxEmpty:()=>oM,boxesEqual:()=>Tg,buildDateFormatter:()=>Xc,cachedTextMeasurer:()=>et,calcLineHeight:()=>Rn,calculatePlacement:()=>ix,callWithContext:()=>ls,callback:()=>ot,callbackDefs:()=>Xe,callbackOf:()=>Di,ceilTo:()=>p0,checkDatum:()=>FM,circularSliceArray:()=>ca,clamp:()=>ae,clampArray:()=>Bc,clipLines:()=>TM,clipSpanX:()=>vx,collapseSpanToPoint:()=>UM,collectAggregationLevels:()=>WL,color:()=>te,colorStopsOrderValidator:()=>Jm,colorUnion:()=>ws,commonChartOptionsDefs:()=>ke,commonSeriesOptionsDefs:()=>qe,commonSeriesThemeableOptionsDefs:()=>Ke,compactAggregationIndices:()=>kl,compareDates:()=>$y,computeExtremesAggregation:()=>vr,computeExtremesAggregationPartial:()=>Dg,constant:()=>Ae,contextMenuItemsArray:()=>cg,countFractionDigits:()=>Pc,countLines:()=>a0,createAggregationIndices:()=>So,createButton:()=>cu,createCanvasContext:()=>rM,createCheckbox:()=>JM,createDeprecationWarning:()=>Yy,createElement:()=>ye,createElementId:()=>Ir,createIcon:()=>iD,createId:()=>Ii,createIdsGenerator:()=>jg,createNumberFormatter:()=>qm,createSelect:()=>eD,createSvgElement:()=>jt,createTextArea:()=>tD,createTicks:()=>Wc,date:()=>ns,dateToNumber:()=>Ui,dateTruncationForDomain:()=>Gg,datesSortOrder:()=>Uy,debounce:()=>qp,decodeIntervalValue:()=>zM,deepClone:()=>Te,deepFreeze:()=>Ks,defaultEpoch:()=>ux,defined:()=>ce,definedZoomState:()=>Rt,diffArrays:()=>cM,distribute:()=>GS,downloadUrl:()=>NM,dropFirstWhile:()=>_S,dropLastWhile:()=>HS,durationDay:()=>Pl,durationHour:()=>Ol,durationMinute:()=>wr,durationMonth:()=>ox,durationSecond:()=>jc,durationWeek:()=>OM,durationYear:()=>Jd,easeIn:()=>RN,easeInOut:()=>zN,easeInOutQuad:()=>FN,easeInQuad:()=>VN,easeOut:()=>Tr,easeOutQuad:()=>BN,encodedToTimestamp:()=>Lr,enterpriseRegistry:()=>zi,entries:()=>rt,errorBarOptionsDefs:()=>Cd,errorBarThemeableOptionsDefs:()=>Ad,estimateTickCount:()=>fx,evaluateBezier:()=>$a,every:()=>L0,expandLegendPosition:()=>Sl,extent:()=>Ga,extractDecoratedProperties:()=>C0,extractDomain:()=>rd,fillGradientDefaults:()=>ng,fillImageDefaults:()=>og,fillOptionsDef:()=>se,fillPatternDefaults:()=>ag,findMaxIndex:()=>Dr,findMaxValue:()=>Wy,findMinIndex:()=>Hc,findMinMax:()=>Tt,findMinValue:()=>ZL,findRangeExtent:()=>xo,first:()=>$s,flush:()=>XS,focusCursorAtEnd:()=>Vy,fontFamilyFull:()=>rg,fontOptionsDef:()=>$e,fontWeight:()=>kd,formatNumber:()=>dM,formatObjectValidator:()=>k0,formatPercent:()=>hM,formatValue:()=>ya,fromPairs:()=>N0,generateUUID:()=>Yd,geoJson:()=>Ll,getAngleRatioRadians:()=>nM,getAttribute:()=>wl,getDOMMatrix:()=>Vm,getDocument:()=>dn,getElementBBox:()=>tM,getIconClassNames:()=>Al,getImage:()=>$S,getLastFocus:()=>ex,getMaxInnerRectSize:()=>Fy,getMidpointsForIndices:()=>Fa,getMinOuterRectSize:()=>KL,getOffscreenCanvas:()=>Kp,getPath:()=>cy,getPath2D:()=>Tc,getResizeObserver:()=>Bm,getSequentialColors:()=>mn,getTickTimeInterval:()=>au,getWindow:()=>Re,googleFont:()=>ty,gradientColorStops:()=>ig,gradientStrict:()=>sg,greaterThan:()=>os,groupBy:()=>cd,guardTextEdges:()=>i0,hasNoModifiers:()=>Kd,hasRequiredInPath:()=>xl,highlightOptionsDef:()=>ey,htmlElement:()=>Ym,inRange:()=>d0,initRovingTabIndex:()=>Qy,insertListItemsSorted:()=>tx,instanceOf:()=>TL,interpolationOptionsDefs:()=>hg,intervalCeil:()=>PM,intervalEpoch:()=>El,intervalExtent:()=>hx,intervalFloor:()=>en,intervalHierarchy:()=>nu,intervalMilliseconds:()=>cs,intervalNext:()=>cx,intervalPrevious:()=>EM,intervalRange:()=>Gn,intervalRangeCount:()=>Fg,intervalRangeNumeric:()=>RM,intervalRangeStartIndex:()=>dx,intervalStep:()=>ja,intervalUnit:()=>xa,inverseEaseOut:()=>nD,isArray:()=>De,isBetweenAngles:()=>Qs,isBoolean:()=>JS,isButtonClickEvent:()=>Jy,isColor:()=>t0,isContinuous:()=>Uc,isDate:()=>Cs,isDecoratedObject:()=>pg,isDefined:()=>Mt,isDenseInterval:()=>Rl,isDocumentFragment:()=>KS,isElement:()=>Fm,isEmptyObject:()=>md,isEnumKey:()=>wL,isEnumValue:()=>LL,isFiniteNumber:()=>Be,isFunction:()=>Pa,isGradientFill:()=>Qt,isGradientFillArray:()=>kN,isGradientOrPatternFill:()=>IN,isHTMLElement:()=>hd,isHtmlElement:()=>Hm,isImageFill:()=>Wa,isInputPending:()=>iM,isInteger:()=>u0,isKeyOf:()=>ml,isNegative:()=>Oc,isNode:()=>Up,isNumber:()=>gt,isNumberEqual:()=>He,isNumberObject:()=>BM,isObject:()=>ge,isObjectLike:()=>fd,isObjectWithProperty:()=>T0,isObjectWithStringProperty:()=>O0,isPatternFill:()=>jn,isPlainObject:()=>We,isPointLabelDatum:()=>$M,isProperties:()=>Vc,isRegExp:()=>e0,isScaleValid:()=>zl,isSegmentTruncated:()=>Xp,isString:()=>Bt,isStringFillArray:()=>HM,isStringObject:()=>mx,isSymbol:()=>yd,isTextTruncated:()=>nr,isTruncated:()=>n0,isUnitTimeCategoryScaling:()=>Nr,isValidDate:()=>fl,isValidNumberFormat:()=>f0,iterate:()=>mr,joinFormatted:()=>ar,jsonApply:()=>$d,jsonDiff:()=>Hn,jsonPropertyCompare:()=>fM,jsonWalk:()=>ko,kebabCase:()=>r0,labelBoxOptionsDef:()=>zn,legendPositionValidator:()=>Id,lessThan:()=>as,lessThanOrEqual:()=>h0,levenshteinDistance:()=>o0,lineDashOptionsDef:()=>oe,lineDistanceSquared:()=>kr,lineHighlightOptionsDef:()=>lr,lineSegmentOptions:()=>x0,lineSegmentation:()=>b0,linear:()=>sD,linearGaugeSeriesOptionsDef:()=>mo,linearGaugeSeriesThemeableOptionsDef:()=>xg,linearGaugeTargetOptionsDef:()=>mg,linearPoints:()=>ZM,listDecoratedProperties:()=>fr,lowestGranularityForInterval:()=>ou,lowestGranularityUnitForTicks:()=>Hg,lowestGranularityUnitForValue:()=>ru,makeAccessibleClickListener:()=>uN,mapValues:()=>Ec,markerOptionsDefs:()=>ga,markerStyleOptionsDefs:()=>ur,measureTextSegments:()=>Js,memo:()=>Zd,merge:()=>wd,mergeArrayDefaults:()=>ly,mergeDefaults:()=>re,modulus:()=>g0,multiSeriesHighlightOptionsDef:()=>_t,nearestSquared:()=>Xd,nearestSquaredInContainer:()=>DM,nextPowerOf2:()=>Fc,niceTicksDomain:()=>gx,normalisedExtentWithMetadata:()=>Gc,normalisedTimeExtentWithMetadata:()=>Pg,normalizeAngle180:()=>wg,normalizeAngle360:()=>Qe,normalizeAngle360FromDegrees:()=>Ha,normalizeAngle360Inclusive:()=>Wd,number:()=>W,numberFormatValidator:()=>fn,numberMin:()=>Xm,numberRange:()=>c0,object:()=>or,objectsEqual:()=>Ht,objectsEqualWith:()=>ry,optionsDefs:()=>Et,or:()=>Se,padding:()=>bl,paddingOptions:()=>v0,parseNumberFormat:()=>tg,partialAssign:()=>fg,pause:()=>Gy,pick:()=>gg,placeLabels:()=>KM,positiveNumber:()=>P,positiveNumberNonZero:()=>gn,previousPowerOf2:()=>ky,radialGaugeSeriesOptionsDef:()=>Rc,radialGaugeSeriesThemeableOptionsDef:()=>bg,radialGaugeTargetOptionsDef:()=>yg,range:()=>Kc,rangeValidator:()=>lg,ratio:()=>ne,readIntegratedWrappedValue:()=>yx,record:()=>ZS,required:()=>j,rescaleSpan:()=>Yc,rescaleVisibleRange:()=>Rg,resetIds:()=>gN,rotatePoint:()=>_y,roundTo:()=>Sd,safeCall:()=>$m,seriesLabelOptionsDefs:()=>ft,seriesTooltipRangeValidator:()=>M0,setAttribute:()=>Pe,setAttributes:()=>ma,setDocument:()=>jS,setElementBBox:()=>jd,setElementStyle:()=>_n,setElementStyles:()=>aM,setPath:()=>dy,setWindow:()=>WS,shadowOptionsDefs:()=>Ra,shallowClone:()=>Nl,shapeHighlightOptionsDef:()=>Ct,shapeSegmentOptions:()=>y0,shapeSegmentation:()=>fo,shapeValidator:()=>hr,simpleMemorize:()=>Ki,simpleMemorize2:()=>Ar,smoothPoints:()=>qM,solveBezier:()=>$g,sortAndUniqueDates:()=>Ky,sortBasedOnArray:()=>FS,spanRange:()=>tn,splitBezier2D:()=>lu,stepPoints:()=>XM,stopPageScrolling:()=>vM,strictObjectKeys:()=>za,strictUnion:()=>eg,string:()=>L,stringLength:()=>Zm,stringifyValue:()=>xd,strokeOptionsDef:()=>q,textOrSegments:()=>$i,themeOperator:()=>Dd,throttle:()=>Wm,tickFormat:()=>px,tickStep:()=>$c,toArray:()=>ld,toDegrees:()=>sM,toFontString:()=>Gm,toIterable:()=>w0,toPlainText:()=>Ne,toRadians:()=>lt,toTextString:()=>At,toolbarButtonOptionsDefs:()=>dr,tooltipOptionsDefs:()=>Ue,tooltipOptionsDefsWithArea:()=>I0,transformIntegratedCategoryValue:()=>Wg,truncateLine:()=>Tl,typeUnion:()=>yl,undocumented:()=>Q,unguardTextEdges:()=>s0,union:()=>U,unionSymbol:()=>bd,unique:()=>$p,validate:()=>Mi,withTimeout:()=>UL,without:()=>J,wrapLines:()=>Qd,wrapText:()=>Io,wrapTextOrSegments:()=>qd,wrapTextSegments:()=>ax});var VS=(e=>(e.Chart="chart",e.Axis="axis",e.Series="series",e.Plugin="plugin",e.AxisPlugin="axis:plugin",e.SeriesPlugin="series:plugin",e.Preset="preset",e))(VS||{});function rd(e){return e.domain}var BS=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(BS||{}),Pn=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),i.size===0&&this.events.delete(e))}emit(e,t){const i=this.events.get(e);if(i)for(const s of i)s(t)}clear(e){e?this.events.delete(e):this.events.clear()}},Wp=class{constructor(e){if(this.maxCacheSize=e,this.store=new Map,e<=0)throw new Error("LRUCache size must be greater than 0")}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this.store.size>this.maxCacheSize&&this.store.delete(this.store.keys().next().value),t}clear(){this.store.clear()}},be={};Ws(be,{Time:()=>B_,check:()=>dd,create:()=>ML,inDevelopmentMode:()=>DL});function ld(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function $p(e){return Array.from(new Set(e))}function cd(e,t){return e.reduce((i,s)=>{const n=t(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function En(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!En(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function ca(e,t,i=0){if(e.length===0)return[];const s=[];for(let n=0;n<t;n++)s.push(e.at((n+i)%e.length));return s}function FS(e,t){const i=new Map;for(const[s,n]of t.entries())i.set(n,s);return e.sort((s,n)=>{const a=i.get(s)??1/0,o=i.get(n)??1/0;return a-o})}function _S(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const s=i;s!==0&&e.splice(0,s)}function HS(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const s=e.length-1-i;s!==0&&e.splice(e.length-s,s)}function GS(e,t,i){const s=[e],n=Math.round((t-e)/(i-1));if(n>0)for(let a=e+n;a<t&&!(s.push(a)>=i-1);a+=n);return s.push(t),s}var hn={};typeof globalThis.window<"u"&&(hn.window=globalThis.window),typeof document<"u"?hn.document=document:typeof globalThis.global<"u"&&(hn.document=globalThis.document);function dn(e){return e?hn.document?.[e]:hn.document}function Re(e){return e?hn.window?.[e]:hn.window}function jS(e){hn.document=e}function WS(e){hn.window=e}function Kp(){return hn.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function Tc(){return hn.window?.Path2D??globalThis.Path2D}function Vm(){return hn.window?.DOMMatrix??globalThis.DOMMatrix}function $S(){return hn.window?.Image??globalThis.Image}function Bm(){return hn.window?.ResizeObserver??globalThis.ResizeObserver}var yL=1,O_=11;function Up(e){return e!=null&&typeof e.nodeType=="number"}function Fm(e){return e!=null&&e.nodeType===yL}function KS(e){return e!=null&&e.nodeType===O_}function hd(e){return e!=null&&e.nodeType===yL&&"style"in e}var K={};Ws(K,{error:()=>xL,errorOnce:()=>E_,log:()=>_m,logGroup:()=>vL,reset:()=>R_,table:()=>P_,warn:()=>uo,warnOnce:()=>un});var US=new Set;function _m(...e){console.log(...e)}function uo(e,...t){console.warn(`AG Charts - ${e}`,...t)}function xL(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function P_(...e){console.table(...e)}function bL(e,t,i){let s;e instanceof Error?s=e.message:typeof e=="string"?s=e:typeof e=="object"?s=JSON.stringify(e):s=String(e);const n=`${t}: ${s}`;US.has(n)||(i(e),US.add(n))}function un(e,...t){bL(e,"Logger.warn",i=>uo(i,...t))}function E_(e,...t){bL(e,"Logger.error",i=>xL(i,...t))}function R_(){US.clear()}function vL(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var z_=2e3,SL=Date.now();function V_(){const e=Date.now()-SL;if(e>z_){const t=(Math.floor(e/100)/10).toFixed(1);_m(`**** ${t}s since last log message ****`)}SL=Date.now()}function ML(...e){return Object.assign((...i)=>{dd(...e)&&(typeof i[0]=="function"&&(i=ld(i[0]())),V_(),_m(...i))},{check:()=>dd(...e),group:(i,s)=>dd(...e)?vL(i,s):s()})}function dd(...e){return e.length===0&&e.push(!0),ld(Re("agChartsDebug")).some(i=>e.includes(i))}function DL(e){if(dd("dev"))return e()}function B_(e,t={}){const{logResult:i=!0,logStack:s=!1,logArgs:n=!1,logData:a}=t;return function(o,r,l){const c=l.value;l.value=function(...h){const d=performance.now(),u=c.apply(this,h),f={duration:performance.now()-d};return i&&(f.result=u),n&&(f.args=h),s&&(f.stack=new Error("Stack trace for timing debug").stack),a&&(f.logData=a(this)),_m(e,f),u}}}var ha={};Ws(ha,{flush:()=>XS,record:()=>ZS});var YS=new Map;function ZS(e,t){dd("scene:stats:verbose")&&YS.set(e,t)}function XS(){const e=Object.fromEntries(YS);return YS.clear(),e}var zi={},fe={};Ws(fe,{RegistryMode:()=>kL,getAxisModule:()=>W_,getChartModule:()=>$_,getPresetModule:()=>K_,getSeriesModule:()=>U_,hasModule:()=>H_,isEnterprise:()=>Z_,isIntegrated:()=>X_,isModuleType:()=>ud,isUmd:()=>q_,listModules:()=>G_,listModulesByType:()=>j_,register:()=>qS,registerModules:()=>F_,reset:()=>__,setRegistryMode:()=>Y_});var kL=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))(kL||{}),Yp=new Set,po=new Map;function IL(e){if(po.set(e.name,e),e.dependencies)for(const t of e.dependencies)qS(t)}function qS(e){const t=po.get(e.name);if(!t){IL(e);return}if(t.version===e.version){!t.enterprise&&e.enterprise&&IL(e);return}throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${t.version} vs ${e.version}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(`
`))}function F_(e){for(const t of e.flat())qS(t)}function __(){Yp.clear(),po.clear()}function H_(e){return po.has(e)}function*G_(){for(const e of po.values())yield e}function*j_(e){for(const t of po.values())ud(e,t)&&(yield t)}function W_(e){const t=po.get(e);if(ud("axis",t))return t}function $_(e){const t=po.get(e);if(ud("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function K_(e){const t=po.get(e);if(ud("preset",t))return t}function U_(e){const t=po.get(e);if(ud("series",t))return t}function Y_(e){Yp.add(e)}function Z_(){return Yp.has("enterprise")}function X_(){return Yp.has("integrated")}function q_(){return Yp.has("umd")}function ud(e,t){return t?.type===e}var pt=class{constructor(){this.callbacks=new Set}flush(){for(const e of this.callbacks)e();this.callbacks.clear()}merge(e){for(const t of e.callbacks)this.callbacks.add(t)}register(...e){for(const t of e)t&&this.callbacks.add(t)}},hi=class{constructor(){this.cleanup=new pt}destroy(){this.cleanup.flush()}},Q_=void 0,J_=void 0;J_=Q_;var eH=void 0,tH=void 0;tH=eH;var AL=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(AL||{}),CL=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(CL||{}),iH=void 0,sH=void 0;sH=iH;var nH=void 0,aH=void 0;aH=nH;var pd="\u2026",sr=/\r?\n/g,gd="\u200B",QS=/[\s.,;:-]{1,5}$/,Zp;function oH(e){if(Zp==null){const i=Re("Option");Zp=new i().style}Zp.color=e;const t=Zp.color||null;return Zp.color="",t}function Mt(e){return e!=null}function De(e){return Array.isArray(e)}function JS(e){return typeof e=="boolean"}function Cs(e){return e instanceof Date}function fl(e){return Cs(e)&&!Number.isNaN(Number(e))}function e0(e){return e instanceof RegExp}function Pa(e){return typeof e=="function"}function ge(e){return typeof e=="object"&&e!==null&&!De(e)}function fd(e){return De(e)||We(e)}function We(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function md(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function Bt(e){return typeof e=="string"}function gt(e){return typeof e=="number"}function Be(e){return Number.isFinite(e)}function Hm(e){return e!=null&&e.nodeType===1&&"style"in e}function wL(e,t){return Bt(t)&&Object.keys(e).includes(t)}function LL(e,t){return Object.values(e).includes(t)}function yd(e){return typeof e=="symbol"}function t0(e){return Bt(e)&&(e==="none"||oH(e)!=null)}function ml(e,t){return e in t}function Gm({fontSize:e,fontStyle:t,fontWeight:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i} `),n+=`${e}px`,n+=` ${s}`,n}function Rn(e,t=1.15){return Math.round(e*t)}function At(e){return String(e??"")}function jm(e){return e.replace(QS,"")+pd}function i0(e){return gd+e+gd}function s0(e){return e.replaceAll(gd,"")}function n0(e){return De(e)?Xp(e.at(-1)):nr(At(e))}function nr(e){return e.endsWith(pd)}function Xp(e){return At(e?.text).endsWith(pd)}function ar(e,t="and",i=String,s=1/0){if(e.length===0)return"";if(e.length===1)return i(e[0]);e=e.map(i);const n=e.pop();if(e.length>=s){const a=e.length-(s-1);return`${e.slice(0,s-1).join(", ")}, and ${a} more ${t} ${n}`}return`${e.join(", ")} ${t} ${n}`}function xd(e,t=1/0){if(typeof e=="number"){if(Number.isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function a0(e){let t=1;for(let i=0;i<e.length;i++)e.codePointAt(i)===10&&t++;return t}function o0(e,t){if(e===t)return 0;const[i,s]=e.length<t.length?[e,t]:[t,e],n=i.length,a=s.length;let o=new Array(n+1).fill(0).map((l,c)=>c),r=new Array(n+1);for(let l=1;l<=a;l++){r[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;r[c]=Math.min(o[c]+1,r[c-1]+1,o[c-1]+h)}[o,r]=[r,o]}return o[n]}function r0(e){return e.replaceAll(rH,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var rH=/[A-Z]+(?![a-z])|[A-Z]/g;function Ne(e,t=""){return e==null?t:De(e)?e.map(i=>At(i.text)).join(""):Bt(e)?e:String(e)}function qp(e,t=0,i){const{leading:s=!1,trailing:n=!0,maxWait:a=1/0}=i??{};let o,r;if(a<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!r){r=Date.now(),o=setTimeout(()=>r=null,t),e(...c);return}let h=t;if(a!==1/0&&r){const d=Date.now()-r;t>a-d&&(h=a-d)}clearTimeout(o),r??(r=Date.now()),o=setTimeout(()=>{r=null,n&&e(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(o),r=null}})}function Wm(e,t,i){const{leading:s=!0,trailing:n=!0}=i??{};let a,o,r=!1;function l(){n&&o?(a=setTimeout(l,t),e(...o)):r=!1,o=null}function c(...h){r?o=h:(r=!0,a=setTimeout(l,t),s?e(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(a),r=!1,o=null}})}function $m(e,t,i=""){try{return e(...t)}catch(s){const n=i?` \`${i}\``:"";un(`Uncaught exception in user callback${n}`,s)}}var da=Symbol("description"),NL=Symbol("required"),Km=Symbol("marked"),Um=Symbol("undocumented"),bd=Symbol("union"),lH=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(s=>s!==i)));return e},new Map),l0=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(l0||{});function Qp(e,t){return Be(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var go=class{constructor(e,t,i,s,n){this.type=e,this.description=t,this.value=i,this.path=s,this.key=n}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?Qp(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:i}=this;return t==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${xd(i,50)}\`; expecting ${e}, ignoring.`}},Jp=class extends go{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${Qp(this.altPath??this.path,this.key)}\``}getPostfix(){const e=ar(cH(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function Mi(e,t,i=""){if(!ge(e))return{cleared:null,invalid:[new go("required","an object",e,i)]};const s={},n=[],a=new Set(Object.keys(e)),o=[];if(bd in t){const r=Object.keys(t),l=t[bd];if(e.type!=null&&r.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,d=Mi(h,t[c],i);Object.assign(s,{type:c},d.cleared);for(const u of d.invalid)u.setUnionType(c,i);n.push(...d.invalid)}else{const c=ar(r,"or",h=>`'${h}'`);n.push(new go("required",`a keyword such as ${c}`,e.type,i,"type"))}return{cleared:s,invalid:n}}for(const r of Object.keys(t)){const l=t[r],c=l[NL],h=e[r];if(a.delete(r),h===void 0&&(l[Um]||o.push(r),!c))continue;const d=Qp(i,r);if(Pa(l)){const p=l(h,{options:e,path:d});if(typeof p=="object"){if(n.push(...p.invalid),p.valid){s[r]=p.cleared;continue}else if(xl(p.invalid,d))continue}else if(p){s[r]=h;continue}n.push(new go(c?"required":"invalid",l[da],h,i,r))}else{const u=Mi(h,l,d);u.cleared!=null&&(s[r]=u.cleared),n.push(...u.invalid)}}for(const r of a){const l=e[r];l!==void 0&&n.push(new Jp(o,l,i,r))}return{cleared:s,invalid:n}}function cH(e,t,i=2){const s=e.toLowerCase(),n=lH.get(s);return t.filter(a=>{const o=a.toLowerCase();return n?.has(a)===!0||o.includes(s)||o0(s,o)<=i})}function ze(e,t){if(Pa(e)){let s=function(n,a){return e(n,a)};var i=s;return s[da]=t,s}else return{...e,[da]:t}}function j(e){return Object.assign(Pa(e)?(t,i)=>e(t,i):Et(e),{[NL]:!0,[da]:e[da]})}function Q(e){return Object.assign(Pa(e)?(t,i)=>e(t,i):Et(e),{[Um]:!0,[da]:e[da]})}var Et=(e,t="an object",i=!1)=>ze((s,n)=>{const a=Mi(s,e,n.path),o=!xl(a.invalid,n.path);return{valid:o,cleared:o||!i?a.cleared:null,invalid:a.invalid}},t),yl=(e,t,i)=>({...e,[da]:t,[bd]:i}),Fe=(...e)=>ze((t,i)=>{const s=[];for(const n of e){const a=n(t,i);if(typeof a=="object"){if(s.push(...a.invalid),!a.valid)return{valid:!1,cleared:t,invalid:s};t=a.cleared}else if(!a)return!1}return{valid:!0,cleared:t,invalid:s}},ar(e.filter(t=>!t[Um]).map(t=>t[da]).filter(Mt),"and")),Se=(...e)=>ze((t,i)=>{for(const s of e){const n=s(t,i);if(typeof n=="object"?n.valid:n)return n}return!1},ar(e.filter(t=>!t[Um]).map(t=>t[da]).filter(Mt),"or")),vd=e=>Be(e)||fl(e),hH=e=>Cs(e)||(Be(e)||Bt(e))&&fl(new Date(e)),pn=ze(De,"an array"),R=ze(JS,"a boolean"),ot=ze(Pa,"a function"),te=ze(t0,"a color string"),ns=ze(hH,"a date"),ce=ze(Mt,"a defined value"),W=ze(Be,"a number"),or=ze(ge,"an object"),L=ze(Bt,"a string"),Ym=ze(Hm,"an html element"),rr=(e,t=1/0)=>{let i;return t===1/0?i=`an array of at least ${e} items`:e===t?i=`an array of exactly ${e} items`:e===0?i=`an array of no more than ${t} items`:i=`an array of at least ${e} and no more than ${t} items`,ze(s=>De(s)&&s.length>=e&&s.length<=t,i)},Zm=(e,t=1/0)=>{let i;return t===1/0?i=`a string of at least ${e} characters`:e===t?i=`an string of exactly ${e} characters`:e===0?i=`an string of no more than ${t} characters`:i=`an string of at least ${e} and no more than ${t} characters`,ze(s=>Bt(s)&&s.length>=e&&s.length<=t,i)},Xm=(e,t=!0)=>ze(i=>Be(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),c0=(e,t)=>ze(i=>Be(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),P=Xm(0),gn=Xm(0,!1),ne=c0(0,1),as=e=>ze((t,{options:i})=>!vd(t)||!vd(i[e])||t<i[e],`the value to be less than \`${e}\``),h0=e=>ze((t,{options:i})=>!vd(t)||!vd(i[e])||t<=i[e],`the value to be less than or equal to \`${e}\``),os=e=>ze((t,{options:i})=>!vd(t)||!vd(i[e])||t>i[e],`the value to be greater than \`${e}\``);function U(...e){ge(e[0])&&(e=Object.values(e[0]));const t=ar(e,"or",i=>`'${i}'`);return ze(i=>e.includes(i),`a keyword such as ${t}`)}function eg(){return U}var Ae=e=>ze(t=>e===t,`the value ${JSON.stringify(e)}`),TL=(e,t)=>ze(i=>i instanceof e,t??`an instance of ${e.name}`),me=(e,t,i=!0)=>ze((s,n)=>{if(!De(s))return!1;let a=i;const o=[],r=[],l=c=>{a=i?a&&c:a||c};if(s.length===0)return{valid:!0,cleared:o,invalid:r};for(let c=0;c<s.length;c++){const h=s[c],d=e(h,{options:h,path:`${n.path}[${c}]`});typeof d=="object"?(l(d.valid),r.push(...d.invalid),d.cleared!=null&&o.push(d.cleared)):(l(d),d&&o.push(h))}return{valid:a,cleared:a||!i?o:null,invalid:r}},t??`${e[da]} array`),Ft=(e,t="an object array")=>ze((i,s)=>{if(!De(i))return!1;const n=[],a=[];for(let o=0;o<i.length;o++){const r=`${s.path}[${o}]`,l=Mi(i[o],e,r);xl(l.invalid,r)||n.push(l.cleared),a.push(...l.invalid)}return{valid:!0,cleared:n,invalid:a}},t),Di=(e,t)=>ze((i,s)=>{if(!Pa(i))return!1;if(Km in i)return!0;const n=t??e[da];return{valid:!0,cleared:Object.assign((...o)=>{const r=$m(i,o);if(r==null)return;const l=e(r,{options:r,path:""});if(typeof l=="object"){if(OL(l,s,n,r),l.valid)return l.cleared}else{if(l)return r;un(`Callback \`${s.path}\` returned an invalid value \`${xd(r,50)}\`; expecting ${n}, ignoring.`)}},{[Km]:!0}),invalid:[]}},"a function"),Xe=(e,t="an object")=>ze((i,s)=>{if(!Pa(i))return!1;if(Km in i)return!0;const n=t;return{valid:!0,cleared:Object.assign((...o)=>{const r=$m(i,o,s.path);if(r==null)return;const l=Mi(r,e);return OL(l,s,n,r),l.cleared},{[Km]:!0}),invalid:[]}},"a function");function xl(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function OL(e,t,i,s){if(e.invalid.length!==0){if(De(s)){const n=i??e.invalid[0]?.description??"a valid value";return un(`Callback \`${t.path}\` returned an invalid value \`${xd(s,50)}\`; expecting ${n}, ignoring.`)}for(const n of e.invalid){if(n instanceof Jp)return un(`Callback \`${t.path}\` returned an unknown property \`${Qp(n.path,n.key)}\`${n.getPostfix()}`);const a=xd(n.value,50);un(n.key?`Callback \`${t.path}\` returned an invalid property \`${Qp(n.path,n.key)}\`: \`${a}\`; expecting ${n.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${a}\`; expecting ${i??n.description}, ignoring.`)}}}function ae(e,t,i){return Math.min(i,Math.max(e,t))}function d0(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function He(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function Oc(e){return Math.sign(e)===-1||Object.is(e,-0)}function u0(e){return e%1===0}function Sd(e,t=2){const i=10**t;return Math.round(e*i)/i}function p0(e,t=2){const i=10**t;return Math.ceil(e*i)/i}function g0(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function Pc(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let n;[t,n]=t.split("e"),n!=null&&(i=Number(n))}const s=t.split(".")[1]?.length??0;return Math.max(s-i,0)}var PL=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,EL=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function f0(e){if(!Bt(e))return!1;const t=EL.exec(e);return PL.test(t?t[2]:e)}function tg(e){let t,i;const s=EL.exec(e);s&&([,t,e,i]=s);const n=PL.exec(e);if(!n){un(`The number formatter is invalid: ${e}`);return}const[,a,o,r,l,c,h,d,u,p,f]=n;return{fill:a,align:o,sign:r,symbol:l,zero:c,width:Number.parseInt(h),comma:d,precision:Number.parseInt(u),trim:!!p,type:f,prefix:t,suffix:i}}function qm(e){const t=typeof e=="string"?tg(e):e;if(t==null)return;const{fill:i,align:s,sign:n="-",symbol:a,zero:o,width:r,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=t;let{trim:p}=t;const f=u==null||Number.isNaN(u);let y;if(!c)y=ua.g,p=!0;else if(c in ua&&c in Md)y=f?Md[c]:ua[c];else if(c in ua)y=ua[c];else if(c in Md)y=Md[c];else throw new Error(`The number formatter type is invalid: ${c}`);const b=c?6:12;let x;f||(x=u);let v=s,S=i;return o&&(S??(S="0"),v??(v="=")),(M,D)=>{let I;x!=null?I=x:c==="f"||c==="%"?I=D??b:c?I=b:I=D??b;let k=y(M,I);p&&(k=pH(k)),l&&(k=gH(k,l));const C=xH(a,c),A=C?.length??0;C&&(k=`${C}${k}`),c==="s"&&(k=`${k}${fH(M)}`),(c==="%"||c==="p")&&(k=`${k}%`);const{value:w,prefixLength:T}=mH(M,k,n),O=T+A;let z=w;return r!=null&&!Number.isNaN(r)&&(z=yH(z,r,S??" ",v,O)),z=`${h}${z}${d}`,z}}var Md={b:e=>Qm(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Qm(e).toString(8),x:e=>Qm(e).toString(16),X:e=>Md.x(e).toUpperCase(),n:e=>Md.d(e),"%":e=>`${Qm(e*100).toFixed(0)}`},ua={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>ua.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>ua.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>ua.g(e,t).toUpperCase(),n:(e,t)=>ua.g(e,t),p:(e,t)=>ua.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const a=10**n;return(Math.round(i/a)*a).toFixed()},s:(e,t)=>{const i=VL(e);return ua.r(e/10**i,t)},"%":(e,t)=>ua.f(e*100,t)},RL=-24,zL=24,dH={[RL]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[zL]:"Y"},uH="\u2212";function Qm(e){return Math.floor(Math.abs(e))}function pH(e){if(!e.endsWith("0")||!e.includes("."))return e;let t=e.length-1;for(;t>0;)if(e[t]=="0")t-=1;else if(e[t]=="."){t-=1;break}else break;return e.substring(0,t+1)}function gH(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),n=e.substring(i);for(let a=s.length-3;a>0;a-=3)s.splice(a,0,t);return`${s.join("")}${n}`}function fH(e){return dH[VL(e)]}function VL(e){return ae(RL,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,zL)}function mH(e,t,i=""){if(i==="(")return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let s="";return e<0?s=uH:i==="+"?s="+":i===" "&&(s=" "),{value:`${s}${t}`,prefixLength:s.length}}function yH(e,t,i=" ",s=">",n=0){const a=t-e.length;if(a<=0)return e;const o=i.repeat(a);if(s==="="){const r=Math.min(Math.max(n,0),e.length),l=e.slice(0,r),c=e.slice(r);return`${l}${o}${c}`}if(s===">"||!s)return o+e;if(s==="<")return`${e}${o}`;if(s==="^"){const r=Math.ceil(a/2),l=Math.floor(a/2);return`${i.repeat(r)}${e}${i.repeat(l)}`}return o+e}function xH(e,t){if(e==="#")switch(t){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return e??""}var Dd=e=>{if(!ge(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},bH=Et({color:te,stop:ne},""),Jm=ze(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop<t)return!1;t=i.stop}return!0},"colour stops to be defined in ascending order"),ig=Fe(rr(2),me(bH),Jm),m0=U("axis","item","series"),vH={type:j(Ae("gradient")),colorStops:j(ig),rotation:W,gradient:Q(U("linear","radial","conic")),bounds:Q(m0),reverse:Q(R),colorSpace:Q(U("rgb","oklch"))},sg=Et(vH,"a gradient object with colour stops"),q={stroke:te,strokeWidth:P,strokeOpacity:ne},ng=Et({type:j(Ae("gradient")),gradient:j(U("linear","radial","conic")),bounds:j(m0),colorStops:j(Se(ig,Fe(rr(2),me(te)))),rotation:j(W),reverse:j(R),colorSpace:j(U("rgb","oklch"))}),ag=Et({type:j(Ae("pattern")),pattern:j(U("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Zm(2),width:j(P),height:j(P),fill:j(te),fillOpacity:j(ne),backgroundFill:j(te),backgroundFillOpacity:j(ne),padding:j(P),rotation:j(W),scale:j(P),stroke:j(te),strokeWidth:j(P),strokeOpacity:j(ne)}),og=Et({type:j(Ae("image")),url:L,width:P,height:P,rotation:j(W),backgroundFill:j(te),backgroundFillOpacity:ne,fit:j(U("stretch","contain","cover")),repeat:j(U("repeat","repeat-x","repeat-y","no-repeat"))}),SH={gradient:{colorStops:ig,rotation:W,gradient:Q(U("linear","radial","conic")),bounds:Q(m0),reverse:Q(R),colorSpace:Q(U("rgb","oklch"))},pattern:{pattern:U("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Zm(2),width:P,height:P,rotation:W,scale:P,fill:te,fillOpacity:ne,backgroundFill:te,backgroundFillOpacity:ne,...q,padding:Q(P)},image:{url:j(L),backgroundFill:te,backgroundFillOpacity:ne,width:P,height:P,fit:U("stretch","contain","cover","none"),repeat:U("repeat","repeat-x","repeat-y","no-repeat"),rotation:W}},MH=yl(SH,"a color object"),ws=Se(te,Et(MH,"a color object")),se={fill:ws,fillOpacity:ne};se.fillGradientDefaults=Q(ng),se.fillPatternDefaults=Q(ag),se.fillImageDefaults=Q(og);var oe={lineDash:me(P),lineDashOffset:W},pa={...se,...q,...oe,opacity:ne,cornerRadius:P},lr={...q,...oe,opacity:ne},Ct={...se,...q,...oe,opacity:ne};function ey(e){return{enabled:R,range:U("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function _t(e,t){return{enabled:R,range:U("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t,bringToFront:R}}var y0={start:ce,stop:ce,...q,...se,...oe},x0={start:ce,stop:ce,...q,...oe},fo=Et({enabled:R,key:j(U("x","y")),segments:Ft(y0,"path segments array")},"a segmentation object",!0),b0=Et({enabled:R,key:j(U("x","y")),segments:Ft(x0,"path segments array")},"a segmentation object",!0),ty=Et({googleFont:L},"google font"),rg=Se(L,Dd,ty,me(Se(L,ty))),kd=Se(P,U("normal","bold","bolder","lighter")),$e={color:te,fontFamily:rg,fontSize:P,fontStyle:U("normal","italic","oblique"),fontWeight:kd},v0=Et({top:W,right:W,bottom:W,left:W},"padding object"),bl=Se(W,v0),cr={enabled:R,stroke:te,strokeWidth:P,strokeOpacity:ne},zn={border:cr,cornerRadius:W,padding:bl,...se},S0=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],DH={floating:R,placement:U(...S0),xOffset:W,yOffset:W},Id=ze((e,t)=>{let i;if(typeof e=="string")S0.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new go("invalid",`a legend placement string: ["${S0.join('", "')}"]`,e,t.path)));else{const{cleared:s,invalid:n}=Mi(e,DH);i={valid:n.length===0,cleared:s,invalid:n}}return i},"a legend position object or placement string"),hr=Se(U("circle","cross","diamond","heart","plus","pin","square","star","triangle"),ot),BL=U("never","always","hyphenate","on-space"),iy=U("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),lg=Se(P,U("exact","nearest","area")),M0=Se(P,U("exact","nearest")),$i=Se(L,W,ns,Ft({text:j(L),...$e},"text segments array")),sy={enabled:R,text:$i,textAlign:U("left","center","right"),wrapping:U("never","always","hyphenate","on-space"),spacing:P,maxWidth:P,maxHeight:P,...$e};sy.padding=Q(P);var ny={enabled:R,text:$i,renderer:Di(Se(L,Ym))},D0=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],FL={type:U("action","separator"),showOn:U("always","series-area","series-node","legend-item"),label:j(L),enabled:R,action:ot,items:(e,t)=>cg(e,t)};FL.iconUrl=Q(L);var kH=Et(FL),IH=ze((e,t)=>{let i;return typeof e=="string"?D0.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new go("invalid",`a context menu item string alias: ["${D0.join('", "')}"]`,e,t.path))):i=kH(e,t),i},`a context menu item object or string alias: [${D0.join(", ")}]`),cg=me(IH,"a menu items array",!1),dr={label:L,ariaLabel:L,tooltip:L,icon:U("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},Ea=Se(L,Di($i)),k0=Et({x:Ea,y:Ea,angle:Ea,radius:Ea,size:Ea,color:Ea,label:Ea,secondaryLabel:Ea,sectorLabel:Ea,calloutLabel:Ea,legendItem:Ea}),fn=ze(f0,"a valid number format string"),ke={width:P,height:P,minWidth:P,minHeight:P,suppressFieldDotNotation:R,title:sy,subtitle:sy,footnote:sy,padding:{top:P,right:P,bottom:P,left:P},seriesArea:{border:cr,clip:R,cornerRadius:W,padding:bl},legend:{enabled:R,position:Id,orientation:U("horizontal","vertical"),maxWidth:P,maxHeight:P,spacing:P,border:cr,cornerRadius:W,padding:bl,fill:ws,fillOpacity:ne,preventHidingAll:R,reverseOrder:R,toggleSeries:R,item:{marker:{size:P,shape:hr,padding:P,strokeWidth:P},line:{length:P,strokeWidth:P},label:{maxLength:P,formatter:ot,...$e},maxWidth:P,paddingX:P,paddingY:P,showSeriesStroke:R},pagination:{marker:{size:P,shape:hr,padding:P},activeStyle:{...se,...q},inactiveStyle:{...se,...q},highlightStyle:{...se,...q},label:$e},listeners:{legendItemClick:ot,legendItemDoubleClick:ot}},gradientLegend:{enabled:R,position:Id,spacing:P,reverseOrder:R,border:cr,cornerRadius:W,padding:bl,fill:ws,fillOpacity:ne,gradient:{preferredLength:P,thickness:P},scale:{label:{...$e,minSpacing:P,format:fn,formatter:ot},padding:P,interval:{step:W,values:pn,minSpacing:Fe(P,as("maxSpacing")),maxSpacing:Fe(P,os("minSpacing"))}}},listeners:{seriesNodeClick:ot,seriesNodeDoubleClick:ot,seriesVisibilityChange:ot,activeChange:ot,click:ot,doubleClick:ot,annotations:ot,zoom:ot},loadGoogleFonts:R,highlight:{drawingMode:U("overlay","cutout"),range:U("tooltip","node")},overlays:{loading:ny,noData:ny,noVisibleSeries:ny,unsupportedBrowser:ny},tooltip:{enabled:R,showArrow:R,pagination:R,delay:P,range:lg,wrapping:BL,mode:U("single","shared","compact"),position:{anchorTo:U("pointer","node","chart"),placement:Se(iy,me(iy)),xOffset:W,yOffset:W}},animation:ce,contextMenu:ce,context:()=>!0,dataSource:{getData:ot},keyboard:{enabled:R,tabIndex:W},touch:{dragAction:U("none","drag","hover")},ranges:{enabled:R,buttons:Ft({...dr,value:Se(W,Fe(me(Se(W,ns)),rr(2,2)),ot)},"range button options array")},locale:{localeText:or,getLocaleText:Di(L)},background:{visible:R,fill:te,image:{url:j(L),top:W,right:W,bottom:W,left:W,width:P,height:P,opacity:ne}},styleNonce:L,sync:ce,zoom:ce,scrollbar:ce,formatter:Se(Di($i),k0)};ke.flashOnUpdate=Q(ce),ke.dataSource.requestThrottle=Q(P),ke.dataSource.updateThrottle=Q(P),ke.dataSource.updateDuringInteraction=Q(R),ke.statusBar=Q(ce),ke.foreground=Q({visible:R,text:L,image:{url:L,top:W,right:W,bottom:W,left:W,width:P,height:P,opacity:ne},...se}),ke.overrideDevicePixelRatio=Q(W),ke.sync.domainMode=Q(U("direction","position","key")),ke.displayNullData=Q(R);var Ke={cursor:L,context:()=>!0,showInLegend:R,nodeClickRange:lg,listeners:{seriesNodeClick:ot,seriesNodeDoubleClick:ot},highlight:ey(Ct)};Ke.allowNullKeys=Q(R);var qe={...Ke,id:L,visible:R,context:()=>!0,data:pn};qe.seriesGrouping=Q(ce);var ur={shape:hr,size:P,...se,...q,...oe},ga={enabled:R,itemStyler:Xe({...se,...q,...oe,shape:hr,size:P}),...ur},ft={enabled:R,formatter:Di($i),format:fn,itemStyler:Xe({enabled:R,...zn,...$e}),...zn,...$e},pr={...ft,lineHeight:P,minimumFontSize:P,wrapping:BL,overflowStrategy:U("ellipsis","hide")},Ad={visible:R,cap:{visible:R,length:P,lengthRatio:ne,...q,...oe},...q,...oe},Cd={...Ad,xLowerKey:L,xUpperKey:L,yLowerKey:L,yUpperKey:L,xLowerName:L,xUpperName:L,yLowerName:L,yUpperName:L,itemStyler:Xe({visible:R,...q,...oe,cap:{visible:R,length:P,lengthRatio:ne,...q,...oe}})},Ue={enabled:R,showArrow:R,range:M0,renderer:Di(Se(L,W,ns,Et({heading:L,title:L,symbol:{marker:{enabled:R,shape:hr,...se,stroke:te,strokeOpacity:ne,strokeWidth:P,...oe},line:{enabled:R,stroke:te,strokeWidth:P,strokeOpacity:ne,...oe}},data:Ft({label:j(L),value:j(Se(L,W,ns))})},"tooltip renderer result object"))),position:{anchorTo:U("node","pointer","chart"),placement:Se(iy,me(iy)),xOffset:W,yOffset:W},interaction:{enabled:R}},I0={...Ue,range:lg},Ra={enabled:R,xOffset:W,yOffset:W,blur:P,color:te},hg=yl({linear:{},smooth:{tension:ne},step:{position:U("start","middle","end")}},"interpolation line options"),dg=Symbol("BREAK"),ug="__decorator_config",ay="__decorator_accessors";function m(e,t){A0(e,t).optional=!0}function A0(e,t){if(Object.getOwnPropertyDescriptor(e,ug)==null&&Object.defineProperty(e,ug,{value:{}}),Object.getOwnPropertyDescriptor(e,ay)==null){const h=Object.getPrototypeOf(e)?.[ay]?.slice()??[];Object.defineProperty(e,ay,{value:h})}const i=e[ug],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let a=n?.get,o=n?.set;if(a==null||o==null){const c=e[ay];let h=c.indexOf(t);h===-1&&(h=c.push(t)-1),a??(a=function(){let d=this.__accessors;return d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[h]}),o??(o=function(d){let u=this.__accessors;u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[h]=d})}return Object.defineProperty(e,t,{set:function(c){const{setters:h,observers:d}=i[s];let u;h.some(p=>p.length>2)&&(u=a.call(this));for(const p of h)if(c=p(this,t,c,u),c===dg)return;o.call(this,c);for(const p of d)p(this,c,u)},get:function(){let c=a.call(this);for(const h of i[s].getters)if(c=h(this,t,c),c===dg)return;return c},enumerable:!0,configurable:!1}),i[s]}function gr(e,t,i){return(s,n)=>{const a=A0(s,n);a.setters.push(e),t&&a.getters.unshift(t),i&&Object.assign(a,i)}}function oy(e){return(t,i)=>{A0(t,i).observers.push(e)}}function pg(e){return e!==void 0&&ug in e}function fr(e){const t=new Set;for(;pg(e);)t.add(e?.[ug]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function C0(e){return fr(e).reduce((t,i)=>(t[String(i)]=e[i]??null,t),{})}function*mr(...e){for(const t of e)t!=null&&(t[Symbol.iterator]?yield*t:yield t)}function w0(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function $s(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*rt(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function za(e){return Object.keys(e)}function Ht(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>Ht(i,t[s])):We(e)?We(t)?ry(e,t,Ht):!1:e===t}function ry(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function re(...e){const t={};for(const i of e){if(!ge(i))continue;const s=pg(i)?fr(i):Object.keys(i);for(const n of s)We(t[n])&&We(i[n])?t[n]=re(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function wd(...e){const t={};for(const i of e){if(!ge(i))continue;const s=pg(i)?fr(i):Object.keys(i);for(const n of s)We(t[n])&&We(i[n])?t[n]=wd(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function ly(e,...t){return t&&De(e)?e.map(i=>re(i,...t)):e}function Ec(e,t){const i={};for(const[s,n]of rt(e))i[s]=t(n,s,e);return i}function J(e,t){const i={...e};for(const s of t)delete i[s];return i}function gg(e,t){if(e==null)return;const i={};for(const s of t)Object.hasOwn(e,s)&&(i[s]=e[s]);return i}function L0(e,t){if(e==null)return!0;for(const[i,s]of rt(e))if(!t(i,s))return!1;return!0}function N0(e){const t={};if(e==null)return t;for(const[i,s]of e)t[i]=s;return t}function cy(e,t){return(De(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var hy=new Set(["__proto__","constructor","prototype"]);function dy(e,t,i){const s=De(t)?t.slice():t.split("."),n=s.pop();if(s.some(o=>hy.has(o)))return;const a=s.reduce((o,r)=>o[r],e);return a[n]=i,a[n]}function fg(e,t,i){if(i===void 0)return t;for(const s of e){const n=i[s];n!==void 0&&(t[s]=n)}return t}function uy(e,t,i){const s=i??Object.keys(t);for(let n=0,a=s.length;n<a;n++){const o=s[n],r=t[o];e[o]!==r&&(e[o]=r)}return e}function Ks(e){if(e==null||typeof e!="object"||!We(e))return e;Object.freeze(e);for(const t of Object.getOwnPropertyNames(e)){const i=e[t];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Ks(i)}return e}function T0(e,t){return We(e)&&t in e}function O0(e,t){return T0(e,t)&&typeof e[t]=="string"}var py={fills:Fe(rr(2),me(Et({color:te,stop:W},"")),Jm),fillMode:U("continuous","discrete")},mg={value:j(W),text:L,shape:Se(U("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),ot),placement:U("before","after","middle"),spacing:P,size:P,rotation:W,...se,...q,...oe},yg={value:j(W),text:L,shape:Se(U("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),ot),placement:U("inside","outside","middle"),spacing:P,size:P,rotation:W,label:{...ft,spacing:P},...se,...q,...oe},xg={...J(Ke,["listeners"]),direction:U("horizontal","vertical"),cornerMode:U("container","item"),cornerRadius:P,thickness:P,segmentation:{enabled:R,spacing:P,interval:{values:me(W),step:W,count:W}},bar:{enabled:R,thickness:P,thicknessRatio:ne,...py,...se,...q,...oe},label:{...pr,text:L,spacing:P,avoidCollisions:R,placement:U("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Ue},mo={...J(qe,["listeners"]),...xg,type:j(Ae("linear-gauge")),value:j(W),scale:{min:Fe(W,as("max")),max:Fe(W,os("min")),label:{enabled:R,formatter:ot,rotation:W,spacing:P,minSpacing:P,placement:U("before","after"),avoidCollisions:R,format:fn,...$e},interval:{values:me(W),step:W},...py,...se,...q,...oe},targets:Ft(mg,"target options array")};mo.margin=Q(W),mo.defaultColorRange=Q(me(te)),mo.defaultTarget=Q({...mg,value:W,label:{...ft,spacing:W}}),mo.defaultScale=Q(mo.scale),mo.scale.defaultFill=Q(te);var bg={...J(Ke,["listeners"]),outerRadius:P,innerRadius:P,outerRadiusRatio:ne,innerRadiusRatio:ne,startAngle:W,endAngle:W,spacing:P,cornerMode:U("container","item"),cornerRadius:P,scale:{min:Fe(W,as("max")),max:Fe(W,os("min")),label:{enabled:R,formatter:ot,rotation:W,spacing:P,minSpacing:P,avoidCollisions:R,format:fn,...$e},interval:{values:me(W),step:W},...py,...se,...q,...oe},segmentation:{enabled:R,spacing:P,interval:{values:me(W),step:W,count:W}},bar:{enabled:R,...py,...se,...q,...oe},needle:{enabled:R,spacing:P,radiusRatio:ne,...se,...q,...oe},label:{text:L,spacing:P,...pr},secondaryLabel:{text:L,...pr},tooltip:Ue},Rc={...J(qe,["listeners"]),...bg,type:j(Ae("radial-gauge")),value:j(W),targets:Ft(yg,"target options array")};Rc.defaultColorRange=Q(me(te)),Rc.defaultTarget=Q({...yg,value:W,label:{...ft,spacing:W}}),Rc.scale.defaultFill=Q(te);var P0=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(P0||{}),Va=12,ki={SMALLEST:8/Va,SMALLER:10/Va,SMALL:12/Va,MEDIUM:13/Va,LARGE:14/Va,LARGEST:17/Va},E0=(e=>(e.TOP="top",e.TOP_RIGHT="top-right",e.TOP_LEFT="top-left",e.RIGHT="right",e.RIGHT_TOP="right-top",e.RIGHT_BOTTOM="right-bottom",e.BOTTOM="bottom",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.LEFT="left",e.LEFT_TOP="left-top",e.LEFT_BOTTOM="left-bottom",e))(E0||{}),R0=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.TIME="time",e.NUMBER="number",e.LOG="log",e))(R0||{}),z0=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(z0||{}),V0=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(V0||{}),zc=(e,t,i)=>e*(1-i)+t*i,B0=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},F0=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},_L=class at{constructor(t,i,s,n=1){this.r=ae(0,t||0,1),this.g=ae(0,i||0,1),this.b=ae(0,s||0,1),this.a=ae(0,n||0,1)}static validColorString(t){return t.includes("#")?!!at.parseHex(t):t.includes("rgb")?!!at.stringToRgba(t):at.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.includes("#"))return at.fromHexString(t);const i=at.nameToHex.get(t.toLowerCase());if(i)return at.fromHexString(i);if(t.includes("rgb"))return at.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replaceAll(" ","").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;s<t.length;s+=2)i.push(Number.parseInt(`${t[s]}${t[s+1]}`,16));break;case 3:case 4:i=t.split("").map(s=>Number.parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=at.parseHex(t);if(i){const[s,n,a,o]=i;return new at(s/255,n/255,a/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let r=0;r<t.length;r++){const l=t[r];if(i===-1&&l==="(")i=r;else if(l===")"){s=r;break}}if(i===-1||s===-1)return;const a=t.substring(i+1,s).split(","),o=[];for(let r=0;r<a.length;r++){const l=a[r];let c=Number.parseFloat(l);if(!Number.isFinite(c))return;l.includes("%")?(c=ae(0,c,100),c/=100):r===3?c=ae(0,c,1):(c=ae(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(t){const i=at.stringToRgba(t);if(i){if(i.length===3)return new at(i[0],i[1],i[2]);if(i.length===4)return new at(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new at(t[0],t[1],t[2],t[3]);if(t.length===3)return new at(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const a=at.HSBtoRGB(t,i,s);return new at(a[0],a[1],a[2],n)}static fromHSL(t,i,s,n=1){const a=at.HSLtoRGB(t,i,s);return new at(a[0],a[1],a[2],n)}static fromOKLCH(t,i,s,n=1){const a=at.OKLCHtoRGB(t,i,s);return new at(a[0],a[1],a[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+at.padHex(Math.round(this.r*255).toString(16))+at.padHex(Math.round(this.g*255).toString(16))+at.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=at.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return at.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=B0(t),a=B0(i),o=B0(s),r=Math.cbrt(.4122214708*n+.5363325363*a+.0514459929*o),l=Math.cbrt(.2119034982*n+.6806995451*a+.1073969566*o),c=Math.cbrt(.0883024619*n+.2817188376*a+.6299787005*o),h=.2104542553*r+.793617785*l-.0040720468*c,d=1.9779984951*r-2.428592205*l+.4505937099*c,u=.0259040371*r+.7827717662*l-.808675766*c,p=Math.atan2(u,d)*180/Math.PI,f=h,y=Math.hypot(d,u),b=p>=0?p:p+360;return[f,y,b]}static OKLCHtoRGB(t,i,s){const n=t,a=i*Math.cos(s*Math.PI/180),o=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*a+.2158037573*o)**3,l=(n-.1055613458*a-.0638541728*o)**3,c=(n-.0894841775*a-1.291485548*o)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,d=-1.2684380046*r+2.6097574011*l-.3413193965*c,u=-.0041960863*r-.7034186147*l+1.707614701*c,p=F0(h),f=F0(d),y=F0(u);return[p,f,y]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),a=Math.max(t,i,s),o=(a+n)/2;let r,l;if(a===n)r=0,l=0;else{const c=a-n;l=o>.5?c/(2-a-n):c/(a+n),a===t?r=(i-s)/c+(i<s?6:0):a===i?r=(s-t)/c+2:r=(t-i)/c+4,r*=360/6}return[r,l,o]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,a=2*s-n;function o(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?a+(n-a)*6*h:h<1/2?n:h<2/3?a+(n-a)*(2/3-h)*6:a}const r=o(t/360+1/3),l=o(t/360),c=o(t/360-1/3);return[r,l,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),a=Math.max(t,i,s),o=a===0?0:(a-n)/a;let r=0;if(n!==a){const l=a-n,c=(a-t)/l,h=(a-i)/l,d=(a-s)/l;t===a?r=d-h:i===a?r=2+c-d:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,o,a]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,a=0,o=0;if(i===0)n=a=o=s;else{const r=(t-Math.floor(t))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),d=s*(1-i*(1-l));switch(Math.trunc(r)){case 0:n=s,a=d,o=c;break;case 1:n=h,a=s,o=c;break;case 2:n=c,a=s,o=d;break;case 3:n=c,a=h,o=s;break;case 4:n=d,a=c,o=s;break;case 5:n=s,a=c,o=h;break}}return[n,a,o]}static mix(t,i,s){return new at(zc(t.r,i.r,s),zc(t.g,i.g,s),zc(t.b,i.b,s),zc(t.a,i.a,s))}static lighten(t,i){const s=at.RGBtoOKLCH(t.r,t.g,t.b);return at.fromOKLCH(ae(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=at.RGBtoOKLCH(t.r,t.g,t.b);return at.fromOKLCH(ae(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(a=>at.RGBtoOKLCH(a.r,a.g,a.b));return Array.from({length:i},(a,o)=>{const r=o/(i-1),l=t.length<=2?0:Math.min(Math.floor(r*(t.length-1)),t.length-2),c=(r-l*s)/s,h=n[l],d=n[l+1];return at.fromOKLCH(zc(h[0],d[0],c),zc(h[1],d[1],c),zc(h[2],d[2],c))})}};_L.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var Oe=_L,Ld={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},_0={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},H0={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},yr={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},yo={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},G0={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},Vi={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},j0={...Vi,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},gy={...Vi,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},fy=e=>({...Vi,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${e}.fill`}},{$isPattern:{$palette:`${e}.fill`}},{$isImage:{$palette:`${e}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${e}.fill`}]},[{color:{$mix:[{$palette:`${e}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${e}.fill`},"white",.15]}}]]}}}),vg={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Ba={...vg,reverse:!0},my={...vg,bounds:"series"},yy={...vg,bounds:"series",reverse:!0},W0={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},tt={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},10]},padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:yr,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},xy={...tt,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},$0={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},K0={...tt,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},by=e=>({...tt,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),it={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},U0={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function mn(e){return Ec(e,t=>{const i=Oe.fromString(t);return[Oe.darken(i,.15).toString(),t,Oe.lighten(i,.15).toString()]})}var Ye={padding:8,cornerRadius:4,fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]},border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}}},Us={enabled:!0,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},Nd={enabled:!0,unhighlightedSeries:{opacity:.2}},vy={enabled:!0,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},Sy={enabled:!0,unhighlightedItem:{opacity:.2}},My={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},vl={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},Dy=class nL{constructor(t){this.version=t.split("-")[0]}save(...t){const i={version:this.version};for(const s of Object.values(t))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(t,...i){if(typeof t!="object"){un(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){un("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){un("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,t[s.mementoOriginatorKey]),a=[];if(!s.guardMemento(n,a)){const o=a.length>0?`
${a.join(`
`)}
`:"";un(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${o}`,n);return}s.restoreMemento(this.version,t.version,n)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,nL.encodeTypes))}catch(s){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(t,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),nL.decodeTypes)}catch(s){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(t,i){return Cs(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return ge(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},Sg=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(Sg||{}),xr=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PROCESS_RANGE=4]="PROCESS_RANGE",e[e.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",e[e.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",e[e.SERIES_UPDATE=7]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=9]="SCENE_RENDER",e[e.NONE=10]="NONE",e))(xr||{}),Y0=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",e[e.AXIS_GRID=2]="AXIS_GRID",e[e.AXIS=3]="AXIS",e[e.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",e[e.ZOOM_SELECTION=5]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=7]="SERIES_LAYER",e[e.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=12]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=14]="STATUS_BAR",e[e.SERIES_LABEL=15]="SERIES_LABEL",e[e.LEGEND=16]="LEGEND",e[e.NAVIGATOR=17]="NAVIGATOR",e[e.FOREGROUND=18]="FOREGROUND",e))(Y0||{}),Z0=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(Z0||{}),X0=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(X0||{}),q0=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(q0||{});function Sl(e){const{placement:t="bottom",floating:i=!1,xOffset:s=0,yOffset:n=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:i,xOffset:s,yOffset:n}}var X=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(e==null)return this.clear(),this;if(typeof e!="object")return uo(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of fr(this))if(i.has(s)){const n=e[s],a=this;if(Vc(a[s]))if(a[s]instanceof Bi){const o=a[s].reset(n);o==null?uo(`unable to set [${String(s)}] - expecting a properties array`):a[s]=o}else a[s].set(n);else We(n)?a[s]=wd(n,a[s]??{}):a[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)uo(`unable to set [${String(s)}] in ${t} - property is unknown`);return this}clear(){for(const e of fr(this)){const t=this[e];Vc(t)?t.clear():this[e]=void 0}return this}toJson(){return fr(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=Vc(i)?i.toJson():i,e},{})}},Bi=class s_ extends Array{constructor(t,...i){super(i.length);const n=(a=>!!a?.prototype?.constructor?.name)(t)?a=>new t().set(a):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if(De(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new s_(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function Vc(e){return e instanceof X||e instanceof Bi}var Ml=class extends X{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};g([m],Ml.prototype,"type",2),g([m],Ml.prototype,"tension",2),g([m],Ml.prototype,"position",2);function Bc(e,t){const[i,s]=Tt(t);return ae(i,e,s)}function Tt(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function xo(e){const[t,i]=Tt(e);return i-t}function Fc(e){return e=Math.trunc(e),e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function ky(e){return e=Math.trunc(e),e<=0?0:e===1?1:1<<31-Math.clz32(e)}var Ys=0,Zs=1,Xs=2,qs=3,Vn=4,bo=1e3,HL=10,br=64,Dl=4294967295,AH=3,CH=20,Q0=100;function J0(e,t,i,s,n,a,o,r){let l=0;for(;l<Q0&&e[s]==null&&s<n;)s+=1,l+=1;for(;l<Q0&&e[n]==null&&n>s;)n-=1,l+=1;if(l>=Q0||s>=n)return a;const c=Number.isFinite(t)?Bn(e[n],t,i,r)-Bn(e[s],t,i,r):_c(n,e.length)-_c(s,e.length);if(c===0||!Number.isFinite(c))return a;const h=Math.abs(c)/(n-s);let d;if(o<AH?d=!0:o>CH?d=!1:d=h<=a,a=Math.min(a,h),!d)return a;const u=Math.floor((s+n)/2),p=J0(e,t,i,s,u,a,o+1,r),f=J0(e,t,i,u+1,n,a,o+1,r);return Math.min(p,f,a)}function wH(e,t,i,s){return J0(e,t,i,0,e.length-1,1/(e.length-1),0,s)}function vo(e,t,i,s){if(Number.isFinite(t)){const n=s?.smallestKeyInterval,a=s?.xNeedsValueOf??!0,o=n==null?wH(e,t,i,a):n/(i-t);return Fc(Math.trunc(1/o))>>3}else{let n=Math.ceil(Math.log2(e.length))-1;return n=Math.min(Math.max(n,0),24),Math.trunc(2**n)}}function oi(e,t){const{domain:i,sortMetadata:s}=t;switch(e){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(i.length===0)return[1/0,-1/0];if(s?.sortOrder===1)return[Number(i[0]),Number(i.at(-1))];if(s?.sortOrder===-1)return[Number(i.at(-1)),Number(i[0])];let n=1/0,a=-1/0;for(const o of i){const r=Number(o);n=Math.min(n,r),a=Math.max(a,r)}return[n,a]}case"color":case"log":case"mercator":return[0,0]}}function _c(e,t){return e/t}function Bn(e,t,i,s){return s?(e.valueOf()-t)/(i-t):(e-t)/(i-t)}function Mg(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*Vn)}function GL(e,t,i,s,n,{xNeedsValueOf:a=!0,xValuesLength:o}={}){const r=e[n];if(r==null)return-1;const l=o??e.length,c=Number.isFinite(t)?Bn(r,t,i,a):_c(n,l);return Mg(c,s)}function jL(e,t,i,s){for(const n of s)if(i===e[t+n])return!0;return!1}function So(e,t,i,s,n,a,{positive:o,split:r=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:h,reuseValueData:d,reuseNegativeIndexData:u,reuseNegativeValueData:p}={}){const f=Number.NaN,y=a*Vn,b=h?.length===y?h:new Uint32Array(y),x=d?.length===y?d:new Float64Array(y);let v,S;r&&(u?.length===y?v=u:v=new Uint32Array(y),p?.length===y?S=p:S=new Float64Array(y));const M=Number.isFinite(s)&&Number.isFinite(n),D=e.length;M&&(x.fill(f),b.fill(Dl),r&&(S.fill(f),v.fill(Dl)));const I=M?a/(n-s):a*(1/D);let k=-1,C=-1,A=f,w=-1,T=f,O=-1,z=f,V=-1,E=f,_=-1,G=-1,B=f,F=-1,Y=f,Z=-1,ie=f,ee=-1,he=f;const Me=e.length,Ce=t===i;for(let xe=0;xe<Me;xe++){const Ge=e[xe];if(Ge==null)continue;const je=t[xe],dt=Ce?je:i[xe];let Ze,we;c?(Ze=je==null?f:je.valueOf(),we=dt==null?f:dt.valueOf()):(Ze=je??f,we=dt??f);let Ie=!0;if(r)Ie=Ze>=0;else if(o!=null&&Ze>=0!==o)continue;let pe;M?l?pe=(Ge.valueOf()-s)*I:pe=(Ge-s)*I:pe=xe*I;const yt=Math.floor(pe),xt=(yt<a?yt:a-1)<<2;if(Ie){xt!==k&&(k!==-1&&(b[k]=C,b[k+1]=w,b[k+2]=O,b[k+3]=V,x[k]=A,x[k+1]=T,x[k+2]=z,x[k+3]=E),k=xt,C=-1,A=f,w=-1,T=f,O=-1,z=f,V=-1,E=f);const ut=we===we,bt=Ze===Ze;C===-1?(C=xe,A=pe,w=xe,T=pe,ut&&(O=xe,z=we),bt&&(V=xe,E=Ze)):(pe<A&&(C=xe,A=pe),pe>T&&(w=xe,T=pe),ut&&we<z&&(O=xe,z=we),bt&&Ze>E&&(V=xe,E=Ze))}else{xt!==_&&(_!==-1&&(v[_]=G,v[_+1]=F,v[_+2]=Z,v[_+3]=ee,S[_]=B,S[_+1]=Y,S[_+2]=ie,S[_+3]=he),_=xt,G=-1,B=f,F=-1,Y=f,Z=-1,ie=f,ee=-1,he=f);const ut=we===we,bt=Ze===Ze;G===-1?(G=xe,B=pe,F=xe,Y=pe,ut&&(Z=xe,ie=we),bt&&(ee=xe,he=Ze)):(pe<B&&(G=xe,B=pe),pe>Y&&(F=xe,Y=pe),ut&&we<ie&&(Z=xe,ie=we),bt&&Ze>he&&(ee=xe,he=Ze))}}return k!==-1&&(b[k]=C,b[k+1]=w,b[k+2]=O,b[k+3]=V,x[k]=A,x[k+1]=T,x[k+2]=z,x[k+3]=E),r&&_!==-1&&(v[_]=G,v[_+1]=F,v[_+2]=Z,v[_+3]=ee,S[_]=B,S[_+1]=Y,S[_+2]=ie,S[_+3]=he),{indexData:b,valueData:x,negativeIndexData:v,negativeValueData:S}}function kl(e,t,i,{inPlace:s=!1,midpointData:n,reuseIndexData:a,reuseValueData:o}={}){const r=Math.trunc(i/2),l=r*Vn;let c;s?c=e:a?.length===l?c=a:c=new Uint32Array(l);let h;s?h=t:o?.length===l?h=o:h=new Float64Array(l);const d=n??new Uint32Array(r);for(let u=0;u<r;u+=1){const p=Math.trunc(u*Vn),f=Math.trunc(p*2),y=Math.trunc(f+Vn),b=e[y+Ys]===Dl,x=b||t[f+Ys]<t[y+Ys]?f:y,v=e[x+Ys];c[p+Ys]=v,h[p+Ys]=t[x+Ys];const S=b||t[f+Zs]>t[y+Zs]?f:y,M=e[S+Zs];c[p+Zs]=M,h[p+Zs]=t[S+Zs],d[u]=v+M>>1;const D=b||t[f+Xs]<t[y+Xs]?f:y;c[p+Xs]=e[D+Xs],h[p+Xs]=t[D+Xs];const I=b||t[f+qs]>t[y+qs]?f:y;c[p+qs]=e[I+qs],h[p+qs]=t[I+qs]}return{maxRange:r,indexData:c,valueData:h,midpointData:d}}function Fa(e,t,i,s=Ys,n=Zs,a=-1){const o=i?.length===e?i:new Uint32Array(e);for(let r=0,l=0;r<e;r+=1,l+=Vn){const c=t[l+s],h=t[l+n];o[r]=c===a?a:c+h>>1}return o}function WL(e,{collectLevel:t,shouldContinue:i,minRange:s=br,compactInPlace:n=!1}){let a=e,o=t(a);const r=[o];for(;a.maxRange>s&&i(o,a);){const l=kl(a.indexData,a.valueData,a.maxRange,{inPlace:n});a={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},o=t(a),r.push(o)}return r.reverse(),r}function vr(e,t,i,s,n){if(t.length<bo)return;const[a,o]=e,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=n;let d=vo(t,a,o,{smallestKeyInterval:r,xNeedsValueOf:l});const u=h?.find(x=>x.maxRange===d);let{indexData:p,valueData:f}=So(t,i,s,a,o,d,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),y=Fa(d,p,u?.midpointIndices);const b=[{maxRange:d,indexData:p,valueData:f,midpointIndices:y}];for(;d>br;){const x=d,v=Math.trunc(x/2),S=h?.find(D=>D.maxRange===v),M=kl(p,f,x,{reuseIndexData:S?.indexData,reuseValueData:S?.valueData});d=M.maxRange,p=M.indexData,f=M.valueData,y=M.midpointData??Fa(d,p,S?.midpointIndices),b.push({maxRange:d,indexData:p,valueData:f,midpointIndices:y})}return b.reverse(),b}function Dg(e,t,i,s,n){if(t.length<bo)return;const[a,o]=e,{smallestKeyInterval:r,targetRange:l,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:d}=n,u=vo(t,a,o,{smallestKeyInterval:r,xNeedsValueOf:c}),p=Math.min(u,Fc(Math.max(l,br))),f=d?.find(M=>M.maxRange===p),{indexData:y,valueData:b}=So(t,i,s,a,o,p,{xNeedsValueOf:c,yNeedsValueOf:h,reuseIndexData:f?.indexData,reuseValueData:f?.valueData}),x=Fa(p,y,f?.midpointIndices),v={maxRange:p,indexData:y,valueData:b,midpointIndices:x};function S(){return vr([a,o],t,i,s,{smallestKeyInterval:r,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:d})?.filter(D=>D.maxRange!==p)??[]}return{immediate:[v],computeRemaining:S}}var Il=Symbol("is-dark-theme"),Mo=Symbol("default-shadow-colour"),Do=Symbol("default-caption-layout-style"),Sr=Symbol("default-caption-alignment"),Iy=Symbol("palette-up-stroke"),Ay=Symbol("palette-down-stroke"),Cy=Symbol("palette-up-fill"),wy=Symbol("palette-down-fill"),Ly=Symbol("palette-neutral-stroke"),Ny=Symbol("palette-neutral-fill"),Ty=Symbol("palette-alt-up-stroke"),Oy=Symbol("palette-alt-down-stroke"),Py=Symbol("palette-alt-up-fill"),Ey=Symbol("palette-alt-down-fill"),Ry=Symbol("palette-gray-fill"),zy=Symbol("palette-gray-stroke"),kg=Symbol("default-polar-series-stroke"),Ig=Symbol("default-sparkline-crosshair-stroke"),Ls=Symbol("default-financial-charts-annotation-stroke"),Td=Symbol("default-hierarchy-strokes"),Ag=Symbol("default-text-annotation-color"),rs=Symbol("default-financial-charts-annotation-background-fill"),Od=Symbol("default-annotation-handle-fill"),Pd=Symbol("default-annotation-statistics-fill"),Ed=Symbol("default-annotation-statistics-stroke"),Rd=Symbol("default-annotation-statistics-color"),zd=Symbol("default-annotation-statistics-divider-stroke"),Vd=Symbol("default-annotation-statistics-fill"),Bd=Symbol("default-annotation-statistics-stroke"),Fd=Symbol("default-textbox-fill"),_d=Symbol("default-textbox-stroke"),Hd=Symbol("default-textbox-color"),Gd=Symbol("default-toolbar-position");function LH(e,t){return"context"in e}function $L(e,t){return e!=null&&LH(e,t)&&t!=null&&typeof t=="object"&&t.context===void 0?(t.context=e.context,!0):!1}function ls(e,t,i){if(Array.isArray(e)){for(const s of e)if($L(s,i))break}else $L(e,i);return t(i)}var eM=class{constructor(){this.cache=new WeakMap}call(e,t,i){let s,n=this.cache.get(t);try{s=JSON.stringify(i)}catch{return this.invoke(e,t,n,void 0,i)}return n==null&&(n=new Map,this.cache.set(t,n)),n.has(s)?n.get(s):this.invoke(e,t,n,s,i)}invoke(e,t,i,s,n){try{const a=ls(e,t,n);return i&&s!=null&&i.set(s,a),a}catch(a){un("User callback errored, ignoring",a);return}}invalidateCache(){this.cache=new WeakMap}};function jd(e,t){if(!e)return;const{x:i,y:s,width:n,height:a}=NH(t);By(e.style,"width",n),By(e.style,"height",a),By(e.style,"left",i),By(e.style,"top",s)}function tM(e){const t=Number.parseFloat(e.style.width),i=Number.parseFloat(e.style.height),s=Number.parseFloat(e.style.left),n=Number.parseFloat(e.style.top),a=Number.isFinite(t)?t:e.offsetWidth,o=Number.isFinite(i)?i:e.offsetHeight,r=Number.isFinite(s)?s:e.offsetLeft,l=Number.isFinite(n)?n:e.offsetTop;return{x:r,y:l,width:a,height:o}}function Vy(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=dn().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=Re().getSelection();i?.removeAllRanges(),i?.addRange(t)}function iM(){const e=Re("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function Al(e){return`ag-charts-icon ag-charts-icon-${e}`}function NH(e){let{x:t,y:i,width:s,height:n}=e;return(s==null||s>0)&&(n==null||n>0)?e:(t!=null&&s!=null&&s<0&&(s=-s,t=t-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:t,y:i,width:s,height:n})}function By(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}function Fy(e,t,i=1/0){const s=t,n=i,a=e%180*(Math.PI/180),o=Math.abs(Math.sin(a)),r=Math.abs(Math.cos(a));if(o===0)return{width:s,height:n};if(r===0)return{width:n,height:s};if(!Number.isFinite(n)){const c=r/o,h=s/(r+c*o);return{width:h,height:c*h}}const l=r*r-o*o;if(l===0){const c=Math.min(s,n)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((s*r-n*o)/l),height:Math.abs((n*r-s*o)/l)}}function KL(e,t,i=1/0){const s=t,n=i,a=e%180*(Math.PI/180),o=Math.abs(Math.sin(a)),r=Math.abs(Math.cos(a));return o===0?{width:s,height:n}:r===0?{width:n,height:s}:{width:s*r+n*o,height:s*o+n*r}}function _y(e,t,i,s=0,n=0){const a=Math.cos(i),o=Math.sin(i),r=e-s,l=t-n;return{x:s+r*a-l*o,y:n+r*o+l*a}}var fa=Math.PI*2,Cg=Math.PI/2;function Qe(e){return e%=fa,e+=fa,e%=fa,e}function Wd(e){return e%=fa,e+=fa,e!==fa&&(e%=fa),e}function wg(e){return e%=fa,e<-Math.PI?e+=fa:e>=Math.PI&&(e-=fa),e}function Qs(e,t,i){const s=Qe(e),n=Qe(t),a=Qe(i);return n<a?n<=s&&s<=a:n>a?n<=s||s<=a:t!==i}function lt(e){return e/180*Math.PI}function sM(e){return e/Math.PI*180}function _a(e,t){return e=Qe(e),t=Qe(t),t-e+(e>t?fa:0)}function nM(e){const t=Qe(e);return t<=Cg?t/Cg:t<=Math.PI?(Math.PI-t)/Cg:t<=1.5*Math.PI?(t-Math.PI)/Cg:(fa-t)/Cg}function Hy(e,t,i){const s=nM(i);return e*s+t*Math.abs(1-s)}function Ha(e){return e?Qe(lt(e)):0}var Lg=class{constructor(){this.queue=[]}waitForCompletion(e=50){const t=this.queue;function i(s){function n(){clearTimeout(o),s(!0)}function a(){const r=t.indexOf(n);r<0||(t.splice(r,1),s(!1))}const o=setTimeout(a,e);t.push(n)}return new Promise(i)}notify(){for(const e of this.queue.splice(0))e()}};function Gy(e=0){function t(i){setTimeout(i,e)}return new Promise(t)}async function UL(e,t,i=`Timeout after ${t}ms`){let s;const n=new Promise((a,o)=>{s=setTimeout(()=>o(new Error(i)),t)});try{return await Promise.race([e,n])}finally{clearTimeout(s)}}function Cl(e){return e==="true"}function TH(e){return Number(e)}function Fn(e){return e}var OH={role:Fn,"aria-checked":Cl,"aria-controls":Fn,"aria-describedby":Fn,"aria-disabled":Cl,"aria-expanded":Cl,"aria-haspopup":Fn,"aria-hidden":Cl,"aria-label":Fn,"aria-labelledby":Fn,"aria-live":Fn,"aria-orientation":Fn,"aria-selected":Cl,"data-focus-override":Cl,"data-focus-visible-override":Cl,"data-preventdefault":Cl,class:Fn,for:Fn,id:Fn,tabindex:TH,title:Fn,placeholder:Fn};function Pe(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function ma(e,t){if(t!=null)for(const[i,s]of rt(t))i!=="class"&&Pe(e,i,s)}function wl(e,t,i){if(!hd(e))return;const s=e.getAttribute(t);return s===null?i:OH[t]?.(s)??void 0}function _n(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function aM(e,t){for(const[i,s]of rt(t))_n(e,i,s)}function Gt(e,t){const i=Array.isArray(e)?e:e.split(".");if(i.length===1){const[s]=i;return gr((n,a,o)=>n[s]=o,n=>n[s],t)}return gr((s,n,a)=>dy(s,i,a),s=>cy(s,i),t)}function YL(e){return gr((t,i,s)=>t[e]=s)}function Dt(e,t){return gr((i,s,n)=>i[e][t??s]=n)}function _e(e){const{newValue:t,oldValue:i,changeValue:s}=e;return gr((n,a,o,r)=>(o!==r&&(r!==void 0&&i?.call(n,r),o!==void 0&&t?.call(n,o),s?.call(n,o,r)),o))}function Xt(e){return oy(e)}var Mr=class extends X{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};g([_e({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),m],Mr.prototype,"enabled",2),g([Dt("node","stroke"),m],Mr.prototype,"stroke",2),g([Dt("node","strokeOpacity"),m],Mr.prototype,"strokeOpacity",2),g([_e({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),m],Mr.prototype,"strokeWidth",2);function jy(e,t,i,s,n){return t<e.x+e.width&&t+s>e.x&&i<e.y+e.height&&i+n>e.y}function Ng(e,t,i,s=0,n=0){return t>=e.x&&t+s<=e.x+e.width&&i>=e.y&&i+n<=e.y+e.height}function oM(e){return e==null||e.height===0||e.width===0||Number.isNaN(e.height)||Number.isNaN(e.width)}function Tg(e,t){return e===t?!0:e==null||t==null?!1:e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dr(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,e=n+1):t=n-1}return s}function Hc(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,t=n-1):e=n+1}return s}function Wy(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),a=i(n);a==null?t=n-1:(s=a,e=n+1)}return s}function ZL(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),a=i(n);a==null?e=n+1:(s=a,t=n-1)}return s}function rM(e=0,t=0){const i=Kp();return new i(e,t).getContext("2d")}var XL=800,qL=600,QL={quality:1};function JL(e){const t=class extends e{constructor(...s){super(...s),this.gpu=!1}toBuffer(s,n){return super.toBuffer(s,{...n,msaa:!1})}transferToImageBitmap(){const{width:s,height:n}=this,a=new t(Math.max(1,s),Math.max(1,n));return s>0&&n>0&&a.getContext("2d").drawCanvas(this,0,0,s,n),Object.defineProperty(a,"close",{value:()=>{}}),a}};return t}var eN=!1;function tN(e,t){if(eN)return;eN=!0;const i=e.prototype.createConicGradient;Object.defineProperty(e.prototype,"createConicGradient",{value:function(s,n,a){return i.call(this,s+Math.PI/2,n,a)},writable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillText",{value:function(s,n,a){let o=this.outlineText(s);o=o.transform(new t([1,0,0,1,n,a])),this.fill(o)},writable:!0,configurable:!0})}var iN=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},lM=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}};function $y(e,t){return e.valueOf()-t.valueOf()}function PH(e){let t=Number.NaN;const i=[];for(const s of e){const n=s.valueOf();t!==n&&i.push(s),t=n}return i}function Ky(e){const t=e.slice().sort($y);return Uy(t)==null?PH(t):t}function Uy(e){if(e.length===0)return 1;const t=Number(e.at(-1))>Number(e[0])?1:-1;let i=-1/0*t;for(const s of e){const n=s.valueOf();if(Math.sign(n-i)!==t)return;i=n}return t}function Yy(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");un(i)}}function sN(e,t){const i=Yy(),s=t?.default;return gr((n,a,o)=>(o!==s&&i(a.toString(),e),o))}function nN(e,t){const i=Yy();return gr((s,n,a)=>(a!==s[e]&&(i(n.toString(),`Use [${e}] instead.`),dy(s,e,t?t(a):a)),dg),(s,n)=>(i(n.toString(),`Use [${e}] instead.`),cy(s,e)))}function cM(e,t){const i=Math.max(e.length,t.length),s=new Set,n=new Set;for(let a=0;a<i;a++){const o=e[a],r=t[a];o!==r&&(n.has(r)?n.delete(r):r&&s.add(r),s.has(o)?s.delete(o):o&&n.add(o))}return{changed:s.size>0||n.size>0,added:s,removed:n}}function Og(e,t,i,s){const n=e-i,a=t-s;return n*n+a*a}function kr(e,t,i,s,n,a,o){if(i===n&&s===a)return Math.min(o,Og(e,t,i,s));const r=n-i,l=a-s,c=Math.max(0,Math.min(1,((e-i)*r+(t-s)*l)/(r*r+l*l))),h=i+c*r,d=s+c*l;return Math.min(o,Og(e,t,h,d))}function aN(e,t,i,s,n,a,o,r,l){r&&([o,a]=[a,o]);const c=Math.atan2(t-s,e-i);if(!Qs(c,a,o)){const d=i+Math.cos(a)*n,u=s+Math.sin(a)*n,p=i+Math.cos(a)*n,f=s+Math.sin(a)*n;return Math.min(l,Og(e,t,d,u),Og(e,t,p,f))}const h=n-Math.sqrt(Og(e,t,i,s));return Math.min(l,h*h)}function Ga(e,t){if(e.length===0)return null;if(t!==void 0){const a=e.at(0),o=e.at(-1),r=a instanceof Date?a.getTime():a,l=o instanceof Date?o.getTime():o;if(typeof r=="number"&&typeof l=="number")return t===1?[r,l]:[l,r]}let i=1/0,s=-1/0;for(const a of e){const o=a instanceof Date?a.getTime():a;typeof o=="number"&&(o<i&&(i=o),o>s&&(s=o))}const n=[i,s];return n.every(Number.isFinite)?n:null}function Gc(e,t,i,s,n,a,o){let r=!1;const l=Ga(e,o),c=l&&a?[a(l[0]),a(l[1])]:l;if(c==null){let u;return t!=null&&i!=null&&t<=i?u=[t,i]:s!=null&&n!=null&&s<=n&&(u=[s,n]),{extent:u??[],clipped:!1}}let[h,d]=c;return t!=null?(r||(r=t>h),h=t):s!=null&&s<h&&(h=s),i!=null?(r||(r=i<d),d=i):n!=null&&n>d&&(d=n),h>d?{extent:[],clipped:!1}:{extent:[h,d],clipped:r}}function Pg(e,t,i,s,n){const{extent:a,clipped:o}=Gc(e.domain,gt(t)?new Date(t):t,gt(i)?new Date(i):i,gt(s)?new Date(s):s,gt(n)?new Date(n):n,r=>new Date(r),e.sortMetadata?.sortOrder);return{extent:a.map(r=>new Date(r)),clipped:o}}var EH=new Intl.NumberFormat("en-US",{style:"percent"});function ya(e,t=2){return typeof e=="number"?dM(e,t):typeof e=="string"?e:String(e??"")}function hM(e){return EH.format(e)}var oN=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function dM(e,t){let i=oN.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),oN.set(t,i)),i.format(e)}function rN(e){return Array.isArray(e)&&e.length>=2&&e.every(Be)}function Zy(e){return Array.isArray(e)&&e.length>=2&&e.every(rN)}function RH(e){const t=e[0],i=e.at(-1);return i===void 0?!1:He(t[0],i[0],.001)&&He(t[1],i[1],.001)}function lN(e){return Array.isArray(e)&&e.every(Zy)&&e.every(RH)}function cN(e){if(e===null)return!0;if(!ge(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(cN);case"MultiPolygon":return Array.isArray(i)&&i.every(lN);case"Polygon":return lN(i);case"MultiLineString":return Array.isArray(i)&&i.every(Zy);case"LineString":return Zy(i);case"MultiPoint":return Zy(i);case"Point":return rN(i);default:return!1}}function zH(e){return ge(e)&&e.type==="Feature"&&cN(e.geometry)}function VH(e){return ge(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(zH)}var Ll=ze(VH,"a GeoJSON object"),uM=class{constructor(e,t,i){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e,this.processedEdge=t,this.singleValueEdges=i}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(e){const t=new pM(e);return this._vertexCount++,t}addEdge(e,t,i){i===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:s}=e,n=s.get(i);n?n.includes(t)||(this.singleValueEdges?.has(i)?s.set(i,[t]):(n.push(t),this._edgeCount++)):(s.set(i,[t]),this._edgeCount++)}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[,i]of t)this._vertexCount-=i.length;e.clear()}}removeEdge(e,t,i){const s=e.edges.get(i);if(!s)return;const n=s.indexOf(t);n!==-1&&(s.splice(n,1),s.length===0&&e.edges.delete(i),this._edgeCount--,i===this.cachedNeighboursEdge&&e.readCachedNeighbours()?.delete(t.value))}removeEdges(e,t){e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[,t]of e.edges)for(const i of t)yield i}*neighboursAndEdges(e){for(const[t,i]of e.edges)for(const s of i)yield[s,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const i=this.findNeighbour(e,t);if(i)return this.getVertexValue(i)}findNeighbourWithValue(e,t,i){const s=i==null?this.neighbours(e):this.neighboursWithEdgeValue(e,i);if(s){for(const n of s)if(this.getVertexValue(n)===t)return n}}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let n;for(const a of t)if(n=(n??e).readCachedNeighbours()?.get(a),!n)return;return n}if(t.length===0)return;let s=e;for(const n of t){const a=s?this.neighboursWithEdgeValue(s,i):void 0;if(!a)return;s=a.find(o=>o.value===n)}return s}adjacent(e,t){for(const[,i]of e.edges)if(i.includes(t))return!0;return!1}},pM=class{constructor(e){this.value=e,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}},gM="class-instance";function Hn(e,t,i){if(De(t)){if(!De(e)||e.length!==t.length||t.some((s,n)=>Hn(e[n],s,i)!=null))return t}else if(We(t)){if(!We(e))return t;const s={},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const a of n)if(e[a]!==t[a])if(i?.has(a))s[a]=t[a];else if(typeof e[a]==typeof t[a]){const o=Hn(e[a],t[a],i);o!==null&&(s[a]=o)}else s[a]=t[a];return Object.keys(s).length?s:null}else if(e!==t)return t;return null}function fM(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Te(e,t){return De(e)?BH(e,t):We(e)?FH(e,t):e instanceof Map?new Map(Te(Array.from(e))):Nl(e)}function BH(e,t){const i=[],s=t?.seen;for(const n of e){if(typeof n=="object"&&s?.includes(n)){uo("cycle detected in array",n);continue}s?.push(n),i.push(Te(n,t)),s?.pop()}return i}function FH(e,t){const i={};for(const s of Object.keys(e))t?.assign?.has(s)?i[s]=e[s]:t?.shallow?.has(s)?i[s]=Nl(e[s]):i[s]=Te(e[s],t);return i}function Nl(e){return De(e)?e.slice(0):We(e)?{...e}:Cs(e)?new Date(e):e0(e)?new RegExp(e.source,e.flags):e}function ko(e,t,i,s,n,a){if(De(e)){a=t(e,s,n,a);let o=0;for(const r of e)a=ko(r,t,i,s?.[o],n,a),o++}else if(We(e)){a=t(e,s,n,a);for(const o of Object.keys(e)){if(i?.has(o))continue;const r=e[o];a=ko(r,t,i,s?.[o],n,a)}}return a}function $d(e,t,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:a=[]}=i;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(t==null)return e;if(Vc(e))return e.set(t);const o=e,r=mM(e);for(const l of Object.keys(t)){if(hy.has(l))continue;const c=`${n?n+".":""}${l}`;if(a.includes(c))continue;const h=t[l],d=`${s?s+".":""}${l}`,u=o.constructor,p=o[l];try{const f=mM(p),y=mM(h);if(r===gM&&!(l in e||l==="context")){if(h===void 0)continue;uo(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}if(f!=null&&y!=null&&y!==f&&(f!==gM||y!=="object")){uo(`unable to set [${d}] in ${u?.name} - can't apply type of [${y}], allowed types are: [${f}]`);continue}if(Vc(p))h===void 0?p.clear():p.set(h);else if(y==="object"&&l!=="context"){if(!(l in o)){uo(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}p==null?o[l]=h:$d(p,h,{...i,path:d,matcherPath:c})}else o[l]=h}catch(f){uo(`unable to set [${d}] in [${u?.name}]; nested error is: ${f.message}`)}}return e}function mM(e){return e==null?null:Hm(e)||Cs(e)?"primitive":De(e)?"array":ge(e)?We(e)?"object":gM:Pa(e)?"function":"primitive"}function st(e,t,i,s){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i,s)}function Xy(e,t,i=["Escape"]){return st(e,"keydown",s=>{qy(s,...i)&&t(s)})}function yM(e,t){const i=st(Re(),"mousedown",s=>{[0,2].includes(s.button)&&!hN(e,s)&&(t(),i())});return i}function xM(e,t){const i=st(Re(),"touchstart",s=>{Array.from(s.targetTouches).some(a=>!hN(e,a))&&(t(),i())});return i}function hN(e,t){return Fm(t.target)&&t.target.shadowRoot!=null?!0:Up(t.target)&&e.contains(t.target)}function bM(e,t,i){const s=n=>{for(const a of t)Pe(a,"data-focus-visible-override",n)};return s(i),st(e,"keydown",()=>s(!0),{once:!0})}function Kd(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function qy(e,...t){return Kd(e)&&t.includes(e.key)}function dN(e,t,i){return st(e,"keydown",s=>{qy(s,i)&&t.focus()})}var Ud={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function Qy(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:a,onBlur:o}=e,{nextKey:r,prevKey:l}=Ud[t],c=p=>{if(p.target&&"tabIndex"in p.target){for(const f of i)f.tabIndex=-1;p.target.tabIndex=0}},[h,d]=s?[i.length,i.length]:[0,1/0],u=new pt;for(let p=0;p<i.length;p++){const f=i[(h+p-1)%d],y=i[p],b=i[(h+p+1)%d];u.register(st(y,"focus",c),a&&st(y,"focus",a),o&&st(y,"blur",o),n&&Xy(y,n),f&&dN(y,f,l),b&&dN(y,b,r),st(y,"keydown",x=>{qy(x,r,l)&&x.preventDefault()})),y.tabIndex=p===0?0:-1}return u}function uN(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function Jy(e){return"button"in e?e.button===0:Kd(e)&&(e.code==="Space"||e.key==="Enter")}function ex(e){const t=e?.target;if(Fm(t)&&"tabindex"in t.attributes)return t}function vM(e){return st(e,"keydown",t=>{if(t.defaultPrevented)return;wl(t.target,"data-preventdefault",!0)&&qy(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var SM=new Map,pN=1;function gN(){SM.clear(),pN=1}function Ii(e){const t=e.constructor;let i=Object.hasOwn(t,"className")?t.className:t.name;DL(()=>{if(!i)throw new Error(`The ${String(t)} is missing the 'className' property.`)}),i??(i="Unknown");const s=(SM.get(i)??0)+1;return SM.set(i,s),`${i}-${s}`}function Ir(){return`ag-charts-${pN++}`}function Yd(){return crypto.randomUUID?.()??_H()}function _H(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let i=0;i<e.length;i++)(i===4||i===6||i===8||i===10)&&(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}function tx(e,t,i){let s=e,n=s;for(const a of t)if(s==null||i(s.value,a)>0)s={value:a,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,a)<=0;)n=n.next;n.next={value:a,next:n.next}}return s}var Eg=new WeakMap;function Zd(e,t){const i=JSON.stringify(e,null,0);return Eg.has(t)||Eg.set(t,new Map),Eg.get(t)?.has(i)||Eg.get(t)?.set(i,t(e)),Eg.get(t)?.get(i)}var MM=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function Ar(e,t){let i=new MM;const s=(...n)=>{let a=i;for(const o of n){const r=typeof o=="object"||typeof o=="symbol"?a.weak:a.strong;let l=r.get(o);l==null&&(l=new MM,r.set(o,l)),a=l}if(a.set)return t?.("hit",e,n),a.value;{const o=e(...n);return a.set=!0,a.value=o,t?.("miss",e,n),o}};return s.reset=()=>{i=new MM},s}function Ki(e,t){const i=new Map,s=(...o)=>o.map(r=>typeof r=="object"||typeof r=="symbol"?r:(i.has(r)||i.set(r,{v:r}),i.get(r))),n={},a=new WeakMap;return(...o)=>{const r=o.length===0?[n]:s(...o);let l=a;for(const d of r.slice(0,-1))l.has(d)||l.set(d,new WeakMap),l=l.get(d);const c=r.at(-1);let h=l.get(c);return h?t?.("hit",e,o):(h=e(...o),l.set(c,h),t?.("miss",e,o)),h}}function Xd(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const a of i){const o=a.distanceSquared(e,t);if(o===0)return{nearest:a,distanceSquared:0};o<n.distanceSquared&&(n.nearest=a,n.distanceSquared=o)}return n}function DM(e,t,i,s=1/0){const{x:n=e,y:a=t}=i.transformPoint?.(e,t)??{},o={nearest:void 0,distanceSquared:s};for(const r of i.children){const{nearest:l,distanceSquared:c}=r.nearestSquared(n,a,o.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<o.distanceSquared&&(o.nearest=l,o.distanceSquared=c)}return o}var Cr=class extends X{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}};g([m],Cr.prototype,"top",2),g([m],Cr.prototype,"right",2),g([m],Cr.prototype,"bottom",2),g([m],Cr.prototype,"left",2);function ix(e,t,i,s){let{top:n,right:a,bottom:o,left:r,width:l,height:c}=s;return r!=null?l!=null?a=i.width-r+l:a!=null&&(l=i.width-r-a):a!=null&&l!=null&&(r=i.width-a-l),n!=null?c!=null?o=i.height-n-c:o!=null&&(c=i.height-o-n):o!=null&&c!=null&&(n=i.height-o-c),l==null?c==null?(c=t,l=e):l=Math.ceil(e*c/t):c??(c=Math.ceil(t*l/e)),r==null&&(a==null?r=Math.floor((i.width-l)/2):r=i.width-a-l),n==null&&(o==null?n=Math.floor((i.height-c)/2):n=i.height-c-o),{x:r,y:n,width:l,height:c}}var kM="color: green",IM="color: grey";function Je(){return oy(()=>{})}function AM(e,t){const i=fr(t);if(i.length===0)return;const s=C0(e);for(const n of i)n in s&&(t[n]=s[n])}var fN=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},CM=class Nn extends fN{constructor(t,i,s){super(),this.defaultState=t,this.states=i,this.enterEach=s,this.debug=ML(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,kM)}transition(t,i){if(!this.transitionChild(t,i)||this.state===Nn.child||this.state===Nn.parent)return;const n=this.state,a=this.states[this.state];let o=a[t];const r=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(o))o=o.find(h=>{if(!h.guard)return!0;const d=h.guard(i);return d||this.debug(`${r} (guarded)`,h.target,IM),d});else if(typeof o=="object"&&!(o instanceof Nn)&&o.guard&&!o.guard(i)){this.debug(`${r} (guarded)`,o.target,IM);return}if(!o){this.debug(`${r} ${this.state}`,IM);return}const l=this.getDestinationState(o),c=l===this.state?void 0:a.onExit;this.debug(`${r} ${l}`,kM),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof Nn)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==Nn.child&&l!==Nn.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===Nn.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==Nn.child||!this.childState||(AM(this,this.childState),this.childState.transition(t,i),!this.childState.is(Nn.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,kM),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let i=this.state;return typeof t=="string"?i=t:t instanceof Nn?(this.childState=t,this.childState.parent=this,i=Nn.child):typeof t=="object"&&(t.target instanceof Nn?(this.childState=t.target,this.childState.parent=this,i=Nn.child):t.target!=null&&(i=t.target)),i}};CM.child="__child",CM.parent="__parent";var de=CM,wM=class extends fN{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)AM(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)AM(this,i),i.transitionAsync(e,t)}},sx=class{constructor(e,t){this.ctx=e,this.measureTextCached=t,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(e){if(e==="alphabetic")return 0;if(this.baselineMap.has(e))return this.baselineMap.get(e);this.ctx.textBaseline=e;const{alphabeticBaseline:t}=this.ctx.measureText("");return this.baselineMap.set(e,t),this.ctx.textBaseline="alphabetic",t}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(e){const t=this.measureTextCached?.(e)??this.ctx.measureText(e),{width:i,fontBoundingBoxAscent:s=t.emHeightAscent,fontBoundingBoxDescent:n=t.emHeightDescent}=t,a=s+n;return{width:i,height:a,ascent:s,descent:n}}measureLines(e){const t=typeof e=="string"?e.split(sr):e;let i=0,s=0;const n=t.map(a=>{const o=this.measureText(a);return i<o.width&&(i=o.width),s+=o.height,{text:a,...o}});return{width:i,height:s,lineMetrics:n}}textWidth(e,t){if(t){let i=0;for(let s=0;s<e.length;s++)i+=this.textWidth(e.charAt(s));return i}return e.length>1?this.ctx.measureText(e).width:this.charMap.get(e)??this.charWidth(e)}charWidth(e){const{width:t}=this.ctx.measureText(e);return this.charMap.set(e,t),t}},LM=new Wp(50);function et(e){typeof e=="object"&&(e=Gm(e));let t=LM.get(e);if(t)return t;const i=new Wp(1e4),s=rM();return s.font=e,t=new sx(s,n=>{let a=i.get(n);return a||(a=s.measureText(n),i.set(n,a),a)}),LM.set(e,t),t}et.clear=()=>LM.clear();function Js(e,t){let i={segments:[],width:0,height:0,ascent:0,descent:0};const s=[i];for(const o of e){const{text:r,fontSize:l=t.fontSize,fontStyle:c=t.fontStyle,fontWeight:h=t.fontWeight,fontFamily:d=t.fontFamily,...u}=o,p={fontSize:l,fontStyle:c,fontWeight:h,fontFamily:d},f=et(p),y=At(r).split(sr);for(let b=0;b<y.length;b++){const x=y[b],v=f.measureText(x);b>0&&(i={segments:[],width:0,height:0,ascent:0,descent:0},s.push(i)),x&&(i.width+=v.width,i.ascent=Math.max(i.ascent,v.ascent),i.descent=Math.max(i.descent,v.descent),i.height=Math.max(i.height,i.ascent+i.descent),i.segments.push({...p,...u,text:x,textMetrics:v}))}}let n=0,a=0;for(const o of s)n=Math.max(n,o.width),a+=o.height;return{width:n,height:a,lineMetrics:s}}function ye(e,t,i){const s=dn().createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const n of t.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function jt(e){return dn().createElementNS("http://www.w3.org/2000/svg",e)}function NM(e,t){const i=dn("body"),s=ye("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>s.remove())}function mN(e,t){return t.overflow==="hide"&&e.some(nr)}function qd(e,t){return De(e)?ax(e,t):Qd(At(e),t).join(`
`)}function Io(e,t){return Qd(e,t).join(`
`)}function Qd(e,t){return nx(e,t)}function Tl(e,t,i,s){const n=t.textWidth(pd);let a=0,o=0;for(;o<e.length;o++){const r=t.textWidth(e.charAt(o));if(a+r>i)break;a+=r}if(e.length===o&&(!s||a+n<=i))return s?jm(e):e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+n>i;)e=e.slice(0,-1).trimEnd();return jm(e)}function nx(e,t,i=0){const s=e.split(sr),n=et(t.font),a=[];if(t.textWrap==="never"){for(const c of s){const h=Tl(c.trimEnd(),n,Math.max(0,t.maxWidth-i));if(!h)break;a.push(h),i=0}return mN(a,t)?[]:a}const o=t.textWrap==="hyphenate",r=t.textWrap==null||t.textWrap==="on-space";for(const c of s){let h=c.trimEnd();if(h===""){a.push(h);continue}let d=0,u=0,p=0;for(a.length||(u=i);d<h.length;){const f=h.charAt(d);if(f===" "&&(p=d),u+=n.textWidth(f),u>t.maxWidth){if(d===0){h="";break}let y=n.textWidth(h.slice(0,d+1));if(a.length||(y+=i),y<=t.maxWidth){u=y,d++;continue}if(p){const v=HH(h,p+1),S=n.textWidth(v);if(S<=t.maxWidth){a.push(h.slice(0,p).trimEnd()),h=h.slice(p).trimStart(),d=0,u=0,p=0;continue}else r&&S>t.maxWidth&&a.push(h.slice(0,p).trimEnd(),Tl(h.slice(p).trimStart(),n,t.maxWidth,!0))}else if(r){const v=Tl(h,n,t.maxWidth,!0);v&&a.push(v)}if(r){h="";break}const b=o?"-":"";let x=h.slice(0,d).trim();for(;x.length&&n.textWidth(x+b)>t.maxWidth;)x=x.slice(0,-1).trimEnd();if(x&&x!==gd)a.push(x+b);else{h="";break}h=h.slice(x.length).trimStart(),d=-1,u=0,p=0}d++}h&&a.push(h)}GH(a,n,t);const l=TM(a,n,t);return mN(l,t)?[]:l}function HH(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}function TM(e,t,i){if(!Be(i.maxHeight))return e;const{height:s,lineMetrics:n}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let a=0,o=0;a<n.length;a++)if(o+=n[a].height,o>i.maxHeight){if(i.overflow==="hide"||a===0)return[];const r=e.slice(0,a),l=r.pop();return r.concat(nr(l)?l:Tl(l,t,i.maxWidth,!0))}return e}function GH(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:s}=e,n=e[s-1],a=e[s-2];if(a.length<n.length)return;const o=a.lastIndexOf(" ");if(o===-1||o===a.indexOf(" ")||n.includes(" "))return;const r=a.slice(o+1);t.textWidth(n+r)<=i.maxWidth&&(e[s-2]=a.slice(0,o),e[s-1]=r+" "+n)}function ax(e,t){const{maxHeight:i=1/0}=t,s=[];let n=0,a=0;function o(){const r=s.pop();if(!r)return;const l=et(r),c=Tl(r.text,l,t.maxWidth,!0),h=l.measureText(c);s.push({...r,text:c,textMetrics:h})}for(const{width:r,height:l,segments:c}of Js(e,t.font).lineMetrics){if(a+l>i){s.length&&o();break}if(n+r<=t.maxWidth){n+=r,a+=l,s.push(...c);continue}for(const h of c){if(n+h.textMetrics.width<=t.maxWidth){n+=h.textMetrics.width,s.push(h);continue}const d=et(h),u=i0(h.text),p={...t,font:h,maxHeight:i-a};let f=nx(u,{...p,overflow:"hide"},n);if(f.length===0)if(t.textWrap==="never")f=nx(u,p,n);else{f=nx(u,p);const x=s.at(-1);x&&(x.text+=`
`,n=0)}if(f.length===0){o();break}const y=f.findIndex(nr);y!==-1&&(f=f.slice(0,y+1));const b=f.at(-1);for(const x of f){const v=s0(x),S=d.measureText(v),M={...h,text:v,textMetrics:S};x===b?n+=S.width:(M.text+=`
`,n=0),a+=S.height,s.push(M)}if(y!==-1)break}}return s}function Rg(e,[t,i],[s,n]){const a=n-s,o=i-t,r=t+o*e[0],l=t+o*e[1];return[(r-s)/a,(l-s)/a]}var jc=1e3,wr=jc*60,Ol=wr*60,Pl=Ol*24,OM=Pl*7,ox=Pl*30,Jd=Pl*365,eu=new Date().getTimezoneOffset()*wr,tu={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:jc,hierarchy:"day",encode(e,t){const i=t?0:eu;return Math.floor((e.getTime()-i)/jc)},decode(e,t){const i=t?0:eu;return new Date(i+e*jc)}},minute:{milliseconds:wr,hierarchy:"day",encode(e,t){const i=t?0:eu;return Math.floor((e.getTime()-i)/wr)},decode(e,t){const i=t?0:eu;return new Date(i+e*wr)}},hour:{milliseconds:Ol,hierarchy:"day",encode(e,t){const i=t?0:eu;return Math.floor((e.getTime()-i)/Ol)},decode(e,t){const i=t?0:eu;return new Date(i+e*Ol)}},day:{milliseconds:Pl,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*wr;return Math.floor((e.getTime()-i)/Pl)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:ox,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const i=Math.floor(e/12),s=e-i*12;return new Date(Date.UTC(i,s,1))}else{const i=Math.floor(e/12),s=e-i*12;return new Date(i,s,1)}}},year:{milliseconds:Jd,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){let i;return t?(i=new Date,i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(e,0,1,0,0,0,0),i}}};function zg(e){return typeof e=="string"?{unit:e,step:1,epoch:void 0,utc:!1}:{unit:e.unit,step:e.step??1,epoch:e.epoch,utc:e.utc??!1}}function Vg(e,t,i,s){if(i==null)return 0;const n=tu[e];return Math.floor(n.encode(new Date(i),s))%t}function iu(e,t,i,s,n){const a=tu[t];return Math.floor((a.encode(new Date(e),s)-n)/i)}function su(e,t,i,s,n){return tu[t].decode(e*i+n,s)}function rx(e,t,i,s,n){const a=new Date(e),o=iu(a,t,i,s,n);return su(o,t,i,s,n)}function lx(e,t,i,s,n){const a=new Date(Number(e)-1),o=iu(a,t,i,s,n);return su(o+1,t,i,s,n)}function en(e,t){const{unit:i,step:s,epoch:n,utc:a}=zg(e),o=Vg(i,s,n,a);return rx(t,i,s,a,o)}function PM(e,t){const{unit:i,step:s,epoch:n,utc:a}=zg(e),o=Vg(i,s,n,a);return lx(t,i,s,a,o)}function EM(e,t){const{unit:i,step:s,epoch:n,utc:a}=zg(e),o=Vg(i,s,n,a);return su(iu(lx(t,i,s,a,o),i,s,a,o)-1,i,s,a,o)}function cx(e,t){const{unit:i,step:s,epoch:n,utc:a}=zg(e),o=Vg(i,s,n,a);return su(iu(rx(t,i,s,a,o),i,s,a,o)+1,i,s,a,o)}function hx(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const s=t.valueOf()-e.valueOf(),n=e.valueOf();e=new Date(n+i[0]*s),t=new Date(n+i[1]*s)}return[new Date(e),new Date(t)]}function Bg(e,t,i,{extend:s=!1,visibleRange:n=[0,1],limit:a,defaultAlignment:o="start"}={}){const r=zg(e),{unit:l,step:c,utc:h}=r;let d;r.epoch!=null?d=r.epoch:o==="interval"?d=void 0:t.valueOf()>i.valueOf()?d=i:d=t;const u=Vg(r.unit,r.step,d,r.utc);let[p,f]=hx(t,i,n);p=s?rx(p,l,c,h,u):lx(p,l,c,h,u),f=s?lx(f,l,c,h,u):rx(f,l,c,h,u);const y=iu(p,l,c,h,u);let b=iu(f,l,c,h,u);return a!=null&&b-y>a&&(b=y+a),{range:[y,b],unit:l,step:c,utc:h,offset:u}}function Fg(e,t,i,s){const{range:[n,a]}=Bg(e,t,i,s);return Math.abs(a-n)}function Gn(e,t,i,s){const{range:[n,a],unit:o,step:r,utc:l,offset:c}=Bg(e,t,i,s),h=[];for(let d=n;d<=a;d+=1){const u=su(d,o,r,l,c);h.push(u)}return h}function RM(e,t,i,s){const{range:[n,a],unit:o,step:r,utc:l,offset:c}=Bg(e,t,i,s),h=Math.max(0,a-n+1),d=new Array(h);for(let u=0;u<h;u++)d[u]=n+u;return{encodedValues:d,encodingParams:{unit:o,step:r,utc:l,offset:c}}}function zM(e,t){return su(e,t.unit,t.step,t.utc,t.offset)}var VM=new Date().getTimezoneOffset()*6e4,jH=1e3,WH=6e4,$H=36e5;function Lr(e,t){const{unit:i,step:s,utc:n,offset:a}=t,o=e*s+a;switch(i){case"millisecond":return o;case"second":return(n?0:VM)+o*jH;case"minute":return(n?0:VM)+o*WH;case"hour":return(n?0:VM)+o*$H;default:return tu[i].decode(o,n).valueOf()}}function dx(e,t,i,{extend:s,visibleRange:n,limit:a,defaultAlignment:o}={}){const{range:[r]}=Bg(e,t,i,{extend:s,visibleRange:n,limit:a,defaultAlignment:o}),{range:[l]}=Bg(e,t,i,{extend:s,limit:a,defaultAlignment:o});return r-l}function xa(e){return typeof e=="string"?e:e.unit}function ja(e){return typeof e=="string"?1:e.step??1}function El(e){return typeof e=="string"?void 0:e.epoch}function nu(e){return tu[xa(e)].hierarchy}function cs(e){return ja(e)*tu[xa(e)].milliseconds}var qt=(e,t)=>({duration:cs(e)*t,timeInterval:e,step:t}),_g=[qt({unit:"second"},1),qt({unit:"second"},5),qt({unit:"second"},15),qt({unit:"second"},30),qt({unit:"minute"},1),qt({unit:"minute"},5),qt({unit:"minute"},15),qt({unit:"minute"},30),qt({unit:"hour"},1),qt({unit:"hour"},3),qt({unit:"hour"},6),qt({unit:"hour"},12),qt({unit:"day"},1),qt({unit:"day"},2),qt({unit:"day",step:7},1),qt({unit:"day",step:7},2),qt({unit:"day",step:7},3),qt({unit:"month"},1),qt({unit:"month"},2),qt({unit:"month"},3),qt({unit:"month"},4),qt({unit:"month"},6),qt({unit:"year"},1)],yN=[1,2,5,10];function xN(e,t){return Math.abs(Math.round(e)-e)<t}function bN(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function Wc(e,t,i,s,n,a){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(i<2)return{ticks:[e,t],count:2,firstTickIndex:0};const o=$c(e,t,i,s,n);if(!Number.isFinite(o))return{ticks:[],count:0,firstTickIndex:void 0};let r=e,l=t;xN(r/o,1e-12)||(r=Math.ceil(r/o)*o),xN(l/o,1e-12)||(l=Math.floor(l/o)*o),a!=null&&(a=Rg(a,[e,t],[r,l]));const{ticks:c}=Kc(r,l,o,a),h=c.at(0);return{ticks:c,count:bN(r,l,o),firstTickIndex:h==null?void 0:Math.round((h-r)/o)}}var KH=Math.floor(2*OM/ox*10)/10;function vN({timeInterval:e,step:t}){const i=cs(e)*t,s=nu(e),n=s?cs(s):void 0;return i<=(n??1/0)*KH}function ux(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function au(e,t,i,s,n,{weekStart:a,primaryOnly:o=!1,targetInterval:r}){if(i<=0)return;const l=r??Math.abs(t-e)/Math.max(i,1),c=_g.findLast(p=>(!o||vN(p))&&l>p.duration),h=_g.find(p=>(!o||vN(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max($c(e,t,i,s,n),1)};if(h==null)return{unit:"year",step:r==null?$c(e/Jd,t/Jd,i,s,n):1};const{timeInterval:d,step:u}=l-c.duration<h.duration-l?c:h;return{unit:d.unit,step:ja(d)*u,epoch:ux(d,{weekStart:a})}}function $c(e,t,i,s=0,n=1/0){if(e===t)return ae(1,s,n);if(i<1)return Number.NaN;const a=Math.abs(t-e),o=10**Math.floor(Math.log10(a/i));let r=Number.NaN,l=1/0,c=!1;for(const h of yN){const d=Math.ceil(a/(h*o)),u=d>=s&&d<=n;if(c&&!u)continue;const p=Math.abs(d-i);(l>p||c!==u)&&(c||(c=u),l=p,r=h)}return r*o}function SN(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function px(e,t){const i=tg(t??",f");if(i==null)return;(i.precision==null||Number.isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n))return 0;const[a,o]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(a!=="1"&&a!=="-1"?1:0)+SN(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const a=Math.floor(Math.log10(Math.abs(n))),o=i.type?6:12,r=n.toExponential(o-1).split(/[.e]/g)[1],l=SN(r);return Math.max(0,l-a)}))));const s=qm(i);return n=>s(Number(n))}function Kc(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const n=10**Pc(i),a=Math.min(e,t),o=Math.max(e,t);let r,l;if(s!=null&&(s[0]!==0||s[1]!==1)){const d=t-e,u=e+d*s[0],p=t-d*(1-s[1]);r=Math.min(u,p),l=Math.max(u,p)}else r=a,l=o;r=Math.floor(r*n)/n,l=Math.ceil(l*n)/n;const c=[];for(let d=0;;d+=1){const u=Math.round((a+i*d)*n)/n;if(u>o)break;u>=r&&u<=l&&c.push(u)}const h=c.at(0);return{ticks:c,count:bN(a,o,i),firstTickIndex:h==null?void 0:Math.round((h-a)/i)}}function Rl(e,t){return e>=t?(un("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function gx(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let n=1/0,a=[e,t];for(const o of yN){const r=o*s,l=Math.floor(e/r)*r,c=Math.ceil(t/r)*r,h=1-i/Math.abs(c-l);n>h&&(n=h,a=[l,c])}return a}function fx(e,t,i,s,n,a){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};a=Math.max(a,e/(n+1)),i??(i=a),s??(s=e),i>s&&(i===a?i=s:s=i),i=Math.max(i,1);const o=Math.max(1,Math.floor(e/(t*i))),r=Math.min(o,Math.ceil(e/(t*s))),l=ae(r,Math.floor(n/t),o);return{minTickCount:r,maxTickCount:o,tickCount:l}}function Ui(e){return e instanceof Date?e.getTime():e}function ou(e){return e<jc?"millisecond":e<wr?"second":e<Ol?"minute":e<Ol*23?"hour":e<28*Pl?"day":e<Jd?"month":"year"}function Hg(e){if(e.length===0)return"millisecond";if(e.length===1)return ru(e[0]);let t=1/0;for(let i=1;i<e.length;i++)t=Math.min(t,Math.abs(e[i].valueOf()-e[i-1].valueOf()));return ou(t)}function ru(e){return en("second",e)<e?"millisecond":en("minute",e)<e?"second":en("hour",e)<e?"minute":en("day",e)<e?"hour":en("month",e)<e?"day":en("year",e)<e?"month":"year"}function Gg(e){const[t,i]=e.length===0?[0,0]:Tt([e[0].valueOf(),e.at(-1).valueOf()]),s=new Date(t).getFullYear(),n=new Date(i).getFullYear();if(s!==n)return;const a=new Date(t).getMonth(),o=new Date(i).getMonth();if(a!==o)return"year";const r=new Date(t).getDate(),l=new Date(i).getDate();return r!==l?"month":"day"}function jg(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}function mx(e){return e!=null&&Object.hasOwn(e,"toString")&&Bt(e.toString())}function BM(e){return e!=null&&Object.hasOwn(e,"valueOf")&&Be(e.valueOf())}function Uc(e){return Be(e)||fl(e)||BM(e)}function FM(e,t){return e!=null&&(!t||Uc(e))}function Wg(e){return mx(e)&&Object.hasOwn(e,"id")?e.id:e}function yx(e){return mx(e)&&Object.hasOwn(e,"value")?e.value:e}var H={};Ws(H,{add:()=>UH,angle:()=>QH,apply:()=>rG,distance:()=>ZH,distanceSquared:()=>XH,equal:()=>aG,from:()=>oG,gradient:()=>eG,intercept:()=>tG,intersectAtX:()=>sG,intersectAtY:()=>iG,length:()=>xx,lengthSquared:()=>MN,multiply:()=>YH,normalized:()=>qH,origin:()=>DN,required:()=>lG,rotate:()=>JH,round:()=>nG,sub:()=>_M});function UH(e,t){return typeof t=="number"?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function _M(e,t){return typeof t=="number"?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function YH(e,t){return typeof t=="number"?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function xx(e){return Math.hypot(e.x,e.y)}function MN(e){return e.x*e.x+e.y*e.y}function ZH(e,t){return xx(_M(e,t))}function XH(e,t){return MN(_M(e,t))}function qH(e){const t=xx(e);return{x:e.x/t,y:e.y/t}}function QH(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function JH(e,t,i=DN()){const s=xx(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function eG(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function tG(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function iG(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function sG(e,t,i=0,s){const n=e===1/0?1/0:e*i+t;return{x:i,y:s==null?n:s-n}}function nG(e,t=2){return{x:Sd(e.x,t),y:Sd(e.y,t)}}function aG(e,t){return e.x===t.x&&e.y===t.y}function oG(e,t){if(typeof e=="number")return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function rG(e,t){return e.x=t.x,e.y=t.y,e}function lG(e){return{x:e?.x??0,y:e?.y??0}}function DN(){return{x:0,y:0}}var ve={};Ws(ve,{bottomCenter:()=>pG,center:()=>uG,clone:()=>yG,collides:()=>xG,end:()=>hG,from:()=>bG,height:()=>fG,normalise:()=>bx,origin:()=>vG,round:()=>mG,start:()=>cG,topCenter:()=>dG,width:()=>gG});function cG(e){return{x:e.x1,y:e.y1}}function hG(e){return{x:e.x2,y:e.y2}}function dG(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function uG(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function pG(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function gG(e){return Math.abs(e.x2-e.x1)}function fG(e){return Math.abs(e.y2-e.y1)}function mG(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function yG(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function xG(e,t){const i=bx(e),s=bx(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function bx(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function bG(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return bx({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)}function vG(){return{x1:0,y1:0,x2:0,y2:0}}function Qt(e){return ge(e)&&e.type=="gradient"}function kN(e){return De(e)&&e.every(Qt)}function HM(e){return De(e)&&e.every(t=>typeof t=="string")}function jn(e){return e!==null&&ge(e)&&e.type=="pattern"}function Wa(e){return e!==null&&ge(e)&&e.type=="image"}function IN(e){return Qt(e)||jn(e)}function $a(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function $g(e,t,i,s,n){if(n<=Math.min(e,s))return e<s?0:1;if(n>=Math.max(e,s))return e<s?1:0;let a=0,o=1,r=Number.NaN;for(let l=0;l<12;l+=1)r=(a+o)/2,$a(e,t,i,s,r)<n?a=r:o=r;return r}function lu(e,t,i,s,n,a,o,r,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*s,d=(1-l)*i+l*n,u=(1-l)*s+l*a,p=(1-l)*n+l*o,f=(1-l)*a+l*r,y=(1-l)*c+l*d,b=(1-l)*h+l*u,x=(1-l)*d+l*p,v=(1-l)*u+l*f,S=(1-l)*y+l*x,M=(1-l)*b+l*v;return[[{x:e,y:t},{x:c,y:h},{x:y,y:b},{x:S,y:M}],[{x:S,y:M},{x,y:v},{x:p,y:f},{x:o,y:r}]]}function AN(e,t,i,s){const n=-e+3*t-3*i+s,a=2*(e-2*t+i),o=-e+t;if(n===0){if(a!==0){const l=-o/a;if(l>0&&l<1)return[l]}return[]}const r=a*a-4*n*o;if(r>=0){const l=Math.sqrt(r),c=(-a+l)/(2*n),h=(-a-l)/(2*n);return[c,h].filter(d=>d>0&&d<1)}return[]}function GM(e,t,i,s,n,a,o,r){const l=AN(e,i,n,o),c=AN(t,s,a,r);return[...l,...c]}function jM(e,t,i){const s=$a(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=$a(e[0].y,e[1].y,e[2].y,e[3].y,.5),a=Math.hypot(s-t,n-i),o=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:a,minDistance:o}}function WM(e,t,i,s,n,a,o,r,l,c,h=1){let u={value:jM([{x:e,y:t},{x:i,y:s},{x:n,y:a},{x:o,y:r}],l,c),next:null},p;for(;u!=null;){const{points:f,distance:y,minDistance:b}=u.value;if(u=u.next,(p==null||y<p.distance)&&(p={distance:y,minDistance:b}),p!=null&&p.distance-b<=h)continue;const[x,v]=lu(f[0].x,f[0].y,f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y,.5),S=[jM(x,l,c),jM(v,l,c)].sort(CN);u=tx(u,S,CN)}return p?.distance??1/0}var CN=(e,t)=>t.minDistance-e.minDistance;function SG({point:e,anchor:t},i,s,n,a){if(e.size===0)return!1;let o=e.x,r=e.y;t!=null&&(o-=(t.x-.5)*e.size,r-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+n&&(l=i+n);let c=r;r<s?c=s:r>s+a&&(c=s+a);const h=o-l,d=r-c;return Math.hypot(h,d)<=e.size/2}function $M(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var MG={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function KM(e,t,i=5){const s=new Map,n=[],a=new Map(Array.from(e.entries(),([r,l])=>[r,l.toSorted((c,h)=>h.point.size-c.point.size)])),o=[...a.values()].flat();for(const[r,l]of a.entries()){const c=[];if(l[0]?.label){for(let h=0,d=l.length;h<d;h++){const u=l[h],{point:p,label:f,anchor:y}=u,{text:b,width:x,height:v}=f,S=p.size/2;let M=0,D=0;if(S>0&&u.placement!=null){const C=MG[u.placement];M=(x/2+S+i)*C.x,D=(v/2+S+i)*C.y}let I=p.x-x/2+M,k=p.y-v/2+D;if(y&&(I-=(y.x-.5)*p.size,k-=(y.y-.5)*p.size),Ng(t,I,k,x,v)&&!o.some(C=>SG(C,I,k,x,v))&&!n.some(C=>jy(C,I,k,x,v))){const C={index:h,text:b,x:I,y:k,width:x,height:v,datum:u};c.push(C),n.push(C)}}s.set(r,c)}}return s}function wN(e){return e.type==="continuous"||e.type==="log"}function LN(e){return e.type==="category"}function Nr(e){return"variant"in e&&e.variant==="unit-time"}function NN(e){return!("variant"in e)}function Ka(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:wN(e)&&wN(t)?e.type===t.type&&En(e.domain,t.domain)&&En(e.range,t.range):LN(e)&&LN(t)?Nr(e)&&Nr(t)?e.firstBandTime===t.firstBandTime&&e.lastBandTime===t.lastBandTime&&e.bandCount===t.bandCount&&e.intervalMs===t.intervalMs&&e.inset===t.inset&&e.step===t.step:NN(e)&&NN(t)?e.inset===t.inset&&e.step===t.step&&En(e.domain,t.domain):!1:!1}function zl(e){return e==null?!1:e.type==="category"?Nr(e)?Number.isFinite(e.firstBandTime)&&Number.isFinite(e.lastBandTime)&&Number.isFinite(e.bandCount)&&e.bandCount>0:e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function tn(e){switch(e.type){case"linear":case"step":case"multi-line":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function DG(e){const t=tn(e);return t[0].x>t[1].x&&t.reverse(),t}function UM(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,midPoints:e.midPoints.map(()=>({x:i,y:s}))}}}function Yc(e,t,i){const[s,n]=tn(e),a=n.x===s.x?0:(i.x-t.x)/(n.x-s.x),o=n.y===s.y?0:(i.y-t.y)/(n.y-s.y);switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*a,cp1y:i.y-(e.cp2y-s.y)*o,cp2x:i.x-(e.cp1x-s.x)*a,cp2y:i.y-(e.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*a};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,midPoints:e.midPoints.map(r=>({x:t.x+(r.x-s.x)*a,y:t.y+(r.y-s.y)*o}))}}}function vx(e,t,i){const{moveTo:s}=e,[n,a]=DG(e),{x:o,y:r}=n,{x:l,y:c}=a;if(i<o)return Yc(e,n,n);if(t>l)return Yc(e,a,a);switch(e.type){case"linear":{const h=r===c?void 0:(c-r)/(l-o),d=h==null?r:h*(t-o)+r,u=h==null?r:h*(i-o)+r;return{type:"linear",moveTo:s,x0:t,y0:d,x1:i,y1:u}}case"step":if(i<=e.stepX){const h=e.y0;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:i}}else if(t>=e.stepX){const h=e.y1;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:t}}else{const{y0:h,y1:d,stepX:u}=e;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:d,stepX:u}}case"cubic":{const h=$g(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[d,u]=lu(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=$g(u[0].x,u[1].x,u[2].x,u[3].x,i);return[u,d]=lu(u[0].x,u[0].y,u[1].x,u[1].y,u[2].x,u[2].y,u[3].x,u[3].y,p),{type:"cubic",moveTo:s,cp0x:u[0].x,cp0y:u[0].y,cp1x:u[1].x,cp1y:u[1].y,cp2x:u[2].x,cp2y:u[2].y,cp3x:u[3].x,cp3y:u[3].y}}case"multi-line":{const{midPoints:h}=e,d=h.findLastIndex(I=>I.x<=t);let u=h.findIndex(I=>I.x>=i);u===-1&&(u=h.length);const p=d>=0?h[d]:void 0,f=p?.x??o,y=p?.y??r,b=u<h.length?h[u]:void 0,x=b?.x??l,v=b?.y??c,S=y===v?void 0:(v-y)/(x-f),M=S==null?y:S*(f-o)+y,D=S==null?y:S*(x-o)+y;return{type:"multi-line",moveTo:s,x0:t,y0:M,x1:i,y1:D,midPoints:h.slice(Math.max(d,0),u)}}}}var YM=(e=>(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(YM||{});function ZM(e){const t=[];let i=0,s=Number.NaN,n=Number.NaN;for(const{x:a,y:o}of e){if(i>0){const r=i===1;t.push({type:"linear",moveTo:r,x0:s,y0:n,x1:a,y1:o})}i+=1,s=a,n=o}return t}var kG={start:0,middle:.5,end:1};function XM(e,t){const i=[];let s=0,n=Number.NaN,a=Number.NaN;const o=typeof t=="number"?t:kG[t];for(const{x:r,y:l}of e){if(s>0){const c=s===1,h=n+(r-n)*o;i.push({type:"step",moveTo:c,x0:n,y0:a,x1:r,y1:l,stepX:h})}s+=1,n=r,a=l}return i}function qM(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=.05,n=i.map((o,r)=>{const l=r===0?o:i[r-1],c=r===i.length-1?o:i[r+1],h=r===0||r===i.length-1;if(Math.sign(l.y-o.y)===Math.sign(c.y-o.y))return 0;if(!h){const d=Math.abs(l.y-c.y),u=Math.abs(o.y-l.y)/d,p=Math.abs(o.y-c.y)/d;if(u<=s||1-u<=s||p<=s||1-p<=s)return 0}return(c.y-l.y)/(c.x-l.x)});n[1]===0&&(n[0]*=2),n.at(-2)===0&&(n[n.length-1]*=2);const a=[];for(let o=1;o<i.length;o+=1){const r=i[o-1],l=n[o-1],c=i[o],h=n[o],d=c.x-r.x,u=c.y-r.y;let p=d*t/3,f=d*l*t/3,y=d*t/3,b=d*h*t/3;h===0&&Math.abs(f)>Math.abs(u)&&(p*=Math.abs(u/f),f=Math.sign(f)*Math.abs(u)),l===0&&Math.abs(b)>Math.abs(u)&&(y*=Math.abs(u/b),b=Math.sign(b)*Math.abs(u)),a.push({type:"cubic",moveTo:o===1,cp0x:r.x,cp0y:r.y,cp1x:r.x+p,cp1y:r.y+f,cp2x:c.x-y,cp2y:c.y-b,cp3x:c.x,cp3y:c.y})}return a}var ba=0,Yi=1;function Rt(e){return{x:{min:e?.x?.min??ba,max:e?.x?.max??Yi},y:{min:e?.y?.min??ba,max:e?.y?.max??Yi}}}var Zc=class extends X{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},Sx={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function QM(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function TN(e,t){const s=new Date(e.getFullYear(),0,1).getDay(),n=(t-s+7)%7,a=new Date(e.getFullYear(),0,n+1);return a<=e?Math.floor(QM(e,a)/7)+1:0}var IG=0,ON=1,PN=4;function EN(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(PN-s+7)%7,a=new Date(t,0,n-(PN-ON)+1);return a<=e?Math.floor(QM(e,a)/7)+1:EN(e,t-1)}function AG(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${hs(Math.floor(i/60),2,"0")}${hs(Math.floor(i%60),2,"0")}`}var CG={a:e=>Sx.shortDays[e.getDay()],A:e=>Sx.days[e.getDay()],b:e=>Sx.shortMonths[e.getMonth()],B:e=>Sx.months[e.getMonth()],c:"%x, %X",d:(e,t)=>hs(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>hs(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>hs(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":hs(i,2,t??"0")},j:(e,t)=>hs(QM(e)+1,3,t??"0"),m:(e,t)=>hs(e.getMonth()+1,2,t??"0"),M:(e,t)=>hs(e.getMinutes(),2,t??"0"),L:(e,t)=>hs(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>hs(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>hs(TN(e,IG),2,t??"0"),V:(e,t)=>hs(EN(e),2,t??"0"),w:(e,t)=>hs(e.getDay(),2,t??"0"),W:(e,t)=>hs(TN(e,ON),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>hs(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>hs(e.getFullYear(),4,t??"0"),Z:e=>AG(e),"%":()=>"%"},wG={_:" ",0:"0","-":""};function hs(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function Xc(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const r=i>0?e.substring(0,i):e;t.push(r)}if(i<0)break;const s=e[i+1],n=wG[s];n!=null&&i++;const a=e[i+1],o=CG[a];if(typeof o=="function")t.push([o,n]);else if(typeof o=="string"){const r=Xc(o);t.push([r,n])}else t.push(`${n??""}${a}`);e=e.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return t.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}function cu(e,t){const i=ye("button",Mx("ag-charts-input ag-charts-button",t));return e.label===void 0?(i.append(iD(e.icon)),i.ariaLabel=e.altText):i.append(e.label),i.addEventListener("click",e.onPress),ma(i,t),i}function JM(e,t){const i=ye("input",Mx("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",s=>e.onChange(i.checked,s)),i.addEventListener("keydown",s=>{Jy(s)&&(s.preventDefault(),i.click())}),ma(i,t),i}function eD(e,t){const i=ye("select",Mx("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const n=ye("option");return n.value=s.value,n.textContent=s.label,n})),Pe(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),ma(i,t),i}function tD(e,t){const i=ye("textarea",Mx("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),ma(i,t),Pe(i,"data-preventdefault",!1),i}function iD(e){const t=ye("span",`ag-charts-icon ag-charts-icon-${e}`);return Pe(t,"aria-hidden",!0),t}function Mx(e,t){return t==null?e:`${e} ${t.class}`}var sD=e=>e,RN=e=>1-Math.cos(e*Math.PI/2),Tr=e=>Math.sin(e*Math.PI/2),zN=e=>-(Math.cos(e*Math.PI)-1)/2,VN=e=>e*e,BN=e=>1-(1-e)**2,FN=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,nD=e=>2*Math.asin(e)/Math.PI,qc=(e,t)=>e===t;function $(e){return function(t,i){const s=`__${i}`;t[i]||aD(t,i,s,e)}}function Kg(e){return $(e)}function Or(e){return $(e)}function hu(e){const t=e??{};return t.equals=En,$(e)}function Ee(e){return function(t,i){const s=`__${i}`;t[i]||aD(t,i,s,e)}}function du(e){return function(t,i){const s=`__${i}`;t[i]||aD(t,i,s,e)}}function aD(e,t,i,s){const{changeCb:n,convertor:a,checkDirtyOnAssignment:o=!1}=s??{},r={changeCb:n,checkDirtyOnAssignment:o,convertor:a},l=TG(i,NG(LG(OG(i,r),r),r),r);function c(){return this[i]}Object.defineProperty(e,t,{set:l,get:c,enumerable:!0,configurable:!0})}function LG(e,t){const{convertor:i}=t;if(i){let n=function(o){e.call(this,a(o))};var s=n;const a=i;return n}return e}var _N=Symbol("no-change");function NG(e,t){const{changeCb:i}=t;if(i){let n=function(o){const r=e.call(this,o);return r!==_N&&a.call(this,this),r};var s=n;const a=i;return n}return e}function TG(e,t,i){const{checkDirtyOnAssignment:s}=i;if(s){let a=function(o){const r=t.call(this,o);return o?._dirty===!0&&this.markDirty(e),r};var n=a;return a}return t}function OG(e,t){const{equals:i=qc}=t;function s(n){const a=this[e];return i(n,a)?_N:(this[e]=n,this.onChangeDetection(e),n)}return s}var HN={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]"};function GN(e,t,i,s){return{unit:e,step:t,epoch:i,utc:s,every(n){return GN(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var jN={};function di(e,t=1,i,s=!1){K.warnOnce("time import is deprecated, use object notation instead");const n=`${e}:${t}:${i?.getTime()??0}:${s}`;let a=jN[n];return a==null&&(a=GN(e,t,i,s),jN[n]=a),a}var PG={get millisecond(){return di("millisecond")},get second(){return di("second")},get minute(){return di("minute")},get hour(){return di("hour")},get day(){return di("day")},get monday(){return di("day",7,new Date(1970,0,5))},get tuesday(){return di("day",7,new Date(1970,0,6))},get wednesday(){return di("day",7,new Date(1970,0,7))},get thursday(){return di("day",7,new Date(1970,0,1))},get friday(){return di("day",7,new Date(1970,0,2))},get saturday(){return di("day",7,new Date(1970,0,3))},get sunday(){return di("day",7,new Date(1970,0,4))},get month(){return di("month")},get year(){return di("year")},get utcMillisecond(){return di("millisecond",1,void 0,!0)},get utcSecond(){return di("second",1,void 0,!0)},get utcMinute(){return di("minute",1,void 0,!0)},get utcHour(){return di("hour",1,void 0,!0)},get utcDay(){return di("day",1,void 0,!0)},get utcMonth(){return di("month",1,void 0,!0)},get utcYear(){return di("year",1,void 0,!0)}},Dx=Symbol("interpolate"),kx=e=>e[Dx]!=null,Ug=class Gp{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromObject({x:t,y:i,width:s,height:n}){return new Gp(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const o of t)o.x<i&&(i=o.x),o.y<s&&(s=o.y),Ns(o.x,o.width)>n&&(n=Ns(o.x,o.width)),Ns(o.y,o.height)>a&&(a=Ns(o.y,o.height));return new Gp(i,s,n-i,a-s)}static nearestBox(t,i,s){return Xd(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:Ns(this.x,this.width),bottom:Ns(this.y,this.height),toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new Gp(t,i,s,n)}equals(t){return Tg(this,t)}containsPoint(t,i){return Ng(this,t,i)}intersection(t){const i=Math.max(this.x,t.x),s=Math.max(this.y,t.y),n=Math.min(Ns(this.x,this.width),Ns(t.x,t.width)),a=Math.min(Ns(this.y,this.height),Ns(t.y,t.height));if(!(i>n||s>a))return new Gp(i,s,n-i,a-s)}collidesBBox(t){return this.x<Ns(t.x,t.width)&&Ns(this.x,this.width)>t.x&&this.y<Ns(t.y,t.height)&&Ns(this.y,this.height)>t.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(t,i){if(this.containsPoint(t,i))return 0;const s=t-ae(this.x,t,Ns(this.x,this.width)),n=i-ae(this.y,i,Ns(this.y,this.height));return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[Dx](t,i){return new Gp(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};Ug.zero=Object.freeze(new Ug(0,0,0,0)),Ug.NaN=Object.freeze(new Ug(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var le=Ug;function Ns(e,t){return e===-1/0&&t===1/0?1/0:e+t}function WN({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function $N(e){if(be.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),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 KN(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var oD;function EG(){const e=Kp();return oD??(oD=new e(1,1)),oD}var rD=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[a,o]=KN(t,i,s),r=Kp();this.canvas=new r(a,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),$N(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?EG().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[a,o]=KN(e,t,i);s.width=a,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){WN(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)}},lD=(e,t)=>Math.sign(e-t);function UN(e,t){if(typeof e=="number"&&typeof t=="number")return lD(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let a=0;a<n;a+=1){const o=lD(i[a],s[a]);if(o!==0)return o}return lD(i.length,s.length)}var YN=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(YN||{}),RG=5,Qc=class aL{constructor(t){this.serialNumber=aL._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=Ii(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=t?.name,this.tag=t?.tag??Number.NaN,this.zIndex=t?.zIndex??0,this.scene=t?.scene,(t?.debugDirty??aL._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const a=jt("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 o=jt("defs");o.append(...n.defs),a.append(o)}return a.append(...n.elements),a.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,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(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=RG)throw i.errorCount=s,i;K.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){t&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(t){this.batchLevel++;try{t()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(t){this.batchLevel++;try{uy(this,t)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(t,i){this.batchLevel++;try{uy(this,t,i)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],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(t,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[t,i]of this._debugDirtyProperties.entries())i.length>1&&K.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${t} (${i.length}x)`,()=>{for(const s of i)K.log(s)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(t){t.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};Qc.className="AbstractNode",Qc._nextSerialNumber=0,Qc._debugEnabled=!1,g([Ee()],Qc.prototype,"visible",2),g([Ee({equals:Ht,changeCb:Qc.handleNodeZIndexChange})],Qc.prototype,"zIndex",2);var Pr=Qc,Ix=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Ax=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};function ZN(e,t,i){if(i==null||i[0]===0&&i[1]===1)return;const s=ae(0,Math.floor(i[0]*e.length),e.length),n=ae(0,Math.ceil(i[1]*e.length),e.length),a=t?e.length-n:s,o=t?e.length-s:n;return[a,o]}function zG(e,t,i){return ZN(e,t,i)??[0,e.length]}function XN(e,t,i){const s=ZN(e,t,i);if(s==null)return{ticks:e,count:e.length,firstTickIndex:0};const[n,a]=s;return{ticks:e.slice(n,a),count:e.length,firstTickIndex:n}}function Cx(e){const t=yx(e.at(0)),i=yx(e.at(-1));return t!=null&&i!=null?[t,i]:[void 0,void 0]}var qN=e=>{const t=Oe.fromString(e),[i,s,n]=Oe.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},cD=1e-6,QN=e=>e.c<cD||e.l<cD||e.l>1-cD,VG=(e,t,i)=>{i=ae(0,i,1);let s;if(QN(e))s=t.h;else if(QN(t))s=e.h;else{const r=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=e.c*(1-i)+t.c*i,a=e.l*(1-i)+t.l*i,o=e.a*(1-i)+t.a*i;return Oe.fromOKLCH(a,n,s,o)},uu=class extends Ix{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(qN)}update(){const{domain:e,range:t}=this;e.length<2&&(K.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>n){K.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((a,o)=>a-o);break}}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(qN)}normalizeDomains(...e){return{domain:e.map(t=>t.domain).flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],a=t.at(-1),o=i[0],r=i.at(-1);if(e<=n)return o;if(e>=a)return r;let l,c;if(t.length===2){const u=(e-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<t.length-2&&!(e<t[l+1]);l++);const u=t[l],p=t[l+1];c=(e-u)/(p-u)}const h=s[l],d=s[l+1];return VG(h,d,c).toRgbaString()}invert(){}getDomainMinMax(){return Cx(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&K.warnOnce("Expected update to not invalidate scale"))}};g([Ax],uu.prototype,"domain",2),g([Ax],uu.prototype,"range",2);var hD=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache?.ctx===e&&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 o=this.createCanvasGradient(e,s,i);if(o==null)return;const r=a==="oklch",l=.05;let c=n[0];o.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(r){const u=new uu;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)o.addColorStop(p,u.convert(p)??"transparent")}o.addColorStop(d.stop,d.color),c=d}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:e,bbox:s,gradient:o},o}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);for(const{stop:s,color:n}of this.stops){const a=jt("stop");a.setAttribute("offset",`${s}`),a.setAttribute("stop-color",`${n}`),i.appendChild(a)}return i}},BG=class extends hD{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,a=Ha(n+-90),o=i?.centerX??t.x+t.width*.5,r=i?.centerY??t.y+t.height*.5;return e.createConicGradient(a,o,r)}createSvgGradient(e){return jt("linearGradient")}},FG=class extends hD{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=Ha(i+90),n=Math.cos(s),a=Math.sin(s),o=e.width,r=e.height,l=e.x+o*.5,c=e.y+r*.5,h=Math.hypot(r,o)/2,d=Math.atan2(r,o);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(e,t){const{x0:i,y0:s,x1:n,y1:a}=this.getGradientPoints(t);if(!(Number.isNaN(i)||Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(a)))return e.createLinearGradient(i,s,n,a)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:n}=this.getGradientPoints(e),a=jt("linearGradient");return a.setAttribute("x1",String(t)),a.setAttribute("y1",String(i)),a.setAttribute("x2",String(s)),a.setAttribute("y2",String(n)),a.setAttribute("gradientUnits","userSpaceOnUse"),a}},_G=class extends hD{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+t.width*.5,n=i?.centerY??t.y+t.height*.5,a=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(s,n,a,s,n,o)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,s=jt("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},dD=class extends X{constructor(){super(...arguments),this.color="black"}};g([m],dD.prototype,"stop",2),g([m],dD.prototype,"color",2);function HG(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function JN(e){return e.flatMap((t,i)=>{const{stop:s}=t,n=e.at(i+1)?.color;return n==null?[t]:[t,{stop:s,color:n}]})}function GG(e,t){const i=t==="discrete"?1:0,s=e.map((n,a,{length:o})=>({stop:(a+i)/(o-1+i),color:n}));return t==="discrete"?JN(s):s}function eT(e,t,i,s="continuous"){const n=e.map(f=>typeof f=="string"?{color:f}:f);if(n.length===0)return GG(t,s);if(!HG(n))return K.warnOnce("[fills] must have the stops defined in ascending order"),[];const a=Math.min(...i),o=Math.max(...i),r=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let f=0;f<n.length;f+=1){const y=n[f];if(f>=h){h=n.length-1;for(let x=f+1;x<n.length;x+=1)if(n[x]?.stop!=null){h=x;break}}let b=y?.stop;if(b==null){const x=n[c]?.stop,v=n[h]?.stop,S=x??a,M=v??o,D=r&&x==null?1:0;b=S+(M-S)*(f-c+D)/(h-c+D)}else c=f;l[f]=Math.max(0,Math.min(1,(b-a)/(o-a)))}let d=n.find(f=>f.color!=null)?.color,u;const p=n.map((f,y)=>{let b=f?.color;const x=l[y];return b!=null?d=b:d==null?(u==null&&(u=new uu,u.domain=[0,1],u.range=t),b=u.convert(x)):b=d,{stop:x,color:b}});return s==="discrete"?JN(p):p}var jG=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[n,a]=this.getSize(t.width,t.height,i,s);return n<1||a<1?(K.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let a=e,o=t,r=1;const l=i/s,c=e/t;return n==="stretch"||e===0||t===0?(a=i,o=s):n==="contain"?r=c>l?i/e:s/t:n==="cover"&&(r=c>l?s/t:i/e),[Math.max(1,a*r),Math.max(1,o*r)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:a}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const r=Ha(s),l=Math.cos(r),c=Math.sin(r),[h,d]=this.getSize(o.width,o.height,n??t.width,a??t.height),u=h/o.width,p=d/o.height,f=t.x+t.width/2,y=t.y+t.height/2,b=l*h-c*d,x=c*h+l*d,v=b/2,S=x/2,M=Vm();e?.setTransform(new M([l*u,c*p,-c*u,l*p,f-v,y-S]))}createPattern(e,t,i,s){const n=this.width??t,a=this.height??i,o=this._cache;if(o?.ctx===e&&o.width===n&&o.height===a)return o.pattern;const r=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(e,r,n,a);if(l!=null)return this._cache={ctx:e,pattern:l,width:n,height:a},l}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:a}=this,{x:o,y:r,width:l,height:c}=e,h=jt("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(o)),h.setAttribute("y",String(r)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const d=jt("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=jt("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/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}},WG=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,wt=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,$G=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,tT=/^[01]/,KG={z:[],h:[wt],v:[wt],m:[wt,wt],l:[wt,wt],t:[wt,wt],s:[wt,wt,wt,wt],q:[wt,wt,wt,wt],c:[wt,wt,wt,wt,wt,wt],a:[wt,wt,wt,tT,tT,wt,wt]};function UG(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=WG.exec(e.slice(i));let a;if(n==null){if(!s){K.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}a=s}else a=n[1],i+=n[0].length;const o=YG(a,e,i);if(!o)return;i=o[0],s=a,t.push(o[1])}return t}function YG(e,t,i){const s=KG[e.toLocaleLowerCase()],n={command:e,params:[]};for(const a of s){const o=t.slice(i),r=a.exec(o);if(r!=null){n.params.push(Number.parseFloat(r[0])),i+=r[0].length;const l=$G.exec(o.slice(r[0].length));l!=null&&(i+=l[0].length)}else{if(n.params.length===1)return[i,n];K.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}function ZG(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function XG(e,t,i,s=1e-6){if(Math.abs(e)<s)return ZG(t,i);const n=t*t-4*e*i,a=[];if(Math.abs(n)<s){const o=-t/(2*e);o>=0&&o<=1&&a.push(o)}else if(n>0){const o=Math.sqrt(n),r=(-t-o)/(2*e),l=(-t+o)/(2*e);r>=0&&r<=1&&a.push(r),l>=0&&l<=1&&a.push(l)}return a}function qG(e,t,i,s,n=1e-6){if(Math.abs(e)<n)return XG(t,i,s,n);const a=t/e,o=i/e,r=s/e,l=(3*o-a*a)/9,c=(9*a*o-27*r-2*a*a*a)/54,h=l*l*l+c*c,d=1/3,u=[];if(h>=0){const p=Math.sqrt(h),f=Math.sign(c+p)*Math.pow(Math.abs(c+p),d),y=Math.sign(c-p)*Math.pow(Math.abs(c-p),d),b=Math.abs(Math.sqrt(3)*(f-y)/2),x=-d*a+(f+y);if(x>=0&&x<=1&&u.push(x),Math.abs(b)<n){const v=-d*a-(f+y)/2;v>=0&&v<=1&&u.push(v)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),f=d*a,y=2*Math.sqrt(-l),b=y*Math.cos(d*p)-f,x=y*Math.cos(d*(p+2*Math.PI))-f,v=y*Math.cos(d*(p+4*Math.PI))-f;b>=0&&b<=1&&u.push(b),x>=0&&x<=1&&u.push(x),v>=0&&v<=1&&u.push(v)}return u}function Yg(e,t,i,s,n,a,o,r){const l=(i-e)*(r-a)-(s-t)*(o-n);if(l===0)return 0;const c=((o-n)*(t-a)-(e-n)*(r-a))/l,h=((i-e)*(t-a)-(s-t)*(e-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function QG(e,t,i,s,n,a,o,r,l,c,h,d){let u=0;const p=c-d,f=h-l,y=l*(d-c)-c*(h-l),b=iT(e,i,n,o),x=iT(t,s,a,r),v=p*b[0]+f*x[0],S=p*b[1]+f*x[1],M=p*b[2]+f*x[2],D=p*b[3]+f*x[3]+y,I=qG(v,S,M,D);for(const k of I){const C=k*k,A=k*C,w=b[0]*A+b[1]*C+b[2]*k+b[3],T=x[0]*A+x[1]*C+x[2]*k+x[3];let O;l===h?O=(T-c)/(d-c):O=(w-l)/(h-l),O>=0&&O<=1&&u++}return u}function iT(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}var pu=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 e=Tc();this.path2d=new e}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(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,a){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,a),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t,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(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,a,o,r=!1){const l=i,c=s/i,h=Math.cos(n),d=Math.sin(n),u=-c*d,p=c*h,f=l*Math.cos(a),y=l*Math.sin(a),b=e+h*f+u*y,x=t+d*f+p*y,v=(b-this.cx)**2+(x-this.cy)**2;this.openedPath?v>1e-6&&this.lineTo(b,x):this.moveTo(b,x);let S=r?-Qe(a-o):Qe(o-a);Math.abs(Math.abs(o-a)-2*Math.PI)<1e-6&&S<2*Math.PI&&(S+=2*Math.PI*(r?-1:1));const M=Math.max(Math.ceil(Math.abs(S)/(Math.PI/2)),1),D=S/M,I=4/3*Math.tan(D/4);for(let k=0;k<M;k+=1){const C=a+D*(k+0),A=a+D*(k+1),w=l*Math.sin(C),T=l*Math.cos(C),O=l*Math.sin(A),z=l*Math.cos(A),V=T-I*w,E=w+I*T,_=z+I*O,G=O-I*z,B=z,F=O;this.cubicCurveTo(e+h*V+u*E,t+d*V+p*E,e+h*_+u*G,t+d*_+p*G,e+h*B+u*F,t+d*B+p*F)}}arc(e,t,i,s,n,a){this.ellipse(e,t,i,i,0,s,n,a)}appendSvg(e){const t=UG(e);if(t==null)return!1;let i=0,s=0,n,a,o=0,r=0;for(const{command:l,params:c}of t){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]),o=d+c[2],r=u+c[3],n=d+c[4],a=u+c[5];break;case"s":this.cubicCurveTo(n+n-o,a+a-r,d+c[0],u+c[1],d+c[2],u+c[3]),o=d+c[0],r=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]),o=c[0],r=c[1],n=c[2],a=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-o))/3,(a+2*(a+a-r))/3,(2*(n+n-o)+c[0])/3,(2*(a+a-r)+c[1])/3,c[0],c[1]),o=n+n-o,r=a+a-r,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(e,t,i,s,n,a,o,r,l){i=Math.abs(i),s=Math.abs(s);const c=(e-r)/2,h=(t-l)/2,d=Math.sin(n),u=Math.cos(n),p=u*c+d*h,f=-d*c+u*h,y=p/i,b=f/s;let x=y*y+b*b,v=(e+r)/2,S=(t+l)/2,M=0,D=0;x>=1?(x=Math.sqrt(x),i*=x,s*=x):(x=Math.sqrt(1/x-1),a===o&&(x=-x),M=x*i*b,D=-x*s*y,v+=u*M-d*D,S+=d*M+u*D);const I=Math.atan2((f-D)/s,(p-M)/i),k=Math.atan2((-f-D)/s,(-p-M)/i)-I,C=I+k,A=!!(1-o);this.ellipse(v,S,i,s,n,I,C,A)}clear(e){e?(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 t=Tc();this.path2d=new t,this.openedPath=!1,this.closedPath=!1}isPointInPath(e,t){const i=this.commands,s=this.params,n=this.commandsLength,a=-1e4,o=-1e4;let r=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+=Yg(r,l,c,h,a,o,e,t),c=s[p++],r=c,h=s[p++],l=h;break;case 1:d+=Yg(c,h,s[p++],s[p++],a,o,e,t),c=s[p-2],h=s[p-1];break;case 2:d+=QG(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,o,e,t),c=s[p-2],h=s[p-1];break;case 3:d+=Yg(r,l,c,h,a,o,e,t);break}return d%2===1}distanceSquared(e,t){let i=1/0;const s=this.commands,n=this.params,a=this.commandsLength;let o=Number.NaN,r=Number.NaN,l=0,c=0;for(let h=0,d=0;h<a;h++)switch(s[h]){case 0:l=o=n[d++],c=r=n[d++];break;case 1:{const u=l,p=c;l=n[d++],c=n[d++],i=kr(e,t,u,p,l,c,i);break}case 2:{const u=l,p=c,f=n[d++],y=n[d++],b=n[d++],x=n[d++];l=n[d++],c=n[d++],i=WM(u,p,f,y,b,x,l,c,e,t)**2;break}case 3:i=kr(e,t,l,c,o,r,i);break}return i}toSVG(e=(t,i)=>({x:t,y:i})){const t=[],{commands:i,params:s}=this,n=(o,r)=>{t.push(o);for(let l=0;l<r;l+=2){const{x:c,y:h}=e(s[a++],s[a++]);t.push(c,h)}};let a=0;for(let o=0;o<this.commandsLength;o++)switch(i[o]){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 t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,n,a]=[1/0,1/0,-1/0,-1/0],[o,r]=[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),o=u,r=p};let d=0;for(let u=0;u<this.commandsLength;u++)switch(e[u]){case 0:h(t[d++],t[d++]),l=o,c=r;break;case 1:h(t[d++],t[d++]);break;case 2:{const f=o,y=r,b=t[d++],x=t[d++],v=t[d++],S=t[d++],M=t[d++],D=t[d++],I=GM(f,y,b,x,v,S,M,D);for(const k of I){const C=$a(f,b,v,M,k),A=$a(y,x,S,D,k);h(C,A)}h(M,D);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new le(s,i,n-s,a-i)}};function Fi(e,t,i){const s=Math.round(t*e)/e;return i==null?s:i===0?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-s}function sT(e,t){return Math.floor(t*e)/e}function uD(e,t,i){const{width:s,height:n,padding:a,strokeWidth:o}=t,r=s/2,l=n/2,c=Math.max(1,s-a-o/2),h=Math.max(1,n-a-o/2);let d=!1;for(const[u,p]of i){const f=r+(u-.5)*c,y=l+(p-.5)*h;d?e.lineTo(f,y):e.moveTo(f,y),d=!0}e.closePath()}var nT={circles(e,{width:t,strokeWidth:i,padding:s}){const n=t/2,a=Math.max(1,n-s-i/2);e.arc(n,n,a,0,Math.PI*2)},squares(e,{width:t,height:i,pixelRatio:s,padding:n,strokeWidth:a}){const o=n+a/2;e.moveTo(Fi(s,o),Fi(s,o)),e.lineTo(Fi(s,t-o),Fi(s,o)),e.lineTo(Fi(s,t-o),Fi(s,i-o)),e.lineTo(Fi(s,o),Fi(s,i-o)),e.closePath()},triangles(e,t){uD(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){uD(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:s}){const a=Math.max(1,(t-s)/2),o=a/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:o,h=l*Math.PI/5-r,d=t/2+Math.cos(h)*c,u=i/2+Math.sin(h)*c;e.lineTo(d,u)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const n=Math.max(1,t/4-s/2),a=t/2,o=i/2+n/2;e.arc(a-n,o-n,n,lt(130),lt(330)),e.arc(a+n,o-n,n,lt(220),lt(50)),e.lineTo(a,o+n),e.closePath()},crosses(e,t){uD(e,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]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const a=Fi(s,t/2)-n%2/2;e.moveTo(a,0),e.lineTo(a,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const a=Fi(s,i/2)-n%2/2;e.moveTo(0,a),e.lineTo(t,a)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),a=s*Math.cos(n),o=s*Math.sin(n);e.moveTo(-a,o),e.lineTo(a,-o),e.moveTo(-a,i+o),e.lineTo(t+a,-o),e.moveTo(t-a,i+o),e.lineTo(t+a,i-o)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),a=s*Math.cos(n),o=s*Math.sin(n);e.moveTo(t-a,-o),e.lineTo(t+a,o),e.moveTo(-a,-o),e.lineTo(t+a,i+o),e.moveTo(-a,i-o),e.lineTo(a,i+o)}},JG=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:s,padding:n,strokeWidth:a,path:o}=this,r=new pu;let l=nT[t]!=null;return o&&l&&(l=!r.appendSvg(o)),l&&nT[t](r,{width:i,height:s,pixelRatio:e,strokeWidth:a,padding:n}),r}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=i,t.lineWidth=s,t.globalAlpha=n,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:s}=this;i!=="none"&&(t.fillStyle=i,t.globalAlpha=s,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:s,scale:n,backgroundFill:a,backgroundFillOpacity:o}=this;if(i*n<1||s*n<1)return K.warnOnce("Pattern fill is too small to render, ignoring."),null;const r=new rD({width:i,height:s,pixelRatio:t*n}),l=r.context;a!=="none"&&(l.fillStyle=a,l.globalAlpha=o,l.fillRect(0,0,i,s));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=e.createPattern(r.canvas,"repeat");return this.setPatternTransform(h,t),r.destroy(),h}setPatternTransform(e,t,i=0,s=0){if(e==null)return;const n=Ha(this.rotation),a=1/t,o=Math.cos(n)*a,r=Math.sin(n)*a,l=Vm();e.setTransform(new l([o,r,-r,o,i,s]))}createPattern(e,t){if(this._cache?.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);if(i!=null)return this._cache={ctx:e,pattern:i,pixelRatio:t},i}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,rotation:c,scale:h}=this,d=jt("pattern");d.setAttribute("viewBox",`0 0 ${e} ${t}`),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("patternUnits","userSpaceOnUse");const u=jt("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(a)),d.appendChild(u);const p=jt("path");return p.setAttribute("fill",i),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",o),p.setAttribute("stroke-width",String(r)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(p),d}};function aT(e,t){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a}=t;i&&e.setAttribute("font-style",i),s&&e.setAttribute("font-weight",String(s)),n!=null&&e.setAttribute("font-size",String(n)),a&&e.setAttribute("font-family",a)}function ej(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=t;i&&e.setAttribute("stroke",i),s!=null&&e.setAttribute("stroke-width",String(s)),n!=null&&e.setAttribute("stroke-opacity",String(n))}function tj(e,t){const{lineDash:i,lineDashOffset:s}=t;if(i?.some(n=>n!==0)){const n=i.length%2===1?[...i,...i]:i;e.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&e.setAttribute("stroke-dashoffset",String(s))}}var Zi=class extends Pr{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(t){if(Qt(t))return this.createGradient(t)}createGradient(t){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:a=0,reverse:o=!1}=t;if(n==null)return;let r=eT(n,["black"],[0,1]);switch(o&&(r=r.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new FG(i,r,a);case"radial":return new _G(i,r);case"conic":return new BG(i,r,a)}}getPattern(t){if(jn(t))return this.createPattern(t)}createPattern(t){return new JG(t)}getImage(t){if(Wa(t))return this.createImage(t)}createImage(t){return new jG(this.imageLoader,t)}onFillChange(){typeof this.fill=="object"&&Ht(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(t,i){return Fi(this.layerManager?.canvas?.pixelRatio??1,t,i)}markDirty(t){super.markDirty(t),this.cachedDefaultGradientFillBBox=void 0}fillStroke(t,i){this.__drawingMode==="cutout"&&(t.globalCompositeOperation="destination-out",this.executeFill(t,i),t.globalCompositeOperation="source-over"),this.renderFill(t,i),this.renderStroke(t,i)}renderFill(t,i){const{__fill:s,__fillOpacity:n=1,fillImage:a}=this;if(s!=null&&s!=="none"&&n>0){const o=t.globalAlpha;a&&(t.globalAlpha=a.backgroundFillOpacity,t.fillStyle=a.backgroundFill,this.executeFill(t,i),t.globalAlpha=o),this.applyFillAndAlpha(t),this.applyShadow(t),this.executeFill(t,i),t.globalAlpha=o,this.fillShadow?.enabled&&(t.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(t,i){i?t.fill(i):t.fill()}applyFillAndAlpha(t){const{__fill:i,fillGradient:s,fillPattern:n,fillImage:a,__fillOpacity:o=1,__opacity:r=1}=this,l=r*o;if(l!==1&&(t.globalAlpha*=l),s){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;t.fillStyle=s.createGradient(t,c,h)??"black"}else if(n){const{x:c,y:h}=this.getBBox(),d=this.layerManager?.canvas?.pixelRatio??1,u=n.createPattern(t,d);n.setPatternTransform(u,d,c,h),u?t.fillStyle=u:(t.fillStyle=n.fill,t.globalAlpha*=n.fillOpacity)}else if(a){const c=this.getBBox(),h=a.createPattern(t,c.width,c.height,this);a.setImageTransform(h,c),t.fillStyle=h??"transparent"}else t.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(t){const{__stroke:i,__strokeOpacity:s=1,strokeGradient:n,__opacity:a=1}=this;t.strokeStyle=n?.createGradient(t,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const o=a*s;o!==1&&(t.globalAlpha*=o)}applyShadow(t){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:s}=this;s?.enabled&&(t.shadowColor=s.color,t.shadowOffsetX=s.xOffset*i,t.shadowOffsetY=s.yOffset*i,t.shadowBlur=s.blur*i)}renderStroke(t,i){const{__stroke:s,__strokeWidth:n=0,__strokeOpacity:a=1,__lineDash:o,__lineDashOffset:r,__lineCap:l,__lineJoin:c,__miterLimit:h}=this;if(s!=null&&s!=="none"&&n>0&&a>0){const{globalAlpha:d}=t;this.applyStrokeAndAlpha(t),t.lineWidth=n,o&&t.setLineDash(o),r&&(t.lineDashOffset=r),l&&(t.lineCap=l),c&&(t.lineJoin=c),h!=null&&(t.miterLimit=h),this.executeStroke(t,i),t.globalAlpha=d}}executeStroke(t,i){i?t.stroke(i):t.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(t,i){return this.isPointInPath(t,i)}applySvgFillAttributes(t,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")t.setAttribute("fill",s);else if(Qt(s)&&this.fillGradient){i??(i=[]);const a=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=Yd();a.setAttribute("id",o),i.push(a),t.setAttribute("fill",`url(#${o})`)}else if(jn(s)&&this.fillPattern){i??(i=[]);const a=this.fillPattern.toSvg(),o=Yd();a.setAttribute("id",o),i.push(a),t.setAttribute("fill",`url(#${o})`)}else if(Wa(s)&&this.fillImage){i??(i=[]);const a=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),a),r=Yd();o.setAttribute("id",r),i.push(o),t.setAttribute("fill",`url(#${r})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(t){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=this;ej(t,{stroke:Bt(i)?i:void 0,strokeOpacity:s,strokeWidth:n}),tj(t,{lineDash:a,lineDashOffset:o})}static handleFillChange(t){t.onFillChange()}static handleStrokeChange(t){t.onStrokeChange()}setStyleProperties(t,i,s){const n=t?.opacity??1,a=t?.fill,o=(t?.fillOpacity??1)*n,r=(t?.strokeOpacity??1)*n,l=t?.strokeWidth??0,c=t?.lineDashOffset??0;let h=!1;this.__fillOpacity!==o&&(this.__fillOpacity=o,h=!0),this.__strokeOpacity!==r&&(this.__strokeOpacity=r,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==t?.lineDash&&(this.__lineDash=t?.lineDash,h=!0),this.setFillProperties(a,i,s),a!==this.fill&&(this.fill=a),t?.stroke!==this.stroke&&(this.stroke=t?.stroke),h&&this.markDirty()}setFillProperties(t,i,s){const n=i==null||!Qt(t)||t.bounds==null||t.bounds==="item"?void 0:i[t.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())}};g([Ee()],Zi.prototype,"drawingMode",2),g([Ee()],Zi.prototype,"fillOpacity",2),g([Ee()],Zi.prototype,"strokeOpacity",2),g([du({equals:Ht,changeCb:Zi.handleFillChange})],Zi.prototype,"fill",2),g([Or({equals:Ht,changeCb:Zi.handleStrokeChange})],Zi.prototype,"stroke",2),g([Ee()],Zi.prototype,"strokeWidth",2),g([hu()],Zi.prototype,"lineDash",2),g([Ee()],Zi.prototype,"lineDashOffset",2),g([Ee()],Zi.prototype,"lineCap",2),g([Ee()],Zi.prototype,"lineJoin",2),g([Ee()],Zi.prototype,"miterLimit",2),g([Ee({convertor:e=>ae(0,e??1,1)})],Zi.prototype,"opacity",2),g([Or({equals:qc,checkDirtyOnAssignment:!0})],Zi.prototype,"fillShadow",2),g([du({equals:Tg,changeCb:e=>e.onFillChange()})],Zi.prototype,"fillBBox",2),g([du({equals:Ht,changeCb:e=>e.onFillChange()})],Zi.prototype,"fillParams",2);var Jc=Zi,oT=[1,0,0,1,0,0],eh=class OS{get e(){return[...this.elements]}constructor(t=oT){this.elements=[...t]}setElements(t){const i=this.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],this}get identity(){const t=this.elements;return He(t[0],1)&&He(t[1],0)&&He(t[2],0)&&He(t[3],1)&&He(t[4],0)&&He(t[5],0)}AxB(t,i,s){const n=t[0]*i[0]+t[2]*i[1],a=t[1]*i[0]+t[3]*i[1],o=t[0]*i[2]+t[2]*i[3],r=t[1]*i[2]+t[3]*i[3],l=t[0]*i[4]+t[2]*i[5]+t[4],c=t[1]*i[4]+t[3]*i[5]+t[5];s=s??t,s[0]=n,s[1]=a,s[2]=o,s[3]=r,s[4]=l,s[5]=c}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return t instanceof OS?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new OS(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],n=t[2],a=t[3];const o=t[4],r=t[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new OS([a,-s,-n,i,n*r-a*o,s*o-i*r])}invertSelf(){const t=this.elements;let i=t[0],s=t[1],n=t[2],a=t[3];const o=t[4],r=t[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,t[0]=a,t[1]=-s,t[2]=-n,t[3]=i,t[4]=n*r-a*o,t[5]=s*o-i*r,this}transformPoint(t,i){const s=this.elements;return{x:t*s[0]+i*s[2]+s[4],y:t*s[1]+i*s[3]+s[5]}}transformBBox(t,i){const s=this.elements,n=s[0],a=s[1],o=s[2],r=s[3],l=t.width*.5,c=t.height*.5,h=t.x+l,d=t.y+c,u=Math.abs(l*n)+Math.abs(c*o),p=Math.abs(l*a)+Math.abs(c*r);return i??(i=new le(0,0,0,0)),i.x=h*n+d*o+s[4]-u,i.y=h*a+d*r+s[5]-p,i.width=u+u,i.height=p+p,i}toContext(t){if(this.identity)return;const i=this.elements;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(t,i,s,n,a,o,r){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=r?.scalingCenterX??0,d=r?.scalingCenterY??0);const u=n,p=Math.cos(u),f=Math.sin(u);let y,b;u===0?(y=0,b=0):(y=r?.rotationCenterX??0,b=r?.rotationCenterY??0);const x=a,v=o,S=h*(1-l)-y,M=d*(1-c)-b;return t.setElements([p*l,f*l,-f*c,p*c,p*S-f*M+y+x,f*S+p*M+b+v]),t}};function Vl(e){return lT(e.constructor)}var rT=Symbol("isMatrixTransform");function lT(e){return e[rT]===!0}function pD(e){var t,i;const s=e;if(lT(e))return e;const n=Symbol("matrix_combined_transform");class a extends s{constructor(){super(...arguments),this[i]=new eh,this._dirtyTransform=!0}onChangeDetection(r){super.onChangeDetection(r),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(oT),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNode(r,l)}pickNodes(r,l,c){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNodes(r,l,c)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[n];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(r)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[n];if(l.identity||r==null)return r;const c=jt("g");c.append(...r.elements);const[h,d,u,p,f,y]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${f} ${y})`),{elements:[c],defs:r.defs}}}return t=rT,i=n,a[t]=!0,a}function gu(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends pD(i){constructor(){super(...arguments),this[t]=new eh,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(eh.updateTransformMatrix(this[s],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return t=s,g([$()],n.prototype,"rotationCenterX",2),g([$()],n.prototype,"rotationCenterY",2),g([$()],n.prototype,"rotation",2),n}function ij(e){return"scalingX"in e&&"scalingY"in e&&"scalingCenterX"in e&&"scalingCenterY"in e}function wx(e){var t;const i=e,s=Symbol("matrix_scale");class n extends pD(i){constructor(){super(...arguments),this[t]=new eh,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(o){super.updateMatrix(o);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;r===1&&l===1||(eh.updateTransformMatrix(this[s],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}resetScalingProperties(o,r,l,c){this.__scalingX=o,this.__scalingY=r,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return t=s,g([$()],n.prototype,"scalingX",2),g([$()],n.prototype,"scalingY",2),g([$()],n.prototype,"scalingCenterX",2),g([$()],n.prototype,"scalingCenterY",2),n}function fu(e){var t;const i=e,s=Symbol("matrix_translation");class n extends pD(i){constructor(){super(...arguments),this[t]=new eh,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:r,translationY:l}=this;r===0&&l===0||(eh.updateTransformMatrix(this[s],1,1,0,r,l),o.multiplySelf(this[s]))}}return t=s,g([$()],n.prototype,"translationX",2),g([$()],n.prototype,"translationY",2),n}var Wt=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())Vl(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return Vl(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():Vl(e)&&(t=e.toParent(t));for(const i of e.traverseUp())Vl(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())Vl(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return Vl(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){Vl(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())Vl(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},Lx,gD=class wm extends Pr{constructor(t){super(t),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=t?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=t?.optimizeForInfrequentRedraws===!0}static is(t){return t instanceof wm}static computeChildrenBBox(t,i=!0){return le.merge(Pr.extractBBoxes(t,i))}static compareChildren(t,i){return UN(t.__zIndex,i.__zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return wm.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const u of this.descendants())u instanceof Jc&&(s=Math.max(s,u.strokeWidth));const a=Math.max(1,s/2*n),{x:o,y:r}=Wt.toCanvasPoint(this,0,0),l=sT(t,o+i.x-a)-o,c=sT(t,r+i.y-a)-r,h=Math.ceil(i.x+i.width-l+a),d=Math.ceil(i.y+i.height-c+a);return new le(l,c,h,d)}prepareSharedCanvas(t,i,s){return Lx?.pixelRatio===s?Lx.resize(t,i,s):Lx=new rD({width:t,height:i,pixelRatio:s}),Lx}setScene(t){const i=this.scene;super.setScene(t),this.layer&&i&&i!==t&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const s of this.children())s.setScene(t)}markDirty(t){this.dirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of w0(t))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);t.parentNode=void 0,t.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const o=s[n].pickNode(t,i);if(o!=null)return o}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:a,layer:o}=this,r=o!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,a||r||l}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const s of this.children()){const n=s.preRender(t);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(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t},a=this.isDirty(t);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:o,stats:r,devicePixelRatio:l}=t;let{image:c}=this;if(a){c?.bitmap.close(),c=void 0;const d=i?void 0:this.computeSafeClippingBBox(l),u=(p,...f)=>{const y=p.context;n.ctx=y,p.clear(),y.save();try{y.setTransform(...f),y.globalAlpha=1,this.renderInContext(n)}finally{y.restore(),y.verifyDepthZero?.()}};if(i)u(i,o.getTransform());else if(d){const{x:p,y:f,width:y,height:b}=d,x=Math.floor(y*l),v=Math.floor(b*l);if(x>0&&v>0){const S=this.prepareSharedCanvas(y,b,l);u(S,l,0,0,l,-p*l,-f*l),c={bitmap:S.transferToImageBitmap(),x:p,y:f,width:y,height:b}}}this.image=c,r&&r.layersRendered++}else r&&r.layersSkipped++;const{globalAlpha:h}=o;if(o.globalAlpha=h*this.opacity,i){o.save();try{o.resetTransform(),i.drawImage(o)}finally{o.restore()}}else if(c){const{bitmap:d,x:u,y:p,width:f,height:y}=c;o.drawImage(d,0,0,f*l,y*l,u,p,f,y)}o.globalAlpha=h,super.render(n)}applyClip(t,i){const{x:s,y:n,width:a,height:o}=i;t.beginPath(),t.rect(s,n,a,o),t.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&(this.sortChildren(wm.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=Wt.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(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*excludeChildren(t){for(const i of this.children())(t.instance&&!(i instanceof t.instance)||t.name&&i.name!==t.name)&&(yield i)}*descendants(){for(const t of this.children())yield t,t instanceof wm&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?Wt.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};gD.className="Group",g([$({convertor:e=>ae(0,e,1)})],gD.prototype,"opacity",2);var Le=gD,sj=class extends wx(Le){},yne=class extends gu(Le){},ds=class extends fu(Le){},mu=class extends gu(fu(Le)){},nj=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise((t,i)=>{this.acquireQueue.push([e,t,i]),this.available&&this.dispatchNext().catch(i)})}async acquireImmediately(e){return this.available?(await this.acquire(e),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t,i]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(s){i?.(s)}[e,t,i]=this.acquireQueue.shift()??[]}this.available=!0}},cT=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if(typeof t!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);i!=null&&(i.delete(t),i.size===0&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){const t=this.eventListeners.get(e.type);if(t)for(const i of t)i(e)}};function aj(e){const t=Re();function i(n,a){return t.requestAnimationFrame(n)}function s(n){t.cancelAnimationFrame(n)}return hT(i,e,s)}function fD(e){function t(s,n=0){if(n===0){queueMicrotask(s);return}return setTimeout(s,n)}function i(s){clearTimeout(s)}return hT(t,e,i)}function hT(e,t,i){let s=0,n=!1,a,o,r;function l(){return n}function c(){n=!1,r=void 0,o?.(),o=void 0,a=void 0,s>0&&(r=e(h))}function h(){const y=s;s=0,n=!0;const b=t({count:y});if(!b){c();return}b.then(c,c)}function d(y){s===0&&!l()&&(r=e(h,y)),s++}function u(){r!=null&&i&&(i(r),r=void 0,s=0)}async function p(){if(l())for(a??(a=new Promise(f));l();)await a}function f(y){o=y}return{schedule:d,cancel:u,waitForCompletion:p}}var dT=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function yu(e,t,i){const{offsetX:s,offsetY:n,clientX:a,clientY:o}=t,{currentX:r,currentY:l}=Bl.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:t}}function Nx(e,t,i){return{type:e,sourceEvent:t}}var oj={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>yu("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>yu("click",e,t),dblclick:(e,t)=>yu("dblclick",e,t),mouseenter:(e,t)=>yu("mouseenter",e,t),mousemove:(e,t)=>yu("mousemove",e,t),mouseleave:(e,t)=>yu("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:s,clientY:n}=e,a=e.deltaMode===0?.01:1,o=e.deltaX*a,r=e.deltaY*a;return{type:"wheel",offsetX:t,offsetY:i,clientX:s,clientY:n,deltaX:o,deltaY:r,sourceEvent:e}},touchstart:(e,t)=>Nx("touchstart",e,t),touchmove:(e,t)=>Nx("touchmove",e,t),touchend:(e,t)=>Nx("touchend",e,t),touchcancel:(e,t)=>Nx("touchcancel",e,t)},Bl=class{static alloc(e,t,i){return oj[e](t,i)}static isHTMLEvent(e){return dT.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},rj=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const s=a=>{const o=Bl.alloc(e,a,t.getElement());this.dispatch(e,t,o)},n={};(e.startsWith("touch")||e==="wheel")&&(n.passive=!1),this.initSourceHandler(e,s),t.getElement().addEventListener(e,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const s=this.lazyGetWidgetListeners(e,t),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(e){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of rt(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const s of this.widgetListeners?.[e]??[])s(i,t)}},lj=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.window=Re(),this.cleanup=new pt,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:o,mouseup:r}=this;this.cleanup.register(st(n,"mousedown",a,{capture:!0}),st(n,"mouseenter",a,{capture:!0}),st(n,"mouseleave",a,{capture:!0}),st(n,"mouseout",a,{capture:!0}),st(n,"mouseover",a,{capture:!0}),st(n,"mousemove",o,{capture:!0}),st(n,"mouseup",r,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function cj(e,t,i,s){if(e.globalMouseDragCallbacks==null)return new lj(e,t,i,s)}var hj=500,dj=100;function uj(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}var mD=!1,pj=class{constructor(e,t,i,s,n){this.glob=e,this.self=t,this.initialTouch=s,this.target=n,this.cleanup=new pt,this.longTapInterrupted=!1,this.longtap=()=>{const{target:r,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new pt;r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),mD=!0;const h=y=>y.preventDefault(),d=y=>{mD=!1,y.preventDefault(),c.flush()};c.register(st(r,"touchmove",h,{passive:!1}),st(r,"touchend",d,{passive:!1}),st(r,"touchcancel",d,{passive:!1}));const{clientX:u,clientY:p}=l,f=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:Re(),clientX:u,clientY:p,pointerType:"touch"});r.dispatchEvent(f)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(r.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||uj(h,d)>dj,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(r,d))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,hj);const{touchmove:a,touchend:o}=this;this.cleanup.register(st(n,"touchmove",a,{passive:!1}),st(n,"touchstart",o,{passive:!1}),st(n,"touchend",o,{passive:!1}),st(n,"touchcancel",o,{passive:!1})),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.flatMap(i=>Array.from(i));return Array.from(t).find(i=>i.identifier===this.initialTouch.identifier)}};function gj(e,t,i,s,n){if(!(e.globalTouchDragCallbacks!=null||mD))return new pj(e,t,i,s,n)}function yD(e,t,i,s){const{currentX:n,currentY:a}=Bl.calcCurrentXY(e.getElement(),s),o=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:a,originDeltaX:o,originDeltaY:r,sourceEvent:s}}function fj(e,{pageX:t,pageY:i}){const{x:s,y:n}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-n}}function xD(e,t,i,s,n){const{currentX:a,currentY:o}=Bl.calcCurrentXY(e.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:a,currentY:o,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var uT={},pT=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return t===void 0&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(t);break}}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(this.dragTriggerRemover==null){const t=e.getElement(),i=new pt;i.register(st(t,"mousedown",s=>this.triggerMouseDrag(e,s)),st(t,"touchstart",s=>this.triggerTouchDrag(e,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){t.button===0&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};fg(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:n=>{const a=yD(e,"drag-start",i,n);this.dispatch("drag-start",e,a)},mousemove:n=>{const a=yD(e,"drag-move",i,n);this.dispatch("drag-move",e,a)},mouseup:n=>{const a=yD(e,"drag-end",i,n);this.dispatch("drag-end",e,a),this.endDrag(e,a)}};this.mouseDragger=cj(uT,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const n=e.getElement(),a=n.getBoundingClientRect();Ng(a,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];t.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const s={pageX:Number.NaN,pageY:Number.NaN,...fj(e,i)};fg(["pageX","pageY"],s,i);const n={touchmove:(r,l)=>{const c=xD(e,"drag-move",s,r,l);this.dispatch("drag-move",e,c)},touchend:(r,l)=>{const c=xD(e,"drag-end",s,r,l);this.dispatch("drag-end",e,c)}},a=e.getElement();this.touchDragger=gj(uT,this,n,i,a);const o=xD(e,"drag-start",s,t,i);this.dispatch("drag-start",e,o)}dispatch(e,t,i){for(const s of this.getListenerSet(e))s(i,t);this.dispatchCallback(e,i)}},mj=class{constructor(e){this.elem=e}setBounds(e){jd(this.elemContainer??this.elem,e)}getBounds(){return tM(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();jd(t,i),aM(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Er=class extends mj{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(e){Pe(this.elem,"id",e)}get id(){return wl(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 e of this.children)e.parent=void 0,e.destroy();this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){_n(this.elem,"display",e?"none":void 0)}isHidden(){return Re()?.getComputedStyle?.(this.elem).display==="none"}setCursor(e){_n(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){Pe(this.elem,"aria-describedby",e)}setAriaHidden(e){Pe(this.elem,"aria-hidden",e)}setAriaLabel(e){Pe(this.elem,"aria-label",e)}setAriaExpanded(e){Pe(this.elem,"aria-expanded",e)}setAriaControls(e){Pe(this.elem,"aria-controls",e)}setAriaHasPopup(e){Pe(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){_n(this.elem,"pointer-events",e)}setCSSVariable(e,t){this.elem.style.setProperty(e,t)}isDisabled(){return wl(this.elem,"aria-disabled",!1)}hasPopup(){const e=wl(this.elem,"aria-haspopup");return e!==void 0&&e!=="false"}parseFloat(e){return e===""?0:Number.parseFloat(e)}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(e){this.elem.focus(e)}setFocusOverride(e){Pe(this.elem,"data-focus-override",e)}setPreventsDefault(e){Pe(this.elem,"data-preventdefault",e)}setTabIndex(e){Pe(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){e.getElement().remove()}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(e!==void 0)return this.children.filter(t=>t.domIndex!==void 0&&t.domIndex>e).reduce((t,i)=>!t||i.domIndex<t.domIndex?i:t,void 0)}addListener(e,t){return Bl.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new rj),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new pT(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){Bl.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new pT(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...t,...Bl.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,n)}i=i.parent}}static addWindowEvent(e,t){const i=s=>{s.persisted||t()};return st(Re(),"pagehide",i)}},Zg=(e,{x0:t,y0:i,x1:s,y1:n,cx:a,cy:o},r,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==n){const c=Math.atan2(i-o,t-a),h=Math.atan2(n-o,s-a);e.arc(a,o,r,c,h)}else e.lineTo(t,i)},Ai=class extends Jc{constructor(){super(...arguments),this.path=new pu,this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&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(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){t.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new pu),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t)}finally{t.restore()}}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=jt("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};Ai.className="Path",g([$()],Ai.prototype,"clip",2),g([$()],Ai.prototype,"clipX",1),g([$()],Ai.prototype,"clipY",1);function Tx(e,t,i,s,n){let a=!1,o=!1,r=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 r>e?(a=!0,r=e,l=i-Math.sqrt(Math.max(n**2-(s-e)**2))):He(r,0)&&(r=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-t)**2)),h=t):He(h,0)&&(h=0),{leading0:r,leading1:l,trailing0:c,trailing1:h,leadingClipped:a,trailingClipped:o}}function Ox(e,t,i,s,n,a,o){let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:h}=a;const d=Math.max(r+h,l+c),u=Math.max(r+l,h+c);if(d<=0&&u<=0){if(o==null)e.rect(t,i,s,n);else{const k=Math.max(t,o.x),C=Math.min(t+s,o.x+o.width),A=Math.max(i,o.y),w=Math.min(i+n,o.y+o.height);e.rect(k,A,C-k,w-A)}return}else if(o==null&&r===l&&r===c&&r===h){e.roundRect(t,i,s,n,r);return}if(s<0&&(t+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(o==null)o=new le(t,i,s,n);else{const k=Math.max(t,o.x),C=Math.min(t+s,o.x+o.width),A=Math.max(i,o.y),w=Math.min(i+n,o.y+o.height);o=new le(k,A,C-k,w-A)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,c/=p,h/=p);let f=!0,y=!0,b=!0,x=!0,v,S,M,D;if(f){const k=Tx(o.height,o.width,Math.max(t+r-o.x,0),Math.max(i+r-o.y,0),r);k.leadingClipped&&(x=!1),k.trailingClipped&&(y=!1);const C=Math.max(o.x+k.leading1,o.x),A=Math.max(o.y+k.leading0,o.y),w=Math.max(o.x+k.trailing1,o.x),T=Math.max(o.y+k.trailing0,o.y),O=t+r,z=i+r;v={x0:C,y0:A,x1:w,y1:T,cx:O,cy:z}}if(y){const k=Tx(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);k.leadingClipped&&(f=!1),k.trailingClipped&&(b=!1);const C=Math.min(o.x+o.width-k.leading0,o.x+o.width),A=Math.max(o.y+k.leading1,o.y),w=Math.min(o.x+o.width-k.trailing0,o.x+o.width),T=Math.max(o.y+k.trailing1,o.y),O=t+s-l,z=i+l;S={x0:C,y0:A,x1:w,y1:T,cx:O,cy:z}}if(b){const k=Tx(o.height,o.width,Math.max(o.x+o.width-(t+s-c),0),Math.max(o.y+o.height-(i+n-c),0),c);k.leadingClipped&&(y=!1),k.trailingClipped&&(x=!1);const C=Math.min(o.x+o.width-k.leading1,o.x+o.width),A=Math.min(o.y+o.height-k.leading0,o.y+o.height),w=Math.min(o.x+o.width-k.trailing1,o.x+o.width),T=Math.min(o.y+o.height-k.trailing0,o.y+o.height),O=t+s-c,z=i+n-c;M={x0:C,y0:A,x1:w,y1:T,cx:O,cy:z}}if(x){const k=Tx(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(t+h-o.x,0),h);k.leadingClipped&&(b=!1),k.trailingClipped&&(f=!1);const C=Math.max(o.x+k.leading0,o.x),A=Math.min(o.y+o.height-k.leading1,o.y+o.height),w=Math.max(o.x+k.trailing0,o.x),T=Math.min(o.y+o.height-k.trailing1,o.y+o.height),O=t+h,z=i+n-h;D={x0:C,y0:A,x1:w,y1:T,cx:O,cy:z}}let I=!1;f&&v!=null&&(Zg(e,v,r,!I),I||(I=!0)),y&&S!=null&&(Zg(e,S,l,!I),I||(I=!0)),b&&M!=null&&(Zg(e,M,c,!I),I||(I=!0)),x&&D!=null&&Zg(e,D,h,!I),e.closePath()}var Ci=class extends Ai{constructor(){super(...arguments),this.borderPath=new pu,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(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,__crisp:i,__topLeftCornerRadius:s,__topRightCornerRadius:n,__bottomRightCornerRadius:a,__bottomLeftCornerRadius:o}=this;let{__x:r,__y:l,__width:c,__height:h,__strokeWidth:d,__clipBBox:u}=this;const f=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(e.clear(),t.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=f&&(y*=c/f),h<=f&&(y*=h/f),c=this.align(r,c),h=this.align(l,h),r=this.align(r),l=this.align(l),u=u==null?void 0:new le(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height))),d)if(c<f){const x=r+f/2;t.moveTo(x,l),t.lineTo(x,l+h),d=f,this.borderClipPath=void 0}else if(h<f){const x=l+f/2;t.moveTo(r,x),t.lineTo(r+c,x),d=f,this.borderClipPath=void 0}else if(d<c&&d<h){const x=d/2;r+=x,l+=x,c-=d,h-=d;const v=u?.clone().shrink(x),S={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:a>0?a-d:0,bottomLeft:o>0?o-d:0};this.borderClipPath=void 0,c>0&&h>0&&(v==null||v?.width>0&&v?.height>0)&&(Ox(e,r,l,c,h,S,v),Ox(t,r,l,c,h,S,v))}else this.borderClipPath=this.borderClipPath??new pu,this.borderClipPath.clear(),this.borderClipPath.rect(r,l,c,h),t.rect(r,l,c,h);else{const x={topLeft:s,topRight:n,bottomRight:a,bottomLeft:o};this.borderClipPath=void 0,Ox(e,r,l,c,h,x,u)}if([s,n,a,o].every(yj)){let x=function(M,D){return S.getBBox().distanceSquared(M,D)};var b=x;const v=this.getBBox();this.hittester=v.containsPoint.bind(v);const S=this;this.distanceSquared=x}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=y}computeBBox(){const{__x:e,__y:t,__width:i,__height:s,__clipBBox:n}=this;return n?.clone()??new le(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(e,t,i,s,n,a,o,r){this.__drawingMode=e,this.__topLeftCornerRadius=t,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=s,this.__bottomLeftCornerRadius=n,this.__visible=a,this.__crisp=o,this.__fillShadow=r,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(e,t,i,s,n,a){this.__x=e,this.__y=t,this.__width=i,this.__height=s,this.__opacity=n,this.__clipBBox=a,this.dirtyPath=!0,this.markDirty()}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{lineDash:n,lineDashOffset:a,lineCap:o,lineJoin:r,borderPath:l,borderClipPath:c}=this;c&&e.clip(c.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),a&&(e.lineDashOffset=a),o&&(e.lineCap=o),r&&(e.lineJoin=r),e.stroke(l.getPath2D()),e.globalAlpha=s}}};Ci.className="Rect",g([Ee()],Ci.prototype,"x",2),g([Ee()],Ci.prototype,"y",2),g([Ee()],Ci.prototype,"width",2),g([Ee()],Ci.prototype,"height",2),g([Ee()],Ci.prototype,"topLeftCornerRadius",2),g([Ee()],Ci.prototype,"topRightCornerRadius",2),g([Ee()],Ci.prototype,"bottomRightCornerRadius",2),g([Ee()],Ci.prototype,"bottomLeftCornerRadius",2),g([Ee({equals:Tg})],Ci.prototype,"clipBBox",2),g([Ee()],Ci.prototype,"crisp",2);function yj(e){return e===0}var xj=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){be.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(e,t){const i=this.stats.get(e);i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.sum+=t,i.count+=1):this.stats.set(e,{min:t,max:t,sum:t,count:1})}recordTimings(e){for(const[t,i]of Object.entries(e))t!=="start"&&typeof i=="number"&&this.recordTiming(t,i)}logAccumulatedStats(){if(this.stats.size===0)return;const e=(Date.now()-this.lastLogTime)/1e3,t=Array.from(this.stats.keys()).sort((a,o)=>a==="\u23F1\uFE0F"?-1:o==="\u23F1\uFE0F"?1:a.localeCompare(o)),i=[];for(const a of t){const o=this.stats.get(a),r=o.sum/o.count;i.push(`${a}[${o.min.toFixed(1)}/${r.toFixed(1)}/${o.max.toFixed(1)}]ms`)}const n=this.stats.get("\u23F1\uFE0F")?.count??0;K.log(`\u{1F4CA} Stats (${e.toFixed(0)}s, ${n} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},xu,th=0;function bj(){return xu??(xu=new xj),xu}function vj(){th++;let e=!1;return()=>{e||th===0||(e=!0,th--,th===0&&yT())}}function Sj(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function Mj(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[t,e,i])typeof n=="number"&&s.push(Sj(n));return`Heap ${s.join(" / ")}`}function gT(e,t,i,s,n={},a=le.zero,o){if(!be.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:r=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:d=0,opsSkipped:u=0}=s??{},p=performance.now(),{start:f,...y}=t,b=p-f,x=bj();x.recordTimings(y),x.recordTiming("\u23F1\uFE0F",b);const v=Object.entries(y).map(([B,F])=>mT(B,F)).filter(B=>B!=null).join(" + "),S=Object.entries(n).map(([B,F])=>`${B}: ${JSON.stringify(F)}`).join(" ; "),M=be.check("scene:stats:verbose"),D=M?Mj():null,I=M?ha.flush():{},k=Object.entries(I),C=[],A=[];for(const[B,F]of k)B.endsWith(":aggregation")&&Array.isArray(F)?C.push(`${B.replace(":aggregation","")}(${F.join(",")})`):B.endsWith(":nodeData")&&typeof F=="number"&&A.push(`${B.replace(":nodeData","")}(${F})`);const w=C.length>0?`Aggregation: ${C.join(", ")}`:null,T=A.length>0?`NodeData: ${A.join(", ")}`:null,O=[`${mT("\u23F1\uFE0F",f,p)} (${v})`,`${S}`,w,T,`Layers: ${M?bD(r,l):e.size}`,M?`Nodes: ${bD(c,h)}`:null,M?`Ops: ${bD(d,u)}`:null,D].filter(Bt),z=new sx(i),V=new Map(O.map(B=>[B,z.measureText(B)])),E=Math.max(...Array.from(V.values(),B=>B.width)),_=wj(V.values(),B=>B.height),G=2+a.x;i.save();try{i.fillStyle=o?.background??"white",i.fillRect(G,0,E,_),i.fillStyle=o?.foreground??"black";let B=0;for(const[F,Y]of V.entries())B+=Y.height,i.fillText(F,G,B)}catch(B){K.warnOnce("Error during debug stats rendering",B)}finally{i.restore()}}function Dj(e){const t=ld(Re("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function kj(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const n=Wt.toCanvas(s);if(!n){K.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}}catch(i){K.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var Ij=new Set,Aj=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function Cj(e){const{...t}=e;for(const i of Object.keys(t))Aj.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(Ij.add(i),delete t[i]);return t}function Px(e,t){if(!be.check(!0,"scene"))return{};let i=0;return{node:t==="json"?Cj(e):e,name:e.name??e.id,dirty:e instanceof Le?e.dirty:void 0,...Array.from(e instanceof Le?e.children():[],s=>Px(s,t)).reduce((s,n)=>{let{name:a}=n;const{node:{visible:o,opacity:r,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:f}=n;(!o||r<=0)&&(a=`(${a})`),Le.is(f)&&f.renderToOffscreenCanvas&&(a=`*${a}*`);const y=Array.isArray(l)?`(${l.join(", ")})`:l,b=[`${(i++).toString().padStart(3,"0")}|`,`${a??"<unknown>"}`,`z: ${y}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(S=>!!S).join(" ");let x=b,v=1;for(;s[x]!=null&&v<100;)x=`${b} (${v++})`;return s[x]=n,s},{})}}function fT(e){const t=e instanceof Le?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof Le?e.children():[],a=>fT(a)).filter(a=>a.paths.length>0),s=Le.is(e)?e.name??e.id:e.id,n=i.length?i.flatMap(a=>a.paths).map(a=>`${s}.${a}`):[s];return{dirtyTree:{name:s,node:e,dirty:t,...i.map(a=>a.dirtyTree).filter(a=>a.dirty!=null).reduce((a,o)=>(a[o.name??"<unknown>"]=o,a),{})},paths:n}}function bD(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function mT(e,t,i){const s=i==null?t:i-t;return`${e}: ${Math.round(s*100)/100}ms`}function wj(e,t){let i=0;for(const s of e)i+=t(s);return i}function yT(e=!1){if(!xu){e&&(th=0);return}!e&&th>0||(xu.destroy(),xu=void 0,e&&(th=0))}var yn=class Tn extends Jc{constructor(t){super(t),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=Tn.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=t?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),De(this.text))this.lines=[],this.richText??(this.richText=new Le),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(t=>At(t.text).split(sr)).filter(Boolean).map(()=>new Tn({trimText:!1})));else{const t=At(this.text).split(sr);this.lines=this.trimText?t.map(i=>i.trim()):t}}get font(){return this.fontCache??(this.fontCache=Gm(this)),this.fontCache}static measureBBox(t,i,s,n){if(De(t)){const{font:a,lineHeight:o,textAlign:r,textBaseline:l}=n,{width:c,height:h,lineMetrics:d}=Js(t,a),u=o?o*d.length:h,p=Tn.calcTopOffset(u,d[0],l),f=Tn.calcLeftOffset(c,r);return new le(i-f,s-p,c,u)}else return Tn.computeBBox(At(t).split(sr),i,s,n)}static computeBBox(t,i,s,n){const{font:a,lineHeight:o,textAlign:r,textBaseline:l}=n,{width:c,height:h,lineMetrics:d}=et(a).measureLines(t),u=o?o*d.length:h,p=Tn.calcTopOffset(u,d[0],l),f=Tn.calcLeftOffset(c,r);return new le(i-f,s-p,c,u)}static calcTopOffset(t,i,s){switch(s){case"alphabetic":return i?.ascent??0;case"middle":return t/2;case"bottom":return t;default:return 0}}static calcSegmentedTopOffset(t,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,et(a).baselineDistance("middle")),0):t/2;case"bottom":return t;default:return 0}}static calcLeftOffset(t,i){let s=0;switch(i){case"center":s=.5;break;case"right":case"end":s=1}return t*s}getBBox(){const t=super.getBBox();if(!this.textMap?.size||!De(this.text))return t;const{height:i,lineMetrics:s}=Js(this.text,this),n=Tn.calcSegmentedTopOffset(i,s,this.textBaseline),a=this.y-n;return t.y===a?t:new le(t.x,a,t.width,t.height)}computeBBox(){if(this.generateTextMap(),this.textMap?.size){const r=le.merge(this.textMap.values());return r.x=this.x-Tn.calcLeftOffset(r.width,this.textAlign),r.y=this.y,r}const{x:t,y:i,lines:s,textBaseline:n,textAlign:a}=this,o=Tn.computeBBox(s,t,i,{font:this,textBaseline:n,textAlign:a});return this.boxing!=null&&o.grow(this.boxPadding),o}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return Ne(this.text)}isPointInPath(t,i){return this.getBBox()?.containsPoint(t,i)??!1}setScene(t){this.richText?.setScene(t),super.setScene(t)}generateTextMap(){if(!De(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let t=0;const i=this.richText.children();for(const{width:s,height:n,ascent:a,segments:o}of Js(this.text,this).lineMetrics){let r=0;for(const{color:l,textMetrics:c,...h}of o){const d=i.next().value;d.x=this.x-s/2+r,d.y=a+t,d.setProperties({...h,fill:l??this.fill});const u=d.getBBox();this.textMap.set(d,u),r+=c.width}t+=n}}render(t){const{ctx:i,stats:s}=t;if(!this.layerManager||!this.hasRenderableText())return s&&(s.nodesSkipped+=1),super.render(t);if(De(this.text)&&this.richText){this.generateTextMap();const n=this.richText.getBBox(),{width:a,height:o,lineMetrics:r}=Js(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-Tn.calcSegmentedTopOffset(o,r,this.textBaseline);this.renderBoxing(t,n.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(t),i.restore()}else this.renderText(t);if(Tn.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(t)}markDirty(t){return this.textMap?.clear(),super.markDirty(t)}renderText(t){const{fill:i,stroke:s,strokeWidth:n,font:a,textAlign:o}=this;if(!i&&!(s&&n)||!this.layerManager)return super.render(t);const{ctx:r}=t;r.font!==a&&(r.font=a),r.textAlign=o,this.renderBoxing(t),this.fillStroke(r)}renderBoxing(t,i){if(!this.boxing)return;const s=i??Tn.computeBBox(this.lines,this.x,this.y,this);if(s.width===0||s.height===0)return;const{x:n,y:a,width:o,height:r}=s.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=n,this.boxing.y=a,this.boxing.width=o,this.boxing.height=r,this.boxing.preRender(t),this.boxing.render(t)}executeFill(t){this.renderLines((i,s,n)=>t.fillText(i,s,n))}executeStroke(t){this.renderLines((i,s,n)=>t.strokeText(i,s,n))}renderLines(t){const{x:i,y:s,lines:n}=this;if(!Number.isFinite(i)||!Number.isFinite(s))return;const a=et(this),{lineMetrics:o}=a.measureLines(n),{textBaseline:r,lineHeight:l=a.lineHeight()}=this;let c=0;r==="top"?c=o[0].ascent:(r==="middle"||r==="bottom")&&(c=l*(1-n.length),r==="middle"?(c/=2,c-=a.baselineDistance(r)):c-=o[0].descent);for(const h of o)t(h.text,i,s+c),c+=l}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}setBoxing(t){const i=t.border?.enabled?t.border?.stroke:void 0;t.fill!=null||i!=null?(this.boxing??(this.boxing=new Ci({scene:this.scene})),this.boxing.fill=t.fill,this.boxing.fillOpacity=t.fillOpacity??1,this.boxing.cornerRadius=t.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=t.border?.strokeWidth??0,this.boxing.strokeOpacity=t.border?.strokeOpacity??1,this.boxPadding=t.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}getBoxingProperties(){const{fill:t,fillOpacity:i,cornerRadius:s,stroke:n,strokeWidth:a,strokeOpacity:o}=this.boxing??{};return{border:{enabled:n!=null,stroke:n,strokeWidth:a,strokeOpacity:o},cornerRadius:s,fill:t,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const t=this.text;if(t==null)return;const i=jt("text");if(De(t))for(const s of t){const n=jt("tspan");aT(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=At(s.text),i.append(n)}else this.applySvgFillAttributes(i),aT(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=At(t);return{elements:[i]}}hasRenderableText(){const{text:t}=this;return t==null?!1:De(t)?!0:At(t)!==""}};yn.className="Text",yn.debug=be.create(!0,"scene:text"),yn.defaultFontSize=10,g([$()],yn.prototype,"x",2),g([$()],yn.prototype,"y",2),g([Kg({changeCb:e=>e.onTextChange()})],yn.prototype,"text",2),g([$({changeCb:e=>{e.fontCache=void 0}})],yn.prototype,"fontStyle",2),g([$({changeCb:e=>{e.fontCache=void 0}})],yn.prototype,"fontWeight",2),g([$({changeCb:e=>{e.fontCache=void 0}})],yn.prototype,"fontSize",2),g([$({changeCb:e=>{e.fontCache=void 0}})],yn.prototype,"fontFamily",2),g([$()],yn.prototype,"textAlign",2),g([$()],yn.prototype,"textBaseline",2),g([$()],yn.prototype,"lineHeight",2);var xn=yn,xT=class extends gu(xn){},bu=class extends gu(fu(xn)){},vu=class extends hi{constructor(e){super(),this.ctx=e,this.rectNode=new Ci,this.textNode=new xn,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}createNode(){return new Le({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};g([m,Dt("node","visible")],vu.prototype,"visible",2),g([m,Dt("rectNode","fill")],vu.prototype,"fill",2),g([m],vu.prototype,"image",2),g([m,Dt("textNode")],vu.prototype,"text",2);var zt=class extends X{constructor(){super(...arguments),this.id=Ii(this),this.node=new xT({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n}=this,a=Math.min(this.maxWidth??1/0,e)-s*2,o=this.maxHeight??t-s*2,r={maxWidth:a,maxHeight:o,font:this,textWrap:n};if(!Number.isFinite(a)&&!Number.isFinite(o)){this.node.text=i;return}let l;De(i)?(l=ax(i,r),this.truncated=l.some(Xp)):(l=Io(At(i),r),this.truncated=nr(l)),this.node.text=l}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(!this.enabled||!this.text){this.destroyProxyText();return}const s=Wt.toCanvas(this.node);if(!s)return;const{id:n}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))]);const a=Ne(this.text);a!==this.lastProxyTextContent&&(this.proxyText.textContent=a,this.lastProxyTextContent=a);const{lastProxyBBox:o}=this;(o==null||s.x!==o.x||s.y!==o.y||s.width!==o.width||s.height!==o.height)&&(this.proxyText.setBounds(s),this.lastProxyBBox={x:s.x,y:s.y,width:s.width,height:s.height})}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.truncated){const{x:i,y:s}=Wt.toCanvas(this.node),n=t.sourceEvent.offsetX+i,a=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:a,showArrow:!1},[{type:"structured",title:Ne(this.text)}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const e of this.proxyTextListeners??[])e();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};zt.className="Caption",zt.SMALL_PADDING=10,g([m,Dt("node","visible")],zt.prototype,"enabled",2),g([m,Dt("node")],zt.prototype,"text",2),g([m,Dt("node")],zt.prototype,"textAlign",2),g([m,Dt("node")],zt.prototype,"fontStyle",2),g([m,Dt("node")],zt.prototype,"fontWeight",2),g([m,Dt("node")],zt.prototype,"fontSize",2),g([m,Dt("node")],zt.prototype,"fontFamily",2),g([m,Dt("node","fill")],zt.prototype,"color",2),g([m],zt.prototype,"spacing",2),g([m],zt.prototype,"maxWidth",2),g([m],zt.prototype,"maxHeight",2),g([m],zt.prototype,"wrapping",2),g([m],zt.prototype,"padding",2),g([m],zt.prototype,"layoutStyle",2);var Ex=class extends Array{destroy(){for(const e of this)e.destroy();this.length=0}findById(e){return this.find(t=>t.id===e)}matches(e){return this.length===Object.keys(e).length&&L0(e,(t,i)=>ge(i)&&"type"in i&&this.findById(t)?.type===i.type)}getById(e){const t=this.findById(e);if(!t)throw new Error(`Could not find axis by id [${e}].`);return t}},Lj=class extends Ex{get x(){return this.getById("x")}get y(){return this.getById("y")}perpendicular(e){const t=e.direction==="x"?"y":"x";return this[t]}},Nj=class extends Ex{get angle(){return this.getById("angle")}get radius(){return this.getById("radius")}},Rx=class{constructor(){this.title=new zt,this.subtitle=new zt,this.footnote=new zt}positionCaptions({layoutBox:e}){const{title:t,subtitle:i,footnote:s}=this,n=e.height/10;t.enabled&&(this.positionCaption("top",t,e,n),this.shrinkLayoutByCaption("top",t,e)),i.enabled&&(this.positionCaption("top",i,e,n),this.shrinkLayoutByCaption("top",i,e)),s.enabled&&(this.positionCaption("bottom",s,e,n),this.shrinkLayoutByCaption("bottom",s,e))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:n}=e.series;for(const a of[t,i,s])if(a.layoutStyle==="overlay"){if(a.textAlign==="left")a.node.x=n.x+a.padding;else if(a.textAlign==="right"){const o=a.node.getBBox();a.node.x=n.x+n.width-o.width-a.padding}}}computeX(e,t){return e==="left"?t.x:e==="right"?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){if(!t.text)return;const{lineMetrics:n}=De(t.text)?Js(t.text,t):et(t).measureLines(At(t.text)),a=Math.max(n[0].height,s);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+(e==="top"?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,a)}shrinkLayoutByCaption(e,t,i){if(t.layoutStyle==="block"){const s=t.node.getBBox().clone(),{spacing:n=0}=t;e==="bottom"&&De(t.text)&&(s.y-=s.height),i.shrink(Math.ceil(e==="top"?s.y-i.y+s.height+n:i.y+i.height-s.y+n),e)}}};g([m],Rx.prototype,"title",2),g([m],Rx.prototype,"subtitle",2),g([m],Rx.prototype,"footnote",2);var Tj=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],Oj=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e??(e="candlestick"),e}guardMemento(e){return e==null||Tj.includes(e)}restoreMemento(e,t,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>K.error("error restoring state",n))}},ue="13.1.0",bT=Symbol("previous-memento-not-found"),Pj=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=be.create(!0,"history"),this.cleanup=new pt,this.cleanup.register(e.on("series:undo",this.undo.bind(this)),e.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){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 t){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:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const i=this.findPreviousMemento(t);if(i===bT)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):bT}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(ue,ue,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},Ej=class{constructor(){this.caretaker=new Dy(ue),this.state=new Map}setState(e,t){Ht(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const s=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:s},e)}},Rj=`.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}
`,vD=class{constructor(){this.cleanup=new pt,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},zj=class PS{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new pt,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(t){this.guardTabIndex=t,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(t,i){this.cleanup.register(st(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;Pe(this.topTabGuard,"tabindex",i),Pe(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let s;t.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(t,i){const s=Re();return Array.from(t.querySelectorAll(i)).filter(n=>{if(hd(n)){const a=s.getComputedStyle(n);return a.display!=="none"&&a.visibility!=="none"}return!1})}findEnterTarget(t){const i=PS.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=PS.queryFocusable(dn(),"[tabindex]").filter(a=>a.tabIndex>0).sort((a,o)=>a.tabIndex-o.tabIndex),{before:s,after:n}=PS.findBeforeAndAfter(i,this.guardTabIndex);return t?s:n}static findBeforeAndAfter(t,i){let s=0,n=t.length-1,a,o;for(;s<=n;){const r=Math.floor((s+n)/2),l=t[r].tabIndex;if(l===i){a=t[r-1]||void 0,o=t[r+1]||void 0;break}else l<i?(a=t[r],s=r+1):(o=t[r],n=r-1)}return{before:a,after:o}}},Vj=class{constructor(e){this.callback=e,this.devicePixelRatio=Re("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=Re("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 e=Re("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},vT=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 e=Bm();e!==void 0&&(this.resizeObserver=new e(i=>{for(const{target:s,contentRect:{width:n,height:a}}of i){const o=this.elements.get(s);this.checkSize(o,s,n,a)}}));let t;this.pixelRatioObserver=new Vj(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=dn("readyState")==="complete",this.documentReady?this.observeWindow():Re()?.addEventListener("load",this.onLoad)}destroy(){Re()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:n},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady){this.queuedObserveRequests.push([e,t]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},Xg=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),t!==void 0&&super.set(e,t),delete this.cachedState,delete this.cachedValue,this}delete(e){return delete this.cachedState,delete this.cachedValue,super.delete(e)}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}},Bj='<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>',Fj=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],_j=new Set(["styles","canvas-container","canvas","tooltip-container"]),ST={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},Hj=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 Gj(e,t){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===e&&t(n.intersectionRatio)},{root:e});return i.observe(e),i}var MT={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return MT}};function DT(e,t){const i=ye("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var zx=class ad extends vD{constructor(t,i,s,n,a,o="normal"){super(),this.eventsHub=t,this.chart=i,this.styleContainer=n,this.skipCss=a,this.mode=o,this.anchorName=`--${Ii(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 vT,this.cursorState=new Xg("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 r=!1;if(this.observer=Gj(this.element,l=>{l===0&&!r&&this.eventsHub.emit("dom:hidden",null),r=l===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",Rj),this.setContainer(s),this.cleanup.register(vM(this.element)),this.mode==="normal"){const l=this.rootElements["canvas-center"].element;if(l==null)throw new Error("Error initializing tab guards");const c=DT(l,"beforebegin"),h=DT(l,"afterend");this.tabGuards=new zj(l,c,h)}}initDOM(){if(this.mode==="normal"){const s=ye("div");return s.innerHTML=Bj,s.firstChild}const t=ye("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=ye("div");return t.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:i}=this,s={};for(const n of Fj){const a=`ag-charts-${n}`;let o;if(t==="normal"?o=i.classList.contains(a)?i:i.getElementsByClassName(a)[0]:_j.has(n)?o=i:o=i.getElementsByClassName(a)[0]??ye("div"),o==null)throw new Error(`AG Charts - unable to find DOM element ${a}`);s[n]={element:o,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 t of Object.values(this.rootElements)){for(const i of t.children.values())i.remove();t.element.remove()}this.element.remove()}postRenderUpdate(){this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(ad.batchedUpdateContainer.length===0&&Re().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),ad.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of ad.batchedUpdateContainer)t.destroyed||t.updateContainer();ad.batchedUpdateContainer.splice(0)}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.documentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const t of this.rootElements.styles.children.keys())this.removeChild("styles",t);for(const[t,i]of this.styles)this.addStyles(t,i)}}setSizeOptions(t=300,i=300,s,n){const{style:a}=this.element;a.width=`${s??t}px`,a.height=`${n??i}px`,this.minWidth=s??t,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:t}=this.rootElements["canvas-center"].element;t.visibility=this.containerSize==null?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(!(t==null||t===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=t,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=t.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.eventsHub.emit("dom:resize",null)}),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(t){const i="ag-charts-theme-";for(const s of Array.from(this.element.classList))s.startsWith(i)&&s!==t&&this.element.classList.remove(s);this.element.classList.add(t)}setThemeParameters(t){for(const[i,s]of rt(t)){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-${r0(i)}`,n)}}updateCanvasLabel(t){Pe(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:t}addEventListener(t,i,s){const n=this.getEventElement(this.element,t);return st(n,t,i,s)}removeEventListener(t,i,s){this.getEventElement(this.element,t).removeEventListener(t,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=Re(),i=new le(0,0,t.innerWidth,t.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??MT}getRawOverlayClientRect(){let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let a;if(i!=null&&t===i)a=!0;else{const r=t.computedStyleMap?.()?.get("overflow-y")?.toString();a=r==="auto"||r==="scroll"}if(a)return le.fromObject(t.getBoundingClientRect());t=t.parentElement}if(this.documentRoot!=null)return le.fromObject(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=Re();return new le(0,0,s,n)}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??dn("body");for(;t!=null;){if(t===i)return;if(KS(t.parentNode))return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:i}=this.rootElements[t],s=[];for(const n of i.values())s.push(le.fromObject(n.getBoundingClientRect()));return le.merge(s)}isManagedChildDOMElement(t,i,s){const{children:n}=this.rootElements[i],a=n?.get(s);return a!=null&&t.contains(a)}contains(t,i){return i==null?this.element.contains(t):this.rootElements[i].element.contains(t)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),this.container==null||this.skipCss)return;const n=r=>r.getAttribute(s)===t,a=r=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of r.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=ye("style");return this.chart.styleNonce!=null&&(d.nonce=this.chart.styleNonce),h==null?r.prepend(d):r.insertBefore(d,h.nextSibling),d};let o;this.styleContainer?o=a(this.styleContainer):this.initiallyConnected===!1?o=this.addChild("styles",t):this.documentRoot==null&&!ad.headStyles.has(t)?(o=a(dn("head")),ad.headStyles.add(t)):this.documentRoot!=null&&(o=this.addChild("styles",t)),!(o==null||n(o))&&(o.setAttribute(s,t),o.innerHTML=i)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,i){this.cursorState.set(t,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(t,i,s,n){const{element:a,children:o,listeners:r}=this.rootElements[t];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(i))return o.get(i);const{childElementType:l="div"}=Hj.get(t)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??ye(l);for(const[h,d,u]of r)c.addEventListener(h,d,u);if(o.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(t,i){const{children:s}=this.rootElements[t];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(t){const{dataset:i}=this.element;i[t]??(i[t]="0"),i[t]=String(Number(i[t])+1)}setDataBoolean(t,i){this.element.dataset[t]=String(i)}setDataNumber(t,i){this.element.dataset[t]=String(i)}updateContainerClassName(){const{element:t,containerSize:i,minWidth:s,minHeight:n}=this;t.classList.toggle(ST.safeHorizontal,s>=(i?.width??1/0)),t.classList.toggle(ST.safeVertical,n>=(i?.height??1/0))}};zx.className="DOMManager",zx.batchedUpdateContainer=[],zx.headStyles=new Set;var kT=zx,jj=class extends Er{constructor(){super(ye("div")),this.textElement=jt("text"),this.textElement.role="presentation",this.svgElement=jt("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(e){this.textElement.textContent=e;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(){}},Wj=class{constructor(e,t){this.getDispatcher=t,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()},e.setAriaExpanded(!1),this.controller=e}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(e){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=e,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(e){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:e?.overrideFocusVisible})}},SD=class extends Er{constructor(e,t){super(e),Pe(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{Jy(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new Wj(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(e){Pe(this.elem,"aria-disabled",!e)}setControlled(e){return this.lazyControllerImpl().setControlled(e)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(e){return this.lazyControllerImpl().expandControlled(e)}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},Vx=class extends SD{constructor(){super(ye("button"))}},IT=class extends Er{constructor(){super(ye("div")),Pe(this.elem,"role","group")}destructor(){}},MD=class extends Er{constructor(e,t){super(ye("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,o]=n==="both"?[Ud.horizontal,Ud.vertical]:[Ud[n],void 0];let r=-1;if(Kd(i.sourceEvent)){const l=i.sourceEvent.key;l===a.nextKey||l===o?.nextKey?r=s.index+1:(l===a.prevKey||l===o?.prevKey)&&(r=s.index-1)}this.children[r]?.focus()},Pe(this.elem,"role",t),this.orientation=e}get orientation(){return wl(this.elem,"aria-orientation")??"both"}set orientation(e){Pe(this.elem,"aria-orientation",e==="both"?void 0:e)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,s=t===e.index;for(let n=0;n<i.length;n++){const a=i[n];a.index===t&&(this.focusedChildIndex=n),a.index=n}if(s){const n=i[t]??i[t-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},$j=class extends MD{constructor(){super("both","list"),this.setHidden(!0)}destructor(){for(const e of this.children)e.getElement().parentElement.remove()}addChildToDOM(e,t){const i=ye("div");Pe(i,"role","listitem"),_n(i,"position","absolute"),Er.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(e){this.children.length===0&&(e=!0),super.setHidden(e)}},Su=class extends Er{constructor(e){super(e)}destructor(){}},DD=class Lm extends Er{constructor(){super(ye("input")),this._step=Lm.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==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),t!==void 0)){const i=()=>this.getElement().step=t.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,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 wl(this.elem,"aria-orientation")??"both"}set orientation(t){Pe(this.elem,"aria-orientation",t==="both"?void 0:t),Lm.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),n=ae(t,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(t,i){const{divider:s}=this.step,n=Math.round(t*1e4)/s,{ariaValueText:a=hM(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=a,o.ariaValueNow=`${n}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",Lm.onKeyDown):t.addListener("keydown",Lm.onKeyDown)}static onKeyDown(t,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};DD.STEP_ONE={attributeValue:"1",divider:1},DD.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var kD=DD,Kj=class extends Vx{constructor(){super(),Pe(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){Pe(this.elem,"aria-checked",e)}},Bx=class extends MD{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function Mu(e,t){return t.params?.type===e}function Uj(e){if(e==="button")return new Vx;if(e==="slider")return new kD;if(e==="toolbar")return new Bx;if(e==="group")return new IT;if(e==="list")return new $j;if(e==="region")return new Su(ye("div"));if(e==="text")return new jj;if(e==="listswitch")return new Kj;throw new Error("AG Charts - error allocating meta")}function AT(e){const t={params:e,result:void 0};return t.result=Uj(t.params.type),t}var Yj=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new pt}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=AT(e),{params:i,result:s}=t,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,Mu("toolbar",t)&&(t.result.orientation=t.params.orientation);const{ariaLabel:a}=i;return a&&this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(a.id,a.params)}),s}createProxyElement(e){const t=AT(e);if(Mu("button",t)){const{params:i,result:s}=t,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(t.params,t.result)}if(Mu("slider",t)){const{params:i,result:s}=t,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(t.params,t.result)}if(Mu("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(Mu("listswitch",t)){const{params:i,result:s}=t;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(Mu("region",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.role=i.role??"region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return _n(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),e.classList?.length&&i.classList.add(...e.classList),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,n=this.initElement(e,t);i!==void 0&&(n.tabIndex=i),s!==void 0&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i),t.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",e.domManagerId)}}}},Zj=/\$\{(\w+)}(?:\[(\w+)])?/gi,ID={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"})},Xj=({defaultValue:e,variables:t})=>e?.replaceAll(Zj,(i,s,n)=>{const a=t[s],o=n==null?null:ID[n];return n!=null&&o==null&&K.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(a):typeof a=="number"?ID.number.format(a):a instanceof Date?ID.datetime.format(a):String(a)}),qj=class{constructor(e){this.eventsHub=e,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.eventsHub.emit("locale:change",null))}t(e,t={}){const{localeText:i=HN,getLocaleText:s}=this,n=i[e];return String(s?.({key:e,defaultValue:n,variables:t})??Xj({key:e,defaultValue:n,variables:t})??e)}},CT=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:n=!1}=e;this.pixelRatio=e.pixelRatio??Re("devicePixelRatio")??1,this.element=s??ye("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??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(t??0,i??0,this.pixelRatio),$N(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:n}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),n.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){WN(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")}};g([Xt(e=>e.onEnabledChange())],CT.prototype,"enabled",2);var Qj=class extends Pn{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=$S(),a=new n;return this.imageLoadingCount++,a.onload=()=>{s.image=a;for(const o of s.nodes)o.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},a.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},a.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const e of this.cache.values())e.nodes.clear();this.cache.clear()}},Jj=class{constructor(e){this.canvas=e,this.debug=be.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i);for(const{canvas:s}of this.layersMap.values())s.resize(e,t,i)}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:n}=e,a=new rD({width:t,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(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},Fx=class extends Pn{constructor(e){super(),this.debug=be.create(!0,"scene"),this.id=Ii(this),this.imageLoader=new Qj,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new pt,this.updateDebugFlags(),this.canvas=new CT(e),this.layersManager=new Jj(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{K.warnOnce(`Unable to load image ${t}`)}))}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(e){const{element:t}=this.canvas;return t.remove(),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){be.inDevelopmentMode(()=>Pr._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>e.remove()}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return e.remove(),this}download(e,t){NM(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s,debugColors:n}=e??{},{canvas:a,canvas:{context:o}={},root:r,width:l,height:c,pixelRatio:h}=this;if(!o)return;const d=be.check("scene:stats","scene:stats:verbose");d&&this.ensureDebugStatsRegistration();const u=performance.now(),p=this.applyPendingResize();if(r&&!r.visible){this.isDirty=!1;return}let f;if(r instanceof Le&&(f=r.dirty),r!=null&&f===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:Px(r,"console")}),d&&gT(this.layersManager,t,o,void 0,i,s,n);return}const y={ctx:o,width:l,height:c,devicePixelRatio:h,debugNodes:{}};be.check("scene:stats:verbose")&&(y.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),Dj(y);let b=!1;if((f!==!1||p)&&(b=!0,a.clear()),r&&be.check("scene:dirtyTree")){const{dirtyTree:x,paths:v}=fT(r);be.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:x,paths:v})}if(r&&b){if(r.visible&&r.preRender(y),this.debug.check()){const x=Px(r,"console");this.debug("Scene.render() - before",{canvasCleared:b,tree:x})}if(r.visible)try{o.save(),r.render(y),o.restore()}catch(x){throw this.canvas.reset(),x}}t["\u270D\uFE0F"]=performance.now()-u,o.verifyDepthZero?.(),this.isDirty=!1,d&&gT(this.layersManager,t,o,y.stats,i,s,n),kj(o,y.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{tree:Px(r,"console"),canvasCleared:b})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const e=vj(),t=()=>{e(),this.releaseDebugStats=void 0};this.releaseDebugStats=t,this.cleanup.register(t)}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return Pr.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,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(),yT(),Object.assign(this,{canvas:void 0})}};Fx.className="Scene";var e4=class{constructor(e,t,i){this.eventsHub=e,this.annotationRoot=t,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||De(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return re(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Te([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(e.remove(),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},t4=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new Le({name:"Axes-Grids",zIndex:2}),this.axisGroup=new Le({name:"Axes",zIndex:3}),this.axisLabelGroup=new Le({name:"Axes-Labels",zIndex:15}),this.axisCrosslineRangeGroup=new Le({name:"Axes-Crosslines-Range",zIndex:6}),this.axisCrosslineLineGroup=new Le({name:"Axes-Crosslines-Line",zIndex:10}),this.axisCrosslineLabelGroup=new Le({name:"Axes-Crosslines-Label",zIndex:15}),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(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of t){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(e){for(const[,t]of this.axes)for(const i of t)if(i.axisId===e)return i}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}},AD=class{constructor(e,t,i){this.eventsHub=e,this.caller=t,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=be.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){typeof e=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(e){const{pendingData:t}=this;if(t!=null&&(t.params.windowStart==null&&t.params.windowEnd==null||t.params.windowStart?.valueOf()===e.windowStart?.valueOf()&&t.params.windowEnd?.valueOf()===e.windowEnd?.valueOf())){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,t.data);return}this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:e}=this;if(!e)return;const{params:t,fetchRequest:i}=e,s=await i;return{params:t,data:s}}restoreData(e){this.pendingData=e}createThrottledFetch(e){return Wm(t=>this.fetch(t).catch(i=>K.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return Wm((t,i)=>this.dispatch(t,i),e,{leading:!0,trailing:!0})}dispatch(e,t){this.debug(`DataService - dispatching 'data-load' | ${e}`),this.eventsHub.emit("data:load",{data:t})}async fetch(e){"context"in this.caller&&(e.context=this.caller.context);const t=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(e),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(o){this.debug(`DataService - request failed | ${s}`),K.errorOnce(`DataService - request failed | [${o}]`)}this.isLoadingInitialData=!1;const a=this.freshRequests.indexOf(t);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:e,fetchRequest:t},this.freshRequests.push(t),await t}};g([_e({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],AD.prototype,"dispatchThrottle",2),g([_e({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],AD.prototype,"requestThrottle",2);var i4=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){if(!(!e||e.size===0)){this.loadFonts(e);for(const t of e)this.observeFontStatus(t)}}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).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=${t.join(s)}${i}&display=swap');
`;this.domManager.addStyles(`google-font-${t.join("-")}`,n)}observeFontStatus(e){const t=Bm();if(t===void 0)return;const i=dn();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",e),s.style.setProperty("font-size","16px"),s.style.setProperty("white-space","nowrap"),s.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,s);const n=new t(a=>{const o=a?.at(0)?.contentBoxSize.at(0)?.inlineSize;o!=null&&o>0&&(et.clear(),this.updateService.update(5))});n.observe(s),this.observers.push(n)}},wT=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===e);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(s){K.errorOnce(s)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},Ao={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},s4={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"},Ts={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},n4=/%[-_0]?L/,a4=/%[-_0]?S/,o4=/%[-_0]?M/,r4=/%[-_0]?[HI]/,l4=/^%[-_0]?[de]$/,c4=/^%[-_0]?[Bbm]$/,h4=/^%[-_0]?[Yy]$/;function d4(e,t,i){if(typeof e=="string")return e;e??(e=Ao);const{millisecond:s=Ao.millisecond,second:n=Ao.second,minute:a=Ao.minute,hour:o=Ao.hour,day:r=Ao.day,month:l=Ao.month,year:c=Ao.year}=e,h=Ts[t],d=s4[t],u=i?Ts[i]:-1;if(u<Ts.year&&h>=Ts.year&&!h4.test(c)||u<Ts.month&&h>=Ts.month&&!c4.test(l)||u<Ts.day&&h>=Ts.day&&!l4.test(r))return d;let p;switch(t){case"year":return c;case"month":return u<Ts.year?`${l} ${c}`:l;case"day":return u<Ts.year?`${l} ${r} ${c}`:`${l} ${r}`;case"hour":p=o;break;case"minute":p=a;break;case"second":p=n;break;case"millisecond":p=s;break;default:return d}if(h>=Ts.hour&&!r4.test(p)||h>=Ts.minute&&!o4.test(p)||h>=Ts.second&&!a4.test(p)||h>=Ts.millisecond&&!n4.test(p))return d;let f;return u<Ts.year?f=`${l} ${r} ${c}`:u<Ts.month&&(f=`${l} ${r}`),f?`${p} ${f}`:p}var Du=class ES extends wT{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=Ar((t,i,s,n,a)=>{const o=ES.mergeSpecifiers(t,i)??Ao;return ES.getFormatter("date",o,s,n,{truncateDate:a})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const s of t)We(s)&&We(i)?i={...i,...s}:i=s;return i}static getFormatter(t,i,s,n="long",{truncateDate:a}={}){if(We(i)){if(t!=="date"){K.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const o=n==="component"?i?.[s]??Ao[s]:d4(i,s,a);return Xc(o)}switch(t){case"number":{const o=tg(i);return o==null?void 0:qm(o)}case"date":return Xc(i);case"category":return o=>i.replace("%s",String(o))}}setFormatter(t){this.formatter!==t&&(this.formatter=t,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:s,truncateDate:n,allowNull:a}={}){if(i.value==null&&!a)return;const{formatter:o}=this;if(o==null)return;if(typeof o=="function"){const h=t(o,i);return h==null?void 0:String(h)}const r=o[i.property];if(r==null)return;if(typeof r=="function"){const h=t(r,i);return h==null?h:At(h)}else if(i.type==="date"){const{unit:h,style:d}=i;return this.dateFormatter(r,s,h,d,n)?.(i.value)}const l=s??r;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=ES.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(t,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,a=typeof n=="function"?void 0:n?.[t.property];switch(t.type){case"date":{const{unit:o,style:r}=t,l=a!=null&&typeof a!="function"?a:void 0;return this.dateFormatter(l,i,o,r,s)?.(t.value)??String(t.value)}case"number":return ya(t.value,t.fractionDigits);case"category":return t.value==null?"":Array.isArray(t.value)?t.value.join(" - "):typeof t.value=="string"?t.value:typeof t.value=="number"?ya(t.value):String(t.value)}}},CD={activeItem:{type:j(eg()("series-node","legend")),seriesId:L,itemId:j(Se(L,P))}};CD.frozen=Q(R);var qg={mode:Q(U("integrated","standalone")),container:Ym,context:()=>!0,theme:ce,series:pn,annotations:ce,navigator:ce,scrollbar:ce,initialState:{active:CD,chartType:L,annotations:ce,legend:Ft({visible:R,seriesId:L,itemId:L,legendItemName:L},"legend state array"),zoom:ce}},u4={...ke,...qg,axes:or,data:pn},p4={...ke,...qg,axes:or,data:pn},g4={...ke,...qg,data:pn,topology:Ll},f4={...ke,...qg,data:pn},LT=(e=>(e[e.Default=64]="Default",e[e.ZoomDrag=32]="ZoomDrag",e[e.Annotations=16]="Annotations",e[e.ContextMenu=8]="ContextMenu",e[e.Animation=4]="Animation",e[e.AnnotationsSelected=2]="AnnotationsSelected",e[e.Frozen=1]="Frozen",e[e.Clickable=82]="Clickable",e[e.Focusable=68]="Focusable",e[e.Keyable=86]="Keyable",e[e.ContextMenuable=72]="ContextMenuable",e[e.AnnotationsMoveable=18]="AnnotationsMoveable",e[e.AnnotationsDraggable=114]="AnnotationsDraggable",e[e.ZoomDraggable=100]="ZoomDraggable",e[e.ZoomClickable=68]="ZoomClickable",e[e.ZoomWheelable=118]="ZoomWheelable",e[e.All=126]="All",e))(LT||{}),NT=class{constructor(){this.stateQueue=68}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}},m4=class{constructor(e,t,i,s,n){this.chartService=e,this.eventsHub=t,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:o}=this;o&&(this.restoreMemento(o.version,o.mementoVersion,o.memento),this.pendingMemento=void 0),a()})}isFrozen(){return this.interactionManager.isState(1)}clear(){this.update(void 0,void 0)}update(e,t){this.performUpdate("user-interaction",e,t,!1)}performUpdate(e,t,i,s){if(!this.updateable)return;const n=this.currentItem;if(this.currentItem=t,this.eventsHub.emit("active:update",t),s||!Ht(n,t)){const{activeItem:a}=this.createMemento(),{datum:o}=i??{};this.fireEvent({type:"activeChange",source:e,activeItem:a,datum:o})}}createMemento(){switch(this.currentItem?.type){case"series-node":case"legend":{const{type:e,seriesId:t,itemId:i}=this.currentItem;return{activeItem:{type:e,seriesId:t,itemId:i}}}default:return this.currentItem?.type,{}}}guardMemento(e,t){if(e==null)return!0;const i=Mi(e,qg.initialState.active);return t.push(...i.invalid.map(s=>s.toString())),i.invalid.length===0}restoreMemento(e,t,i){if(!this.didLayout){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.updateable=!1;const[s,n]=this.performRestoration(i?.activeItem);this.updateable=!0;const a=this.isFrozen(),o=i?.frozen,r=o===void 0?!1:a!==o;o===!0?this.interactionManager.pushState(1):o===!1&&this.interactionManager.popState(1),this.performUpdate("state-change",s,n,r)}performRestoration(e){let t=!1;const i=()=>t=!0;let s;const n=r=>s=r,a=this.pendingMemento!==void 0,o=this.chartService.id;return this.eventsHub.emit("active:load-memento",{initialState:a,chartId:o,activeItem:e,reject:i,setDatum:n}),t?[void 0,void 0]:[e,s]}};function y4(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function TT(e,t){if(typeof e=="string")try{e=Oe.fromString(e)}catch{e=Oe.fromArray([0,0,0])}if(typeof t=="string")try{t=Oe.fromString(t)}catch{t=Oe.fromArray([0,0,0])}return i=>Oe.mix(e,t,i).toRgbaString()}var wD=.2,Qg=["initial","remove","update","add","trailing","end","none"],_x={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:wD,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+wD,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function x4(e){return e.every(t=>t instanceof Pr)}function LD(e){return x4(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function ND(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>ND(i,t[s])):kx(e)&&kx(t)?e.equals(t):We(e)&&We(t)?ry(e,t,ND):!1}var b4=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??sD,this.phase=e.phase;const t=e.duration??_x[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,e.skip===!0&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),e.collapsable!==!1&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return ND(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,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),e-(s-t)):0}get delta(){return this.ease(ae(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||kx(t))return this.interpolateValue(e,t);if(Array.isArray(t)){const s=[];for(let n=0;n<t.length;n++){const a=this.createInterpolator(e[n],t[n]);a!=null&&s.push(a)}return n=>{const a=[];for(const o of s)a.push(o(n));return a}}const i=[];for(const s of Object.keys(t)){const n=this.createInterpolator(e[s],t[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[a,o]of i)n[a]=o(s);return n}}interpolateValue(e,t){if(!(e==null||t==null)){if(kx(e))return i=>e[Dx](t,i);try{switch(typeof e){case"number":return y4(e,t);case"string":return TT(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}};function v4(e,t,i,s){return t<e.startIndex?(e.startIndex+=i,e.endIndex+=i,!1):t<e.endIndex||t===e.endIndex&&s?(e.endIndex+=i,!0):!1}function S4(e,t,i){const s=t+i;if(s<=e.startIndex)return e.startIndex=Math.max(0,e.startIndex-i),e.endIndex=Math.max(e.startIndex,e.endIndex-i),!1;if(t>=e.endIndex)return!1;if(t<=e.startIndex&&s>=e.endIndex)e.startIndex=t,e.endIndex=t;else if(t<=e.startIndex){const n=s-e.startIndex,a=e.endIndex-e.startIndex;e.startIndex=t,e.endIndex=e.startIndex+Math.max(0,a-n)}else s>=e.endIndex?e.endIndex=Math.max(e.startIndex,t):e.endIndex=Math.max(e.startIndex,e.endIndex-i);return!0}function OT(e,t){const i=Math.ceil(e/1e3);return Math.max(t,i)}function PT(e,t){return Math.max(1,Math.ceil(e/t))}function M4(e){return e.filter(t=>t.endIndex>t.startIndex)}function D4(e,t,i){if(!t.enableBanding||e<t.minDataSizeForBanding)return[i(0,e)];const s=OT(e,t.targetBandCount),n=PT(e,s),a=[];for(let o=0;o<e;o+=n){const r=Math.min(o+n,e);a.push(i(o,r))}return a}function k4(e,t){for(const i of t)i.insertCount>0&&e.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&e.handleRemoval(i.index,i.deleteCount)}function I4(e,t){for(const i of t)e.handleInsertion(i,0)}function A4(e,t){k4(e,t.spliceOps),t.updatedIndices.size>0&&I4(e,t.updatedIndices)}var C4=1e3,w4=10,ET=class{constructor(e={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:e.minDataSizeForBanding??C4,targetBandCount:e.targetBandCount??w4,maxBandSize:e.maxBandSize??1/0,enableBanding:e.enableBanding??!0}}applyIndexMap(e){A4(this,e)}initializeBands(e){this.dataSize=Math.max(0,e),this.bands=D4(this.dataSize,this.config,(t,i)=>this.createBand(t,i))}getBandCount(){return this.bands.length}handleInsertion(e,t){if(this.dataSize+=t,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=OT(this.dataSize,this.config.targetBandCount),s=PT(this.dataSize,i),n=Math.ceil(s*1.1);for(let a=0;a<this.bands.length;a++){const o=this.bands[a],r=a===this.bands.length-1;if(e===o.endIndex&&r&&t>0){o.endIndex-o.startIndex>=s?this.bands.push(this.createBand(e,e+t)):(o.endIndex+=t,o.isDirty=!0);break}v4(o,e,t,r)&&(o.isDirty=!0,t>0&&e<o.endIndex&&o.endIndex-o.startIndex>n&&this.splitBand(a,s))}}handleRemoval(e,t){if(t<=0||this.bands.length===0)return;const i=Math.min(t,Math.max(0,this.dataSize-e));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const s of this.bands)S4(s,e,i)&&(s.isDirty=!0);this.bands=M4(this.bands)}}splitBand(e,t){const i=this.bands[e],s=i.endIndex-i.startIndex,n=Math.min(t,Math.floor(s/2)),a=i.startIndex+n,o=this.createBand(i.startIndex,a),r=this.createBand(a,i.endIndex);this.bands.splice(e,1,o,r)}getStats(){const e=this.bands.filter(t=>t.isDirty);return{totalBands:this.bands.length,dirtyBands:e.length,dataSize:this.dataSize}}markRangeDirty(e,t){for(const i of this.bands)e<i.endIndex&&t>i.startIndex&&(i.isDirty=!0)}},Wn=class n_{constructor(){this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(t){return t instanceof n_}setSortedUniqueMode(t,i){i&&(this.isSortedUnique=!0,this.sortOrder=t,this.sortedValues=[])}extend(t){this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(t),t instanceof Date&&(this.hasDateValues=!0)):t instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(t.valueOf())):this.domain.add(t)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let t=!1;return this.sortedValues.filter(i=>{if(i==null)return t?!1:(t=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(t)return!1;t=!0}return!0})}if(this.hasDateValues){const t=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...t,...Array.from(this.domain)]:t}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(t){if(this.isSortedUnique&&t.isSortedUnique&&this.sortOrder===t.sortOrder&&this.sortOrder!==void 0&&t.sortedValues){t.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...t.sortedValues);return}if(this.convertToSetMode(),t.hasDateValues&&(this.hasDateValues=!0),t.isSortedUnique&&t.sortedValues)for(const i of t.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of t.dateTimestamps)this.dateTimestamps.add(i);for(const i of t.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const t of this.sortedValues)t instanceof Date?this.dateTimestamps.add(t.valueOf()):this.domain.add(t);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},$n=class a_{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof a_}static extendDomain(t,i=[1/0,-1/0]){for(const s of t)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(t){typeof t!="number"&&!(t instanceof Date)||(this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t))}getDomain(){return[...this.domain]}},Jg=class extends ET{constructor(e,t={},i=!1){super(t),this.fullDomainCache=null,this.sortOrder=void 0,this.isUnique=!1,this.domainFactory=e,this.isDiscrete=i}setSortOrderMetadata(e,t){this.sortOrder=e,this.isUnique=t}createBand(e,t){const i=this.domainFactory();return this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&Wn.is(i)&&i.setSortedUniqueMode(this.sortOrder,this.isUnique),{startIndex:e,endIndex:t,subDomain:i,isDirty:!0}}initializeBands(e){super.initializeBands(e),this.fullDomainCache=null}handleInsertion(e,t){super.handleInsertion(e,t),this.fullDomainCache=null}handleRemoval(e,t){super.handleRemoval(e,t),this.fullDomainCache=null}splitBand(e,t){this.bands.length>1&&super.splitBand(e,t)}markBandsDirty(e,t){this.markRangeDirty(e,t),this.fullDomainCache=null}markAllBandsDirty(){for(const e of this.bands)e.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(e,t){const i=e.length;for(const s of this.bands){if(!s.isDirty)continue;const n=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&Wn.is(n)&&n.setSortedUniqueMode(this.sortOrder,this.isUnique),s.subDomain=n;const{startIndex:a,endIndex:o}=s;for(let r=a;r<o&&r<i;r++)t?.[r]||s.subDomain.extend(e[r]);s.isDirty=!1}this.fullDomainCache=null}getDirtyBands(){return this.bands.filter(e=>e.isDirty)}extend(e){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const e of this.bands)if(!Wn.is(e.subDomain)||!e.subDomain.isSortedUniqueMode()||e.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const e=new Wn;e.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const t of this.bands)Wn.is(t.subDomain)&&e.mergeFrom(t.subDomain);return e.getDomain()}deduplicateNulls(e){let t=!1;return e.filter(i=>{if(i==null)return t?!1:(t=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(t)return!1;t=!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 e=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(e):e,this.fullDomainCache}if(this.isDiscrete){const e=this.bands[0].subDomain;if(Wn.is(e))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const t=new Wn;for(const i of this.bands)Wn.is(i.subDomain)&&t.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(t.getDomain())}else{const t=new Set;for(const i of this.bands)for(const s of i.subDomain.getDomain())t.add(s);this.fullDomainCache=Array.from(t)}}else{let e,t;for(const i of this.bands){const s=i.subDomain.getDomain();if(s.length===2){const[n,a]=s;(e===void 0||n!=null&&e!=null&&n<e)&&(e=n),(t===void 0||a!=null&&t!=null&&a>t)&&(t=a)}}e!==void 0&&t!==void 0?this.fullDomainCache=[e,t]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const e=this.bands.filter(i=>i.isDirty).length,t=this.bands.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:e,averageBandSize:this.bands.length>0?t/this.bands.length:0,dataSize:this.dataSize}}};function RT(e,t=[0,0]){for(const i of e)typeof i=="number"&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function L4(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,aggregateFunction:s=>RT(s),groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function N4(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>$n.extendDomain(s)}}function zT(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function T4(e,t){const i=t?.visible??!0;return{id:e,matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:n=>RT(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 VT(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,a=[])=>{const o=a[1]-a[0];return t.aggregateFunction(n).map(r=>r/o)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function O4(e){return()=>{let t=0;return i=>Be(i)?(t+=e?Math.max(0,i):i,t):i}}function P4(){return()=>{let e=0;return t=>{if(!Be(t))return t;const i=e;return e+=t,i}}}var TD="\0__AG_NULL__\0",OD="\0__AG_UNDEFINED__\0";function BT(e){return e===null?TD:e===void 0?OD:Array.isArray(e)?"["+e.map(BT).join(",")+"]":ge(e)?JSON.stringify(e):String(e)}function PD(e){return e.map(BT).join("-")}function bn(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function FT(e,t){return t?.get(e.id)??0}function ED(e){return"scopes"in e&&Array.isArray(e.scopes)}function Fl(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function Hx(e){const t=new Set;for(const i of e.values())i&&t.add(i);return t}function RD(e,t,i=!1){const s=[];for(const n of e){const a=n?.[t];if(a==null&&!i)return;s.push(a)}return s}function E4(e){const t=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(e);){if(s.index!==i)return;i=s.index+s[0].length;const a=s[1].trim();if(a.startsWith("."))t.push(a.slice(1).trim());else if(a.startsWith("[")){const o=a.slice(1,-1).trim();o.startsWith("'")?t.push(o.slice(1,-1).replaceAll(/(?<!\\)\\'/g,"'")):o.startsWith('"')?t.push(o.slice(1,-1).replaceAll(/(?<!\\)\\"/g,'"')):t.push(o)}else t.push(a)}if(i===e.length)return t}function R4(e){return t=>{let i=t;for(const s of e)i=i[s];return i}}var z4=class{constructor(e,t,i){this.ctx=e,this.scopeCacheManager=t,this.resolvers=i}aggregateUngroupedData(e){const t=this.ctx.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i,dataSources:s}=e,n=$s(s.keys()),a=e.keys.map(l=>l.get(n)),o=s.get(n)?.data??[],r=this.ctx.keys.some(l=>l.allowNullKey===!0);e.aggregation=o?.map((l,c)=>{const h=[];for(const[d,u]of this.ctx.aggregates.entries()){const p=this.valueGroupIdxLookup(u);let f=u.groupAggregateFunction?.()??[1/0,-1/0];const y=p.map(S=>i[S][c]),b=RD(a,c,r),x=b==null?void 0:u.aggregateFunction(y,b);x&&(f=u.groupAggregateFunction?.(x,f)??$n.extendDomain(x,f));const v=u.finalFunction?.(f)??f;h[d]=v,$n.extendDomain(v,t[d])}return h})}aggregateGroupedData(e){const t=this.ctx.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,n]of this.ctx.aggregates.entries()){const a=this.valueGroupIdxLookup(n);for(let o=0;o<e.groups.length;o++){const r=e.groups[o];r.aggregation??(r.aggregation=[]);const l=r.keys;let c=n.groupAggregateFunction?.()??[1/0,-1/0];const h=Math.max(...a.map(u=>r.datumIndices[u]?.length??0));for(let u=0;u<h;u++){const p=a.map(y=>{const b=r.datumIndices[y]?.[u];if(b==null)return;const x=this.resolvers.resolveAbsoluteIndex(o,b);return i[y][x]}),f=n.aggregateFunction(p,l);f&&(c=n.groupAggregateFunction?.(f,c)??$n.extendDomain(f,c))}const d=n.finalFunction?.(c)??c;r.aggregation[s]=d,$n.extendDomain(d,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this.ctx,{columnScopes:i,columns:s,invalidData:n}=e;for(const a of t){const o=this.valueGroupIdxLookup(a),r=a.adjust()();for(let l=0;l<e.groups.length;l++){const c=e.groups[l];r(s,o,c,l)}for(const l of o){const h=this.ctx.values[l].valueType==="category",d=s[l],u=$s(i[l]),p=n?.get(u),f=h?new Wn:new $n;for(let y=0;y<d.length;y+=1)p?.[y]!==!0&&f.extend(d[y]);e.domain.values[l]=f.getDomain()}}}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}},V4=class{constructor(e){this.ctx=e}setupDomainForDefinition(e,t,i){const s=e.valueType==="category";let n=t.get(e);return!n&&this.ctx.bandingConfig?.enableBanding!==!1&&(n=new Jg(s?()=>new Wn:()=>new $n,this.ctx.bandingConfig,s),t.set(e,n)),n&&s&&n.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),n||(s?new Wn:new $n)}extendDomainFromData(e,t,i){if(e instanceof Jg)e.extendBandsFromData(t,i);else for(let s=0;s<t.length;s++)i?.[s]!==!0&&e.extend(t[s])}initializeBandedDomain(e,t,i){if(!(e instanceof Jg))return;const s=e.getStats(),n=s.bandCount===0||s.dataSize!==t;this.ctx.debug.check()&&n&&i&&this.ctx.debug(`Reinitializing bands for ${i}: bandCount=${s.bandCount}, dataSize=${s.dataSize}, dataLength=${t}`),n&&e.initializeBands(t)}},_l=Symbol("key-sort-orders"),zD=Symbol("column-sort-orders"),VD=Symbol("domain-ranges"),ef=Symbol("domain-bands"),ih=Symbol("reducer-bands"),_T=Object.freeze([0]);function BD(e,t){if(typeof t=="string")e.set(t,(e.get(t)??0)+1);else for(const i of t)e.set(i,(e.get(i)??0)+1)}function Gx(e,t){if(e.reusableResult.valid=!1,e.hasInvalidValue){e.reusableResult.value=e.invalidValue,e.domain.extend(e.invalidValue);return}e.mode!=="integrated"&&K.warnOnce(`invalid value of type [${typeof t}] for [${e.def.scopes} / ${e.def.id}] ignored:`,`[${t}]`),e.reusableResult.value=void 0}function tf(e,t,i,s,n,a){return e&&t&&e(i,s,n)===!1?(a.reusableResult.missing=!1,Gx(a,i),a.reusableResult):null}function sf(e,t,i,s,n){n.missing=!e,!e&&!t&&BD(i,s)}function jx(e,t,i){return t.valid=!0,t.value=e,i.extend(e),t}var B4=class{constructor(e){this.ctx=e}createProcessValueFn(e,t,i,s,n,a){const o={def:e,accessor:t,domain:i,reusableResult:s,processorFns:n,mode:this.ctx.mode};return(a==="extend"?this.createSpecializedProcessValue(o,e.validation):null)??this.createGenericProcessValue(o,a)}createSpecializedProcessValue(e,t){return e.def.forceValue!=null?this.createSpecializedProcessValueForceValue(e):e.def.processor?this.createSpecializedProcessValueProcessor(e,t):t?e.def.type==="key"?this.createSpecializedProcessValueKeyValidation(e,t):this.createSpecializedProcessValueValueValidation(e,t):null}createValidationMeta(e){const{def:t,domain:i,reusableResult:s,mode:n}=e;return{reusableResult:s,hasInvalidValue:"invalidValue"in t,invalidValue:t.invalidValue,domain:i,def:t,mode:n}}createSpecializedProcessValueKeyValidation(e,t){const{def:i,accessor:s,domain:n,reusableResult:a}=e,o=i.property,r="missingValue"in i,l=i.missingValue,c=i.missing,h=i.allowNullKey??!1,d=this.createValidationMeta(e);if(s){const u=s;return function(f,y,b){let x;try{x=u(f)}catch{}const v=x!=null||h&&x==null,S=!h&&x==null;return!v||S||t(x,f,y)===!1?(a.missing=!v,!v&&!r&&BD(c,b),Gx(d,x),a):(a.missing=!1,a.valid=!0,a.value=x,n.extend(x),a)}}return function(p,f,y){const b=o in p,x=b?p[o]:l,v=!h&&x==null;return!b||v||t(x,p,f)===!1?(a.missing=!b,!b&&!r&&BD(c,y),Gx(d,x),a):(a.missing=!1,a.valid=!0,a.value=x,n.extend(x),a)}}createSpecializedProcessValueValueValidation(e,t){const{def:i,accessor:s,domain:n,reusableResult:a}=e,o=i.property,r="missingValue"in i,l=i.missingValue,c=i.missing,h=this.createValidationMeta(e);if(s){const d=s;return function(p,f,y){let b;try{b=d(p)}catch{}const x=b!=null,v=tf(t,x,b,p,f,h);return v!==null?v:(sf(x,r,c,y,a),jx(b,a,n))}}return function(u,p,f){const y=o in u,b=y?u[o]:l,x=tf(t,y,b,u,p,h);return x!==null?x:(sf(y,r,c,f,a),jx(b,a,n))}}createSpecializedProcessValueForceValue(e){const{def:t,accessor:i,domain:s,reusableResult:n}=e,a=t.property,o=t.forceValue;if(i){const r=i;return function(c,h,d){let u;try{u=r(c)}catch{}const y=u!=null&&Oc(u)?-1*o:o;return n.missing=!1,n.valid=!0,n.value=y,s.extend(y),n}}return function(l,c,h){const d=a in l,u=d?l[a]:void 0,f=d&&Oc(u)?-1*o:o;return n.missing=!1,n.valid=!0,n.value=f,s.extend(f),n}}createSpecializedProcessValueProcessor(e,t){const{def:i,accessor:s,domain:n,reusableResult:a,processorFns:o}=e,r=i.property,l="missingValue"in i,c=i.missingValue,h=i.missing,d=i.processor,u=this.createValidationMeta(e);if(s){const p=s;return function(y,b,x){let v;try{v=p(y)}catch{}const S=v!=null,M=tf(t,S,v,y,b,u);if(M!==null)return M;sf(S,l,h,x,a);let D=o.get(i);return D==null&&(D=d(),o.set(i,D)),v=D(v,b),jx(v,a,n)}}return function(f,y,b){const x=r in f;let v=x?f[r]:c;const S=tf(t,x,v,f,y,u);if(S!==null)return S;sf(x,l,h,b,a);let M=o.get(i);return M==null&&(M=d(),o.set(i,M)),v=M(v,y),jx(v,a,n)}}createGenericProcessValue(e,t){const{def:i,accessor:s,domain:n,processorFns:a}=e,o=i.property,r="missingValue"in i,l=i.missingValue,c=i.missing,h=t==="extend",d=e.reusableResult,u=this.createValidationMeta(e);return function(f,y,b){let x,v;if(s){try{x=s(f)}catch{}v=x!=null}else v=o in f,x=v?f[o]:l;i.forceValue!=null&&(x=v&&Oc(x)?-1*i.forceValue:i.forceValue,v=!0),sf(v,r,c,b,d);const S=i.allowNullKey??!1;if(i.type==="key"&&x==null&&!S)return Gx(u,x),d;const D=tf(i.validation,v,x,f,y,u);if(D!==null)return D;if(d.valid=!0,i.processor){let I=a.get(i);I==null&&(I=i.processor(),a.set(i,I)),x=I(x,y)}return h&&n.extend(x),d.value=x,d}}};function F4(e,t){return!e||!t||e.length===0||t.length===0?!0:e.some(i=>t.includes(i))}function HT(e,t){if(e.valueType==="category"){for(const i of t)if(i.property===e.property&&i.valueType===e.valueType&&F4(i.scopes,e.scopes)&&i.validation===e.validation)return i}}var _4=class{constructor(e,t,i){this.ctx=e,this.initializer=t,this.scopeCacheManager=i,this.processValueFactory=new B4(e)}recomputeDomains(e){const t=this.ctx.debug.check()?performance.now():0,i=e[ef];let s;const n=e[_l],a=this.setupDefinitionDomains(this.ctx.keys,i,n),o=new Map;for(const h of this.ctx.values){const d=HT(h,this.ctx.keys);d&&o.set(h,d)}const r=this.setupValueDomainsWithSharing(this.ctx.values,i,a,o),l=new Set;for(const[,h]of o){const d=a.get(h);d&&l.add(d)}this.initializeDomainBands(this.ctx.keys,a,h=>{const d=e.keys[h];return Math.max(...Array.from(d.values()).map(u=>u.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,r,h=>e.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 Jg){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)=>e.keys[h]?.get(d),h=>h.scopes??[],h=>e.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,r,(h,d)=>e.columns[h],h=>[$s(h.scopes)],h=>e.invalidKeys?.get(h),l),e.domain.keys=this.ctx.keys.map(function(d){const u=a.get(d),p=u.getDomain();return $n.is(u)&&p[0]>p[1]?[]:p}),e.domain.values=this.ctx.values.map(function(d){const u=r.get(d),p=u.getDomain();return $n.is(u)&&p[0]>p[1]?[]:p}),e.type==="grouped"&&(e.domain.groups=e.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(e,a,r,i,c),this.ctx.debug.check()&&t>0){const d=performance.now()-t;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(e,t,i){const s=new Map;for(const[n,a]of e.entries()){const o=i?.get(n);s.set(a,this.initializer.setupDomainForDefinition(a,t,o))}return s}initializeDomainBands(e,t,i,s){for(const[n,a]of e.entries()){const o=t.get(a);if(!o)continue;const r=i(n);this.initializer.initializeBandedDomain(o,r,s(a))}}extendDomainsFromData(e,t,i,s,n,a){for(const[o,r]of e.entries()){const l=t.get(r);if(l&&!a?.has(l))for(const c of s(r)){if(!c)continue;const h=i(o,c);if(!h)continue;const d=n(c);this.initializer.extendDomainFromData(l,h,d)}}}setupValueDomainsWithSharing(e,t,i,s){const n=new Map;for(const a of e){const o=s.get(a);if(o){const r=i.get(o);if(r){n.set(a,r);continue}}n.set(a,this.initializer.setupDomainForDefinition(a,t))}return n}initDataDomainProcessor(e){const{keys:t,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 o=!0;const r=()=>{for(const u of t)u.valueType==="category"?n.set(u,new Wn):n.set(u,new $n);for(const u of i){const p=HT(u,t);if(p){const f=n.get(p);if(f){n.set(u,f),o&&(o=(u.scopes?.length??0)===s.size);continue}}u.valueType==="category"?n.set(u,new Wn):(n.set(u,new $n),o&&(o=(u.scopes?.length??0)===s.size))}};r();const l=this.scopeCacheManager.buildAccessors(mr(t,i)),c=new WeakMap;for(const u of mr(t,i)){const p=l.get(u.property),f=n.get(u),y={value:void 0,missing:!1,valid:!1},b=this.processValueFactory.createProcessValueFn(u,p,f,y,a,e);c.set(u,b)}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,f,y){return h(u)(p,f,y)}return{dataDomain:n,processValue:d,getProcessValue:h,initDataDomain:r,scopes:s,allScopesHaveSameDefs:o}}collectDomainBandingMetadata(e,t,i,s,n){e.optimizations??(e.optimizations={});const a=(l,c)=>l.map(h=>{const d=c.get(h),u=s.get(h),p=d instanceof Jg;let f;p||(f=h.valueType==="category"?"discrete domain":"not configured");let y;if(p&&u){const b=n.get(u)??u.getStats(),x=b.bandCount>0?b.dirtyBandCount/b.bandCount:0;y={totalBands:b.bandCount,dirtyBands:b.dirtyBandCount,dataSize:b.dataSize,scanRatio:x}}return{property:String(h.property),applied:p,reason:f,stats:y}}),o=a(this.ctx.keys,t),r=a(this.ctx.values,i);e.optimizations.domainBanding={keyDefs:o,valueDefs:r}}};function H4(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function G4(e,t){const i=typeof t=="number"?t:t?.valueOf?.();if(typeof i!="number"||!Number.isFinite(i))return;if(e.lastValue===void 0){e.lastValue=i;return}const s=i-e.lastValue;if(s===0)e.isUnique=!1;else if(e.isOrdered){const n=s>0?1:-1;e.sortOrder===0?e.sortOrder=n:e.sortOrder!==n&&(e.isOrdered=!1)}e.lastValue=i}function j4(e){return{sortOrder:e.isOrdered&&e.sortOrder!==0?e.sortOrder:void 0,isUnique:e.isUnique,isDirty:!1}}var W4=class{constructor(e,t){this.ctx=e,this.domainManager=t,this.markScopeDatumInvalid=function(i,s,n,a,o){for(const r of i){a.has(r)||(a.set(r,Fl(s.length,!1)),o.set(r,0));const l=a.get(r);l[n]||(l[n]=!0,o.set(r,o.get(r)+1))}}}extractData(e){const{dataDomain:t,getProcessValue:i,allScopesHaveSameDefs:s}=this.domainManager.initDataDomainProcessor("extend"),{keys:n,values:a}=this.ctx,{invalidData:o,invalidKeys:r,invalidKeyCount:l,invalidDataCount:c,allKeyMappings:h,keySortOrders:d}=this.extractKeys(n,e,i),{columns:u,columnScopes:p,columnNeedValueOf:f,partialValidDataCount:y,maxDataLength:b}=this.extractValues(o,c,a,e,r,i),x=v=>{const S=t.get(v),M=S.getDomain();return $n.is(S)&&M[0]>M[1]?[]:M};return{type:"ungrouped",input:{count:b},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...h.values()],columns:u,columnScopes:p,columnNeedValueOf:f,invalidKeys:r,invalidKeyCount:l,invalidData:o,invalidDataCount:c,domain:{keys:n.map(x),values:a.map(x)},defs:{allScopesHaveSameDefs:s,keys:n,values:a},partialValidDataCount:y,time:0,version:0,[VD]:new Map,[_l]:d,[zD]:new Map,[ef]:new Map,[ih]:new Map}}extractKeys(e,t,i){const s=new Map,n=new Map,a=new Map,o=new Map,r=new Map,l=new Map;let c,h;const d=e.map(p=>i(p)),u=(p,f)=>{const y=h.get(p);c.set(f,c.get(y)),s.has(y)&&(s.set(f,s.get(y)),n.set(f,n.get(y)),o.set(f,o.get(y)))};for(const[p,f]of e.entries()){const{invalidValue:y,scopes:b}=f,x=d[p];c=new Map,h=new Map,r.set(f,c);const v=H4();for(const S of b??[]){const M=t.get(S)?.data??[];if(h.has(M)){u(M,S);continue}const D=[];c.set(S,D),h.set(M,S);let I,k,C=0;for(let A=0;A<M.length;A++){if(M[A]==null||typeof M[A]!="object"){I??(I=Fl(M.length,!1)),k??(k=Fl(M.length,!1)),C+=1,I[A]=!0,k[A]=!0,D.push(y);continue}const w=x(M[A],A,S);if(w.valid){D.push(w.value),G4(v,w.value);continue}D.push(y),I??(I=Fl(M.length,!1)),k??(k=Fl(M.length,!1)),C+=1,I[A]=!0,k[A]=!0}I&&k&&(s.set(S,I),n.set(S,k),a.set(S,C),o.set(S,C))}l.set(p,j4(v))}return{invalidData:n,invalidKeys:s,invalidKeyCount:a,invalidDataCount:o,allKeyMappings:r,keySortOrders:l}}extractValues(e,t,i,s,n,a){let o=0;const r=[],l=[],c=[];let h=0;const d=i.map(u=>a(u));for(const[u,p]of i.entries()){const{invalidValue:f}=p,y=d[u];if(new Set(p.scopes.map(k=>s.get(k))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(p)}`);const x=new Set(p.scopes),v=$s(p.scopes),S=s.get(v)?.data??[],M=new Array,D=n.get(v);let I=!1;for(let k=0;k<S.length;k++){if(S[k]==null||typeof S[k]!="object"){this.markScopeDatumInvalid(p.scopes,S,k,e,t),M[k]=f;continue}const C=S[k],A=D==null?!1:D[k],w=y(C,k,p.scopes);let T=w.value;(A||!w.valid)&&this.markScopeDatumInvalid(p.scopes,S,k,e,t),A?T=f:w.valid||(o+=1,T=f),!I&&T!=null&&typeof T=="object"&&(I=!0),M[k]=T}r.push(M),l.push(x),c.push(I),h=Math.max(h,M.length)}return{columns:r,columnScopes:l,columnNeedValueOf:c,partialValidDataCount:o,maxDataLength:h}}warnDataMissingProperties(e){if(e.size!==0)for(const t of mr(this.ctx.keys,this.ctx.values))for(const[i,s]of t.missing){if(s<(e.get(i)?.data.length??1/0))continue;const n=i==null?"":` for ${i}`;K.warnOnce(`the key '${t.property}' was not found in any data element${n}.`)}}},$4=class{constructor(e){this.ctx=e}groupData(e,t){var i;const{keys:s,columns:n,columnScopes:a,invalidKeys:o,invalidData:r}=e,l=e.scopes,c=[],h=[],d=l.size!==1||t!=null?new Map:void 0;let u=!0,p=0;const f=l.size,y=this.groupBatches(l,n,a,s,r,o),b=y.length;if(this.ctx.debug?.check()&&!e.optimizations&&(e.optimizations={}),this.ctx.debug?.check()){const S=f>0?1-b/f:0;e.optimizations.batchMerging={originalBatchCount:f,mergedBatchCount:b,mergeRatio:S}}const x=y.length===1,v=Object.freeze(Fl(y[0][1].length,_T));for(const[S,M,D,I,k,C]of y){const A=n[$s(M)];for(let w=0;w<A.length;w++){if(C?.[w]===!0)continue;const T=D.map(B=>B[w]);if(T==null||T.length===0)throw new Error("AG Charts - no keys found for scope(s): "+S.join(", "));const O=t?.(T)??T,z=d==null?void 0:PD(O);let V=d?.get(z),E,_,G=!1;if(V==null?(E={keys:O,datumIndices:[],aggregation:[],validScopes:l},_=p++,V=[_,E],G=!0,d?.set(z,V),c.push(E.keys),h.push(E)):([_,E]=V,u=!1),k?.[w]===!0){E.validScopes===l&&(E.validScopes=new Set(l.values()));for(const B of I)E.validScopes.delete(B)}if(G&&w===_&&x)E.datumIndices=v;else{!G&&E.datumIndices===v&&(E.datumIndices=v.map(B=>[...B]));for(const B of M)(i=E.datumIndices)[B]??(i[B]=[]),E.datumIndices[B].push(w-_)}}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:h,groupsUnique:u,optimizations:e.optimizations,[ef]:e[ef],[ih]:e[ih]}}groupBatches(e,t,i,s,n,a){const o=[],r=new Set;for(const l of e){const c=t.map((f,y)=>y).filter(f=>!r.has(f)&&i[f].has(l));if(c.length===0)continue;for(const f of c)r.add(f);const h=new Set;for(const f of c)for(const y of i[f])h.add(y);const d=s.map(f=>f.get(l)).filter(f=>f!=null),u=n?.get(l),p=a?.get(l);o.push([l,c,d,h,u,p])}return this.mergeCompatibleBatches(o)}areBatchesCompatible(e,t){const[,,i,,s,n]=e,[,,a,,o,r]=t;return i.every((l,c)=>l===a[c])&&n===r&&s===o}mergeCompatibleBatches(e){const t=[],i=new Set;for(let s=0;s<e.length;s++){if(i.has(s))continue;const[n,a,o,r,l,c]=e[s],h=[[n],[...a],o,new Set(r),l,c];this.findAndMergeCompatibleBatches(e,s,h,i),t.push(h),i.add(s)}return t}findAndMergeCompatibleBatches(e,t,i,s){const n=e[t];for(let a=t+1;a<e.length;a++){if(s.has(a))continue;const o=e[a],[r,l,,c]=o;if(this.areBatchesCompatible(n,o)){i[0].push(r),i[1].push(...l);for(const h of c)i[3].add(h);s.add(a)}}}};function GT(e){return e.removedIndices.size===0&&e.totalPrependCount===0&&e.totalAppendCount>0}function K4(e){return e.removedIndices.size===0&&e.totalAppendCount===0&&e.totalPrependCount>0}function U4(e){return e.removedIndices.size===0}function Y4(e){return e.removedIndices.size===0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0&&t.deleteCount===0)}function Z4(e){return e.removedIndices.size>0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0)}function X4(e){const{removedIndices:t}=e;if(t.size===0)return!1;const i=Array.from(t).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 q4(e){return X4(e)&&e.totalAppendCount>0&&e.totalPrependCount===0}var Q4=class{constructor(e,t){this.indexMap=e,this.prependValues=t.prependValues,this.appendValues=t.appendValues,this.insertionValues=t.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((e,t)=>e-t)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((e,t)=>e-t)}forEachPreservedIndex(e){const{originalLength:t,removedIndices:i,totalPrependCount:s}=this.indexMap;let n=0;const a=Array.from(i).sort((r,l)=>r-l);let o=0;for(let r=0;r<t;r++){for(;o<a.length&&a[o]<r;)n++,o++;if(!i.has(r)){const l=r+s-n;e(r,l)}}}getPrependedValues(){return this.prependValues}getAppendedValues(){return this.appendValues}getInsertionValues(){return this.insertionValues}applyToArray(e,t,i){const{spliceOps:s,finalLength:n,originalLength:a}=this.indexMap;if(!(a===n&&s.length===0)){for(const o of s){const r=o.insertCount>0?Array.from({length:o.insertCount},function(h,d){return t(o.index+d)}):[],l=e.splice(o.index,o.deleteCount,...r);i&&l.length>0&&i(l,o)}e.length!==n&&(e.length=n)}}},J4=class extends ET{constructor(e={}){super(e),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(e,t){return{startIndex:e,endIndex:t,cachedResult:void 0,isDirty:!0}}initializeBands(e){super.initializeBands(e),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(e,t,i=!1){const s=e.reducer();for(const n of this.bands){if(i&&!n.isDirty)continue;const a=e.needsOverlap&&n.startIndex>0?Math.max(0,n.startIndex-1):n.startIndex,o=this.evaluateRange(e,s,t,a,n.endIndex);n.cachedResult=o,n.isDirty=!1}}getResult(e){const t=this.bands.map(i=>i.cachedResult);return e.combineResults(t)}evaluateRange(e,t,i,s,n){let a=e.initialValue;const{keyColumns:o,keysParam:r,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;h<c;h+=1){for(let d=0;d<r.length;d++)r[d]=o[d]?.[h];a=t(a,r)}return a}captureStatsBeforeProcessing(){const e=this.bands.filter(i=>i.isDirty),t=e.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);this.lastDirtyBandCount=e.length,this.lastScanRatio=this.dataSize>0?t/this.dataSize:0,this.statsCaptured=!0}getStats(){const e=this.bands.filter(s=>!s.isDirty&&s.cachedResult!==void 0);let t,i;if(this.statsCaptured)t=this.lastDirtyBandCount,i=this.lastScanRatio;else{const s=this.bands.filter(a=>a.isDirty),n=s.reduce((a,o)=>a+(o.endIndex-o.startIndex),0);t=s.length,i=this.dataSize>0?n/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:t,dataSize:this.dataSize,scanRatio:i,cacheHits:e.length}}},jT=class{constructor(e={}){this.bandingConfig=e}static evaluateRange(e,t,i,s,n){let a=e.initialValue;const{keyColumns:o,keysParam:r,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;h<c;h+=1){for(let d=0;d<r.length;d++)r[d]=o[d]?.[h];a=t(a,r)}return a}evaluate(e,t,i={}){var s;const n=this.createContext(e,t);if(!n)return;t[s=ih]??(t[s]=new Map);const a=t[ih],o=e.property;let r=a.get(o);return r||(r=new J4(this.bandingConfig),a.set(o,r)),r.getBandCount()===0&&r.initializeBands(n.rawData.length),i.beforeEvaluate?.(r,n),r.captureStatsBeforeProcessing(),r.evaluateFromData(e,n,i.reuseCleanBands??!1),r.getResult(e)}applyIndexMap(e,t){const i=e[ih];if(i)for(const s of i.values())s.applyIndexMap(t)}createContext(e,t){if(t.type!=="ungrouped")return;const i=ED(e)?e.scopes[0]:$s(t.dataSources.keys());if(i==null)return;const s=t.dataSources.get(i)?.data??[],n=t.keys.map(o=>o.get(i)).filter(o=>o!=null),a=n.map(()=>{});return{scopeId:i,rawData:s,keyColumns:n,keysParam:a}}},eW=class{constructor(e,t){this.ctx=e,this.reducerManager=t}isReprocessingSupported(e){if(e.type==="grouped"){if(!e.groupsUnique||this.getUniqueDataSets(e).size!==1)return!1;const n=$s(e.scopes);if(e.invalidKeys?.get(n)?.some(o=>o))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(e,t,i,s,n,a){const o=performance.now(),r=this.collectScopeChanges(e,t);if(r.size===0)return e;this.commitPendingTransactions(e);const l=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),h=this.processAllInsertions(e,r,l,c);this.processAllUpdates(e,r,l,c,h),this.updateBandsForChanges(e,r);const d=this.transformKeysArrays(e,r,h);this.transformColumnsArrays(e,r,h),this.transformInvalidityArrays(e,r,h),this.reprocessBandedReducers(e,r),e.type==="grouped"&&(this.transformGroupsArray(e,r,h),this.ctx.groupProcessors.length>0&&s(e,r)),this.invalidateSortOrdersForChanges(e,r),n(e),this.reprocessProcessors(e),e.reduced?.diff!=null&&r.size>0&&this.generateDiffMetadata(e,r,d),this.updateProcessedDataMetadata(e);const u=performance.now();e.time=u-o,e.version+=1,a(e,"reprocess");const p=Hx(r);return e.changeDescription=p.size===1?p.values().next().value:void 0,e}updateBandsForChanges(e,t){const i=e[ef];if(i.size===0)return;const s=Hx(t);for(const n of s){const{indexMap:a}=n;for(const o of i.values())o.applyIndexMap(a)}}reprocessBandedReducers(e,t){if(e.type!=="ungrouped")return;const i=this.ctx.reducers.filter(s=>s.supportsBanding&&typeof s.combineResults=="function");if(i.length!==0){e.reduced??(e.reduced={});for(const s of i){const n=this.reducerManager.evaluate(s,e,{reuseCleanBands:!0,beforeEvaluate:(a,o)=>{if(!o.scopeId)return;const r=t.get(o.scopeId);r&&a.applyIndexMap(r.indexMap)}});n!==void 0&&(e.reduced[s.property]=n)}}}collectScopeChanges(e,t){const i=new Map;for(const[s,n]of e.dataSources){const a=t?.get(n)??n.getChangeDescription();a&&i.set(s,a)}return i}commitPendingTransactions(e){const t=this.getUniqueDataSets(e);for(const i of t)i.commitPendingTransactions()}buildDefinitionProcessors(e,t){return e.map((i,s)=>({def:i,index:s,processValue:t(i)}))}processAllInsertions(e,t,i,s){const n=new Map;for(const[a,o]of t){const r=e.dataSources.get(a);if(!r)continue;const l=this.processInsertionsOnce(a,o,r,i,s);n.set(a,l)}return n}processAllUpdates(e,t,i,s,n){for(const[a,o]of t){const r=e.dataSources.get(a);if(!r)continue;const l=o.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>=r.data.length)continue;const d=this.processDatum(r,h,a,i,s);d&&c.set(h,d)}}}processInsertionsOnce(e,t,i,s,n){const a=new Map,{finalLength:o}=t.indexMap;for(const r of t.indexMap.spliceOps)if(!(r.insertCount<=0))for(let l=0;l<r.insertCount;l++){const c=r.index+l;if(c<0||c>=o)continue;const h=this.processDatum(i,c,e,s,n);h&&a.set(c,h)}return a}processDatum(e,t,i,s,n){const a=e.data[t],o=new Map,r=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,t,i);o.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,t,d.scopes);r.set(h,{value:p.value,valid:p.valid}),p.valid||(c=!0)}}return{keys:o,values:r,hasInvalidKey:l,hasInvalidValue:c}}transformArraysWithCache(e,t,i,s,n,a){for(const[o,r]of e.entries())for(const l of n(r)){const c=t.get(l);if(!c)continue;const h=s(o,l);if(!h)continue;const d=i.get(l);this.applyChangeDescWithCache(c,h,d,(u,p)=>a(u,r,o))}}transformKeysArrays(e,t,i){const s=new Map,n=r=>{let l=s.get(r);return l||(l={tuples:[]},s.set(r,l)),l},a=new WeakSet;for(const[r,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=t.get(c);if(!h)continue;const d=e.keys[r]?.get(c);if(!d)continue;if(a.has(d)){const y=Array.from(e.keys[r].entries()).find(([b,x])=>x===d)?.[0];y&&y!==c&&s.has(y)&&s.set(c,s.get(y));continue}a.add(d);const u=i.get(c),p=n(c);let f=0;this.applyChangeDescWithCache(h,d,u,y=>{const b=y?.keys.get(r);return b?.valid?b.value:l.invalidValue},y=>{for(const b of y)p.tuples[f]||(p.tuples[f]=new Array(this.ctx.keys.length)),p.tuples[f][r]=b,f+=1})}const o=new Map;for(const[r,{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(r)&&d.push(p);d.length>0&&c.add(PD(d))}o.set(r,c)}return o}transformColumnsArrays(e,t,i){this.transformArraysWithCache(this.ctx.values,t,i,s=>e.columns[s],s=>[$s(s.scopes)],(s,n,a)=>{if(s){if(s.hasInvalidKey)return n.invalidValue;const o=s.values.get(a);return o?.valid?o.value:n.invalidValue}return n.invalidValue})}transformInvalidityMap(e,t,i,s){const n=new Set;for(const[a,o]of t){let r=e.get(a);if(!r){const c=i.get(a);if(c&&Array.from(c.values()).some(s))r=Fl(o.indexMap.originalLength,!1),e.set(a,r);else continue}if(n.has(r))continue;n.add(r);const l=i.get(a);this.applyChangeDescWithCache(o,r,l,(c,h)=>s(c))}}transformInvalidityArrays(e,t,i){e.invalidKeys&&this.transformInvalidityMap(e.invalidKeys,t,i,s=>s?.hasInvalidKey??!1),e.invalidData&&this.transformInvalidityMap(e.invalidData,t,i,s=>s?s.hasInvalidKey||s.hasInvalidValue:!1)}applyChangeDescWithCache(e,t,i,s,n){e.applyToArray(t,o=>{const r=i?.get(o);return s(r,o)},n);const a=e.getUpdatedIndices();if(a.length!==0)for(const o of a){if(o<0||o>=t.length)continue;const r=i?.get(o);t[o]=s(r,o)}}transformGroupsArray(e,t,i){const s=$s(e.scopes),n=t.get(s);if(!n)return;const a=i.get(s);for(const[,r]of a??[])if(r.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(e.groups,r=>this.createDataGroupForInsertion(r,e,s,a));const o=n.getUpdatedIndices();if(o.length>0)for(const r of o)r<0||r>=e.groups.length||(e.groups[r]=this.createDataGroupForInsertion(r,e,s,a))}createDataGroupForInsertion(e,t,i,s){const n=[];for(const d of t.keys){const u=d.get(i);u&&n.push(u[e])}const a=t.groups[0],o=()=>Object.freeze(Fl(t.columnScopes.length,_T)),r=a?.datumIndices??o(),c=s?.get(e)?.hasInvalidValue??!1;let h;return c?(h=new Set(t.scopes),h.delete(i)):h=t.scopes,{keys:n,datumIndices:r,aggregation:[],validScopes:h}}generateDiffMetadata(e,t,i){const s=(n,a)=>{const o=[];for(const r of e.keys){const l=r.get(n);if(!l)return;o.push(l[a])}return o.length>0?PD(o):void 0};for(const[n,a]of t){const o={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&&o.added.add(u)}const{originalLength:r,totalPrependCount:l}=a.indexMap;if(!GT(a.indexMap))if(K4(a.indexMap)&&r>0)for(let c=l;c<l+r;c++){const h=s(n,c);h&&o.moved.add(h)}else if(U4(a.indexMap)&&l>0)for(let c=0;c<r;c++){const h=c+l,d=s(n,h);d&&o.moved.add(d)}else a.forEachPreservedIndex((c,h)=>{if(c!==h){const d=s(n,h);d&&o.moved.add(d)}});e.reduced.diff[n]=o}}updateProcessedDataMetadata(e){let t=0;for(const s of e.dataSources.values())t=Math.max(t,s.data.length);e.input.count=t;let i=0;for(const[s,n]of e.invalidData??new Map){const a=e.invalidKeys?.get(s);for(let o=0;o<n.length;o++)n[o]&&!a?.[o]&&(i+=1)}e.partialValidDataCount=i,this.recountInvalid(e.invalidKeys,e.invalidKeyCount),this.recountInvalid(e.invalidData,e.invalidDataCount),this.invalidateCachesForChanges(e)}updateSortOrderForAppend(e,t,i){if(i.length===0)return;const s=o=>{if(typeof o=="number")return o;if(o instanceof Date)return o.valueOf()};let n=s(t);const a=e.sortOrder;for(const o of i){const r=s(o);if(r===void 0)continue;if(n===void 0){n=r;continue}const l=r-n;if(l===0&&(e.isUnique=!1),e.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==a&&(e.sortOrder=void 0)}n=r}}updateKeySortOrdersForAppend(e,t){for(const[i,s]of e.keys.entries()){const n=e[_l].get(i);if(!n)continue;const a=$s(s.values());if(!a||a.length<=t)continue;const o=t>0?a[t-1]:void 0,r=a.slice(t);this.updateSortOrderForAppend(n,o,r)}}invalidateSortOrdersForChanges(e,t){const i=Hx(t);let s=!0,n=!1,a=!1,o,r;for(const l of i){const{indexMap:c}=l;Y4(c)||(GT(c)?(n=!0,o=c.originalLength):Z4(c)||(q4(c)?(a=!0,r={originalLength:c.originalLength,removedCount:c.removedIndices.size}):s=!1))}s?n&&o!==void 0?this.updateKeySortOrdersForAppend(e,o):a&&r&&this.updateKeySortOrdersForRollingWindow(e,r):(e[_l].clear(),e[zD].clear())}updateKeySortOrdersForRollingWindow(e,t){const{originalLength:i,removedCount:s}=t;for(const[n,a]of e.keys.entries()){const o=e[_l].get(n);if(!o)continue;const r=$s(a.values());if(!r||r.length===0)continue;const l=i-s,c=l>0?r[l-1]:void 0,h=r.slice(l);this.updateSortOrderForAppend(o,c,h)}}invalidateCachesForChanges(e){this.markDomainRangesDirty(e[VD])}markDomainRangesDirty(e){for(const t of e.values())t.isDirty=!0}recountInvalid(e,t){if(!(!e||!t))for(const[i,s]of e){const n=s.filter(Boolean).length;n===0?(e.delete(i),t.delete(i)):t.set(i,n)}}reprocessProcessors(e){if(this.ctx.processors.length!==0){e.reduced??(e.reduced={});for(const t of this.ctx.processors){const i=e.reduced[t.property],s=t.incrementalCalculate?.(e,i)??t.calculate(e,i);e.reduced[t.property]=s}}}getUniqueDataSets(e){return new Set(e.dataSources.values())}},sh=0,nh=1,Co=2,tW=class Nm{constructor(t){this.isDirty=!1;const i=t.reduce((a,o)=>Math.max(a,o.length),0),{maxLevelSize:s,buffer:n}=Nm.createBuffer(i);this.maxLevelSize=s,this.buffer=n,this.dataLength=i,this.populateBuffer(t)}static computeMaxLevelSize(t){let s=1<<32-Math.clz32(t);return t===s/2&&(s=s>>>1),s}static createBuffer(t){const i=Nm.computeMaxLevelSize(t),s=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:s}}populateBuffer(t){const{maxLevelSize:i,buffer:s}=this,n=i-1;for(const a of t){const o=a.length;for(let r=0;r<o;r+=1){const l=Number(a[r]);if(l!==l)continue;const c=n+r<<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 o=a-1,r=o+a<<1;let l=o<<1,c=r;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 f=s[c+1],y=s[d+1];s[l+1]=y!==y||f>y?f:y,l+=2,c+=4}}}rebuild(t){const i=t.reduce((n,a)=>Math.max(n,a.length),0);if(Nm.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:n,buffer:a}=Nm.createBuffer(i);this.maxLevelSize=n,this.buffer=a}this.dataLength=i,this.populateBuffer(t)}updateValue(t,i){const{maxLevelSize:s,buffer:n}=this,a=s+t-1,o=Math.trunc(a*Co)+sh,r=Math.trunc(a*Co)+nh;n[o]=Number.NaN,n[r]=Number.NaN;for(const l of i){const c=Number(l),h=n[o],d=n[r];(!Number.isFinite(h)||c<h)&&(n[o]=c),(!Number.isFinite(d)||c>d)&&(n[r]=c)}this.propagateUp(a)}updateValues(t){for(const{index:i,values:s}of t)this.updateValue(i,s)}propagateUp(t){const{buffer:i}=this;for(;t>0;){const s=Math.trunc((t-1)/2),n=2*s+1,a=2*s+2,o=i[Math.trunc(n*Co)+sh],r=i[Math.trunc(n*Co)+nh],l=i[Math.trunc(a*Co)+sh],c=i[Math.trunc(a*Co)+nh];i[Math.trunc(s*Co)+sh]=!Number.isFinite(l)||o<l?o:l,i[Math.trunc(s*Co)+nh]=!Number.isFinite(c)||r>c?r:c,t=s}}computeRangeInto(t,i,s,n,a,o,r){const l=a+o-1;if(l<i||a>=s)return r;if(a>=i&&l<s){const c=t[Math.trunc(n*Co)+sh],h=t[Math.trunc(n*Co)+nh];Number.isFinite(c)&&(r[0]=Math.min(r[0],c)),Number.isFinite(h)&&(r[1]=Math.max(r[1],h))}else o>1&&(n=Math.trunc(n*2),o=Math.trunc(o/2),this.computeRangeInto(t,i,s,Math.trunc(n+1),a,o,r),this.computeRangeInto(t,i,s,Math.trunc(n+2),a+o,o,r));return r}rangeBetween(t,i,s){const n=s??[0,0];if(t>i)return n[0]=Number.NaN,n[1]=Number.NaN,n;const{maxLevelSize:a,buffer:o}=this;return n[0]=1/0,n[1]=-1/0,this.computeRangeInto(o,t,i,0,0,a,n),n}getRange(t){const{buffer:i}=this,s=t??[0,0];return s[0]=i[sh],s[1]=i[nh],s}get range(){const{buffer:t}=this;return[t[sh],t[nh]]}get length(){return this.dataLength}};function iW(e,t){const i=e.length;if(e.length<=1)return 1;let s=0,n=e[0];for(let a=1;a<i;a++){const o=e[a];if(o==null)continue;if(typeof(t?o.valueOf():o)!="number")return;const l=Math.sign(o-n);if(l!==0){if(s!==0&&s!==l)return;s=l}n=o}return s===0?1:s}var sW=class{constructor(e){this.ctx=e,this.rangeBetweenBuffer=[0,0]}resolveMissingDataCount(e){let t=0;for(const i of this.ctx.values)t=Math.max(t,i.missing.get(e.id)??0);return t}resolveProcessedDataDefById(e,t){const i=this.ctx.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return n.get(e.id)}hasColumnById(e,t){return this.ctx.scopeCache.get(e.id)?.get(t)!=null}resolveColumnById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return n}resolveColumnNeedsValueOf(e,t,i){const s=this.resolveProcessedDataIndexById(e,t);return i.columnNeedValueOf?.[s]??!0}resolveAbsoluteIndex(e,t){return e+t}getDomain(e,t,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,s],n){const a=t.map(d=>this.resolveProcessedDataIndexById(e,d)),o=n.input.count;if(i<=0&&s>=o){const d=n.domain.values;let u=1/0,p=-1/0;for(const f of a){const y=d[f];y!=null&&(y[0]<u&&(u=y[0]),y[1]>p&&(p=y[1]))}return this.rangeBetweenBuffer[0]=u,this.rangeBetweenBuffer[1]=p,this.rangeBetweenBuffer}const r=a.join(":"),l=n[VD],c=a.map(d=>n.columns[d]);let h=l.get(r);return h==null?(h=new tW(c),l.set(r,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,s,this.rangeBetweenBuffer)}getSortOrder(e,t,i,s){const n=i.get(t);if(n==null||n.isDirty){const a={sortOrder:iW(e,s)};return i.set(t,a),a.sortOrder}return n.sortOrder}getKeySortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s]?.get(e.id);return n?this.getSortOrder(n,s,i[_l],!0):void 0}getKeySortEntry(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i[_l].get(s);return n?.isDirty?void 0:n}getColumnSortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.columnNeedValueOf?.[s]??!0;return this.getSortOrder(i.columns[s],s,i[zD],n)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}},nW=class{constructor(e){this.ctx=e}processScopeCache(){this.ctx.scopeCache.clear();for(const e of mr(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(!this.ctx.scopeCache.has(t))this.ctx.scopeCache.set(t,new Map([[s,e]]));else{if(this.ctx.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(t).set(s,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.ctx.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,s=typeof t=="string"?t:t.id,n=o=>{if(o.idsMap){for(const[r,l]of o.idsMap)if(e?.includes(r)&&l.has(s))return!0}return!1},a=this.ctx.values.reduce((o,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(h=>e?.includes(h)))&&(r.property===s||r.id===s||n(r))&&o.push(l),o),[]);if(a.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return a}buildAccessors(e){const t=new Map;if(this.ctx.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=E4(i.property);if(n==null){K.warnOnce("Invalid property path [%s]",i.property);continue}const a=R4(n);t.set(i.property,a)}return t}},FD=class{constructor(e,t="standalone",i=!1,s){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=be.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 e.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}).`)},o=new Set,r=new Set;for(const c of e.props){const h=c.type==="key"?o:r;if(ED(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(r.values());for(const h of o)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 sW(l),this.scopeCacheManager=new nW(l),this.domainInitializer=new V4(l),this.domainManager=new _4(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new jT(this.opts.domainBandingConfig),this.dataExtractor=new W4(l,this.domainManager),this.dataGrouper=new $4(l),this.aggregator=new z4(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new eW(l,this.reducerManager)}resolveProcessedDataDefById(e,t){return this.resolvers.resolveProcessedDataDefById(e,t)}resolveProcessedDataIndexById(e,t){return this.resolvers.resolveProcessedDataIndexById(e,t)}resolveKeysById(e,t,i){return this.resolvers.resolveKeysById(e,t,i)}hasColumnById(e,t){return this.resolvers.hasColumnById(e,t)}resolveColumnById(e,t,i){return this.resolvers.resolveColumnById(e,t,i)}resolveColumnNeedsValueOf(e,t,i){return this.resolvers.resolveColumnNeedsValueOf(e,t,i)}resolveMissingDataCount(e){return this.resolvers.resolveMissingDataCount(e)}*forEachDatum(e,t,i,s){const n=t.columnScopes.findIndex(a=>a.has(e.id));for(const a of i.datumIndices[n]??[]){const o=this.resolvers.resolveAbsoluteIndex(s,a);yield t.columns[n][o]}}getUniqueDataSets(e){return new Set(e.dataSources.values())}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(a=>a.has(e.id)),s={groupIndex:0,columnIndex:i},n=[];for(const a of t.groups){s.group=a;for(const o of a.datumIndices[i]??n)s.datumIndex=this.resolvers.resolveAbsoluteIndex(s.groupIndex,o),yield s;s.groupIndex++}}getDomain(e,t,i,s){const n=this.resolvers.getDomain(e,t,i,s);if(i==="key"&&n.length>0){const a=this.getKeySortMetadata(e,t,s);return{domain:n,sortMetadata:a}}return{domain:n}}getDomainBetweenRange(e,t,[i,s],n){return this.resolvers.getDomainBetweenRange(e,t,[i,s],n)}getKeySortOrder(e,t,i){return this.resolvers.getKeySortOrder(e,t,i)}getColumnSortOrder(e,t,i){return this.resolvers.getColumnSortOrder(e,t,i)}getKeySortMetadata(e,t,i){const s=this.resolvers.getKeySortEntry(e,t,i);if(s?.sortOrder!=null)return{sortOrder:s.sortOrder,isUnique:s.isUnique}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:n,reducers:a,processors:o,propertyProcessors:r}=this,l=performance.now();if(t&&this.keys.length===0)return;let c=this.extractData(e);t?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),r.length>0&&this.postProcessProperties(c),a.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(e);const h=performance.now();return c.time=h-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&aW(c),this.processScopeCache(),c}isReprocessingSupported(e){return this.incrementalProcessor.isReprocessingSupported(e)}reprocessData(e,t){if(!this.isReprocessingSupported(e)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const s=this.getUniqueDataSets(e);for(const n of s)n.commitPendingTransactions();return this.processData(e.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip");return this.incrementalProcessor.reprocessData(e,t,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this))}recomputeDomains(e){this.domainManager.recomputeDomains(e)}warnDataMissingProperties(e){this.dataExtractor.warnDataMissingProperties(e)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}valueIdxLookup(e,t){return this.scopeCacheManager.valueIdxLookup(e,t)}extractData(e){return this.dataExtractor.extractData(e)}reprocessGroupProcessors(e,t){const{groupProcessors:i}=this,{columns:s}=e;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=Hx(t);for(const a of i){const o=this.valueGroupIdxLookup(a),r=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=e.groups[u];r(s,o,p,u)}}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))t()(e,n)}reduceData(e){e.reduced??(e.reduced={});for(const t of this.reducers)this.shouldUseReducerBanding(t,e)?e.reduced[t.property]=this.reduceWithBands(t,e):e.reduced[t.property]=this.reduceStandard(t,e)}shouldUseReducerBanding(e,t){return t.type==="ungrouped"&&e.supportsBanding===!0&&typeof e.combineResults=="function"}reduceWithBands(e,t){const i=this.reducerManager.evaluate(e,t,{reuseCleanBands:!1});return i===void 0?this.reduceStandard(e,t):i}reduceStandard(e,t){const i=e.reducer();if(t.type==="grouped"){let r=e.initialValue;for(const l of t.groups)r=i(r,l.keys);return r}const s=ED(e)?e.scopes[0]:$s(t.scopes);if(s==null)return e.initialValue;const n=t.dataSources.get(s)?.data??[],a=t.keys.map(r=>r.get(s)).filter(r=>r!=null),o=a.map(()=>{});return jT.evaluateRange(e,i,{rawData:n,keyColumns:a,keysParam:o},0,n.length)}postProcessData(e){e.reduced??(e.reduced={});for(const i of this.processors)e.reduced[i.property]=i.calculate(e,e.reduced[i.property]);const{diff:t}=e.reduced;t&&this.eventsHub?.emit("datamodel:diff",{diff:t})}initDataDomainProcessor(e){return this.domainManager.initDataDomainProcessor(e)}collectOptimizationMetadata(e,t){const i=e.optimizations?.domainBanding,s=e[ih];this.reducers.length>0&&s&&this.collectReducerBandingMetadata(e,s);const n=e.optimizations?.reducerBanding;e.optimizations={performance:{processingTime:e.time,pathTaken:t},...i&&{domainBanding:i},...n&&{reducerBanding:n}};const a=this.isReprocessingSupported(e),o=t==="reprocess";let r;if(!a){const l=[];if(e.type==="grouped"){e.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(e).size!==1&&l.push("multiple data sources");const h=$s(e.scopes);e.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"),r=l.length>0?l.join(", "):void 0}if(e.optimizations.reprocessing={applied:o,reason:r},e.type==="grouped"){let l=0;const c=e.groups[0];if(c){const h=c.datumIndices;for(const d of e.groups)d.datumIndices===h&&l++}e.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:e.groups.length}}}collectReducerBandingMetadata(e,t){if(this.reducers.length===0)return;e.optimizations??(e.optimizations={});const i=[];for(const s of this.reducers){const n=t.get(s.property),a=this.shouldUseReducerBanding(s,e)&&n!=null;let o;a||(s.supportsBanding!==!0?o="reducer does not support banding":e.type!=="ungrouped"?o="grouped data not supported":s.combineResults===void 0?o="missing combineResults function":o="banding not applied");let r;a&&n&&(r=n.getStats()),i.push({property:String(s.property),applied:a,reason:o,stats:r})}e.optimizations.reducerBanding={reducers:i}}buildAccessors(e){return this.scopeCacheManager.buildAccessors(e)}};function aW(e){const t=(i,s)=>{s.length>0&&(K.log(`DataModel.processData() - ${i}`),K.table(s))};if(K.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[]),e.optimizations){K.log("DataModel.processData() - Optimization Summary");const i=e.optimizations;if(i.performance&&K.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})`:"";K.log(` Reprocessing: ${s}${n}`)}if(i.domainBanding){const s=i.domainBanding.keyDefs.filter(r=>r.applied),n=i.domainBanding.valueDefs.filter(r=>r.applied),a=s.length+n.length,o=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(a>0){K.log(` Domain Banding: \u2713 (${a}/${o} definitions)`);for(const r of[...s,...n])if(r.stats){const l=(r.stats.scanRatio*100).toFixed(1);K.log(` ${r.property}: scanned ${r.stats.dirtyBands}/${r.stats.totalBands} bands (${l}%)`)}}else{const r=[...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(r)].join(", ");K.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const s=i.sharedDatumIndices.applied?"\u2713":"\u2717",n=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;K.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}`;K.log(` Batch Merging: ${n} (${s}% reduction)`)}}}var WT=1e3;function $T(e,t,i){const s=e.filter(n=>typeof n=="number"&&Number.isFinite(n));return s.length>0?i(s):t}function va(e){return e.input.count<=WT}function KT(e){return e!=null&&Uc(e)}function oW(e){return e!=null}function rW(e){return!0}function UT(e,t){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return KT;default:return t?rW:oW}}function YT(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Hl(e,t,i={}){const s=i.allowNullKey??!1;return{property:e,type:"key",valueType:YT(t),validation:i.validation??UT(t,s),...i}}function Lt(e,t,i={}){const s=i.allowNullKey??!1;return{property:e,type:"value",valueType:YT(t),validation:i.validation??UT(t,s),...i}}function lW(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...t}}var cW=function(e){return e};function ZT(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>cW:t.length===1?t[0]:function(){const s=t.map(n=>n());return function(a,o){return s.reduce((r,l)=>l(r,o),a)}}}function hW(e,t={}){const{min:i=-1/0,max:s=1/0,processor:n,...a}=t;return{type:"value",property:e,valueType:"range",validation:KT,processor:ZT(n,function(){return function(l){return Be(l)?ae(i,l,s):l}}),...a}}function _D(e,t,i={}){const{onlyPositive:s,processor:n,...a}=i;return{...Lt(e,t,a),processor:ZT(n,O4(s))}}function dW(e,t,i={}){return{...Lt(e,t,i),processor:P4()}}function nf(e,t,i,s){return[Lt(e,s,i),vW(i.groupId,t,i.separateNegative),...i.rangeId==null?[]:[N4(i.rangeId,i.groupId)]]}var XT={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let e=Number.NaN;return function(i,s){const n=s[0],a=typeof n=="number"?n:Number(n);if(!Number.isFinite(a))return i;const o=e;if(e=a,!Number.isFinite(e))return i;const r=Math.abs(a-o),l=i??1/0;return r>0&&r<l?r:l}},supportsBanding:!0,combineResults(e){return $T(e,1/0,t=>Math.min(...t))},needsOverlap:!0},qT={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let e=Number.NaN;return function(i,s){const n=s[0],a=typeof n=="number"?n:Number(n);if(!Number.isFinite(a))return i;const o=e;if(e=a,!Number.isFinite(e))return i;const r=Math.abs(a-o),l=i??-1/0;return r>0&&r>l?r:l}},supportsBanding:!0,combineResults(e){return $T(e,-1/0,t=>Math.max(...t))},needsOverlap:!0},uW={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:t}}){return t?.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 pW({normaliseTo:e}){const t=(i,s)=>{if(s===0)return 0;const n=(i??0)*e/s;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(i,s,n,a)=>{const o=gW(i,s,n,a);for(const r of s){const l=n.datumIndices[r];if(l!=null)for(const c of l){const h=a+c,d=i[r],u=d[h];if(u==null){d[h]=void 0;continue}d[h]=t(u,o)}}}}function gW(e,t,i,s){const n=[0,0];for(const a of t){const o=e[a],r=i.datumIndices[a];if(r!=null)for(const l of r){const c=s+l,h=o[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 Wx(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:Zd({normaliseTo:t},pW)}}function fW({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const n=e[1]-e[0],a=function(r,l,c){const h=e[0]+(r-l)/c*n;return c===0?t:h>=e[1]?e[1]:h<e[0]?e[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]=[e[0],e[1]];const p=l.columns[c];for(let f=0;f<p.length;f+=1)p[f]=a(p[f],h,u)}}}function HD(e,t,i,s,n){return{type:"property-value-processor",property:e,adjust:Zd({normaliseTo:t,rangeMin:s,rangeMax:n,zeroDomain:i},fW)}}var af=1,$x=2;function mW(e,t,i){let s=af|$x;if(e.valueType==="category")return t.length<i.length&&(s&=~af),s;let n=i[0]?.valueOf();for(let a=1;s!==0&&a<i.length;a++){const o=i[a]?.valueOf();(!Number.isFinite(o)||n>o)&&(s&=~$x),Number.isFinite(o)&&n===o&&(s&=~af),n=o}return s}function yW(e){return function(i,s){if(!va(i))return;const{keys:n,values:a}=i.defs,{input:o,domain:{values:r},columns:l}=i;let c=!0,h=!0;if(o.count!==0){const d=i[_l];for(let u=0;(c||h)&&u<n.length;u++){const p=n[u],f=d.get(u);if(p.valueType==="category"){const y=i.domain.keys[u]?.length??0,b=i.keys[u]?.values().next().value?.length??0;y<b&&(c=!1)}else f&&(f.isUnique===!1&&(c=!1),f.sortOrder!==1&&(h=!1))}if(e&&e.length>0){let u=af|$x;for(let p=0;u!==0&&p<a.length;p++){const f=a[p];e.includes(f.id)&&(u&=mW(f,r[p],l[p]))}u&af||(c=!1),u&$x||(h=!1)}}return{uniqueKeys:c,orderedKeys:h}}}function xW(){return{uniqueKeys:!0,orderedKeys:!1}}function of(e){return{type:"processor",property:"animationValidation",calculate:Zd(e,yW),incrementalCalculate:xW}}function bW({mode:e,separateNegative:t}){return function(){return function(){return function(a,o,r,l){const c=[0,0];for(const h of o){const d=r.datumIndices[h];if(d==null)continue;const u=c[0],p=c[1],f=a[h];let y=!1;for(const b of d){const x=l+b,v=f[x];if(!Be(v))continue;const S=t&&Oc(v),M=S?u:p;if(e==="normal"?f[x]=M+v:f[x]=M,!y){const D=S?0:1;c[D]=M+v,y=!0}}}}}}}function vW(e,t,i=!1){const s=Zd({mode:t,separateNegative:i},bW);return{type:"group-value-processor",matchGroupIds:[e],adjust:s,supportsReprocessing:!0}}function QT(e){return e.id??e.property}function SW(e,t,i){const s=new Map,n=t.defs.values;for(let r=0;r<n.length;r+=1){const l=n[r];if(l.scopes?.includes(e)===!1)continue;const c=QT(l);if(s.has(c))return;s.set(c,r)}const a=[],o=i.defs.values;for(let r=0;r<o.length;r+=1){const l=o[r];if(l.scopes?.includes(e)===!1)continue;const c=QT(l),h=s.get(c);if(h==null)return;s.delete(c),a.push({previousIndex:h,nextIndex:r})}if(s.size===0)return a}function GD(e,t,i,s,n){for(const{previousIndex:a,nextIndex:o}of i){const r=e[a],l=t[o],c=r[s],h=l[n];if(c!==h)return!1}return!0}function Kx(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,n){if(!va(s))return;const a=new Map,o=new Map,r=new Map,l=new Map,c=t.keys.map(v=>v.get(e)),h=s.keys.map(v=>v.get(e)),d=t.columns,u=s.columns,p=SW(e,t,s);if(p==null)return n;const f=Math.max(t.input.count,s.input.count),y=s.defs.keys.some(v=>v.allowNullKey===!0);for(let v=0;v<f;v++){const S=v<t.input.count,M=v<s.input.count,D=S?RD(c,v,y):void 0,I=D==null?"":us(...D),k=M?RD(h,v,y):void 0,C=k==null?"":us(...k);if(M&&S&&I===C){GD(d,u,p,v,v)||r.set(C,v);continue}const A=l.get(C);A!=null?((i||!GD(d,u,p,A,v))&&(r.set(C,v),a.set(C,v)),l.delete(C)):M&&o.set(C,v);const w=o.get(I);w!=null?((i||!GD(d,u,p,w,v))&&(r.set(I,v),a.set(I,v)),o.delete(I)):S&&(r.delete(I),l.set(I,v))}const x={changed:o.size>0||r.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...n,[e]:x}}}}function us(...e){if(e.length===1){const t=Wg(e[0]);if(t===null)return TD;if(t===void 0)return OD;if(typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t}return e.map(t=>{const i=Wg(t);return i===null?TD:i===void 0?OD:i}).join("___")}var JT=class{constructor(e){this.maxAnimationTime=e,this.debug=be.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Qg.map(t=>[t,[]])),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(Qg[this.currentPhase])??[]}checkOverlappingId(e){e!=null&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(Qg.indexOf(e.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",e.id),e.stop();return}this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);i!=null&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=Qg[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:_x[c]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const o=()=>Qg[this.currentPhase]==null,r=()=>{for({phase:s,phaseControllers:n,phaseMeta:a}=i();!o()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:a}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=t,h=a.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():t=Math.min(u.update(c),t),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`,n),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(t>0&&!o());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 e=!0;for(const[,t]of this.controllers)if(t.duration>0&&_x[t.phase].skipIfNoEarlierAnimations!==!0){e=!1;break}if(!e)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(e=!0){if(this.skipAnimations===!1&&e===!0){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(t){K.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(e){if(e!=null&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){for(const e of this.stoppedCbs)e();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,s]of this.phases)s.length!==0&&(e!=null&&e!==i||(t+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}};function e1(e){return e==null?!0:!Number.isNaN(e)&&e>=0&&e<=2}var MW=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.maxAnimatableItems=WT,this.batch=new JT(this.defaultDuration*1.5),this.debug=be.create(!0,"animation"),this.events=new Pn,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(r){this.failsafeOnError(r);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||e.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:a}=e;if(!e1(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!e1(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const o=new b4({...e,id:i,skip:s,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}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(e){this.requestId=Re().requestAnimationFrame(t=>{e(t).catch(i=>K.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(e??i);e=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(t):(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(t)}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(e,t=!0){K.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new JT(this.defaultDuration*1.5),e===!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(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},DW=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}}},kW=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},IW=class{constructor(){this.items=new DW,this.lists=new kW}},t1=class{constructor(e){this.eventsHub=e,this.builtins=new IW,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,s){const{widgetEvent:n}=t;if(n.sourceEvent.defaultPrevented)return;const a=s?.x??t.canvasX,o=s?.y??t.canvasY,r={showOn:e,x:a,y:o,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",r),this.eventsHub.emit("context-menu:complete",r)}isVisible(e){return!this.hiddenActions.has(e)}toggle(e,t){switch(t??(t=this.isVisible(e)?"hide":"show"),t){case"show":this.hiddenActions.delete(e);break;case"hide":this.hiddenActions.add(e);break}}},i1=class oL{constructor(t){this.eventsHub=t,this.highlightStates=new Xg,this.pendingUnhighlights=new Map,this.unhighlightDelay=100}updateHighlight(t,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(t)){const o=fD(()=>{this.applyPendingUnhighlight(t)});this.pendingUnhighlights.set(t,{scheduler:o}),o.schedule(this.unhighlightDelay)}return}const a=this.pendingUnhighlights.get(t);a&&(a.scheduler.cancel(),this.pendingUnhighlights.delete(t)),i?this.highlightStates.set(t,i):this.highlightStates.delete(t),this.maybeEmitChange(t,n)}maybeEmitChange(t,i){const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit(oL.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:s,previousHighlight:i})}applyPendingUnhighlight(t){if(!this.pendingUnhighlights.has(t))return;this.pendingUnhighlights.delete(t);const i=this.getActiveHighlight();this.highlightStates.delete(t);const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit(oL.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:s,previousHighlight:i})}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:t}of this.pendingUnhighlights.values())t.cancel();this.pendingUnhighlights.clear()}isEqual(t,i){return t===i||t!=null&&i!=null&&t.series===i.series&&this.idsMatch(t,i)&&t.datum===i.datum}idsMatch(t,i){return t.itemId!=null&&i.itemId!=null&&t.itemId===i.itemId||t.datumIndex!=null&&i.datumIndex!=null&&Ht(t.datumIndex,i.datumIndex)}};i1.HIGHLIGHT_CHANGE_EVENT="highlight:change";var s1=i1,n1=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.Series=2]="Series",e[e.OtherSeries=3]="OtherSeries",e[e.OtherItem=4]="OtherItem",e))(n1||{}),jD=[0,1,2,3,4];function AW(e){switch(e){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function ku(e){const t=i=>i;switch(e){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 t(e)}}var Gl=class extends X{};g([m],Gl.prototype,"fill",2),g([m],Gl.prototype,"fillOpacity",2),g([m],Gl.prototype,"stroke",2),g([m],Gl.prototype,"strokeWidth",2),g([m],Gl.prototype,"strokeOpacity",2),g([m],Gl.prototype,"lineDash",2),g([m],Gl.prototype,"lineDashOffset",2);var Rr=class extends X{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(e){const t=AW(e);return t.length===0?{}:re(...t.map(i=>this[i]))}};g([m],Rr.prototype,"enabled",2),g([m],Rr.prototype,"range",2),g([m],Rr.prototype,"bringToFront",2),g([m],Rr.prototype,"highlightedItem",2),g([m],Rr.prototype,"unhighlightedItem",2),g([m],Rr.prototype,"highlightedSeries",2),g([m],Rr.prototype,"unhighlightedSeries",2);var wo=class extends X{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],wo.prototype,"start",2),g([m],wo.prototype,"stop",2),g([m],wo.prototype,"fill",2),g([m],wo.prototype,"fillOpacity",2),g([m],wo.prototype,"stroke",2),g([m],wo.prototype,"strokeWidth",2),g([m],wo.prototype,"strokeOpacity",2),g([m],wo.prototype,"lineDash",2),g([m],wo.prototype,"lineDashOffset",2);var Ux=class{constructor(){this.key="x",this.segments=new Bi(wo)}};g([m],Ux.prototype,"enabled",2),g([m],Ux.prototype,"key",2),g([m],Ux.prototype,"segments",2);var jl=class extends X{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};g([m],jl.prototype,"type",2),g([m],jl.prototype,"colorStops",2),g([m],jl.prototype,"bounds",2),g([m],jl.prototype,"gradient",2),g([m],jl.prototype,"rotation",2),g([m],jl.prototype,"reverse",2),g([m],jl.prototype,"colorSpace",2);var wi=class extends X{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}};g([m],wi.prototype,"type",2),g([m],wi.prototype,"colorStops",2),g([m],wi.prototype,"bounds",2),g([m],wi.prototype,"gradient",2),g([m],wi.prototype,"rotation",2),g([m],wi.prototype,"scale",2),g([m],wi.prototype,"reverse",2),g([m],wi.prototype,"path",2),g([m],wi.prototype,"pattern",2),g([m],wi.prototype,"width",2),g([m],wi.prototype,"height",2),g([m],wi.prototype,"padding",2),g([m],wi.prototype,"fill",2),g([m],wi.prototype,"fillOpacity",2),g([m],wi.prototype,"backgroundFill",2),g([m],wi.prototype,"backgroundFillOpacity",2),g([m],wi.prototype,"stroke",2),g([m],wi.prototype,"strokeOpacity",2),g([m],wi.prototype,"strokeWidth",2);var zr=class extends X{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"}};g([m],zr.prototype,"type",2),g([m],zr.prototype,"url",2),g([m],zr.prototype,"rotation",2),g([m],zr.prototype,"scale",2),g([m],zr.prototype,"backgroundFill",2),g([m],zr.prototype,"backgroundFillOpacity",2),g([m],zr.prototype,"repeat",2),g([m],zr.prototype,"fit",2);var Ua=class extends X{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Rr}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context")),"allowNullKeys"in t&&(this.allowNullKeys=t.allowNullKeys,e.delete("allowNullKeys"))}};g([m],Ua.prototype,"id",2),g([m],Ua.prototype,"visible",2),g([m],Ua.prototype,"focusPriority",2),g([m],Ua.prototype,"showInLegend",2),g([m],Ua.prototype,"cursor",2),g([m],Ua.prototype,"nodeClickRange",2),g([m],Ua.prototype,"highlight",2);function a1(e,t){if(t.length===0)return[!1,!1];const i=t[0],s=t.at(-1);if(typeof i=="string"||i===null||i===void 0)return[e===i,e===s];if(e==null)return[!1,!1];const n=e.valueOf();if(i==null||s==null)return[!1,!1];let a=i.valueOf(),o=s.valueOf();return a>o&&([a,o]=[o,a]),[n===a,n===o]}function WD(e,t,i,s,n,a){const[o,r]=a1(t,a),[l,c]=a1(e,n);return{xKey:i,yKey:s,xValue:e,yValue:t,first:l,last:c,min:o,max:r}}function rf(e,t,[i,s],n){let a=Hc(0,t-1,r=>{const l=e===1?r:t-r,c=n(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,o=Dr(0,t-1,r=>{const l=e===1?r:t-r,c=n(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=s})??t-1;return e===-1&&([a,o]=[t-o,t-a]),a=Math.max(a,0),o=Math.min(o+1,t),[a,o]}function $D(e,t,i){if(i){const{x:n,y:a,width:o,height:r}=i;return{canvasX:n+o/2,canvasY:a+r/2}}const s=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(s){const{x:n,y:a}=Wt.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(a)}}}function CW(e,t,i,s,n){let a=-1,o=0,r=0,l=!1;for(;o<s&&a<=t-e;){a+=1;const c=i+r;if(l||(r*=-1),r>=0&&(r+=1),l&&r<0&&(r-=1),c<e||c>t){l=!0;continue}n(c)&&(o+=1)}return o}function KD(e){const t={};for(const i of jD)t[i]=e(void 0,!1,i);return t}function wW(e,...t){const i={};for(const s of t??["default"])for(const n of jD){const a=i[s]??(i[s]={});a[n]=e(void 0,!1,n,s)}return i}function UD(e){return(e?.opacity??1)<1||(e?.fillOpacity??1)<1||(e?.strokeOpacity??1)<1}var o1=new Map;function LW(e){if(e==null)return!1;const t=e.fill;if(!Bt(t))return!1;const i=t.trim(),s=i.toLowerCase();if(s==="transparent"||s==="none")return!1;let n=o1.get(i);if(n==null){try{n=Oe.fromString(i).a===1}catch{n=!1}o1.set(i,n)}return n}function NW(e,t){return e!=="cutout"?e:LW(t)?"cutout":"overlay"}function r1(e,t){for(const i of t??[])switch(typeof e){case"string":if(i.itemId===e)return i;break;case"number":if(i.datumIndex===e)return i;break;default:return e}}var Yx=class{constructor(e,t,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new Xg,this.suppressState=new Xg(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new pt,this.cleanup.register(s.setup(t,i),e.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:e}of this.pendingRemovals.values())e.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(e,t,i,s){const n=this.pendingRemovals.get(e);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(e)),i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:s}),this.applyStates()}removeTooltip(e,t,i=!1){if(i&&this.removeDelay>0){const n=this.pendingRemovals.get(e);if(n){t&&(n.lastMeta=t);return}const a=fD(()=>{this.applyPendingRemoval(e)});this.pendingRemovals.set(e,{scheduler:a,lastMeta:t}),a.schedule(this.removeDelay);return}const s=this.pendingRemovals.get(e);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(e)),this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyPendingRemoval(e){this.pendingRemovals.has(e)&&(this.pendingRemovals.delete(e),this.stateTracker.delete(e),this.applyStates())}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||t?.meta==null||t?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(Ht(this.appliedState?.content,t?.content)&&Ht(this.appliedState?.pagination,t?.pagination)){const n=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,n)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,s){const{canvasX:n,canvasY:a}=e,o=t.properties.tooltip,{placement:r,anchorTo:l,xOffset:c,yOffset:h}=o.position,d=$D(t,i,s);return{canvasX:n,canvasY:a,nodeCanvasX:d?.canvasX??n,nodeCanvasY:d?.canvasY??a,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:r,anchorTo:l,xOffset:c,yOffset:h}}}},l1=3,TW=505,c1=30;function YD(e,t){const{device:i,offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:c}=t;return{type:e,device:i,offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:c}}function h1(e,t){const i=e*e+t*t,s=l1*l1;return i>=s}function OW(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY,n=i*i+s*s,a=c1*c1;return n<a}var PW=class{constructor(e){this.cleanup=new pt,this.events=new Pn,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.events.emit("mousemove",e)}onDblClick(e){this.events.emit("dblclick",e)}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&h1(e.originDeltaX,e.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",e)}onDragEnd(e){if(this.isDragging){this.events.emit("drag-end",e),this.isDragging=!1;return}if(e.device==="mouse"){const t=YD("click",e);this.events.emit("click",t)}else if(e.sourceEvent.type==="touchend"){if(h1(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=YD("click",e);this.events.emit("click",t);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=TW&&OW(this.lastClick,e)){const s=YD("dblclick",e);this.events.emit("dblclick",s),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},ZD=class extends Su{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},EW=class{constructor(e,t){this.seriesWidget=new ZD(e.getParent("series-area")),this.chartWidget=new ZD(e.getParent("canvas-proxy")),this.containerWidget=new ZD(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),t.withDragInterpretation&&(this.seriesDragInterpreter=new PW(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},d1=class rL extends Ix{constructor(t=[],i=[]){super(),this.range=i,this.defaultTickCount=rL.defaultTickCount,this.defaultClamp=!1,this._domain=[],this.domainNeedsValueOf=!0,this.d0Cache=Number.NaN,this.d1Cache=Number.NaN,this.domain=t}static is(t){return t instanceof rL}get domain(){return this._domain}set domain(t){if(this._domain=t,t&&t.length>=2){const i=t[0];this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=t[0].valueOf(),this.d1Cache=t[1].valueOf()):(this.d0Cache=t[0],this.d1Cache=t[1])}else this.d0Cache=Number.NaN,this.d1Cache=Number.NaN}normalizeDomains(...t){return u1(...t)}calcBandwidth(t=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let o=Math.abs(this.d1Cache-this.d0Cache)/t+1;if(i!==0){const r=Math.floor(n);o=Math.min(o,r)}return n/Math.max(1,o)}convert(t,i){const{domain:s}=this;if(!s||s.length<2||t==null)return Number.NaN;const{range:n}=this,a=i?.clamp??this.defaultClamp;let o=this.d0Cache,r=this.d1Cache,l=typeof t=="number"?t:t.valueOf();if(this.transform&&(o=this.transform(o),r=this.transform(r),l=this.transform(l)),a){const[h,d]=Tt([o,r]);if(l<h)return n[0];if(l>d)return n[1]}if(o===r)return(n[0]+n[1])/2;if(l===o)return n[0];if(l===r)return n[1];const c=n[0];return c+(l-o)/(r-o)*(n[1]-c)}invert(t,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:o}=this,[r,l]=o;let c;return r===l?c=this.toDomain((n+a)/2):c=this.toDomain(n+(t-r)/(l-r)*(a-n)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return Cx(this.domain)}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};d1.defaultTickCount=5;var mt=d1;function u1(...e){let t,i=1/0,s,n=-1/0;for(const a of e){const o=a.domain;for(const r of o){const l=r.valueOf();l<i&&(i=l,t=r),l>n&&(n=l,s=r)}}return t!=null&&s!=null?{domain:[t,s],animatable:!0}:{domain:[],animatable:!1}}var XD=class o_ extends Ix{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(t){return t instanceof o_}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(t){t=ae(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=ae(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=ae(0,t,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&K.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t,i?.alignment);return s==null||s<0||s>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(s)}getDomainMinMax(){return Cx(this.domain)}invertNearestIndex(t){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let s=0,n=i-1,a=1/0,o=0;for(;s<=n;){const r=Math.trunc((n+s)/2),l=this.ordinalRange(r),c=Math.abs(l-t);if(c===0)return r;c<a&&(a=c,o=r),l<t?s=r+1:n=r-1}return o}update(){const[t,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:n}=this,a=this.getBandCountForUpdate();if(a===0)return;const o=i-t;let r;a===1?(s=0,r=o*(1-n*2)):r=o/Math.max(1,a-s+n*2);const l=this.round&&Math.floor(r)>0,c=l?Math.floor(r):r;let h=t+(o-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=r*(1-s)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,a=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return ae(a,i+s*t,o)}};g([Ax],XD.prototype,"range",2),g([Ax],XD.prototype,"round",2);var Ya=XD,RW=1e3,p1=20;function g1(e,t=0,i=e.length-1){const s=i-t+1;if(s<2)return{isUniform:!1};const n=Array.from({length:p1},(l,c)=>t+Math.floor(c*(s-1)/(p1-1))),a=n.map(l=>e[l].valueOf()),o=(a.at(-1)-a[0])/(s-1);if(!Number.isFinite(o)||o===0)return{isUniform:!1};const r=Math.abs(o*.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-o)>r)return{isUniform:!1}}return{isUniform:!0,interval:o}}var Lo=class r_ extends Ya{static is(t){return t instanceof r_}toDomain(t){return new Date(t)}get reversed(){const{domain:t}=this;return t.length>0&&t[0].valueOf()>t.at(-1).valueOf()}get numericBands(){return this.bands.map(t=>t.valueOf())}convert(t,i){this.refresh(),t instanceof Date||(t=new Date(t));const{domain:s,reversed:n}=this,a=this.numericBands,o=a.length;if(s.length<=0)return Number.NaN;const r=this.ordinalRange(0),l=this.ordinalRange(o-1);if(o===0)return r;if(i?.clamp===!0){const{range:S}=this;if(t.valueOf()<a[0])return S[0];if(t.valueOf()>a.at(-1))return S[1]}if((i?.alignment??0)!==2){const S=super.convert(t,i);return n?l-(S-r):S}const h=t.valueOf();let d=this.findIndex(t)??0,u;n?(d=Math.min(Math.max(d,1),o-1),u=-1):(d=Math.min(Math.max(d,0),o-2),u=1);const p=a[d],f=a[d+u],y=this.ordinalRange(d),b=this.ordinalRange(d+u),v=(h-p)/(f-p)*(b-y)+y;return n?l-(v-r):v}invert(t,i=!1){this.refresh();const{domain:s}=this;if(s.length<=0)return;const n=this.bands,a=this.getBandCountForUpdate(),o=s[0].valueOf()>s.at(-1).valueOf();let r;return i?r=this.invertNearestIndex(t-this.bandwidth/2):r=Hc(0,a-1,c=>this.ordinalRange(c)>=t)??a-1,n[o?a-1-r:r]}getUniformityCache(t){}findIndex(t,i=0){if(t==null)return;const s=this.numericBands,n=s.length;if(n===0)return;if(n===1)return 0;const a=t.valueOf();return i===1?Hc(0,n-1,o=>s[o]>=a):Dr(0,n-1,o=>s[o]<=a)}};function Zx(e,t,i,s,n){return t+(s-t)*((n-e)/(i-e))}function f1(e,t,i,s,n){return e+(n-t)*((i-e)/(s-t))}function m1(e,t,i){return[f1(e,i.min,t,i.max,0),f1(e,i.min,t,i.max,1)]}function zW(e,t,i){const[s,n]=m1(e.x1,e.x2,t),[a,o]=m1(e.y1,e.y2,i);return{x1:s,x2:n,y1:a,y2:o}}function y1(e,t,i,s,n,a){if(i<=n&&a<=s)return i;const o=n-i,r=a-s,l=Math.abs(o)<Math.abs(r)?o:r;return ae(e,i+l,t)}function VW(e,t,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=t,a=ve.from(i),o=ve.from(e),r=zW(o,s,n),l=y1(r.x1,r.x2,o.x1,o.x2,a.x1,a.x2),c=y1(r.y1,r.y2,o.y1,o.y2,a.y1,a.y2),h={x:{min:Zx(o.x1,s.min,o.x2,s.max,l),max:Zx(o.x1,s.min,o.x2,s.max,l+e.width)},y:{min:Zx(o.y1,n.min,o.y2,n.max,c),max:Zx(o.y1,n.min,o.y2,n.max,c+e.height)}},d=h.x.max-h.x.min,u=h.y.max-h.y.min;return h.x.min=ae(0,h.x.min,1-d),h.x.max=h.x.min+d,h.y.min=ae(0,h.y.min,1-u),h.y.max=h.y.min+u,h}function x1(e,t){const i=e?.valueOf(),s=t?.valueOf();return typeof i!="number"||typeof s!="number"?[void 0,void 0]:i<s?[0,1]:[1,0]}var b1=e=>ze((t,{options:i})=>!mt.is(e?.scale)&&!Lo.is(e?.scale)||t==null||i.end==null?!0:t<i.end,"to be less than end");function BW(e){for(const t of za(e)){const i=e[t];if(!i)continue;const{min:s,max:n}=i;(s<0||n>1)&&(K.warnOnce(`Attempted to update axis (${t}) zoom to an invalid ratio of [{ min: ${s}, max: ${n} }], expecting a ratio of 0 to 1. Ignoring.`),delete e[t])}}function v1(e,t){const i={};for(const{id:s,direction:n}of e){const{min:a,max:o}=t[s]??{min:0,max:1};i[s]={min:a,max:o,direction:n}}return i}function FW(e,t){const i=za(e),s=za(t);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=e[n],o=t[n];if(a!==o&&(a==null||o==null||a.direction!==o.direction||a.min!==o.min||a.max!==o.max))return!1}return!0}function _W(e){return{source:"user-interaction",sourceDetail:e}}var S1=class extends vD{constructor(e,t,i){super(),this.eventsHub=e,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(e.on("zoom:change-request",s=>{this.constrainZoomToRequiredWidth(s)}),t.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"})}),t.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(e){const t={};let i;const{state:s}=this;if(this.independentAxes){const n=this.getPrimaryAxisId("x"),a=this.getPrimaryAxisId("y");i=[],n&&i.push(n),a&&i.push(a)}else i=za(s);for(const n of i){const{direction:a}=s[n]??{};if(a!=null){const o=e[a];if(o){const{min:r,max:l}=o;t[n]={min:r,max:l,direction:a}}}}return t}toZoomState(e){let t,i;for(const s of za(e)){const{min:n,max:a,direction:o}=e[s];o==="x"?t??(t={min:n,max:a}):o==="y"&&(i??(i={min:n,max:a}))}if(t||i)return{x:t,y:i}}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!ge(e))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:b1(i),end:ce},rangeY:{start:b1(s),end:ce},ratioX:{start:ce,end:ce},ratioY:{start:ce,end:ce},autoScaledAxes:ce},{invalid:a}=Mi(e,n);return a.length>0?(t.push(...a.map(String)),!1):!0}restoreMemento(e,t,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.pendingMemento=void 0;const s=Rt(this.getZoom());i?.rangeX?s.x=this.rangeToRatioDirection("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 o=this.toCoreZoomState(s);this.lastRestoredState=Ks(Te(o)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:o,isReset:!1})}findAxis(e){for(const t of this.axes)if(t.id===e)return t}getAxes(){return this.axes}setAxes(e){const{axes:t}=this;t.length=0;for(const n of e)"range"in n&&t.push(n);const i=this.state,s=v1(e,i);this.state=s,this.lastRestoredState=v1(e,this.lastRestoredState),this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:s,isReset:!1})}setIndependentAxes(e=!0){this.independentAxes=e}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:e,sourceDetail:t},i){const s=this.toCoreZoomState(i??{});return this.updateChanges({source:e,sourceDetail:t,changes:s,isReset:!1})}computeChangedAxesIds(e){const t=[],i=this.state;for(const s of za(e)){const n=e[s]??{min:0,max:1},a=i[s];(a==null||a.min!==n.min||a.max!==n.max)&&t.push(s)}return t}updateChanges(e){const{source:t,sourceDetail:i,isReset:s,changes:n}=e;BW(n);const a=this.computeChangedAxesIds(n),o=Te(this.state),r=Te(this.state);for(const l of a){const c=r[l];c!=null&&(c.min=n[l]?.min??0,c.max=n[l]?.max??1)}return this.state=r,this.dispatch(t,i,a,s,o)}resetZoom({source:e,sourceDetail:t}){this.updateChanges({source:e,sourceDetail:t,changes:this.getRestoredZoom(),isReset:!0})}resetAxisZoom({source:e,sourceDetail:t},i){this.updateChanges({source:e,sourceDetail:t,changes:{[i]:this.getRestoredZoom()[i]},isReset:!0})}panToBBox(e,t){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=this.getZoom();if(i===void 0||!i.x&&!i.y)return!1;if(!(e.width>0&&e.height>0&&Math.abs(t.width)<=Math.abs(e.width)&&Math.abs(t.height)<=Math.abs(e.height)))return K.warnOnce("cannot pan to target BBox - chart too small?"),!1;const n=VW(e,i,t),a=this.toCoreZoomState(n);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:a,isReset:!1})}fireZoomPanStartEvent(e){this.eventsHub.emit("zoom:pan-start",{callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,s=>Number(s)-i)}extendWith({source:e,sourceDetail:t},i,s){const n=this.getPrimaryAxis(i);if(!n)return;const a=this.getDomainExtents(n);if(!a)return;const[,o]=a,r=s(o),l=this.rangeToRatioAxis(n,{start:r});l&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:l},isReset:!1})}updateWith({source:e,sourceDetail:t},i,s){const n=this.getPrimaryAxis(i);if(!n)return;const a=this.getDomainExtents(n);if(!a)return;let[o,r]=a;[o,r]=s(o,r);const l=this.rangeToRatioAxis(n,{start:o,end:r});l&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:l},isReset:!1})}getZoom(){return this.toZoomState(this.state)}getAxisZoom(e){return this.state[e]??{min:0,max:1}}getAxisZooms(){return this.state}getCoreZoom(){return this.state}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}getBoundSeries(){const e=this.getPrimaryAxis("x"),t=this.getPrimaryAxis("y");let i;if(this.independentAxes){const s=new Set(e?.boundSeries??[]),n=new Set(t?.boundSeries??[]);i=new Set;for(const a of s)n.has(a)&&i.add(a)}else i=new Set([...e?.boundSeries??[],...t?.boundSeries??[]]);return i}constrainZoomToItemCount(e,t,i){let s=[e.x.min,e.x.max],n=i?void 0:[e.y.min,e.y.max];for(const r of this.getBoundSeries()){const l=r.getZoomRangeFittingItems(s,n,t);l!=null&&(s=l.x,n=l.y)}const a={min:s[0],max:s[1]},o=n?{min:n[0],max:n[1]}:void 0;return Rt({x:a,y:o})}isVisibleItemsCountAtLeast(e,t,i){const s=this.getBoundSeries(),n=[e.x.min,e.x.max],a=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[e.y.min,e.y.max];let o=0;for(const r of s){const l=t-(o??0),c=r.getVisibleItems(n,a,l);if(o+=c,o>=t)return!0}return s.size===0}getMementoRanges(){const e=Rt(this.getZoom()),t={rangeX:this.getRangeDirection("x",e.x),rangeY:this.getRangeDirection("y",e.y),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:void 0};return this.eventsHub.emit("zoom:save-memento",{memento:t}),t}restoreRequiredRange(e,t){const{lastRestoredRequiredRange:i,lastRestoredRequiredRangeDirection:s}=this,n=t!=="x"&&t!=="y",a=s===t&&i===e,o=e===0&&(i==null||i===0);if(n||a||o)return;const r=this.getPrimaryAxisId(t);if(!r)return;const l=this.getAxisZoom(r),c=Math.min(1,1/e);let h=0,d=1;t==="x"?(h=ae(0,1-c,l.min),d=ae(0,h+c,1)):(d=Math.min(1,l.max),h=d-c,h<0&&(d-=h,h=0),h=ae(0,h,1),d=ae(0,d,1)),this.lastRestoredRequiredRange=e,this.lastRestoredRequiredRangeDirection=t;const u={[t]:{min:h,max:d}},p=this.toCoreZoomState(u);this.lastRestoredState=Ks(Te(p)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:p,isReset:!1})}constrainZoomToRequiredWidth(e){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const t=this.lastRestoredRequiredRangeDirection,i=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!i)return;const s=e.stateAsDefinedZoom(),n=e.oldState[i],a=s[t].max-s[t].min,o=1/this.lastRestoredRequiredRange;a<=o||e.constrainZoom({...s,[t]:{min:n.min,max:n.min+o}})}dispatch(e,t,i,s,n){const{x:a,y:o}=this.getZoom()??{},r=this.state;let l;const c=this,h={source:e,sourceDetail:t,isReset:s,changedAxes:i,state:r,oldState:n,x:a,y:o,stateAsDefinedZoom(){return Rt(c.toZoomState(h.state))},constrainZoom(p){this.constrainChanges(c.toCoreZoomState(p))},constrainChanges(p){l??(l=Te(r));for(const f of za(p)){const y=p[f],b=l[f];y&&b&&(b.min=y.min,b.max=y.max)}h.state=l}};this.eventsHub.emit("zoom:change-request",h);let d=!1;l&&!FW(r,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:e,sourceDetail:t,x:p.x}),this.pendingZoomEventSource=e}return u}getRange(e,t){return this.getRangeAxis(this.findAxis(e),t)}getRangeDirection(e,t){return this.getRangeAxis(this.getPrimaryAxis(e),t)}getRangeAxis(e,t){if(!e||!t||!mt.is(e.scale)&&!Lo.is(e.scale))return;const i=this.getDomainPixelExtents(e);if(!i)return;const[s,n]=i;let a,o;return s<=n?(a=e.scale.invert(0),o=e.scale.invert(s+(n-s)*t.max)):(a=e.scale.invert(s-(s-n)*t.min),o=e.scale.invert(0)),{start:a,end:o}}rangeToRatio(e,t){return this.rangeToRatioAxis(this.findAxis(e),t)}rangeToRatioDirection(e,t){return this.rangeToRatioAxis(this.getPrimaryAxis(e),t)}rangeToRatioAxis(e,t){if(!e)return;const i=this.getDomainPixelExtents(e);if(!i)return;const[s,n]=i,{scale:a}=e,{start:o,end:r}=t,[l=0,c=1]=x1(o,r),h=o==null?s:a.convert(o,{alignment:l}),d=r==null?n:a.convert(r,{alignment:c})+(a.bandwidth??0);if(!Be(h)||!Be(d))return;const[u,p]=[Math.min(s,n),Math.max(s,n)];if(h<u||h>p){K.warnOnce(`Invalid range start [${o}], expecting a value between [${a.invert(s)}] and [${a.invert(n)}], ignoring.`);return}if(d<u||d>p){K.warnOnce(`Invalid range end [${r}], expecting a value between [${a.invert(s)}] and [${a.invert(n)}], ignoring.`);return}const f=n-s;if(f===0)return;const y=Math.abs((h-s)/f),b=Math.abs((d-s)/f);if(!(y>=b))return{min:y,max:b}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),s=t.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(e){const[t,i]=e.scale.range;if(!(!Be(t)||!Be(i)))return[t,i]}},qD=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Scrollbar=4]="Scrollbar",e[e.Navigator=5]="Navigator",e[e.Overlay=6]="Overlay",e))(qD||{}),HW=class{constructor(e){this.eventsHub=e,this.elements=new Map}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i={width:e,height:t,layoutBox:new le(0,0,e,t),scrollbars:{}};for(const s of Object.values(qD)){if(typeof s!="number")continue;const n=this.elements.get(s);if(n)for(const a of n)a(i)}return i}emitLayoutComplete({width:e,height:t},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:e,height:t},clipSeries:i.clipSeries??!1,series:i.series})}},GW=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=le.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},n=new Set(e.map(o=>o.id));for(const o of this.labelData.keys())n.has(o)||this.labelData.delete(o);for(const o of e){const r=o.getLabelData();r.every($M)&&this.labelData.set(o.id,r)}const a=KM(this.labelData,s,5);for(const o of e)o.updatePlacedLabelData?.(a.get(o.id)??[])}},jW=class{constructor(e){this.eventsHub=e,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return e==null||De(e)}restoreMemento(e,t,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(e){const{seriesId:t,itemId:i,legendItemName:s,visible:n}=e;if(t){const o=(this.legendDataMap.get(t)??[]).map(r=>{const l=r.seriesId===t&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:n}:r});return{seriesId:t,data:o}}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 o=(this.legendDataMap.get(a.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===s?{...r,enabled:n}:r);return{seriesId:a.seriesId,data:o}}}warnFixed(e,t){K.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.eventsHub.emit("legend:change",{legendData:e??this.getData()})}updateData(e,t=[]){this.eventsHub.emit("legend:change-partial",{seriesId:e,legendData:t}),this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,s){if(s){for(const r of this.getData()){const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:e}:c);this.updateData(r.seriesId,l)}return}const n=this.getData(t),a=n.length===1,o=n.map(r=>i==null&&a||r.itemId===i?{...r,enabled:e}:r);this.updateData(t,o)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,s])=>t.concat(s),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(i=>i.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(i=>i.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},WW=class{updateCallback(e){this.resolvePartialCallback=e}resolvePartial(e,t,i){return this.resolvePartialCallback?.(e,t,i)}},$W=class extends Ya{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(e){this._domain!==e&&(e.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=e)}get domain(){return this._domain}get bands(){return this.domain}addBand(e,t,i){this._domain.push(this.getDomainValue(e,t)),this._bandRanges.has(e)||this._bandRanges.set(e,new Map),this._bandRanges.get(e).set(t,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(e,t){return`${e}-${t}`}findIndex(e){let t=0;for(const i of this._bandRanges.keys()){if(i===e)return t;t++}}convert(e){const{_bandwidth:t,_bandRanges:i,_inset:s,_paddingInnerWidth:n}=this;let a=s;const o=e.split("-"),r=Number(o[0]);if(!this._hasFixedWidth)return super.convert(r);for(let l=0;l<r;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??t);a+=h+n}return a}invert(e,t){}getBandCountForUpdate(){return this._bandRanges.size}update(){if(!this._hasFixedWidth)return super.update();const[e,t]=this.range;let{paddingInner:i}=this;const s=this.getBandCountForUpdate();if(s===0)return;let n=0,a=s,o=s;for(const y of this._bandRanges.values()){let b=0,x=!1;for(const v of y.values()){if(v==null){x=!0;continue}b=Math.max(b,v)}x?o-=1:(a-=1,n+=b)}s===1&&(i=0);const r=t-e,l=r/s*i,c=n+l*(s-1),h=r-c;let d=e,u=a>0&&h>=0?h/a:r/s,p=u;o===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(...e){return{domain:[],animatable:!1}}toDomain(e){}},KW=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,width:s,type:n}){if(!t)return;let a=this.groups.get(n);a==null&&(a=new Map,this.groups.set(n,a)),a.set(e,{grouping:t,visible:i,width:s})}updateSeries({internalId:e,seriesGrouping:t,visible:i,width:s,type:n}){if(!t)return;const a=this.groups.get(n)?.get(e);a&&(a.grouping=t,a.width=s,a.visible=i)}deregisterSeries({internalId:e,type:t}){const i=this.groups.get(t);i!=null&&(i.delete(e),i.size===0&&this.groups.delete(t))}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set,a=this.groups.get(e);for(const r of a?.values()??[])r.visible&&(s.add(r.grouping.groupIndex),r.grouping.groupIndex===t.groupIndex&&n.add(r.grouping.stackIndex));const o=Array.from(s);return o.sort((r,l)=>r-l),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(t.groupIndex)}}updateGroupScale({type:e},t,i){const s=this.groupScales.get(e)??new $W;this.groupScales.set(e,s),s.domain=[];const n=this.groups.get(e);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,t],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:e}){return this.groupScales.get(e)}getGroupOffset(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const s=i.getDomainValue(t.groupIndex,t.stackIndex);return i.convert(s)}getStackOffset(e,t){const{seriesGrouping:i}=e;if(!i)return 0;const s=this.groups.get(e.type);if(!s)return 0;const n=this.getGroupScale(e);if(!n||(i.stackCount??0)<1)return 0;let o=0;for(const r of s.values())r.visible&&r.grouping.groupIndex===i.groupIndex&&(o=Math.max(o,r.width??n.bandwidth));return o===0?0:o/2-t/2}},UW=class{constructor(e){this.updateCallback=e,this.events=new Pn}addListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e,t){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e,wasShortcut:t})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSeriesUpdate(e,t){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:e,requiredRangeDirection:t})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},YW=class{constructor(e,t){this.eventsHub=new Pn,this.callbackCache=new eM,this.highlightManager=new s1(this.eventsHub),this.formatManager=new Du,this.layoutManager=new HW(this.eventsHub),this.localeManager=new qj(this.eventsHub),this.seriesStateManager=new KW,this.stateManager=new Ej,this.seriesLabelLayoutManager=new GW,this.cleanup=new pt;const{scene:i,root:s,syncManager:n,container:a,fireEvent:o,updateCallback:r,updateMutex:l,styleContainer:c,skipCss:h,chartType:d,domMode:u,withDragInterpretation:p}=t;this.chartService=e,this.syncManager=n,this.domManager=new kT(this.eventsHub,this.chartService,a,c,h,u),this.widgets=new EW(this.domManager,{withDragInterpretation:p});const f=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Fx({canvasElement:f}),this.scene.setRoot(s),this.cleanup.register(this.scene.on("scene-changed",()=>{this.updateService.update(9)})),this.axisManager=new t4(this.eventsHub,s),this.legendManager=new jW(this.eventsHub),this.annotationManager=new e4(this.eventsHub,e.annotationRoot,o),this.chartTypeOriginator=new Oj(e),this.interactionManager=new NT,this.contextMenuRegistry=new t1(this.eventsHub),this.optionsGraphService=new WW,this.updateService=new UW(r),this.activeManager=new m4(this.chartService,this.eventsHub,this.updateService,this.interactionManager,o),this.proxyInteractionService=new Yj(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new i4(this.domManager,this.updateService),this.historyManager=new Pj(this.eventsHub),this.animationManager=new MW(this.interactionManager,l),this.dataService=new AD(this.eventsHub,e,this.animationManager),this.tooltipManager=new Yx(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new S1(this.eventsHub,this.updateService,o);for(const y of fe.listModulesByType("plugin"))(!y.chartType||y.chartType===d)&&y.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()}},QD=class extends X{constructor(){super(...arguments),this.range="tooltip",this.drawingMode="cutout"}};g([m],QD.prototype,"range",2),g([m],QD.prototype,"drawingMode",2);function ZW(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function XW(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const n=t.get(i);if(n==null||!ZW(s,n))return!1}return!0}function qW(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:n,scopes:a,data:o,...r}=e[i],{type:l,idsMap:c,scopes:h,data:d,...u}=t[i];if(s!==l||a&&h&&!En(a,h)||o&&d&&o!==d||!Ht(r,u)||!XW(n,c))return!1}return!0}function QW(e,t){const{props:i,...s}=e,{props:n,...a}=t;return Ht(s,a)&&qW(i,n)}function JW(e,t,i,s){return t!==e.dataSet?!1:En(i,e.ids)&&QW(s,e.opts)}function M1(e){return e.filter(t=>t.type==="key").map(t=>t.property).join(";")}var JD=class Oa{constructor(t,i,s){this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=be.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,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:t,opts:s,dataSet:i,resolve:n,reject:a})})}execute(t){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const i=new Map;for(const r of this.requested)r.dataSet.hasPendingTransactions()&&i.set(r.dataSet,r.dataSet.getChangeDescription()),r.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()&&(Re().processedData=[]);const a=[];for(const{dataSet:r,ids:l,opts:c,resolves:h,rejects:d}of n){let u=function(S){return JW(S,r,l,c)};var o=u;const p=t?.find(u),f=(S,M)=>{if(this.debug.check()&&Re("processedData").push(M),M==null){for(const D of d)D(new Error("AG Charts - no processed data generated"));return}a.push({opts:c,dataSet:r,dataLength:r.data.length,ids:l,dataModel:S,processedData:M});for(const D of h)D({dataModel:S,processedData:M})},y=()=>{try{const S=new FD(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(s.map(I=>[I.id,I.dataSet])),D=S.processData(M);return f(S,D),S}catch(S){for(const M of d)M(S)}};if(p==null){y();continue}const{dataModel:b,processedData:x}=p,v=i.get(r);if(x&&v&&b.isReprocessingSupported(x)){if(this.debug("DataController.execute() - reprocessing data",x,r),b.reprocessData(x,i),be.check("data-model:reprocess-diff")){const S=new FD(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(s.map(A=>[A.id,A.dataSet])),D=S.processData(M),I=JSON.parse(JSON.stringify(x,Oa.jsonReplacer)),k=JSON.parse(JSON.stringify(D,Oa.jsonReplacer));delete I.time,delete I.optimizations,delete k.time,delete k.optimizations;const C=Hn(k,I);C?(K.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),K.log("Difference between incremental update and full reprocess:"),K.log(""),K.log("BASELINE (full reprocess):"),K.log(JSON.stringify(k,null,2)),K.log(""),K.log("REPROCESSED (incremental update):"),K.log(JSON.stringify(I,null,2)),K.log(""),K.log("DIFF (what changed):"),K.log(JSON.stringify(C,null,2))):K.log("\u2705 Data-model reprocess matches baseline (no diff)")}f(b,x);continue}y()}return a}validateRequests(t){const i=[];for(const[s,n]of t.entries())s>0&&n.dataSet.data.length!==t[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(t){const i=[];for(const s of t){const n=i.find(Oa.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Oa.mergeRequests)}static groupMatch({dataSet:t,opts:i}){const{groupByData:s,groupByKeys:n=!1,groupByFn:a,props:o}=i,r=M1(o);return([l])=>(s===!1||l.dataSet===t)&&(l.opts.groupByKeys??!1)===n&&l.opts.groupByFn===a&&M1(l.opts.props)===r}static mergeRequests(t){const i={ids:[],rejects:[],resolves:[],dataSet:t[0].dataSet,opts:{...t[0].opts,props:[]}},s=new Map,n=new Map;let a=0;for(const o of t){const{id:r,dataSet:l,resolve:c,reject:h,opts:{props:d,...u}}=o;i.ids.push(r),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 f={...p,scopes:[r],data:l.data};Oa.createIdsMap(r,f);let y;Oa.crossScopeMergableTypes.has(f.type)?y=-1:n.has(l.data)?y=n.get(l.data):(y=a++,n.set(l.data,y));const b=`${f.type}-${y}-${f.groupId}`,x=s.get(b),v=x?.find(S=>Oa.deepEqual(S,f));if(x==null){i.opts.props.push(f),s.set(b,[f]);continue}else if(v==null){i.opts.props.push(f),x.push(f);continue}f.scopes!=null&&(v.scopes??(v.scopes=[]),v.scopes.push(...f.scopes)),(v.type==="key"||v.type==="value")&&f.idsMap?.size&&(v.idsMap??(v.idsMap=new Map),Oa.mergeIdsMap(f.idsMap,v.idsMap))}}return i}static mergeIdsMap(t,i){for(const[s,n]of t){const a=i.get(s);if(a==null)i.set(s,new Set(n));else for(const o of n)a.add(o)}}static createIdsMap(t,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(t)?i.idsMap.get(t).add(i.id):i.idsMap.set(t,new Set([i.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(t)){if(n=t.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Oa.deepEqual(t[s],i[s]))return!1;return!0}const a=Object.keys(t);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const o=a[s];if(!Oa.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!Oa.deepEqual(t[o],i[o])))return!1}return!0}return!1}static jsonReplacer(t,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};JD.crossScopeMergableTypes=new Set(["key","group-value-processor"]),JD.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var D1=JD,Iu=class RS{constructor(t){this.data=t,this.pendingTransactions=[]}static empty(){return new RS([])}static wrap(t){return new RS(t)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const t=this.getChangeDescription();return t?t.indexMap.finalLength:this.data.length}addTransaction(t){const i=this.normalizeTransaction(t);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){return new RS([...this.data])}normalizeTransaction(t){const{add:i,addIndex:s,prepend:n,append:a,remove:o,update:r}=t;if(i===void 0)return t;const l={remove:o,update:r};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 t=this.getChangeDescription();if(!t)return!1;const i=t.getPrependedValues(),s=t.getInsertionValues(),n=t.getAppendedValues(),a=[...i,...s,...n];let o=0;return t.applyToArray(this.data,function(l){if(o>=a.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return a[o++]}),this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.updateItemToIndexCache(t,n,i,s),!0}updateItemToIndexCache(t,i,s,n){if(!this.itemToIndexCache)return;const{indexMap:a}=t,{totalPrependCount:o,totalAppendCount:r,removedIndices:l}=a,c=l.size>0,h=n.length>0;if(!c&&o===0&&r===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}let d=!1,u=0;if(c){const b=Array.from(l).sort((x,v)=>x-v);if(d=b[0]===0,d){for(let x=0;x<b.length;x++)if(b[x]!==x){d=!1;break}d&&(u=b.length)}}if(c&&!d){this.itemToIndexCache=void 0;return}const p=this.itemToIndexCache,f=o-u;if(f!==0)for(const[b,x]of p)l.has(x)?p.delete(b):p.set(b,x+f);else if(c)for(const[b,x]of p)l.has(x)&&p.delete(b);for(let b=0;b<s.length;b++){const x=s[b];p.has(x)||p.set(x,b)}const y=a.finalLength-r;for(let b=0;b<i.length;b++){const x=i[b];p.has(x)||p.set(x,y+b)}}clearPendingTransactions(){const t=this.pendingTransactions.length;return this.pendingTransactions=[],this.cachedChangeDescription=void 0,t}getPendingTransactions(){return[...this.pendingTransactions]}toJSON(){return this.data}getChangeDescription(){if(!this.hasPendingTransactions())return;if(this.cachedChangeDescription)return this.cachedChangeDescription;const{indexMap:t,prependValues:i,appendValues:s,insertionValues:n}=this.buildIndexMap(),a=new Q4(t,{prependValues:i,appendValues:s,insertionValues:n});return this.cachedChangeDescription=a,a}removeFromGroups(t,i){for(const s of t){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 t=this.data.length,i=this.collectTransactionEffects(),s=i.prependsList.flat(),n=i.appendsList.flat(),a=i.insertionsList.flat(),o=s.length,r=n.length,l=a.length,c=t-i.removedOriginalIndices.size,h=o+c+l+r,d=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,u=this.buildSpliceOperations(o,l,r,c,i.trackedInsertions,d?.desc,d?.asc),p=this.resolveUpdatedIndices(o,l,c,i.updateTracking,d?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:t,finalLength:h,spliceOps:u,removedIndices:i.removedOriginalIndices,updatedIndices:p,totalPrependCount:o,totalAppendCount:r},prependValues:s,appendValues:n,insertionValues:a}}getSortedRemovedIndices(t){const i=Array.from(t).sort((s,n)=>s-n);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const t={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:o,update:r}=i;this.applyPrepends(s,t),this.applyInsertions(a,t),this.applyAppends(n,t),this.applyRemovals(o,t),this.applyUpdates(r,t)}return{prependsList:t.prependsList,appendsList:t.appendsList,insertionsList:t.insertionsList,trackedInsertions:t.trackedInsertions,removedOriginalIndices:t.removedOriginalIndices,updatedOriginalIndices:t.updatedOriginalIndices,updateTracking:t.updateTracking}}applyPrepends(t,i){!Array.isArray(t)||t.length===0||(i.prependsList.unshift([...t]),i.virtualLength+=t.length)}applyInsertions(t,i){if(Array.isArray(t))for(const{index:s,items:n}of t)s>=0&&s<=i.virtualLength&&n.length>0&&(i.trackedInsertions.push({virtualIndex:s,items:[...n]}),i.insertionsList.push([...n]),i.virtualLength+=n.length)}applyAppends(t,i){!Array.isArray(t)||t.length===0||(i.appendsList.push([...t]),i.virtualLength+=t.length)}applyRemovals(t,i){if(!Array.isArray(t)||t.length===0)return;const s=new Set(t);if(this.removeFromGroups(i.prependsList,s),s.size>0&&this.removeFromGroups(i.insertionsList,s),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(t,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&&K.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyUpdates(t,i){if(!Array.isArray(t)||t.length===0)return;const s=new Set(t),n=this.collectUpdatedIndicesFromGroups(i.prependsList,s),a=s.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,s):[],o=s.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,s):[];s.size>0&&this.collectUpdatedOriginalIndices(s,i),i.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:o,updatedInsertionsIndices:a},s.size>0&&K.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(t,i){if(i.size===0||t.length===0)return[];const s=[];let n=0;for(const a of t){for(const o of a)i.has(o)&&(s.push(n),i.delete(o)),n++;if(i.size===0)break}return s}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let t=0;t<this.data.length;t++)this.itemToIndexCache.has(this.data[t])||this.itemToIndexCache.set(this.data[t],t)}return this.itemToIndexCache}collectUpdatedOriginalIndices(t,i){const s=this.getItemToIndexMap();for(const n of[...t]){const a=s.get(n);a!==void 0&&!i.removedOriginalIndices.has(a)&&(i.updatedOriginalIndices.add(a),t.delete(n))}}removeFromTrackedInsertions(t,i){for(let s=0;s<i.trackedInsertions.length;s++){const n=i.trackedInsertions[s],a=n.items.length,o=[];let r=0;for(;r<n.items.length;)t.includes(n.items[r])?(o.push(r+o.length),n.items.splice(r,1),i.virtualLength--):r++;o.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,n,a,o)}}adjustLaterInsertionsAfterRemoval(t,i,s,n,a){const o=a.length;for(let r=i+1;r<t.length;r++){const l=t[r];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=o),h>0&&(l.virtualIndex-=h)}}buildSpliceOperations(t,i,s,n,a,o,r){const l=[];if(t>0&&l.push({index:0,deleteCount:0,insertCount:t}),o&&o.length>0){let c=o[0],h=1;for(let d=1;d<o.length;d++){const u=o[d];o[d-1]-u===1?h++:(l.push({index:c-h+1+t,deleteCount:h,insertCount:0}),c=u,h=1)}l.push({index:c-h+1+t,deleteCount:h,insertCount:0})}if(a.length>0)for(const c of a){const h=this.countRemovalsBeforeIndex(r,t,c.virtualIndex),d=c.virtualIndex-h;l.push({index:d,deleteCount:0,insertCount:c.items.length})}return s>0&&l.push({index:t+n+i,deleteCount:0,insertCount:s}),l}countRemovalsBeforeIndex(t,i,s){if(!t||t.length===0)return 0;let n=0;for(const a of t)if(a+i<s)n++;else break;return n}resolveUpdatedIndices(t,i,s,n,a,o,r){const l=new Set;if(n)for(const c of n.updatedPrependsIndices)l.add(c);if(o.size>0){const c=Array.from(o).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+t;let f=0;for(const b of r)b.virtualIndex<=p&&(f+=b.items.length);const y=d+t-u+f;l.add(y)}}if(n){const c=t+s+i;for(const h of n.updatedAppendsIndices)l.add(c+h);if(n.updatedInsertionsIndices.length>0&&r.length>0){let h=0;for(const d of r){const u=this.countRemovalsBeforeIndex(a,t,d.virtualIndex),p=d.virtualIndex-u;for(let f=0;f<d.items.length;f++)n.updatedInsertionsIndices.includes(h)&&l.add(p+f),h++}}}return l}},ek=class gl{constructor(t){this.chart=t}subscribe(t=gl.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},gl.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=gl.DEFAULT_GROUP){const i=this.get(t);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(t=gl.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=gl.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=gl.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=gl.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return gl.chartsGroups.get(t)}};ek.chartsGroups=new Map,ek.DEFAULT_GROUP=Symbol("sync-group-default");var e$=ek,tk=class extends X{constructor(){super(...arguments),this.enabled=!1}};g([m],tk.prototype,"enabled",2),g([m],tk.prototype,"tabIndex",2);var k1={};Ws(k1,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Za,fromToMotion:()=>ui,staticFromToMotion:()=>Vr});var Za={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function ui(e,t,i,s,n,a,o){const{fromFn:r,toFn:l,applyFn:c=(f,y)=>f.setProperties(y)}=n,{nodes:h,selections:d}=LD(s),u=(f,y)=>{let b,x=0,v=0;for(const S of y){const M=f[x]===S,D={last:v>=y.length-1,lastLive:x>=f.length-1,prev:y[v-1],prevFromProps:b,prevLive:f[x-1],next:y[v+1],nextLive:f[x+(M?1:0)]},I=`${e}_${t}_${S.id}`;i.stopByAnimationId(I);let k="unknown";M?a&&o&&(k=t$(S,S.datum,a,o)):k="removed",S.transitionOut=k==="removed";const{phase:C,start:A,finish:w,delay:T,duration:O,...z}=r(S,S.datum,k,D),{phase:V,start:E,finish:_,delay:G,duration:B,...F}=l(S,S.datum,k,D),Y=w==null;i.animate({id:I,groupId:e,phase:C??V??"update",duration:O??B,delay:T??G,from:z,to:F,ease:Tr,collapsable:Y,onPlay:()=>{const Z={...A,...E,...z};c(S,Z,"start")},onUpdate(Z){c(S,Z,"update")},onStop:()=>{const Z={...A,...E,...z,...F,...w,..._};c(S,Z,"end")}}),M&&x++,v++,b=z}};let p=0;for(const f of d){const y=f.nodes(),b=y.filter(x=>!f.isGarbage(x));u(b,y),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:Tr,onStop(){f.cleanup()}}),p++}u(h,h)}function Vr(e,t,i,s,n,a,o){const{nodes:r,selections:l}=LD(s),{start:c,finish:h,phase:d}=o;i.animate({id:`${e}_${t}`,groupId:e,phase:d??"update",from:n,to:a,ease:Tr,onPlay:()=>{if(c){for(const u of r)u.setProperties(c);for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const y of p)y.setProperties(c)})}}},onUpdate(u){for(const p of r)p.setProperties(u);for(const p of l){const f=p.nodes();p.batchedUpdate(function(){for(const b of f)b.setProperties(u)})}},onStop:()=>{for(const u of r)u.setProperties({...a,...h});for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const y of p)y.setProperties({...a,...h});u.cleanup()})}}})}function t$(e,t,i,s){const n=i(e,t);return s.added.has(n)?"added":s.removed.has(n)?"removed":e.previousDatum==null&&e.datum!=null?"added":e.previousDatum!=null&&e.datum==null?"removed":"updated"}var I1={};Ws(I1,{resetMotion:()=>Xi});function Xi(e,t){const{nodes:i,selections:s}=LD(e);for(const n of s){const a=n.nodes();n.batchedUpdate(function(){for(const r of a){const l=t(r,r.datum);r.setProperties(l)}n.cleanup()})}for(const n of i){const a=t(n,n.datum);n.setProperties(a)}}var pi=class od{constructor(t,i,s=!0){this.parentNode=t,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=be.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Pr,i)?()=>new i:i}static select(t,i,s=!0){return new od(t,i,s)}static selectAll(t,i){const s=[],n=a=>{if(i(a)&&s.push(a),a instanceof Le)for(const o of a.children())n(o)};return n(t),s}static selectByClass(t,...i){return od.selectAll(t,s=>i.some(n=>s instanceof n))}static selectByTag(t,i){return od.selectAll(t,s=>s.tag===i)}createNode(t,i,s){const n=this.nodeFactory(t);return n.datum=t,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(t,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),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 o=0;o<t.length;o++){const r=t[o];let l=s(r);if(n.has(l)){const c=(a.get(l)??0)+1;a.set(l,c),l=`${l}:${c}`}n.set(l,o)}for(const[o,r]of this._nodesMap.entries()){const l=n.get(r);l==null?this.garbageBin.add(o):(o.datum=t[l],this.garbageBin.delete(o),n.delete(r))}for(const[o,r]of n.entries()){const l=t[r];this._nodesMap.set(this.createNode(l,i,r),o)}}else{const n=Math.max(t.length,this.data.length);for(let a=0;a<n;a++)a>=t.length?this.garbageBin.add(this._nodes[a]):a>=this._nodes.length?this.createNode(t[a],i):(this._nodes[a].datum=t[a],this.garbageBin.delete(this._nodes[a]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const t=this;function i(s){return t.garbageBin.has(s)?(t._nodesMap.delete(s),t.garbageBin.delete(s),s.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const t of this._nodesMap.keys())this.garbageBin.add(t);return this._nodesMap.clear(),this}isGarbage(t){return this.garbageBin.has(t)}each(t){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const n of i.entries())t(n[1],n[1].datum,n[0])}),this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const i=this._nodes[t];yield{node:i,datum:i.datum,index:t}}}select(t){return od.selectAll(this.parentNode,t)}selectByClass(t){return od.selectByClass(this.parentNode,t)}selectByTag(t){return od.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}batchedUpdate(t){this.parentNode.batchedUpdate(t)}},Kn=class extends Jc{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new le(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(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:i,y1:s,x2:n,y2:a}=this;return kr(e,t,i,s,n,a,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:s,y1:n,x2:a,y2:o}=this;if(s===a){const{strokeWidth:r}=this,l=Math.round(s*i)/i+Math.trunc(r*i)%2/(i*2);s=l,a=l}else if(n===o){const{strokeWidth:r}=this,l=Math.round(n*i)/i+Math.trunc(r*i)%2/(i*2);n=l,o=l}t.beginPath(),t.moveTo(s,n),t.lineTo(a,o),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=jt("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};Kn.className="Line",g([$()],Kn.prototype,"x1",2),g([$()],Kn.prototype,"y1",2),g([$()],Kn.prototype,"x2",2),g([$()],Kn.prototype,"y2",2);var ah=class{constructor(){this.enabled=!0}};g([m],ah.prototype,"enabled",2),g([m],ah.prototype,"stroke",2),g([m],ah.prototype,"strokeWidth",2),g([m],ah.prototype,"strokeOpacity",2);var Un=class extends X{constructor(){super(...arguments),this.border=new ah}};g([m],Un.prototype,"border",2),g([m],Un.prototype,"color",2),g([m],Un.prototype,"cornerRadius",2),g([m],Un.prototype,"fill",2),g([m],Un.prototype,"fillOpacity",2),g([m],Un.prototype,"fontStyle",2),g([m],Un.prototype,"fontWeight",2),g([m],Un.prototype,"fontSize",2),g([m],Un.prototype,"fontFamily",2),g([m],Un.prototype,"padding",2);var Yn=class extends Un{constructor(){super(...arguments),this.enabled=!1,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:a}=this;let o;if(n!=null&&(o??(o=e(n,s))),a!=null){let r=this._cachedFormatter;(r?.type!==t||r?.format!==a)&&(r={type:t,format:a,formatter:Du.getFormatter(t,a)},this._cachedFormatter=r),o??(o=r.formatter?.(i))}return o==null||De(o)?o:String(o)}};g([m],Yn.prototype,"enabled",2),g([m],Yn.prototype,"formatter",2),g([m],Yn.prototype,"format",2),g([m],Yn.prototype,"itemStyler",2);function Au(e){const{enabled:t=!1,stroke:i}=e?.border??{},n=e?.fill!=null||t&&i!=null?e?.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:o=0,right:r=0,top:l=0}=n;return{bottom:a,left:o,right:r,top:l}}}var ik=class{constructor(){this.moduleMap=new Map}modules(){return this.moduleMap.values()}addModule(e,t){if(this.moduleMap.has(e))throw new Error(`AG Charts - module already initialised: ${e}`);this.moduleMap.set(e,t)}removeModule(e){this.moduleMap.get(e)?.destroy?.(),this.moduleMap.delete(e)}getModule(e){return this.moduleMap.get(e)}isEnabled(e){return this.moduleMap.has(e)}mapModules(e){return Array.from(this.moduleMap.values(),e)}destroy(){for(const e of this.moduleMap.values())e?.destroy?.();this.moduleMap.clear()}},No=class extends Jc{constructor(e={}){super(e),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 le(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;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:o,horizontal:r}=this,{globalAlpha:l}=t;o!=null&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,s),t.lineTo(n,s),t.lineTo(n,a),t.lineTo(i,a),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:d,endLine:u}=this;if(!!((d||u)&&c&&h)){const{lineDash:f,lineDashOffset:y,lineCap:b,lineJoin:x}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,f&&t.setLineDash([...f]),y&&(t.lineDashOffset=y),b&&(t.lineCap=b),x&&(t.lineJoin=x),t.beginPath(),d&&(t.moveTo(i,s),r?t.lineTo(i,a):t.lineTo(n,s)),u&&(t.moveTo(n,a),r?t.lineTo(n,s):t.lineTo(i,a)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};No.className="Range",g([$()],No.prototype,"x1",2),g([$()],No.prototype,"y1",2),g([$()],No.prototype,"x2",2),g([$()],No.prototype,"y2",2),g([$()],No.prototype,"startLine",2),g([$()],No.prototype,"endLine",2),g([$()],No.prototype,"horizontal",2);function A1(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function C1(e,t){const i=A1(e);if(i==null)return!1;const s=mt.is(t)||Lo.is(t),n=a=>FM(a,s)&&!Number.isNaN(t.convert(a,{clamp:!0}));if(e.type==="range"){const[a,o]=i;return n(a)&&n(o)}else return n(i)}var i$={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}},s$={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}},n$={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}},a$={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}},oh=class extends Un{constructor(){super(...arguments),this.enabled=void 0,this.padding=5}};g([m],oh.prototype,"enabled",2),g([m],oh.prototype,"padding",2),g([m],oh.prototype,"text",2),g([m],oh.prototype,"position",2),g([m],oh.prototype,"rotation",2),g([m],oh.prototype,"parallel",2);var Os=class extends X{constructor(){super(),this.id=Ii(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new oh,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new Le({name:this.id}),this.lineGroup=new Le({name:this.id}),this.labelGroup=new Le({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new No),this.crossLineLabel=this.labelGroup.appendChild(new bu),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(e){const{enabled:t,type:i,data:s,scale:n}=this;if(!n||!t||!e||!C1(this,n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const a=i==="range";a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(e){if(this.data=void 0,!e)return;const{type:t,range:i,value:s,scale:n,clippedRange:a,strokeWidth:o=0}=this;if(!n)return;const r=n.bandwidth??0,l=n.step??0,c=n instanceof Ya?(l-r)/2:0;let[h,d]=Tt(a);h-=r,d+=r;let u,p,f,y;if(t==="line"){const b=r/2;if(u=n.convert(s)+b,p=Number.NaN,f=n.convert(s,{clamp:!0})+b,y=Number.NaN,f>=d||f<=h)return}else if(i){const[b,x]=i,[v,S]=x1(b,x);if(u=n.convert(b,{alignment:v}),p=n.convert(x,{alignment:S}),f=n.convert(b,{clamp:!0,alignment:v}),y=n.convert(x,{clamp:!0,alignment:S}),f>y&&([f,y]=[y,f],[u,p]=[p,u]),f>=d||y<=h)return;Number.isFinite(u)&&(f-=c),Number.isFinite(p)&&(p+=r,y+=r+c)}else return;f=Bc(f,a),y=Bc(y,a),u-c>=f&&(u-=c),p+c<=y&&(p+=c),this.startLine=o>0&&u>=f&&u<=f+c,this.endLine=o>0&&p>=y-r-c&&p<=y,this.data=[f,y],this.label.enabled===!1||this.label.text}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:s}=this,n=Number.isFinite(i)?i-t:0;let a;switch(e){case"top":case"bottom":a=new le(t,e==="top"?0:-s,n,s);break;case"left":case"right":a=new le(e==="left"?0:-s,t,s,n)}this.updateRangeNode(a);const{label:o}=this;o.enabled!==!1&&o.text&&(this.updateLabel(),this.positionLabel(a))}updateRangeNode(e){const{type:t,position:i,crossLineRange:s,startLine:n,endLine:a,fill:o,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d}=this;s.x1=e.x,s.x2=e.x+e.width,s.y1=e.y,s.y2=e.y+e.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=a,s.fill=t==="range"?o:void 0,s.fillOpacity=r??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=d}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fill=t.color,e.text=t.text,e.textAlign="center",e.textBaseline="middle",e.setFont(t),e.setBoxing(t))}get anchor(){const e=this.position==="left"||this.position==="right",t=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return t?(e?n$:a$)[i]:(e?i$:s$)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:s}=this;t.rotation=lt(i.rotation??0);const n=t.getBBox();if(!n)return;const{width:a,height:o}=n,r=i.padding+a/2,l=i.padding+o/2,c=e.x+e.width*(s.rangeH+1)/2-r*s.labelH,h=e.y+e.height*(s.rangeV+1)/2-l*s.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new bu;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=lt(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(e){const{label:t,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:a}=s,o=t.padding+n,r=t.padding+a,l=this.position==="left"||this.position==="right";l&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,o):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,o))),l||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,r):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,r)))}};Os.className="CrossLine",g([m],Os.prototype,"enabled",2),g([m],Os.prototype,"type",2),g([m],Os.prototype,"range",2),g([m],Os.prototype,"value",2),g([m],Os.prototype,"defaultColorRange",2),g([m],Os.prototype,"fill",2),g([m],Os.prototype,"fillOpacity",2),g([m],Os.prototype,"stroke",2),g([m],Os.prototype,"strokeWidth",2),g([m],Os.prototype,"strokeOpacity",2),g([m],Os.prototype,"lineDash",2),g([m],Os.prototype,"label",2);var Xx=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};g([m],Xx.prototype,"enabled",2),g([m],Xx.prototype,"width",2),g([m],Xx.prototype,"style",2);var rh=class extends X{};g([m],rh.prototype,"placement",2),g([m],rh.prototype,"step",2),g([m],rh.prototype,"values",2),g([m],rh.prototype,"minSpacing",2),g([m],rh.prototype,"maxSpacing",2);var Ot=class extends X{constructor(){super(...arguments),this.enabled=!0,this.border=new ah,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(e,t,i,s){const{formatter:n,format:a}=this,{type:o,value:r,domain:l,boundSeries:c}=t,h=t.type==="number"?t.fractionDigits:void 0,d=t.type==="date"?t.unit:void 0;let u;if(n!=null){const p=t.type==="date"?t.step:void 0,f=t.type==="number"?t.visibleDomain:void 0;u=e(n,{value:r,index:i,domain:l,fractionDigits:h,unit:d,step:p,boundSeries:c,visibleDomain:f})}if(a!=null&&u==null){const{specifier:p,dateStyle:f="long",truncateDate:y}=s??{},b=`${f}:${y??"none"}`;let x=this._formatters[b];const v=Du.mergeSpecifiers(p,a);(x?.type!==o||x?.unit!==d||!Ht(x?.mergedFormat,v))&&(x={type:o,mergedFormat:v,unit:d,formatter:Du.getFormatter(o,v,d,f,{truncateDate:y})},this._formatters[b]=x),u=x.formatter?.(r,h)}return u==null||De(u)?u:String(u)}};g([m],Ot.prototype,"enabled",2),g([m],Ot.prototype,"border",2),g([m],Ot.prototype,"cornerRadius",2),g([m],Ot.prototype,"fill",2),g([m],Ot.prototype,"fillOpacity",2),g([m],Ot.prototype,"fontStyle",2),g([m],Ot.prototype,"fontWeight",2),g([m],Ot.prototype,"fontSize",2),g([m],Ot.prototype,"fontFamily",2),g([m],Ot.prototype,"wrapping",2),g([m],Ot.prototype,"truncate",2),g([m],Ot.prototype,"spacing",2),g([m],Ot.prototype,"minSpacing",2),g([m],Ot.prototype,"color",2),g([m],Ot.prototype,"rotation",2),g([m],Ot.prototype,"avoidCollisions",2),g([m],Ot.prototype,"mirrored",2),g([m],Ot.prototype,"padding",2),g([m],Ot.prototype,"parallel",2),g([m],Ot.prototype,"itemStyler",2),g([m],Ot.prototype,"formatter",2),g([m],Ot.prototype,"format",2);var qx=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};g([m],qx.prototype,"enabled",2),g([m],qx.prototype,"width",2),g([m],qx.prototype,"stroke",2);var lh=class extends X{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};g([m],lh.prototype,"enabled",2),g([m],lh.prototype,"width",2),g([m],lh.prototype,"size",2),g([m],lh.prototype,"stroke",2);var Xa=class extends X{constructor(){super(...arguments),this.caption=new zt,this.enabled=!1,this.spacing=zt.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};g([m],Xa.prototype,"enabled",2),g([m],Xa.prototype,"text",2),g([m],Xa.prototype,"spacing",2),g([m],Xa.prototype,"fontStyle",2),g([m],Xa.prototype,"fontWeight",2),g([m],Xa.prototype,"fontSize",2),g([m],Xa.prototype,"fontFamily",2),g([m],Xa.prototype,"color",2),g([m],Xa.prototype,"wrapping",2),g([m],Xa.prototype,"formatter",2);var w1=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(w1||{});function o$(e){const[t,i]=Tt(e.range),s=Math.floor(t),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var sk=Math.PI*2,r$=sk/2;function l$(e,t){return Math.abs(t-e)<r$?t:e>t?t+sk:t-sk}function c$(e){const{min:t,max:i}=e,s=l=>l<t||l>i;return{tick:{fromFn(l,c,h){let{x1:d,x2:u,y1:p,y2:f}=l,y=l.opacity;return(h==="added"||s(c.offset))&&({x1:d,x2:u,y1:p,y2:f}=c,y=0),{x1:d,x2:u,y1:p,y2:f,opacity:y,phase:Za[h]}},toFn(l,c,h){const{x1:d,x2:u,y1:p,y2:f}=c;let y=1;return h==="removed"&&(y=0),{x1:d,x2:u,y1:p,y2:f,opacity:y}},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:Za.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:f,rotationCenterY:y,rotation:b}=d,x=l.opacity;return h==="removed"||s(d.y)?b=c.rotation:(h==="added"||s(l.datum.y))&&({x:u,y:p,rotationCenterX:f,rotationCenterY:y,rotation:b}=c,x=0),{x:u,y:p,rotationCenterX:f,rotationCenterY:y,rotation:b,opacity:x,phase:Za[h]}},toFn(l,c,h){const{x:d,y:u,rotationCenterX:p,rotationCenterY:f}=c;let y=0,b=1;return h==="added"?y=c.rotation:h==="removed"?(b=0,y=c.rotation):y=l$(l.previousDatum?.rotation??c.rotation,c.rotation),{x:d,y:u,rotationCenterX:p,rotationCenterY:f,rotation:y,opacity:b,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:d}=l;return{translationX:h,translationY:d,phase:Za.updated}},toFn(l,c){const{translationX:h,translationY:d}=c;return{translationX:h,translationY:d}}}}}function h$(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function Qx(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function L1(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:a}=t;return{x1:i,x2:s,y1:n,y2:a}}}function d$(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:a}=t;return{x:i,y:n,width:s-i,height:a-n}}}var N1=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(N1||{});function T1(e,t){return e.domain===t.domain&&e.rangeExtent===t.rangeExtent&&e.nice[0]===t.nice[0]&&e.nice[1]===t.nice[1]&&e.gridLength===t.gridLength&&e.visibleRange[0]===t.visibleRange[0]&&e.visibleRange[1]===t.visibleRange[1]&&e.scrollbarKey===t.scrollbarKey&&e.initialPrimaryTickCount?.unzoomed===t.initialPrimaryTickCount?.unzoomed&&e.initialPrimaryTickCount?.zoomed===t.initialPrimaryTickCount?.zoomed}function O1(e,t,i){const s=e.bandwidth??0,a=((e.step??0)-s)/2,o=e.convert(i),r=o-a,l=o+s+a;return[o,Bc(r,t),Bc(l,t)]}var Wl=class l_{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new rh,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new Xa,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 Le({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new mu({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new mu({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Le({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new ds({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new Le({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new Le({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new mu({name:`${this.id}-CrossLines-Range`,zIndex:6}),this.crossLineLineGroup=new mu({name:`${this.id}-CrossLines-Line`,zIndex:10}),this.crossLineLabelGroup=new mu({name:`${this.id}-CrossLines-Label`,zIndex:15}),this.tickLabelGroupSelection=pi.select(this.tickLabelGroup,bu,!1),this.line=new qx,this.tick=new lh,this.gridLine=new Xx,this.label=this.createLabel(),this.defaultTickMinSpacing=l_.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 pt,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new lM(()=>{const{direction:s,boundSeries:n}=this;return Ks(n.flatMap(a=>a.getFormatterContext(s)))}),this.moduleMap=new ik,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(t){const{CrossLineConstructor:i}=this.constructor;for(const s of this._crossLines)this.detachCrossLine(s);this._crossLines=t.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(t){}onMouseMove(t){const s=this.tickLabelGroup.pickNode(t.currentX,t.currentY)?.datum,{textUntruncated:n=void 0}=s??{};n?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:t.currentX,canvasY:t.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(t){this.crossLineRangeGroup.appendChild(t.rangeGroup),this.crossLineLineGroup.appendChild(t.lineGroup),this.crossLineLabelGroup.appendChild(t.labelGroup)}detachCrossLine(t){t.rangeGroup.remove(),t.lineGroup.remove(),t.labelGroup.remove()}destroy(){this.moduleMap.destroy(),this.cleanup.flush()}setScaleRange(t){const{range:i,scale:s}=this,n=(i[1]-i[0])/(t[1]-t[0]),a=n*t[0],o=i[0]-a;s.range=[o,o+n]}updateScale(){const{range:[t,i]}=this;this.setScaleRange(this.visibleRange);for(const s of this.crossLines)s.clippedRange=[t,i]}setCrossLinesVisible(t){this.crossLineRangeGroup.visible=t,this.crossLineLineGroup.visible=t,this.crossLineLabelGroup.visible=t}attachAxis(t){t.gridNode.appendChild(this.gridGroup),t.axisNode.appendChild(this.axisGroup),t.labelNode.appendChild(this.labelGroup),t.crossLineRangeNode.appendChild(this.crossLineRangeGroup),t.crossLineLineNode.appendChild(this.crossLineLineGroup),t.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.crossLineRangeGroup.remove(),this.crossLineLineGroup.remove(),this.crossLineLabelGroup.remove()}attachLabel(t){this.labelGroup.append(t)}inRange(t,i=0){const[s,n]=Tt(this.range);return t>=s-i&&t<=n+i}getRangeOverflow(t){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[a,o]=Tt([i[0]-n*s[0],i[0]-n*s[0]+n]);return t<a?t-a:t>o?t-o:0}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange();for(const s of this.crossLines)this.initCrossLine(s)}onGridVisibilityChange(){}createLabel(){return new Ot}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.gridLine.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(t,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,{...t,...n}));const o=re(a,i,n);return{border:o.border,color:o.color,cornerRadius:o.cornerRadius,fill:o.fill,fillOpacity:o.fillOpacity,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,padding:o.padding,spacing:o.spacing}}getTickSize(t=this.tick){return t.enabled?t.size:0}getTickSpacing(t=this.tick){if(!t.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:t,boundSeries:i,direction:s}=this,a=(t?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(s));this.setDomains(...a)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...t){let i,s;if(t.length>0){const n=this.scale.normalizeDomains(...t);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(t,i="none"){const{dataDomain:{domain:s},range:n,scale:a,gridLength:o}=this,r=xo(n),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let d;if(h==null||!T1(h,{domain:s,rangeExtent:r,nice:c,gridLength:o,visibleRange:l,initialPrimaryTickCount:t,scrollbarKey:i})){const u=a.range;this.setScaleRange([0,1]);const p=c.map(f=>f?0:2);d=this.calculateTickLayout(s,p,[0,1],t),a.range=u,this.unzoomedTickLayoutCache={domain:s,rangeExtent:r,nice:c,gridLength:o,visibleRange:l,initialPrimaryTickCount:t,scrollbarKey:i,tickLayout:d}}else d=h.tickLayout;return this.updateScale(),a.domain=d.niceDomain,{unzoomedTickLayout:d,domain:a.domain}}calculateLayout(t,i){this.chartLayout=i;const s=this.getScrollbarLayoutCacheKey(i),{visibleRange:n}=this,a=n[0]===0&&n[1]===1,{unzoomedTickLayout:o,domain:r}=this.calculateDomain(t,s),l=this.getDomainExtentsNice();let c;if(a)c=o;else{const{range:y,gridLength:b}=this,x=xo(y),v=l.map(M=>M?1:2),{tickLayoutCache:S}=this;S==null||!T1(S,{domain:r,rangeExtent:x,nice:l,gridLength:b,visibleRange:n,initialPrimaryTickCount:t,scrollbarKey:s})?(c=this.calculateTickLayout(r,v,n,t),this.tickLayoutCache={domain:r,rangeExtent:x,nice:l,gridLength:b,visibleRange:n,initialPrimaryTickCount:t,scrollbarKey:s,tickLayout:c}):c=S.tickLayout}const{rawTickCount:h=0,fractionDigits:d,bbox:u}=c,p=o.rawTickCount??0,f=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:f,bbox:u}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(t){const i=t?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updateCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.update(t)}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:a}=this,o=Math.floor(a.x),r=Math.floor(a.y);n.setProperties({translationX:o,translationY:r}),t.setProperties({translationX:o,translationY:r}),i.setProperties({translationX:o,translationY:r}),s.setProperties({translationX:o,translationY:r})}tickFormatter(t,i,s,n,a,o="long"){const{moduleCtx:r,label:l}=this,{formatManager:c}=r,h=s?this.primaryLabel:void 0,d=this.tickFormatParams(t,i,n,a),u=this.formatterBoundSeries.get();let p,f,y;if(d.type==="number")p=d.fractionDigits;else if(d.type==="date"){const{unit:I,step:k,epoch:C}=d;f={unit:I,step:k,epoch:C},y=d.truncateDate}const b=this.uncachedCallWithContext.bind(this),x={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:t,boundSeries:u},v=h??l,S=s?l.format:void 0,{allowNull:M}=this,D={specifier:Du.mergeSpecifiers(h?.format,l.format),truncateDate:y,allowNull:M};return(I,k)=>{const C=this.datumFormatParams(I,x,p,f,o);return C.value=I,v.formatValue(b,C,k,{specifier:S,dateStyle:o,truncateDate:y})??c.format(b,C,D)??c.defaultFormat(C,D)}}formatDatum(t,i,s,n,a,o,r,l,c,h,d){if(i==null&&!d)return"";const{moduleCtx:u,dataDomain:p}=this;l??(l=p.domain);const{formatManager:f}=u,y=this.formatterBoundSeries.get();let b;switch(s){case"crosshair":case"annotation-label":b=this.layout.label.fractionDigits+1;break;case"series-label":b=2;break;case"tooltip":b=3;break;case"legend-label":b=void 0;break}const x=this.datumFormatParams(i,{source:s,datum:o,seriesId:n,legendItemName:a,key:r,property:this.getFormatterProperty(),domain:l,boundSeries:y},b,void 0,"long"),{type:v,value:S}=x,M=this.createCallWithContext(t),D=c?.formatValue(M,v,S,h??x)??f.format(M,x,{allowNull:d})??this.label.formatValue(M,x,Number.NaN)??f.defaultFormat(x);return De(D)?D:String(D)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}hasVisibleSeries(){return this.boundSeries.some(t=>t.isEnabled())}clipTickLines(t,i,s,n){this.tickLineGroup.setClipRect(new le(t,i,s,n))}clipGrid(t,i,s,n){this.gridGroup.setClipRect(new le(t,i,s,n))}getFormatterProperty(){const{direction:t,boundSeries:i}=this;let s=t;for(const n of i){const a=n.resolveKeyDirection(t);if(a!==t){s=a;break}}return s}getTitleFormatterParams(t){const{direction:i}=this,s=this.formatterBoundSeries.get();return{domain:t,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(t){return{domain:[...t.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 5}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:t}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:mt.is(t)||Lo.is(t),getCanvasBounds:()=>Wt.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=>t.invert(i,!0),scaleInvertNearest:i=>t.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(t){if(!Ya.is(this.scale))return;const{scale:i,range:s,id:n}=this,a=i.invert(this.isVertical()?t.y:t.x,!0),[o,r,l]=O1(i,s,a);return{id:n,value:a,band:[r,l],position:o}}measureBand(t){if(!Ya.is(this.scale))return;const[,i,s]=O1(this.scale,this.range,t);return{band:[i,s]}}isVertical(){return this.direction==="y"}isReversed(){return this.reverse}cachedCallWithContext(t,i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],t,i)}uncachedCallWithContext(t,i){const{chartService:s}=this.moduleCtx;return ls([this,s],t,i)}createCallWithContext(t){const{chartService:i}=this.moduleCtx;return(s,n)=>ls([t,this,i],s,n)}};Wl.defaultTickMinSpacing=50,Wl.CrossLineConstructor=Os,g([m],Wl.prototype,"nice",2),g([m],Wl.prototype,"reverse",2),g([m],Wl.prototype,"interval",2),g([m],Wl.prototype,"title",2),g([Xt((e,t,i)=>e.onGridLengthChange(t,i))],Wl.prototype,"gridLength",2);var nk=Wl,ak=class extends Ot{constructor(){super(...arguments),this.autoRotateAngle=335}};g([m],ak.prototype,"autoRotate",2),g([m],ak.prototype,"autoRotateAngle",2);var Cu=class c_ extends Ya{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof c_}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let i;const s=new Set;let n=!0;for(const a of t){const o=a.domain;s.has(o)||(s.add(o),i==null?i=P1(o):(n&&(n=u$(o,i)),i=P1([...i,...o])))}return i??(i=[]),{domain:i,animatable:n}}toDomain(t){}invert(t,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,t-s));return i||t===this.ordinalRange(n)?this.domain[n]:void 0}ticks(t,i=this.domain,s){const{bands:n}=this;let{tickCount:a}=t;if(a===0){const y=n.length>1?1:0;return{ticks:n[y]?[n[y]]:[],count:void 0,firstTickIndex:y}}let o=a!=null&&a!==0?Math.trunc(n.length/a):1;if(o=ky(o),o<=1)return XN(i,!1,s);a=Math.trunc(n.length/o);const r=o*a,l=ky(Math.trunc((n.length-r)/2)),c=ae(0,Math.floor((s?.[0]??0)*n.length),n.length),h=ae(0,Math.ceil((s?.[1]??1)*n.length),n.length),d=Math.floor((c-l)/o)*o+l,u=Math.ceil((h-l)/o)*o+l,p=[];for(let y=d;y<u;y+=o)y>=0&&y<n.length&&p.push(n[y]);let f=p.length>0?this.findIndex(p[0]):void 0;return f!=null&&(f=Math.floor((f-l)/o)),{ticks:p,count:void 0,firstTickIndex:f}}findIndex(t){const{index:i,indexInitialized:s}=this;if(!s){const{domain:n}=this;for(let a=0;a<n.length;a++)i.set(Ui(n[a]),a);this.indexInitialized=!0}return i.get(Ui(t))}};function P1(e){let t;const i=new Set;for(const s of e){const n=Ui(s),a=i.size;i.add(n),i.size!==a?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function u$(e,t){let i=-1;for(const s of e){const n=t.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}var Jx=new Date(1970,0,4),wu=class h_ extends mt{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof h_}toDomain(t){return new Date(t)}convert(t,i){return super.convert(typeof t=="number"?t:t?.valueOf()??Number.NaN,i)}invert(t){return new Date(super.invert(t))}niceDomain(t,i=this.domain){if(i.length<2)return[];let[s,n]=i;const a=4,o=this.getPixelRange();for(let r=0;r<a;r++){const[l,c]=g$(s,n,t,o);if(Ui(s)===Ui(l)&&Ui(n)===Ui(c))break;s=l,n=c}return[s,n]}ticks(t,i=this.domain,s=[0,1],{extend:n=!1}={}){const{nice:a,interval:o,tickCount:r=mt.defaultTickCount,minTickCount:l,maxTickCount:c}=t;if(i.length<2)return;const h=i.map(Ui),d=h[0],u=h.at(-1);if(o!=null){const b=this.getPixelRange();return{ticks:E1({start:d,stop:u,interval:o,availableRange:b,visibleRange:s,extend:n})??p$({start:d,stop:u,tickCount:r,minTickCount:l,maxTickCount:c,visibleRange:s,extend:n}),count:void 0}}else{if(a.every(Boolean)&&r===2)return{ticks:i,count:void 0};if(a.every(Boolean)&&r===1)return{ticks:i.slice(0,1),count:void 0}}const p=au(d,u,r,l,c,{weekStart:Jx});if(p==null)return;const f=Gn(p,new Date(d),new Date(u),{visibleRange:s,extend:n}),y=dx(p,new Date(d),new Date(u),{visibleRange:s,extend:n});return{ticks:f,count:void 0,firstTickIndex:y,timeInterval:p}}};function p$({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:a,extend:o}){const r=au(e,t,i,s,n,{weekStart:Jx});return r?Gn(r,new Date(e),new Date(t),{visibleRange:a,extend:o}):[]}function E1({start:e,stop:t,interval:i,availableRange:s,visibleRange:n,extend:a}){if(!i)return[];if(We(i)||typeof i=="string"){const d=Gn(i,new Date(e),new Date(t),{visibleRange:n,extend:a});return Rl(d.length,s)?void 0:d}const o=Math.abs(i);if(Rl(Math.abs(t-e)/o,s))return;const r=_g.findLast(d=>o%d.duration===0);if(r){const{timeInterval:d,step:u,duration:p}=r,f={...d,step:u*ja(d)*Math.round(o/p),epoch:ux(d,{weekStart:Jx})};return Gn(f,new Date(e),new Date(t),{visibleRange:n,extend:a})}let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return h}function g$(e,t,i,s){const{interval:n}=i,a=Math.min(Ui(e),Ui(t)),o=Math.max(Ui(e),Ui(t));let r;if(We(n)||typeof n=="string")r=n;else{let d;typeof n=="number"&&(d=(o-a)/Math.max(n,1),Rl(d,s)&&(d=void 0)),d??(d=i.tickCount??mt.defaultTickCount),r=au(a,o,d,i.minTickCount,i.maxTickCount,{weekStart:Jx})}if(r==null)return[e,t];const l=Gn(r,new Date(a),new Date(o),{extend:!0});if(l==null||l.length<2)return[e,t];const c=l[0],h=l.at(-1);return e<=t?[c,h]:[h,c]}var f$=1e3,$l=class d_ extends Lo{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=mt.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof d_}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this.isReversed=R1(t))}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(t=>t.valueOf())),this._numericBands}getUniformityCache(t){const{bands:i}=this,s=i.length;if(!t||t[0]===0&&t[1]===1)return s>f$&&this._uniformityCache===void 0&&(this._uniformityCache=g1(i)),this._uniformityCache;const n=Math.floor(t[0]*s),a=Math.min(Math.ceil(t[1]*s),s-1);return g1(i,n,a)}normalizeDomains(...t){const i=t.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 o=a.domain,r,l=!1;return a.sortMetadata?.sortOrder===void 0?r=Uy(o):(r=a.sortMetadata.sortOrder,l=a.sortMetadata.isUnique??!1),r===-1?o=o.slice().reverse():r==null&&(o=l?o.slice().sort((c,h)=>c.valueOf()-h.valueOf()):Ky(o.slice())),{domain:o,animatable:!0}}return{domain:Ky(i.map(a=>a.domain).flat()),animatable:!0}}ticks(t,i,s=[0,1],{extend:n=!1,dropInitial:a=!1}={}){const{interval:o,maxTickCount:r,tickCount:l=r}=t,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(s=[1-s[1],1-s[0]]),this.refresh(),o==null){const{ticks:S,tickOffset:M,tickEvery:D}=this.getDefaultTicks(i,l,s,n);let I=S.length>0?this.findIndex(S[0]):void 0;return I=I==null?void 0:Math.floor((I-M)/D),{ticks:S,count:void 0,firstTickIndex:I}}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,f]=this.range,y=Math.abs(f-p),b=E1({start:d,stop:u,interval:o,availableRange:y,visibleRange:s,extend:n})??this.getDefaultTicks(i,l,s,n).ticks,x=[];let v=-1;for(const S of b){const M=this.findIndex(S,1)??-1,D=M===v;v=M,!(a&&M===0)&&M!==-1&&!D&&x.push(c[M])}return{ticks:x,count:void 0,firstTickIndex:void 0}}stepTicks(t,i,s=[0,1],n=!0){const a=i?this.bandDomainIndices(i):void 0,o=this.ticksEvery(a,s,t,0,!1),r=o.at(-1),l=n&&t>1?a?.[1]:void 0,c=l!=null&&r!=null?this.findIndex(r):void 0;return c!=null&&l!=null&&l-c<t&&o.pop(),o}bandCount(t=[0,1]){const{domain:i}=this,s=Math.floor(t[0]*i.length);return Math.ceil(t[1]*i.length)-s}getDefaultTicks(t,i,s,n){const{bands:a}=this,o=Math.ceil(a.length/i),r=Math.floor(o/2),l=t?this.bandDomainIndices(t):void 0;return{ticks:this.ticksEvery(l,s,o,r,n),tickOffset:r,tickEvery:o}}bandDomainIndices(t){const i=R1(t),s=this.findIndex(t[i?t.length-1:0],1)??0,n=this.findIndex(t[i?0:t.length-1],1)??this.bands.length-1;return[s,n]}ticksEvery([t,i]=[0,this.bands.length],s,n,a,o){const{bands:r}=this,l=t,c=i-t+1;let h=l+Math.floor(s[0]*c),d=l+Math.ceil(s[1]*c);o&&(h-=n,d+=n),h=Math.max(h,0),d=Math.min(d,r.length);let u;if(n<=1)u=r.slice(h,d);else{u=[];for(let p=h;p<d;p+=1)(p-l+a)%n===0&&u.push(r[p])}return u}};function R1(e){return e.length>0&&e[0]>e.at(-1)}var m$=1e3,ok=5e7,Kl=class u_ extends Lo{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=12,this._domain=[],this._bands=void 0}static is(t){return t instanceof u_}static supportsInterval(t,i){return z1(t,i)}set domain(t){t!==this._domain&&(this._domain=t,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(t){this._interval!==t&&(this._interval=t,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 t=this._encodingParams;this._bands=this._encodedBands.map(i=>zM(i,t))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const t=this._encodingParams;this._numericBands=this._encodedBands.map(i=>Lr(i,t))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:t,interval:i}=this;if(t.length<2||i==null){this._encodedBands=[];return}const s=this.getCachedBandRange();if(s==null){this._encodedBands=[];return}const[n,a]=s,o={visibleRange:[0,1],extend:!1};if(Fg(i,n,a,o)>ok){K.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:r,encodingParams:l}=RM(i,n,a,o);this._encodedBands=r,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(t){const i=this.getBandCountForUpdate();if(!t||t[0]===0&&t[1]===1){if(i>m$&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=Lr(this._encodedBands[0],this._encodingParams),n=Lr(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=Lr(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:Lr(this._encodedBands[1],this._encodingParams)-s}}return{isUniform:!1}}normalizeDomains(...t){return u1(...t)}getCachedBandRange(){const{domain:t,interval:i}=this;if(!(t.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:en(i,t[0]),stop:en(i,t[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:t}=this;if(t!=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()),o=Math.max(s.valueOf(),n.valueOf()),r=cx(t,new Date(o)).valueOf();this._domainBoundaries={d0:a,dNext:r}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const t=Lr(this._encodedBands[0],this._encodingParams),i=Lr(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:t,intervalMs:i-t}}return this._linearParams}isLinearUnit(){const t=this._encodingParams?.unit;return t==="millisecond"||t==="second"||t==="minute"||t==="hour"}findIndex(t,i=0){if(t==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(t,i);const{firstBandTime:a,intervalMs:o}=n,r=t.valueOf(),l=(r-a)/o;let c=i===1?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,s-1)),this.isLinearUnit()){if(i===1){if(a+c*o<r&&c===s-1)return}else if(a+c*o>r&&c===0)return;return c}const h=this.numericBands;if(i===1){for(;c>0&&h[c-1]>=r;)c--;for(;c<s-1&&h[c]<r;)c++;if(h[c]<r)return}else{for(;c<s-1&&h[c+1]<=r;)c++;for(;c>0&&h[c]>r;)c--;if(h[c]>r)return}return c}convert(t,i){this.refresh(),t instanceof Date||(t=new Date(t));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 o=t.valueOf();if(o<a.d0||o>=a.dNext)return Number.NaN}}return super.convert(t,i)}calculateBands(t,i,s=!1){if(t===this.domain&&i[0]===0&&i[1]===1&&!s&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(t.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(!z1(t,n,a))return{bands:[],firstBandIndex:void 0};const o=t===this.domain?this.getCachedBandRange():rk(t,n);if(o==null)return{bands:[],firstBandIndex:void 0};const[r,l]=o;if(Fg(n,r,l,a)>ok)return K.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const c=Gn(n,r,l,a),h=dx(n,r,l,a);return{bands:c,firstBandIndex:h}}ticks({interval:t},i=this.domain,s=[0,1],{extend:n=!1}={}){if(i.length<2)return;let a,o,r;if(i===this.domain&&!n?({bands:a}=this.calculateBands(i,[0,1],!1),r=zG(a,!1,s),o=r[0]):{bands:a,firstBandIndex:o}=this.calculateBands(i,s,n),t==null)return{ticks:a,count:void 0,firstTickIndex:o};const l=this.interval?cs(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(We(t)||typeof t=="string")d=Gn(t,i[0],i[1],{extend:!0,visibleRange:s}),u=0,p=d.length-1;else{const M=r?r[0]:0,D=r?r[1]:a.length-1;d=a,u=Dr(M,D,I=>a[I].valueOf()<=c)??M,p=Dr(M,D,I=>a[I].valueOf()<=h)??D}const f=[];let y;for(let M=u;M<=p;M++){const D=d[M].valueOf(),I=Dr(0,a.length-1,C=>a[C].valueOf()<=D),k=I!=null&&I!=y?a[I]:void 0;y=I,k!=null&&D-k.getTime()<=l&&f.push(k)}let b,x;if(this.interval){const M=rk([new Date(c),new Date(h)],this.interval);b=M[0].valueOf(),x=M[1].valueOf()}else b=c,x=h;let v=Hc(0,f.length-1,M=>f[M].valueOf()>=b)??0,S=Dr(0,f.length-1,M=>f[M].valueOf()<=x)??f.length-1;return n&&(v=Math.max(v-1,0),S=Math.min(S+1,f.length-1)),{ticks:f.slice(v,S+1),count:f.length,firstTickIndex:o}}};function z1(e,t,i){const[s,n]=rk(e,t);return Fg(t,s,n,i)<=ok}function rk(e,t){const i=en(t,e[0]),s=en(t,e[1]);return[i,s]}function y$(e,t,i,s,n){let[a,o]=Tt(t.map(Number));const r=Math.floor(i.unzoomed);if(r<=1){const[x,v]=x$(a,o),S=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:M}=Wc(x,v,S,void 0,void 0,n),D=[e.toDomain(x),e.toDomain(v)];return s&&D.reverse(),{domain:D,ticks:M}}if(a===o){const x=Math.floor(Math.log10(a)),v=Math.pow(10,x),S=Math.min(v,1),M=r-1;a-=S*Math.floor(M/2),o=a+S*M}let l=a,c=o;l=b$(l,c,r);const h=S$(l,c,r),d=r-1;c=l+d*h;const u=Math.floor(l/h)*h,p=Math.floor(c/h)*h;u<=a&&p>=o&&(l=u,c=p);const f=[e.toDomain(l),e.toDomain(c)];s&&f.reverse();const y=h*((i.unzoomed-1)/(i.zoomed-1)),b=v$(l,y,Math.floor(i.zoomed));return{domain:f,ticks:b}}function x$(e,t){let i=e,s=t,n=0;do{[i,s]=gx(i,s);const{ticks:a}=Wc(i,s,5);if(a.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[e,t]}function b$(e,t,i){e=Math.floor(e);const s=Math.abs(t-e)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(e/a)*a}function v$(e,t,i){const s=Pc(t),n=Math.pow(10,s),a=[];for(let o=0;o<i;o++){const r=e+t*o;a.push(Math.round(r*n)/n)}return a}function S$(e,t,i){const s=i-1,n=(t-e)/s;return M$(n)}function M$(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/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:e}var D$=18,k$=[1,2,3,4,6,8,9,10,12];function V1(e,t=0){const i=[];for(const s of e){const{x:n,y:a,width:o,height:r}=s;if(i.some(l=>jy(l,n,a,o+t,r+t)))return!0;i.push(s)}return!1}function I$(e,t,i,s){if(e==null)return t;if(typeof e!="number"){const r=t[0],l=typeof e=="string"?{unit:e,epoch:r}:{...e,epoch:r};return Gn(l,t[0],t[1],{visibleRange:i,extend:s})}const n=[],a=t[0].valueOf(),o=t[1].valueOf();for(let r=a;r<=o;r+=e)n.push(new Date(r));return n}function B1(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}function A$(e){if(e.length<2)return 1/0;let t=0,i=e[0].translation;for(let s=1;s<e.length;s++){const n=e[s].translation,a=Math.abs(n-i);t=Math.max(t,a),i=n}return t}function C$(e,{niceDomain:t,rawTicks:i,rawFirstTickIndex:s=0,generatePrimaryTicks:n,primaryTicksIndices:a,alignment:o,fractionDigits:r,timeInterval:l}){const{scale:c,label:h,tickFormatter:d,inRange:u,isVertical:p,sizeLimit:f=1/0}=e,y=wu.is(c)||Lo.is(c),b=et(h),x=jg(),v=[];return F1(c,t,()=>{const S=Ya.is(c)?c.bandwidth??1/0:1/0,M=(c.bandwidth??0)/2,D=w$(h.enabled,n,t,i,r,l,d);let I=p?f:S,k=p?S:f;if(h.rotation){const A=Fy(h.rotation,I,k);I=A.width,k=A.height}const C={font:h,maxWidth:I,maxHeight:k,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping};for(let A=0;A<i.length;A++){const w=i[A],T=c.convert(w,{alignment:o})+M;if(u&&!u(T))continue;const O=a?.has(A)??!1,z=D(O,w,A);let V=null;h.avoidCollisions&&(V=qd(z,C)||null);const E=V??z,_=De(E),G=E!==z&&(_?Xp(E.at(-1)):nr(At(E)));let B;if(y){const F=w?.valueOf();Number.isFinite(F)&&(B=x(`v:${F}`))}B??(B=x(`l:${_?Ne(E.flat()):E}`)),v.push({tick:w,tickId:B,tickLabel:E,isPrimary:O,index:A+s,textUntruncated:G?Ne(z):void 0,textMetrics:_?Js(E,h):b.measureLines(At(E)),translation:Math.floor(T)})}}),v}function F1(e,t,i){const s=e.domain;try{e.domain=t,i()}finally{e.domain=s}}function w$(e,t,i,s,n,a,o){const r=t?"component":"long",l=t&&a?nu(a):void 0,c=t?o(i,s,!0,n,l,r):null,h=e?o(i,s,!1,n,a,r):null;return(d,u,p)=>(d?c:h)?.(u,p)??String(u)}function L$(e,t,i,s,n,a,o,r){if(!wu.is(e)&&!Lo.is(e))return;const l=nu(a);if(l==null)return;o&&(t=[1-t[1],1-t[0]]);const c=Math.min(e.domain[0].valueOf(),e.domain.at(-1).valueOf()),h=Math.max(e.domain[0].valueOf(),e.domain.at(-1).valueOf());let[d,u]=hx(new Date(c),new Date(h),t);d=en(l,d),d.valueOf()>=c&&(d=EM(l,d)),u=PM(l,u),u.valueOf()<=h&&(u=cx(l,u));const p=Gn(l,d,u),f=cs(a),y=$l.is(e),b={...n,interval:a},x=[];let v,S,M,D=0;if($l.is(e)){const I=xa(a);S=r!=null&&cs(r)>=cs(I)?2:3,M=1;const k=i/s,C=e.bandCount(t)/(k*D$);D=k$.findLast(A=>C>=A)??1}else Kl.is(e)&&(e.interval==null||cs(e.interval)>=f)?S=1:(S=0,M=2);for(let I=0;I<p.length-1;I++){const k=p[I],C=p[I+1],A=I===0,w=I===p.length-2,T=C.valueOf()-k.valueOf(),O=[Math.max((c-k.valueOf())/T,0),Math.min((h-k.valueOf())/T,1)];let z;switch(S){case 0:z=I$(b.interval,[k,C],O,!0);break;case 1:case 3:{z=e.ticks(b,[k,C],O,{extend:!0,dropInitial:!0})?.ticks??[];break}case 2:z=e.stepTicks(D,[k,C],void 0,!w);break}if(_S(z,G=>G.valueOf()<k.valueOf()),w||HS(z,G=>{switch(S){case 0:case 3:return G.valueOf()+f>C.valueOf();case 1:case 2:return G.valueOf()>=C.valueOf()}}),z.length===0)continue;const V=z[0],E=$y(V,k);(S===0?E===0:E<=f)&&(!y||!A)&&(v??(v=new Set),v.add(x.length)),x.push(...z)}return v?.size===1&&v.has(0)&&(v=void 0),{ticks:x,primaryTicksIndices:v,alignment:M}}function N$(e,t,i,s,n){const a=_1(e.format,s);if(a==null)return{width:0,height:0};const o=Xc(a),r=s?nu(s):void 0,l=_1(t?.format,r),c=l?Xc(l):o,h=new Date(i[0]),d=new Date(i.at(-1)),u=r?Gn(r,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let p=0,f=0;if(o!=null){const y=Au(e),b=y.left+y.right,x=y.top+y.bottom;let v,S;u!=null&&u.length>1?(v=u[0],S=u[1]):(v=h,S=d);const M=Gn(s,v,S,{limit:50});for(const D of M){const I=o(D),{width:k,height:C}=n.measureLines(I);p=Math.max(p,k+b),f=Math.max(f,C+x)}}if(c!=null&&u!=null){const y=Au(t),b=y.left+y.right,x=y.top+y.bottom;for(const v of u){const S=c(v),{width:M,height:D}=n.measureLines(S);p=Math.max(p,M+b),f=Math.max(f,D+x)}}return{width:Math.ceil(p),height:Math.ceil(f)}}function T$(e,t,i,s){return e&&!t?i*s===-1?"top":"bottom":"middle"}function O$(e,t,i,s,n){const a=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI,r=a||o?-1:1;if(e)if(t||i){if(s*r===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function _1(e,t){if(e!=null){if(typeof e=="string")return e;if(We(e)&&t!=null)return e[xa(t)]}}function P$(e,t,i=0){const s=Ha(e),n=!s&&i>=0&&i<=Math.PI?-1:1,a=!s&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,o=t?n*(Math.PI/2):0;return{configuredRotation:s,defaultRotation:o,parallelFlipFlag:n,regularFlipFlag:a}}var E$=new Date(1970,0,4);function H1(e){const{label:t,domain:i,axisRotation:s,labelOffset:n,sideFlag:a}=e,{defaultRotation:o,configuredRotation:r,parallelFlipFlag:l,regularFlipFlag:c}=P$(t.rotation,t.parallel,s),h=r+o,d=(C,A=0)=>{const w=t.minSpacing??(r===0&&A===0?10:0),T=h+A,O=Au(t);return V1(V$(e,C,T),w)||V1(B$(C.ticks,n,T,O),w)},{maxTickCount:u}=G1(e),p=R$(e),f=t.enabled&&t.avoidCollisions,y=Number.isFinite(u)?u:10,b=f&&t.autoRotate&&t.rotation==null;let x=0,v=0,S=!0,M={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;S&&x<=y;)({tickData:M,index:x}=z$(e,p,M,x)),v=b&&d(M,0)?Ha(t.autoRotateAngle):0,S=f&&d(M,v);const D=O$(t.parallel,r,v,a,c),I=T$(t.parallel,r,a,l),k=r+v;return{tickData:M,textAlign:D,textBaseline:I,rotation:k}}function R$(e){return e.interval?.values?2:e.primaryTickCount!=null?1:0}function G1({scale:e,domain:t,range:i,visibleRange:s,label:n,defaultTickMinSpacing:a,interval:{minSpacing:o,maxSpacing:r}}){const{defaultTickCount:l}=e,c=xo(i),h=xo(s);if(Cu.is(e)||$l.is(e)&&t.length<1e3){const d=Cu.is(e)?t.length:Math.min(t.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 fx(c,h,o,r,l,a)}function z$(e,t,i,s){const{step:n,values:a}=e.interval,{maxTickCount:o,minTickCount:r,tickCount:l}=G1(e),c=A=>Math.max(l-A,r),h=n==null&&a==null&&c(s)>r,d=i.rawTicks,u=l-r,p={minTickCount:r,maxTickCount:o,tickCount:c(s)};let f=j1(e,t,p);if(h&&B1(f.rawTicks,d)){let A=s,w=u;for(;A<=w;){s=Math.trunc((A+w)/2),p.tickCount=c(s);const T=j1(e,t,p);B1(T.rawTicks,d)?A=s+1:(f=T,w=s-1)}}const{tickDomain:y,niceDomain:b,rawTicks:x,rawTickCount:v,rawFirstTickIndex:S,generatePrimaryTicks:M,primaryTicksIndices:D,alignment:I,fractionDigits:k,timeInterval:C}=f;return{tickData:{tickDomain:y,niceDomain:b,rawTicks:x,rawTickCount:v,fractionDigits:k,timeInterval:C,ticks:C$(e,{niceDomain:b,rawTicks:x,rawFirstTickIndex:S,generatePrimaryTicks:M,primaryTicksIndices:D,alignment:I,fractionDigits:k,timeInterval:C})},index:s+1}}function j1(e,t,i){const{domain:s,reverse:n,visibleRange:a,scale:o,interval:r,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:d}=e,u={nice:c.map(A=>A===0),interval:r.step,...i},p={...u,nice:c.map(A=>A===0||A===1)};let f;t===1&&h!=null&&mt.is(o)&&(f=y$(o,s,h,n,a));const y=c.includes(0)?f?.domain??o.niceDomain(u,s):s;let b=y,x,v,S,M,D,I;const k=l?.enabled===!0&&p.interval==null;F1(o,y,()=>{switch(t){case 2:if(b=r.values,x=r.values,v=x.length,$l.is(o)?I=1:Kl.is(o)&&(I=2),mt.is(o)){const[A,w]=Tt(y.map(Number));x=x.filter(T=>Number(T)>=A&&Number(T)<=w).sort((T,O)=>Number(T)-Number(O))}break;case 1:if(f)x=f.ticks,v=f.ticks.length;else{const A=o.ticks(p,y,a);x=A?.ticks,v=A?.count}break;default:{const{tickCount:A,minTickCount:w,maxTickCount:T}=i;if(y.length>0&&p.interval==null&&(Kl.is(o)||k&&(wu.is(o)||$l.is(o)))){const V=y,E=Math.min(V[0].valueOf(),V.at(-1).valueOf()),_=Math.max(V[0].valueOf(),V.at(-1).valueOf());M=au(E,_,A,w,T,{weekStart:l==null?E$:void 0,primaryOnly:!0})}let O;$l.is(o)?O=d:Kl.is(o)&&(O=o.interval),O!=null&&M!=null&&cs(O)>=cs(M)&&(M=O);const z=M?L$(o,a,A,T,p,M,n,d):void 0;if(z)({ticks:x,primaryTicksIndices:D,alignment:I}=z);else{const V=Kl.is(o)&&p.interval==null&&M!=null?{...p,interval:M}:p,E=o.ticks(V,y,a);if(x=E?.ticks,v=E?.count,S=E?.firstTickIndex,wu.is(o)||Lo.is(o)){const _=typeof p.interval=="number"?ou(p.interval):p.interval;M??(M=_??E?.timeInterval)}}}}}),x??(x=[]);let C=0;for(const A of x){if(typeof A!="number")continue;const w=Pc(A);w>C&&(C=w)}return k||(D=void 0),{tickDomain:b,niceDomain:y,rawTicks:x,rawTickCount:v,rawFirstTickIndex:S,generatePrimaryTicks:k,primaryTicksIndices:D,alignment:I,fractionDigits:C,timeInterval:M}}function V$(e,t,i){const{niceDomain:s,ticks:n,timeInterval:a}=t;if(a==null)return[];const o=A$(n),{label:r,labelOffset:l,primaryLabel:c,domain:h}=e,{width:d,height:u}=N$(r,c,s??h,a,et(r)),p=[];for(const f of[0,o]){const{x:y,y:b}=_y(l,f,i);p.push({x:y,y:b,width:d,height:u})}return p}function B$(e,t,i,s){const n=[],a=s.left+s.right,o=s.top+s.bottom;for(const{tickLabel:r,textMetrics:l,translation:c}of e){if(!r)continue;const{x:h,y:d}=_y(t,c,i),u=l.width+a,p=l.height+o;n.push({x:h,y:d,width:u,height:p})}return n}var lf=class p_ extends nk{constructor(t,i){super(t,i),this.maxThicknessRatio=.3,this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new ds({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new ds({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Kn({zIndex:1})),this.tickLineGroupSelection=pi.select(this.tickLineGroup,Kn,!1),this.gridLineGroupSelection=pi.select(this.gridLineGroup,Kn,!1),this.gridFillGroupSelection=pi.select(this.gridFillGroup,Ci,!1),this.tempText=new bu({debugDirty:!1}),this.tempCaption=new zt,this.animationManager=t.animationManager,this.animationState=new de("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(t.eventsHub.on("layout:complete",n=>{const a=[n.chart.width,n.chart.height];s!=null&&!En(a,s)&&this.animationState.transition("resize"),s=a}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof p_}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(t){t==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new ak}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(t,i){return this.updateDirection(),super.calculateLayout(t,i)}layoutCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.calculateLayout?.(t)}calculateTickLayout(t,i,s,n){const a=this.label.getSideFlag(),o=a*(this.getTickSize()+this.getTickSpacing()+this.label.spacing+this.seriesAreaPadding),r=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(r);if(i[0]===2&&i[1]===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:he,spacing:Me}=this.measureAxisLayout(t,[],[],r,l);return{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:he,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:Me}}}const{label:c,primaryLabel:h,scale:d,range:u,interval:p,reverse:f,defaultTickMinSpacing:y,minimumTimeGranularity:b}=this,x=H1({label:c,scale:d,interval:p,primaryLabel:h,domain:t,range:u,reverse:f,niceMode:i,visibleRange:s,defaultTickMinSpacing:y,minimumTimeGranularity:b,sideFlag:a,labelOffset:o,primaryTickCount:n,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction==="y",sizeLimit:this.chartLayout?.sizeLimit,inRange:he=>this.inRange(he,.001),tickFormatter:(...he)=>this.tickFormatter(...he)}),{tickData:v}=x;if(this.label.avoidCollisions&&this.horizontal&&v.ticks.length>2&&(mt.is(this.scale)||Lo.is(this.scale))){const he=this.chartLayout?.padding.right??0,Me=v.ticks.at(-1);Me?.tickLabel!=null&&Me.translation+Me.textMetrics.width/2>u[1]+he&&(Me.tickLabel=void 0,s[0]===0&&s[1]===1&&(v.ticks[0].tickLabel=void 0))}const{ticks:M,tickDomain:D,rawTicks:I,rawTickCount:k,fractionDigits:C,timeInterval:A,niceDomain:w}=v,T=M.map(he=>this.getTickLabelProps(he,x,l)),{position:O,gridPadding:z,gridLength:V}=this,E=O==="bottom"||O==="right"?-1:1,_=E*z,G=E*(V+z),B=this.calculateGridLines(M,_,G),F=this.calculateGridFills(M,_,G),Y=this.calculateTickLines(M,E,l),{bbox:Z,spacing:ie}=this.measureAxisLayout(D,M,T,r,l);return{ticks:I,rawTickCount:k,tickDomain:D,niceDomain:w,fractionDigits:C,timeInterval:A,bbox:Z,layout:{ticks:M,gridLines:B,gridFills:F,tickLines:Y,labels:T,spacing:ie}}}calculateGridLines(t,i,s){return t.map((n,a)=>this.calculateGridLine(n,a,i,s,t))}calculateGridLine({index:t,tickId:i,translation:s},n,a,o,r){const{gridLine:l,horizontal:c}=this,[h,d,u,p]=c?[s,a,s,o]:[a,s,o,s],{style:f}=l,{stroke:y,strokeWidth:b=0,lineDash:x}=f[t%f.length]??{};return{tickId:i,offset:s,x1:h,y1:d,x2:u,y2:p,stroke:y,strokeWidth:b,lineDash:x}}calculateGridFills(t,i,s){const{horizontal:n,range:a,type:o}=this,r=[];if(t.length==0)return r;let l=0;const c=!n&&o==="unit-time";if(c&&t[0].translation<a[0]||!c&&t[0].translation>a[0]){const d={tickId:`before:${t[0].tickId}`,translation:a[0]};r.push(this.calculateGridFill(d,-1,t[0].index,i,s,t)),l=1}return r.push(...t.map((d,u)=>this.calculateGridFill(d,u,d.index+l,i,s,t))),r}calculateGridFill({tickId:t,translation:i},s,n,a,o,r){const{gridLine:l,horizontal:c,range:h}=this,d=r[s+1],u=i,p=d?d.translation:h[1],[f,y,b,x]=c?[u,Math.max(a,o),p,Math.min(a,o)]:[Math.min(a,o),Math.min(u,p),Math.max(a,o),Math.max(u,p)],{fill:v,fillOpacity:S}=l.style[n%l.style.length]??{};return{tickId:t,x1:f,y1:y,x2:b,y2:x,fill:v,fillOpacity:S}}calculateTickLines(t,i,s=0){return t.map(n=>this.calculateTickLine(n,n.index,i,t,s))}calculateTickLine({isPrimary:t,tickId:i,translation:s},n,a,o,r=0){const{horizontal:l,tick:c,primaryTick:h}=this,d=t&&h?h:c,u=this.getTickSize(d),p=this.getTickSpacing(d),f=-a*(r+p),y=-a*u,[b,x,v,S]=l?[s,f,s,f+y]:[f,s,f+y,s],{stroke:M,width:D}=d;return{tickId:i,offset:s,x1:b,y1:x,x2:v,y2:S,stroke:M,strokeWidth:D,lineDash:void 0}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.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:o}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const r=o.map(c=>c.tickId),l=cM(t,r);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:t,translationY:i}=this.getAxisTransform();return{x:t,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const t=this.getAxisTransform();this.tickLineGroup.datum=t,this.tickLabelGroup.datum=t,this.lineNodeGroup.datum=t,this.headingLabelGroup.datum=t}setAxisVisible(t){this.tickLineGroup.visible=t&&(this.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=t&&(this.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=t,this.headingLabelGroup.visible=t}getAxisLineCoordinates(){const{horizontal:t}=this,[i,s]=Tt(this.lineRange??this.range);return t?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(t,i){const{translation:s}=t,{position:n,primaryTick:a}=this;let o=this.getTickSize();a?.enabled&&(o=Math.max(o,this.getTickSize(a)));const r=n==="bottom"||n==="right"?-1:1,l=this.getTickSpacing(this.tick),c=-r*(i+l),h=c,d=c-r*(o+l),u=Math.min(h,d),p=Math.max(h,d);switch(n){case"top":return new le(s,u,0,p-u);case"bottom":return new le(s,u,0,p-u);case"left":return new le(u,s,p-u,0);case"right":return new le(u,s,p-u,0)}}lineNodeBBox(){const{position:t,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),a=n-s;switch(t){case"top":return new le(s,-i,a,i);case"bottom":return new le(s,0,a,i);case"left":return new le(-i,s,i,a);case"right":return new le(0,s,i,a)}}titleBBox(t,i){const{tempCaption:s}=this;return s.node.setProperties(this.titleProps(s,t,i)),s.node.getBBox()}getScrollbarThickness(t){return t?.enabled&&t.placement==="inner"?t.spacing+t.thickness:0}resolveScrollbarLayout(t,i){if(!t)return;const{position:s}=this,n=s==="top"||s==="left"?-1:1;if(t.placement==="inner"){const o=n===1?t.spacing:-t.spacing-t.thickness;return{...t,offset:o}}const a=n===1?i+t.spacing:-i-t.spacing-t.thickness;return{...t,offset:a}}applyScrollbarLayout(t,i,s){const n=this.resolveScrollbarLayout(s,i);let a=i;if(n){const{offset:o,thickness:r,placement:l}=n;l==="outer"&&(a+=n.spacing+r),this.horizontal?t.push(new le(0,o,0,r)):t.push(new le(o,0,r,0))}return{spacing:a,scrollbarLayout:n}}measureAxisLayout(t,i,s,n,a){const{tick:o,primaryTick:r,label:l,primaryLabel:c,title:h,position:d,horizontal:u,seriesAreaPadding:p}=this,f=[];if(f.push(this.lineNodeBBox()),o.enabled||r?.enabled)for(const D of i)f.push(this.getTickLineBBox(D,a));const{tempText:y}=this;if(l.enabled)for(const D of s){if(!D.visible)continue;y.setProperties(D);const I=y.getBBox();I&&f.push(I)}if(c?.enabled&&d==="bottom"&&(f.push(new le(0,Rn(l.fontSize)+2,1,this.getTickSize(o)+this.getTickSpacing(o)+l.spacing+p)),c.format!=null)){const{format:I}=c,C=(We(I)?Object.values(I):[I]).reduce((A,w)=>Math.max(A,a0(w)),0);f.push(new le(0,this.getTickSize(r??o)+this.getTickSpacing(r??o)+c.spacing+p,1,C*Rn(c.fontSize)+2))}const b=le.merge(f),x=u?b.height:b.width,{spacing:v,scrollbarLayout:S}=this.applyScrollbarLayout(f,x,n);return this.layout.labelThickness=x,this.layout.scrollbar=S,h.enabled&&f.push(this.titleBBox(t,v)),{bbox:le.merge(f),spacing:v}}titleProps(t,i,s){const{title:n}=this;if(!n.enabled)return t.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};t.enabled=!0,t.color=n.color,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.fontWeight=n.fontWeight,t.wrapping=n.wrapping;const a=(n.spacing??0)+s,{range:o}=this,r=(o[0]+o[1])/2;let l,c,h,d;switch(this.position){case"top":l=r,c=-a,h=0,d="bottom";break;case"bottom":l=r,c=a,h=0,d="top";break;case"left":l=-a,c=r,h=Math.PI/-2,d="bottom";break;case"right":l=a,c=r,h=Math.PI/2,d="bottom";break}const{formatter:u=f=>f.defaultValue}=n,p=this.cachedCallWithContext(u,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:d,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(t,i,s){const{horizontal:n,primaryLabel:a,primaryTick:o,seriesAreaPadding:r,scale:l}=this,{tickId:c,tickLabel:h="",translation:d,isPrimary:u,textUntruncated:p}=t,f=u&&a?.enabled?a:this.label,y=u&&o?.enabled?o:this.tick,{rotation:b,textBaseline:x,textAlign:v}=i,{range:S}=l,M=this.label.getSideFlag(),D=Au(f)[this.position];let I=M*(this.getTickSize(y)+this.getTickSpacing(y)+f.spacing+r)-D;s&&(I+=M*s);const k=h!=="",C=n?d:I,A=n?-I:d;return{...this.getLabelStyles({value:t.tick,formattedValue:h},void 0,f),tickId:c,rotation:b,text:h,textAlign:v,textBaseline:x,textUntruncated:p,visible:k,x:C,y:A,rotationCenterX:C,rotationCenterY:A,range:S}}updateSelections(){if(!this.tickLayout)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,gridFills:n,labels:a}=this.tickLayout,o=r=>r.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,o),this.gridFillGroupSelection.update(this.gridLine.enabled?n:[],void 0,o),this.tickLineGroupSelection.update(i,void 0,o),this.tickLabelGroupSelection.update(a,void 0,o)}updateGridLines(){this.gridLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((t,i)=>{t.fill=i.fill,t.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTitle(t,i){const{caption:s}=this.title,n=this.titleProps(s,t,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((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.pointerEvents=i.textUntruncated==null?1:0,t.setFont(i),t.setBoxing(i)})}animateReadyUpdate(t){const{animationManager:i}=this.moduleCtx,s=o$(this),n=c$(s);ui(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),ui(this.id,"line",i,[this.lineNode],n.line),ui(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(a,o)=>o.tickId,t),ui(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(a,o)=>o.tickId,t),ui(this.id,"title",i,[this.title.caption.node],n.label,(a,o)=>o.tickId,t)}resetSelectionNodes(){Xi([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],h$()),Xi([this.gridLineGroupSelection,this.tickLineGroupSelection],L1()),Xi([this.gridFillGroupSelection],d$()),Xi([this.tickLabelGroupSelection],Qx()),Xi([this.title.caption.node],Qx()),Xi([this.lineNode],L1())}};g([m],lf.prototype,"thickness",2),g([m],lf.prototype,"maxThicknessRatio",2),g([m],lf.prototype,"position",2),g([m],lf.prototype,"crossAt",2);var cf=lf,W1=["right","top","left","bottom"];function F$(e){return typeof e=="string"&&W1.includes(e)}function _$(e){const t=[],i=[],s=[...W1];for(const n of e)n instanceof cf&&(F$(n.position)?i.push(n.position):t.push(n));for(const n of t){let a;do a=s.pop();while(a&&i.includes(a));if(a==null)break;n.position=a}}var $1=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function H$(e,t,i){const s=new Map,n=d=>{if(d===void 0)return $1;if(s.has(d))return s.get(d);const u=fe.getSeriesModule(d)?.matchingKeys??$1;return s.set(d,u),u},a=(d,u,p)=>{const f=n(d),y=[d];for(const b of f)b in u&&u[b]!=null&&y.push(`${b}=${u[b]}`);return p?.seriesGrouping&&y.push(`seriesGrouping.groupId=${p?.seriesGrouping.groupId}`),y.join(";")},o=new Map;let r=0;for(const d of e){const u=a(d.type,d.properties,i?.[r]);o.has(u)||o.set(u,[]),o.get(u)?.push([d,r++])}const l=new Map;r=0;for(const d of t){const u=a(d.type,d,d);l.has(u)||l.set(u,[]),l.get(u)?.push([d,r++])}if(![...o.keys()].some(d=>l.has(d)))return{status:"no-overlap",oldKeys:o.keys(),newKeys:l.keys()};const h=[];for(const[d,u]of l.entries())for(const[p,f]of u){const y=o.get(d);if(y==null||y.length<1){h.push({opts:p,targetIdx:f,idx:f,status:"add"}),o.delete(d);continue}const[b,x]=y.shift(),v=i?.[x]??{},S=Hn(v,p??{}),{groupIndex:M,stackIndex:D}=S?.seriesGrouping??{};M!=null||D!=null?h.push({opts:p,series:b,diff:S,targetIdx:f,idx:x,status:"series-grouping"}):S?h.push({opts:p,series:b,diff:S,targetIdx:f,idx:x,status:"update"}):h.push({opts:p,series:b,targetIdx:f,idx:x,status:"no-op"}),y.length===0&&o.delete(d)}for(const d of o.values())for(const[u,p]of d)h.push({series:u,idx:p,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}var Ul=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(e=>[e.name,e]));function G$(e){const t=Ul.get(e);return t?.type==="series"?t.chartType:void 0}function hf(e){const t=e.series?.[0]?.type??"line";return fe.getSeriesModule(t)?.chartType??G$(t)??"unknown"}function j$(e){return hf(e)==="cartesian"}var W$=class extends ik{*legends(){for(const e of fe.listModulesByType("plugin"))(e.name==="legend"||e.name==="gradientLegend")&&(yield{legendType:e.name==="legend"?"category":"gradient",legend:this.getModule(e.name)})}},lk="ag-charts-overlay",K1="ag-charts-dark-overlay",ch=class extends X{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return De(this.text)?Ne(this.text):this.rendererAsText?this.rendererAsText:e.t(At(this.text)||this.defaultMessageId)}getElement(e,t,i,s){if(this.content?.remove(),this.rendererAsText=void 0,this.focusBox=s,this.renderer){const n={},a=ls(e,this.renderer,n);if(hd(a))this.content=a;else{const o=ye("div");o.innerHTML=a;const{firstElementChild:r}=o;hd(r)&&o.childElementCount===1?this.content=r:this.content=o}this.rendererAsText=this.content?.textContent?.trim()??void 0}else{const n=ye("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(De(this.text)){const a=ye("div");for(const o of this.text){const r=ye("span",{color:o.color,fontSize:`${o.fontSize}px`,fontFamily:o.fontFamily??"inherit",fontWeight:String(o.fontWeight),fontStyle:o.fontStyle});r.innerText=At(o.text),a.appendChild(r)}n.appendChild(a)}else n.innerText=this.getText(i);this.content=n,this.content.classList.add(this.className),t?.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(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};g([m],ch.prototype,"enabled",2),g([m],ch.prototype,"text",2),g([m],ch.prototype,"renderer",2);var Lu=class extends X{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new ch("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new ch("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new ch("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new ch("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(t.focusBox!==void 0)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};g([m],Lu.prototype,"darkTheme",2),g([m],Lu.prototype,"loading",2),g([m],Lu.prototype,"noData",2),g([m],Lu.prototype,"noVisibleSeries",2),g([m],Lu.prototype,"unsupportedBrowser",2);function $$(e,t){const{animationDuration:i}=_x.add,s=i*t,n=ye("div",`${lk}--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=ye("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"}),o=ye("p",{marginTop:"1em"});o.innerText=e;const r=ye("div",`${lk}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=ye("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,o,r),n}var df=class extends X{constructor(e){super(),this.ctx=e,this.rectNode=new Ci,this.border=new Mr(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new pt,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}destroy(){this.cleanup.flush()}getPadding(){const{border:e,padding:t}=this,i=e.enabled?e.strokeWidth:0;if(typeof t=="number"){const s=t+i;return{top:s,right:s,bottom:s,left:s}}return{top:(t.top??0)+i,right:(t.right??0)+i,bottom:(t.bottom??0)+i,left:(t.left??0)+i}}createNode(){return new Le({name:"series-area-container",zIndex:4})}onLayoutComplete(e){const{x:t,y:i,width:s,height:n}=e.series.paddedRect;this.rectNode.x=t,this.rectNode.y=i,this.rectNode.width=s,this.rectNode.height=n}};g([m],df.prototype,"border",2),g([m],df.prototype,"clip",2),g([Dt("rectNode","cornerRadius"),m],df.prototype,"cornerRadius",2),g([m],df.prototype,"padding",2);function U1(e,t,i,s){if(Qt(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse,colorSpace:e.colorSpace??t.colorSpace};if(jn(e)){const n=e.pattern??i.pattern;let a=e.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?a??(a=i.strokeWidth):a??(a=0);const o=e.width??e.height??i.width,r=e.height??e.width??i.height;return{type:"pattern",pattern:n,width:o,height:r,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:a,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return Wa(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function ck(e,t,i,s){return!Qt(e?.fill)&&!jn(e?.fill)&&!Wa(e?.fill)?e:{...e,fill:U1(e.fill,t,i,s)}}var Y1=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(Y1||{}),K$=.25,U$=.125,eb=class{constructor(e,t,i,s){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},hk=class{constructor(e,t){this.series=e,this.seriesGrouping=t,this.type="groupingChanged"}};function Z1(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function dk(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius";default:return"x"}}var uf=class extends cT{constructor(e){super(),this.cleanup=new pt,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=eb,this.internalId=Ii(this),this.contentGroup=new ds({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new ds({name:`${this.internalId}-highlight`,zIndex:1}),this.highlightNodeGroup=this.highlightGroup.appendChild(new Le({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new Le({name:`${this.internalId}-highlight-label`,zIndex:2})),this.annotationGroup=new ds({name:`${this.internalId}-annotation`}),this.labelGroup=new ds({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new ik,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new Pn,this._pickNodeCache=new Wp(5),this.fireEventWrapper=l=>super.fireEvent(l);const{moduleCtx:t,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:a=!1,usesPlacedLabels:o=!1,alwaysClip:r=!1}=e;this.ctx=t,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=a,this.usesPlacedLabels=o,this.pickModes=i,this.alwaysClip=r,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(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const e=this.data;return e==null?!1:e.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:n}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new hk(this,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(e,t=!1){const i=this.bringToFront();return!t&&e===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=e,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:e),this.fireEvent(new hk(this,this.seriesGrouping)),!0)}setZIndex(e){this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e}renderToOffscreenCanvas(){return!1}hasHighlightOpacity(){if(!this.properties.highlight.enabled||this.ctx.highlightManager.getActiveHighlight()==null)return!1;const{unhighlightedItem:e,unhighlightedSeries:t}=this.properties.highlight;return UD(e)||UD(t)}getDrawingMode(e,t="cutout"){return e?t:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const e=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:e}}}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,t){const i=Z1(e),s=i==null?e:dk(this.resolveKeyDirection(i)),n=t?.[s],a=[];if(!n)return a;const o=(...r)=>{for(const l of r)Array.isArray(l)?o(...l):typeof l=="object"?o(...Object.values(l)):a.push(l)};return o(...n.map(r=>this.properties[r])),a}getKeyAxis(e){}getKeys(e){return this.getPropertyValues(dk(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(dk(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),s=this.getPropertyValues(e,this.propertyNames),n=[];for(let a=0;a<i.length;a++)n.push({seriesId:t,key:i[a],name:s[a]});return n}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(s=>s.getDomain(e)).flat();return i.length===0?t:{domain:t.domain.concat(i)}}getRange(e,t){return this.getSeriesRange(e,t)}getMinimumRangeSeries(e){}getMinimumRangeChart(e){return 0}getZoomRangeFittingItems(e,t,i){}getVisibleItems(e,t,i){return 1/0}toCanvasFromMidPoint(e){const{x:t=0,y:i=0}=e.midPoint??{};return Wt.toCanvasPoint(this.contentGroup,t,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:e,seriesGrouping:t,type:i,visible:s}=this;this.ctx.seriesStateManager.updateSeries({internalId:e,type:i,visible:s,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0})}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:t=1}=this.getHighlightStyle();return t}getHighlightState(e,t,i,s){return this.properties.highlight.enabled?t?1:e?.series==null?0:this.isSeriesHighlighted(e,s)?this.isItemHighlighted(e,i)==null?2:4:3:0}getHighlightStateString(e,t,i,s){return ku(this.getHighlightState(e,t,i,s))}onChangeHighlight(e){const t=e.previousHighlight,i=e.currentHighlight,s=this.getHighlightState(i),n=this.getHighlightState(t);this.setSeriesIndex(this.declarationOrder);const a=this.hasItemStylers();if(!a&&s===n){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:o,unhighlightedItem:r,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=a||!md(o)||!md(r)||!md(l)}bringToFront(){return this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(e,t){return this.properties.highlight.enabled?e?.series===this:!1}isItemHighlighted(e,t){if(!(e?.datumIndex==null||t==null))return e.datumIndex===t}getHighlightStyle(e,t,i,s){const n=this.ctx.highlightManager?.getActiveHighlight();return i??(i=this.getHighlightState(n,e,t,s)),this.properties.highlight.getStyle(i)}resolveMarkerDrawingModeForState(e,t){return NW(e,t)}filterItemStylerFillParams(e){return Qt(e)?J(e,["bounds","colorSpace","gradient","reverse"]):jn(e)?J(e,["padding"]):e}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:s,pickModeAxis:n,visible:a,contentGroup:o}=this;if(!a||!o.visible||t==="highlight"&&!this.properties.highlight.enabled||t==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let r=1/0;if(t==="tooltip"||t==="highlight-tooltip"){const{tooltip:u}=this.properties;r=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(t==="event"||t==="context-menu"){const{nodeClickRange:u}=this.properties;r=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=e,d=JSON.stringify({x:c,y:h,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const f=this.pickNodesExactShape(e);p=f.length===0?void 0:{datums:f,distance:0};break}case 1:{const f=this.pickNodeClosestDatum(e),y=f?.distance===0?this.pickNodesExactShape(e):void 0;y!=null&&y.length!==0?p={datums:y,distance:0}:f?p={datums:[f.datum],distance:f.distance}:p=void 0;break}case 2:{const f=n==null?void 0:this.pickNodeMainAxisFirst(e,n==="main-category");p=f==null?void 0:{datums:[f.datum],distance:f.distance};break}}if(p&&p.distance<=r)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&t.push(s)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=Xd(e.x,e.y,t),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireEvent(e){ls([this.properties,this.ctx.chartService],this.fireEventWrapper,e)}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:s,legendItemName:n}=t??{};this.toggleSeriesItem(i,e,s,n)}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendType:n}=e,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=a!=null&&a===e.legendItemName;(s.id===this.id||r||o!=null)&&this.toggleSeriesItem(t,n,i,a,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:n,legendType:a}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===e.legendItemName;s.id===this.id||l||r!=null?this.toggleSeriesItem(!0,a,i,o,e):t&&n===1?this.toggleSeriesItem(!0,a,void 0,o):this.toggleSeriesItem(!1,a,void 0,o)}toggleSeriesItem(e,t,i,s,n){const a=this.id;(e||t!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:a,itemId:i,legendItemName:n?.legendItemName??s,visible:e};this.fireEvent(o),this.ctx.legendManager.toggleItem(e,a,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(e,t,i,s,n,a,o){const{id:r,properties:l}=this;return e.formatDatum(l,i,t,r,a,s,n,void 0,void 0,void 0,o)}getLabelText(e,t,i,s,n,a,o,r=!1){if(e==null&&!r)return"";const{axes:l,canHaveAxes:c,ctx:h,id:d,properties:u}=this,p="series-label",f="legendItemName"in u?u.legendItemName:void 0,y={seriesId:this.id,...o},b=c?Z1(s):void 0,x=b==null?void 0:l[this.resolveKeyDirection(b)];if(x!=null)return x.formatDatum(u,e,p,d,f,t,i,n,a,y,r);const{formatManager:v}=h,S=this.callWithContext.bind(this),M=I=>a.formatValue(S,I.type,I.value,y)??v.format(S,I)??(e==null?"":String(e)),D=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return M({type:"number",value:e,datum:t,seriesId:d,legendItemName:f,key:i,source:p,property:s,domain:n,boundSeries:D,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return M({type:"category",value:e,datum:t,seriesId:d,legendItemName:f,key:i,source:p,property:s,domain:n,boundSeries:D})}}getMarkerStyle(e,{datumIndex:t,datum:i,point:s},n,a,o={size:s?.size??e.size??0},r){const{itemStyler:l}=e,{highlightState:c,isHighlight:h=!1,checkForHighlight:d=!0,resolveMarkerSubPath:u=["marker"],resolveStyler:p=!1}=a??{},f=["series",`${this.declarationOrder}`,...u];if(p){const v={permissivePath:!0},S=this.ctx.optionsGraphService.resolvePartial(f,o,v);S&&(o={...S,size:S.size??o.size})}const y=d?this.getHighlightStyle(h,t,c):void 0;let x=re(y,o,e.getStyle(),r);if(l&&n){const v=this.ctx.highlightManager?.getActiveHighlight(),S=this.getHighlightStateString(v,h,t),M=this.filterItemStylerFillParams(x.fill),D=this.cachedCallWithContext(l,{seriesId:this.id,...x,fill:M,...n,highlightState:S,datum:i}),I=this.ctx.optionsGraphService.resolvePartial(f,D);x=re(I,x)}return x}applyMarkerStyle(e,t,i,s,{applyTranslation:n=!0,selected:a=!0}={}){const{shape:o,size:r=0}=e,l=this.visible&&r>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y);if(t.setStyleProperties(e,s),n?t.setProperties({visible:l,shape:o,size:r,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):t.setProperties({visible:l,shape:o,size:r}),a||(t.fillOpacity*=K$,t.strokeOpacity*=U$),typeof o=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[d,u]=["x","y"].map(p=>(e.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(e){const{width:t,height:i}=e??{width:Number.NaN,height:Number.NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,n=Hn(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,s=i.get(e);if(s!=null)return s;try{const n=t();return i.set(e,n),n}catch(n){K.error(String(n))}}cachedCallWithContext(e,t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,t)}callWithContext(e,t){return ls([this.properties,this.ctx.chartService],e,t)}formatTooltipWithContext(e,t,i){return e.formatTooltip([this.properties,this.ctx.chartService],t,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};uf.className="Series",g([_e({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],uf.prototype,"seriesGrouping",2);var Y$=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=ye("div"),this.svg=jt("svg"),this.outerPath=jt("path"),this.innerPath=jt("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=ye("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(e,t,i){if(t!=null)if(e instanceof Ai){const s=(a,o)=>{let{x:r,y:l}=Wt.toCanvasPoint(e,a,o);return r-=t.x??0,l-=t.y??0,{x:r,y:l}},n=e.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(e.x-t.x,0),a=Math.max(e.y-t.y,0),o=Math.min(e.x+e.width-t.x,t.width),r=Math.min(e.y+e.height-t.y,t.height);s=new le(n,a,o-n,r-a)}else s=new le(e.x-t.x,e.y-t.y,e.width,e.height);jd(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return t!=null&&Re().getComputedStyle(t).opacity==="1"}},Z$=class{constructor(e,t,i,s){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(_n(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(_n(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),Pe(this.label1,"id",Ir()),Pe(this.label2,"id",Ir()),_n(this.label1,"display","none"),_n(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Pe(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(e){const t=ye("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),e==="swap"&&t(this.activeAnnouncer)}dispatch(e,t){e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1);for(const i of this.listeners[e])i(t)}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],ma(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),ma(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},X$={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 q$(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(i.key===e.key&&(i.shift===void 0||i.shift===e.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===e.ctrlKey||i.ctrlOrMeta===e.metaKey))return!0;return!1}function Q$(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of rt(X$))if(q$(e,s))return{name:t,activatesFocusIndicator:i}}function J$(e,t,i){const s=$D(e,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof le){const{x:a,y:o}=n.computeCenter();return{x:t.x+a,y:t.y+o}}return Wt.toCanvas(n).computeCenter()}}function eK({bounds:e}){return e instanceof le?e:e!=null?Wt.toCanvas(e):le.NaN}function tK(e,t,i){const{x:s,y:n}=J$(e,t,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}var X1=.1,q1=200,Q1=12,iK=.5,sK=class{constructor(){this.events=new Pn,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(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const a=.001,o=Math.trunc(Math.ceil(n/(a*1e3)));let{x:r,y:l,vx:c,vy:h}=this;for(let d=0;d<o;d+=1){const u=r-e,p=l-t,f=-(q1*u+Q1*c)/X1,y=-(q1*p+Q1*h)/X1;c+=f*a,h+=y*a,r+=c*a,l+=h*a}Math.hypot(r-e,l-t)<iK?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=r,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})}},tb=null;function Nu(e){const t=Ne(e);return t===""?"":(tb??(tb=ye("div")),tb.textContent=t,tb.innerHTML.replaceAll(`
`,"<br>"))}function pf(e,t){const{path:i,size:s}=e,{x:n,y:a}=e;i.clear();let o=!1;for(const[r,l]of t){const c=n+(r-.5)*s,h=a+(l-.5)*s;o?i.lineTo(c,h):i.moveTo(c,h),o=!0}i.closePath()}var nK={circle({path:e,x:t,y:i,size:s}){const n=s/2;e.arc(t,i,n,0,Math.PI*2),e.closePath()},cross(e){pf(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]])},diamond(e){pf(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const n=s/4;i=i+n/2,e.arc(t-n,i-n,n,lt(130),lt(330)),e.arc(t+n,i-n,n,lt(220),lt(50)),e.lineTo(t,i+n),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.891-.5)*s,i+(.391-.5)*s),e.cubicCurveTo(t+(.891-.5)*s,i+(.606-.5)*s,t+(.5-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.5-.5)*s,i+(1-.5)*s,t+(.109-.5)*s,i+(.606-.5)*s,t+(.109-.5)*s,i+(.391-.5)*s),e.cubicCurveTo(t+(.109-.5)*s,i+(.175-.5)*s,t+(.284-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.716-.5)*s,i+(0-.5)*s,t+(.891-.5)*s,i+(.175-.5)*s,t+(.891-.5)*s,i+(.391-.5)*s),e.closePath()},plus(e){pf(e,[[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:e,x:t,y:i,size:s,pixelRatio:n}){const a=s/2;e.moveTo(Fi(n,t-a),Fi(n,i-a)),e.lineTo(Fi(n,t+a),Fi(n,i-a)),e.lineTo(Fi(n,t+a),Fi(n,i+a)),e.lineTo(Fi(n,t-a),Fi(n,i+a)),e.closePath()},star({path:e,x:t,y:i,size:s}){const a=s/2,o=a/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:o,h=l*Math.PI/5-r,d=t+Math.cos(h)*c,u=i+Math.sin(h)*c;e.lineTo(d,u)}e.closePath()},triangle(e){pf(e,[[.5,0],[1,.87],[0,.87]])}},gf=class extends Ai{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(e,t){return this.distanceSquared(e,t)<=0}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(e,t){const i=Li.anchor(this.shape),s=e-this.x+(i.x-.5)*this.size,n=t-this.y+(i.y-.5)*this.size,a=this.size/2;return Math.max(s*s+n*n-a*a,0)}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,a=this.layerManager?.canvas?.pixelRatio??1,o=Li.anchor(t),r={path:e,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:a};e.clear(),typeof t=="string"?nK[t](r):typeof t=="function"&&t(r)}computeBBox(){const{x:e,y:t,size:i}=this,s=Li.anchor(this.shape);return new le(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};g([du({equals:qc})],gf.prototype,"shape",2),g([Ee()],gf.prototype,"x",2),g([Ee()],gf.prototype,"y",2),g([Ee({convertor:Math.abs})],gf.prototype,"size",2);var Li=class extends gu(wx(fu(gf))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}resetAnimationProperties(e,t,i,s,n,a){this.__x=e,this.__y=t,this.__size=i,this.__opacity=s,this.resetScalingProperties(n,a,e,t),this.dirtyPath=!0,this.markDirty()}};function aK(e,t,i=t*(5/3)){const s=new Le,n=Math.min(e.marker.strokeWidth??1,2),a=e.line?.enabled?Math.min(e.line.strokeWidth,2):0,o=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),r=Math.max(e.marker.enabled===!1?0:t,a);if(e.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=e.line,d=new Kn;d.x1=0,d.y1=r/2,d.x2=o,d.y2=r/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=a,d.lineDash=h,s.append(d)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:f}=e.marker,y=new Li;y.shape=l??"square",y.size=t,y.fill=c,y.fillOpacity=h??1,y.stroke=d,y.strokeOpacity=u??1,y.strokeWidth=n,y.lineDash=p,y.lineDashOffset=f??0;const b=Li.anchor(l),x=o/2+(b.x-.5)*t,v=r/2+(b.y-.5)*t,S=t/(t+n);y.x=x,y.y=v,y.scalingCenterX=x,y.scalingCenterY=v,y.scalingX=S,y.scalingY=S,s.append(y)}return Le.toSVG(s,o,r)}var qi="ag-charts-tooltip",oK="ag-charts-tooltip--dark";function Br(e){return e==null?!1:Array.isArray(e)?e.some(t=>Br(t.text)):At(e).trim()!==""}function hh(e,t=!1){return e==null?!t:typeof e=="number"&&!Number.isFinite(e)}function rK(e){return e.type==="raw"||!e.data||e.data.length===0?!1:e.data.every(t=>t.missing===!0)}function J1(e){const t=[],i=new Map;for(const s of e)if(!rK(s))if(s.type==="structured"){const{heading:n}=s,a=Br(n)?i.get(n):void 0,o={type:"structured",heading:n,items:[s]};a==null?(i.set(n,o),t.push(o)):a.items.push(s)}else t.push(s);return t}function lK(e){const t=J1(e),i=[];for(const s of t)if(s.type!=="raw"){Br(s.heading)&&i.push(Ne(s.heading));for(const n of s.items)if(Br(n.title)&&i.push(Ne(n.title)),n.data)for(const a of n.data)a.missing!==!0&&i.push(a.label??a.fallbackLabel,Ne(a.value))}return i.filter(s=>s!=="").join("; ")}function eO(e,t,i){let s="";Br(e)?(s+=`<span class="${qi}-label">${Nu(e)}</span>`,s+=" ",s+=`<span class="${qi}-value">${Nu(t)}</span>`):s+=`<span class="${qi}-label">${Nu(t)}</span>`;const n=[`${qi}-row`];return i&&n.push(`${qi}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function cK(e){let t="";if(e.data?.length&&e.data.every(a=>a.missing===!0))return t;const i=Br(e.title),s=!i&&e.data?.length===1,n=e.symbol==null?void 0:aK(e.symbol,12);if(n!=null&&(i||e.data?.length)&&(t+=`<span class="${qi}-symbol">${n}</span>`),i&&(t+=`<span class="${qi}-title">${Nu(e.title)}</span>`,t+=" "),e.data)for(const a of e.data)a.missing!==!0&&(t+=eO(a.label??a.fallbackLabel,Ne(a.value),s),t+=" ");return t}function tO(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${qi}-footer">${i}</div>`}function iO(e,t,i,s){const n=t.items.length===1?t.items[0]:void 0;let a,o,r;switch(i){case"compact":a=!0,o=Ne(n?.title);break;case"single":const h=Br(t.heading);a=n!=null&&(!h||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,r=Ne(h?t.heading:n?.title);break;case"shared":a=!1}let l="";if(a&&n!=null){if(Br(o)&&(l+=`<span class="${qi}-title">${Nu(o)}</span>`),n.data)for(const h of n.data)h.missing!==!0&&(l+=eO(h.label??r,Ne(h.value),!1),l+=" ")}else{Br(t.heading)&&(l+=`<span class="${qi}-heading">${Nu(Ne(t.heading))}</span>`,l+=" ");for(const h of t.items)l+=cK(h)}if(l.length===0)return;const c=i!=="compact"&&s!=null?tO(e,s):void 0;return c+null&&(l+=c),l=`<div class="${qi}-content">${l.trimEnd()}</div>`,l}function hK(e,t){const i=t==null?void 0:tO(e,t);return i==null?"":`<div class="${qi}-content">${i}</div>`}function dK(e,t,i,s){const n=J1(t);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return iO(e,n[0],i,s);{const a=n.map(o=>o.type==="structured"?iO(e,o,i):o.rawHtmlString);return s!=null&&a.push(hK(e,s)??""),a.join("")}}}var uK={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},pK={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},gK={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},sO={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},fK={pointer:"top",node:"top",chart:"top-left"},Tu=class extends X{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};g([m],Tu.prototype,"xOffset",2),g([m],Tu.prototype,"yOffset",2),g([m],Tu.prototype,"anchorTo",2),g([m],Tu.prototype,"placement",2);var qa=class extends X{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Tu,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new pt,this.springAnimation=new sK,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new vT,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(e,t){return"togglePopover"in Re().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",qi),this.element.setAttribute("popover","manual"),this.element.className=qi,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",qi),this.cleanup.flush(),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:a}=i,{x:o,y:r}=this.springAnimation,l=a.position?.anchorTo??"pointer";let c=a.position?.placement??fK[l];Array.isArray(c)||(c=[c]);const h=a.position?.xOffset??0,d=a.position?.yOffset??0,u=n.x,p=n.y,f=n.width-t.width-1+u,y=n.height-t.height+p;let b=0,x,v,S=!1;do{x=c[b],b+=1;const C=this.getTooltipBounds({elementSize:t,placement:x,anchorTo:l,canvasX:o,canvasY:r,yOffset:d,xOffset:h,canvasRect:s});v=ix(t.width,t.height,n,C),S=!1,sO[x]&1&&(S||(S=v.x<u||v.x>f)),sO[x]&2&&(S||(S=v.y<p||v.y>y))}while(b<c.length&&S);const M=ae(u,v.x,f),D=ae(p,v.y,y);S||(S=M!==v.x||D!==v.y);const I=l!=="chart"&&!S&&!h&&!d,k=a.showArrow??this.showArrow??I;this.arrowPosition=k?gK[x]:void 0,this.updateClassModifiers(),e.style.translate=`${M}px ${D}px`}show(e,t,i,s,n,a=!1){const{element:o}=this;if(o!=null&&s!=null&&s.length!==0){const c=dK(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){o.innerHTML="",this.toggle(!1);return}o.innerHTML=c}else if(o==null||o.innerHTML===""){this.toggle(!1);return}const r={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:r,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,o.style.pointerEvents="auto",o.removeAttribute("aria-hidden"),o.tabIndex=-1):(this.enableInteraction=!1,o.style.pointerEvents="none",o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex")),o.style.setProperty("--top",`${t.top}px`),o.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,a)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:e},t){const{interactive:i,interactiveLeave:s,enabled:n,element:a}=this;if(a==null)return!1;if(s)return!0;const o=i&&n&&this.isVisible()&&Up(e)&&this.contains(e);return o&&(this.interactiveLeave={callback:t,listener:r=>{(r.relatedTarget==null||Up(r.relatedTarget)&&!this.contains(r.relatedTarget))&&this.popInteractiveLeaveCallback()}},a.addEventListener("focusout",this.interactiveLeave.listener),a.addEventListener("mouseout",this.interactiveLeave.listener)),o}popInteractiveLeaveCallback(){const{interactiveLeave:e,element:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback()))}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(i,s)=>e.toggle(`${qi}--${i}`,s);t("no-interaction",!this.enableInteraction),t("arrow-top",this.arrowPosition===1),t("arrow-right",this.arrowPosition===3),t("arrow-bottom",this.arrowPosition===2),t("arrow-left",this.arrowPosition===0),t("compact",this.mode==="compact"),e.toggle(oK,this.darkTheme);for(const i of this.wrapTypes)e.toggle(`${qi}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:s,canvasX:n,canvasY:a,yOffset:o,xOffset:r,canvasRect:l}=e,{width:c,height:h}=t,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=uK[s],p=pK[s];return d.top=a+o+h*(p-1)/2+8*p,d.left=n+r+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=o,d.left=l.width/2-c/2+r,d;case"right":return d.top=l.height/2-h/2+o,d.left=l.width-c+r,d;case"left":return d.top=l.height/2-h/2+o,d.left=r,d;case"bottom":return d.top=l.height-h+o,d.left=l.width/2-c/2+r,d;case"top-left":return d.top=o,d.left=r,d;case"top-right":return d.top=o,d.left=l.width-c+r,d;case"bottom-right":return d.top=l.height-h+o,d.left=l.width-c+r,d;case"bottom-left":return d.top=l.height-h+o,d.left=r,d}return d}};g([m],qa.prototype,"enabled",2),g([m],qa.prototype,"mode",2),g([m],qa.prototype,"showArrow",2),g([m],qa.prototype,"delay",2),g([m],qa.prototype,"range",2),g([m],qa.prototype,"wrapping",2),g([m],qa.prototype,"position",2),g([m],qa.prototype,"pagination",2),g([m],qa.prototype,"darkTheme",2),g([m],qa.prototype,"bounds",2);function mK(e){return e.datum.itemId!==void 0?e.datum.itemId:typeof e.datum.datumIndex=="number"?e.datum.datumIndex:JSON.stringify(e.datum.datumIndex)}function ib(e,t){return e.series===t.series&&Ht(e.datumIndex,t.datumIndex)}function yK(e,t){return t==null?-1:e.findIndex(i=>ib(i,t))}var xK=class{constructor(e,t,i){this.activeManager=e,this.tooltipProperties=t,this.focusState=i,this.candidates=[],this.activeState=new Xg}getActive(){return this.activeState.stateValue()}clear(){this.activeState.clear(),this.lastNotifiedActive=void 0,this.candidates.length=0,this.pendingPickedNodes=void 0}setSource(e,t){t===void 0?this.activeState.delete(e):this.activeState.set(e,t),this.syncActiveManager()}syncActiveManager(){const e=this.getActive(),t=this.lastNotifiedActive;if(e!==t&&!(e!==void 0&&t!==void 0&&ib(e,t)))if(this.lastNotifiedActive=e,e===void 0)this.activeManager.clear();else{const i=e.series.id,s=mK(e);this.activeManager.update({type:"series-node",seriesId:i,itemId:s},e.datum)}}popPendingPickedNodes(){const e=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,e}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(e){if(e!==void 0){const i=this.getActive();if(this.tooltipProperties.pagination&&i!==void 0){const s=e.matches.find(n=>ib(n,i));if(s)return s}}const t=e?.matches[0];return this.setSource("highlight",t),t}onPickedNodesTooltip(e){if(e!==void 0&&this.tooltipProperties.pagination){const i=this.getActive(),s=e.matches;this.candidates=s;let n=yK(s,i);n===-1&&(n=0);const a=s[n];this.setSource("tooltip",a);const o={index:n,length:s.length};return{active:a,paginationState:o}}const t=e?.matches[0];return this.setSource("tooltip",t),{active:t}}onPickedNodesFocus(e){const{series:t}=this.focusState;if(this.clear(),t!==void 0&&e!==void 0){const{datum:i,datumIndex:s}=e;this.setSource("focus",{series:t,datum:i,datumIndex:s})}}onPickedNodesAPI(e){return this.pendingPickedNodes=e,e.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:e}=this,t=this.getActive(),i=t==null?-1:e.findIndex(o=>ib(o,t));if(i===-1)return{active:void 0,paginationState:void 0};let s=i+1;s>=e.length&&(s=0);const n=e[s];this.setSource("tooltip",n);const a={index:s,length:this.candidates.length};return{active:n,paginationState:a}}return{active:this.getActive()}}},nO=class extends vD{constructor(e){super(),this.chart=e,this.id=Ii(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=aj(()=>{if(this.hoverDevice==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=7){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.pickManager=new xK(e.ctx.activeManager,e.tooltip,this.focus);const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new Z$(i,s,"img",t),this.swapChain.addListener("blur",r=>this.onBlur(r)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new Y$(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:n,seriesWidget:a,containerWidget:o}=e.ctx.widgets;a.setTabIndex(-1),this.cleanup.register(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),a.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),a.addListener("mousemove",r=>this.onHover(r,a)),a.addListener("wheel",r=>this.onWheel(r)),a.addListener("mouseleave",r=>this.onLeave(r)),a.addListener("keydown",r=>this.onKeyDown(r)),a.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),o.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),o.addListener("click",(r,l)=>this.onClick(r,l)),o.addListener("dblclick",(r,l)=>this.onClick(r,l)),e.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),e.ctx.eventsHub.on("active:load-memento",r=>this.onActiveLoadMemento(r)),e.ctx.eventsHub.on("active:update",r=>this.onActiveUpdate(r)),e.ctx.eventsHub.on("dom:resize",()=>this.clearAll()),e.ctx.eventsHub.on("highlight:change",r=>this.changeHighlightDatum(r)),e.ctx.eventsHub.on("layout:complete",r=>this.layoutComplete(r)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.eventsHub.on("zoom:change-complete",()=>this.clearAll()),e.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),n&&this.cleanup.register(n.events.on("drag-move",r=>this.onDragMove(r,a)),n.events.on("click",r=>this.onClick(r,a)),n.events.on("dblclick",r=>this.onClick(r,a)))}get bbox(){return(this.seriesRect??le.zero).clone()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var e;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((e=this.highlight).stashedHoverEvent??(e.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(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let s=t.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[t.declarationOrder,i.declarationOrder]),s<n?-1:s>n?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onAnimationStart(){this.hoverDevice!=="setState"&&this.clearAll()}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(t!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,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=Wt.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");c&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=c.matches[0].datum)}const a=s?.series;this.clearAll();const o=e.currentX+t.cssLeft(),r=e.currentY+t.cssTop(),{datumIndex:l}=s??{};a&&s&&l!=null?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:o,canvasY:r},{pickedSeries:a,pickedNode:{...s,datumIndex:l}},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:o,canvasY:r},void 0,n)}onLeave(e){!this.isState(82)||e.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll(!0))}onWheel(e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.hoverDevice="pointer")}onDragMove(e,t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(82)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(this.isIgnoredTouch(e)||(e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),t!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=e,this.hoverDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule();let i;if(this.isState(64)){const{currentX:n,currentY:a}=e;i=this.pickNodes({x:n,y:a},"event");const o=i?.matches,r=o?.[0];r?.series.hasEventListener("seriesNodeClick")||r?.series.hasEventListener("seriesNodeDoubleClick")||o!=null&&o.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(e,s)}onClick(e,t){if(e.device==="keyboard"||(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),e.device==="touch"&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(82)))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t);const i=t===this.chart.ctx.widgets.seriesWidget;if(!this.isState(64)){i&&this.emitSeriesAreaClickEvent(e,!1);return}if(i){if(this.checkSeriesNodeClick(e)){this.emitSeriesAreaClickEvent(e,!0),this.update(7),e.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(e,!1)}const s={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(s)}emitSeriesAreaHoverEvent(e,t){const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e),n={canvasX:i,canvasY:s,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",n)}emitSeriesAreaClickEvent(e,t){if(!("currentX"in e))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e),n={canvasX:i,canvasY:s,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:click",n)}toCanvasCoordinates(e){return{canvasX:e.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:e.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(e){this.isState(68)&&(this.hoverDevice="pointer",this.maybeEnterInteractiveTooltip(e)||this.clearAll(!0),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(86))return;const t=Q$(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.hoverDevice==="keyboard"),t?.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:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:e});case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(68)&&(this.hoverDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.eventsHub.emit("series:focus-change",null))}onSubmit(e){if(!this.isState(68))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!=null&&i!=null?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event"),s=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||s.active===void 0)return!1;const{series:n,datum:a}=s.active,o=s.paginationState==null?i.distance:0;if(e.type==="click"){if(n.fireNodeClickEvent(e.sourceEvent,a)){const l=this.pickManager.nextCandidate();if(l.active!==void 0){const{canvasX:c,canvasY:h}=this.toCanvasCoordinates(e);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.active,c,h,l.paginationState)}}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=o===0,n.fireNodeDoubleClickEvent(e.sourceEvent,a),!0):!1}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(e,t)===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(e,t){if(this.chart.chartType==="standalone")return this.handleSoloSeriesFocus(e,t);const{focus:i}=this,s=i.sortedSeries.filter(l=>l.visible&&l.focusable);if(s.length===0)return 1;const n=i.datumIndex-t,a=i.seriesIndex-e;i.seriesIndex=ae(0,i.seriesIndex,s.length-1),i.series=s[i.seriesIndex];const o=this.focus.datumIndex,r=this.focus.seriesIndex;return this.updatePickedFocus(o,t,n,r,e,a)}handleSoloSeriesFocus(e,t){this.focus.series=this.focus.sortedSeries[0];const i=this.focus.datumIndex,s=this.focus.seriesIndex,n=this.focus.datumIndex-t,a=this.focus.seriesIndex-e;return this.updatePickedFocus(i,t,n,s,e,a)}pickFocus(e,t){const i=e.pickFocus(t);return this.hoverDevice==="keyboard"&&this.pickManager.onPickedNodesFocus(i),i}updatePickedFocus(e,t,i,s,n,a){const{focus:o,hoverRect:r,seriesRect:l}=this;if(o.series==null||r==null)return 1;const c={datumIndex:e,datumIndexDelta:t,otherIndex:s,otherIndexDelta:n,seriesRect:l},h=this.pickFocus(o.series,c);if(!h)return 2;const{datum:d}=h;if(o.datum=d,o.datumIndex=h.datumIndex,h.otherIndex!=null&&(o.seriesIndex=h.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const f=eK(h),{x:y,y:b}=f.computeCenter();if(!r.containsPoint(y,b)&&this.chart.ctx.zoomManager.panToBBox(r,f))return 3;const{x1:x,x2:v,y1:S,y2:M}=ve.from(f),D=r.containsPoint(x,S),I=r.containsPoint(v,S),k=r.containsPoint(x,M),C=r.containsPoint(v,M);if(!(D||I||k||C)){const A=ve.from(r);h.movedBounds=f.clone(),x<A.x1&&v<A.x1?(h.movedBounds.x=A.x1-2,h.movedBounds.width=4):x>A.x2&&v>A.x2&&(h.movedBounds.x=A.x2-2,h.movedBounds.width=4),S<A.y1&&M<A.y1?(h.movedBounds.y=A.y1-2,h.movedBounds.height=4):S>A.y2&&M>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(o.series,d.datumIndex,d,"aria-label"),p=tK(o.series,r,h);if(p!=null&&this.hoverDevice==="keyboard"){this.clearCachedEvents();const f=Yx.makeTooltipMeta(p,o.series,d,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,d),this.isTooltipEnabled(o.series)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,f,u)}return this.maybeAnnouncePickedFocus(t,i,n,a,h,u),0}maybeAnnouncePickedFocus(e,t,i,s,n,a){const{focus:o}=this;let r;this.announceMode==="when-changed"?e===0&&i===0||t!==n.datumIndex||s!==(n.otherIndex??o.seriesIndex)?r="always":r="never":r=this.announceMode,r==="always"&&this.swapChain.update(this.getDatumAriaText(n.datum,a))}getDatumAriaText(e,t){const i=t==null?"":lK(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(e=!1){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,e)}clearTooltip(e=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,e),this.tooltip.lastHover=void 0}clearAll(e=!1){this.pickManager.onClearUI(),this.clearHighlight(e),this.clearTooltip(e),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:e,paginationState:t}=this.pickManager.onPickedNodesAPIDebounced();if(e===void 0)return;this.chart.ctx.highlightManager.updateHighlight(this.id,e.datum);const i=$D(e.series,e.datum,void 0);if(this.chart.tooltip.enabled&&i){const{canvasX:s,canvasY:n}=i;this.showTooltip(e,s,n,t)}}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(82))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t);if(e?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",o=this.pickNodes({x:t.currentX,y:t.currentY},a),r=this.pickManager.onPickedNodesHighlight(o);r===void 0?this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0):this.chart.ctx.highlightManager.updateHighlight(this.id,r.datum,!1)}handleHoverTooltip(e,t){if(!this.isState(82))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e),n=e.sourceEvent.target;if(t?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",qi))return;const a=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip"),{active:o,paginationState:r}=this.pickManager.onPickedNodesTooltip(a);o===void 0?this.hoverDevice=="pointer"&&this.clearTooltip(!0):this.showTooltip(o,i,s,r)}showTooltip({series:e,datum:t,datumIndex:i},s,n,a){const o=this.getTooltipContent(e,i,t,"tooltip");if(o!=null){const l=Yx.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,l,o,a)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&i.properties.cursor!=="default"&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),this.hoverDevice==="setState"||i==null||t==null?this.update(7,{clearCallbackCache:!0}):this.update(7,{seriesToUpdate:new Set([t,i].filter(Boolean)),clearCallbackCache:!0})}pickNodes(e,t,i){const s=[...this.series].reverse(),n=t==="event"||t==="context-menu",a=t==="tooltip"||t==="highlight-tooltip",o=u=>{if(n)return u.properties.nodeClickRange;if(a)return u.properties.tooltip.range},{x:r,y:l}=e,c=new Set;for(const u of s)u.visible&&u.contentGroup.visible&&o(u)==="area"&&u.isPointInArea?.(r,l)&&c.add(u);const h=c.size>0;let d;for(const u of s){if(!u.visible||!u.contentGroup.visible||h&&!(o(u)==="area"&&c.has(u)))continue;const p=u.pickNodes(e,t,i);if(p==null||p.datums.length===0)continue;const{datums:f,distance:y}=p;if(p.datums.length!==0){if(y===0){d?.distance!==0&&(d={matches:[],distance:0});for(const b of f){const{datumIndex:x}=b;d.matches.push({series:u,datum:b,datumIndex:x})}}else if(d==null||d.distance>y){const[b]=f,{datumIndex:x}=b;d={matches:[{series:u,datum:b,datumIndex:x}],distance:y}}}}return d}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t,i,s){let n;if(s==="aria-label"||this.isTooltipEnabled(e)){const{cachedTooltipContent:a}=this;if(a?.series===e&&a.datumIndex===t)n=a.content;else{const o=this.chart.getTooltipContent(e,t,i,s);this.cachedTooltipContent={series:e,datumIndex:t,content:o},n=o}}else this.cachedTooltipContent=void 0;return n}onActiveLoadMemento(e){switch(e.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(e.activeItem,e);default:return e.activeItem?.type}}onActiveUpdate(e){e?.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:e,itemId:t}=this.activeState.lastActive,i=this.findPickedNodes(e,t);i&&(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(e,t){const{seriesId:i,itemId:s}=e,n=this.findPickedNodes(i,s);if(n===void 0)t.reject(),this.onActiveClear();else{const a=this.pickManager.onPickedNodesAPI(n);t.setDatum(a?.datum),this.hoverDevice="setState",this.activeState.lastActive={seriesId:i,itemId:s},t.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(e,t){const i=this.series.find(a=>a.id===e);if(i==null){K.warn(`Cannot find seriesId: "${e}"`);return}const s=i.findNodeDatum(t);if(s==null){K.warn(`Cannot find itemId: ${JSON.stringify(t)}`);return}return{matches:[{datum:s,datumIndex:s.datumIndex,series:i}],distance:0}}};nO.className="SeriesAreaManager";var aO=30,bK=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}getGroupIndex(e){const{internalId:t,seriesGrouping:i}=e;return i?.groupIndex??t}getGroupType(e,t){return t?"top":e.type}requestGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),a=this.getGroupIndex(e),o=this.series.get(t);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=aO?"aggressive-grouping":"normal");let r=this.groups.get(n);r==null&&(r=new Map,this.groups.set(n,r));const l=this.lookupIdx(a);let c=r.get(l);return c==null&&(c={type:n,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Le({name:`${e.contentGroup.name??n}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e,bringToFront:s}),c.seriesIds.push(t),c.group.appendChild(i),c.group}changeGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),a=this.series.get(t),o=a?this.getGroupType(a.seriesConfig,a.bringToFront):void 0,r=this.getGroupIndex(e),l=this.lookupIdx(r),c=this.groups.get(n)?.get(l);if(!(o===n&&c?.seriesIds.includes(t)===!0))return this.series.has(t)&&this._releaseGroup({internalId:t,contentGroup:i,type:o}),this.requestGroup(e)}releaseGroup(e){const{internalId:t,contentGroup:i}=e,s=this.getGroupType(e,e.bringToFront());this._releaseGroup({internalId:t,contentGroup:i,type:s})}_releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const n=this.series.get(t)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(a=>a!==t),i.remove()),n?.seriesIds.length===0?(n.group.remove(),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(t)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(t)}updateLayerCompositing(){for(const e of this.groups.values())for(const t of e.values()){const{group:i,seriesIds:s}=t;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(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!Number.isFinite(e))?0:Math.floor(ae(0,e/this.expectedSeriesCount,1)*aO)}destroy(){for(const e of this.groups.values())for(const t of e.values())t.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){let t;for(const i of e){const n=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(t==null||n==null){t=n;continue}t=UN(t,n)<=0?t:n}return t??1}},oO=class extends X{constructor(){super(...arguments),this.dragAction="drag"}};g([m],oO.prototype,"dragAction",2);var vK=class{constructor(e,t,i,s,n,a){this.chart=e,this.eventsHub=t,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 pt,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",o=>this.onUpdateComplete(o)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(5)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){!e.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||e.wasShortcut||this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,s=!0;if(t){const n=this.zoomManager.getAxisZoom(t.id);i=this.getAxisWindow(t,n),s=this.shouldRefresh(e,t,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>e.type==="time")}shouldRefresh(e,t,i){if(e.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(t.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(t.id,i),!0)}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||i.length===0||Number.isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*t.min),a=new Date(Number(i[0])+s*t.max);return{min:n,max:a}}},SK=/^((?!chrome|android).)*safari/i,MK=/Version\/(\d+(\.\d+)?)/,DK=/Chrome/,kK=/Chrome\/(\d+)/,IK=/Edg/,AK=/OPR/;function CK(){const{userAgent:e}=Re("navigator");if(SK.test(e)){const t=MK.exec(e);if(t==null)return!1;const i=Number.parseFloat(t[1]),s=Math.floor(i)>16;return s||K.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}else if(DK.test(e)&&!IK.test(e)&&!AK.test(e)){const t=kK.exec(e);if(t==null)return!1;const i=Number.parseInt(t[1],10),s=i>126;return s||K.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}var wK=new Set(["map-shape-background","map-line-background"]),LK=class{constructor(e,t,i,s,n,a,o){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=a,this.domManager=o,this.cleanup=new pt,this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(lk),this.cleanup.register(this.eventsHub.on("layout:complete",r=>this.onLayoutComplete(r)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!wK.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(K1):this.overlayElem.classList.remove(K1),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const n=t,a=!t&&!i,o=i&&!s,r=this.overlays.unsupportedBrowser.enabled&&CK();n?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),a?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||a||o||r;Pe(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Sa=be.create(!0,"opts"),$t=class g_ extends cT{constructor(t,i){var s;super(),this.id=Ii(this),this.seriesRoot=new ds({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new ds({name:`${this.id}-annotation-root`,zIndex:11}),this.titleGroup=new Le({name:"titles",zIndex:15}),this.debug=be.create(!0,"chart"),this.extraDebugStats={},this.data=Iu.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new Lg,this._requiredRange=0,this._requiredRangeDirection="x",this.chartCaptions=new Rx,this.padding=new Cr(20),this.keyboard=new tk,this.touch=new oO,this.mode="standalone",this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this.cleanup=new pt,this.chartAnimationPhase="initial",this.modulesManager=new W$,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 Lg,this.performUpdateType=10,this.runningUpdateType=10,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new nj,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=fD(({count:d})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,d)).catch(u=>K.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 hk))return;const{series:u,seriesGrouping:p}=d;if(u.contentGroup.isRoot())return;const f=this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,bringToFront:()=>u.bringToFront(),renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:p});f!=null&&u.attachSeries(f,this.seriesRoot,this.annotationRoot)},this.chartOptions=t;const n=i?.scene,a=i?.container??t.processedOptions.container??void 0,o=i?.styleContainer??t.specialOverrides.styleContainer,r=t.specialOverrides.skipCss;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const l=new Le({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 qa,this.seriesLayerManager=new bK(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const c=this.ctx=new YW(this,{chartType:this.getChartType(),scene:n,root:l,container:a,styleContainer:o,skipCss:r,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new e$(this),fireEvent:d=>this.fireEvent(d),updateCallback:(d,u)=>this.update(d,u),updateMutex:this.updateMutex});t.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 Lu,(s=this.overlays.loading).renderer??(s.renderer=()=>$$(this.overlays.loading.getText(c.localeManager),c.animationManager.defaultDuration)),this.processors=[new vK(this,c.eventsHub,c.dataService,c.updateService,c.zoomManager,c.animationManager),new LK(this,this.overlays,c.eventsHub,c.dataService,c.localeManager,c.animationManager,c.domManager)],this.highlight=new QD,this.container=a;const h=this.getModuleContext();this.background=zi.createBackground?.(h)??new vu(h),this.foreground=zi.createForeground?.(h),this.seriesArea=new df(h),c.domManager.setDataBoolean("animating",!1),c.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new nO(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 Iu(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(),Er.addWindowEvent("page-left",()=>this.destroy()),c.animationManager.addListener("animation-frame",()=>{this.update(9),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(5,{forceNodeDataRefresh:!0,skipAnimations:d})})),this.parentResize(c.domManager.containerSize)}static getInstance(t){return g_.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}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(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}fireEvent(t){ls(this,this.fireEventWrapper,t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:a,mode:o}=this,r=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(d,u,p,f)=>this.getTooltipContent(d,u,p,f),chartType:r,ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:a,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(t,i,s,n){const o=n==="aria-label"||t.properties.tooltip.enabled!==!1?t.getTooltipContent(i,s):void 0,r=o==null?[]:[o];if(this.tooltip.mode!=="shared"||this.series.length===1)return r;const l=t.getCategoryValue(i);return l==null?r:this.series.flatMap(c=>{if(c===t)return r;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(t=>t.enabled&&t.text).map(t=>t.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(t,i){for(let s=0;s<this.series.length;s++){const n=this.series[s],a=t.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 t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.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(t){if(this.destroyed)return;const i=t?.keepTransferableResources;let s;this.performUpdateType=10,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(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>K.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const t of this.series)t.resetDatumCallbackCache()}update(t=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:a=this.series,newAnimationBatch:o,apiUpdate:r=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=r,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),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(t===0||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]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}updateSplits(t){const i=this._performUpdateSplits;i[t]??(i[t]=0),i[t]+=performance.now()-this._previousSplit,this._previousSplit=performance.now()}async tryPerformUpdate(t){try{await this.performUpdate(t)}catch(i){K.error("update error",i,i.stack)}}async performUpdate(t){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:a}=this,o=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=10,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<9&&(a.animationManager.startBatch(this._performUpdateSkipAnimations),a.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",xr[i]),this._previousSplit=performance.now(),n.start??(n.start=this._previousSplit),i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))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 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case 4:if(this.checkUpdateShortcut(4))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case 5:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(5))break;await this.processLayout(),this.updateSplits("\u2316");case 6:if(this.checkUpdateShortcut(6))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case 7:{if(this.checkUpdateShortcut(7))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(o),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case 8:if(this.checkUpdateShortcut(8))break;a.updateService.dispatchPreSceneRender(),this.updateSplits("\u2196");case 9:if(this.checkUpdateShortcut(9))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 10: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=10,this.syncStatus="ready"),this._performUpdateNotify.notify();const r=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Sd(r-n.start),count:t,performUpdateType:xr[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}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-",t),n=a.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return this.destroyed?!0:this.updateShortcutCount>3?(K.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",xr[t]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",xr[t]),!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 Ex}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const s=i?.filter(n=>!t.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(t.length);for(const n of t){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(t)}destroySeries(t){if(t)for(const i of t)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(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const i of this.axes){let s=function(n){return n.axes[i.direction]===i};var t=s;i.boundSeries=this.series.filter(s)}}assignAxesToSeries(){for(const t of this.series)for(const i of t.directions){const s=t.getKeyAxis(i)??i,n=this.axes.findById(s);if(!n){K.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}t.axes[i]=n}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=t;const{pixelRatio:n}=t;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[a=0,o=0,r=1]=this._lastAutoSize??[];a===i&&o===s&&r===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:a,inHeight:o,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,a??this.width,o??this.height);const h=a??this.width??this._lastAutoSize?.[0],d=o??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:h,height:d,pixelRatio:u,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||d==null||!Be(h)||!Be(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 f=5;for(const y of this.axes){const b=y.getUpdateTypeOnResize();b<f&&(f=b)}this.update(f,{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 t=new D1(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const s of this.series)i.push(s.processData(t)??Promise.resolve());for(const s of this.modulesManager.modules())s?.processData&&i.push(s.processData(t)??Promise.resolve());this._cachedData=t.execute(this._cachedData),this.updateSplits("\u{1F3ED}"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const t of this.axes)t.processData();for(const t of this.series)t.updatedDomains()}processRanges(){var t;const i={},s={},n=new Map;this._requiredRangeDirection="x";for(const a of this.series)a.visible&&(i[t=a.type]??(i[t]=[]),a.getMinimumRangeSeries(i[a.type]),a.resolveKeyDirection("x")==="y"&&(this._requiredRangeDirection="y"),n.has(a.type)||n.set(a.type,a));for(const[a,o]of n)s[a]=o.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(t){for(const i of fe.listModulesByType("plugin"))switch(i.name){case"legend":this.setCategoryLegendData(t);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(t){const{legendManager:i,stateManager:s}=this.ctx;if(t)for(const a of this.series){const o=t.find(r=>r.seriesId===a.id);a.onLegendInitialState("category",o)}const n=this.series.flatMap(a=>{const o=a.getLegendData("category");return i.updateData(a.id,o),o});if(t){s.setStateAndRestore(i,t);return}if(this.mode!=="integrated"){const a={},o=new Map(this.series.map(r=>[r.id,r]));for(const{seriesId:r,symbol:{marker:l},label:c}of n.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=o.get(r);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&&K.warnOnce(`legend item '${Ne(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):u.set(c.text,l.fill)}}i.update()}async processLayout(){const t=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const t=this.background.fill;if(t)try{const i=Oe.fromString(t),[s]=Oe.RGBtoOKLCH(i.r,i.g,i.b);return{background:t,foreground:s>.5?"black":"white"}}catch{return{background:t}}}preSeriesUpdate(){const{_requiredRange:t,seriesRect:i}=this;if(i==null)return;const s=this._requiredRangeDirection==="x"?i.width:i.height,n=t/s||0;this.ctx.updateService.dispatchPreSeriesUpdate(n,this._requiredRangeDirection)}async updateSeries(t){const{seriesRect:i}=this;function s(n){return n.update({seriesRect:i})}await Promise.all(t.map(s).filter(n=>n!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(n=>n.visible&&n.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t,i){const s=Re("agChartsDebugTimeout");s==null?(t??(t=1e4),i??(i=!1)):(t=s,i??(i=!0));const n=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==10||this.runningUpdateType!==10||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==10||this.runningUpdateType!==10||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-n>t){const a=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(a);K.warnOnce(a)}iM()&&await Gy(),this.ctx.scene.waitingForUpdate()&&await Gy(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){t.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,t.seriesWithUserVisibility);const i=5,s=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){Sa("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,a=t.processedOptions;Sa("Chart.applyOptions() - applying delta",s);const o=this.applyModules(),r=["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),$d(this,s,{skip:r});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}=t,d=h===void 0||h.has("data");if(s.data&&d){const S=s.data,M=t.userOptions.data,I=Array.isArray(S)&&S!==M?S.slice():S;this.data=new Iu(I)}if("legend"in s&&s.legend&&"listeners"in s.legend&&this.modulesManager.isEnabled("legend")){const S=s.legend.listeners;S?Object.assign(this.legend.listeners,S):this.legend.listeners.clear()}s.locale?.localeText&&(this.pendingLocaleText=s.locale?.localeText),this.chartOptions=t;const u=this.modulesManager.getModule("navigator"),p=this.modulesManager.getModule("zoom"),f=this.modulesManager.getModule("scrollbar");!u?.enabled&&!p?.enabled&&!f?.enabled&&this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const y=u?.miniChart,b=a.navigator?.miniChart?.series??a.series;y?.enabled===!0&&b!=null?this.applyMiniChartOptions(y,b,a,n):y?.enabled===!1&&(y.series=[],y.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const v=l||o?0:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(a,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(a),this.ctx.formatManager.setFormatter(a.formatter),Sa("Chart.applyOptions() - update type",xr[v],{seriesStatus:c,forceNodeDataRefresh:l}),t.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=t.optionsProcessingTime;const S=performance.now()-t.optionsProcessingTime;this._performUpdateSplits.start=S}this.update(v,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(t){const{activeManager:i,annotationManager:s,chartTypeOriginator:n,historyManager:a,stateManager:o,zoomManager:r}=this.ctx,{initialState:l}=t;if("annotations"in t&&t.annotations?.enabled&&l?.annotations!=null){const c=l.annotations.map(h=>{const d=s.getAnnotationTypeStyles(h.type);return re(h,d)});o.setState(s,c)}l?.chartType!=null&&o.setState(n,l.chartType),(t.navigator?.enabled||t.zoom?.enabled||t.scrollbar?.enabled)&&l?.zoom!=null&&o.setState(r,l.zoom),l?.active!=null&&o.setState(i,l.active),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&a.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(t,i){const s=!!t.data||i==="data-change"||i==="replaced",n=["legend","gradientLegend"].some(o=>t[o]!=null),a=t.title!=null&&t.subtitle!=null||t.formatter!=null;return s||n||a}shouldClearLegendData(t,i,s){const n=s==="replaced"||s==="series-count-changed"||s==="series-grouping-change"||s==="updated"&&(t.series?.length!==i.series?.length||!t.series?.every((o,r)=>o.type===i.series?.[r].type)),a=i.legend!=null&&i.legend.enabled!==!1&&(t.legend==null||t.legend.enabled===!1);return n||a}applyMiniChartOptions(t,i,s,n){const a=n?.navigator?.miniChart?.series??n?.series,o=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(a));this.applyAxes(t,s,n,o,["tick","thickness","title","crosshair","gridLine","label"]);const r=t.series;for(const h of r)h.properties.id=void 0;const l=t.axes,c=l.find(h=>h.direction==="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(J(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 f=1;f<p.length;f++)p[f].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:t}=this.constructor;let i=!1;for(const s of fe.listModulesByType("plugin")){const n=!s.chartType||s.chartType===t;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(t){for(let i=0;i<t.length;i++)t[i].setSeriesIndex(i)}applySeries(t,i,s){if(!i)return"no-change";const n=H$(t.series,i,s);if(n.status==="no-overlap"){Sa(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const d=i.map(u=>this.createSeries(u));return this.initSeriesDeclarationOrder(d),t.series=d,"replaced"}Sa("Chart.applySeries() - matchResult",n);const a=[];let o=!1,r=!1,l=!1,c=!1;const h=n.changes.toSorted((d,u)=>d.targetIdx-u.targetIdx);for(const d of h)switch(r||(r=d.status==="series-grouping"),o||(o=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),Sa("Chart.applySeries() - created new series",u);break}case"remove":Sa(`Chart.applySeries() - removing series at previous idx ${d.idx}`,d.series);break;case"no-op":a.push(d.series),Sa(`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:f}=d;Sa(`Chart.applySeries() - applying series diff previous idx ${f}`,p,u),this.applySeriesValues(u,p),u.markNodeDataDirty(),a.push(u)}}return this.initSeriesDeclarationOrder(a),Sa("Chart.applySeries() - final series instances",a),t.series=a,r?"series-grouping-change":c?"series-count-changed":o?"data-change":l?"updated":"no-op"}applyAxes(t,i,s,n,a=[]){if(!("axes"in i)||!i.axes)return!1;a=["type",...a];const o=i.axes;if(!(n==="replaced")&&t.axes.matches(o)&&j$(s)){for(const c of t.axes){const h=s.axes?.[c.id]??{},d=Hn(h,o[c.id]);Sa(`Chart.applyAxes() - applying axis diff idx ${c.id}`,d),$d(c,d,{skip:a})}return!0}return Sa(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),t.axes=this.createAxes(o,a),!0}createSeries(t){const s=fe.getSeriesModule(t.type).create(this.getModuleContext());return this.applySeriesOptionModules(s,t),this.applySeriesValues(s,t),s}applySeriesOptionModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const a of fe.listModulesByType("series:plugin"))a.name in i&&(a.seriesTypes?.includes(t.type)??!0)&&n.addModule(a.name,a.create(s))}applySeriesValues(t,i){const s=t.getModuleMap(),{type:n,data:a,listeners:o,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const h of fe.listModulesByType("series:plugin"))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&&(t.visible=c.visible),t.properties.set(c),"data"in i&&t.setOptionsData(a==null?void 0:Iu.wrap(a)),"listeners"in i&&(this.registerListeners(t,o),this.series.includes(t)&&this.addSeriesListeners(t)),"seriesGrouping"in i&&(r==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...r})}createAxes(t,i){const s=this.createChartAxes(),n=this.getModuleContext();for(const[a,o]of rt(t)){const r=fe.getAxisModule(o.type).create(n);r.id=a,this.applyAxisModules(r,o),$d(r,o,{skip:i}),s.push(r)}return _$(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const a of fe.listModulesByType("axis:plugin")){const o=i[a.name]!=null;o!==n.isEnabled(a.name)&&(o?(n.addModule(a.name,a.create(s)),t[a.name]=n.getModule(a.name)):(n.removeModule(a.name),delete t[a.name]))}}registerListeners(t,i){if(t.clearEventListeners(),i&&typeof i=="object")for(const[s,n]of rt(i))n!=null&&t.addEventListener(s,n)}async applyTransaction(t){await this.updateMutex.acquire(()=>{this.data.addTransaction(t),this.update(1,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}};$t.className="Chart",$t.chartsInstances=new WeakMap,g([_e({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),$t.chartsInstances.set(e,this))},oldValue(e){$t.chartsInstances.delete(e)}})],$t.prototype,"container",2),g([_e({newValue(e){this.resize("width option",{inWidth:e})}})],$t.prototype,"width",2),g([_e({newValue(e){this.resize("height option",{inHeight:e})}})],$t.prototype,"height",2),g([_e({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],$t.prototype,"minWidth",2),g([_e({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],$t.prototype,"minHeight",2),g([_e({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],$t.prototype,"overrideDevicePixelRatio",2),g([m],$t.prototype,"padding",2),g([m],$t.prototype,"keyboard",2),g([m],$t.prototype,"touch",2),g([m],$t.prototype,"mode",2),g([m],$t.prototype,"styleNonce",2),g([Gt("chartCaptions.title")],$t.prototype,"title",2),g([Gt("chartCaptions.subtitle")],$t.prototype,"subtitle",2),g([Gt("chartCaptions.footnote")],$t.prototype,"footnote",2),g([m],$t.prototype,"formatter",2),g([m],$t.prototype,"suppressFieldDotNotation",2),g([m],$t.prototype,"loadGoogleFonts",2),g([_e({changeValue(e,t){this.onAxisChange(e,t)}})],$t.prototype,"axes",2),g([_e({changeValue(e,t){this.onSeriesChange(e,t)}})],$t.prototype,"series",2);var sb=$t;function rO(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var gi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Fr={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},uk="white",NK={"radial-gauge":!0,"linear-gauge":!0};function Ou(e){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${e}`,{$lessThan:[{$path:`/series/$index/${e}`},1]},!1]}]},{$path:"/series"}]}}function TK(e){return NK[e]===!0}var Zn=class Tm{static getDefaultColors(){return{fills:gi,fillsFallback:Object.values(gi),strokes:Fr,sequentialColors:mn(gi),divergingColors:[gi.ORANGE,gi.YELLOW,gi.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Oe.interpolate([Oe.fromHexString(gi.BLUE),Oe.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[gi.GREEN,gi.YELLOW,gi.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:gi.GREEN,stroke:Fr.GREEN},down:{fill:gi.RED,stroke:Fr.RED},neutral:{fill:gi.GRAY,stroke:Fr.GRAY},altUp:{fill:gi.BLUE,stroke:Fr.BLUE},altDown:{fill:gi.ORANGE,stroke:Fr.ORANGE},altNeutral:{fill:gi.GRAY,stroke:Fr.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:uk,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:Va,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:t,time:i}){return re(t&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ki.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:ki.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Do,textAlign:Sr},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ki.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Do,textAlign:Sr},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:ki.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Do,textAlign:Sr},highlight:{drawingMode:{$if:[{$or:[Ou("highlight/highlightedItem/opacity"),Ou("highlight/unhighlightedItem/opacity"),Ou("highlight/highlightedSeries/opacity"),Ou("highlight/unhighlightedSeries/opacity"),Ou("fillOpacity"),Ou("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:Il,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:Il},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(t={}){const{overrides:i,palette:s,params:n}=Te(t),a=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.processOverrides(o,i);const{fills:r,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=Ks(re(s,{fills:Object.values(r),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=rO(s),this.params=re(n,this.getPublicParameters()),this.config=Ks(Te(a)),this.overrides=Ks(i),this.presets=Ks(o)}processOverrides(t,i){for(const s of fe.listModulesByType("series")){const n=s.name,a=i[n];TK(n)&&(t[n]=a,delete i[n])}}createChartConfigPerChartType(t){var i;for(const s of fe.listModulesByType("chart"))for(const n of fe.listModulesByType("series"))n.chartType===s.name&&(t[i=n.name]??(t[i]=s.themeTemplate));return t}getDefaults(){const t=(n,a)=>{const o={},r=re({axes:{}},...Array.from(fe.listModulesByType("plugin"),l=>({[l.name]:l.themeTemplate})),fe.getChartModule(n)?.themeTemplate,this.getChartDefaults());for(const l of a){o[l]=re(PK(l),o[l]??r);const{axes:c}=o[l];for(const h of fe.listModulesByType("axis"))c[h.name]=re(c[h.name],!h.chartType||h.chartType===n?OK(h.name):null,Tm.axisDefault[h.name]);(l==="map-shape-background"||l==="map-line-background")&&delete o[l].series.tooltip}return o},i=[...fe.listModulesByType("series")],s=cd(i,n=>n.chartType||"unknown");return re(...Object.keys(s).map(n=>t(n,s[n]?.map(a=>a.name)??[])))}static applyTemplateTheme(t,i,s){if(De(t))for(let n=0;n<t.length;n++){const a=t[n];typeof a=="symbol"&&s?.has(a)&&(t[n]=s.get(a))}else for(const n of Object.keys(t)){const a=t[n];typeof a=="symbol"&&s?.has(a)&&(t[n]=s.get(a))}}templateTheme(t,i=!0){const s=i?Te(t):t,n=this.getTemplateParameters();return ko(s,Tm.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Tm.getDefaultColors()}getPublicParameters(){return Tm.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(Il,!1),t.set(Mo,"#00000080"),t.set(Ig,"#aaa"),t.set(Do,"block"),t.set(Sr,"center"),t.set(Td,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(kg,uk),t.set(Ls,gi.BLUE),t.set(rs,gi.BLUE),t.set(Ag,gi.BLUE),t.set(Od,uk),t.set(Pd,"#fafafa"),t.set(Ed,"#ddd"),t.set(Rd,"#000"),t.set(zd,"#181d1f"),t.set(Vd,"#e35c5c"),t.set(Bd,"#e35c5c"),t.set(Fd,"#fafafa"),t.set(_d,"#ddd"),t.set(Hd,"#000"),t.set(Gd,"top");const i=this.getDefaultColors();return t.set(Iy,this.palette.up?.stroke??i.up.stroke),t.set(Cy,this.palette.up?.fill??i.up.fill),t.set(Ay,this.palette.down?.stroke??i.down.stroke),t.set(wy,this.palette.down?.fill??i.down.fill),t.set(Ly,this.palette.neutral?.stroke??i.neutral.stroke),t.set(Ny,this.palette.neutral?.fill??i.neutral.fill),t.set(Ty,this.palette.altUp?.stroke??i.up.stroke),t.set(Py,this.palette.altUp?.fill??i.up.fill),t.set(Oy,this.palette.altDown?.stroke??i.down.stroke),t.set(Ey,this.palette.altDown?.fill??i.down.fill),t.set(Ry,this.palette.altNeutral?.fill??i.altNeutral.fill),t.set(zy,this.palette.altNeutral?.stroke??i.altNeutral.stroke),t}};Zn.axisDefault={number:Zn.getAxisDefaults({title:!0,time:!1}),log:Zn.getAxisDefaults({title:!0,time:!1}),category:Zn.getAxisDefaults({title:!0,time:!1}),"grouped-category":Zn.getAxisDefaults({title:!0,time:!1}),time:Zn.getAxisDefaults({title:!0,time:!0}),"unit-time":Zn.getAxisDefaults({title:!0,time:!0}),"ordinal-time":Zn.getAxisDefaults({title:!0,time:!0}),"angle-category":Zn.getAxisDefaults({title:!1,time:!1}),"angle-number":Zn.getAxisDefaults({title:!1,time:!1}),"radius-category":Zn.getAxisDefaults({title:!0,time:!1}),"radius-number":Zn.getAxisDefaults({title:!0,time:!1})};var Qa=Zn;function OK(e){let t=fe.getAxisModule(e)?.themeTemplate??{};for(const i of fe.listModulesByType("axis:plugin"))(i.axisTypes?.includes(e)??!0)&&(t=re({[i.name]:i.themeTemplate},t));return t}function PK(e){let t=fe.getSeriesModule(e)?.themeTemplate??{};for(const i of fe.listModulesByType("series:plugin"))(i.seriesTypes?.includes(e)??!0)&&(t=re({series:{[i.name]:i.themeTemplate}},t));return t}var EK=new Set(["foreground"]);function lO(e){const t=new Map;for(const[h,{type:d}]of Ul)fe.hasModule(h)||(t.has(d)?t.get(d).add(h):t.set(d,new Set([h])));if(t.size===0)return e;function i(h){const d=t.get("plugin");if(!(!ge(h)||!d))for(const u of d)u in h&&h[u].enabled!==!0&&delete h[u]}function s(h){const d=t.get("series:plugin");if(!(!ge(h)||!d))for(const u of d)u in h&&delete h[u]}function n(h){const d=t.get("axis:plugin");if(!(!ge(h)||!d))for(const u of d)u in h&&h[u].enabled!==!0&&delete h[u]}function a(h){if(ge(h))for(const d of Object.keys(h)){if(t.get("axis")?.has(d)){delete h[d];continue}n(h[d])}}function o(h){ge(h)&&(a(h.axes),i(h),s(h.series))}const r=Te(e.config),l=Te(e.overrides),c=Te(e.presets);for(const h of Object.keys(r)){if(t.get("series")?.has(h)){delete r[h];continue}o(r[h])}if(ge(l)){const h=l;ge(h.common)&&(a(h.common.axes),i(h.common));for(const d of Object.keys(h))if(d!=="common"){if(t.get("series")?.has(d)){delete h[d];continue}o(h[d])}}if(ge(c)){const h=c;for(const d of Object.keys(h)){if(t.get("preset")?.has(d)||t.get("series")?.has(d)){delete h[d];continue}i(h[d]),a(h[d]?.axes)}}return Object.create(e,{config:{value:Ks(r),enumerable:!0},overrides:{value:ge(l)?Ks(l):l,enumerable:!0},presets:{value:ge(c)?Ks(c):c,enumerable:!0}})}function RK(e,t,i){const s=$p(FK(e,t).concat(i));if(!s.length)return;const n=fe.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/r/module-registry/",a=cd(s,o=>o.enterprise?"enterprise":"community");if(s.length){const o=fe.isEnterprise()||a.enterprise?.length?"enterprise":"community";K.errorOnce(["required modules are not registered. Check if you have registered the modules:","",fe.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":BK(s.map(zK),o),"",`See ${n} for more details.`].join(`
`))}}function zK(e){return e.moduleId??e.name}function cO(e){return` ${e},`}function VK(e,t){return e.length?`import {
${e.map(cO).join(`
`)}
} from 'ag-charts-${t}';`:null}function BK(e,t){const i=VK(["ModuleRegistry"].concat(e),t),s=e.map(cO).join(`
`);return`${i}
ModuleRegistry.registerModules([
${s}
]);`}function FK(e,t){const i=new Map,s="axes"in t&&ge(t.axes)?t.axes:{},n=new Set(Object.values(s).map(r=>r?.type).filter(Mt)),a=new Set(t.series?.map(r=>r.type).filter(Mt));function o(r){i.set(r.name,r)}for(const r of Ul.values())if(!fe.hasModule(r.name)&&!EK.has(r.name)&&!(e&&r.chartType&&e!==r.chartType))switch(r.type){case"chart":break;case"axis":if(n.has(r.name)){for(const h of Object.keys(s))s?.[h].type===r.name&&delete s[h];o(r)}break;case"series":a.has(r.name)&&(t.series=t.series.filter(h=>h.type!==r.name),o(r));break;case"plugin":const l=r.name,c=t[l];ge(c)&&(c.enabled!==!1&&o(r),delete t[l]);break;case"axis:plugin":for(const h of Object.values(s)){const d=r.name;h?.[d]&&(h[d].enabled!==!1&&o(r),delete h[d])}break;case"series:plugin":for(const h of t.series??[])h[r.name]&&(delete h[r.name],o(r));break}for(const r of a){const l=Ul.get(r);l?.type==="series"&&!fe.hasModule(l.name)&&!i.has(l.name)&&(t.series=t.series.filter(c=>c.type!==l.name),o(l))}return Array.from(i.values())}function hO(e,t){const i="axes"in t&&ge(t.axes),s="series"in t&&De(t.series),n=o=>e==null||!o.chartType||o.chartType===e,a=[];for(const o of fe.listModules())if(fe.isModuleType("plugin",o))n(o)||(delete t[o.name],a.push(o.name));else if(fe.isModuleType("axis:plugin",o)){if(i&&!n(o)){for(const r of Object.values(t.axes))delete r[o.name];a.push(o.name)}}else if(fe.isModuleType("series:plugin",o)&&s&&!n(o)){for(const r of t.series)delete r[o.name];a.push(o.name)}return a}var pk="#192232",ps={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},dh={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Pu=class extends Qa{getDefaultColors(){return{fills:ps,fillsFallback:Object.values(ps),strokes:dh,sequentialColors:mn(ps),divergingColors:[ps.ORANGE,ps.YELLOW,ps.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[ps.GREEN,ps.YELLOW,ps.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:ps.GREEN,stroke:dh.GREEN},down:{fill:ps.RED,stroke:dh.RED},neutral:{fill:ps.GRAY,stroke:dh.GRAY},altUp:{fill:ps.BLUE,stroke:dh.BLUE},altDown:{fill:ps.ORANGE,stroke:dh.ORANGE},altNeutral:{fill:ps.GRAY,stroke:dh.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:pk,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 e=super.getTemplateParameters();return e.set(Il,!0),e.set(kg,pk),e.set(Ls,ps.BLUE),e.set(Ag,"#fff"),e.set(rs,ps.BLUE),e.set(Od,pk),e.set(Pd,"#28313e"),e.set(Ed,"#4b525d"),e.set(Rd,"#fff"),e.set(zd,"#fff"),e.set(Fd,"#28313e"),e.set(_d,"#4b525d"),e.set(Hd,"#fff"),e}constructor(e){super(e)}},vn={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},uh={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},_K=class extends Pu{getDefaultColors(){return{...super.getDefaultColors(),fills:{...vn},fillsFallback:Object.values({...vn}),strokes:{...uh},sequentialColors:mn(vn),divergingColors:[vn.GREEN,vn.BLUE,vn.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:vn.GREEN,stroke:uh.GREEN},down:{fill:vn.RED,stroke:uh.RED},neutral:{fill:vn.BLUE,stroke:uh.BLUE},altUp:{fill:vn.GREEN,stroke:uh.GREEN},altDown:{fill:vn.RED,stroke:uh.RED},altNeutral:{fill:vn.GRAY,stroke:uh.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,vn.BLUE),e.set(rs,vn.BLUE),e.set(Do,"overlay"),e.set(Sr,"left"),e.set(Gd,"bottom"),e}},Sn={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ph={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},HK=class extends Qa{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Sn},fillsFallback:Object.values({...Sn}),strokes:{...ph},sequentialColors:mn(Sn),divergingColors:[Sn.GREEN,Sn.BLUE,Sn.RED],up:{fill:Sn.GREEN,stroke:ph.GREEN},down:{fill:Sn.RED,stroke:ph.RED},neutral:{fill:Sn.BLUE,stroke:ph.BLUE},altUp:{fill:Sn.GREEN,stroke:ph.GREEN},altDown:{fill:Sn.RED,stroke:ph.RED},altNeutral:{fill:Sn.GRAY,stroke:ph.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,Sn.BLUE),e.set(rs,Sn.BLUE),e.set(Do,"overlay"),e.set(Sr,"left"),e.set(Gd,"bottom"),e}},gs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},gh={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},GK=class extends Pu{getDefaultColors(){return{...super.getDefaultColors(),fills:gs,fillsFallback:Object.values(gs),strokes:gh,sequentialColors:mn(gs),divergingColors:[gs.ORANGE,gs.YELLOW,gs.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[gs.GREEN,gs.YELLOW,gs.RED],up:{fill:gs.GREEN,stroke:gh.GREEN},down:{fill:gs.RED,stroke:gh.RED},neutral:{fill:gs.GRAY,stroke:gh.GRAY},altUp:{fill:gs.BLUE,stroke:gh.BLUE},altDown:{fill:gs.RED,stroke:gh.RED},altNeutral:{fill:gs.GRAY,stroke:gh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,gs.BLUE),e.set(rs,gs.BLUE),e}},fs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},fh={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},jK=class extends Qa{getDefaultColors(){return{...super.getDefaultColors(),fills:fs,fillsFallback:Object.values(fs),strokes:fh,sequentialColors:mn(fs),divergingColors:[fs.ORANGE,fs.YELLOW,fs.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[fs.GREEN,fs.YELLOW,fs.RED],up:{fill:fs.GREEN,stroke:fh.GREEN},down:{fill:fs.RED,stroke:fh.RED},neutral:{fill:fs.GRAY,stroke:fh.GRAY},altUp:{fill:fs.BLUE,stroke:fh.BLUE},altDown:{fill:fs.RED,stroke:fh.RED},altNeutral:{fill:fs.GRAY,stroke:fh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,fs.BLUE),e.set(rs,fs.BLUE),e}},Jt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},mh={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},WK=class extends Pu{getDefaultColors(){return{fills:Jt,fillsFallback:Object.values(Jt),strokes:mh,sequentialColors:mn(Jt),divergingColors:[Jt.BLUE,Jt.RED],hierarchyColors:[],secondSequentialColors:[Jt.BLUE,Jt.PURPLE,Jt.MAGENTA,Jt.PINK,Jt.RED,Jt.ORANGE,Jt.YELLOW,Jt.GREEN],secondDivergingColors:[Jt.BLUE,Jt.RED],secondHierarchyColors:[],up:{fill:Jt.GREEN,stroke:mh.GREEN},down:{fill:Jt.RED,stroke:mh.RED},neutral:{fill:Jt.GRAY,stroke:mh.GRAY},altUp:{fill:Jt.BLUE,stroke:mh.BLUE},altDown:{fill:Jt.RED,stroke:mh.RED},altNeutral:{fill:Jt.GRAY,stroke:mh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,Jt.BLUE),e.set(rs,Jt.BLUE),e}},ei={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},yh={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},$K=class extends Qa{getDefaultColors(){return{...super.getDefaultColors(),fills:ei,fillsFallback:Object.values(ei),strokes:yh,sequentialColors:mn(ei),divergingColors:[ei.BLUE,ei.RED],hierarchyColors:[],secondSequentialColors:[ei.BLUE,ei.PURPLE,ei.MAGENTA,ei.PINK,ei.RED,ei.ORANGE,ei.YELLOW,ei.GREEN],secondDivergingColors:[ei.BLUE,ei.RED],secondHierarchyColors:[],up:{fill:ei.GREEN,stroke:yh.GREEN},down:{fill:ei.RED,stroke:yh.RED},neutral:{fill:ei.GRAY,stroke:yh.GRAY},altUp:{fill:ei.BLUE,stroke:yh.BLUE},altDown:{fill:ei.RED,stroke:yh.RED},altNeutral:{fill:ei.GRAY,stroke:yh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,ei.BLUE),e.set(rs,ei.BLUE),e}},Ni={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"},Yl={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"},KK=class extends Pu{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ni,RED:Ni.ORANGE},fillsFallback:Object.values({...Ni,RED:Ni.ORANGE}),strokes:{...Yl,RED:Yl.ORANGE},sequentialColors:mn({...Ni,RED:Ni.ORANGE}),divergingColors:[Ni.ORANGE,Ni.YELLOW,Ni.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Ni.GREEN,Ni.YELLOW,Ni.ORANGE],up:{fill:Ni.GREEN,stroke:Yl.GREEN},down:{fill:Ni.ORANGE,stroke:Yl.ORANGE},neutral:{fill:Ni.GRAY,stroke:Yl.GRAY},altUp:{fill:Ni.BLUE,stroke:Yl.BLUE},altDown:{fill:Ni.ORANGE,stroke:Yl.ORANGE},altNeutral:{fill:Ni.GRAY,stroke:Yl.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,Ni.BLUE),e.set(rs,Ni.BLUE),e}},_i={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"},_r={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"},UK=class extends Qa{getDefaultColors(){return{...super.getDefaultColors(),fills:{..._i,RED:_i.ORANGE},fillsFallback:Object.values({..._i,RED:_i.ORANGE}),strokes:{..._r,RED:_r.ORANGE},sequentialColors:mn({..._i,RED:_i.ORANGE}),divergingColors:[_i.ORANGE,_i.YELLOW,_i.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[_i.GREEN,_i.YELLOW,_i.ORANGE],secondHierarchyColors:[],up:{fill:_i.GREEN,stroke:_r.GREEN},down:{fill:_i.ORANGE,stroke:_r.ORANGE},neutral:{fill:_r.GRAY,stroke:_r.GRAY},altUp:{fill:_i.BLUE,stroke:_r.BLUE},altDown:{fill:_i.ORANGE,stroke:_r.ORANGE},altNeutral:{fill:_i.GRAY,stroke:_r.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,_i.BLUE),e.set(rs,_i.BLUE),e}},nb=U("millisecond","second","minute","hour","day","month","year"),dO={unit:j(nb),step:gn,epoch:ns,utc:R};dO.every=ot;var gk=Et(dO,"a time interval object"),Eu={enabled:R,text:L,padding:W,border:cr,cornerRadius:W,...$e,...se},Hr=ze({enabled:R,type:j(U("line","range")),range:Fe(ze((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),me(ce),rr(2,2)),value:Fe(ze((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),ce),label:Eu,fill:te,fillOpacity:ne,...q,...oe},"cross-line options"),uO={...Hr,label:{...Eu,position:U("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:W}},Zl={enabled:R,rotation:W,avoidCollisions:R,minSpacing:P,spacing:P,formatter:Di($i),itemStyler:Xe({...$e,...zn,spacing:W}),...$e,...zn},ab={autoRotate:R,autoRotateAngle:W,wrapping:U("never","always","hyphenate","on-space"),truncate:R,...Zl},pO={format:fn,...ab},ob={format:Se(L,or),...ab},gO={enabled:R,width:P,size:P,stroke:te},fk={enabled:R,label:ob,tick:gO},fO={values:me(ce),minSpacing:P},Ru={reverse:R,gridLine:{enabled:R,width:P,style:Ft({fill:te,fillOpacity:P,stroke:Se(te,Dd),strokeWidth:P,lineDash:me(P)},"a grid-line style object array")},interval:fO,label:Zl,line:{enabled:R,width:P,stroke:te},tick:gO,context:()=>!0};Ru.layoutConstraints=Q({stacked:j(R),align:j(U("start","end")),unit:j(U("percent","px")),width:j(P)});var Xl={...Ru,crossAt:{value:j(Se(W,ns,L,me(L))),sticky:R},crossLines:Ft(uO,"a cross-line options array"),position:U("top","right","bottom","left"),thickness:P,maxThicknessRatio:ne,title:{enabled:R,text:$i,spacing:P,formatter:Di($i),...$e}};Xl.title._enabledFromTheme=Q(R);var rb={enabled:R,...se,...q,...oe};function xh(e,t){const i={enabled:R,xOffset:W,yOffset:W,formatter:Di(L),renderer:Di(Se(L,Et({text:L,color:te,backgroundColor:te,opacity:ne},"crosshair label renderer result object")))};let s;return e&&(s={...i,format:t?Se(L,Et({millisecond:L,second:L,hour:L,day:L,month:L,year:L})):L}),{enabled:R,snap:R,label:s??i,...q,...oe}}function ff(e,t){return{min:Fe(e,as("max")),max:Fe(e,os("min")),preferredMin:Fe(e,as("preferredMax"),as("max")),preferredMax:Fe(e,os("preferredMin"),os("min")),nice:R,interval:{step:t?Se(gn,nb,gk):gn,values:me(e),minSpacing:Fe(P,as("maxSpacing")),maxSpacing:Fe(P,os("minSpacing"))}}}var mO={step:Se(gn,nb,gk),values:me(Se(W,ns)),minSpacing:Fe(P,as("maxSpacing")),maxSpacing:Fe(P,os("minSpacing")),placement:U("on","between")},zu={...Xl,type:Ae("category"),label:ab,paddingInner:ne,paddingOuter:ne,groupPaddingInner:ne,crosshair:xh(),bandAlignment:U("justify","start","center","end"),bandHighlight:rb,interval:{...fO,placement:U("on","between")}},Vu={...Xl,type:Ae("grouped-category"),label:ab,crosshair:xh(),bandHighlight:rb,paddingInner:ne,groupPaddingInner:ne,depthOptions:Ft({label:{enabled:R,avoidCollisions:R,wrapping:U("never","always","hyphenate","on-space"),truncate:R,rotation:W,spacing:W,...$e,...zn},tick:{enabled:R,stroke:te,width:P}},"depth options objects array")},Bu={...Xl,...ff(W),type:Ae("number"),label:pO,crosshair:xh(!0)},Fu={...Xl,...ff(W),type:Ae("log"),base:Fe(gn,ze(e=>e!==1,"not equal to 1")),label:pO,crosshair:xh(!0)},_u={...Xl,...ff(Se(W,ns),!0),type:Ae("time"),label:ob,parentLevel:fk,crosshair:xh(!0,!0)},Hu={...Xl,type:Ae("unit-time"),unit:Se(gk,nb),label:ob,parentLevel:fk,paddingInner:ne,paddingOuter:ne,groupPaddingInner:ne,crosshair:xh(!0,!0),bandAlignment:U("justify","start","center","end"),bandHighlight:rb,min:Fe(Se(W,ns),as("max")),max:Fe(Se(W,ns),os("min")),preferredMin:Fe(Se(W,ns),as("preferredMax"),as("max")),preferredMax:Fe(Se(W,ns),os("preferredMin"),os("min")),interval:mO},Gu={...Xl,type:Ae("ordinal-time"),paddingInner:ne,paddingOuter:ne,groupPaddingInner:ne,label:ob,parentLevel:fk,interval:mO,crosshair:xh(!0,!0),bandHighlight:rb,bandAlignment:U("justify","start","center","end")},yO={...Ru,...ff(W),type:Ae("angle-number"),crossLines:Ft(Hr),startAngle:W,endAngle:W,label:{...Zl,orientation:U("fixed","parallel","perpendicular"),format:fn}},mk={...Ru,type:Ae("angle-category"),shape:U("polygon","circle"),crossLines:Ft(Hr),startAngle:W,endAngle:W,paddingInner:ne,groupPaddingInner:ne,label:{...Zl,orientation:U("fixed","parallel","perpendicular")}};mk.innerRadiusRatio=ne;var xO={...Ru,...ff(W),type:Ae("radius-number"),shape:U("polygon","circle"),positionAngle:W,innerRadiusRatio:ne,crossLines:Ft({...Hr,label:{...Eu,positionAngle:W}},"cross-line options"),title:{enabled:R,text:$i,spacing:P,formatter:Di($i),...$e},label:{...Zl,format:fn}},bO={...Ru,type:Ae("radius-category"),positionAngle:W,innerRadiusRatio:ne,paddingInner:ne,paddingOuter:ne,groupPaddingInner:ne,label:Zl,crossLines:Ft({...Hr,label:{...Eu,positionAngle:W}},"cross-line options"),title:{enabled:R,text:$i,spacing:P,formatter:Di($i),...$e}},vO=_t(Ct,Ct),YK=Xe({...q,...se,...oe,marker:ur}),SO={showInMiniChart:R,connectMissingData:R,interpolation:hg,label:ft,styler:YK,marker:ga,tooltip:I0,shadow:Ra,...Ke,...se,...q,...oe,highlight:vO,segmentation:fo},yk={...SO,...qe,highlight:vO,type:j(Ae("area")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,legendItemName:L,stacked:R,stackGroup:L,normalizedTo:W};yk.yFilterKey=Q(L);var MO=_t(pa,pa),DO=Xe({...se,...q,...oe,cornerRadius:P}),xk={direction:U("horizontal","vertical"),showInMiniChart:R,cornerRadius:P,styler:DO,itemStyler:DO,crisp:R,label:{...ft,placement:U("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:P},errorBar:Ad,shadow:Ra,tooltip:Ue,...Ke,highlight:MO,...se,...q,...oe,segmentation:fo,width:gn,widthRatio:ne};xk.sparklineMode=Q(R);var ju={...xk,...qe,highlight:MO,type:j(Ae("bar")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,direction:U("horizontal","vertical"),grouped:R,stacked:R,stackGroup:L,normalizedTo:W,legendItemName:L,errorBar:Cd};ju.yFilterKey=Q(L),ju.pickOutsideVisibleMinorAxis=Q(R),ju.focusPriority=Q(W),ju.simpleItemStyler=Q(ot);var kO={title:L,domain:me(W),maxSize:P,showInMiniChart:R,label:{placement:U("top","right","bottom","left"),...ft},tooltip:Ue,styler:Xe({...ga,maxSize:P}),maxRenderedItems:W,...Ke,...J(ga,["enabled"]),highlight:_t(Ct,Ct)},lb={...kO,...qe,type:j(Ae("bubble")),xKey:j(L),yKey:j(L),sizeKey:j(L),labelKey:L,xName:L,yName:L,sizeName:L,labelName:L,legendItemName:L,xKeyAxis:L,yKeyAxis:L,highlight:_t(Ct,Ct)};lb.xFilterKey=Q(L),lb.yFilterKey=Q(L),lb.sizeFilterKey=Q(L);var IO={showInMiniChart:R,cornerRadius:P,label:ft,tooltip:Ue,shadow:Ra,...Ke,...se,...q,...oe,highlight:_t(Ct,Ct),areaPlot:R,aggregation:U("count","sum","mean"),bins:me(me(W)),binCount:P},ZK={...qe,...IO,type:j(Ae("histogram")),xKey:j(L),yKey:L,xKeyAxis:L,yKeyAxis:L,xName:L,yName:L},AO=_t(Ct,lr),XK=Xe({...q,...oe,marker:ur}),bk={title:L,showInMiniChart:R,connectMissingData:R,interpolation:hg,label:ft,styler:XK,marker:ga,tooltip:Ue,errorBar:Ad,...Ke,...q,...oe,highlight:AO,segmentation:b0};bk.sparklineMode=Q(R);var mf={...bk,...qe,highlight:AO,type:j(Ae("line")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,stacked:R,stackGroup:L,normalizedTo:W,legendItemName:L,errorBar:Cd};mf.yFilterKey=Q(L),mf.pickOutsideVisibleMinorAxis=Q(R),mf.focusPriority=Q(W);var CO={title:L,showInMiniChart:R,label:{placement:U("top","right","bottom","left"),...ft},tooltip:Ue,errorBar:Ad,styler:Xe(ga),maxRenderedItems:W,...Ke,...J(ga,["enabled"]),highlight:_t(Ct,Ct)},cb={...CO,...qe,type:j(Ae("scatter")),xKey:j(L),yKey:j(L),labelKey:L,xName:L,yName:L,labelName:L,legendItemName:L,xKeyAxis:L,yKeyAxis:L,errorBar:Cd,highlight:_t(Ct,Ct)};cb.xFilterKey=Q(L),cb.yFilterKey=Q(L),cb.sizeFilterKey=Q(L);var wO=_t(Ct,Ct),vk={...Ke,radiusMin:P,radiusMax:P,rotation:W,outerRadiusOffset:W,outerRadiusRatio:ne,hideZeroValueSectorsInLegend:R,sectorSpacing:P,cornerRadius:P,itemStyler:Xe({...se,...q,...oe,cornerRadius:P}),title:{enabled:R,text:L,showInLegend:R,spacing:P,...$e},calloutLabel:{enabled:R,offset:W,minAngle:P,avoidCollisions:R,formatter:Di($i),format:L,itemStyler:Xe({enabled:R,...zn,...$e}),...zn,...$e},sectorLabel:{enabled:R,positionOffset:W,positionRatio:ne,formatter:Di($i),format:L,itemStyler:Xe({enabled:R,...zn,...$e}),...zn,...$e},calloutLine:{colors:me(te),length:P,strokeWidth:P,itemStyler:Xe({color:te,length:P,strokeWidth:P})},fills:me(ws),strokes:me(te),tooltip:Ue,shadow:Ra,highlight:wO,...oe,...J(se,["fill"]),...J(q,["stroke"])},To={...vk,...qe,type:j(Ae("pie")),angleKey:j(L),radiusKey:L,calloutLabelKey:L,sectorLabelKey:L,legendItemKey:L,angleName:L,radiusName:L,calloutLabelName:L,sectorLabelName:L,highlight:wO};To.angleFilterKey=Q(L),To.defaultColorRange=Q(me(me(te))),To.defaultPatternFills=Q(me(te)),To.title._enabledFromTheme=Q(R),To.calloutLabel._enabledFromTheme=Q(R),To.sectorLabel._enabledFromTheme=Q(R),To.angleKeyAxis=Q(L),To.radiusKeyAxis=Q(L);var LO={...vk,innerRadiusOffset:W,innerRadiusRatio:ne,innerCircle:{fill:L,fillOpacity:ne},innerLabels:{spacing:P,...$e,...zn}},NO={...LO,...To,type:j(Ae("donut")),innerLabels:Ft({text:j(L),spacing:P,...$e,...zn},"inner label options array")};NO.angleFilterKey=Q(L);var Wu={lineStyle:U("solid","dashed","dotted"),...oe},bh={...se,...q,...oe},yf={visible:R,locked:R,readOnly:R,handle:bh,...$e},hb={position:U("top","center","bottom"),alignment:U("left","center","right"),...$e},TO={position:U("top","inside","bottom"),alignment:U("left","center","right"),...$e},qK={enabled:R,cornerRadius:P,...$e,...se,...q,...oe},QK={visible:R,...Wu,...q},OO={divider:q,...se,...q,...$e},PO={handle:bh,statistics:OO,...Wu,...se,...q},db={visible:R,locked:R,readOnly:R,extendStart:R,extendEnd:R,handle:bh,text:hb,...Wu,...q},Sk={visible:R,locked:R,readOnly:R,axisLabel:qK,handle:bh,text:hb,...Wu,...q},EO={visible:R,locked:R,readOnly:R,extendStart:R,extendEnd:R,handle:bh,text:TO,background:se,...Wu,...q},RO={...EO},zO={...EO,middle:QK},Mk={label:$e,showFill:R,isMultiColor:R,strokes:me(te),rangeStroke:te,bands:U(4,6,10),...db},VO={...se,...q,...yf},BO={...se,...q,...yf},FO={...se,...q,...yf,background:{...se,...q}},Dk={visible:R,locked:R,readOnly:R,handle:bh,...se},ub={visible:R,locked:R,readOnly:R,extendStart:R,extendEnd:R,handle:bh,text:hb,background:se,statistics:OO,...Wu,...q},_O={visible:R,up:PO,down:PO},$u={enabled:R,axesButtons:{enabled:R,axes:U("x","y","xy")},toolbar:{enabled:R,padding:P,buttons:Ft({...dr,value:U("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:R,buttons:me(Se(Et({...dr,value:j(U("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),Et({...dr,value:j(U("lock")),checkedOverrides:dr})))}};$u.data=Q(pn),$u.xKey=Q(L),$u.volumeKey=Q(L),$u.snap=Q(R);var Oo={...se,...q,opacity:ne},HO={...se,...q,...oe,cornerRadius:P,whisker:{...q,...oe},cap:{lengthRatio:ne}},GO={...HO,opacity:ne},jO=Xe({...se,...q,...oe,cornerRadius:P,whisker:{...q,...oe},cap:{lengthRatio:ne}}),WO={direction:U("horizontal","vertical"),showInMiniChart:R,styler:jO,itemStyler:jO,tooltip:Ue,...Ke,...HO,highlight:_t(GO,GO),segmentation:fo,width:gn,widthRatio:ne},kk={cornerRadius:P,wick:{...q,...oe},...se,...q,...oe},$O={...kk,opacity:ne},KO={item:{up:kk,down:kk},itemStyler:Xe({...se,...q,...oe,cornerRadius:P,wick:{...q,...oe}}),showInMiniChart:R,tooltip:Ue,...Ke,highlight:_t($O,$O)},UO={fills:me(ws),strokes:me(te),label:{spacing:P,maxWidth:P,...ft},link:{tension:ne,itemStyler:Xe({...se,...q,...oe,tension:ne}),...se,...q,...oe},node:{width:P,spacing:P,itemStyler:Xe({...se,...q,...oe}),...se,...q,...oe},tooltip:Ue,...Ke},YO={direction:U("horizontal","vertical"),fills:me(ws),strokes:me(te),label:{spacing:P,placement:U("before","middle","after"),...ft},stageLabel:{placement:U("before","after"),format:fn,...Zl},tooltip:Ue,...J(Ke,["showInLegend"]),...J(se,["fill"]),...J(q,["stroke"]),...oe,highlight:ey(lr)},ZO={direction:U("horizontal","vertical"),fills:me(ws),strokes:me(te),itemStyler:Xe({...se,...q,...oe}),spacingRatio:ne,crisp:R,dropOff:{enabled:R,...se,...q,...oe},stageLabel:{placement:U("before","after"),format:fn,...Zl},label:ft,tooltip:Ue,shadow:Ra,...J(Ke,["showInLegend"]),...J(se,["fill"]),...J(q,["stroke"]),...oe},XO={title:L,textAlign:U("left","center","right"),verticalAlign:U("top","middle","bottom"),itemPadding:P,itemStyler:Xe({...se,...q}),showInMiniChart:R,label:pr,tooltip:Ue,...Ke,...q},qO={showInMiniChart:R,itemStyler:Xe({...q,...oe}),item:{up:{...q,...oe},down:{...q,...oe}},tooltip:Ue,...Ke,highlight:_t(lr,lr)},QO={maxStrokeWidth:P,itemStyler:Xe({...q,...oe}),sizeDomain:me(P),label:ft,tooltip:Ue,...Ke,...q,...oe,highlight:_t(lr,lr)},JO={...q,...oe},e2={colorRange:me(te),maxSize:P,sizeDomain:me(P),label:{placement:U("top","bottom","left","right"),...ft},tooltip:Ue,...Ke,...J(ga,["enabled"]),highlight:_t(Ct,Ct)},t2={colorRange:me(te),padding:P,itemStyler:Xe({...se,...q,...oe}),label:pr,tooltip:Ue,...Ke,...se,...q,...oe,highlight:_t(Ct,Ct)},i2={...Ke,...se,...q,...oe},Ku=Xe({...se,...q,...oe,cornerRadius:P}),s2={cornerRadius:P,styler:Ku,itemStyler:Ku,label:ft,tooltip:Ue,...Ke,...se,...q,...oe,highlight:_t(pa,pa)},n2={direction:U("horizontal","vertical"),aspectRatio:P,spacing:P,reverse:R,itemStyler:Xe({...se,...q,...oe}),fills:me(ws),strokes:me(te),label:ft,stageLabel:{spacing:P,placement:U("before","after"),...ft},tooltip:Ue,shadow:Ra,...Ke,...J(se,["fill"]),...J(q,["stroke"]),...oe},a2={connectMissingData:R,marker:ga,styler:Xe({marker:ur,...se,...q,...oe}),label:ft,tooltip:Ue,...Ke,...se,...q,...oe,highlight:_t(Ct,Ct)},o2={connectMissingData:R,marker:ga,styler:Xe({marker:ur,...q,...oe}),label:ft,tooltip:Ue,...Ke,...q,...oe,highlight:_t(Ct,lr)},r2={cornerRadius:P,styler:Ku,itemStyler:Ku,label:ft,tooltip:Ue,...Ke,...se,...q,...oe,highlight:_t(pa,pa)},l2={cornerRadius:P,columnWidthRatio:ne,maxColumnWidthRatio:ne,styler:Ku,itemStyler:Ku,label:ft,tooltip:Ue,...Ke,...se,...q,...oe,highlight:_t(pa,pa)},JK={marker:ga,...q,...oe},c2={marker:{enabled:R,...ur},...q,...oe},h2={marker:ur,...q,...oe},d2={showInMiniChart:R,connectMissingData:R,interpolation:hg,label:{...ft,placement:U("inside","outside"),spacing:P},tooltip:Ue,shadow:Ra,...Ke,...se,...JK,item:{low:{...c2},high:{...c2}},styler:Xe({...se,item:{low:{...h2},high:{...h2}}}),highlight:_t(Ct,Ct),segmentation:fo,invertedStyle:{enabled:R,...se}},u2=Xe({...se,...q,...oe,cornerRadius:P}),p2={direction:U("horizontal","vertical"),grouped:R,showInMiniChart:R,cornerRadius:P,styler:u2,itemStyler:u2,label:{...ft,placement:U("inside","outside"),spacing:P},tooltip:Ue,shadow:Ra,...Ke,...se,...q,...oe,highlight:_t(pa,pa),segmentation:fo,width:gn,widthRatio:ne},g2={fills:me(ws),strokes:me(te),label:{...ft,spacing:P,placement:U("left","right","center"),edgePlacement:U("inside","outside")},link:{itemStyler:Xe({...se,...q,...oe}),...se,...q,...oe},node:{width:P,spacing:P,minSpacing:Fe(P,h0("spacing")),alignment:U("left","center","right","justify"),verticalAlignment:U("top","bottom","center"),sort:U("data","ascending","descending","auto"),itemStyler:Xe({...se,...q,...oe}),...se,...q,...oe},tooltip:Ue,...Ke},f2={fills:me(ws),strokes:me(te),colorRange:me(te),sectorSpacing:P,cornerRadius:P,padding:P,itemStyler:Xe({...se,...q}),label:{spacing:P,...pr},secondaryLabel:pr,tooltip:Ue,...J(Ke,["highlight","showInLegend"]),...J(se,["fill"]),...J(q,["stroke"]),highlight:{highlightedItem:Oo,highlightedBranch:Oo,unhighlightedItem:Oo,unhighlightedBranch:Oo}},m2={fills:me(ws),strokes:me(te),colorRange:me(te),itemStyler:Xe({...se,...q}),group:{gap:P,padding:P,cornerRadius:P,textAlign:U("left","center","right"),interactive:R,highlight:{highlightedItem:Oo,unhighlightedItem:Oo},label:{...ft,spacing:P},...se,...q},tile:{gap:P,padding:P,cornerRadius:P,textAlign:U("left","center","right"),verticalAlign:U("top","middle","bottom"),label:{...ft,spacing:P,lineHeight:P,minimumFontSize:P,wrapping:U("never","always","hyphenate","on-space"),overflowStrategy:U("ellipsis","hide")},secondaryLabel:{...ft,lineHeight:P,minimumFontSize:P,wrapping:U("never","always","hyphenate","on-space"),overflowStrategy:U("ellipsis","hide")},highlight:{highlightedItem:Oo,highlightedBranch:Oo,unhighlightedItem:Oo,unhighlightedBranch:Oo},...se,...q},tooltip:Ue,...J(Ke,["highlight","showInLegend"])},Ik={name:L,cornerRadius:P,itemStyler:Xe({...se,...q,...oe,cornerRadius:P}),label:{...ft,placement:U("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:P},tooltip:Ue,shadow:Ra,...se,...q,...oe},y2={direction:U("horizontal","vertical"),showInMiniChart:R,item:{positive:Ik,negative:Ik,total:Ik},line:{enabled:R,...q,...oe},tooltip:Ue,width:gn,widthRatio:ne,...Ke},pb=Et({__type:j(Ae("date")),value:Se(L,W)},"a serializable date object"),x2={width:P,height:P,grip:R,fill:te,stroke:te,strokeWidth:P,cornerRadius:P},nt={enabled:R,height:P,spacing:P,cornerRadius:W,mask:{fill:te,fillOpacity:ne,stroke:te,strokeWidth:P},minHandle:x2,maxHandle:x2,miniChart:{enabled:R,padding:{top:P,bottom:P},label:{enabled:R,avoidCollisions:R,spacing:P,format:fn,formatter:Di($i),interval:{minSpacing:P,maxSpacing:P,values:pn,step:W},...$e},series:ce}},Ak={...se,...q,...oe,cornerRadius:P,opacity:ne},b2={...Ak,minSize:P,hoverStyle:{fill:se.fill,stroke:q.stroke}},v2={enabled:R,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:Ak,thumb:b2},eU={...v2,position:U("top","bottom")},tU={...v2,position:U("left","right")},Ps={enabled:R,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:Ak,thumb:b2,horizontal:eU,vertical:tU},vh=J(uO,["type","value","range"]),Es={number:{...J(Bu,["type","crossLines"]),top:J(Bu,["type","crossLines","position"]),right:J(Bu,["type","crossLines","position"]),bottom:J(Bu,["type","crossLines","position"]),left:J(Bu,["type","crossLines","position"]),crossLines:vh},log:{...J(Fu,["type","crossLines"]),top:J(Fu,["type","crossLines","position"]),right:J(Fu,["type","crossLines","position"]),bottom:J(Fu,["type","crossLines","position"]),left:J(Fu,["type","crossLines","position"]),crossLines:vh},category:{...J(zu,["type","crossLines"]),top:J(zu,["type","crossLines","position"]),right:J(zu,["type","crossLines","position"]),bottom:J(zu,["type","crossLines","position"]),left:J(zu,["type","crossLines","position"]),crossLines:vh},time:{...J(_u,["type","crossLines"]),top:J(_u,["type","crossLines","position"]),right:J(_u,["type","crossLines","position"]),bottom:J(_u,["type","crossLines","position"]),left:J(_u,["type","crossLines","position"]),crossLines:vh},"unit-time":{...J(Hu,["type","crossLines"]),top:J(Hu,["type","crossLines","position"]),right:J(Hu,["type","crossLines","position"]),bottom:J(Hu,["type","crossLines","position"]),left:J(Hu,["type","crossLines","position"]),crossLines:vh},"grouped-category":{...J(Vu,["type"]),top:J(Vu,["type","position"]),right:J(Vu,["type","position"]),bottom:J(Vu,["type","position"]),left:J(Vu,["type","position"]),crossLines:vh},"ordinal-time":{...J(Gu,["type","crossLines"]),top:J(Gu,["type","crossLines","position"]),right:J(Gu,["type","crossLines","position"]),bottom:J(Gu,["type","crossLines","position"]),left:J(Gu,["type","crossLines","position"]),crossLines:vh}},Uu={"angle-category":{...J(mk,["type","crossLines"]),crossLines:J(Hr,["type"])},"angle-number":{...J(yO,["type","crossLines"]),crossLines:J(Hr,["type"])},"radius-category":{...J(bO,["type","crossLines"]),crossLines:{...J(Hr,["type"]),label:{...Eu,positionAngle:W}}},"radius-number":{...J(xO,["type","crossLines"]),crossLines:{...J(Hr,["type"]),label:{...Eu,positionAngle:W}}}},ct={visible:Q(R)},iU={common:{...ke,navigator:nt,scrollbar:Ps,axes:{...Es,...Uu},annotations:{...$u,line:db,"horizontal-line":Sk,"vertical-line":Sk,"disjoint-channel":RO,"parallel-channel":zO,"fibonacci-retracement":Mk,"fibonacci-retracement-trend-based":Mk,callout:VO,comment:BO,note:FO,text:yf,arrow:db,"arrow-up":Dk,"arrow-down":Dk,"date-range":ub,"price-range":ub,"date-price-range":ub,"quick-date-price-range":_O},chartToolbar:{enabled:R},initialState:{legend:Ft({visible:R,seriesId:L,itemId:L,legendItemName:L},"legend state array"),zoom:{rangeX:{start:Se(W,pb),end:Se(W,pb)},rangeY:{start:Se(W,pb),end:Se(W,pb)},ratioX:{start:ne,end:ne},ratioY:{start:ne,end:ne},autoScaledAxes:me(Ae("y"))}}},line:{...ke,axes:Es,series:bk,navigator:nt,scrollbar:Ps,...ct},scatter:{...ke,axes:Es,series:CO,navigator:nt,scrollbar:Ps,...ct,paired:Q(R)},bubble:{...ke,axes:Es,series:kO,navigator:nt,scrollbar:Ps,...ct},area:{...ke,axes:Es,series:SO,navigator:nt,scrollbar:Ps,...ct},bar:{...ke,axes:Es,series:xk,navigator:nt,scrollbar:Ps,...ct},"box-plot":{...ke,axes:Es,series:WO,navigator:nt,scrollbar:Ps,...ct},candlestick:{...ke,axes:Es,series:KO,navigator:nt,scrollbar:Ps,...ct},"cone-funnel":{...ke,axes:Es,series:YO,navigator:nt,scrollbar:Ps,...ct},funnel:{...ke,axes:Es,series:ZO,navigator:nt,scrollbar:Ps,...ct},ohlc:{...ke,axes:Es,series:qO,navigator:nt,scrollbar:Ps,...ct},histogram:{...ke,axes:J(Es,["category","grouped-category","unit-time","ordinal-time"]),series:IO,navigator:nt,scrollbar:Ps,...ct},heatmap:{...ke,axes:Es,series:XO,navigator:nt,scrollbar:Ps,...ct},waterfall:{...ke,axes:Es,series:y2,navigator:nt,scrollbar:Ps,...ct},"range-bar":{...ke,axes:Es,series:p2,navigator:nt,scrollbar:Ps,...ct},"range-area":{...ke,axes:Es,series:d2,navigator:nt,scrollbar:Ps,...ct},donut:{...ke,series:LO,navigator:nt,...ct},pie:{...ke,series:vk,navigator:nt,...ct},"radar-line":{...ke,axes:Uu,series:o2,navigator:nt,...ct},"radar-area":{...ke,axes:Uu,series:a2,navigator:nt,...ct},"radial-bar":{...ke,axes:Uu,series:r2,navigator:nt,...ct},"radial-column":{...ke,axes:Uu,series:l2,navigator:nt,...ct},nightingale:{...ke,axes:Uu,series:s2,navigator:nt,...ct},sunburst:{...ke,series:f2,navigator:nt,...ct},treemap:{...ke,series:m2,navigator:nt,...ct},"map-shape":{...ke,series:t2,navigator:nt,...ct},"map-line":{...ke,series:QO,navigator:nt,...ct},"map-marker":{...ke,series:e2,navigator:nt,...ct},"map-shape-background":{...ke,series:i2,navigator:nt,...ct},"map-line-background":{...ke,series:JO,navigator:nt,...ct},sankey:{...ke,series:g2,navigator:nt,...ct},chord:{...ke,series:UO,navigator:nt,...ct},pyramid:{...ke,series:n2,navigator:nt,...ct},"radial-gauge":{...ke,...bg,targets:J(yg,["value"]),tooltip:{...bg.tooltip,...ke.tooltip}},"linear-gauge":{...ke,...xg,targets:J(mg,["value"]),tooltip:{...xg.tooltip,...ke.tooltip}}};function gb(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var sU=gb(iU,function e(t,i){if(yd(i))return t;if(Pa(t))return Se(t,Dd,yd);if(ge(t))return Se(Et(bd in t?gb(t,s=>ge(s)?gb(s,e):s):gb(t,e)),Dd,yd);throw new Error(`Invalid theme override value: ${String(t)}`)}),ms={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Sh={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},nU=class extends Pu{getDefaultColors(){return{fills:ms,fillsFallback:Object.values(ms),strokes:Sh,sequentialColors:mn(ms),divergingColors:[ms.ORANGE,ms.YELLOW,ms.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ms.GREEN,ms.YELLOW,ms.RED],secondHierarchyColors:[],up:{fill:ms.GREEN,stroke:Sh.GREEN},down:{fill:ms.RED,stroke:Sh.RED},neutral:{fill:ms.GRAY,stroke:Sh.GRAY},altUp:{fill:ms.BLUE,stroke:Sh.BLUE},altDown:{fill:ms.ORANGE,stroke:Sh.ORANGE},altNeutral:{fill:ms.GRAY,stroke:Sh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,ms.BLUE),e.set(rs,ms.BLUE),e}},ys={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Mh={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},aU=class extends Qa{getDefaultColors(){return{...super.getDefaultColors(),fills:ys,fillsFallback:Object.values(ys),strokes:Mh,sequentialColors:mn(ys),divergingColors:[ys.ORANGE,ys.YELLOW,ys.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ys.GREEN,ys.YELLOW,ys.RED],secondHierarchyColors:[],up:{fill:ys.GREEN,stroke:Mh.GREEN},down:{fill:ys.RED,stroke:Mh.RED},neutral:{fill:ys.GRAY,stroke:Mh.GRAY},altUp:{fill:ys.BLUE,stroke:Mh.BLUE},altDown:{fill:ys.ORANGE,stroke:Mh.ORANGE},altNeutral:{fill:ys.GRAY,stroke:Mh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ls,ys.BLUE),e.set(rs,ys.BLUE),e}},Ck=Ki(()=>new Qa),oU=be.create(!0,"perf"),Ja=(e,t,i)=>{oU("[CACHE] ChartTheme",e,t.name,i)},wk={"ag-default-dark":Ki(()=>new Pu),"ag-sheets-dark":Ki(()=>new KK,Ja),"ag-polychroma-dark":Ki(()=>new WK,Ja),"ag-vivid-dark":Ki(()=>new nU,Ja),"ag-material-dark":Ki(()=>new GK,Ja),"ag-financial-dark":Ki(()=>new _K,Ja),"ag-default":Ck,"ag-sheets":Ki(()=>new UK,Ja),"ag-polychroma":Ki(()=>new $K,Ja),"ag-vivid":Ki(()=>new aU,Ja),"ag-material":Ki(()=>new jK,Ja),"ag-financial":Ki(()=>new HK,Ja)},fb=Ki(rU,Ja);function rU(e){if(e instanceof Qa)return e;if(!dU(e))return Ck();if(e==null||typeof e=="string"){const n=wk[e??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=Mi(lU(e),cU,"theme");for(const n of i)K.warnOnce(String(n));const s=t?.baseTheme?fb(t.baseTheme):Ck();return t?new s.constructor(t):s}function lU(e){if(!ge(e)||!ge(e.baseTheme))return e;let t=e,i,s;const n=[];for(;typeof t=="object";)i??(i=t.palette),s??(s=t.params),t.overrides&&n.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:re(...n),params:s,palette:i}}var cU={baseTheme:Se(L,or),overrides:sU,params:{accentColor:te,axisColor:te,backgroundColor:te,borderColor:te,borderRadius:W,chartBackgroundColor:te,chartPadding:W,focusShadow:L,foregroundColor:te,fontFamily:rg,fontSize:W,fontWeight:kd,gridLineColor:te,popupShadow:L,subtleTextColor:te,textColor:te,separationLinesColor:te,chromeBackgroundColor:te,chromeFontFamily:rg,chromeFontSize:W,chromeFontWeight:kd,chromeSubtleTextColor:te,chromeTextColor:te,buttonBackgroundColor:te,buttonBorder:R,buttonFontWeight:kd,buttonTextColor:te,inputBackgroundColor:te,inputBorder:R,inputTextColor:te,menuBackgroundColor:te,menuBorder:R,menuTextColor:te,panelBackgroundColor:te,panelSubtleTextColor:te,tooltipBackgroundColor:te,tooltipBorder:R,tooltipTextColor:te,tooltipSubtleTextColor:te,crosshairLabelBackgroundColor:te,crosshairLabelTextColor:te},palette:{fills:me(ws),strokes:me(te),up:{fill:Se(te,sg),stroke:te},down:{fill:Se(te,sg),stroke:te},neutral:{fill:Se(te,sg),stroke:te}}},hU=U("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 dU(e){const{invalid:t}=Mi({theme:e},{theme:Se(hU,or)});for(const i of t)K.warnOnce(String(i));return t.length===0}var Vt="path",Ma="pathArray",Pt="default",Mn="override",xs="user",ql="userPartial",Po="operation",Eo="operationValue",Yu="dependency",Lk="autoEnable",S2="autoEnableValue",M2="prune",D2="childrenSource";function Nk(e){return gt(e)&&e>=0&&e<=1}function xf(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return!1;i=i[s]}return!0}function Qi(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function Zu(e,t,i){const s=t.length;if(s===0)return;let n=e;const a=s-1,o=t[a];for(let r=0;r<a;r++){const l=t[r],c=t[r+1];let h=n[l];(h==null||!fd(h))&&(h=Number.isNaN(Number(c))?{}:[],n[l]=h),n=h}n[o]=i}var uU=/^\d+$/;function pU(e,t=0){let i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];if(uU.test(n)&&(i++,i>t))return s}return-1}function Xu(e,t=0){const i=pU(e,t);return Number(e[i])}function Dh(e,t,i){const s=t.split("/");let n=[...e];t.startsWith("/")&&(n=[],s.shift());let a=!1;for(const o of s){if(o==="..")n.pop(),a||n.pop();else if(o===".")n.pop();else if(o==="$index"){const r=Xu(e);if(Number.isNaN(r))return Ro;n.push(`${r}`)}else if(o==="$prevIndex"){const r=Xu(e);if(Number.isNaN(r)||Number(r)<=0)return Ro;n.push(`${Number(r)-1}`)}else if(o.startsWith("$")){const r=i?.[o.slice(1)];if(r==null)return Ro;n.push(r)}else o.length!==0&&n.push(o);a=o===".."}return n}var Ro=Symbol("unresolvable-path"),Dn=Symbol("resolved-to-branch");function bf(e,t){if(e==null||typeof e!="object"||Array.isArray(e)||(t??(t=Object.keys(e)),t.length===0))return;const i=t[0];if(C2.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function gU(e,t,i){const s=bf(e.getVertexValue(i));switch(s?.operation){case"$path":{const[n]=s.values,a=e.getPathArray(t),o=Dh(a,n);return o===Ro?void 0:e.findVertexAtPath(o)}case"$value":return t}}var fU={$cacheMax:mU};function mU(e,t,i){const[s]=i,n=e.getPathArray(t),a=e.getCachedValue(n,"$cacheMax"),o=e.resolveVertexValue(t,s);if(typeof o!="number")return a;if(typeof a!="number")return e.setCachedValue(n,"$cacheMax",o),o;const r=Math.max(a,o);return e.setCachedValue(n,"$cacheMax",r),r}var yU={$hasSeriesType:{dependencies:Tk,resolve:xU},$isChartType:{dependencies:Tk,resolve:vU},$isSeriesType:{dependencies:Tk,resolve:bU}};function Tk(e,t,i){const s=e.findVertexAtPath(["series","0","type"]);s&&e.addEdge(t,s,Yu)}function xU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),a=e.getResolvedPath(["series"]);if(!Array.isArray(a))return!1;for(const o of a)if(o.type===n)return!0;return!1}function bU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return e.getResolvedPath(["series","0","type"])===n}function vU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),a=e.getResolvedPath(["series","0","type"]);if(typeof a!="string")return!1;const o=fe.getSeriesModule(a);if(o==null)return!1;switch(n){case"cartesian":return o.chartType==="cartesian";case"polar":return o.chartType==="polar";case"standalone":return o.chartType==="standalone"}return!1}var SU={$foregroundBackgroundMix:MU,$foregroundOpacity:DU,$interpolate:kU,$isGradient:IU,$isImage:AU,$isPattern:CU,$mix:wU};function MU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),a=e.getParamValue("foregroundColor"),o=e.getParamValue("backgroundColor");if(typeof a=="string"&&typeof o=="string"&&Nk(n))return Oe.mix(Oe.fromString(a),Oe.fromString(o),1-n).toString();be.inDevelopmentMode(()=>K.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function DU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),a=e.getParamValue("foregroundColor");if(typeof a=="string"&&Nk(n)){const o=Oe.fromString(a);return new Oe(o.r,o.g,o.b,n).toString()}be.inDevelopmentMode(()=>K.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function kU(e,t,i){const[s,n]=i,a=e.resolveVertexValue(t,s),o=e.resolveVertexValue(t,n);if(!(!De(a)||!gt(o)))return Oe.interpolate(a.map(r=>Oe.fromString(r)),o).map(r=>r.toString())}function IU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Qt(n)}function AU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Wa(n)}function CU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return jn(n)}function wU(e,t,i){const[s,n,a]=i,o=e.resolveVertexValue(t,s),r=e.resolveVertexValue(t,n),l=e.resolveVertexValue(t,a),c=e.getPathArray(t),h=`\`$mix\` json operation failed on [${String(o)}, ${String(r)}, ${String(l)}] at [${c.join(".")}], expecting`,d=`${h} two colors and a number between 0 and 1.`;if(typeof r!="string"||!Nk(l)){be.inDevelopmentMode(()=>K.warnOnce(d));return}if(typeof o=="string")try{return Oe.mix(Oe.fromString(o),Oe.fromString(r),l).toString()}catch{be.inDevelopmentMode(()=>K.warnOnce(d));return}if(!Qt(o)){be.inDevelopmentMode(()=>K.warnOnce(d));return}let u=o.colorStops;try{u=u?.map(p=>{let f;return typeof p.color=="string"&&(f=Oe.mix(Oe.fromString(p.color),Oe.fromString(r),l).toString()),{...p,color:f}})}catch{be.inDevelopmentMode(()=>K.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...o,colorStops:u}}var LU={$rem:NU};function NU(e,t,i){const[s]=i,n=e.getVertexValue(s),a=e.getParamValue("fontSize");if(typeof a=="number"&&typeof n=="number")return Math.round(n*a);be.inDevelopmentMode(()=>K.warnOnce(`\`$rem\` json operation failed on [${String(n)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var TU={$and:OU,$eq:PU,$every:EU,$greaterThan:RU,$if:zU,$lessThan:VU,$not:BU,$or:FU,$some:_U,$switch:HU};function OU(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);if(i.length===1&&Array.isArray(n))return n.every(a=>!!a);if(!n)return!1}return!0}function PU(e,t,i){let s,n=!0;for(const a of i){const o=e.resolveVertexValue(t,a);if(n)s=o,n=!1;else if(o!==s)return!1}return!0}function EU(e,t,i){const[s,n]=i,a=e.getVertexValue(s),o=e.resolveVertexValue(t,n);if(!Array.isArray(o))return;let r=0;for(const l of o){if(!e.graftAndResolveOrphanValue(t,`${r}`,a,l))return!1;r++}return!0}function RU(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)>e.resolveVertexValue(t,n)}function zU(e,t,i){const[s,n,a]=i,r=e.resolveVertexValue(t,s)?n:a,l=e.neighboursWithEdgeValue(r,Vt);if(l)for(const c of l)e.addEdge(t,c,Vt);return e.resolveVertexValue(t,r)}function VU(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)<e.resolveVertexValue(t,n)}function BU(e,t,i){const[s]=i;if(s)return!e.resolveVertexValue(t,s)}function FU(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);if(i.length===1&&Array.isArray(n))return n.some(a=>!!a);if(n)return!0}return!1}function _U(e,t,i){const[s,n]=i,a=e.getVertexValue(s),o=e.resolveVertexValue(t,n);if(!Array.isArray(o))return;let r=0;for(const l of o){if(e.graftAndResolveOrphanValue(t,`${r}`,a,l))return!0;r++}return!1}function HU(e,t,i){const[s,n,...a]=i,o=e.resolveVertexValue(t,s);for(const r of a){const l=e.getVertexValue(r);if(!Array.isArray(l))continue;const[c,h]=l;if(o===c||Array.isArray(c)&&c.includes(o))return h}return e.resolveVertexValue(t,n)}var GU={$isUserOption:jU,$palette:WU,$mapPalette:$U,$path:{dependencies:A2,resolve:KU},$pathString:{dependencies:A2,resolve:UU},$ref:YU};function jU(e,t,i){const[s,n,a]=i,o=e.neighboursWithEdgeValue(s,Vt);if(o)for(const r of o){const l=e.findNeighbour(r,Pt);if(l&&k2(e,t,l))return e.resolveVertexValue(t,n)}else if(k2(e,t,s))return e.resolveVertexValue(t,n);return e.resolveVertexValue(t,a)}function k2(e,t,i){const s=e.resolveVertexValue(t,i);if(!Bt(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const n=e.getPathArray(t),a=Dh(n,s);return a===Ro?!1:e.hasUserOption(a)}var I2=new Set(["fill","fillFallback","stroke","gradient","range2"]);function WU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!Bt(n))return;if(I2.has(n)){const o=e.getPathArray(t),r=Xu(o);if(Number.isNaN(r))return;switch(n){case"fill":return ca(e.palette.fills,1,r)[0];case"fillFallback":return ca(e.palette.fillsFallback,1,r)[0];case"stroke":return ca(e.palette.strokes,1,r)[0];case"gradient":return ca(e.palette.sequentialColors,1,r)[0];case"range2":return ca(e.palette.fills,2,r)}return}if(n==="gradients")return e.palette.sequentialColors;if(n==="type")return e.paletteType;const a=Qi(e.palette,n.split("."));return Array.isArray(a)?[...a]:typeof a=="object"?{...a}:a}function $U(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!Bt(n))return;if(I2.has(n)){const o=e.getPathArray(t);let r=Xu(o),l=0;const c=["series","0","type"];for(let h=0;h<r;h++){c[1]=`${h}`;const d=e.getResolvedPath(c);(d==="map-shape-background"||d==="map-line-background")&&l++}if(r-=l,Number.isNaN(r))return;switch(n){case"fill":return ca(e.palette.fills,1,r)[0];case"fillFallback":return ca(e.palette.fillsFallback,1,r)[0];case"stroke":return ca(e.palette.strokes,1,r)[0];case"gradient":return ca(e.palette.sequentialColors,1,r)[0];case"range2":return ca(e.palette.fills,2,r)}return}if(n==="gradients")return e.palette.sequentialColors;if(n==="type")return e.paletteType;const a=Qi(e.palette,n.split("."));return Array.isArray(a)?[...a]:typeof a=="object"?{...a}:a}function A2(e,t,i){const[s]=i,n=e.getVertexValue(s);if(Bt(n)){const a=e.getPathArray(t),o=Dh(a,n);if(o===Ro)return;const r=e.findVertexAtPath(o);r&&e.addEdge(t,r,Yu)}}function KU(e,t,i){const s=i.length>1,n=i.length>2,[a,o,r]=i,l=e.resolveVertexValue(t,a),c=n?e.resolveVertexValue(t,r):null;if(!Bt(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),d=Dh(h,l);if(d===Ro)return;const u=c?Qi(c,d):e.getResolvedPath(d);if(u!=null)return u;if(s)return e.resolveVertexValue(t,o)}function UU(e,t,i){const[s,n]=i,a=e.resolveVertexValue(t,s);if(!Bt(a))throw new Error(`\`$path\` json operation failed on [${String(a)}], expecting a string.`);let o;n&&(o=e.graftAndResolveOrphan(t,n));const r=e.getPathArray(t),l=Dh(r,a,o);if(l===Ro)throw new Error(`Unresolvable path [${a}] at [${r.join(".")}]`);return l}function YU(e,t,i){const[s]=i,n=e.getVertexValue(s);return e.getParamValue(n)}var ZU={$apply:XU,$applyCycle:qU,$applySwitch:QU,$applyTheme:JU,$clone:e3,$findFirstSiblingNotOperation:t3,$map:i3,$merge:s3,$omit:n3,$size:a3,$shallow:r3,$shallowSimple:o3,$value:l3};function XU(e,t,i){const[s,n,a,o]=i,r=e.getVertexValue(s);if(!We(r))return;const l=n?e.getVertexValue(n):void 0,c=e.neighboursWithEdgeValue(t,Vt),h=c&&c.length>0;if(!h&&l==null)return Dn;const d=a?e.resolveVertexValue(t,a):void 0,u=o?e.resolveVertexValue(t,o):void 0;if(!h&&l!=null)if(bf(l)){const p=e.resolveVertexValue(t,n);We(p)&&e.graftObject(t,p,[d,u])}else e.graftObject(t,l,[d,u]);if(!h)return Dn;for(const p of c){const f=e.neighboursWithEdgeValue(p,Vt);if(!f||f.length===0){const y=e.addVertex({});e.addEdge(p,y,Pt)}else e.graftObject(p,r,[d,u])}return Dn}function qU(e,t,i){const[s,n,a]=i,o=e.resolveVertexValue(t,s);if(typeof o!="number")return;const r=e.getPathArray(t),l=e.dangerouslyGetUserOption(r),c=e.hasThemeOverride(r),h=l==null?void 0:xs,d=l??e.resolveVertexValue(t,n);if(!Array.isArray(d))return;const u=a?e.getVertexValue(a):void 0;for(let p=0;p<o;p++){const f=d[p%d.length];f!=null&&((l||!c)&&e.graftValue(t,`${p}`,f,void 0,h),u&&e.graftValue(t,`${p}`,u,f,h))}return Dn}function QU(e,t,i){const[s,n,...a]=i,o=e.resolveVertexValue(t,s);for(const r of a){const l=e.getVertexValue(r);if(!Array.isArray(l))continue;const[c,h]=l;if(o===c||Array.isArray(c)&&c.includes(o))return e.graftObject(t,h,[],Pt),Dn}return e.resolveVertexValue(t,n)}function JU(e,t,i){const[s,n,a]=i;let o=e.getVertexValue(s);if(typeof o=="string"&&(o=[o]),!Array.isArray(o))return;const r=e.neighboursWithEdgeValue(t,Vt),l=a?e.getVertexValue(a):[],c=Array.isArray(l)?new Set(l):new Set;if(!r)return Dn;for(const h of r){const d=e.graftAndResolveOrphan(h,n);for(const u of o){const p=Dh([],u,d);p!==Ro&&e.graftConfig(h,p,c)}}return Dn}function e3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(We(n))return e.graftObject(t,n,void 0,xs),Dn}function t3(e,t,i){const[s]=i,n=e.getPathArray(t),a=Dh(n,"..");if(a===Ro)return;const o=e.findVertexAtPath(a);if(!o)return e.resolveVertexValue(t,s);const r=e.neighboursWithEdgeValue(o,Vt);if(r)for(const l of r){const c=e.getPathArray(l);if(c[a.length]===n[a.length])continue;const h=c.concat(n.slice(a.length+1)),d=e.findVertexAtPath(h);if(!d)continue;const u=e.findNeighbourValue(d,xs);if(u!=null)return u;const p=e.findNeighbourValue(d,Mn);if(p!=null)return p}return e.resolveVertexValue(t,s)}function i3(e,t,i){const[s,n]=i,a=e.getVertexValue(s),o=e.resolveVertexValue(t,n);if(!Array.isArray(o))return;const r=e.neighboursWithEdgeValue(t,Vt);if(r&&r.length>0)return;let l=0;for(const c of o)e.graftValue(t,`${l}`,a,c),l++;return Dn}function s3(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);We(n)&&e.graftObject(t,n)}return Dn}function n3(e,t,i){const[s,n]=i;let a=e.getVertexValue(s);if(!Array.isArray(a)){const r=gU(e,t,n);if(!r)return;a=e.resolveVertexValue(r,s)}const o=e.resolveVertexValue(t,n);if(!(!Array.isArray(a)||!We(o)))return J(o,a)}function a3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return fd(n)?"length"in n?n.length:Object.keys(n).length:0}function o3(e,t,i){const s=[];for(const n of i)s.push(e.getVertexValue(n));return s}function r3(e,t,i){const s=e.getPathArray(t),n=e.hasUserOption(s);if(!n&&i.length===1)return e.resolveVertexValue(t,i[0]);const a=[];for(const o of i)a.push(e.getVertexValue(o));return n?(e.prune(t,[Mn,Pt]),Dn):(e.graftObject(t,a),Dn)}function l3(e,t,i){const[s]=i,n=e.getVertexValue(s),a=e.getPathArray(t);if(n==="$index")return Xu(a);if(n==="$parentIndex")return Xu(a,1);if(n==="$1")return e.resolveValue$1(a)}var c3={$isEven:h3};function h3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Number.isNaN(Number(n))?!1:Number(n)%2===0}var vf={...fU,...yU,...SU,...LU,...GU,...TU,...c3,...ZU},C2=new Set(Object.keys(vf));function Sf(e){return C2.has(e)}var kt=be.create("opts","options-graph"),d3=Ki(u3);function u3(e,t){return kt.group("OptionsGraph.constructor()",()=>{const i=new w2(e.config,t,e.params,e.palette,e.overrides,e.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 Ql=class ss extends uM{constructor(t={},i={},s=void 0,n={},a=void 0,o=new Map){super(Vt,Po,new Set([ql,xs])),this.config=t,this.userOptions=i,this.palette=n,this.overrides=a,this.internalParams=o,this.edgePriority=[...ss.EDGE_PRIORITY],this.graftEdge=ss.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=ge(i?.theme)?rO(i.theme?.palette):"inbuilt";const r=i.series?.[0]?.type??"line";kt("build user"),this.buildGraphFromObject(this.root,xs,J(i,["theme"])),kt("build defaults"),this.buildGraphFromObject(this.root,Pt,J(t[r],ss.COMPLEX_KEYS));const l=a?J(a[r],ss.COMPLEX_KEYS):{};Object.keys(l).length>0&&(kt("build series overrides"),this.buildGraphFromObject(this.root,Mn,l));const c=a?J(a.common,ss.COMPLEX_KEYS):{};Object.keys(c).length>0&&(kt("build common overrides"),this.buildGraphFromObject(this.root,Mn,fe.getSeriesModule(r)?.chartType==="cartesian"?c:J(c,["zoom","navigator"]))),s&&(kt("build params"),this.buildGraphFromObject(this.params,Pt,s));const h=this.findNeighbourWithValue(this.root,"axes",Vt),d=this.findNeighbourWithValue(this.root,"series",Vt);h&&(kt("build axes"),this.buildGraphFromObject(h,Pt,{$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&&(kt("build series"),this.buildGraphFromObject(d,Pt,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const u=J(t[r]?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(u).length>0&&(kt("build annotations type config"),this.buildGraphFromObject(this.annotations,Pt,u));const p=J(a?.common?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&(kt("build annotations type overrides"),this.buildGraphFromObject(this.annotations,Mn,p));const f=gg(t[r]?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(kt("build annotations config"),this.buildGraphFromObject(this.root,Pt,{annotations:f}));const y=gg(a?.common?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(y).length>0&&(kt("build annotations overrides"),this.buildGraphFromObject(this.root,Mn,{annotations:y})),this.buildDependencyGraph()}static clearValueCache(){ss.valueCache.clear()}clear(){kt.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,kt("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return kt.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},kt("resolve params"),this.resolveVertex(this.params,this.resolvedParams),kt("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),kt("resolve root"),this.resolveVertex(this.root),kt("resolved root",this.resolved),kt("vertex count",this.getVertexCount()),kt("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(t){const i=super.addVertex(t);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(t,i,s){const n=(this.neighboursWithEdgeValue(t,s)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!n&&(this.rollbackEdgesFrom.push(t),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(s)),super.addEdge(t,i,s)}resolvePartial(t,i,s){if(!i||!this.root)return;const{permissivePath:n,proxyPaths:a}=s??{},o=Object.keys(i);if(kt.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${t.join(".")} [${o}]`),o.length===0)return{};const r=this.findVertexAtPath(t);if(!r){if(n)return;throw new Error(`Could not find vertex in OptionsGraph at path [${t.join(".")}].`)}const l=this.findNeighbour(r,Ma);if(this.userPartialOptions={},Zu(this.userPartialOptions,t,i),a)for(const p of Object.keys(a)){const f=a[p],y=Qi(i,[p]);y!=null&&(Zu(i,f,y),Zu(this.userPartialOptions,[...t,...f],y),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=ql,this.edgePriority=[ql,...ss.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(r,ql,i,l);for(const p of o){const f=a?.[p]?this.findVertexAtPath([...t,...a[p]]):this.findNeighbourWithValue(r,p,Vt);f&&this.refreshPendingProcessingEdges(f)}this.buildDependencyGraph();const c={};if(this.resolveVertex(r,c),this.rollback(),this.graftEdge=ss.GRAFT_EDGE,this.edgePriority=ss.EDGE_PRIORITY,this.userPartialOptions=void 0,a)for(const p of Object.keys(a)){const f=a[p],y=Qi(c,[...t,...f]);Zu(c,[...t,p],y)}const h=Qi(c,t),u=s?.pick??!0?gg(Qi(c,t),o):h;return kt("vertex count",this.getVertexCount()),kt("edge count",this.getEdgeCount()),kt("resolved partial",u),kt.check()&&console.groupEnd(),u}findVertexAtPath(t){const i=t.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,t,Vt);if(s)return this.cachedPathVertices.set(i,s),s}hasUserOption(t){if(xf(this.userOptions,t))return!0;const s=this.findVertexAtPath(t);if(s){if(this.findNeighbour(s,xs)!=null||this.findNeighbour(s,ql)!=null)return!0;const n=this.findNeighbourValue(s,D2);return n===xs||n===ql}return!1}dangerouslyGetUserOption(t){if(this.userPartialOptions){const i=Qi(this.userPartialOptions,t);if(i!=null)return i}return Qi(this.userOptions,t)}hasThemeOverride(t){if(this.overrides==null)return!1;if(t[0]==="axes"&&t.length>1){const i=this.getResolvedPath(["axes",t[1],"type"]);if(xf(this.overrides,["common","axes",i,...t.slice(2)]))return!0;const s=this.getResolvedPath(["series","0","type"]);return xf(this.overrides,[s,"axes",i,...t.slice(2)])}if(t[0]==="series"&&t.length>1){const i=this.getResolvedPath(["series",t[1],"type"]);return xf(this.overrides,[i,"series",...t.slice(2)])}return xf(this.overrides,t)}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],Vt);if(!i)return;const s=this.findNeighbour(i,Pt);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[t]=n,n}getPathArray(t){return this.findNeighbourValue(t,Ma)??[]}getResolvedPath(t){return Qi(this.resolved,t)}getCachedValue(t,i){const s=[...t,i].join(".");return ss.valueCache.get(s)}setCachedValue(t,i,s){const n=[...t,i].join(".");ss.valueCache.set(n,s)}prune(t,i){this.addEdge(t,this.addVertex(i),M2)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,Po);if(s&&Sf(s)){const a=this.neighboursWithEdgeValue(i,Eo),o=vf[s],l=(typeof o=="function"?o:o.resolve)?.(this,t,a??[]);return l===Dn?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const a={};this.resolveVertexChildren(i,a),n=Qi(a,this.getPathArray(t))}return this.resolveValueOrSymbol(n)}resolveValue$1(t){for(let i=t.length;i>=0;i--){const s=t.slice(0,i).join("."),n=this.value$1.get(s);if(n!=null)return n}}graftConfig(t,i,s){const n=Qi(this.config,i),a=this.findNeighbour(t,Ma);if(ge(n)&&this.buildGraphFromObject(t,Pt,n,a,void 0,s),this.overrides){const o=Qi(this.overrides,i);ge(o)&&this.buildGraphFromObject(t,Mn,o,a,void 0,s);const r=Qi(this.overrides,["common",...i.slice(1)]);ge(r)&&this.buildGraphFromObject(t,Mn,r,a,void 0,s)}this.buildDependencyGraph()}graftObject(t,i,s,n=this.graftEdge){const a=this.findNeighbour(t,Ma);if(this.buildGraphFromObject(t,n,i,a),this.overrides&&s)for(const o of s){if(o==null)continue;const r=Qi(this.overrides,o);r&&this.buildGraphFromObject(t,Mn,r,a)}this.buildDependencyGraph()}graftValue(t,i,s,n,a=this.graftEdge){const o=[...this.getPathArray(t),i],r=this.findVertexAtPath(o)??this.addVertex(i);this.value$1.set(o.join("."),n),this.buildGraphFromValue(t,r,a,o,s),this.buildDependencyGraph()}graftAndResolveOrphan(t,i){const s={},n=this.addVertex(s),a=this.getPathArray(t);return this.graftAndResolveChildren(i,n,a,[]),this.resolveVertex(n,s),Qi(s,a)}graftAndResolveOrphanValue(t,i,s,n,a=this.graftEdge){const o={},r=this.addVertex(o),c=[...this.getPathArray(t),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),n),this.buildGraphFromValue(r,h,a,c,s),this.resolveVertex(r,o),Qi(o,c)}buildGraphFromObject(t,i,s,n,a=ss.SHALLOW_KEYS,o){const r=Object.keys(s),l=bf(s,r);if(l){const f=this.addVertex(s);this.addEdge(t,f,i),this.buildGraphFromOperation(f,i,l,n);return}if(r.length===0){this.addEdge(t,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(t,i,s,void 0);return}const c=this.getVertexChildrenByKey(t),h=n?this.getVertexValue(n):[];let d;Array.isArray(s)&&this.addEdge(t,this.addVertex(i),D2);const u=[...h],p=h.length;for(const f of r){if(o?.has(f))continue;const y=c?.get(f)??this.addVertex(f);u[p]=f,a?.has(f)?this.buildShallowGraphFromValue(t,y,i,u,s[f]):this.buildGraphFromValue(t,y,i,u,s[f],a),f==="enabled"&&(d=y)}this.buildGraphAutoEnable(t,i,s,d)}buildGraphAutoEnable(t,i,s,n){if(i===Pt&&!n||i===xs&&n||i!==Pt&&i!==xs&&i!==ql&&i!==Mn)return;let a=this.findNeighbour(t,Lk);a||(a=this.addVertex(Lk),this.addEdge(t,a,Lk)),n&&this.addEdge(n,a,S2);const{enabled:o,_enabledFromTheme:r}=s;this.addEdge(a,this.addVertex({enabled:o,_enabledFromTheme:r,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(t){const i=this.neighboursWithEdgeValue(t,Vt);if(!i)return;const s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(t,i,s,n,a,o){this.addEdge(t,i,Vt);let r=this.findNeighbour(i,Ma);r||(r=this.addVertex([...n]),this.addEdge(i,r,Ma));const l=bf(a);if(l){const c=this.addVertex(a);this.addEdge(i,c,s),this.addEdge(c,r,Ma),this.buildGraphFromOperation(c,s,l,r)}else if(fd(a))this.buildGraphFromObject(i,s,a,r,o);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(t,i,s,n,a){this.addEdge(t,i,Vt);let o=this.findNeighbour(i,Ma);o||(o=this.addVertex([...n]),this.addEdge(i,o,Ma));const r=this.addVertex(a);this.addEdge(i,r,s)}buildGraphFromOperation(t,i,s,n){const a=this.addVertex(s.operation);this.addEdge(t,a,Po);for(const o of s.values)this.buildGraphFromOperationValue(t,o,i,n)}buildGraphFromOperationValue(t,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const a=this.addVertex(i);this.addEdge(t,n,Ma),this.addEdge(t,a,Eo);const o=bf(i);o?this.buildGraphFromOperation(a,s,o,n):fd(i)&&this.buildGraphFromObject(a,s,i,n)}buildDependencyGraph(){for(let t=0;t<this.pendingProcessingEdgesFrom.length;t++){const i=this.pendingProcessingEdgesFrom[t],s=this.pendingProcessingEdgesTo[t],n=this.getVertexValue(s);if(!Sf(n))continue;const a=this.neighboursWithEdgeValue(i,Eo),o=vf[n];(typeof o=="function"?void 0:o.dependencies)?.(this,i,a??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}refreshPendingProcessingEdges(t){const s=this.findNeighbour(t,Pt)??t,n=this.findNeighbour(s,Po);if(n){this.pendingProcessingEdgesFrom.push(s),this.pendingProcessingEdgesTo.push(n);const o=this.neighboursWithEdgeValue(s,Eo);if(o)for(const r of o)this.refreshPendingProcessingEdges(r)}const a=this.neighboursWithEdgeValue(t,Vt);if(a)for(const o of a)this.refreshPendingProcessingEdges(o)}resolveVertex(t,i=this.resolved,s){const n=this.getPathArray(t),a=n[0];if(n.length===1&&this.resolvedRootAncestorsPaths.add(a),n.length>1&&!this.resolvedRootAncestorsPaths.has(a)){const o=this.findVertexAtPath([a]);if(o){this.resolveVertex(o,i,s);return}}if(this.userPartialOptions==null&&i===this.resolved&&n.length>0){const o=Qi(i,n);if(o!=null&&!We(o))return}this.resolveVertexInEdgePriority(t,i,n,s),this.resolveVertexAutoEnable(t,i,n),this.resolveVertexChildren(t,i,s)}resolveVertexInEdgePriority(t,i,s,n){const a=this.neighboursWithEdgeValue(t,Vt),[o]=this.edgePriority;for(const r of this.edgePriority){const l=this.findNeighbour(t,r);if(l==null)continue;const c=this.resolveVertexValueInternal(t,l);if(!(c==null&&r!==o)&&!(a&&a.length>0&&r!==o)&&!(Array.isArray(n)&&n.includes(r))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&ss.UNSAFE_CLEAR_KEYS.has(s.at(-1))),s.length===0){if(c==null)continue;this.resolved=c}else Zu(i,s,c);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,Po);if(s&&Sf(s)){const n=this.neighboursWithEdgeValue(i,Eo),a=vf[s],r=(typeof a=="function"?a:a.resolve)?.(this,t,n??[]);return r===Dn?void 0:r}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,s){const n=this.neighboursWithEdgeValue(t,S2)?.[0];if(!n)return;const a=this.findVertexAtPath(s),o=this.findNeighbourValue(n,Pt),r=this.findNeighbourValue(n,Mn),l=this.findNeighbourValue(n,xs),h=a&&this.findNeighbour(a,xs)!=null?void 0:this.findNeighbourValue(n,ql);(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!o?._enabledFromTheme&&!r?._enabledFromTheme&&Zu(i,s,!0)}resolveVertexChildren(t,i,s){const n=this.neighboursWithEdgeValue(t,Vt);if(n){s??(s=this.findNeighbourValue(t,M2));for(const a of n){const o=this.getVertexValue(a);n.length>1&&Sf(o)||o!=="_enabledFromTheme"&&this.resolveVertex(a,i,s)}}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,Yu);if(i)for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(t,i,s,n){const a=this.neighboursWithEdgeValue(t,Vt);if(a)for(const o of a){const r=this.getVertexValue(o),l=[...s,r],c=[...n,r],h=this.addVertex(r),d=this.findNeighbourValue(o,Pt);this.addEdge(i,h,Vt);const u=this.addVertex(l);if(this.addEdge(h,u,Ma),ge(d)){this.buildGraphFromObject(h,Pt,d,u);const p=this.findNeighbour(h,Pt);this.addEdge(p,this.addVertex(l),Ma);const f=this.findNeighbourValue(p,Po);if(Sf(f)){const y=this.neighboursWithEdgeValue(p,Eo),b=vf[f];(typeof b=="function"?void 0:b.dependencies)?.(this,p,y??[])}}this.graftAndResolveChildren(o,h,l,c)}}resolveValueOrSymbol(t){return typeof t=="symbol"&&this.internalParams?.has(t)?this.internalParams.get(t):t}snapshot(){kt("snapshot"),this.isRollingBack=!0}rollback(){kt(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let t=0;t<this.rollbackEdgesFrom.length;t++){const i=this.rollbackEdgesFrom[t],s=this.rollbackEdgesTo[t],n=this.rollbackEdgesValue[t];this.removeEdge(i,s,n)}for(const t of this.rollbackVertices)this.removeVertex(t);this.cachedPathVertices.clear(),this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1}diagram(t,i=2){this.diagramKeys=new Map,this.diagramEdges=new Map;const s=this.findVertexAtPath(t),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(t){let i=this.diagramKeys.get(t);return i||(i=`${this.diagramKeys.size}`,this.diagramKeys.set(t,i)),i}diagramLabel(t,i,s){let n=this.diagramKeys.get(t);if(n)return n;n=this.diagramKey(t);const a={[xs]:"UO",[Pt]:"DE",[Yu]:"DEP",[Po]:"OP",[Eo]:"OPV",[Mn]:"OV"};let o=s?a[s]??void 0:void 0;return o=o?`:::${o}`:"",typeof i.value=="symbol"?`${n}[/"[symbol]"\\]${o}`:Array.isArray(i.value)?`${n}[/"[array]"\\]${o}`:typeof i.value=="object"?`${n}[/"[object]"\\]${o}`:s===Pt||s===xs||s===Mn?`${n}("${i.value}")${o}`:`${n}["${i.value}"]${o}`}diagramVertex(t,i,s,n){const a=this.getPathArray(i),o=a.length>0?a.join("."):"root";this.diagramNeighbours(t,o,i,s+1,n);let r=this.diagramKeys.get(o);r||(r=this.diagramKey(o),t.push(` ${r}["${i.value}"]`))}diagramNeighbours(t,i,s,n,a){for(const p of this.neighboursWithEdgeValue(s,Vt)??[]){const f=this.getPathArray(p),y=f.length>0?f.join("."):"root";n<a&&this.diagramVertex(t,p,n+1,a),this.diagramChild(t,Vt,i,s,y,s)}const o=this.neighboursWithEdgeValue(s,xs)??[];let r=0;for(const p of o)this.diagramChild(t,xs,i,s,`${i}.${xs}.${r}`,p),r++;const l=this.neighboursWithEdgeValue(s,Pt)??[];r=0;for(const p of l)this.diagramChildWithNeighbours(t,Pt,i,s,`${i}.${Pt}.${r}`,p,n+1,a),r++;const c=this.neighboursWithEdgeValue(s,Po)??[];r=0;const[h]=c;h&&(this.diagramChildWithNeighbours(t,Po,i,s,`${i}.${Po}.${r}`,h,n+1,a),r++);const d=this.neighboursWithEdgeValue(s,Eo)??[];r=0;for(const p of d)this.diagramChildWithNeighbours(t,Eo,i,s,`${i}.${Eo}.${r}`,p,n+1,a),r++;const u=this.neighboursWithEdgeValue(s,Yu)??[];r=0;for(const p of u)this.diagramChildWithNeighbours(t,Yu,i,s,this.getPathArray(p).join("."),p,n+1,a),r++}diagramChild(t,i,s,n,a,o){let r=this.diagramEdges.get(s);if(r?.has(a))return;r||(r=new Set,this.diagramEdges.set(s,r)),r.add(a);const l=i===Vt?"":`|${i}|`;t.push(` ${this.diagramLabel(s,n)} -->${l} ${this.diagramLabel(a,o,i)}`)}diagramChildWithNeighbours(t,i,s,n,a,o,r,l){this.diagramChild(t,i,s,n,a,o),this.diagramNeighbours(t,a,o,r+1,l)}};Ql.EDGE_PRIORITY=[xs,Mn,Pt],Ql.GRAFT_EDGE=Pt,Ql.SHALLOW_KEYS=new Set(["context","data","topology"]),Ql.COMPLEX_KEYS=["annotations","axes","series"],Ql.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],Ql.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),Ql.valueCache=new Map;var w2=Ql,L2=e=>`'${e}'`,Ok="__AXIS_ID_",kh={top:"x",bottom:"x",left:"y",right:"y"},Ih=class Wi{constructor(t,i,s,n,a,o,r=!1,l){this.themeParameters={},this.optionMetadata=a??{},this.processedOverrides=s??{};let c=null;t instanceof Wi?(c=t,this.specialOverrides=c.specialOverrides,o&&(this.userDeltaKeys=new Set(Object.keys(o))),o??(o=Hn(c.userOptions,i,Wi.JSON_DIFF_OPTS)),this.userOptions=Te(wd(o,c.userOptions),{...Wi.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Te(t??i,{...Wi.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),this.findSeriesWithUserVisiblity(i,o),r&&this.removeLeftoverSymbols(this.userOptions);const h=t instanceof Wi&&o?.data!==void 0&&o?.data?.length!==t.userOptions.data?.length;let d,u,p,f,y,b,x;if(!r&&this.seriesWithUserVisibility==null&&o!==void 0&&Wi.isFastPathDelta(o)&&c!=null&&!h?({activeTheme:d,processedOptions:u,fastDelta:p}=this.fastSetup(o,c),f=c.themeParameters,y=c.annotationThemes):(Wi.perfDebug("ChartOptions.slowSetup()"),{activeTheme:d,processedOptions:u,themeParameters:f,annotationThemes:y,googleFonts:b,optionsGraph:x}=this.slowSetup(s,o,r)),this.activeTheme=d,this.processedOptions=u,this.fastDelta=p??void 0,this.themeParameters=f,this.annotationThemes=y,this.googleFonts=b,this.optionsGraph=x,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const v=performance.now();this.optionsProcessingTime=v-l}be.inDevelopmentMode(()=>Ks(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return Wi.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return Wi.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(t,i){for(const s of[t,i]){const n=s?.series;if(Array.isArray(n))for(let a=0;a<n.length;a++){const o=n[a];"visible"in o&&(this.seriesWithUserVisibility??(this.seriesWithUserVisibility={identifiers:new Set,indices:new Set}),o.id?this.seriesWithUserVisibility.identifiers.add(o.id):this.seriesWithUserVisibility.indices.add(a))}}}fastSetup(t,i){const{activeTheme:s,processedOptions:n}=i,{presetType:a}=this.optionMetadata;if(a!=null&&t?.data!=null){const r=fe.getPresetModule(a);if(r?.processData){const{series:l,data:c}=r.processData(t.data);t=re({series:l,data:c},t)}}this.fastSeriesSetup(t,n);const o=re(t,n);return Wi.debug("ChartOptions.fastSetup() - processed options",o),{activeTheme:s,processedOptions:o,fastDelta:t}}fastSeriesSetup(t,i){t?.series&&(t.series?.every((s,n)=>fM(s,i.series?.[n]??{}))?delete t.series:t.series=t.series.map((s,n)=>wd(s,i.series?.[n]??{})))}slowSetup(t,i,s=!1){let n=Te(this.userOptions,Wi.OPTIONS_CLONE_OPTS_FAST);i&&(n=re(i,n),s&&this.removeLeftoverSymbols(n));let a=lO(fb(n.theme));const{presetType:o}=this.optionMetadata;if(o!=null){const b=fe.getPresetModule(o);if(b){const{validate:x=Mi}=b,v=n,S=n.type,M=S==null?void 0:a.presets[S],{cleared:D,invalid:I}=x(v,b.options,"");for(const k of I)K.warn(k);xl(I,"")?n={}:(Wi.debug(">>> AgCharts.createOrUpdate() - applying preset",D),n=b.create(D,M,()=>this.activeTheme),a=lO(fb(n.theme)))}}this.soloSeriesIntegrity(n),o!=null&&a.templateTheme(n,!1),hO(void 0,n);const r=this.validateSeriesOptions(n),l=hf(n);if(this.chartDef=fe.getChartModule(l),!this.chartDef.placeholder){const{validate:b=Mi}=this.chartDef,{cleared:x,invalid:v}=b(n,this.chartDef.options,"");for(const S of v)K.warn(S);n=x}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=d3(a,n),u=d.resolve(),p=d.resolveParams(),f=d.resolveAnnotationThemes();d.clearSafe();const y=re(t,u);return hO(this.chartDef.name,y),RK(this.chartDef.name,y,r),this.validateSeriesOptions(y),this.validateAxesOptions(y,h),this.validatePluginOptions(y),this.processMiniChartSeriesOptions(y),y.loadGoogleFonts||c.clear(),Wi.debug(()=>["ChartOptions.slowSetup() - processed options",Te(y)]),{activeTheme:a,processedOptions:y,themeParameters:p,annotationThemes:f,googleFonts:c,optionsGraph:d}}validatePluginOptions(t){for(const i of fe.listModulesByType("plugin")){const s=i.name;if(s in t&&i.options!=null&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:a}=Mi(t[s],i.options,i.name);for(const o of a)K.warn(o);t[s]=n}}}validateSeriesOptions(t){const i=this.chartDef?.name,s=[],n=t.series?.length??0,a=[];let o;for(let r=0;r<n;r++){const l=`series[${r}]`,c=t.series[r],h=fe.getSeriesModule(c.type);if(h==null){const f=fe.isEnterprise();o??(o=ar(Array.from(Ul.values()).filter(b=>b.type==="series"&&(f||!b.enterprise)&&(!i||b.chartType===i)).map(b=>b.name),"or",L2));const y=Ul.get(c.type);if(c.type!=null&&y?.type==="series"){a.push(y);continue}K.warn(c.type==null?`Option \`${l}.type\` is required and has not been provided; expecting ${o}, ignoring.`:`Unknown type \`${c.type}\` at \`${l}.type\`; expecting ${o}, ignoring.`);continue}else if(i&&h.chartType!==i){K.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=Mi}=h,{cleared:u,invalid:p}=d(c,h.options,l);for(const f of p)K.warn(f);xl(p,l)||s.push(u)}return t.series=s,a}validateAxesOptions(t,i){if(!("axes"in t)||!t.axes)return;const s=this.chartDef?.name,n={};let a;for(const[o,r]of rt(t.axes)){if(!r)continue;if(r.type==null){n[o]=r;continue}const l=`axes.${i?.get(o)??o}`,c=fe.getAxisModule(r.type);if(c==null){const p=fe.isEnterprise();a??(a=ar(Array.from(Ul.values()).filter(y=>y.type==="axis"&&(p||!y.enterprise)&&y.chartType===s).map(y=>y.name),"or",L2)),Ul.get(r.type)?.type!=="axis"&&K.warn(`Unknown type \`${r.type}\` at \`${l}.type\`; expecting one of ${a}, ignoring.`);continue}else if(c.chartType!==s){K.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${s}\`, ignoring.`);break}const{validate:h=Mi}=c,{cleared:d,invalid:u}=h(r,c.options,l);for(const p of u)K.warn(p);xl(u,l)||(n[o]=d)}t.axes=n}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??Hn(t.processedOptions,this.processedOptions,Wi.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.displayNullData,s=t.series?.map(n=>{const o=!!fe.getSeriesModule(n.type)?.options?.visible,r={};return o&&(r.visible=!0),i!==void 0&&n.allowNullKeys===void 0&&(r.allowNullKeys=i),re(this.getSeriesGroupingOptions(n),n,r)});t.series=this.setSeriesGroupingOptions(s??[])}processAxesOptions(t,i){const s=i==="polar"?["angle","radius"]:["x","y"],n="axes"in t&&Object.keys(t.axes??{}).length>0,a=this.countNonDefaultSeriesAxisKeys(t,s),o=a>0,r=o&&a<(t?.series?.length??0),l=t.series?.[0],c=this.optionsType(t),h=this.predictAxes(c,s,l,t.data)??this.cloneDefaultAxes(c),d=ge(l)&&"direction"in l&&l.direction==="horizontal"&&fe.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!n&&!o&&!d){t.axes=h;return}const u="axes"in t?new Set(Object.keys(t.axes??{})):new Set,p=this.getPrimaryAxisKeys(t,s,u,o),f=this.getRemappedAxisKeys(u,p,s,r),y={},b=new Map;for(const[x,v]of f)y[v]="axes"in t?Nl(t.axes?.[x]):void 0,b.set(v,x);return this.remapSeriesAxisKeys(t,s,y,f,h,r),this.predictAxesMissingTypesAndPositions(t,s,y,h),this.alternateSecondaryAxisPositions(t,y,b),t.axes=y,b}getSeriesDirectionAxisKey(t,i){const s=fe.getSeriesModule(t.type);return s?"direction"in t&&t.direction==="horizontal"&&s.axisKeysFlipped?s.axisKeysFlipped[i]:s.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(t,i){let s=0;for(const n of t.series??[])for(const a of i){const o=this.getSeriesDirectionAxisKey(n,a);!o||!ml(o,n)||n[o]!==a&&s++}return s}getPrimaryAxisKeys(t,i,s,n){const a=new Map;for(const o of i){let r=!1;if("axes"in t&&t.axes&&!(o in t.axes&&ge(t.axes[o])&&!("position"in t.axes[o]))){for(const[l,c]of rt(t.axes))if("position"in c&&c.position&&o===kh[c.position]){a.set(o,l),r=!0;break}}if(!r&&n)for(const l of t.series??[]){const c=this.getSeriesDirectionAxisKey(l,o);if(!c)continue;const h=l[c];if(!s.has(h)){if(!h){a.set(o,o);break}a.set(o,h);break}}}if(s.size===0||!("axes"in t)||!t.axes)return a;if(a.size===0)for(const o of i)o in t.axes&&a.set(o,o);if(a.size===0){for(const o of i)for(const[r,l]of rt(t.axes))if(l.type?.startsWith(o)){a.set(o,r);break}}if(a.size===0&&(t.series?.length??0)>0)for(const o of i)for(const r of t.series){const l=this.getSeriesDirectionAxisKey(r,o);if(!l)continue;const c=r[l];if(s.has(c)){a.set(o,c);break}}if(a.size<2){const o=new Set(a.values());for(const[r,l]of rt(t.axes))if(!(o.has(r)||"position"in l)){for(const c of i)if(!a.has(c)){a.set(c,r),o.add(r);break}if(a.size===2)break}}return a}getRemappedAxisKeys(t,i,s,n){const a=new Map;for(const[o,r]of i)a.set(r,o);for(const o of t)a.has(o)||a.set(o,`${Ok}${a.size}`);if(n)for(const o of s)a.has(o)||a.set(o,`${Ok}${a.size}`);return a}remapSeriesAxisKeys(t,i,s,n,a,o){for(const r of t.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(r,l);if(!c)continue;s[l]??(s[l]=Nl(a[l]));let h=l;if(c in r){const d=r[c];n.has(d)?h=n.get(d):(h=`${Ok}${n.size}`,n.set(d,h),s[h]=Nl(a[l]))}else n.has(l)&&o&&(h=n.get(l),s[h]??(s[h]=Nl(a[l])));r[c]=h}}predictAxes(t,i,s,n){if(!s)return;const a=s?.data??n;if(!a?.length)return;const o=fe.getSeriesModule(t)?.predictAxis;if(!o)return;const r=new Map,l=GS(0,a.length-1,5);for(const c of l){const h=a[c];for(const d of i){const u=o(d,h,s);if(!r.has(d)){r.set(d,u);continue}const p=r.get(d);if(!(!u&&!p)){if(!u||!p)return;for(const f of Object.keys(p))if(p[f]!==u[f])return}}}for(const[c,h]of r)h||r.delete(c);if(r.size!==0){if(r.size===1){const[c]=r.values(),h=this.cloneDefaultAxes(t);return"position"in c?Ec(h,d=>"position"in d&&d.position===c.position?c:d):void 0}return Object.fromEntries(r)}}cloneDefaultAxes(t){const i=fe.getSeriesModule(t);return i?.defaultAxes?Te(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(t,i,s,n){for(const[a,o]of rt(s)){if(!We(o)||"type"in o&&"position"in o)continue;if(a in n){o.type??(o.type=n[a].type),o.position??(o.position=n[a].position);continue}this.predictAxisMissingTypeFromPosition(o,n)||(this.predictAxisMissingTypeAndPositionFromSeries(t,i,a,o,n),"type"in o||delete s[a])}}predictAxisMissingTypeFromPosition(t,i){if(!("position"in t)||!ml(t.position,kh))return!1;for(const s of Object.values(i))if(ml(s.position,kh)&&kh[t.position]===kh[s.position])return t.type=s.type,!0;for(const[s,n]of rt(kh))if(t.position!==s&&n===kh[t.position])return t.type=i[n].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(t,i,s,n,a){for(const o of t.series??[])for(const r of i){const l=this.getSeriesDirectionAxisKey(o,r);if(!(!l||!ml(l,o))&&o[l]===s)return n.type??(n.type=a[r].type),n.position??(n.position=a[r].position),r==="y"}return!1}alternateSecondaryAxisPositions(t,i,s){let n=0,a=0;for(const[o,r]of rt(i)){if(!We(r)||!("position"in r))continue;const l=s.get(o),c="axes"in t&&t.axes&&l&&l in t.axes?t.axes[l]:void 0,h=c&&"position"in c?c.position:void 0;if(r.position==="top"||r.position==="bottom"?(n+=1,n===2&&h==null&&(r.position="top")):(r.position==="left"||r.position==="right")&&(a+=1,a===2&&h==null&&(r.position="right")),n>1&&a>1)break}}processMiniChartSeriesOptions(t){const i=t.navigator?.miniChart?.series;i!=null&&(t.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(t){const{groupable:i,stackable:s,stackedByDefault:n=!1}=fe.getSeriesModule(t.type);t.grouped&&!i&&K.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&K.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:a,stacked:o}=t;return o??(o=(n||t.stackGroup!=null)&&!(i&&a)),a??(a=!0),{stacked:s&&o,grouped:i&&a&&!(s&&o)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);Wi.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((a,o)=>{var r;return o.groupType==="default"||(a[r=o.seriesType]??(a[r]=0),a[o.seriesType]+=o.groupType==="stack"?1:o.series.length),a},{});return i.flatMap(a=>{var o;switch(s[o=a.seriesType]??(s[o]=0),a.groupType){case"stack":{const r=s[a.seriesType]++;return a.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:a.groupId,groupIndex:r,groupCount:n[a.seriesType],stackIndex:c,stackCount:a.series.length}}))}case"group":return a.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:a.groupId,groupIndex:s[a.seriesType]++,groupCount:n[a.seriesType],stackIndex:0,stackCount:0}}))}return a.series}).map(({stacked:a,grouped:o,...r})=>r)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const i=new Map;return t.reduce((s,n)=>{const a=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:a,series:[n],groupId:"__default__"});else{const o=this.getSeriesGroupId(n);if(!i.has(o)){const l={groupType:n.stacked?"stack":"group",seriesType:a,series:[],groupId:o};i.set(o,l),s.push(l)}i.get(o).series.push(n)}return s},[])}soloSeriesIntegrity(t){if(!De(t.series))return;const i=n=>fe.getSeriesModule(n)?.solo??!1,s=t.series;if(s&&s.length>1&&s.some(n=>i(n.type))){const n=this.optionsType(t);if(i(n))K.warn(`series[0] of type '${n}' is incompatible with other series types. Only processing series[0]`),t.series=s.slice(0,1);else{const{solo:a,nonSolo:o}=cd(s,l=>i(l.type)?"solo":"nonSolo"),r=$p(a.map(l=>l.type)).join(", ");K.warn(`Unable to mix these series types with the lead series type: ${r}`),t.series=o}}}static processFontOptions(t,i,s,n=new Set){if(typeof t=="object"&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const a=[];for(const o of t.fontFamily)typeof o=="object"&&"googleFont"in o?(a.push(o.googleFont),n?.add(o.googleFont)):a.push(o);t.fontFamily=a.join(", ")}else typeof t.fontFamily=="object"&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,n?.add(t.fontFamily));return n}processFonts(t,i=new Set){return ko(t,Wi.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(t){if("enabled"in t&&t.enabled===!1)for(const i of Object.keys(t))i!=="enabled"&&delete t[i]}removeDisabledOptions(t){ko(t,Wi.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!ge(t)))for(const i of Object.keys(t)){const s=t[i];yd(s)&&delete t[i]}}removeLeftoverSymbols(t){ko(t,Wi.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=Re():WS(t.window),t.document==null?t.document=dn():jS(t.document),t.window==null)throw new Error("AG Charts - unable to resolve global window");if(t.document==null)throw new Error("AG Charts - unable to resolve global document");return t}};Ih.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Ih.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},Ih.JSON_DIFF_OPTS=new Set(["data","localeText"]),Ih.perfDebug=be.create(!0,"perf"),Ih.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Ih.debug=be.create(!0,"opts");var Mf=Ih,mb=be.create(!0,"opts"),Jl="AG Charts - Chart was destroyed, cannot perform request.",Df=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){if(!this.chart)throw new Error(Jl);return mb.group("AgChartInstance.update()",async()=>{const i=be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(t,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(t){if(!this.chart)throw new Error(Jl);return mb.group("AgChartInstance.updateDelta()",async()=>{const i=be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,t,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(Jl);const t=Te(this.chart.getOptions(),Mf.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){if(!this.chart)throw new Error(Jl);return this.chart.waitForUpdate()}applyTransaction(t){const{chart:i}=this;if(!i)throw new Error(Jl);if(t==null||typeof t!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:s,addIndex:n,remove:a,update:o}=t;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(o!=null&&!Array.isArray(o))throw new Error('AG Charts - transaction "update" must be an array.');return mb.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const r=i.data.deepClone();return r.addTransaction(t),r.commitPendingTransactions(),this.updateDelta({data:r.data})}return mb("transaction",t),await this.chart?.applyTransaction(t)})}async download(t){if(!this.chart)throw new Error(Jl);const i=await this.prepareResizedChart(this,this.chart,t);try{i.chart?.download(t?.fileName,t?.fileFormat)}finally{i.destroy()}}async __toSVG(t){if(!this.chart)throw new Error(Jl);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...t});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(t){if(!this.chart)throw new Error(Jl);const i=await this.prepareResizedChart(this,this.chart,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(t,s);return}await this.setStateOriginators(t,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(t,[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(t,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,a=s.height??i.height??i.ctx.scene.canvas.height,o=t.getState(),r={...i.chartOptions.processedOverrides,container:dn().createElement("div"),width:n,height:a};s.width!=null&&s.height!=null&&(r.overrideDevicePixelRatio=1);const l=i.getOptions();if(fe.isEnterprise()){r.animation={enabled:!1};const y=this.licenseManager?.getWatermarkForegroundConfigForBrowser();y&&(r.foreground=y)}const c={...i.chartOptions.specialOverrides},h={...i.chartOptions.optionMetadata},d=await this.chart?.ctx.dataService.getData(),u=this.factoryApi.create(l,r,c,h,d);o.legend&&this.syncLegend(i,u,o),u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),await u.setState(o);const p={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};u.chart?.ctx.zoomManager.updateZoom(p,i.ctx.zoomManager.getZoom()),u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate();const f=[];for(const y of i.modulesManager.legends())f.push(y.legend.pagination?.currentPage??0);for(const y of u.chart.modulesManager.legends()){const b=f.shift()??0;y.legend.pagination&&y.legend.pagination.setPage(b)}return u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}syncLegend(t,i,s){const n=new Map;for(const[a,o]of t.series.entries()){const r=i.chart?.series[a];r&&n.set(o.id,r.id)}s.legend=s.legend?.map(a=>({...a,seriesId:n.get(a.seriesId??"")??a.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:a,legendManager:o},modulesManager:r}=this.chart,l=[];return"annotations"in t&&t.annotations?.enabled&&l.push(s),i.presetType==="price-volume"&&l.push(n),(t.navigator?.enabled||t.zoom?.enabled)&&l.push(a),r.isEnabled("legend")&&t.legend?.enabled!==!1&&l.push(o),l.push(this.chart.ctx.activeManager),l}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};Df.chartInstances=new WeakMap,g([_e({oldValue(e){e.destroyed||(e.publicApi=void 0),Df.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,Df.chartInstances.set(e,this))}})],Df.prototype,"chart",2);var N2=Df,p3=1e3,Pk=class Nc{constructor(t,i,s,n,a,o=p3){this.name=t,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=a,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,n,a){return this.pools.has(t)||this.pools.set(t,new Nc(t,i,s,n,a)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(t),Nc.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):Nc.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 t=this.freePool.pop();if(t==null)throw new Error("AG Charts - pool has no free instances");return Nc.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");Nc.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),Nc.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);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 t=this.freePool.splice(0);for(const i of t)this.destroyItem(i);Nc.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};Pk.pools=new Map,Pk.debug=be.create(!0,"pool");var g3=Pk,Gr=be.create(!0,"opts"),Da=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=zi.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return zi.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return T2.getInstance(e)}static create(e,t){const i=be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Gr.group("AgCharts.create()",()=>{e=be.inDevelopmentMode(()=>Ks(Te(e)))??e,this.licenseCheck(e);const s=T2.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t,apiStartTime:i});return this.licenseManager?.isDisplayWatermark()&&zi.injectWatermark?.(s.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),s})}static createFinancialChart(e){return Gr.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return Gr.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return Gr.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};Da.licenseChecked=!1;var zo=class Om{static getInstance(t){const i=sb.getInstance(t);return i?N2.chartInstances.get(i):void 0}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:n,processedOverrides:a=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:d}=t,u=zi.styles==null?[]:[["ag-charts-enterprise",zi.styles]];if(fe.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(`
`));Gr(()=>[">>> AgCharts.createOrUpdate() user options",Te(s)]);const{presetType:p}=r;let f=s;Da.optionsMutationFn&&f&&(f=Da.optionsMutationFn(Te(f,Mf.OPTIONS_CLONE_OPTS_FAST),p),Gr(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Te(f)]));const y=this.getPool(r);let b=!1,x,v=i?.chart;v==null&&y?.hasFree()&&(x=y.obtainFree(),v=x.item);const{document:S,window:M,styleContainer:D,skipCss:I,...k}=f??{},C=v?.getChartOptions(),A=new Mf(C,k,a,{...o,document:S,window:M,styleContainer:D,skipCss:I},r,l,h,d);(v==null||hf(A.processedOptions)!==hf(v.chartOptions.processedOptions))&&(x?.release(),x=this.getPool(A.optionMetadata)?.obtain(A),x?v=x.item:(b=!0,v=Om.createChartInstance(A,v))),A.optionsGraph&&v.ctx.optionsGraphService.updateCallback((w,T,O)=>A.optionsGraph?.resolvePartial(w,T,O));for(const[w,T]of u)v.ctx.domManager.addStyles(w,T);return v.ctx.fontManager.updateFonts(A.googleFonts),c!=null&&v.ctx.dataService.restoreData(c),i==null?(i=new N2(v,Om.callbackApi,n),i.releaseChart=x?.release):(x||b)&&(i.releaseChart?.(),i.chart=v,i.releaseChart=x?.release),Gr.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[v.id]=v),v.queuedUserOptions.push(A.userOptions),v.queuedChartOptions.push(A),v.requestFactoryUpdate(w=>{Gr.group(">>>> Chart.applyOptions()",()=>{w.applyOptions(A);const T=w.queuedUserOptions.indexOf(A.userOptions)+1;w.queuedUserOptions.splice(0,T),w.queuedChartOptions.splice(0,T)})}),i}static updateUserDelta(t,i,s){i=Te(i,Mf.OPTIONS_CLONE_OPTS_FAST);const n=ko(i,Om.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Gr(()=>[">>> AgCharts.updateUserDelta() user delta",Te(i)]),Om.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:n,apiStartTime:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0}),n=hf(t.processedOptions);return fe.getChartModule(n).create(t,s)}static getPool(t){if(t.pool===!0)return g3.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};zo.caretaker=new Dy(ue),zo.callbackApi={caretaker:zo.caretaker,create(e,t,i,s,n){return zo.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s,data:n})},update(e,t,i,s){return zo.createOrUpdate({userOptions:e,proxy:t,specialOverrides:i,apiStartTime:s})},updateUserDelta(e,t,i){return zo.updateUserDelta(e,t,i)}},zo.markRemovedProperties=(e,t,i,s)=>{let n=s??!1;if(typeof e!="object"||e==null)return n;for(const a of za(e))e[a]===void 0&&(Object.assign(e,{[a]:Symbol("UNSET")}),n||(n=!0));return n},zo.detachAndClear=e=>e.detachAndClear(),zo.destroy=e=>e.destroy();var T2=zo,N={};Ws(N,{APPROXIMATE_THRESHOLD:()=>RW,AbstractBarSeries:()=>Z2,AbstractBarSeriesProperties:()=>wf,AggregationManager:()=>Tb,AnchoredPopover:()=>zP,ApproximateOrdinalTimeScale:()=>vY,Arc:()=>Fo,Axis:()=>nk,AxisGroupZIndexMap:()=>N1,AxisInterval:()=>rh,AxisLabel:()=>Ot,AxisTick:()=>lh,BBox:()=>le,Background:()=>vu,BandScale:()=>Ya,BaseToolbar:()=>dI,Caption:()=>zt,CartesianAxis:()=>cf,CartesianCrossLine:()=>Os,CartesianSeries:()=>ec,CartesianSeriesNodeEvent:()=>_k,CartesianSeriesProperties:()=>eo,CategoryAxis:()=>If,CategoryScale:()=>Cu,Chart:()=>sb,ChartAxes:()=>Ex,ChartOptions:()=>Mf,CollapseMode:()=>nP,ColorScale:()=>uu,ContextMenuRegistry:()=>t1,ContinuousScale:()=>mt,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Ju,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>ep,DEFAULT_POLAR_DIRECTION_KEYS:()=>SP,DEFAULT_POLAR_DIRECTION_NAMES:()=>MP,DOMManager:()=>kT,DataController:()=>D1,DataModel:()=>FD,DataModelSeries:()=>Fk,DataSet:()=>Iu,DiscreteTimeAxis:()=>IP,DraggablePopover:()=>VP,DropShadow:()=>Bo,ExtendedPath2D:()=>pu,FillGradientDefaults:()=>jl,FillImageDefaults:()=>zr,FillPatternDefaults:()=>wi,FloatingToolbar:()=>CY,FormatManager:()=>Du,Group:()=>Le,GroupWidget:()=>IT,HierarchyHighlightState:()=>DP,HierarchyNode:()=>cY,HierarchySeries:()=>hY,HierarchySeriesProperties:()=>ic,HighlightManager:()=>s1,HighlightProperties:()=>Rr,HighlightState:()=>n1,Image:()=>tp,InteractionManager:()=>NT,InteractionState:()=>LT,LARGEST_KEY_INTERVAL:()=>qT,Label:()=>Yn,LabelStyle:()=>Un,LayoutElement:()=>qD,Line:()=>Kn,LinearScale:()=>Ah,LogScale:()=>Vk,Marker:()=>Li,Menu:()=>MY,MercatorScale:()=>dY,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Za,NativeWidget:()=>Su,NiceMode:()=>w1,Node:()=>Pr,OrdinalTimeScale:()=>$l,Path:()=>Ai,PointerEvents:()=>YN,PolarAxis:()=>rI,PolarSeries:()=>iI,QuadtreeNearest:()=>V2,RadialColumnShape:()=>to,Range:()=>No,Rect:()=>Ci,Rotatable:()=>gu,RotatableText:()=>xT,SMALLEST_KEY_INTERVAL:()=>XT,Scalable:()=>wx,ScalableGroup:()=>sj,Scene:()=>Fx,Sector:()=>vs,SectorBox:()=>NP,SegmentedPath:()=>Bk,Selection:()=>pi,Series:()=>uf,SeriesItemHighlightStyle:()=>Gl,SeriesMarker:()=>sn,SeriesNodeEvent:()=>eb,SeriesNodePickMode:()=>Y1,SeriesProperties:()=>Ua,SeriesTooltip:()=>jr,Shape:()=>Jc,SliderWidget:()=>kD,StopProperties:()=>dD,SvgPath:()=>LP,Text:()=>xn,TimeAxisParentLevel:()=>Qu,TimeScale:()=>wu,Toolbar:()=>IY,ToolbarButtonWidget:()=>BP,ToolbarWidget:()=>Bx,TooltipManager:()=>Yx,Transformable:()=>Wt,TransformableGroup:()=>mu,TransformableText:()=>bu,Translatable:()=>fu,TranslatableGroup:()=>ds,TranslatableSvgPath:()=>bY,UnitTimeScale:()=>Kl,ZoomManager:()=>S1,accumulativeValueProperty:()=>_D,addHitTestersToQuadtree:()=>vb,adjustLabelPlacement:()=>G2,angleCategoryAxisOptionsDefs:()=>mk,angleNumberAxisOptionsDefs:()=>yO,animationValidation:()=>of,annotationCalloutStylesDefs:()=>VO,annotationChannelTextDefs:()=>TO,annotationCommentStylesDefs:()=>BO,annotationCrossLineStyleDefs:()=>Sk,annotationDisjointChannelStyleDefs:()=>RO,annotationFibonacciStylesDefs:()=>Mk,annotationLineStyleDefs:()=>db,annotationLineTextDefs:()=>hb,annotationMeasurerStylesDefs:()=>ub,annotationNoteStylesDefs:()=>FO,annotationOptionsDef:()=>$u,annotationParallelChannelStyleDefs:()=>zO,annotationQuickMeasurerStylesDefs:()=>_O,annotationShapeStylesDefs:()=>Dk,annotationTextStylesDef:()=>yf,boxPlotSeriesThemeableOptionsDef:()=>WO,buildResetPathFn:()=>tI,calculateDataDiff:()=>bP,calculateLabelTranslation:()=>fY,calculateSegments:()=>yb,candlestickSeriesThemeableOptionsDef:()=>KO,checkCrisp:()=>mP,chordSeriesThemeableOptionsDef:()=>UO,clippedRoundRect:()=>Ox,collapsedStartingBarPosition:()=>Of,computeBarFocusBounds:()=>Yk,computeMarkerFocusBounds:()=>Cb,coneFunnelSeriesThemeableOptionsDef:()=>YO,createDatumId:()=>us,diff:()=>Kx,drawCorner:()=>Zg,drawMarkerUnitPolygon:()=>pf,findNodeDatumInArray:()=>r1,findQuadtreeMatch:()=>Sb,fixNumericExtent:()=>bn,fromToMotion:()=>ui,funnelSeriesThemeableOptionsDef:()=>ZO,generateTicks:()=>H1,getColorStops:()=>eT,getCrossLineValue:()=>A1,getItemStyles:()=>KD,getItemStylesPerItemId:()=>wW,getLabelStyles:()=>Ch,getMarkerStyles:()=>wb,getMissCount:()=>FT,getRadialColumnWidth:()=>TP,getShapeFill:()=>U1,getShapeStyle:()=>ck,groupAccumulativeValueProperty:()=>nf,hasDimmedOpacity:()=>UD,heatmapSeriesThemeableOptionsDef:()=>XO,initialStatePickedOptionsDef:()=>CD,interpolatePoints:()=>Tf,isTooltipValueMissing:()=>hh,keyProperty:()=>Hl,makeSeriesTooltip:()=>Lh,mapLineBackgroundSeriesThemeableOptionsDef:()=>JO,mapLineSeriesThemeableOptionsDef:()=>QO,mapMarkerSeriesThemeableOptionsDef:()=>e2,mapShapeBackgroundSeriesThemeableOptionsDef:()=>i2,mapShapeSeriesThemeableOptionsDef:()=>t2,markerEnabled:()=>Qk,markerFadeInAnimation:()=>Rf,markerSwipeScaleInAnimation:()=>qk,midpointStartingBarPosition:()=>nY,minimumTimeAxisDatumGranularity:()=>B2,motion:()=>LY,nightingaleSeriesThemeableOptionsDef:()=>s2,normaliseGroupTo:()=>Wx,ohlcSeriesThemeableOptionsDef:()=>qO,ordinalTimeAxisOptionsDefs:()=>Gu,pairUpSpans:()=>Nf,pathFadeInAnimation:()=>eI,pathMotion:()=>Ob,pathSwipeInAnimation:()=>Jk,plotAreaPathFill:()=>yP,plotInterpolatedLinePathStroke:()=>Db,plotLinePathStroke:()=>$k,predictCartesianFinancialAxis:()=>f3,predictCartesianNonPrimitiveAxis:()=>kf,prepareAreaFillAnimationFns:()=>xP,prepareBarAnimationFunctions:()=>Pf,prepareLinePathPropertyAnimation:()=>Kk,processedDataIsAnimatable:()=>va,pyramidSeriesThemeableOptionsDef:()=>n2,radarAreaSeriesThemeableOptionsDef:()=>a2,radarLineSeriesThemeableOptionsDef:()=>o2,radialBarSeriesThemeableOptionsDef:()=>r2,radialColumnSeriesThemeableOptionsDef:()=>l2,radiusCategoryAxisOptionsDefs:()=>bO,radiusNumberAxisOptionsDefs:()=>xO,rangeAreaSeriesThemeableOptionsDef:()=>d2,rangeBarSeriesThemeableOptionsDef:()=>p2,resetAxisLabelSelectionFn:()=>Qx,resetBarSelectionsDirect:()=>kb,resetBarSelectionsFn:()=>Ef,resetLabelFn:()=>wh,resetMarkerFn:()=>Ib,resetMarkerPositionFn:()=>zf,resetMarkerSelectionsDirect:()=>Ab,resetMotion:()=>Xi,sankeySeriesThemeableOptionsDef:()=>g2,sectorBox:()=>AP,seriesLabelFadeInAnimation:()=>ti,seriesLabelFadeOutAnimation:()=>xb,stackCartesianSeries:()=>_2,standaloneChartOptionsDefs:()=>f4,sunburstSeriesThemeableOptionsDef:()=>f2,toHierarchyHighlightString:()=>Vf,toHighlightString:()=>ku,topologyChartOptionsDefs:()=>g4,trailingAccumulatedValueProperty:()=>dW,treemapSeriesThemeableOptionsDef:()=>m2,updateClipPath:()=>Lb,updateLabelNode:()=>H2,upsertNodeDatum:()=>Zk,userInteraction:()=>_W,validateCrossLineValue:()=>C1,valueProperty:()=>Lt,visibleRangeIndices:()=>rf,waterfallSeriesThemeableOptionsDef:()=>y2});function O2(e){return e.isReversed()!==e.range[1]<e.range[0]}function yb(e,t,i,s,n,a=!0){if(t.scale.domain.length===0||i.scale.domain.length===0)return;const o=e.key==="x"?t:i,{scale:r,direction:l}=o,c=l==="x",h=r.bandwidth??0,d=a?((r.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)),f=()=>O2(c?t:i)?c?s.width+u:s.height+p:c?-u:-p,y=()=>O2(c?t:i)?c?-u:-p:c?s.width+u:s.height+p;return(x=>{const v=[];let S=-1;for(let M=0;M<x.length;M++){const D=x[M];if(md(D))continue;const{start:I,stop:k,...C}=x[M],A=x[S]?.stop,w=x.slice(M+1).find(E=>E.start!=null)?.start;let T=r.convert(I??A)-d,O=r.convert(k??w)+2*d;const z=I!=null&&Number.isNaN(T),V=k!=null&&Number.isNaN(O);z||V||(Number.isNaN(T)&&(T=f()),Number.isNaN(O)&&(O=y()),k!=null&&(S=M),v.push({start:T,stop:O,...C}))}return v})(e.segments).map(({stop:x,start:v,...S})=>{const M=c?v:-u,D=c?-p:v,I=c?x+h:s.width+u,k=c?s.height+p:x+h;return{clipRect:{x0:M,y0:D,x1:I,y1:k},...S}})}var P2=new Set(["time","timestamp","date","datetime"]);function Ek(e,t,i,{allowPrimitiveTypes:s=!0}={}){if(e!=="x"&&e!=="y"||!ge(t))return;const n=E2(e,i);if(n==null||!(n in t))return;const a=t[n],o=R2(e,i),r=m3(a);if(r)return{type:r,position:o};const l=y3(n,a);if(l)return{type:l,position:o};if(s)return typeof a=="number"?{type:"number",position:o}:{type:"category",position:o}}function kf(e,t,i){return Ek(e,t,i,{allowPrimitiveTypes:!1})}function f3(e,t,i){if(e!=="x"||!ge(t))return;const s=E2(e,i);if(s==null||!(s in t))return;const n=t[s],a=R2(e,i),o=x3(s,n);if(o)return{type:o,position:a};if(Bt(n))return{type:"category",position:a}}function m3(e){if(De(e)&&e.every(t=>Bt(t)||t===null))return"grouped-category"}function y3(e,t){if(Cs(t)||P2.has(e)&&gt(t))return"time"}function x3(e,t){if(Cs(t)||P2.has(e)&&gt(t))return"ordinal-time"}function E2(e,t){if(e==="x"&&"xKey"in t)return t.xKey;if(e==="y"&&"yKey"in t)return t.yKey}function R2(e,t){return"direction"in t&&t.direction==="horizontal"?e==="x"?"left":"bottom":e==="x"?"bottom":"left"}var b3={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},v3=(e,t)=>Math.log(t)/Math.log(e);function Rk(e,t,i){const s=Math.min(...t),n=b3[e]??v3;return s>=0?n(e,i):-n(e,-i)}var S3={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},M3=(e,t)=>e**t;function zk(e,t,i){const s=Math.min(...t),n=S3[e]??M3;return s>=0?n(e,i):-n(e,-i)}var Vk=class f_ extends mt{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>Rk(this.base,this.domain,s),this.pow=s=>zk(this.base,this.domain,s)}static is(t){return t instanceof f_}transform(t){const[i,s]=Tt(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,s]=Tt(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.exp(t):-Math.exp(-t)}toDomain(t){return t}niceDomain(t,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,a]=i,o=n>a?Math.ceil:Math.floor,r=n>a?Math.floor:Math.ceil,l=zk(s,i,o(Rk(s,i,n))),c=zk(s,i,r(Rk(s,i,a)));return[t.nice[0]?l:i[0],t.nice[1]?c:i[1]]}ticks({interval:t,tickCount:i=mt.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const a=this.base,[o,r]=s,l=Math.min(o,r),c=Math.max(o,r);let h=this.log(l),d=this.log(c);if(t){const b=I=>I>=l&&I<=c,x=Math.min(Math.abs(t),Math.abs(d-h)),{ticks:v,count:S,firstTickIndex:M}=Kc(h,d,x,n),D=v.map(this.pow).filter(b);if(!Rl(D.length,this.getPixelRange()))return{ticks:D,count:S,firstTickIndex:M}}if(!u0(a)||d-h>=i){const b=Math.min(d-h,i),{ticks:x,count:v,firstTickIndex:S}=Wc(h,d,b,void 0,void 0,n);return{ticks:x.map(this.pow),count:v,firstTickIndex:S}}const u=[],p=l>0;h=Math.floor(h)-1,d=Math.round(d)+1;const f=xo(this.range)/i;let y=1/0;for(let b=h;b<=d;b++){const x=this.convert(this.pow(b+1));for(let v=1;v<a;v++){const S=p?v:a-v+1,M=this.pow(b)*S,D=this.convert(M),I=Math.abs(y-D),k=Math.abs(D-x),C=I>=f&&k>=f;M>=l&&M<=c&&(v===1||C||u.length===0)&&(u.push(M),y=D)}}return XN(u,p,n)}},Bk=class extends Ai{constructor(){super(...arguments),this.segmentPath=new Ai}drawPath(e){if(!this.segments||this.segments.length===0){super.drawPath(e);return}e.save();const t=Tc(),i=new t;qu(i,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const n of this.segments)qu(i,n.clipRect);e.clip(i),super.drawPath(e),e.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:o,...r}of this.segments){e.save(),s.path=this.path,s.setProperties(r),s.fill=this.fill==null?"none":a,s.stroke=this.stroke==null?"none":o;const l=new t;qu(l,n),e.clip(l),s.drawPath(e),e.restore()}}};g([Kg()],Bk.prototype,"segments",2);function qu(e,{x0:t,y0:i,x1:s,y1:n},a=!0){const o=Math.min(t,s),r=Math.min(i,n),l=Math.max(t,s),c=Math.max(i,n);e.moveTo(o,r),a?(e.lineTo(l,r),e.lineTo(l,c),e.lineTo(o,c)):(e.lineTo(o,c),e.lineTo(l,c),e.lineTo(l,r)),e.closePath()}var z2=class extends ds{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(wx(Ai))}renderInContext(e){if(!this.visible)return;const{ctx:t}=e;if(!this.segments||this.segments?.length===0)return super.renderInContext(e);t.save();const i=Tc(),s=new i;qu(s,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const a of this.segments)qu(s,a.clipRect);t.clip(s);for(const a of this.children())a.visible&&a.render(e);t.restore();const{scalablePath:n}=this;for(const{clipRect:a,...o}of this.segments){t.save();const r=new i;qu(r,a),t.clip(r),n.setProperties(o);for(const l of this.children())!l.visible||!(l instanceof Ai)||(n.path=l.path,n.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...ij(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),n.render(e));t.restore()}}};g([Kg()],z2.prototype,"segments",2);var V2=class{constructor(e,t,i){this.root=new I3(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(s,n)=>e.distanceSquared(s,n)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},D3=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},k3=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??le.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(this.subdivisions===void 0?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:n}=this,a=this.maxdepth-1,o=i/2,r=s/2,l=new le(e,t,o,r),c=new le(e+o,t,o,r),h=new le(e,t+r,o,r),d=new le(e+o,t+r,o,r);return new D3(this.child(n,a,l),this.child(n,a,c),this.child(n,a,h),this.child(n,a,d))}},I3=class m_ extends k3{addCondition(t){const{x:i,y:s}=t.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(t,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(t,i)<n.distanceSquared}findAction(t,i,s){const n=Xd(t,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(t,i,s){return new m_(t,i,s)}},Ah=class lL extends mt{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof lL}static getTickStep(t,i,s){const{interval:n,tickCount:a=mt.defaultTickCount,minTickCount:o,maxTickCount:r}=s;return n??$c(t,i,a,o,r)}toDomain(t){return t}ticks({interval:t,tickCount:i=mt.defaultTickCount,minTickCount:s,maxTickCount:n},a=this.domain,o){if(!a||a.length<2||i<1||!a.every(Number.isFinite))return{ticks:[],count:0,firstTickIndex:0};const[r,l]=a;if(t){const c=Math.abs(t);if(!Rl((l-r)/c,this.getPixelRange()))return Kc(r,l,c,o)}return Wc(r,l,i,s,n,o)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=mt.defaultTickCount}=t;let[n,a]=i;if(s===1)[n,a]=gx(n,a);else if(s>1){const o=n>a?Math.ceil:Math.floor,r=n>a?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,d=a,u=lL.getTickStep(n,a,t),[p,f]=i;if(n=o(p/u)*u,a=r(f/u)*u,n===h&&a===d)break}}return[t.nice[0]?n:i[0],t.nice[1]?a:i[1]]}},Xn=class extends cf{constructor(e,t=new Ah){super(e,t)}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:o}=Gc(e.domain,t,i,s,n,void 0,e.sortMetadata?.sortOrder);return{domain:a,clipped:o}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}getVisibleDomain(e){const[t,i]=e,[s,n]=this.visibleRange,a=i-t;return[t+s*a,i-(1-n)*a]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:this.getVisibleDomain(e),fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:h}=t,d=this.getVisibleDomain(c);return{type:"number",value:e,datum:s,seriesId:n,legendItemName:a,key:o,source:r,property:l,domain:c,visibleDomain:d,boundSeries:h,fractionDigits:i}}};Xn.className="NumberAxis",Xn.type="number",g([m],Xn.prototype,"min",2),g([m],Xn.prototype,"max",2),g([m],Xn.prototype,"preferredMin",2),g([m],Xn.prototype,"preferredMax",2);var Qu=class extends X{constructor(){super(...arguments),this.enabled=!1,this.label=new Ot,this.tick=new lh}};g([m],Qu.prototype,"enabled",2),g([m],Qu.prototype,"label",2),g([m],Qu.prototype,"tick",2);var Vo=class extends cf{constructor(e){super(e,new wu),this.parentLevel=new Qu,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0}get _unit(){}set _unit(e){K.warnOnce("To use 'unit', use an axis with type 'unit-time' instead of 'time'.")}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}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(e){const{extent:t,clipped:i}=Pg(e,this.min,this.max,this.preferredMin,this.preferredMax);return{domain:t,clipped:i}}processData(){super.processData();const{boundSeries:e,direction:t,min:i,max:s}=this;this.minimumTimeGranularity=B2(e,t,i,s)}tickFormatParams(e,t,i,s){s??(s=Hg(t));const n=Gg(e),a=xa(s),o=ja(s),r=El(s);return{type:"date",unit:a,step:o,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:b}=this,x=ru(e);b!=null&&cs(b)<cs(x)?s=b:s=x}const{datum:a,seriesId:o,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u}=t,p=xa(s),f=ja(s),y=El(s);return{type:"date",value:e,datum:a,seriesId:o,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u,unit:p,step:f,epoch:y,style:n}}};Vo.className="TimeAxis",Vo.type="time",g([m],Vo.prototype,"parentLevel",2),g([m],Vo.prototype,"min",2),g([m],Vo.prototype,"max",2),g([m],Vo.prototype,"preferredMin",2),g([m],Vo.prototype,"preferredMax",2),g([m,Dt("_unit")],Vo.prototype,"unit",2);function B2(e,t,i,s){const n=e.reduce((a,o)=>Math.min(o.minTimeInterval()??1/0,a),1/0);return Number.isFinite(n)?ou(n):F2(e,t,i,s)?.unit}function F2(e,t,i,s){let n=1/0,a=-1/0,o,r=0;const l=[];for(const u of e){if(!u.visible)continue;const{extent:p}=Pg(u.getDomain(t));if(p.length===0)continue;const f=p[0].valueOf(),y=p.at(-1).valueOf();l.push(f,y),n=Math.min(n??1/0,f,y),a=Math.max(a??-1/0,f,y);const b=Math.abs(y-f);if(b===0)continue;const x=u.dataCount();if(r=Math.max(r,x),x<=1)continue;const v=b/(x-1);o=Math.min(o??1/0,v)}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;o??(o=Math.abs(a-n)),o=Math.min(o,A3(l));const c=ou(o);let h=o/cs(c);r<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const d=h===1?void 0:en(c,n);return{unit:c,step:h,epoch:d}}function A3(e){e.sort((i,s)=>i-s);let t=1/0;for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];n-s>0&&(t=Math.min(t,Math.abs(n-s)))}return t}var Fk=class extends uf{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!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:e,yScale:t}){const i=mt.is(e),s=mt.is(t);return{isContinuousX:i,isContinuousY:s,xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await e.request(this.id,t??Iu.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:e,ctx:t}=this;if(!e)return!1;const i=this.getNodeData();if(i!=null&&i.length>t.animationManager.maxAnimatableItems)return!1;const s=e.reduced?.animationValidation;if(!s)return!0;const{orderedKeys:n,uniqueKeys:a}=s;return n&&a}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return r1(e,this.getNodeData())}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox:s}=this,n=t[i],a={...e,datumIndex:i},o=this.computeFocusBounds(a);if(o!==void 0)return{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>i.datumIndex-s.datumIndex),t}isDatumEnabled(e,t){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=e[t];return!i&&s&&n}computeFocusDatumIndex(e,t){const i=(o,r)=>{for(;o>=0&&!this.isDatumEnabled(t,o);)o+=r;return o===-1?void 0:o},s=(o,r)=>{for(;o<t.length&&!this.isDatumEnabled(t,o);)o+=r;return o===t.length?void 0:o};let n;const a=ae(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?n=i(a,e.datumIndexDelta):e.datumIndexDelta>0?n=s(a,e.datumIndexDelta):n=s(a,1)??i(a,-1),n===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:n}dataModelPropertyIsKey(e){const{processedData:t}=this;return t?t.defs.keys.some(i=>i.id===e&&i.idsMap?.get(this.id)?.has(e)===!0):!1}keysOrValues(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:this.dataModelPropertyIsKey(e)?t.resolveKeysById(this,e,i):t.resolveColumnById(this,e,i)}sortOrder(e){const{dataModel:t,processedData:i}=this;if(!(!t||!i))return this.dataModelPropertyIsKey(e)?t.getKeySortOrder(this,e,i):t.getColumnSortOrder(this,e,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();return!t||!i||!s||(t.invalidData?.get(this.id)?.[e]??!1)?void 0:this.keysOrValues(s)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const n=t.invalidData?.get(this.id),a=this.keysOrValues(s);for(let o=0;o<a.length;o+=1){if(n?.[o]===!0)continue;const r=a[o]?.valueOf();if(Ht(e,r))return o}}},Ju={x:["xKey"],y:["yKey"]},ep={x:["xName"],y:["yName"]},_k=class extends eb{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},eo=class extends Ua{constructor(){super(...arguments),this.xKeyAxis="x",this.yKeyAxis="y",this.pickOutsideVisibleMinorAxis=!1,this.segmentation=new Ux}};g([m],eo.prototype,"xKeyAxis",2),g([m],eo.prototype,"yKeyAxis",2),g([m],eo.prototype,"legendItemName",2),g([m],eo.prototype,"pickOutsideVisibleMinorAxis",2),g([m],eo.prototype,"segmentation",2);var Hk=100,ec=class extends Fk{constructor({pathsPerSeries:e=["path"],pathsZIndexSubOrderOffset:t=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:s=!1,animationAlwaysPopulateNodeData:n=!1,segmentedDataNodes:a=!0,animationResetFns:o,propertyKeys:r,propertyNames:l,...c}){if(super({propertyKeys:r,propertyNames:l,canHaveAxes:!0,...c}),this.NodeEvent=_k,this.dataNodeGroup=this.contentGroup.appendChild(new z2({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new ds({name:`${this.id}-series-labels`})),this.labelSelection=pi.select(this.labelGroup,xn),this.highlightSelection=pi.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=pi.select(this.highlightLabelGroup,xn),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=be.create(),!r||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,pathsZIndexSubOrderOffset:t,propertyKeys:r,propertyNames:l,animationResetFns:o,animationAlwaysUpdateSelections:s,animationAlwaysPopulateNodeData:n,datumSelectionGarbageCollection:i,segmentedDataNodes:a},this.paths=e.map(h=>new Bk({name:`${this.id}-${h}`})),this.datumSelection=pi.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new de("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(e){if(this.shouldFlipXY()){if(e==="x")return this.properties.yKeyAxis;if(e==="y")return this.properties.xKeyAxis}if(e==="x")return this.properties.xKeyAxis;if(e==="y")return this.properties.yKeyAxis}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e){for(const t of e)t.remove()}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>Hk}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(e){if(!this.properties.highlight.enabled)return!1;const{series:t,legendItemName:i}=e??{},{legendItemName:s}=this.properties;return t===this||s!=null&&s===i}strokewidthChange(){const e=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,t=this.properties.highlight.highlightedSeries.strokeWidth??e,i=this.properties.highlight.highlightedItem?.strokeWidth??e;return e>i||t>i}update({seriesRect:e}){const{_contextNodeData:t}=this,i=this.checkResize(e),s=this.updateHighlightSelection(),n=this;this.contentGroup.batchedUpdate(function(){const r=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||r)});const a=this.getAnimationData(e,t);a&&(i&&this.animationState.transition("resize",a),this.animationState.transition("update",a),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(e=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!va(i)||e:!1}trimIncrementalNodeArray(e,t){t<e.length&&(e.length=t)}createNodeData(){const e=this.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e,s=this.createNodeDatumContext(t,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(e,t){throw new Error(`${this.constructor.name}: createNodeDatumContext() must be implemented when using the template method pattern`)}populateNodeData(e){throw new Error(`${this.constructor.name}: populateNodeData() must be implemented when using the template method pattern`)}initializeResult(e){throw new Error(`${this.constructor.name}: initializeResult() must be implemented when using the template method pattern`)}validateCreateNodeDataPreconditions(){const e=this.axes.x,t=this.axes.y;if(!(!e||!t||!this.dataModel||!this.processedData))return{xAxis:e,yAxis:t}}getEmptyResult(){}finalizeNodeData(e){e.canIncrementallyUpdate&&this.trimIncrementalNodeArray(e.nodes,e.nodeIndex)}assembleResult(e,t){return t}updateSelections(){var e;const t=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&t)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){(e=this._contextNodeData).animationValid??(e.animationValid=s);const o=this._contextNodeData.nodeData?.length;o!=null&&ha.record(`${this.type}:nodeData`,o)}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:e,labelSelection:t,paths:i}=this,s=this._contextNodeData;if(!s)return;const{nodeData:n,labelData:a,itemId:o}=s;this.updatePaths({itemId:o,contextData:s,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:t})??t})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,n]=Tt(t?.range??[0,1]),[a,o]=Tt(i?.range??[0,1]),r=rd(this.getSeriesDomain("x")),l=[t?.scale.convert(r.at(0)),t?.scale.convert(r.at(-1))],c=rd(this.getSeriesDomain("y")),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=Tt(l),[p,f]=Tt(h);return{axis:new le(s,a,n-s,o-a),series:new le(d,p,u-d,f-p)}}updateNodes(e,t){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)&&e,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:o}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i);const{dataNodeGroup:r,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:d}=this.contextNodeData??{};if(this.updatePathNodes({itemId:d,paths:c,visible:a,animationEnabled:n}),r.visible=n||a,h.visible=a,!r.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:s,isHighlight:!1});const u=this.strokewidthChange()||this.hasChangesOnHighlight;(t||u)&&(this.updateDatumNodes({datumSelection:s,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(e,t){return t?[{...t}]:void 0}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum&&s.itemId===t.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:e,highlightLabelSelection:t,_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:o,labelData:r}=i,l=this.getHighlightData(o,a);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:e});const c=this.getHighlightLabelData(r,a)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:c,labelSelection:t})??t,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)e.datum.missing!==!0&&(yield e)}getQuadTree(){if(this.quadtree===void 0){const e=this.ctx.scene?.canvas??{width:0,height:0},t=new le(0,0,e.width,e.height);this.quadtree=new V2(100,10,t),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodeDataExactShape(e){const{x:t,y:i}=e,{dataNodeGroup:s}=this,n=s.pickNodes(t,i).filter(a=>a.datum.missing!==!0);if(n.length!==0)return n.map(o=>o.datum)}pickModulesExactShape(e){for(const t of this.moduleMap.modules()){const{datum:i}=t.pickNodeExact(e)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.length!==0?t:this.pickNodeDataExactShape(e)??this.pickModulesExactShape(e)??[]}pickNodeDataClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:n}=this;if(!n)return;const a=s.x,o=s.y,r={x:t,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)&&o?.inRange(u)))continue;const f=Math.max((r.x-d)**2+(r.y-u)**2,0);f<l&&(l=f,c=h)}if(l!=null)return{datum:c,distance:Math.sqrt(l)}}pickModulesClosestDatum(e){let t=1/0,i;for(const s of this.moduleMap.modules()){const n=s.pickNodeNearest(e);n!==void 0&&n.distanceSquared<t&&(t=n.distanceSquared,i=n.datum)}if(t!=null)return{datum:i,distance:Math.sqrt(t)}}pickNodeClosestDatum(e){let t=1/0,i;const s=this.pickNodeDataClosestDatum(e);s!=null&&s.distance<t&&(t=s.distance,i=s.datum);const n=this.pickModulesClosestDatum(e);if(n!=null&&n.distance<t&&(t=n.distance,i=n.datum),i){const a=Math.max(t-(i.point?.size??0)/2,0);return{datum:i,distance:a}}}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:n,_contextNodeData:a}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!a)return;const r=n.x,l=n.y;if(r==null||l==null)return;const c=[r,l].filter(f=>f.isCategoryLike()).map(f=>f.direction);if(t&&c.length===0)return;const[h="x"]=c,d=[i,s];h!=="x"&&d.reverse();const u=[1/0,1/0];let p;for(const f of a.nodeData){const{x:y=Number.NaN,y:b=Number.NaN}=f.point??f.midPoint??{};if(Number.isNaN(y)||Number.isNaN(b)||f.missing===!0)continue;const x=[r?.inRange(y,1),l?.inRange(b,1)];if(h!=="x"&&x.reverse(),!x[0]||!o&&!x[1])continue;const v=[y,b];h!=="x"&&v.reverse();let S=!0;for(let M=0;M<v.length;M++){const D=Math.abs(v[M]-d[M]);if(D>u[M]){S=!1;break}else D<u[M]&&(u[M]=D,u.fill(1/0,M+1,u.length))}S&&(p=f)}if(p){let f=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const y of this.moduleMap.modules()){const b=y.pickNodeMainAxisFirst(e,h);if(b!=null&&b.distanceSquared<f){p=b.datum,f=b.distanceSquared;break}}return{datum:p,distance:Math.sqrt(f)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(e,t,i,s){let n;if(s==null){const{processedData:c,dataModel:h}=this;n=h.getColumnSortOrder(this,e,c)??1}else n=s.sortOrder;const a=this.keysOrValues(e),o=0,[r,l]=rf(n,i?.length??a.length,t,c=>{const h=i?.[c]??c;return this.xCoordinateRange(a[h],o,h)});return r<l?[r,l]:[l,r]}domainForVisibleRange(e,t,i,s,n){const{processedData:a,dataModel:o}=this,[r,l]=s,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const f=this.visibleRangeIndices(i,s,n,{sortOrder:h});return o.getDomainBetweenRange(this,t,f,a)}const d=t.map(f=>this.keysOrValues(f));let u=1/0,p=-1/0;for(const[f,y]of c.entries()){const[b,x]=this.xCoordinateRange(y,0,f);if(!(x<r||b>l))for(let v=0;v<t.length;v++){const S=d[v][f];u=Math.min(u,S),p=Math.max(p,S)}}return u>p?[Number.NaN,Number.NaN]:[u,p]}domainForClippedRange(e,t,i){const{processedData:s,dataModel:n,axes:a}=this,r=C3(a[e==="x"?"y":"x"]);if(!r)return t.flatMap(f=>n.getDomain(this,f,"value",s).domain);const l=this.keysOrValues(i),c=n.getColumnSortOrder(this,i,s);if(c!=null){const f=w3(c,l.length,r,y=>l[y]);return n.getDomainBetweenRange(this,t,f,s)}const h=t.map(f=>this.keysOrValues(f)),d=r[0].valueOf(),u=r[1].valueOf(),p=[];for(const[f,y]of l.entries()){const b=y.valueOf();if(b<d||b>u)continue;const x=h.map(v=>v[f]);b>=d&&p.push(...x),b<=u&&p.push(...x)}return p}zoomFittingVisibleItems(e,t,i,s,n){const{dataModel:a,processedData:o}=this;if(!a||!o)return;const r=this.axes.x;if(s!=null)return;const l=this.sortOrder(e);if(l==null)return;const c=this.keysOrValues(e);if(n>c.length)return{x:[0,1],y:void 0};const h=r.scale,d=h.range;h.range=[0,1];let[u,p]=this.visibleRangeIndices(e,i,void 0,{sortOrder:l});p-=1;const f=0;this.xCoordinateRange(c[u],f,u)[0]<i[0]&&(u+=1),this.xCoordinateRange(c[p],f,p)[1]>i[1]&&(p-=1);let y;if(Math.abs(p-u)>=n-1)y=i;else{const b=(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 S=this.xCoordinateRange(c[u-1],f,u-1)[0],M=this.xCoordinateRange(c[p+1],f,p+1)[1];Math.abs(S-b)<Math.abs(M-b)?u-=1:p+=1}const x=this.xCoordinateRange(c[u],f,u)[0],v=this.xCoordinateRange(c[p],f,p)[1];y=[Math.min(i[0],x),Math.max(i[1],v)]}return h.range=d,{x:y,y:void 0}}countVisibleItems(e,t,i,s,n){const{dataModel:a,processedData:o}=this;if(!a||!o)return 1/0;const r=this.keysOrValues(e),l=t.map(k=>a.resolveColumnById(this,k,o)),c=this.shouldFlipXY(),h=c?this.axes.y:this.axes.x,d=c?this.axes.x:this.axes.y,u=c?s??[0,1]:i,p=c?i:s??[0,1];if(s==null){const k=this.sortOrder(e);if(k!=null){const C=h.scale,A=C.range;C.range=[0,1];const w=this.keysOrValues(e);let[T,O]=this.visibleRangeIndices(e,u,void 0,{sortOrder:k});if(O-=1,O<T)return 0;const z=0;this.xCoordinateRange(w[T],z,T)[0]<u[0]&&(T+=1),this.xCoordinateRange(w[O],z,O)[1]>u[1]&&(O-=1);const V=Math.abs(O-T)+1;return C.range=A,V}}const f=(k,C,A)=>k[0]+(A-C[0])/(C[1]-C[0])*(k[1]-k[0]),y=h.range.toSorted(),b=d.range.toSorted(),x=f(y,h.visibleRange,u[0]),v=f(y,h.visibleRange,u[1]),S=f(b,d.visibleRange,Math.min(...p)),M=f(b,d.visibleRange,Math.max(...p)),D=Math.round((u[0]+(u[1]-u[0])/2)*r.length),I=0;return CW(0,r.length-1,D,n,k=>{const[C,A]=this.xCoordinateRange(r[k],I,k),[w,T]=this.yCoordinateRange(l.map(O=>O[k]),I,k);return!Be(C)||!Be(A)||!Be(w)||!Be(T)?!1:C>=x&&A<=v&&w>=S&&T<=M})}minTimeInterval(){let e;try{e=this.keysOrValues("xValue")}catch{}if(e==null||e.length>1e3)return;let t=1/0,i=e[0],s;for(let n=1;n<e.length;n++){const a=e[n];if(a!=null&&i!=null){const o=a.valueOf()-i.valueOf(),r=Math.sign(o);if(r===0)continue;if(s!==void 0&&r!==s)return;t=Math.min(t,Math.abs(o)),s=r}i=a}if(Number.isFinite(t))return t}updateHighlightSelectionItem(e){const{items:t,highlightSelection:i}=e,s=t??[];return this.updateDatumSelection({nodeData:s,datumSelection:i})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateDatumStyles(e){}updatePaths(e){for(const t of e.paths)t.visible=!1}updatePathNodes(e){const{paths:t,visible:i}=e;for(const s of t)s.visible=i}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};if(t)for(const i of e.paths)Xi([i],t)}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Xi([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&Xi([e.labelSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),e.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Xi([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}:void 0}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof Vk){const{range:t,domain:i}=e;return{type:"log",convert:s=>e.convert(s),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof mt){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Ya){if(e instanceof Kl){const t=e.getLinearParams(),i=e.getBandCountForUpdate();if(t!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:t.firstBandTime,lastBandTime:t.firstBandTime+(i-1)*t.intervalMs,bandCount:i,intervalMs:t.intervalMs,inset:e.inset,step:e.step}}return{type:"category",domain:e.domain,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(Sg)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function C3(e){let t,i;if((e instanceof Xn||e instanceof Vo)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function w3(e,t,i,s){const n=i[0].valueOf(),a=i[1].valueOf();let o=Hc(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),r=Dr(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=a});return o==null||r==null?[0,0]:(e===-1&&([o,r]=[t-r,t-o]),o=Math.max(o,0),r=Math.min(r+1,t),[o,r])}function _2(e){const t=new Map;for(const i of e){if(!(i instanceof ec))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 o=t.get(a);o==null&&(o=[],t.set(a,o)),o.push(i)}for(const i of t.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()}}function Ch(e,t,i,s,n,a,o=["series",`${e.declarationOrder}`,"label"]){if(e.visible&&s.itemStyler){const r=e.getHighlightStateString(a,n||t!=null&&a?.series===t.series&&a?.datumIndex===t.datumIndex,t?.datumIndex),l=typeof t?.datumIndex=="number"?t.datumIndex:t?.itemId,c={border:s.border,color:s.color,cornerRadius:s.cornerRadius,datum:t?.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:t?.itemType,seriesId:e.id,padding:s.padding,highlightState:r},h=e.ctx.optionsGraphService.resolvePartial(o,e.cachedCallWithContext(s.itemStyler,{...i,...c}),{pick:!1})??{};return re(h,c)}return s}function H2(e,t,i,s,n,a,o){if(e.visible&&s.enabled&&n){const r=Ch(e,t.datum,i,s,a,o);t.visible=!0,t.x=n.x,t.y=n.y,t.text=n.text,t.fill=r.color,t.setAlign(n),t.setFont(r),t.setBoxing(r)}else t.visible=!1}var L3={"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 G2({isUpward:e,isVertical:t,placement:i,spacing:s=0,rect:n}){let a=n.x+n.width/2,o=n.y+n.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:d}=L3[i],u=(h+1)*.5;if(t){const p=e?n.y+n.height:n.y,f=n.height*c;o=p+f*u+s*d*c,l=d===c?"top":"bottom"}else{const p=e?n.x:n.x+n.width,f=n.width*c;a=p+f*u+s*d*c,r=d===c?"left":"right"}}return{x:a,y:o,textAlign:r,textBaseline:l}}function ti({id:e},t,i,...s){for(const n of s)n.cleanup();Vr(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function xb({id:e},t,i,...s){Vr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function wh(e){return{opacity:1}}var sn=class extends Zc{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:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};g([m,$()],sn.prototype,"enabled",2),g([m,Or({equals:qc})],sn.prototype,"shape",2),g([m,$()],sn.prototype,"size",2),g([m,Or({equals:Ht})],sn.prototype,"fill",2),g([m,$()],sn.prototype,"fillOpacity",2),g([m,$()],sn.prototype,"stroke",2),g([m,$()],sn.prototype,"strokeWidth",2),g([m,$()],sn.prototype,"strokeOpacity",2),g([m],sn.prototype,"lineDash",2),g([m],sn.prototype,"lineDashOffset",2),g([m,Or({equals:qc})],sn.prototype,"itemStyler",2);function N3(e,t){if(e!=null)return{enabled:e.enabled??!0,stroke:e.stroke??t?.stroke??"transparent",strokeWidth:e.strokeWidth??t?.strokeWidth??1,strokeOpacity:e.strokeOpacity??t?.strokeOpacity??1,lineDash:e.lineDash??t?.lineDash??[]}}var j2=class extends X{constructor(){super(...arguments),this.enabled=!1}};g([m],j2.prototype,"enabled",2);var jr=class extends X{constructor(){super(...arguments),this.interaction=new j2,this.position=new Tu,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const s=this.renderer==null?void 0:ls(e,this.renderer,i);if(Bt(s)||gt(s)||Cs(s))return{type:"raw",rawHtmlString:At(s)};if(s!=null){const n=re(s.symbol?.marker,t.symbol?.marker),a=s.symbol?.line??t.symbol?.line?re(s.symbol?.line,t.symbol?.line):void 0,o=t.symbol||s.symbol?{marker:n,line:N3(a,n)}:void 0;return{type:"structured",...t,...s,symbol:o}}return{type:"structured",...t}}};g([m],jr.prototype,"enabled",2),g([m],jr.prototype,"showArrow",2),g([m],jr.prototype,"renderer",2),g([m],jr.prototype,"interaction",2),g([m],jr.prototype,"position",2),g([m],jr.prototype,"range",2),g([m],jr.prototype,"class",2);function Lh(){return new jr}var tc=class y_ extends cf{constructor(t,i=new Cu,s=!0){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=s,this.nice=!1}static is(t){return t instanceof y_}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t.domain,clipped:!1}}getUpdateTypeOnResize(){return this.bandAlignment==null||this.bandAlignment==="justify"?super.getUpdateTypeOnResize():3}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!Be(t)||!Be(i)){const s=this.reduceBandScalePadding();t??(t=s.inner),i??(i=s.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}calculateGridLines(t,i,s){const n=super.calculateGridLines(t,i,s);return this.interval.placement==="between"&&t.length>0&&n.push(super.calculateGridLine({index:t.at(-1).index+1,tickId:`after:${t.at(-1).tickId}`,translation:this.range[1]},t.length,i,s,t)),n}calculateGridLine({index:t,tickId:i,translation:s},n,a,o,r){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridLine({index:t,tickId:i,translation:s},n,a,o,r);const u=s<d.step?Math.floor(d.step/2):d.step/2,p=s-u,[f,y,b,x]=c?[p,Math.max(a,o),p,Math.min(a,o)]:[Math.min(a,o),p,Math.max(a,o),p],{style:v}=l,{stroke:S,strokeWidth:M=0,lineDash:D}=v[t%v.length]??{};return{tickId:i,offset:p,x1:f,y1:y,x2:b,y2:x,stroke:S,strokeWidth:M,lineDash:D}}calculateGridFills(t,i,s){const{horizontal:n,range:a,scale:o}=this;if(this.interval.placement!=="between")return super.calculateGridFills(t,i,s);const r=[];if(t.length==0)return r;const l=t[0],c=l.translation>a[0]+o.step/2,h=t.at(-1),d=n&&h.translation<a[1]-o.step/2;if(c){const u={tickId:`before:${l.tickId}`,translation:l.translation-o.step};r.push(this.calculateGridFill(u,-1,l.index-1,i,s,t))}if(r.push(...t.map((u,p)=>this.calculateGridFill(u,p,u.index,i,s,t))),d){const u={tickId:`after:${h.tickId}`,translation:h.translation+o.step};r.push(this.calculateGridFill(u,t.length,h.index+1,i,s,t))}return r}calculateGridFill({tickId:t,translation:i},s,n,a,o,r){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:t,translation:i},s,n,a,o,r);const u=i-d.step/2,p=i+d.step/2,[f,y,b,x]=c?[u,Math.max(a,o),p,Math.min(a,o)]:[Math.min(a,o),u,Math.max(a,o),p],{fill:v,fillOpacity:S}=l.style[n%l.style.length]??{};return{tickId:t,x1:f,y1:y,x2:b,y2:x,fill:v,fillOpacity:S}}calculateTickLines(t,i,s=0){const n=super.calculateTickLines(t,i,s);return this.interval.placement==="between"&&t.length>0&&n.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${t.at(-1)?.tickId}`,translation:this.range[1]},t.length,i,t,s)),n}calculateTickLine({isPrimary:t,tickId:i,translation:s},n,a,o,r=0){const{horizontal:l,interval:c,primaryTick:h,scale:d,tick:u}=this;if(c.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:i,translation:s},n,a,o,r);const p=t&&h?.enabled?h:u,f=-a*this.getTickSize(p),y=s<d.step?Math.floor(d.step/2):d.step/2,b=s-y,x=-a*(r+this.getTickSpacing(p)),[v,S,M,D]=l?[b,x,b,x+f]:[x,b,x+f,b],{stroke:I,width:k}=p;return{tickId:i,offset:b,x1:v,y1:S,x2:M,y2:D,stroke:I,strokeWidth:k,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce((t,i)=>{const s=i.getBandScalePadding?.();return s&&(t.inner>s.inner&&(t.inner=s.inner),t.outer<s.outer&&(t.outer=s.outer)),t},{inner:1/0,outer:-1/0})}tickFormatParams(t,i,s,n){return{type:"category"}}datumFormatParams(t,i,s,n,a){const{datum:o,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}=i;return Array.isArray(t)&&t.some(f=>typeof f!="string")&&(t=t.map(String)),{type:"category",value:t,datum:o,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}}};tc.className="CategoryAxis",tc.type="category",g([m],tc.prototype,"groupPaddingInner",2),g([m],tc.prototype,"paddingInner",2),g([m],tc.prototype,"paddingOuter",2),g([Dt("layoutConstraints","align")],tc.prototype,"bandAlignment",2),g([_e({newValue(e){e==null||e<=0?(this.layoutConstraints.width=100,this.layoutConstraints.unit="percent"):(this.layoutConstraints.width=e,this.layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}})],tc.prototype,"requiredRange",2);var If=tc,T3=1e3,W2=class x_ extends Cu{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(t){return t instanceof x_}set domain(t){if(t.length<=T3){const i=JSON.stringify(t);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=t}get domain(){return super.domain}normalizeDomains(...t){const{domain:i}=super.normalizeDomains(...t);return{domain:i,animatable:!1}}findIndex(t){return super.findIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const i=JSON.stringify(t),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}},O3=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},P3=class b_{constructor(t="",i,s){this.label=t,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(t,i){let s=this,n;for(let a=0;a<t.length;a++){const o=t[a],r=a!==t.length-1,{children:l}=s,c=l.find(h=>h.label===o);if(c&&r)s=c,n=c;else{const h=new b_(o,s,i);h.index=l.length,l.push(h),r&&(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((t,i)=>i!==this.index)??[]}};function E3(e){const t=e.reduce((n,a)=>Math.max(n,a.length),0),i=new P3,s=new Map;for(let n=0;n<e.length;n++){const a=e[n];for(;a.length<t;)a.push("");const o=i.insertTick(a,n);o!=null&&s.set(a,o)}return{root:i,tickNodes:s}}function R3(e,t,i){const s=t.index-e.index,n=i/s;t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function z3(e,t,i){return t.getSiblings().includes(e.ancestor)?e.ancestor:i}function V3({children:e}){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}function B3(e,t){const i=e.getLeftSibling();if(i){let s=e,n=e,a=i,o=n.getLeftmostSibling(),r=n.mod,l=s.mod,c=a.mod,h=o.mod;for(;a.nextRight()&&n.nextLeft();){a=a.nextRight(),n=n.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=e;const d=a.prelim+c-(n.prelim+r)+1;d>0&&(R3(z3(a,e,t),e,d),r+=d,l+=d),c+=a.mod,r+=n.mod,h+=o.mod,l+=s.mod}a.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!o.nextLeft()&&(o.mod+=r-h),t=e)}return t}function $2(e){const{children:t}=e;if(t.length){let[i]=t;for(const a of t)$2(a),i=B3(a,i);V3(e);const s=(t[0].prelim+t.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function K2(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const s of e.children)K2(s,t+e.mod,i)}function U2(e){const{children:t}=e;let i=0;for(const s of t)U2(s),s.children.length?i+=s.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t.at(-1).subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function F3(e){const t=new _3,{root:i,tickNodes:s}=E3(e);return $2(i),K2(i,-i.prelim,t),U2(i),{layout:t,tickNodes:s}}var _3=class{constructor(){this.dimensions=new O3,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:s,right:n}=this.dimensions;n!==s&&(i=e/(n-s))}return t&&(i*=-1),i}},Af=5,Rs=class extends X{constructor(){super(...arguments),this.enabled=!0,this.border=new ah}};g([m],Rs.prototype,"enabled",2),g([m],Rs.prototype,"avoidCollisions",2),g([m],Rs.prototype,"border",2),g([m],Rs.prototype,"color",2),g([m],Rs.prototype,"cornerRadius",2),g([m],Rs.prototype,"spacing",2),g([m],Rs.prototype,"rotation",2),g([m],Rs.prototype,"wrapping",2),g([m],Rs.prototype,"truncate",2),g([m],Rs.prototype,"fill",2),g([m],Rs.prototype,"fontStyle",2),g([m],Rs.prototype,"fontWeight",2),g([m],Rs.prototype,"fontSize",2),g([m],Rs.prototype,"fontFamily",2),g([m],Rs.prototype,"padding",2);var bb=class extends X{constructor(){super(...arguments),this.enabled=!0}};g([m],bb.prototype,"enabled",2),g([m],bb.prototype,"width",2),g([m],bb.prototype,"stroke",2);var Gk=class extends X{constructor(){super(...arguments),this.label=new Rs,this.tick=new bb}};g([m],Gk.prototype,"label",2),g([m],Gk.prototype,"tick",2);var Cf=class extends If{constructor(e){super(e,new W2),this.tickScale=new W2,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.depthOptions=new Bi(Gk),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:s,bandwidth:n}=this.scale,a=Math.abs(t[1]-t[0])-i,o=this.tickTreeLayout.scaling(a,t[0]>t[1]),r=s+n/2;let l=0;for(const c of e){const h=c.position*o;l>h&&(l=h),c.screen=h+r}for(const c of e)c.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let a=0;a<e;a++)t.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 t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>{e.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.pointerEvents=t.textUntruncated==null?1:0,e.setFont(t),e.setBoxing(t)})}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:e}=this.scale,{title:t,label:i,range:s,depthOptions:n,horizontal:a,line:o}=this,r=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(r);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:o.stroke,strokeWidth:o.enabled?o.width:0}),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:le.zero,spacing:0,depthLabelMaxSize:{},tickLabelLayout:[]};const{depth:c,nodes:h}=this.tickTreeLayout,d=a?-i.getSideFlag():i.getSideFlag(),u=[],p=new Map,f=new Map,y=new bu,b=this.getDepthOptionsMap(c),x=d*(b[0].spacing+this.getTickSpacing()+l),v=this.tickFormatter(this.scale.domain,this.scale.domain,!1),S=(E,_)=>{const G=c-E.depth;if(!b[G]?.enabled||!d0(E.screen,s))return!1;let B=(E.leafCount||1)*e;if(B<Af)return!1;const F=v(E.label,_-1);let Y=F;const Z=this.getLabelStyles({value:E.index,formattedValue:Y,depth:G},n[G]?.label);if(i.avoidCollisions){const ie=b[G].rotation;let ee=this.thickness;if(ie!=null){const Me=Fy(ie,B,ee);B=Me.width,ee=Me.height}const he={font:Z,textWrap:b[G].wrapping,overflow:b[G].truncate?"ellipsis":"hide",maxWidth:B,maxHeight:ee};Y=qd(Y,he)||Y}return Y!==F&&n0(Y)?f.set(_,Ne(F)):f.delete(_),y.x=a?E.screen:x,y.y=a?x:E.screen,y.rotation=0,y.fill=Z.color,y.text=Y,y.textAlign="center",y.textBaseline=i.parallel?"top":"bottom",y.setFont(Z),y.setBoxing(Z),!0},M={};for(const[E,_]of h.entries()){const G=c-_.depth;if(M[G]??(M[G]=0),!_.children.length&&e<Af||!S(_,E)||!y.getBBox())continue;p.set(E,y.getBBox()),y.rotation=Ha(b[G]?.rotation);const{width:Y,height:Z}=y.getBBox(),ie=a?Z:Y;M[G]<ie&&(M[G]=ie)}const D=jg(),I=E=>{if(E===0)return 0;let _=M[0];for(let G=1;G<=E;G++)_+=b[G].spacing,G!==E&&(_+=M[G]);return _};for(const[E,_]of h.entries()){if(E===0)continue;const G=S(_,E),B=!_.children.length,F=c-_.depth;if(B&&e<Af||!G)continue;const Y=Ha(b[F].rotation),Z=p.get(E);if(!Z)continue;const{width:ie,height:ee}=Z,he=I(F);if(y.textAlign="center",y.textBaseline="middle",y.rotation=Y,a?(y.y+=(he+Hy(ie/2,ee/2,Y))*d,y.rotationCenterX=_.screen,y.rotationCenterY=y.y):(y.x+=he*d+Hy((b[F].spacing*d+ie)/2,i.mirrored?ie:0,Y)-ie/2,y.rotationCenterX=y.x,y.rotationCenterY=_.screen),b[F].avoidCollisions){const{width:xe,height:Ge}=y.getBBox(),je=a?xe:Ge,dt=B?e:_.leafCount*e;if(je>dt){p.delete(E);continue}}const Me=y.getPlainText(),Ce=y.getBoxingProperties();u.push({text:Me,textUntruncated:f.get(E),visible:!0,tickId:D(Me),range:this.scale.range,border:Ce.border,color:y.fill,cornerRadius:Ce.cornerRadius,fill:Ce.fill,fontFamily:y.fontFamily,fontSize:y.fontSize,fontStyle:y.fontStyle,fontWeight:y.fontWeight,padding:Ce.padding,rotation:y.rotation,rotationCenterX:y.rotationCenterX,rotationCenterY:y.rotationCenterY,textAlign:y.textAlign,textBaseline:y.textBaseline,x:y.x,y:y.y}),p.set(E,Wt.toCanvas(y))}let k=M[0];for(let E=0;E<c;E++)k+=b[E].spacing,E!==0&&(k+=M[E]);const C=k+l,A=[this.lineNodeBBox(),le.merge(p.values()),new le(0,0,C*d,0)],w=le.merge(A),T=a?w.height:w.width,{spacing:O,scrollbarLayout:z}=this.applyScrollbarLayout(A,T,r);this.layout.labelThickness=T,this.layout.scrollbar=z,t.enabled&&A.push(this.titleBBox(this.scale.domain,O));const V=le.merge(A);return this.layoutCrossLines(),{bbox:V,spacing:O,depthLabelMaxSize:M,tickLabelLayout:u}}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:s,visibleRange:n,tickTreeLayout:a}=this;if(!a)return;const{depthLabelMaxSize:o,spacing:r}=this.computedLayout,{depth:l}=a,c=this.getDepthOptionsMap(l),h=this.chartLayout?.scrollbars?.[this.id],d=this.getScrollbarThickness(h),{position:u,horizontal:p,gridPadding:f}=this,y=u==="bottom"||u==="right"?-1:1,b=f,x=y*s-f,v={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},{ticks:S}=e.ticks(v,void 0,n),{tickInfos:M,minSpacingByDepth:D}=G3(S,this.tickNodes,e,l),I=j3(D),k=$3(M,I,l,D),C=k.map(({tickLabel:A,position:w},T)=>({index:e.findIndex(A),tickId:us(T,...A),translation:Math.round(w)}));this.gridLineGroupSelection.update(i.enabled&&s?this.calculateGridLines(C,b,x):[]),this.gridFillGroupSelection.update(i.enabled&&s?this.calculateGridFills(C,b,x):[]),this.tickLineGroupSelection.update(t.enabled?k.map(({depth:A},w)=>{const{tickId:T,translation:O}=C[w],z=this.depthOptions[A]?.tick;let V=o[0];for(let he=0;he<=A;he++)V+=c[he].spacing,he!==0&&(V+=o[he]);const E=z?.stroke??t.stroke,_=z?.enabled===!1?0:z?.width??t.width,G=-y*V,B=-y*(d+this.getTickSpacing()),[F,Y,Z,ie]=p?[O,B,O,B+G]:[B,O,B+G,O];return{tickId:T,offset:O,x1:F,y1:Y,x2:Z,y2:ie,stroke:E,strokeWidth:_,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(e,t){this.chartLayout=t;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:e}=this,t=this.boundSeries.filter(l=>l.visible).flatMap(l=>rd(l.getDomain(e)));this.dataDomain={domain:Ga(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(Y2),{layout:s,tickNodes:n}=F3(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 o=FS(this.dataDomain.domain,a);this.scale.domain=o;const r=o.map(Y2);r.push([""]),this.tickScale.domain=r}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=De(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};Cf.className="GroupedCategoryAxis",Cf.type="grouped-category",g([m],Cf.prototype,"depthOptions",2);function H3(e){let t=0,i=e;for(;i?.index===0;)t+=1,i=i.parent;return t}function G3(e,t,i,s){const n=new Array(e.length),a=new Array(s).fill(1/0),o=new Array(s).fill(Number.NaN);for(let r=0;r<e.length;r++){const l=e[r],c=t?.get(l),h=c==null?s-1:Math.min(H3(c),s-1),d=i.convert(l);if(n[r]={tickLabel:l,depth:h,position:d},!!Number.isFinite(d))for(let u=0;u<=h;u++){const p=o[u];Number.isFinite(p)&&(a[u]=Math.min(a[u],Math.abs(d-p))),o[u]=d}}return{tickInfos:n,minSpacingByDepth:a}}function j3(e){for(let t=0;t<e.length;t++){const i=e[t];if(!Number.isFinite(i)||i>=Af)return t}return e.length}function W3(e){return!Number.isFinite(e)||e<=0?1:Math.max(1,Math.ceil(Af/e))}function $3(e,t,i,s){if(t<=0)return e;const n=Math.min(t-1,i-1);if(n<0)return e;const a=W3(s[n]),o=[];let r=0;for(const l of e){if(l.depth>=t){o.push(l);continue}l.depth===n&&(r%a===0&&o.push(l),r++)}return o}function Y2(e){return ld(ge(e)&&"value"in e?e.value:e)}function vb(e,t){for(const i of t){const s=i.datum;s===void 0?K.error("undefined datum"):e.addValue(i,s)}}function Sb(e,t){const{x:i,y:s}=t,{nearest:n,distanceSquared:a}=e.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(a)}}var wf=class extends eo{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};g([m],wf.prototype,"direction",2),g([m],wf.prototype,"width",2),g([m],wf.prototype,"widthRatio",2);var Z2=class extends ec{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=Be(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=Ga(e)??[Number.NaN,Number.NaN];return typeof t=="boolean"?n[t?0:1]-=(t?1:-1)*s:(n[0]-=s,n[1]+=s),bn(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getMinimumRangeSeries(e){const{width:t}=this.properties;if(t==null||!this.getCategoryAxis())return;const{index:s}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);e[s]=Math.max(e[s]??0,t)}getMinimumRangeChart(e){if(e.length===0)return 0;const t=this.getCategoryAxis();if(!(t instanceof Cf||t instanceof If))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:o}=t,r=e.reduce((u,p)=>u+p,0),l=r/e.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=r+o*l*(c-1),d=(i-n+a*2)/(1-n);return h*d}validateCreateNodeDataPreconditions(){const e=this.getCategoryAxis(),t=this.getValueAxis();if(!(!e||!t||!this.dataModel||!this.processedData))return{xAxis:e,yAxis:t}}getBandwidth(e,t){return mt.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t,0)??0,n=mt.is(i)?s*-.5:0,a=i.convert(e)+n;return[a,a+s]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,s=e.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 e=this.getCategoryAxis(),t=this.getBandwidth(e)??0;this.ctx.seriesStateManager.updateGroupScale(this,t,e);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(e){const t=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let s=0;mt.is(i.scale)?s=-e/2:this.seriesGrouping==null&&t?s=(this.getGroupScaleRangeWidth(t)-e)/2:t&&this.properties.widthRatio!=null&&(s=(t.bandwidth-e)/2);const n=this.ctx.seriesStateManager.getStackOffset(this,e);return s+n}getBarWidth(){const{seriesGrouping:e}=this,{width:t}=this.properties;let{widthRatio:i}=this.properties;const s=this.ctx.seriesStateManager.getGroupScale(this),n=s?.bandwidth??0;if(e==null&&(i??(i=1)),i!=null){let a=t;return e==null&&a==null&&s&&(a=this.getGroupScaleRangeWidth(s)),a==null&&n<1&&s?s.rawBandwidth:(a??n)*i}return t??(n<1&&s?s.rawBandwidth:n)}getGroupScaleRangeWidth(e){let t=e.range[1]-e.range[0];return e.round&&t>0&&(t=Math.floor(t)),t}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){vb(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Sb(this,e)}};function Ti(e,t,i){return(t-e)*i+e}function X2(e,t){const{x0:i,y0:s,x1:n,y1:a}=e,r=(a-s)/(n-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:r,stepX:t,stepY0:r,stepY1:r,rightCp1x:t,rightCp1y:r,rightCp2x:n,rightCp2y:a}}function K3(e,t){const{cp0x:i,cp0y:s,cp1x:n,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:c}=e,h=$g(i,n,o,l,t),[d,u]=lu(i,s,n,a,o,r,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:t,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function U3(e){const{x0:t,y0:i,x1:s,y1:n,stepX:a}=e;return{leftCp1x:(t+a)/2,leftCp1y:i,leftCp2x:(t+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:n,rightCp1x:(a+s)/2,rightCp1y:n,rightCp2x:(a+s)/2,rightCp2y:n}}function q2(e,t){return e.type==="linear"?X2(e,t):e.type==="cubic"?K3(e,t):e.type==="step"?U3(e):X2(e,t)}function Q2(e,t,i,s,n,a,o){switch(t){case 0:o?e.moveTo(n,a):e.moveTo(i,s);break;case 1:o?e.lineTo(n,a):e.lineTo(i,s);break;case 2:break}}function J2(e,t,i,s,n,a){a?e.lineTo(t,i):e.lineTo(s,n)}function eP(e,t,i,s,n,a,o,r,l,c){c?e.cubicCurveTo(a,o,s,n,t,i):e.cubicCurveTo(s,n,a,o,r,l)}function tP(e,t,i,s,n,a,o){o?(e.lineTo(a,n),e.lineTo(a,i),e.lineTo(t,i)):(e.lineTo(a,i),e.lineTo(a,n),e.lineTo(s,n))}function Y3(e,t,i,s,n,a,o){if(o){for(let r=a.length-1;r>=0;r--){const{x:l,y:c}=a[r];e.lineTo(l,c)}e.lineTo(t,i)}else{for(const{x:r,y:l}of a)e.lineTo(r,l);e.lineTo(s,n)}}function Lf(e,t,i,s){const[n,a]=tn(t);switch(Q2(e,i,n.x,n.y,a.x,a.y,s),t.type){case"linear":J2(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":eP(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":tP(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break;case"multi-line":Y3(e,t.x0,t.y0,t.x1,t.y1,t.midPoints,s);break}}function iP(e,t,i){const[s,n]=tn(e),[a,o]=tn(t),r=Ti(s.x,a.x,i),l=Ti(s.y,a.y,i),c=Ti(n.x,o.x,i),h=Ti(n.y,o.y,i);return[{x:r,y:l},{x:c,y:h}]}function jk(e,t,i,s,n,a){const[{x:o,y:r},{x:l,y:c}]=iP(t,i,s);if(Q2(e,n,o,r,l,c,a),t.type==="cubic"&&i.type==="cubic"){const h=Ti(t.cp1x,i.cp1x,s),d=Ti(t.cp1y,i.cp1y,s),u=Ti(t.cp2x,i.cp2x,s),p=Ti(t.cp2y,i.cp2y,s);eP(e,o,r,h,d,u,p,l,c,a)}else if(t.type==="step"&&i.type==="step"){const h=Ti(t.stepX,i.stepX,s);tP(e,o,r,l,c,h,a)}else if(t.type==="linear"&&i.type==="linear")J2(e,o,r,l,c,a);else{let h;t.type==="step"?h=t.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const d=q2(t,h),u=q2(i,h),p=Ti(d.leftCp1x,u.leftCp1x,s),f=Ti(d.leftCp1y,u.leftCp1y,s),y=Ti(d.leftCp2x,u.leftCp2x,s),b=Ti(d.leftCp2y,u.leftCp2y,s),x=Ti(d.stepX,u.stepX,s),v=Ti(d.stepY0,u.stepY0,s),S=Ti(d.stepY1,u.stepY1,s),M=Ti(d.rightCp1x,u.rightCp1x,s),D=Ti(d.rightCp1y,u.rightCp1y,s),I=Ti(d.rightCp2x,u.rightCp2x,s),k=Ti(d.rightCp2y,u.rightCp2y,s);a?(e.cubicCurveTo(I,k,M,D,x,S),e.lineTo(x,v),e.cubicCurveTo(y,b,p,f,o,r)):(e.cubicCurveTo(p,f,y,b,x,v),e.lineTo(x,S),e.cubicCurveTo(M,D,I,k,l,c))}}var sP=1e3,nP=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(nP||{});function Z3(e,t){return e==null||t==null||typeof e!="object"||typeof t!="object"?!1:"id"in e&&"id"in t?e.id===t.id:e.toString()===t.toString()}function zs(e){return Wg(e).valueOf()}function bs(e,t){if(!t)return Number.NaN;if(e instanceof Date&&(e=e.getTime()),t.type==="continuous"&&typeof e=="number")return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if(t.type==="log"&&typeof e=="number")return t.convert(e);if(t.type!=="category")return Number.NaN;if(Nr(t)){if(typeof e=="number"){const{firstBandTime:n,intervalMs:a,bandCount:o,inset:r,step:l}=t,c=Math.round((e-n)/a);if(c>=0&&c<o)return r+l*c}return Number.NaN}const i=zs(e);let s=t.domain.findIndex(n=>zs(n)===i);return s===-1&&(s=t.domain.findIndex(n=>Z3(e,n))),s>=0?t.inset+t.step*s:Number.NaN}function aP({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(zs(i.xValue0)),xValue1Index:t.indexOf(zs(i.xValue1)),datumIndex:s}))}function oP(e){return Object.values(e.scales).every(t=>t.type==="category"?Nr(t)?t.bandCount<sP:t.domain.length<sP:!0)}function X3(e,t){const i=t.scales.x,s=e.scales.x;if(i?.type!=="category"||s?.type!=="category"||Nr(i)||Nr(s))return!0;let n=-1/0;for(const a of i.domain){const o=bs(a,s);if(Number.isFinite(o)){if(o<n)return!1;n=o}}return!0}function q3(e,t){let i=-1/0;for(const s of e){const n=bs(s.value,t.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function Q3(e,t){const i=new Map;for(const{xValue0:h,xValue1:d}of e.data){const u=zs(h),p=zs(d);i.set(u,h).set(p,d)}const s=Array.from(i,([h,d])=>({axisValue:h,value:d}));s.sort((h,d)=>bs(h.value,e.scales.x)-bs(d.value,e.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of t.data){const u=zs(h),p=zs(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)=>bs(h.value,t.scales.x)-bs(d.value,t.scales.x));const a=s;let o=0;for(const h of n){for(let d=a.length-1;d>=o;d-=1){const u=bs(h.value,t.scales.x),p=bs(a[d].value,t.scales.x);if(u>p){o=d+1;break}}a.splice(o,0,h),o+=1}if(!q3(a,t))return;const r=a.map(h=>h.axisValue),l=aP(t,r),c=aP(e,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function rP(e,t,i,s,n){if(n.xValue1Index===n.xValue0Index+1)return e;const a=tn(e);let o,r;if(t.scales.x?.type==="category"){const l=(a[1].x-a[0].x)/(n.xValue1Index-n.xValue0Index);o=a[0].x+(s-n.xValue0Index)*l,r=o+l}else{const l=i[s],c=i[s+1];o=bs(l,t.scales.x),r=bs(c,t.scales.x)}return vx(e,o,r)}function lP(e,t){const[i,s]=tn(e),n=bs(0,t.scales.y);return Yc(e,{x:i.x,y:n},{x:s.x,y:n})}function cP(e){const[t,i]=tn(e);return UM(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function hP(e,t,i,s,n,a){let o,r;if(n.xValue0Index>=a.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=a.xValue1Index)?.datumIndex,u=d==null?void 0:i.data[d];o=u?.xValue1,r=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];o=u?.xValue0,r=u?.yValue0}if(o==null||r==null)switch(t){case 0:return lP(e,i);case 1:return cP(e)}const l=bs(o,i.scales.x),c=bs(r,i.scales.y),h={x:l,y:c};return Yc(e,h,h)}function Wk(e,t){if(t==null)return;const i=zs(e.xValue0),s=zs(e.xValue1);return t.find(n=>zs(n.xValue0)===i&&zs(n.xValue1)===s)?.span}function dP(e,t,i,s,n,a,o){const r=e.data[s.datumIndex],l=r.span,c=Wk(r,n);if(c==null){const h=hP(l,t,e,i,s,a);o.added.push({from:h,to:l})}else o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l})}function uP(e,t,i,s,n,a,o){const r=e.data[s.datumIndex],l=r.span,c=Wk(r,n);if(c==null){const h=hP(l,t,e,i,s,a);o.removed.push({from:l,to:h})}else o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c})}function pP(e,t,i,s,n){const a=s.scales.x,o=t[n.xValue0Index],r=t[n.xValue1Index];let l,c;if(a?.type==="continuous"||a?.type==="log"?(l=i.data.findLast(x=>zs(x.xValue0)<=o),c=i.data.find(x=>zs(x.xValue1)>=r)):(l=i.data.find(x=>zs(x.xValue0)===o),c=i.data.find(x=>zs(x.xValue1)===r)),l==null||c==null)return;const[{x:h},{x:d}]=tn(e),u=bs(l.xValue0,i.scales.x),p=bs(l.yValue0,i.scales.y),f=bs(c.xValue1,i.scales.x),y=bs(c.yValue1,i.scales.y);let b=s.data[n.datumIndex].span;return b=Yc(b,{x:u,y:p},{x:f,y}),b=vx(b,h,d),b}function J3(e,t,i,s,n,a,o,r,l){const c=n+1,h=o.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),d=a.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),u=t.zeroData,p=e.zeroData;if(h==null&&d!=null){dP(e,i,a,d,u,r,l);return}else if(h!=null&&d==null){uP(t,i,o,h,p,r,l);return}else if(h==null||d==null)return;let f;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?f=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?f=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?f=1:f=0;const y=t.data[h.datumIndex],b=rP(y.span,t,s,n,h),x=e.data[d.datumIndex],v=rP(x.span,e,s,n,d);if(f===1){const S=pP(b,s,t,e,d);S==null?uP(t,i,o,h,p,r,l):(l.removed.push({from:b,to:S}),l.moved.push({from:S,to:v}),l.added.push({from:v,to:v}))}else if(f===-1){const S=pP(v,s,e,t,h);S==null?dP(e,i,a,d,u,r,l):(l.removed.push({from:b,to:b}),l.moved.push({from:b,to:S}),l.added.push({from:S,to:v}))}else l.removed.push({from:b,to:b}),l.moved.push({from:b,to:v}),l.added.push({from:v,to:v})}function eY(e,t,i,s){const n={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:o,newDataAxisIndices:r}=e,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;c<a.length-1;c+=1)J3(t,i,s,a,c,r,o,l,n);return n}function tY(e,t){const i=[],s=[],n=[];for(let a=0;a<t.data.length;a+=1){const o=t.data[a].span,r=e.data[a].span;i.push({from:o,to:o}),s.push({from:o,to:r}),n.push({from:r,to:r})}return{removed:i,moved:s,added:n}}function gP(e,t,i){const{span:s}=t;switch(i){case 0:return Wk(t,e.zeroData)??lP(s,e);case 1:return cP(s)}}function iY(e,t,i){const s=[],n=[];for(const a of t.data){const o=a.span,r=gP(t,a,i);n.push({from:o,to:r})}for(const a of e.data){const o=a.span,r=gP(e,a,i);s.push({from:r,to:o})}return{removed:n,moved:[],added:s}}function Nf(e,t,i){if(!oP(e)||!oP(t)||!X3(e,t))return;const s=Q3(e,t);return s==null?iY(e,t,i):s.axisValues.length===s.oldDataAxisIndices.length+s.newDataAxisIndices.length+2?tY(e,t):eY(s,e,t,i)}function Tf(e,t){const i=e.map(n=>n.point);let s=ZM(i);switch(t.type){case"linear":break;case"smooth":s=qM(i,t.tension);break;case"step":s=XM(i,t.position);break}return s.map(function(a,o){return{span:a,xValue0:e[o].xDatum,yValue0:e[o].yDatum,xValue1:e[o+1].xDatum,yValue1:e[o+1].yDatum}})}function Mb(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function $k({path:e},t){let i;for(const{span:s}of t){const[n,a]=tn(s),o=i!=null&&Mb(i,n)?2:0;Lf(e,s,o,!1),i=a}}function Db(e,t,i){let s;for(const n of i){const[a,o]=iP(n.from,n.to,e),r=s!=null&&Mb(s,a)?2:0;jk(t.path,n.from,n.to,e,r,!1),s=o}}function fP(e,t,i,s=1){const n=(l,c)=>Db(l,c,t.removed),a=(l,c)=>Db(l,c,t.moved),o=(l,c)=>Db(l,c,t.added),r=Kk(e,i,s);return{status:e,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:n},pathProperties:r}}function Kk(e,t,i=1){const s=t==="none"?"updated":e,n={fromFn(a,o){const r={phase:Za[s]},l=a.previousDatum??o;return l!=null&&(r.segments=l),e==="removed"?r.finish={visible:!1}:e==="added"&&(r.start={visible:!0}),r},toFn(a,o){const r={phase:Za[s]},l=o;return l!=null&&(r.segments=l),r}};return t==="fade"?{fromFn(a,o){const r=e==="added"?0:i,l=e==="removed"?a.previousDatum??o:o;return{...n.fromFn(a,o),opacity:r,segments:l}},toFn(a,o){const r=e==="removed"?0:i,l=e==="removed"?a.previousDatum??o:o;return{...n.toFn(a,o),opacity:r,segments:l}}}:n}function sY(e,t,i,s=1){const n=e.scales.x?.type==="category",a=t.scales.x?.type==="category";if(n!==a||!zl(e.scales.x)||!zl(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const r=Nf({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(r==null)return;const l=fP(o,r,"fade",s),c=(i?.changed??!0)||!Ka(e.scales.x,t.scales.x)||!Ka(e.scales.y,t.scales.y)||o!=="updated";return{status:o,stroke:l,hasMotion:c}}function mP(e,t,i,s){if(t!=null){const[n,a]=t;if(n!==0||a!==1)return!1}if(mt.is(e)){const n=e.calcBandwidth(s)-e.calcBandwidth(i);if(n>0&&n<1)return!1}if(Ya.is(e)){const{bandwidth:n,step:a}=e;if(n>0&&n<1)return!1;const o=a-n;if(o>0&&o<1)return!1}return!0}var Uk=e=>Oc(e.yValue??0);function Of(e,t,i){const{startingX:s,startingY:n}=aY(e,t);return{isVertical:e,calculate:(o,r)=>{let l=e?o.x:s,c=e?n:o.y,h=e?o.width:0,d=e?0:o.height;const{opacity:u=1}=o;r&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=r,h=e?r.width:0,d=e?0:r.height,e&&!Uk(r)?c+=r.height:!e&&Uk(r)&&(l+=r.width));let p;return o.clipBBox==null?p=void 0:Uk(o)?p=e?new le(l,c-d,h,d):new le(l-h,c,h,d):p=new le(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function nY(e,t){return{isVertical:e,calculate:i=>({x:e?i.x:i.x+i.width/2,y:e?i.y+i.height/2:i.y,width:e?i.width:0,height:e?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:t}}function Pf(e,t){const i=o=>o==null||Number.isNaN(o.x)||Number.isNaN(o.y);return{toFn:(o,r,l)=>l==="removed"&&o.datum==null&&e.mode==="fade"?{...Ef(o,r),opacity:0}:l==="removed"||i(r)?e.calculate(r,o.previousDatum):{x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1},fromFn:(o,r,l)=>{l==="updated"&&i(r)?l="removed":l==="updated"&&i(o.previousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(o.previousDatum==null&&e.mode==="fade"?c={...Ef(o,r),opacity:0}:c=e.calculate(r,o.previousDatum),l==="unknown"&&(l=t)):c={x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1};const h=Za[l];return{...c,phase:h}},applyFn:(o,r,l)=>{o.resetAnimationProperties(r.x,r.y,r.width,r.height,r.opacity??1,r.clipBBox),o.crisp=l==="end"&&(o.datum?.crisp??!1)}}}function aY(e,t){const i=t[e?"y":"x"];let s=1/0,n=0;return i?(e?n=i.scale.convert(mt.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(mt.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function Ef(e,{x:t,y:i,width:s,height:n,clipBBox:a,opacity:o=1}){return{x:t,y:i,width:s,height:n,clipBBox:a,opacity:o,crisp:e.datum?.crisp??!1}}function kb(e){for(const t of e){const i=t.nodes();t.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)}t.cleanup()})}}function Yk(e,t){if(t===void 0)return;const{x:i,y:s,width:n,height:a}=t;return Wt.toCanvas(e.contentGroup,new le(i,s,n,a))}function Zk(e,t,i,s){const n=e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length;let a;return n?(a=e.nodes[e.nodeIndex],s(e,a,t)):(a=i(e,t),a!=null&&e.nodes.push(a)),e.nodeIndex++,a}function yP({path:e},{spans:t,phantomSpans:i}){let s=0,n={x:Number.NaN,y:Number.NaN},a={x:Number.NaN,y:Number.NaN};for(let o=0;o<t.length;o+=1){const{span:r}=t[o],{span:l}=i[o],{0:c,1:h}=tn(r),{0:d,1:u}=tn(l);if(Mb(n,c)&&Mb(a,d))Lf(e,r,2,!1);else{for(let p=o-1;p>=s;p-=1)Lf(e,i[p].span,1,!0);e.closePath(),Lf(e,r,0,!1),s=o}n=h,a=u}for(let o=t.length-1;o>=s;o-=1)Lf(e,i[o].span,1,!0);e.closePath()}function Xk(e,{path:t},i,s){for(let n=0;n<i.length;n+=1){const a=i[n],o=s[n];jk(t,a.from,a.to,e,0,!1),jk(t,o.from,o.to,e,1,!0),t.closePath()}}function xP(e,t,i,s){const n=(l,c)=>Xk(l,c,t.removed,i.removed),a=(l,c)=>Xk(l,c,t.moved,i.moved),o=(l,c)=>Xk(l,c,t.added,i.added),r=Kk(e,s);return{status:e,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:n},pathProperties:r}}function oY(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!zl(e.scales.x)||!zl(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const a=Nf({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(a==null)return;const o=Nf({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(o==null)return;const r=Nf({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(r==null)return;const l="none",c=xP(n,a,o,l),h=fP(n,r,l);return{status:n,fill:c,stroke:h}}function bP(e,t,i,s,n,a,o){let r=a?.reduced?.diff?.[e];if(r?.changed)return r;if(!o)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=rY(s,n);return r==null&&a?.reduced?.diff!=null?(r={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?r.updated=new Set(Array.from(t,({datum:c})=>i(c))):r.added=new Set(Array.from(t,({datum:c})=>i(c)))):l&&(r={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:c})=>i(c))),removed:new Set,moved:new Set}),r}function vP(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function rY(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!Ka(i.x,s.x)||!Ka(i.y,s.y))return!0;if(!vP(e)||!vP(t))return!1;const n=e.groupScale,a=t.groupScale;return!Ka(n,a)}function Rf({id:e},t,i,s,...n){const a={...s,phase:s?.phase??(i?Za[i]:"trailing")};Vr(e,"markers",t,n,{opacity:0},{opacity:1},a);for(const o of n)o.cleanup()}function lY({id:e},t,...i){Vr(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const s of i)s.cleanup()}function qk({id:e,nodeDataDependencies:t},i,s,...n){const a=t.seriesRectWidth;ui(e,"markers",i,n,{fromFn:(l,c)=>{const h=c.midPoint?.x??a;let d=ae(0,nD(h/a),1);return Number.isNaN(d)&&(d=0),{scalingX:0,scalingY:0,delay:s?.delay??d,duration:s?.duration??wD,phase:s?.phase??"initial",start:s?.start,finish:s?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function Ib(e){return{opacity:1,scalingX:1,scalingY:1}}function Ab(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const n of i){const a=n.datum;if(a?.point==null)continue;const{x:o,y:r}=a.point;!Number.isFinite(o)||!Number.isFinite(r)||n.resetAnimationProperties(o,r,n.size,1,1,1)}t.cleanup()})}}function zf(e,t){return{x:t.point?.x??Number.NaN,y:t.point?.y??Number.NaN,scalingCenterX:t.point?.x??Number.NaN,scalingCenterY:t.point?.y??Number.NaN}}function Cb(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const s=i[t],{point:n}=s??{};if(s==null||n==null)return;const a=e.getFormattedMarkerStyle(s),o=Li.anchor(a.shape),r=n.focusSize??a.size,l=4+r,c=l/2,h=(o.x-.5)*r,d=(o.y-.5)*r,u=s.point.x-c-h,p=s.point.y-c-d;return Wt.toCanvas(e.contentGroup,new le(u,p,l,l))}function Qk(e,t,i,s=i){if(!(s.enabled??i.enabled))return!1;const a=1;return(t.step??xo(t.range)/Math.max(1,e))>a}function wb(e,t,i,s){return s??(s={stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}),jD.reduce((n,a)=>(n[a]=e.getMarkerStyle(i,{},void 0,{highlightState:a},void 0,s),n),{})}function Jk({id:e,visible:t,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:o}=i;Vr(e,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function eI({id:e},t,i,s="add",...n){Vr(e,t,i,n,{opacity:0},{opacity:1},{phase:s})}function tI(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Lb({nodeDataDependencies:e},t){const i=s=>Number.isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var SP={angle:["angleKey"],radius:["radiusKey"]},MP={angle:["angleName"],radius:["radiusName"]},iI=class extends Fk{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new Le({name:"items"})),this.nodeData=[],this.itemSelection=pi.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=pi.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=pi.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=pi.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=s,this.animationState=new de("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(e){if(e==="angle")return this.properties.angleKeyAxis;if(e==="radius")return this.properties.radiusKeyAxis}setZIndex(e){super.setZIndex(e),this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3]}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new xn;return e.pointerEvents=1,e}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new le(-e,-e,e*2,e*2),axis:new le(-e,-e,e*2,e*2)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&Xi([this.itemSelection,this.highlightSelection],e),t&&Xi([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&Xi([this.highlightSelection],t),i&&Xi([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0)return this.itemSelection.select(i=>i instanceof Ai&&i.datum===t)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(e,t){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:s,datumIndex:n}=e??{},a=typeof n=="number"?t?.[n]:void 0;return i===this||a!=null&&a===s}},DP=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.OtherItem=2]="OtherItem",e[e.Branch=3]="Branch",e[e.OtherBranch=4]="OtherBranch",e))(DP||{});function Vf(e){const t=i=>i;switch(e){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 t(e)}}var ic=class extends Ua{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(gi),this.strokes=Object.values(Fr)}};g([m],ic.prototype,"childrenKey",2),g([m],ic.prototype,"sizeKey",2),g([m],ic.prototype,"colorKey",2),g([m],ic.prototype,"colorName",2),g([m],ic.prototype,"fills",2),g([m],ic.prototype,"strokes",2),g([m],ic.prototype,"colorRange",2);var kP=class zS{constructor(t,i,s,n,a,o,r,l,c,h,d){this.series=t,this.itemId=i,this.datumIndex=s,this.datum=n,this.sizeValue=a,this.colorValue=o,this.sumSize=r,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(t,i=zS.Walk.PreOrder){i===zS.Walk.PreOrder&&t(this);for(const s of this.children)s.walk(t,i);i===zS.Walk.PostOrder&&t(this)}find(t){if(t(this))return this;for(const i of this.children){const s=i.find(t);if(s!=null)return s}}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};kP.Walk={PreOrder:0,PostOrder:1};var cY=kP,hY=class extends uf{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new uu,this.animationState=new de("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let a=0,o=1/0,r=-1/0;const l=(u,p,f)=>{const y=f.depth==null?0:f.depth+1,b=t==null?void 0:u[t],x=b==null||b.length===0;let v=i==null?void 0:u[i];Number.isFinite(v)?v=Math.max(v,0):v=x?1:0;const S=v;a=Math.max(a,y);const M=s==null?void 0:u[s];typeof M=="number"&&(o=Math.min(o,M),r=Math.max(r,M));const D=this.getItemStyle({datumIndex:p,datum:u,depth:y,colorValue:M},x,!1);return c(new e(this,us(p.join(";")),p,u,v,M,S,y,f,[],D),b)},c=(u,p)=>{const{datumIndex:f}=u;if(p)for(const[y,b]of p.entries()){const x=l(b,f.concat(y),u);u.children.push(x),u.sumSize+=x.sumSize}return u},h=c(new e(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),d=[o,r];this.colorScale.domain=o<r?[o,r]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=a,this.colorDomain=d}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return this.rootNode?.find(t=>t.itemId===e)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(e){const{colorKey:t,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:a}=this;return e==="gradient"&&t!=null&&i!=null?[{legendType:"gradient",enabled:a&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if(En(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=ae(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let n=this.removeMeIndexPathForIndex(t);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]=ae(0,n.at(-1)+i,l)}const o=n.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(t+1));if(r!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:o.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){K.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})}getCategoryValue(e){}datumIndexForCategoryValue(e){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this)return e}getHierarchyHighlightState(e,t,i){if(e)return 1;if(t==null)return 0;const s=i.datumIndex?.[0],n=t.datumIndex?.[0];return s==null||n==null?0:s===n?3:4}getHierarchyHighlightStyles(e,t){switch(e){case 1:return re(t.highlightedItem,t.highlightedBranch);case 3:return re(t.unhighlightedItem,t.highlightedBranch);case 4:return t.unhighlightedBranch;default:return}}getHighlightStateString(e,t,i,s){if(!this.properties.highlight.enabled||i==null)return Vf(0);const n=i.reduce((r,l)=>r?.children[l],this.rootNode),a=this.getActiveHighlightNode();if(n==null)return Vf(0);const o=this.getHierarchyHighlightState(t??!1,a,n);return Vf(o)}},Nb=Math.PI/180,sI=e=>e*Nb,nI=e=>-Math.log(Math.tan(Math.PI*.25+e*Nb*.5)),aI=e=>e/Nb,oI=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(Nb*.5),dY=class cL extends Ix{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=cL.bounds(t)}static bounds(t){const[[i,s],[n,a]]=t,o=sI(i),r=nI(s),l=sI(n),c=nI(a);return new le(Math.min(o,l),Math.min(r,c),Math.abs(l-o),Math.abs(c-r))}static fixedScale(){return new cL([[aI(0),oI(0)],[aI(1),oI(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,s=1/0,n=-1/0,a=1/0;for(const o of t){const r=o.domain;for(const[l,c]of r)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([t,i]){const[[s,n],[a,o]]=this.range,r=(a-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[(sI(t)-this.bounds.x)*r+s,(nI(i)-this.bounds.y)*l+n]}invert([t,i]){const[[s,n],[a,o]]=this.range,r=(a-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[aI((t-s)/r+this.bounds.x),oI((i-n)/l+this.bounds.y)]}getDomainMinMax(){return Cx(this.domain)}},uY=class{constructor(e){this.minimumDelay=e?.minimumDelay??50,this.timeout=e?.timeout??100}schedule(e,t){this.cancel(),this.pending={computation:e,onComplete:t},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 e=Re(),t=Math.max(0,this.timeout-this.minimumDelay);typeof e.requestIdleCallback=="function"?this.idleCallbackId=e.requestIdleCallback(this.execute.bind(this),{timeout:t}):this.idleCallbackId=setTimeout(()=>this.execute(),t)}cancelScheduled(){if(this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId==null)return;const e=Re();typeof e.cancelIdleCallback=="function"?e.cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0}execute(){const e=this.pending;if(!e)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const t=e.computation();return e.onComplete(t),t}},Tb=class{constructor(){this._dataLength=0,this.executor=new uY}get filters(){return this._filters}aggregate(e){if(this.executor.cancel(),e.targetRange>1&&e.computePartial){const t=e.computePartial(this._filters);if(t){const{immediate:i,computeRemaining:s}=t;return s&&this.executor.schedule(s,n=>{this.mergeFilters(n)}),this._filters=i,i}}return this._filters=e.computeFull(this._filters),this._filters}ensureLevelForRange(e){if(!this._filters?.some(i=>i.maxRange>e)&&this.executor.isPending()){const i=this.executor.demand();i&&this.mergeFilters(i)}}getFilterForRange(e){return this._filters?.find(t=>t.maxRange>e)}cancel(){this.executor.cancel()}markStale(e){const t=this._dataLength>0?e/this._dataLength:0;if(t>10||t<.1||this._dataLength===0)this._filters=void 0,this._dataLength=e;else if(this._filters)for(const i of this._filters)i.stale=!0;else this._dataLength=e;this.executor.cancel()}mergeFilters(e){if(!this._filters||e.length===0)return;const t=[...this._filters,...e];t.sort((i,s)=>i.maxRange-s.maxRange),this._filters=t}},rI=class extends nk{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 e=this.label.getSideFlag(),t=this.hasDefinedDomain()||this.hasVisibleSeries(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();for(const a of this.crossLines)a.sideFlag=-e,a.direction=i===-Math.PI/2?"angle":"radius",a.parallelFlipRotation=s,a.regularFlipRotation=n,a.calculateLayout?.(t,this.reverse)}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each(Qx())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};g([m],rI.prototype,"shape",2),g([m],rI.prototype,"innerRadiusRatio",2);var IP=class extends If{calculateGridLine({index:e,tickId:t,translation:i},s,n,a,o){const{gridLine:r,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:e,tickId:t,translation:i},s,n,a,o);const d=o[s-1],u=d?i-(i-d.translation)/2:h[0],[p,f,y,b]=l?[u,Math.max(n,a),u,Math.min(n,a)]:[Math.min(n,a),u,Math.max(n,a),u],{style:x}=r,{stroke:v,strokeWidth:S=0,lineDash:M}=x[e%x.length]??{};return{tickId:t,offset:u,x1:p,y1:f,x2:y,y2:b,stroke:v,strokeWidth:S,lineDash:M}}calculateGridFills(e,t,i){return this.interval.placement!=="between"?super.calculateGridFills(e,t,i):e.map((s,n)=>this.calculateGridFill(s,n,s.index,t,i,e))}calculateGridFill({tickId:e,translation:t},i,s,n,a,o){const{gridLine:r,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:e,translation:t},i,s,n,a,o);const d=o[i-1],u=o[i+1],p=d?t-(t-d.translation)/2:h[0],f=u?t+(u.translation-t)/2:h[1],[y,b,x,v]=l?[p,Math.max(n,a),f,Math.min(n,a)]:[Math.min(n,a),p,Math.max(n,a),f],{fill:S,fillOpacity:M}=r.style[s%r.style.length]??{};return{tickId:e,x1:y,y1:b,x2:x,y2:v,fill:S,fillOpacity:M}}calculateTickLine({isPrimary:e,tickId:t,translation:i},s,n,a,o=0){const{horizontal:r,interval:l,primaryTick:c,range:h,tick:d}=this;if(l.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:t,translation:i},s,n,a,o);const u=e&&c?.enabled?c:d,p=-n*this.getTickSize(u),f=a[s-1],y=f?i-(i-f.translation)/2:h[0],b=-n*(o+this.getTickSpacing(u)),[x,v,S,M]=r?[y,b,y,b+p]:[b,y,b+p,y],{stroke:D,width:I}=u;return{tickId:t,offset:y,x1:x,y1:v,x2:S,y2:M,stroke:D,strokeWidth:I,lineDash:void 0}}},pY={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}},gY={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 fY({yDirection:e,padding:t=0,position:i="top",bbox:s}){const n=e?pY:gY,{xTranslationDirection:a,yTranslationDirection:o}=n[i],r=a*(t+s.width/2),l=o*(t+s.height/2);return{xTranslation:r,yTranslation:l}}function Ob(e,t,i,s,n){const a=(d,u,p,f)=>{i.animate({id:`${e}_${t}_${u.id}_${d}`,groupId:e,from:p?1:0,to:1,ease:Tr,collapsable:p,onUpdate(y,b){b&&d!=="removed"||(u.path.clear(!0),f(y,u),u.checkPathDirty())},onStop(){d==="added"&&(u.path.clear(!0),f(1,u),u.checkPathDirty())},phase:Za[d]})},o=new Ai,r=d=>(o.resetPathDirty(),d(0,o),o.resetPathDirty(),d(1,o),o.checkPathDirty(),o.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const d of s)i.isSkipped()||(a("removed",d,!r(h),h),a("updated",d,!r(c),c)),a("added",d,!r(l),l)}var Bo=class extends Zc{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};g([m,$()],Bo.prototype,"enabled",2),g([m,$()],Bo.prototype,"color",2),g([m,$()],Bo.prototype,"xOffset",2),g([m,$()],Bo.prototype,"yOffset",2),g([m,$()],Bo.prototype,"blur",2);function AP({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let n=1/0,a=1/0,o=-1/0,r=-1/0;const l=(c,h)=>{n=Math.min(c,n),a=Math.min(h,a),o=Math.max(c,o),r=Math.max(h,r)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),Qs(0,e,t)&&l(s,0),Qs(Math.PI*.5,e,t)&&l(0,s),Qs(Math.PI,e,t)&&l(-s,0),Qs(Math.PI*1.5,e,t)&&l(0,-s),new le(n,a,o-n,r-a)}function lI(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||s<Math.min(n,a)||s>Math.max(n,a))return!1;const o=wg(i.startAngle),r=wg(i.endAngle),l=Math.atan2(t,e);return o<r?l<=r&&l>=o:l<=r&&l>=-Math.PI||l>=o&&l<=Math.PI}function mY(e,t,i,s,n,a,o,r,l,c){if(Number.isNaN(e)||Number.isNaN(t))return 0;a&&([n,s]=[s,n]);const h=(c-r)/(l-o),d=r-h*o,u=Math.pow(h,2)+1,p=2*(h*(d-t)-e),f=Math.pow(e,2)+Math.pow(d-t,2)-Math.pow(i,2),y=Math.pow(p,2)-4*u*f;if(y<0)return 0;const b=(-p+Math.sqrt(y))/2/u,x=(-p-Math.sqrt(y))/2/u;let v=0;for(const S of[b,x]){if(!(S>=Math.min(o,l)&&S<=Math.max(o,l)))continue;const D=h*S+d,I=S-e,k=D-t,C=Math.atan2(k,I);Qs(C,s,n)&&v++}return v}function CP(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=t,o={x:a*Math.cos(i),y:a*Math.sin(i)},r={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 Yg(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||Yg(e.start.x,e.start.y,e.end.x,e.end.y,r.x,r.y,c.x,c.y)||mY(0,0,a,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function yY(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},n={x:e.x,y:e.y+e.height},a={x:e.x+e.width,y:e.y+e.height};return CP({start:i,end:s},t)||CP({start:n,end:a},t)}function wP(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let a=0,o=1;for(let r=0;r<8;r+=1){const l=(a+o)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*s)/(e+l*s))-t<0?a=l:o=l}return a}var xY=1e-6;function sc(e,t){return _a(e,t)<xY?t:Qe(e-t)+t}function Pb(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:Qe(t-e);return e=sc(e,i),t=e+n,{startAngle:e,endAngle:t}}function Eb(e,t,i,s,n,a){const o=Math.sin(a),r=Math.cos(a),l=e**2+t**2-i**2;let c,h,d,u;if(r>.5){const S=o/r,M=1+S**2,D=-2*(e+t*S),I=D**2-4*M*l;if(I<0)return;const k=(-D+Math.sqrt(I))/(2*M),C=(-D-Math.sqrt(I))/(2*M);c=k,h=k*S,d=C,u=C*S}else{const S=r/o,M=1+S**2,D=-2*(t+e*S),I=D**2-4*M*l;if(I<0)return;const k=(-D+Math.sqrt(I))/(2*M),C=(-D-Math.sqrt(I))/(2*M);c=k*S,h=k,d=C*S,u=C}const p=r,f=o,y=c*p+h*f,b=d*p+u*f,x=y>0?sc(Math.atan2(h-t,c-e),s):Number.NaN,v=b>0?sc(Math.atan2(u-t,d-e),s):Number.NaN;if(x>=s&&x<=n)return x;if(v>=s&&v<=n)return v}function Rb(e,t,i,s,n,a){const o=Math.hypot(e,t),r=(o**2-i**2+a**2)/(2*o),l=o-r,c=Math.atan2(t,e),h=Math.acos(-l/i),d=sc(c+h,s),u=sc(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var LP=class extends Ai{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},bY=class extends fu(LP){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},vY=class v_ extends $l{static is(t){return t instanceof v_}setSourceScale(t){this._sourceScale=t;const i=n=>{Object.defineProperty(this,n,{get:()=>t[n],set:a=>{t[n]=a},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const s=n=>{Object.defineProperty(this,n,{get:()=>t[n],configurable:!0})};s("bandwidth"),s("step"),s("inset"),s("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(t){return this._sourceScale?this._sourceScale.ordinalRange(t):super.ordinalRange(t)}convert(t,i){this.refresh();const s=this.findIndex(t,i?.alignment);return s==null||s<0||s>=this.bands.length?Number.NaN:this.ordinalRange(s)}findIndex(t,i=0){if(t==null)return;const{bands:s,reversed:n}=this,a=s.length;if(a===0)return;if(a===1)return 0;const o=s[0],r=s[a-1];if(o==null||r==null)return this._sourceScale?.findIndex(t,i);const l=t.valueOf(),c=o.valueOf(),h=r.valueOf(),d=(l-c)/(h-c),u=n?(1-d)*(a-1):d*(a-1);return i===0?Math.max(0,Math.min(a-1,Math.floor(u))):Math.max(0,Math.min(a-1,Math.ceil(u)))}},NP=class hL{constructor(t,i,s,n){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:n}=this;return new hL(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[Dx](t,i){return new hL(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}},tp=class extends Pr{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};g([$()],tp.prototype,"x",2),g([$()],tp.prototype,"y",2),g([$()],tp.prototype,"width",2),g([$()],tp.prototype,"height",2),g([$()],tp.prototype,"opacity",2);var Fo=class extends Ai{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 He(Qe(this.startAngle),Qe(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new le(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Fo.className="Arc",g([$()],Fo.prototype,"centerX",2),g([$()],Fo.prototype,"centerY",2),g([$()],Fo.prototype,"radius",2),g([$()],Fo.prototype,"startAngle",2),g([$()],Fo.prototype,"endAngle",2),g([$()],Fo.prototype,"counterClockwise",2),g([$()],Fo.prototype,"type",2);function zb(e,t,i){const s=Math.hypot(e,t),a=Math.atan2(t,e)+i;return{x:Math.cos(a)*s,y:Math.sin(a)*s}}var to=class extends Ai{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(e){}computeBBox(){const{columnWidth:e}=this,[t,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=this.getRotation(),n=-e/2,a=e/2,o=-i,r=-t;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:f}=zb(u%2===0?n:a,u<2?o:r,s);l=Math.min(p,l),c=Math.min(f,c),h=Math.max(p,h),d=Math.max(f,d)}return new le(l,c,h-l,d-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=_a(e,t);return Qe(e+i/2+Math.PI/2)}normalizeRadii(e,t){return e>t?[t,e]:[e,t]}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,path:t}=this,[i,s]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=-e/2,a=e/2,o=-s,r=-i,l=this.getRotation(),c=[[n,r],[n,o],[a,o],[a,r]].map(([h,d])=>zb(h,d,l));t.clear(!0),t.moveTo(c[0].x,c[0].y),t.lineTo(c[1].x,c[1].y),t.lineTo(c[2].x,c[2].y),t.lineTo(c[3].x,c[3].y),t.closePath()}calculateCircleIntersection(e,t){const i=e*e;if(t<i)return null;const s=-Math.sqrt(t-i),n=Math.atan2(s,e);return{y:s,angle:n}}calculateBothIntersections(e,t,i){const s=i*i,n=this.calculateCircleIntersection(e,s),a=this.calculateCircleIntersection(t,s);return!n||!a?null:{left:n,right:a}}calculateAxisOuterIntersections(e,t,i){const s=i*i,n=this.calculateCircleIntersection(e,s),a=this.calculateCircleIntersection(t,s);return!n||!a?null:{left:n,right:a,radiusSquared:s}}moveToRotated(e,t,i){const s=zb(e,t,i);this.path.moveTo(s.x,s.y)}lineToRotated(e,t,i){const s=zb(e,t,i);this.path.lineTo(s.x,s.y)}renderTopWithCornerClipping(e,t,i){const{path:s}=this,{right:n,top:a,rotation:o}=i,r=a*a,l=t.radiusSquared-r;if(l<=0)this.lineToRotated(n,t.right.y,o),s.arc(0,0,e,o+t.right.angle,o+t.left.angle,!0);else{const c=Math.sqrt(l),h=Math.atan2(a,c),d=Math.atan2(a,-c);this.lineToRotated(n,t.right.y,o),s.arc(0,0,e,o+t.right.angle,o+h,!0),this.lineToRotated(-c,a,o),s.arc(0,0,e,o+d,o+t.left.angle,!0)}}updateBeveledPath(){const{columnWidth:e,path:t,axisInnerRadius:i,axisOuterRadius:s}=this,[n,a]=this.normalizeRadii(this.innerRadius,this.outerRadius),o=-e/2,r=e/2,l=-a,c=-n,h=this.getRotation(),d=He(n,i),u=He(a,s),p=Math.hypot(o,l)>s||Math.hypot(r,l)>s;if(!d&&!u&&!p){this.updateRectangularPath();return}const f=d?this.calculateBothIntersections(o,r,n):null,y=u?this.calculateBothIntersections(o,r,a):null,b=p?this.calculateAxisOuterIntersections(o,r,s):null;if(d&&!f||u&&!y||p&&!b){this.updateRectangularPath();return}t.clear(!0);const x={left:o,right:r,top:l,bottom:c,rotation:h};f?this.moveToRotated(o,f.left.y,h):this.moveToRotated(o,c,h),f?t.arc(0,0,n,h+f.left.angle,h+f.right.angle,!1):this.lineToRotated(r,c,h),y?(this.lineToRotated(r,y.right.y,h),t.arc(0,0,a,h+y.right.angle,h+y.left.angle,!0)):b?this.renderTopWithCornerClipping(s,b,x):(this.lineToRotated(r,l,h),this.lineToRotated(o,l,h)),t.closePath()}};to.className="RadialColumnShape",g([$()],to.prototype,"isBeveled",2),g([$()],to.prototype,"columnWidth",2),g([$()],to.prototype,"startAngle",2),g([$()],to.prototype,"endAngle",2),g([$()],to.prototype,"outerRadius",2),g([$()],to.prototype,"innerRadius",2),g([$()],to.prototype,"axisInnerRadius",2),g([$()],to.prototype,"axisOuterRadius",2);function TP(e,t,i,s,n){const a=_a(e,t),o=a*(1-s)/2;if(e+=o,t-=o,a<.001)return 2*i*n;if(a>=2*Math.PI){const p=e+a/2;e=p-Math.PI,t=p+Math.PI}const r=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),d=Math.floor(Math.hypot(r-c,l-h)),u=2*i*n;return Math.max(1,Math.min(u,d))}var cI=class{constructor(e,t,i,s,n){this.cx=e,this.cy=t,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(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},vs=class extends Ai{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(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return AP(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:i}=Pb(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=Pb(e.startAngle,e.endAngle,t);return new NP(Math.max(t,a.startAngle),Math.min(i,a.endAngle),Math.max(s,e.innerRadius),Math.min(n,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,n,a,o,r){if(e<=0)return;const{startAngle:l,endAngle:c}=Pb(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&h<=0)return;const p=r?this.getAngleOffset(h+e):this.getAngleOffset(d-e),f=o?l+p+t:c-p-t,y=r?h+e:d-e,b=y*Math.cos(f),x=y*Math.sin(f);if(u!=null&&(!o&&!(f>=l-1e-6&&f<=u.endAngle-1e-6)||o&&!(f>=u.startAngle+1e-6&&f<=c-1e-6)||r&&y<u.innerRadius-1e-6||!r&&y>u.outerRadius+1e-6))return;const v=new cI(b,x,e,i,s);if(u!=null){r?(v.clipStart(Eb(b,x,e,i,s,u.endAngle)),v.clipEnd(Eb(b,x,e,i,s,u.startAngle))):(v.clipStart(Eb(b,x,e,i,s,u.startAngle)),v.clipEnd(Eb(b,x,e,i,s,u.endAngle)));let k,C;if(o?(k=Rb(b,x,e,i,s,u.innerRadius),C=Rb(b,x,e,i,s,u.outerRadius)):(k=Rb(b,x,e,i,s,u.outerRadius),C=Rb(b,x,e,i,s,u.innerRadius)),v.clipStart(k),v.clipEnd(C),k!=null){const{x:A,y:w}=v.pointAt(k),T=sc(Math.atan2(w,A),l);o?a?.clipStart(T):n.clipEnd(T)}if(C!=null){const{x:A,y:w}=v.pointAt(C),T=sc(Math.atan2(w,A),l);o?n.clipStart(T):a?.clipEnd(T)}}if(u!=null){const{x:k,y:C}=v.pointAt((v.a0+v.a1)/2);if(!lI(k,C,u))return}const{x:S,y:M}=v.pointAt(o===r?v.a0:v.a1),D=sc(Math.atan2(M,S),l),I=r?a:n;return o?I?.clipStart(D):I?.clipEnd(D),v}updatePath(){const{path:t,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:a}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=Pb(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),f=this.normalizedClipSector(),y=d-h,b=y>=2*Math.PI-1e-6;t.clear();const x=this.getAngleOffset(u),v=y-2*x,S=p-u,M=u>0&&v>0?2*u*Math.sin(v/2):0,D=p>0&&v>0?2*p*Math.sin(v/2):0;if(o=Math.floor(Math.max(0,Math.min(o,D/2,S/2))),r=Math.floor(Math.max(0,Math.min(r,D/2,S/2))),l=Math.floor(Math.max(0,Math.min(l,M/2,S/2))),c=Math.floor(Math.max(0,Math.min(c,M/2,S/2))),u===0&&p===0||u>p||M<0||D<=0)return;if((f?.startAngle??h)===(f?.endAngle??d))return;if(b&&this.clipSector==null&&o===0&&r===0&&l===0&&c===0){t.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),t.arc(i,s,p,h,d),u>n&&(t.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),t.arc(i,s,u,d,h,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){t.arc(i,s,p,h,d,!1),t.arc(i,s,p,d,h,!0),t.closePath();return}const k=this.getAngleOffset(p);if(y<2*k)return;const A=(f?.innerRadius??u)>n,w=u<n||y<2*x,T=Math.max(o,l,r,c),O=T>0?Math.min(S/T,1):1;o*=O,r*=O,l*=O,c*=O;const z=wP(p,y-2*k,-o,-r);if(o*=z,r*=z,!w&&A){const we=wP(u,y-2*x,l,c);l*=we,c*=we}else l=0,c=0;const V=Math.max(o+l,r+c),E=V>0?Math.min(S/V,1):1;o*=E,r*=E,l*=E,c*=E;let _=0,G=0;const B=o/(p-o),F=r/(p-r);if(B>=0&&B<1-1e-6)_=Math.asin(B);else{_=y/2;const we=p/(1/Math.sin(_)+1);o=Math.min(we,o)}if(F>=0&&F<1-1e-6)G=Math.asin(F);else{G=y/2;const we=p/(1/Math.sin(G)+1);r=Math.min(we,r)}const Y=Math.asin(l/(u+l)),Z=Math.asin(c/(u+c)),ie=f?.outerRadius??p,ee=this.getAngleOffset(ie),he=new cI(0,0,ie,h+ee,d-ee),Me=f?.innerRadius??u,Ce=this.getAngleOffset(Me),xe=A?new cI(0,0,Me,h+Ce,d-Ce):void 0;f!=null&&(he.clipStart(f.startAngle),he.clipEnd(f.endAngle),xe?.clipStart(f.startAngle),xe?.clipEnd(f.endAngle));const Ge=this.arc(o,_,h-Math.PI*.5,h+_,he,xe,!0,!1),je=this.arc(r,G,d-G,d+Math.PI*.5,he,xe,!1,!1),dt=this.arc(c,Z,d+Math.PI*.5,d+Math.PI-Z,he,xe,!1,!0),Ze=this.arc(l,Y,h+Math.PI+Y,h+Math.PI*1.5,he,xe,!0,!0);if(!(w&&A)){if(w){const we=y<Math.PI*.5?a*(1+Math.cos(y))/Math.sin(y):Number.NaN;let Ie;we>0&&we<p?Ie=Math.max(Math.hypot(a,we),u):Ie=a,Ie=Math.max(Ie,u);const pe=h+y*.5;t.moveTo(i+Ie*Math.cos(pe),s+Ie*Math.sin(pe))}else if(!(Ze?.isValid()===!0||xe?.isValid()===!0)){const we=h+y/2,Ie=u*Math.cos(we),pe=u*Math.sin(we);t.moveTo(i+Ie,s+pe)}}if(Ge?.isValid()===!0){const{cx:we,cy:Ie,r:pe,a0:yt,a1:xt}=Ge;t.arc(i+we,s+Ie,pe,yt,xt)}if(he.isValid()){const{r:we,a0:Ie,a1:pe}=he;t.arc(i,s,we,Ie,pe)}if(je?.isValid()===!0){const{cx:we,cy:Ie,r:pe,a0:yt,a1:xt}=je;t.arc(i+we,s+Ie,pe,yt,xt)}if(!w){if(dt?.isValid()===!0){const{cx:we,cy:Ie,r:pe,a0:yt,a1:xt}=dt;t.arc(i+we,s+Ie,pe,yt,xt)}if(xe?.isValid()===!0){const{r:we,a0:Ie,a1:pe}=xe;t.arc(i,s,we,pe,Ie,!0)}if(Ze?.isValid()===!0){const{cx:we,cy:Ie,r:pe,a0:yt,a1:xt}=Ze;t.arc(i+we,s+Ie,pe,yt,xt)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=this.clipSector??this;return lI(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,a),outerRadius:Math.max(n,a)})}};vs.className="Sector",g([$()],vs.prototype,"centerX",2),g([$()],vs.prototype,"centerY",2),g([$()],vs.prototype,"innerRadius",2),g([$()],vs.prototype,"outerRadius",2),g([$()],vs.prototype,"startAngle",2),g([$()],vs.prototype,"endAngle",2),g([Or({equals:(e,t)=>e.equals(t)})],vs.prototype,"clipSector",2),g([$()],vs.prototype,"concentricEdgeInset",2),g([$()],vs.prototype,"radialEdgeInset",2),g([$()],vs.prototype,"startOuterCornerRadius",2),g([$()],vs.prototype,"endOuterCornerRadius",2),g([$()],vs.prototype,"startInnerCornerRadius",2),g([$()],vs.prototype,"endInnerCornerRadius",2);var hI=class extends SD{constructor(){super(ye("div"),"menuitem")}},OP=class extends SD{constructor(){super(ye("div"),"menuitemradio")}setChecked(e){Pe(this.elem,"aria-checked",e)}},SY=["Escape","ArrowLeft"],PP=class S_ extends MD{constructor(t="vertical"){super(t,"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 t=dn().createElement("div");return Pe(t,"role","separator"),this.elem.appendChild(t),t}onChildAdded(t){super.onChildAdded(t),t.addListener("mouseenter",this.handleMouseEnter),t.addListener("mousemove",this.handleMouseMove)}onChildRemoved(t){super.onChildRemoved(t),t.removeListener("mouseenter",this.handleMouseEnter),t.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const t=new hI,i=new S_(this.orientation);i.id=Ir();const s=()=>{this.collapseExpandedSubMenu(i),t.expandControlled()},n=a=>{Kd(a.sourceEvent)&&a.sourceEvent.code==="ArrowRight"&&(this.collapseExpandedSubMenu(i),t.expandControlled())};return t.setControlled(i),t.setAriaHasPopup("menu"),t.addListener("click",s),t.addListener("mouseenter",s),t.addListener("keydown",n),this.addChild(t),{subMenuButton:t,subMenu:i}}expandSubMenu(t,i){const{expansionScope:s}=this;s&&(this.collapseExpandedSubMenu(i),i?.expand(t))}collapseExpandedSubMenu(t){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=t)}expand(t){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:ex(t.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new pt};const i=this.expansionScope,s=this.children.map(n=>n.getElement());Pe(i.lastFocus,"aria-expanded",!0),i.removers.register(yM(this.elem,i.abort),xM(this.elem,i.abort),...this.children.map(n=>Xy(n.getElement(),i.close,SY)),t?.overrideFocusVisible&&bM(this.elem,s,t.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(t){const{mode:i="0"}=t??{};if(this.expansionScope===void 0)return;const{lastFocus:s,removers:n,expandedSubMenu:a}=this.expansionScope;this.expansionScope=void 0,a?.collapse({mode:"3"}),Pe(s,"aria-expanded",!1),i==="0"&&s?.focus({preventScroll:!0}),n.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},EP="canvas-overlay",RP=class extends hi{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.setOwnedWidget=(()=>{let s;return n=>{s?.destroy(),s=n}})(),this.moduleId=`popover-${t}`,i?.detached?this.element=ye("div"):this.element=e.domManager.addChild(EP,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>e.domManager.removeChild(EP,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();t?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return e??(e=ye("div","ag-charts-popover")),e.classList.toggle("ag-charts-popover",!0),t.ariaLabel!=null&&e.setAttribute("aria-label",t.ariaLabel),t.class!=null&&e.classList.add(t.class),this.element.replaceChildren(e),e}showWidget(e,t,i){this.setOwnedWidget(t),this.initPopoverElement(t.getElement(),i),t.addListener("collapse-widget",()=>{e.setControlled(void 0),this.setOwnedWidget(void 0)}),e.setControlled(t),e.expandControlled()}showWithChildren(e,t){const i=this.initPopoverElement(void 0,t);if(i.replaceChildren(...e),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const s=ex(t.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),e.x!=null&&t.style.setProperty("left",`${Math.floor(e.x)}px`),e.y!=null&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},zP=class extends RP{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}updateAnchor(e){const t=e.anchor??this.anchor,i=e.fallbackAnchor??this.fallbackAnchor;t&&this.setAnchor(t,i)}showWidget(e,t,i){super.showWidget(e,t,i),this.updateAnchor(i)}showWithChildren(e,t){const i=super.showWithChildren(e,t);return this.updateAnchor(t),Re().requestAnimationFrame(()=>{this.repositionWithinBounds()}),i}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const n=t.domManager.getBoundingClientRect(),{offsetWidth:a,offsetHeight:o}=s;let r=ae(0,e.x,n.width-a),l=ae(0,e.y,n.height-o);r!==e.x&&i?.x!=null&&(r=ae(0,i.x-a,n.width-a)),l!==e.y&&i?.y!=null&&(l=ae(0,i.y-o,n.height-o)),this.updatePosition({x:r,y:l})}},MY=class extends zP{show(e,t){const i=new PP("vertical");for(const s of t.items)i.addChild(this.createRow(t,s,i));i.addClass("ag-charts-menu"),this.showWidget(e,i,t)}allocRow(e,t){if(e.menuItemRole==null||e.menuItemRole==="menuitem")return new hI;{e.menuItemRole;const i=new OP;return i.setChecked(e.value===t.value),i}}createRow(e,t,i){const s=t.value===e.value,n=this.allocRow(e,t);if(n.addClass("ag-charts-menu__row"),n.toggleClass("ag-charts-menu__row--active",s),typeof t.value=="string"&&(n.getElement().dataset.popoverId=t.value),t.icon!=null){const o=ye("span",`ag-charts-menu__icon ${Al(t.icon)}`);n.getElement().appendChild(o)}const a=t.strokeWidth!=null;if(a&&(n.toggleClass("ag-charts-menu__row--stroke-width-visible",a),n.setCSSVariable("--strokeWidth",a?`${t.strokeWidth}px`:null)),t.label!=null){const o=ye("span","ag-charts-menu__label");o.textContent=this.ctx.localeManager.t(t.label),n.getElement().appendChild(o)}return"altText"in t&&n.setAriaLabel(this.ctx.localeManager.t(t.altText)),n.addListener("click",({sourceEvent:o})=>{e.onPress?.(t),o.preventDefault(),o.stopPropagation(),i.collapse()}),n}},VP=class extends RP{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:H.from(e.clientX,e.clientY),position:H.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=H.sub(H.from(e.clientX,e.clientY),t.client),n=H.add(t.position,s),a=this.ctx.domManager.getBoundingClientRect(),o={};n.x>=0&&n.x+i.offsetWidth<=a.width&&(o.x=n.x),n.y>=0&&n.y+i.offsetHeight<=a.height&&(o.y=n.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},DY={"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 kY(e){return typeof e!="string"?"false":DY[e]}var BP=class extends Vx{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;if(e.tooltip){const n=t.t(e.tooltip);n!==this.lastTooltip&&(this.elem.title=n,this.lastTooltip=n)}let i="";if(e.icon!=null&&(i=`<span class="${Al(e.icon)} ag-charts-toolbar__icon"></span>`),e.label!=null){const n=t.t(e.label);i=`${i}<span class="ag-charts-toolbar__label">${n}</span>`}const s=kY(e.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(e){Pe(this.elem,"aria-checked",e)}},FP="ag-charts-toolbar__button--active",dI=class extends Bx{constructor({eventsHub:e,localeManager:t},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new wT,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=e,this.localeManager=t,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(e){this.ariaLabelId=e,this.updateAriaLabel()}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[i,s]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=e.length;i<t.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(FP,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(FP,e!=null&&e===t)}toggleButtonEnabledByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new le(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,n;for(const[a,o]of e.entries())i=!t&&a===0||n!=o.section,s=a===e.length-1||o.section!=e.at(a+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",a>0&&i),n=o.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:e,...t instanceof X?t.toJson():t},a=this.getButtonWidgetBounds(i),o={event:s,button:n,buttonBounds:a,buttonWidget:i};this.events.dispatch("button-pressed",o)}),i.addListener("focus",()=>{const s={button:{index:e}};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()})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},IY=class extends dI{createButtonWidget(){return new BP(this.localeManager)}},AY=class extends VP{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new le(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const n=e.position??"above",{offsetWidth:a,offsetHeight:o}=s;let r=e.y-o-i,l=e.x-a/2;n==="below"?r=e.y+i:n==="right"?(r=e.y-o/2,l=e.x+t):n==="above-left"&&(l=e.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor(ae(0,e.x,i.width-t.width)),e.y=Math.floor(ae(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},CY=class extends dI{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new AY(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new wY(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new le(i.x+t.x-s.width,i.y+t.y,i.width,i.height)}},wY=class extends Su{constructor(e){super(ye("div","ag-charts-floating-toolbar__drag-handle"));const t=new Su(ye("span",`${Al("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},LY={...k1,...I1},Bf={};Ws(Bf,{ButtonWidget:()=>Vx,MenuItemRadioWidget:()=>OP,MenuItemWidget:()=>hI,MenuWidget:()=>PP,NativeWidget:()=>Su,SliderWidget:()=>kD,ToolbarWidget:()=>Bx,WIDGET_HTML_EVENTS:()=>dT,Widget:()=>Er,WidgetEventUtil:()=>Bl});var _P={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Ig,lineDash:[0],label:{enabled:!1}}},uI={..._P,nice:!1},Vb={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},pI={style:[{stroke:{$ref:"gridLineColor"}}],width:2},NY={number:{gridLine:pI},time:{gridLine:pI},category:{gridLine:pI}},TY={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:{...uI,interval:{values:[0]}},log:{...uI},time:{...uI},category:{..._P}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Vb,position:{...Vb.position,anchorTo:"pointer"},range:"nearest"},axes:NY},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Vb},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Vb}}},HP=Ki(OY);function OY(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:HP(e.baseTheme,t)}:t}function GP(e){if(Array.isArray(e)&&e.length!==0){const t=e.find(i=>i!=null);if(typeof t=="number")return{data:e.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(s=>({x:s?.[0],y:s?.[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(e?.length===0)return{data:e,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:e}}function PY(e){switch(e?.type){case"number":{const{reverse:t,min:i,max:s}=e??{};return{type:"number",reverse:t,min:i,max:s}}case"time":{const{reverse:t,min:i,max:s}=e??{};return{type:"time",reverse:t,min:i,max:s}}case"category":default:{if(e==null)return{type:"category"};const{reverse:t,paddingInner:i,paddingOuter:s}=e;return{type:"category",reverse:t,paddingInner:i,paddingOuter:s}}}}function EY(e,t,i){const s={};return e?.stroke!=null&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),e?.strokeWidth!=null&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),e?.visible!=null&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var RY=Ki((e,t,i)=>s=>{const n=s.datum[s.xKey],a=s.datum[s.yKey],o=i==null?s.datum:s.datum[i],r=t?.renderer?.({context:e,datum:o,xValue:n,yValue:a});if(Bt(r)||gt(r)||Cs(r))return At(r);const l=r?.content??a.toFixed(2);return r?.title?{heading:void 0,title:void 0,data:[{label:r.title,value:l}]}:{heading:void 0,title:l,data:[]}});function zY(e){const{background:t,container:i,foreground:s,height:n,listeners:a,locale:o,minHeight:r,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,theme:u,data:p,crosshair:f,axis:y,min:b,max:x,tooltip:v,context:S,styleNonce:M,...D}=e,I={background:t,container:i,foreground:s,height:n,listeners:a,locale:o,minHeight:r,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,styleNonce:M},{data:k,series:[C]=[],datumKey:A}=GP(p),w=D;C!=null&&Object.assign(w,C),w.tooltip={...v,renderer:RY(S,v,A)},I.theme=HP(u,TY),I.data=k,I.series=[w];const T=w.type==="bar"&&w.direction==="horizontal",[O,z]=T?["left","bottom"]:["bottom","left"],V={...PY(y),position:O,...f==null?{}:{crosshair:f}},E={type:"number",gridLine:EY(y,!1,e),position:z,...b==null?{}:{min:b},...x==null?{}:{max:x}};return I.axes=T?{x:E,y:V}:{x:V,y:E},I}var gI=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],fI={visible:R,reverse:R,stroke:te,strokeWidth:P},Ff={context:()=>!0,tooltip:ce,theme:ce,background:ce,container:ce,width:ce,height:ce,minWidth:ce,minHeight:ce,padding:ce,listeners:ce,locale:ce,data:ce,styleNonce:L,axis:yl({number:{...fI,min:Fe(W,as("max")),max:Fe(W,os("min"))},category:{...fI,paddingInner:ne,paddingOuter:ne},time:{...fI,min:Fe(Se(W,ns),as("max")),max:Fe(Se(W,ns),os("min"))}},"axis options","category"),min:Fe(W,as("max")),max:Fe(W,os("min")),crosshair:{enabled:R,snap:R,...q,...oe},xKey:L,yKey:L};Ff.overrideDevicePixelRatio=Q(W),Ff.foreground=Q(ce);var jP={type:"preset",name:"sparkline",version:ue,options:yl({area:{...Ff,...J(yk,gI)},bar:{...Ff,...J(ju,gI)},line:{...Ff,...J(mf,gI)}},"sparkline options"),create:zY,processData:GP},VY=["top","right","bottom","left"],_f=class M_ extends sb{constructor(t,i){super(t,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new Lj}onAxisChange(t,i){super.onAxisChange(t,i),this.syncAxisChanges(t,i),this.ctx!=null&&this.ctx.zoomManager.setAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(t),s.setClipRect(t)}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 t of this.axes){const i=await this.getSyncedDomain(t);i!=null&&t.setDomains({domain:i})}}performLayout(t){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:a,visible:o}=this.updateAxes(t);this.seriesRoot.visible=o,this.seriesRect=a,this.animationRect=t.layoutBox;const{x:r,y:l}=a;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const f of[i,s])f.translationX=Math.floor(r),f.translationY=Math.floor(l);else{const{translationX:f,translationY:y}=i;Vr(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:f,translationY:y},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=a.clone().grow(this.seriesArea.getPadding()),u=this.series.some(f=>f.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:f=>this.setRootClipRects(f),onStop:()=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(u)}):this.setRootClipRects(u),this.ctx.layoutManager.emitLayoutComplete(t,{axes:N0(this.axes.map(f=>[f.id,f.getLayoutState()])),series:{visible:o,rect:a,paddedRect:c},clipSeries:n}),_2(this.series)}updateAxes(t){const{layoutBox:i,scrollbars:s}=t,{clipSeries:n,seriesRect:a,overflows:o}=this.resolveAxesLayout(i,s);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!o),this.clipAxis(r,a,i);return{clipSeries:n,seriesRect:a,visible:!o}}resolveAxesLayout(t,i){let s,n,a=0;const o=10,r=this.axes.filter(l=>l.crossAt?.value!=null);do if(n=s??this.getDefaultState(),s=this.updateAxesPass(new Map(n.axisAreaWidths),t.clone(),r,i),a++>o){K.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(s,n));return this.lastAreaWidths=s.axisAreaWidths,s}updateAxesPass(t,i,s,n){const a=new Map,o={};let r=!1,l=!1;const c=this.seriesArea.getPadding();for(const D of VY){const I=c[D]??0,k=this.axes.findLast(C=>C.position===D);k?k.seriesAreaPadding=I:i.shrink(I,D)}const h=(t.get("left")??0)+(t.get("right")??0),d=(t.get("top")??0)+(t.get("bottom")??0),u=this.buildCrossLinePadding(t),p=u.left+u.right,f=u.top+u.bottom;i.width<=h+p||i.height<=d+f?r=!0:i.shrink(u);const{scene:y}=this.ctx,b=i.clone().shrink(Object.fromEntries(t));for(const D of this.axes){const{position:I="left",direction:k}=D,C=k==="y";let A;this.sizeAxis(D,b,I),D.thickness==null?A=mI(C,y)*(D.maxThicknessRatio??1):A=D.thickness;const w={sizeLimit:A-D.label.spacing,padding:this.padding,scrollbars:n},{primaryTickCount:T,bbox:O}=D.calculateLayout(D.nice?o[k]:void 0,w);o[k]??(o[k]=T),l||(l=D.dataDomain.clipped||D.visibleRange[0]>0||D.visibleRange[1]<1),D.thickness==null&&(A=Math.min(mI(C,O)??0,A)),a.set(D.id,Math.ceil(A))}let x;s.length>0&&(x=this.calculateAxesCrossPositions(a,b,s));const v=cd(this.axes,D=>D.position??"left"),S=new Map,M=new Map;for(const[D,I]of rt(v)){let k=mI(D!=="left"&&D!=="right",y)%y.pixelRatio,C=0;for(const A of I??[]){M.set(A.id,k);const w=a.get(A.id)??0;C=Math.max(C,k+w),A.layoutConstraints.stacked&&(k+=w+M_.AxesPadding)}S.set(D,Math.ceil(C))}for(const[D,I]of rt(v))this.positionAxes({axes:I??[],position:D,axisWidths:a,axisOffsets:M,axisAreaWidths:S,axisBound:i,seriesRect:b});return x!=null&&this.applyAxisCrossing(b,x),{clipSeries:l,seriesRect:b,axisAreaWidths:S,overflows:r}}calculateAxesCrossPositions(t,i,s){const n=new Map;for(const a of s){const{crossPosition:o,visible:r}=this.calculateAxisCrossPosition(a);a.setAxisVisible(r),this.adjustAxisWidth(a,t,o,i,r),o!=null&&n.set(a.id,o)}return n}calculateAxisCrossPosition(t){const i=this.axes.perpendicular(t),{scale:{domain:s,bandwidth:n},range:a}=i,o=(n??0)/2,r=i.scale.convert(t.crossAt?.value,{clamp:!1})+o;return i.inRange(r)?{crossPosition:r,visible:!0}:t.crossAt?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(r)?a[s[0]]:Bc(r,a),visible:!0}}adjustAxisWidth(t,i,s,n,a){if(t.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager.createMemento().some(d=>{switch(d.type){case"vertical-line":return t.direction==="x";case"horizontal-line":return t.direction==="y"}}))return;const c=i.get(t.id)??0,h=a?this.calculateAxisBleedingWidth(t,c,s,n):0;i.set(t.id,h)}calculateAxisBleedingWidth(t,i,s,n){if(s==null)return i;switch(t.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(t,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==="x";s.crossAxisTranslation.x=a?0:t.x+n-s.translation.x,s.crossAxisTranslation.y=a?t.y+n-s.translation.y:0}}buildCrossLinePadding(t){var i;const s={top:0,right:0,bottom:0,left:0};for(const n of this.axes){const{position:a,label:o}=n;if(n.crossLines)for(const r of n.crossLines)r instanceof Os&&(r.position=a??"top",(i=r.label).parallel??(i.parallel=o.parallel)),r.calculatePadding?.(s)}for(const[n,a=0]of rt(s))s[n]=Math.max(a-(t.get(n)??0),0);return s}clampToOutsideSeriesRect(t,i,s,n){const a=s==="x"?t.x:t.y,o=s==="x"?t.width:t.height;return n===1?Math.min(i,a+o):Math.max(i,a)}async getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(t)}syncAxisChanges(t,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const a of t)n.delete(a);for(const a of n)s.removeAxis(a)}sizeAxis(t,i,s){const n=t instanceof Xn,a=s==="left"||s==="right",{width:o,height:r}=i,l=a?r:o;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:f,align:y}=t.layoutConstraints;f==="px"?h=c+p:h=h*p/100;const b=h-c;if(y==="end")c=l-b,h=l;else if(y==="center"){const x=c+(l-c)/2;c=x-b/2,h=x+b/2}else y==="justify"&&(h=l);a&&(n?[c,h]=[h,c]:[d,u]=[1-u,1-d]),t.range=[c,h],t.visibleRange=[d,u],t.gridLength=a?o:r,t.lineRange=a?[r,0]:[0,o]}positionAxes(t){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:a,axisAreaWidths:o,seriesRect:r,position:l}=t,c=o.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 f of i){const y=o.get(d==="x"?"left":"top")??0,b=n.get(f.id)??0,x=a.get(f.id)??0;f.gridPadding=c-x-b,f.translation[d]=s[d]+y,f.translation[h]=this.clampToOutsideSeriesRect(r,p+u*(x+b),h,u)}}shouldFlipXY(){return this.series.every(t=>t instanceof ec&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&t.set(i,s)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const s of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const a=t.axisAreaWidths.get(s);if((n!=null||a!=null)&&n!==a)return!1}return!0}clipAxis(t,i,s){const n=Math.ceil(t.gridLine?.width??0),a=Math.ceil(t.line?.width??0);let{width:o,height:r}=i;switch(o+=t.direction==="x"?n:a,r+=t.direction==="y"?n:a,t.clipGrid(i.x,i.y,o,r),t.position){case"left":case"right":t.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":t.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};_f.className="CartesianChart",_f.type="cartesian",_f.AxesPadding=15,g([_e({changeValue(e,t){this.onAxisChange(e,t)}})],_f.prototype,"axes",2);var BY=_f;function mI(e,t){return e?t?.width:t?.height}var FY=new Set(["number","log","time"]),_Y=e=>ge(e)&&e.type!=null&&!FY.has(e.type),ri={type:"chart",name:"cartesian",version:ue,options:u4,create(e,t){return new BY(e,t)},validate(e,t,i){const s=[];e?.series?.[0]?.type==="histogram"&&Object.values(e?.axes??{}).some(_Y)&&(s.push(new go("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=J(e,["axes"]));const n=Mi(e,t,i);return n.invalid.push(...s),n}},yI=class extends sb{constructor(e,t){super(e,t),this.axes=this.createChartAxes(),this.padding=new Cr(40),this.ctx.axisManager.axisGroup.zIndex=8}createChartAxes(){return new Nj}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(e=>e.type==="pie"||e.type==="donut")}async performLayout(e){const t=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=t,this.animationRect=t,this.seriesRoot.translationX=t.x,this.seriesRoot.translationY=t.y,await this.computeCircle(t);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(WP))s.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:t,paddedRect:e.layoutBox}})}updateAxes(e,t,i,s){if(this.axes.length===0)return;const n=this.axes.angle,a=this.axes.radius,o=n.scale,r=a.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,a.gridAngles=o.ticks({nice:[n.nice,n.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>o.convert(l)),a.gridRange=n.range,a.range=[s,s*r];for(const l of[n,a])l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()}async computeCircle(e){const t=this.series.filter(WP),i=(l,c,h)=>{this.updateAxes(e,l,c,h);for(const u of t)u.centerX=l,u.centerY=c,u.radius=h;const d=t.filter(u=>u.type==="donut"||u.type==="pie");if(d.length>1){const u=d.map(p=>{const f=p.getInnerRadius();return{series:p,innerRadius:f}}).sort((p,f)=>p.innerRadius-f.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=e.width/2,n=e.height/2,a=Math.max(0,Math.min(e.width,e.height)/2);let o=a;i(s,n,o);const r=async({hideWhenNecessary:l=!1}={})=>{const c=[];for(const u of mr(this.axes,t)){const p=await u.computeLabelsBBox({hideWhenNecessary:l},e);p&&c.push(p)}if(c.length===0){i(s,n,a);return}const h=le.merge(c),d=this.refineCircle(h,o,e);i(d.centerX,d.centerY,d.radius),o=d.radius};await r(),await r(),await r(),await r({hideWhenNecessary:!0}),await r({hideWhenNecessary:!0});for(const l of mr(this.axes,t))await l.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:o,centerX:s,centerY:n}}refineCircle(e,t,i){const n=-t,a=-t,o=t,r=t;let l=Math.max(0,n-e.x),c=Math.max(0,a-e.y),h=Math.max(0,e.x+e.width-o),d=Math.max(0,e.y+e.height-r);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let f=Math.min(u,p)/2;const y=.5*i.width/2,b=.5*i.height/2,x=Math.min(y,b);if(f<x){f=x;const M=l+h,D=c+d;if(2*f+D>i.height){const I=i.height-2*f;Math.min(c,d)*2>I?(c=I/2,d=I/2):c>d?c=I-d:d=I-c}if(2*f+M>i.width){const I=i.width-2*f;Math.min(l,h)*2>I?(l=I/2,h=I/2):l>h?l=I-h:h=I-l}}const v=l+2*f+h,S=c+2*f+d;return{centerX:(i.width-v)/2+l+f,centerY:(i.height-S)/2+c+f,radius:f}}};yI.className="PolarChart",yI.type="polar";function WP(e){return e instanceof iI}var Wr={type:"chart",name:"polar",version:ue,options:p4,create(e,t){return new yI(e,t)},validate(e,t,i){const s=[],n=e?.series?.[0]?.type;(n==="pie"||n==="donut")&&e?.axes&&(s.push(new Jp([],e.axes,i,"axes")),e=J(e,["axes"]));const a=Mi(e,t,i);return a.invalid.push(...s),a}};function HY({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:o=!1}){const r=e==="horizontal",l={max:r?s:i,fn:r?u=>u.width:u=>u.height,padding:r?a:n},c={max:r?i:s,fn:r?u=>u.height:u=>u.width,padding:r?n:a};let h=0;const d=[];for(;h<t.length;){const u=t.slice(h),p=GY(u,h,l,c,o);if(!p)return;h+=p.processedBBoxCount,d.push(p.pageIndices)}return WY(d,e,t,n,a)}function GY(e,t,i,s,n){let o=KY(e,i);if(o<1){if(!n)return;o=1}let r=o;for(;r>=1;){const l=jY(e,t,r,i,s,n);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l<r&&l>1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function jY(e,t,i,s,n,a){const o=[];let r=0,l=0,c=[];const h=[];for(let d=0;d<e.length;d++){const u=(d+i)%i;u===0&&(r+=l,l=0,c.length>0&&o.push(c),c=[]);const p=s.fn(e[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(e[d])+n.padding);const f=r+l,y=!a||o.length>0;if(f>n.max&&y){c=[];break}if(h.reduce((x,v)=>x+v,0)>s.max&&!a)return h.length<i?h.length:void 0;c.push(d+t)}return c.length>0&&o.push(c),o.length>0?o:void 0}function WY(e,t,i,s,n){let a=0,o=0;return{pages:e.map(l=>{t==="horizontal"&&(l=$Y(l));let c=0;const h=l.map(p=>{const f=p.map(x=>(c=Math.max(x,c),i[x]));let y=0,b=0;for(const x of f)y+=x.height+s,b=Math.max(b,x.width+n);return{indices:p,bboxes:f,columnHeight:Math.ceil(y),columnWidth:Math.ceil(b)}});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),o=Math.max(u,o),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:a,maxPageHeight:o}}function $Y(e){const t=[];for(const i of e[0])t.push([]);for(const[i,s]of e.entries())for(const[n,a]of s.entries())t[n][i]=a;return t}function KY(e,t){const i=e.length;let s=0;for(let n=0;n<i;n++)if(s+=t.fn(e[n])+t.padding,s>t.max)return i/n<2?Math.ceil(i/2):n;return i}var ip=class extends X{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([m],ip.prototype,"color",2),g([m],ip.prototype,"fontStyle",2),g([m],ip.prototype,"fontWeight",2),g([m],ip.prototype,"fontSize",2),g([m],ip.prototype,"fontFamily",2);var $r=class extends X{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};g([m],$r.prototype,"size",2),g([m],$r.prototype,"fill",2),g([m],$r.prototype,"fillOpacity",2),g([m],$r.prototype,"stroke",2),g([m],$r.prototype,"strokeWidth",2),g([m],$r.prototype,"strokeOpacity",2);var Bb=class extends X{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};g([_e({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Bb.prototype,"shape",2),g([m],Bb.prototype,"size",2),g([m],Bb.prototype,"padding",2);var Nh=class extends X{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=Ii(this),this.marker=new Bb(this),this.activeStyle=new $r,this.inactiveStyle=new $r,this.highlightStyle=new $r,this.label=new ip,this.group=new ds({name:"pagination"}),this.labelNode=new xn,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 Li,this.previousButton=new Li,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){switch(this._orientation=e,e){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:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:o,highlightActive:r}=this,l=(c,h)=>h?a:c===r?o:n;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=t===0,s=e===t-1,n=e===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(e){e=ae(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),t==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):t==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(9)}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(9)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=Wt.toCanvas(this.previousButton),t=Wt.toCanvas(this.nextButton);return{prev:e,next:t}}};Nh.className="Pagination",g([m],Nh.prototype,"marker",2),g([m],Nh.prototype,"activeStyle",2),g([m],Nh.prototype,"inactiveStyle",2),g([m],Nh.prototype,"highlightStyle",2),g([m],Nh.prototype,"label",2);var UY=class{constructor(e,t){this.dirty=!0,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=ye("p"),this.itemDescription.style.display="none",this.itemDescription.id=Ir(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:n}=e,a=t.localeManager,o=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(a,Ne(s.getItemLabel(l)),c,o),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=r.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,r.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,r.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,r)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d,r)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>n.onHover(d.sourceEvent,r)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const n=Wt.toCanvas(t);this.itemList.setBounds(n);const a=Math.max(...e.nodes().map(o=>o.getTextMeasureBBox().height));e.each((o,r)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=Wt.toCanvas(o,o.getTextMeasureBBox()),p=(a-d)/2,f={x:c-n.x,y:h-p-n.y,height:a,width:u},y=s&&l;o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(y),o.proxyButton.setPointerEvents(y?void 0:"none"),o.proxyButton.setBounds(f)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{oldPages:s,newPages:n}=e,a=(s?.length??n.length)>1,o=n.length>1;a!==o&&(o?this.createPaginationButtons(e):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(o?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:s,next:n}=i.computeCSSBounds(),a=le.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(e){const{ctx:t,pagination:i}=e;this.prevButton||(this.prevButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",s=>this.onPageButton(e,s,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",s=>this.onPageButton(e,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(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,n)=>{const[a,o]=[t[s],e[s]];return a.id!==o.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:n},a,o)=>{const r=n?.getElement();if(r!=null){const l=Ne(i.getItemLabel(a));r.textContent=this.getItemAriaText(e,l,o,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function $P(e,{itemId:t,seriesId:i,label:{text:s}},n){const a={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:n,text:Ne(s),preventDefault:()=>a.defaultPrevented=!0}};return a}var io=class extends ds{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Le({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new xn),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Li({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Kn({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),le.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let n=0,a=0;if(e.visible){const{size:o}=e,r=Li.anchor(e.shape);n=(r.x-.5)*o+i/2,a=(r.y-.5)*o,s?(e.x=0,e.y=0,e.translationX=n,e.translationY=a):(e.x=n,e.y=a,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};io.className="MarkerLabel",g([Dt("label")],io.prototype,"text",2),g([Dt("label")],io.prototype,"fontStyle",2),g([Dt("label")],io.prototype,"fontWeight",2),g([Dt("label")],io.prototype,"fontSize",2),g([Dt("label")],io.prototype,"fontFamily",2),g([Dt("label","fill")],io.prototype,"color",2),g([Xt(e=>e.layoutLabel())],io.prototype,"spacing",2),g([Xt(e=>e.layoutLabel())],io.prototype,"length",2),g([$()],io.prototype,"isCustomMarker",2);function YY(e,t){switch(typeof t.itemId){case"number":return{series:e,itemId:void 0,datum:void 0,datumIndex:t.itemId,legendItemName:t.legendItemName};case"string":return{series:e,itemId:t.itemId,datum:void 0,datumIndex:void 0,legendItemName:t.legendItemName};default:return t.itemId}}var nc=class extends X{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([m],nc.prototype,"maxLength",2),g([m],nc.prototype,"color",2),g([m],nc.prototype,"fontStyle",2),g([m],nc.prototype,"fontWeight",2),g([m],nc.prototype,"fontSize",2),g([m],nc.prototype,"fontFamily",2),g([m],nc.prototype,"formatter",2);var sp=class extends X{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};g([m],sp.prototype,"shape",2),g([m],sp.prototype,"size",2),g([m],sp.prototype,"padding",2),g([m],sp.prototype,"strokeWidth",2),g([m],sp.prototype,"enabled",2);var xI=class extends X{};g([m],xI.prototype,"strokeWidth",2),g([m],xI.prototype,"length",2);var ac=class extends X{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new sp,this.label=new nc,this.line=new xI}};g([m],ac.prototype,"maxWidth",2),g([m],ac.prototype,"paddingX",2),g([m],ac.prototype,"paddingY",2),g([m],ac.prototype,"showSeriesStroke",2),g([m],ac.prototype,"marker",2),g([m],ac.prototype,"label",2),g([m],ac.prototype,"line",2);var bI=class extends X{};g([m],bI.prototype,"legendItemClick",2),g([m],bI.prototype,"legendItemDoubleClick",2);var KP={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},UP={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},YP={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},fi=class extends X{constructor(e){super(),this.ctx=e,this.id=Ii(this),this.group=new ds({name:"legend",zIndex:16}),this.itemSelection=pi.select(this.group,io),this.containerNode=this.group.appendChild(new Ci({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 ac,this.listeners=new bI,this.enabled=!1,this.position="bottom",this.border=new Mr(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new pt,this.size=[0,0],this._visible=!0,this.pagination=new Nh(i=>e.updateService.update(i),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),t["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(e.eventsHub.on("active:load-memento",i=>this.onActiveLoadMemento(i)),e.eventsHub.on("active:update",i=>this.onActiveUpdate(i)),e.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),e.eventsHub.on("legend:change-partial",this.onLegendDataChangePartial.bind(this)),e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new UY(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){Ht(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(t=>!t.hideInLegend))}onLegendDataChangePartial(e){this.itemSelection.each(({proxyButton:t},{itemId:i})=>{if(t!=null)for(const s of e.legendData)s.itemId===i&&t.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(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}updateItemSelection(){const e=[...this.data];this.reverseOrder&&e.reverse(),this.itemSelection.update(e)}isInteractive(){const{toggleSeries:e,listeners:{legendItemClick:t,legendItemDoubleClick:i}}=this;return e||i!=null||t!=null}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:n,maxWidth:a,label:{maxLength:o=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:h}}=this.item;this.updateItemSelection();const d=[],u=et(n),f=a??e*.8,{markerWidth:y,anyLineEnabled:b}=this.calculateMarkerWidth();if(this.itemSelection.each((A,w)=>{A.fontStyle=r,A.fontWeight=l,A.fontSize=c,A.fontFamily=h;const T=this.updateMarkerLabel(A,w,y,b),O=w.itemId??w.id,z=this.getItemLabel(w),V=Ne(z,"<unknown>").replace(sr," ");A.text=this.truncate(V,o,f,T,u,O),d.push(A.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!Number.isFinite(e))return{};[e,t]=this.updateContainer(e,t);const x=this.size,v=this.oldSize;x[0]=e,x[1]=t,(x[0]!==v[0]||x[1]!==v[1])&&(v[0]=x[0],v[1]=x[1]);const{pages:S,maxPageHeight:M,maxPageWidth:D}=this.updatePagination(d,e,t),I=this.pages;this.pages=S,this.maxPageSize=[D-i,M-s];const k=this.pagination.currentPage,C=this.pages[k];return this.pages.length<1||!C?(this.visible=!1,{oldPages:I}):(this.visible=!0,this.updatePositions(k),this.update(),{oldPages:I})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0),n=!!(e.line&&t),a=this.isCustomMarker(s,e.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:a}}calcSymbolsLengths(e,t,i){const{marker:s,line:n}=this.item;let a;const{shape:o}=e.marker;if(this.isCustomMarker(t,o)){const c=new Li;c.shape=o,c.updatePath();const h=c.getBBox();a=Math.max(h.width,h.height)}const r=t?s.size:0,l=i?n.length??25:0;return{markerLength:r,lineLength:l,customMarkerSize:a}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:a,markerEnabled:o}=this.calcSymbolsEnabled(n),{markerLength:r,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,o,a);e=Math.max(e,l,c,r),t||(t=a)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,s){const{marker:n,paddingX:a}=this.item,{symbol:o}=t;let r=a;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),h=n.padding;(l||s)&&(r+=h+i);const{marker:d,line:u}=e;return d.visible=l,d.visible&&(d.shape=n.shape??o.marker.shape??"square",d.size=n.size,d.setStyleProperties(this.getMarkerStyles(Te(o)))),u.visible=s,u.visible&&u.setStyleProperties(this.getLineStyles(o)),e.length=i,e.spacing=h,e.isCustomMarker=c,r}updateContainer(e,t){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,e-=i.strokeWidth*2+i.padding.left+i.padding.right,t-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[e,t]}truncate(e,t,i,s,n,a){let o=!1;e.length>t&&(e=e.substring(0,t),o=!0);const r=Tl(e,n,i-s,o);return nr(r)?this.truncatedItems.add(a):this.truncatedItems.delete(a),r}updatePagination(e,t,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:o,maxPageWidth:r,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=a.findIndex(S=>S.endIndex>=n);this.pagination.currentPage=ae(0,h,a.length-1);const{paddingX:d,paddingY:u}=this.item,p=8,f=r-d,y=o-u;let b=0,x=-l.y-this.item.marker.size/2;c?x+=y+p:(b+=-l.x+f+p,x+=(y-l.height)/2),this.pagination.translationX=b,this.pagination.translationY=x,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((S,M,D)=>{D>(a[v]?.endIndex??1/0)&&v++,S.pageIndex=v}),{maxPageHeight:o,maxPageWidth:r,pages:a}}calculatePagination(e,t,i){const{paddingX:s,paddingY:n}=this.item,a=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:o}=Sl(this.position),r=this.getOrientation(),l=a.includes(o);let c=this.pagination.getBBox(),h=new le(0,0,0,0),d=[],u=0,p=0,f=0;const y=x=>x.width===c.width&&x.height===c.height,b=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(f++>10){K.warn("unable to find stable legend layout.");break}c=h;const x=t-(l?0:c.width),v=i-(l?c.height:0),S=HY({orientation:r,bboxes:e,maxHeight:v,maxWidth:x,itemPaddingY:n,itemPaddingX:s,forceResult:b});d=S?.pages??[],u=S?.maxPageWidth??0,p=S?.maxPageHeight??0;const M=d.length;if(this.pagination.visible=M>1,this.pagination.totalPages=M,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!y(h));return{maxPageWidth:u,maxPageHeight:p,pages:d,paginationBBox:h,paginationVertical:l}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:n,startIndex:a,endIndex:o}=s[e];let r=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+t,p=[];i.each((f,y,b)=>{if(b<a||b>o){f.visible=!1;return}const x=b-a;let v,S;d?(v=x%c,S=Math.floor(x/c)):(v=Math.floor(x/h),S=x%h),f.visible=!0;const M=n[v];M&&(l=Math.floor(u*S),r=Math.floor(p[S]??0),p[S]=(p[S]??0)+M.columnWidth,f.translationX=r,f.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:n}=this,{startIndex:a,endIndex:o}=n[e];a===0?this.paginationTrackingIndex=0:e===n.length-1?this.paginationTrackingIndex=o:this.paginationTrackingIndex=Math.floor((a+o)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:this.isInteractive()}),this.ctx.updateService.update(9)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){const e=this.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-series-visibility",e),this.ctx.contextMenuRegistry.toggle("toggle-other-series",e)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=e.line??{},a=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??a,lineDash:n}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:a,lineDash:o,lineDashOffset:r}=e,l=Math.min(2,a??1);return jn(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),Wa(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),ck({fill:t,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:r},KP,UP,YP)}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:a,padding:o}=this,r=typeof o=="number";return ck({cornerRadius:s,fill:n,fillOpacity:a,padding:{top:r?o:o.top??0,right:r?o:o.right??0,bottom:r?o:o.bottom??0,left:r?o:o.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0},KP,UP,YP)}computePagedBBox(){const e=Le.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[s,n]=this.maxPageSize;e.height=Math.max(n,e.height),e.width=Math.max(s,e.width)}const{strokeWidth:t,padding:i}=this.getContainerStyles();return e.grow(i).grow(t),e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===e.itemId)[0]??{};if(t===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i),this.clearHighlight()}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum),this.clearHighlight()}onContextClick(e,t){if(this.checkInteractionState())return;const{sourceEvent:i}=e,s=t.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:o,offsetY:r}=i,{x:l,y:c}=Wt.toCanvasPoint(t,o,r);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:l,canvasY:c},{legendItem:s})}onClick(e,t,i){this.checkInteractionState()||this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:n},preventHidingAll:a,toggleSeries:o}=this;if(!t)return!1;const{legendType:r,seriesId:l,itemId:c,enabled:h,legendItemName:d}=t,u=n.series.find(y=>y.id===l);if(!u)return!1;let p=h;const f=$P("click",t,e);return s&&ls([u.properties,this.ctx.chartService],s,f.apiEvent),f.defaultPrevented||(o&&(p=!h,a&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.eventsHub.emit("legend:item-click",{legendType:r,series:u,itemId:c,enabled:p,legendItemName:d})),this.updateHighlight(p,t,u),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.checkInteractionState()||this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!t)return!1;const{legendType:a,id:o,itemId:r,seriesId:l}=t,c=s.series.find(d=>d.id===o);if(!c)return!1;const h=$P("dblclick",t,e);if(i&&ls([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(y=>y.getLegendData("category"));let u=0;const p=new Set;for(const y of d)y.enabled&&(u+=1,y.legendItemName!=null&&p.add(y.legendItemName));p.size>0&&(u=p.size);const f=d.find(y=>y.itemId===r&&y.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:a,series:c,itemId:r,numVisibleItems:u,enabled:f?.enabled??!1,legendItemName:f?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=Wt.toCanvas(t).computeCenter():(e.preventDefault(),i=Wt.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(this.checkInteractionState())return;if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.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(e,t);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(e,t,i,s){const n=o=>{if(o===void 0)this.ctx.activeManager.clear();else{const r=o.nodeDatum.series.id,l=o.itemId;this.ctx.activeManager.update({type:"legend",seriesId:r,itemId:l},void 0)}this.ctx.highlightManager.updateHighlight(this.id,o?.nodeDatum)},a=o=>{this.ctx.interactionManager.isState(64)||s?.initialState?n(o):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{n(o)}):o===void 0&&n(o)};if(e===!0&&i!==void 0&&t!==void 0){const o=t.itemId,r=YY(i,t);a({itemId:o,nodeDatum:r})}else a(void 0)}onActiveUpdate(e){e?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id,void 0)}onActiveLoadMemento(e){const{activeItem:t}=e;if(t?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id,void 0);const i=this.data.find(n=>n.seriesId===t.seriesId&&n.itemId===t.itemId),s=this.ctx.chartService.series.find(n=>n.id===t.seriesId);if(s===void 0)K.warn(`Cannot find seriesId: "${t.seriesId}"`),e.reject();else if(i===void 0){const n=JSON.stringify({seriesId:t.seriesId,itemId:t.itemId});K.warn(`cannot find legend item: ${n}`),e.reject()}else this.updateHighlight(i.enabled,i,s,e)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{placement:t,floating:i,xOffset:s,yOffset:n}=Sl(this.position),a=i?new le(0,0,e.width,e.height):e.layoutBox,{x:o,y:r,width:l,height:c}=a,[h,d]=this.calculateLegendDimensions(a),{oldPages:u}=this.calcLayout(h,d),p=this.computePagedBBox();if(this.visible){let y=function(S){};var f=y;const b=this.spacing;let x,v;switch(t){case"top":x=(l-p.width)/2,v=0;break;case"bottom":x=(l-p.width)/2,v=c-p.height;break;case"right":x=l-p.width,v=(c-p.height)/2;break;case"left":x=0,v=(c-p.height)/2;break;case"top-right":case"right-top":x=l-p.width,v=0;break;case"top-left":case"left-top":x=0,v=0;break;case"bottom-right":case"right-bottom":x=l-p.width,v=c-p.height;break;case"bottom-left":case"left-bottom":x=0,v=c-p.height;break;default:y(t)}if(!i){let S,M;switch(t){case"top":case"top-right":case"top-left":S=p.height+b,M="top";break;case"bottom":case"bottom-right":case"bottom-left":S=p.height+b,M="bottom";break;case"left":case"left-top":case"left-bottom":S=p.width+b,M="left";break;case"right":case"right-top":case"right-bottom":S=p.width+b,M="right";break;default:y(t)}a.shrink(S,M)}x+=s,v+=n,this.group.translationX=Math.floor(o+x-p.x),this.group.translationY=Math.floor(r+v-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(e){const{ctx:t,itemSelection:i,pagination:s,pages:n,group:a}=this,o=this.visible&&this.enabled,r=this.isInteractive();this.domProxy.update({visible:o,interactive:r,ctx:t,itemSelection:i,group:a,pagination:s,oldPages:e,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,{placement:s}=Sl(this.position),n=t/i,a=.5,o=.2,r=.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,o*(1/n)):o;l=this.maxWidth?Math.min(this.maxWidth,t):t,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,r*n):r;l=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*d),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(e,t){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],e,t)}};fi.className="Legend",g([m],fi.prototype,"toggleSeries",2),g([m],fi.prototype,"pagination",2),g([m],fi.prototype,"item",2),g([m],fi.prototype,"listeners",2),g([Xt((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:n}}=e;i===!1&&t===!0&&n.restoreState(s)}),m],fi.prototype,"enabled",2),g([m],fi.prototype,"position",2),g([m],fi.prototype,"maxWidth",2),g([m],fi.prototype,"maxHeight",2),g([m],fi.prototype,"reverseOrder",2),g([m],fi.prototype,"orientation",2),g([m],fi.prototype,"preventHidingAll",2),g([m],fi.prototype,"border",2),g([m],fi.prototype,"cornerRadius",2),g([m],fi.prototype,"fill",2),g([m],fi.prototype,"fillOpacity",2),g([m],fi.prototype,"padding",2),g([m],fi.prototype,"spacing",2),g([m],fi.prototype,"xOffset",2),g([m],fi.prototype,"yOffset",2);var vI={type:"plugin",name:"legend",version:ue,options:{enabled:R,position:Id,orientation:U("horizontal","vertical"),maxWidth:P,maxHeight:P,spacing:P,border:cr,cornerRadius:W,padding:bl,fill:ws,fillOpacity:ne,preventHidingAll:R,reverseOrder:R,toggleSeries:R,item:{marker:{size:P,shape:hr,padding:P,strokeWidth:P},line:{length:P,strokeWidth:P},label:{maxLength:P,formatter:ot,...$e},maxWidth:P,paddingX:P,paddingY:P,showSeriesStroke:R},pagination:{marker:{size:P,shape:hr,padding:P},activeStyle:{...se,...q},inactiveStyle:{...se,...q},highlightStyle:{...se,...q},label:$e},listeners:{legendItemClick:ot,legendItemDoubleClick:ot}},themeTemplate:{...My,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"left-top"]},{$eq:[{$path:"./position"},"left-bottom"]},{$eq:[{$path:"./position"},"right"]},{$eq:[{$path:"./position"},"right-top"]},{$eq:[{$path:"./position"},"right-bottom"]},{$eq:[{$path:"./position/placement"},"left"]},{$eq:[{$path:"./position/placement"},"left-top"]},{$eq:[{$path:"./position/placement"},"left-bottom"]},{$eq:[{$path:"./position/placement"},"right"]},{$eq:[{$path:"./position/placement"},"right-top"]},{$eq:[{$path:"./position/placement"},"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:ki.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:e=>{const t=new fi(e);return t.attachLegend(e.scene),t}},np=class extends Xn{getVisibleDomain(e){const[t,i]=e,[s,n]=this.visibleRange;if(e.length<2)return[t,i];const a=Math.min(t,i),o=Math.max(t,i);if(a>=0){const r=Math.log(t),c=Math.log(i)-r;return[Math.exp(r+s*c),Math.exp(r+n*c)]}if(o<=0){const r=-Math.log(-t),c=-Math.log(-i)-r;return[-Math.exp(-(r+s*c)),-Math.exp(-(r+n*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:o}=Gc(e.domain,t,i,s,n,void 0,e.sortMetadata?.sortOrder);return a[0]<0&&a[1]>0||e.domain[0]<0&&e.domain[1]>0?(K.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:o}):a[0]===0||a[1]===0||e.domain[0]===0||e.domain[1]===0?(K.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:o}):{domain:a,clipped:o}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new Vk)}};np.className="LogAxis",np.type="log";var ZY=10;function Fb(e,t,i,s,n,a,o){const r=e[a];if(r===void 0)return-1;const l=Number.isFinite(t)?Bn(r,t,i,o):_c(a,e.length),c=Mg(l,n);return a===s[c+Ys]||a===s[c+Zs]||a===s[c+Xs]||a===s[c+qs]?c:-1}function ZP(e,t,i,s,n,a,o,r,l){let c=0,h=0,d=-1;for(let b=0;b<o;b++){const x=Fb(e,t,i,s,n,b,a);x!==-1&&(c++,x!==d&&(h++,d=x))}h++;const u=r?.length===c?r:new Uint32Array(c),p=l?.length===h?l:new Uint32Array(h);let f=0,y=0;d=-1;for(let b=0;b<o;b++){const x=Fb(e,t,i,s,n,b,a);x!==-1&&(x!==d&&(p[y++]=f,d=x),u[f++]=b)}return p[y]=c-1,{indices:u,metaIndices:p}}function SI(e,t,i,s){const n=t.length;if(n<bo)return;const[a,o]=e,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:c}=s;let h=vo(t,a,o,{xNeedsValueOf:r});const d=c?.find(x=>x.maxRange===h);let{indexData:u,valueData:p}=So(t,i,i,a,o,h,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),{indices:f,metaIndices:y}=ZP(t,a,o,u,h,r,n,d?.indices,d?.metaIndices);const b=[{maxRange:h,metaIndices:y,indices:f,indexData:u,valueData:p}];for(;f.length>ZY&&h>br;){const x=h,v=Math.trunc(x/2),S=c?.find(z=>z.maxRange===v),M=kl(u,p,x,{reuseIndexData:S?.indexData,reuseValueData:S?.valueData});h=M.maxRange,u=M.indexData,p=M.valueData;const D=f;let I=0,k=0,C=-1;for(const z of D){const V=Fb(t,a,o,u,h,z,r);V!==-1&&(I++,V!==C&&(k++,C=V))}k++;const A=S?.indices?.length===I?S.indices:new Uint32Array(I),w=S?.metaIndices?.length===k?S.metaIndices:new Uint32Array(k);let T=0,O=0;C=-1;for(const z of D){const V=Fb(t,a,o,u,h,z,r);V!==-1&&(V!==C&&(w[O++]=T,C=V),A[T++]=z)}w[O]=I-1,f=A,y=w,b.push({maxRange:h,metaIndices:y,indices:f,indexData:u,valueData:p})}return b.reverse(),b}function XY(e,t,i,s){const n=t.length;if(n<bo)return;const[a,o]=e,{xNeedsValueOf:r,yNeedsValueOf:l,targetRange:c,existingFilters:h}=s,d=vo(t,a,o,{xNeedsValueOf:r}),u=Math.min(d,Fc(Math.max(c,br))),p=h?.find(M=>M.maxRange===u),{indexData:f,valueData:y}=So(t,i,i,a,o,u,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),{indices:b,metaIndices:x}=ZP(t,a,o,f,u,r,n,p?.indices,p?.metaIndices),v={maxRange:u,indices:b,metaIndices:x,indexData:f,valueData:y};function S(){return SI([a,o],t,i,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:h})?.filter(D=>D.maxRange!==u)??[]}return{immediate:[v],computeRemaining:S}}function qY(e,t,i,s,n,a){const[o,r]=oi(e,s);return SI([o,r],t,i,{xNeedsValueOf:n,yNeedsValueOf:a})}var QY=Ar(qY);function JY(e,t,i,s,n,a){const o=t.resolveKeysById(n,"xValue",i),r=t.resolveColumnById(n,s,i),l=t.getDomain(n,"xValue","key",i),c=t.resolveColumnNeedsValueOf(n,"xValue",i),h=t.resolveColumnNeedsValueOf(n,s,i);if(a){const[d,u]=oi(e,l);return SI([d,u],o,r,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:a})}return QY(e,o,r,l,c,h)}function e5(e,t,i,s,n,a,o){const r=t.resolveKeysById(n,"xValue",i),l=t.resolveColumnById(n,s,i),c=t.getDomain(n,"xValue","key",i),h=t.resolveColumnNeedsValueOf(n,"xValue",i),d=t.resolveColumnNeedsValueOf(n,s,i),[u,p]=oi(e,c);return XY([u,p],r,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:a,existingFilters:o})}var li=class extends eo{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 Ml,this.shadow=new Bo,this.marker=new sn,this.label=new Yn,this.tooltip=Lh(),this.connectMissingData=!1}};g([m],li.prototype,"xKey",2),g([m],li.prototype,"xName",2),g([m],li.prototype,"yKey",2),g([m],li.prototype,"yName",2),g([m],li.prototype,"yFilterKey",2),g([m],li.prototype,"stackGroup",2),g([m],li.prototype,"normalizedTo",2),g([m],li.prototype,"fill",2),g([m],li.prototype,"fillOpacity",2),g([m],li.prototype,"stroke",2),g([m],li.prototype,"strokeWidth",2),g([m],li.prototype,"strokeOpacity",2),g([m],li.prototype,"lineDash",2),g([m],li.prototype,"lineDashOffset",2),g([m],li.prototype,"interpolation",2),g([m],li.prototype,"styler",2),g([m],li.prototype,"shadow",2),g([m],li.prototype,"marker",2),g([m],li.prototype,"label",2),g([m],li.prototype,"tooltip",2),g([m],li.prototype,"connectMissingData",2);var t5=.125,i5=.25,MI=class extends ec{constructor(e){super({moduleCtx:e,propertyKeys:Ju,propertyNames:ep,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:tI({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:wh,datum:(t,i)=>({...Ib(t),...zf(t,i)})},clipFocusBox:!1}),this.properties=new li,this.connectsToYAxis=!0,this.aggregationManager=new Tb,this.backgroundGroup=new Le({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const e=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||e&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Hk||this.contextNodeData.strokeData.spans.length>Hk)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.backgroundGroup.remove()}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){e.remove(),t.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(e){const i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(e,i)}setZIndex(e){super.setZIndex(e),this.isStacked()?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1])}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:a,yKey:o,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),y=n>1||c!=null,b={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},x={invalidValue:null};(Mt(c)||l)&&n>1&&(x.invalidValue=0),i||(x.forceValue=0);const v=this.properties.allowNullKeys??!1,S=[Hl(a,p,{id:"xValue",allowNullKey:v}),Lt(o,f,{id:"yValueRaw",...x}),...r==null?[]:[Lt(r,f,{id:"yFilterRaw"})]];y&&S.push(...nf(o,"normal",{id:"yValueCumulative",...x,groupId:b.marker},f)),Mt(c)&&S.push(Lt(o,f,{id:"yValue",...x,groupId:b.value}),Wx(Object.values(b),c)),h&&S.push(of());const{dataModel:M,processedData:D}=await this.requestDataModel(e,t,{props:S,groupByKeys:y,groupByData:!y});this.aggregateData(M,D),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:s}=this;if(!t||!i)return{domain:[]};const n=s.y;if(e==="x"){const o=t.resolveProcessedDataDefById(this,"xValue"),r=t.getDomain(this,"xValue","key",i);return o?.def.type==="key"&&o.def.valueType==="category"?r:{domain:bn(Ga(r.domain))}}const a=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(n instanceof Xn&&!(n instanceof np)){const o=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:bn(o)}}else return{domain:bn(a)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t);return[Math.min(i,0),Math.max(s,0)]}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),va(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>e5(i.scale.type,e,t,this.yCumulativeKey(t),this,s,a),computeFull:a=>JY(i.scale.type,e,t,this.yCumulativeKey(t),this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ha.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(e){const{indices:t,metaIndices:i}=e,{visible:s,axes:n,dataModel:a,processedData:o,seriesBelowStackContext:r}=this,l=n.x,c=n.y;if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],r;if(l==null||c==null||a==null||o==null)return;const{scale:h}=l,{scale:d}=c,u=(h.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,f=o.invalidData?.get(this.id),y=a.resolveKeysById(this,"xValue",o),b=a.resolveColumnById(this,this.yCumulativeKey(o),o);let[x,v]=rf(1,i.length-1,l.range,k=>{const C=i[k],A=i[k+1],w=t[C],T=t[A],O=y[w],z=y[T],{0:V}=this.xCoordinateRange(O,0),{1:E}=this.xCoordinateRange(z,0);return[V,E]});x=Math.max(x-1,0),v=Math.min(v+1,i.length-1);let S=[];if(r?.fillSpans)S=r?.fillSpans;else for(let k=x;k<v;k+=1){const C=i[k],A=i[k+1],w=t[C],T=t[A],O=y[w],z=y[T],V={type:"linear",moveTo:!1,x0:h.convert(O)+u,y0:d.convert(0),x1:h.convert(z)+u,y1:d.convert(0)};S.push({span:V,xValue0:O,xValue1:z,yValue0:0,yValue1:0})}this.phantomSpans=S;const M=[],D=[];let I=0;for(let k=x;k<v;k+=1){const C=i[k],A=i[k+1],w=t[C],T=t[A],O=!p&&this.hasInvalidDatumsInRange(f,b,w,T),z=S[I++];if(O){M.push(z),D.push(z);continue}const V=[];for(let Y=C;Y<=A;Y++){const Z=t[Y];if(f?.[Z])continue;const ie=b[Z];if(!Number.isFinite(ie))continue;const ee=y[Z];V.push({point:{x:h.convert(ee)+u,y:d.convert(ie)},xDatum:ee,yDatum:ie})}if(V.length<2){M.push(z),D.push(z);continue}const E=V[0],_=V.at(-1),G=V.slice(1,-1).map(Y=>Y.point),F={span:{type:"multi-line",moveTo:!1,x0:E.point.x,y0:E.point.y,x1:_.point.x,y1:_.point.y,midPoints:G},xValue0:E.xDatum,xValue1:_.xDatum,yValue0:E.yDatum,yValue1:_.yDatum};M.push(F),D.push(F)}return this.fillSpans=M,this.strokeSpans=D,{stack:[],fillSpans:M,strokeSpans:D}}hasInvalidDatumsInRange(e,t,i,s){const n=Math.min(i,s),a=Math.max(i,s);for(let o=n;o<=a;o++){if(e?.[o])return!0;const r=t[o];if(!Number.isFinite(r))return!0}return!1}stackYValueData(){const{visible:e,axes:t,dataModel:i,processedData:s,seriesBelowStackContext:n,properties:a}=this,o=t.x,r=t.y;if(o==null||r==null||i==null||s==null)return;const{interpolation:l}=a,{scale:c}=o,{scale:h}=r,d=(c.bandwidth??0)/2;let u=i.resolveKeysById(this,"xValue",s),p=i.resolveColumnById(this,this.yValueKey(),s);const f=!this.isStacked()&&this.properties.connectMissingData,y=s.invalidKeys?.get(this.id),x=(f?s.invalidData?.get(this.id):void 0)??y;x!=null&&(u=u.filter((T,O)=>x[O]===!1),p=p.filter((T,O)=>x[O]===!1));let[v,S]=rf(1,u.length,o.range,T=>this.xCoordinateRange(u[T],0));v=Math.max(v-2,0),S=Math.min(S+2,u.length);let M;if(n?.fillSpans)M=n?.fillSpans;else{const T=[];for(let O=v;O<S;O+=1){const z=u[O];T.push({point:{x:c.convert(z)+d,y:h.convert(0)},xDatum:z,yDatum:0})}M=Tf(T,{type:"linear"})}if(this.phantomSpans=M,!e)return this.fillSpans=M,this.strokeSpans=[],n;let D=n?.stack;if(D==null){D=[];for(let T=v;T<S-1;T+=1)D.push({leading:0,trailing:0,dataValid:!0,breakBefore:!1})}const I=D.slice();let k=!1;for(let T=0;T<I.length;T+=1){const O=v+T,z=v+T+1;let{leading:V,trailing:E,breakBefore:_}=D[T];const G=p[O],B=p[z],F=!Number.isFinite(G),Y=!Number.isFinite(B),Z=!F&&!Y;Z&&(V+=G,E+=B),T!==0&&Z!==k&&(_=!0),k=Z,I[T]={leading:V,trailing:E,dataValid:Z,breakBefore:_}}const C=[],A=[],w=[];for(let T=0;T<I.length;T+=1){const{leading:O,dataValid:z,breakBefore:V}=I[T],E=v+T;if(V){if(w.length!==0){const _=I[T-1],G={point:{x:c.convert(u[E])+d,y:h.convert(_.trailing)},xDatum:u[E],yDatum:_.trailing};w.push(G);const B=Tf(w,l);C.push(...B),A.push(...B)}w.length=0}if(z){const _={point:{x:c.convert(u[E])+d,y:h.convert(O)},xDatum:u[E],yDatum:O};w.push(_)}else C.push(M[T])}if(w.length!==0){const T=I.at(-1),O=v+I.length,z={point:{x:c.convert(u[O])+d,y:h.convert(T.trailing)},xDatum:u[O],yDatum:T.trailing};w.push(z);const V=Tf(w,l);C.push(...V),A.push(...V),w.length=0}return this.fillSpans=C,this.strokeSpans=A,{stack:I,fillSpans:C,strokeSpans:A}}createStackContext(){const e=this.axes.x;if(e==null)return;const{scale:t}=e,[i,s]=t.range,n=Math.abs(s-i);this.aggregationManager.ensureLevelForRange(n);const a=this.aggregationManager.getFilterForRange(n);return a?this.stackAggregatedData(a):this.stackYValueData()}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const{xKey:n,xName:a,yFilterKey:o,yKey:r,yName:l,legendItemName:c,marker:h,label:d,fill:u,stroke:p,normalizedTo:f}=this.properties,y=e.scale,b=t.scale,{isContinuousY:x}=this.getScaleInformation({xScale:y,yScale:b}),v=s.type==="grouped",[S,M]=y.range,D=Math.abs(M-S);this.aggregationManager.ensureLevelForRange(D);const I=this.aggregationManager.getFilterForRange(D),k=this.contextNodeData?.nodeData,C=k!=null&&this.canIncrementallyUpdateNodes(I!=null);return{xAxis:e,yAxis:t,rawData:s.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:v?i.resolveColumnById(this,"yValueCumulative",s):i.resolveColumnById(this,"yValueRaw",s),yFilterValues:o==null?void 0:i.resolveColumnById(this,"yFilterRaw",s),invalidData:s.invalidData?.get(this.id),xScale:y,yScale:b,xOffset:(y.bandwidth??0)/2,yOffset:0,indices:I?.indices,isContinuousY:x,labelsEnabled:d.enabled,normalizedTo:f,canIncrementallyUpdate:C,animationEnabled:!this.ctx.animationManager.isSkipped(),xKey:n,yKey:r,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("y").domain,nodes:C?k:[],labelData:[],nodeIndex:0,crossFiltering:!1}}computeMarkerCoordinate(e,t){let i;(Mt(e.normalizedTo)?e.isContinuousY&&Uc(t.yDatum):!Number.isNaN(t.yDatum))&&(i=t.yCumulative),t.x=e.xScale.convert(t.xDatum)+e.xOffset,t.y=e.yScale.convert(i),Number.isFinite(t.x)||(t.validPoint=!1)}handleDatum(e,t,i){if(t.xDatum=e.xValues[i],!(t.xDatum===void 0&&!this.properties.allowNullKeys)){if(t.datum=e.rawData[i],t.yDatum=e.yRawValues[i],t.yCumulative=+e.yCumulativeValues[i],t.validPoint=Number.isFinite(t.yDatum)&&e.invalidData?.[i]!==!0,this.computeMarkerCoordinate(e,t),t.selected=e.yFilterValues==null?void 0:e.yFilterValues[i]===t.yDatum,t.selected===!1&&(e.crossFiltering=!0),t.validPoint){if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const n=e.nodes[e.nodeIndex];n.datum=t.datum,n.datumIndex=i,n.midPoint={x:t.x,y:t.y},n.cumulativeValue=t.yCumulative,n.yValue=t.yDatum,n.xValue=t.xDatum,n.point={x:t.x,y:t.y,size:e.markerSize},n.selected=t.selected}else e.nodes.push({series:this,datum:t.datum,datumIndex:i,midPoint:{x:t.x,y:t.y},cumulativeValue:t.yCumulative,yValue:t.yDatum,xValue:t.xDatum,yKey:e.yKey,xKey:e.xKey,point:{x:t.x,y:t.y,size:e.markerSize},fill:e.markerFill,stroke:e.markerStroke,strokeWidth:e.markerStrokeWidth,selected:t.selected});e.nodeIndex++}if(e.labelsEnabled&&t.validPoint){const s=this.getLabelText(t.yDatum,t.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:t.yDatum,datum:t.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName});e.labelData.push({series:this,datum:t.datum,datumIndex:i,x:t.x,y:t.y,labelText:s})}}}populateNodeData(e){const t={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",e.xAxis.range,e.indices);i=Math.max(i-2,0),s=Math.min(s+2,e.indices?.length??e.xValues.length),this.processedData.input.count<1e3&&(i=0,s=this.processedData.input.count);for(let n=i;n<s;n+=1){const a=e.indices?.[n]??n;this.handleDatum(e,t,a)}}initializeResult(e){const{visibleSameStackCount:t}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return{itemId:e.yKey,fillData:{spans:this.fillSpans,phantomSpans:this.phantomSpans},strokeData:{spans:this.strokeSpans},labelData:e.labelData,nodeData:e.nodes,scales:this.calculateScaling(),visible:this.visible,stackVisible:t>0,crossFiltering:e.crossFiltering,styles:wb(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){return t.segments=yb(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene,!1),t}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t,i],visible:s,animationEnabled:n}=e,a=this.contextNodeData?.crossFiltering===!0,o=this.contextNodeData?.segments,r=re(this.getHighlightStyle(),this.getStyle()),{strokeWidth:l,stroke:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,fill:p,fillOpacity:f,opacity:y}=r;i.setProperties({segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:c,strokeWidth:l,strokeOpacity:h*(a?i5:1),lineDash:d,lineDashOffset:u,opacity:y,visible:s||n}),i.datum=o,t.setStyleProperties({fill:p,stroke:void 0,fillOpacity:f*(a?t5:1)},this.getShapeFillBBox()),t.setProperties({segments:o,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:y,visible:s||n}),t.datum=o,Lb(this,i),Lb(this,t)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),yP(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),$k(s,i),s.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{contextNodeData:s,processedData:n,axes:a,properties:o}=this,{marker:r,styler:l}=o,c=l?this.getStyle().marker:void 0,h=s?.crossFiltering===!0||Qk(n.input.count,a.x.scale,r,c);r.isDirty()&&(i.clear(),i.cleanup());const d=h?t:[];return va(this.processedData)?i.update(d,void 0,u=>us(u.xValue)):i.update(d)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();t.each((a,o)=>{if(!t.isGarbage(a)){const r=this.getHighlightState(n,e.isHighlight,o.datumIndex),l=this.getStyle(r),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,o.datumIndex,l.marker);o.style=this.getMarkerStyle(s,o,u,{isHighlight:i,highlightState:r},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,n=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(s,e.drawingMode);i.each((r,l)=>{const c=this.getHighlightState(a,s,l.datumIndex),h=l.style??t.styles[c];this.applyMarkerStyle(h,r,l.point,n,{selected:l.selected}),r.drawingMode=this.resolveMarkerDrawingModeForState(o,h)}),s||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((n,a)=>{const o=Ch(this,a,s,this.properties.label,t,i),{enabled:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=o;r&&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(t,a.datumIndex).opacity??1,n.setBoxing(o)):n.visible=!1})}makeStylerParams(e){const{id:t}=this,{marker:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}=this.properties,u=ku(e??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:o,seriesId:t,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}}makeItemStylerParams(e,t,i,s){const{xKey:n,yKey:a}=this.properties,o=e.resolveKeysById(this,"xValue",t)[i],r=e.resolveColumnById(this,"yValueRaw",t)[i],l=e.getDomain(this,"xValue","key",t).domain,c=e.getDomain(this,this.yCumulativeKey(t),"value",t).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...WD(o,r,n,a,l,c),xValue:o,yValue:r,...s,fill:h}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,tooltip:h,legendItemName:d}=a,u=a.allowNullKeys??!1,p=n.x,f=n.y;if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data?.[e],b=i.resolveKeysById(this,"xValue",s)[e],x=i.resolveColumnById(this,"yValueRaw",s)[e];if(b===void 0&&!u)return;const v=this.getStyle(),S=this.makeItemStylerParams(i,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:y},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",b,y,o,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",x,y,l,d),missing:hh(x)}]},{seriesId:t,datum:y,title:c,xKey:o,xName:r,yKey:l,yName:c,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,marker:o}=this.getStyle(),r=!o.enabled||o.fill==null,l=r?e:o.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:o.size,shape:o.shape,fill:l,fillOpacity:r?i:o.fillOpacity,stroke:o.stroke}),enabled:o.enabled||n<=0},line:{enabled:!0,stroke:t,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:e,id:t,itemId:n,legendItemName:o,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??a??n},symbol:this.legendItemSymbol(),hideInLegend:!r}]}resetDatumAnimation(e){Ab([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),Jk(this,a,...n),Xi([t],zf),qk(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),ti(this,"labels",a,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:o}=e,[r,l]=a;if(n.visible===!1&&o?.visible===!1||r==null&&l==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||o==null){c(),Rf(this,t,"added",this.getAnimationDrawingModes(),i),eI(this,"fill_path_properties",t,"add",r),eI(this,"stroke_path_properties",t,"add",l),ti(this,"labels",t,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const d=oY(n,o);if(d===void 0){h();return}else if(d.status==="no-op")return;Rf(this,t,void 0,this.getAnimationDrawingModes(),i),ui(this.id,"fill_path_properties",t,[r],d.fill.pathProperties),Ob(this.id,"fill_path_update",t,[r],d.fill.path),ui(this.id,"stroke_path_properties",t,[l],d.stroke.pathProperties),Ob(this.id,"stroke_path_update",t,[l],d.stroke.path),ti(this,"labels",t,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 Li}getStyle(e){const{styler:t,marker:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c}=this.properties,{size:h,shape:d,fill:u="transparent",fillOpacity:p}=i;let f={};if(t){const y=this.makeStylerParams(e),b=this.cachedCallWithContext(t,y)??{};f=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],b,{pick:!1})??{}}return f.marker??(f.marker={}),{fill:f.fill??s,fillOpacity:f.fillOpacity??n,lineDash:f.lineDash??a,lineDashOffset:f.lineDashOffset??o,stroke:f.stroke??r,strokeOpacity:f.strokeOpacity??l,strokeWidth:f.strokeWidth??c,marker:{enabled:f.marker.enabled??i.enabled,fill:f.marker.fill??u,fillOpacity:f.marker.fillOpacity??p,shape:f.marker.shape??d,size:f.marker.size??h,lineDash:f.marker.lineDash??i.lineDash??a,lineDashOffset:f.marker.lineDashOffset??i.lineDashOffset??o,stroke:f.marker.stroke??i.stroke??r,strokeOpacity:f.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:f.marker.strokeWidth??i.strokeWidth??c}}}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,t.marker);return this.getMarkerStyle(this.properties.marker,e,i,{isHighlight:!0},void 0,t)}isPointInArea(e,t){let i;for(const s of this.backgroundGroup.children())if(s instanceof Ai){i=s;break}return i?.getBBox().containsPoint(e,t)?i.isPointInPath(e,t):!1}computeFocusBounds(e){return Cb(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};MI.className="AreaSeries",MI.type="area";var s5={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Mo,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",Ba],["pattern",tt]]},stroke:{$palette:"stroke"}},label:{...Ye,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:Nd,segmentation:vl}},DI={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:ue,dependencies:[ri],options:yk,predictAxis:kf,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:s5,create:e=>new MI(e)},n5=.001,kI=class extends Ci{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(e,t,i,s,n,a,o,r,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(e,t,i,s,n,a,o,r)}get feathered(){return Math.abs(this.featherRatio)>n5}isPointInPath(e,t){return this.feathered?this.getBBox().containsPoint(e,t):super.isPointInPath(e,t)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:e,borderPath:t,__direction:i,__featherRatio:s,__x:n,__y:a,__width:o,__height:r}=this;if(e.clear(),t.clear(),i==="x"){const l=Math.abs(s)*o;s>0?(e.moveTo(n,a),e.lineTo(n+o-l,a),e.lineTo(n+o,a+r/2),e.lineTo(n+o-l,a+r),e.lineTo(n,a+r),e.closePath()):(e.moveTo(n+l,a),e.lineTo(n+o,a),e.lineTo(n+o,a+r),e.lineTo(n+l,a+r),e.lineTo(n,a+r/2),e.closePath())}else{const l=Math.abs(s)*r;s>0?(e.moveTo(n,a+l),e.lineTo(n+o/2,a),e.lineTo(n+o,a+l),e.lineTo(n+o,a+r),e.lineTo(n,a+r),e.closePath()):(e.moveTo(n,a),e.lineTo(n+o,a),e.lineTo(n+o,a+r-l),e.lineTo(n+o/2,a+r),e.lineTo(n,a+r-l),e.closePath())}}renderStroke(e){if(!this.feathered){super.renderStroke(e);return}const{__stroke:t,__strokeWidth:i,__lineDash:s,__lineDashOffset:n,__lineCap:a,__lineJoin:o,path:r}=this;if(t&&i){const{globalAlpha:l}=e;this.applyStrokeAndAlpha(e),e.lineWidth=i,s&&e.setLineDash(s),n&&(e.lineDashOffset=n),a&&(e.lineCap=a),o&&(e.lineJoin=o),e.stroke(r.getPath2D()),e.globalAlpha=l}}};g([Ee()],kI.prototype,"direction",2),g([Ee()],kI.prototype,"featherRatio",2);function II(e,t,i,s,n){if(t.length<bo)return;const[a,o]=e,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=n;let d=vo(t,a,o,{smallestKeyInterval:r,xNeedsValueOf:l});const u=h?.find(M=>M.maxRange===d);let{indexData:p,valueData:f,negativeIndexData:y,negativeValueData:b}=So(t,s,i??s,a,o,d,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:u?.positiveIndexData,reuseValueData:u?.positiveValueData,reuseNegativeIndexData:u?.negativeIndexData,reuseNegativeValueData:u?.negativeValueData});if(!y||!b)throw new Error("Negative aggregation data missing in split mode");let x=Fa(d,p,u?.positiveIndices),v=Fa(d,y,u?.negativeIndices);const S=[{maxRange:d,positiveIndices:x,positiveIndexData:p,positiveValueData:f,negativeIndices:v,negativeIndexData:y,negativeValueData:b}];for(;d>64;){const M=d,D=Math.trunc(M/2),I=h?.find(A=>A.maxRange===D),k=kl(p,f,M,{reuseIndexData:I?.positiveIndexData,reuseValueData:I?.positiveValueData}),C=kl(y,b,M,{reuseIndexData:I?.negativeIndexData,reuseValueData:I?.negativeValueData});d=k.maxRange,p=k.indexData,f=k.valueData,x=k.midpointData??Fa(d,p,I?.positiveIndices),y=C.indexData,b=C.valueData,v=C.midpointData??Fa(d,y,I?.negativeIndices),S.push({maxRange:d,positiveIndices:x,positiveIndexData:p,positiveValueData:f,negativeIndices:v,negativeIndexData:y,negativeValueData:b})}return S.reverse(),S}function a5(e,t,i,s,n){if(t.length<bo)return;const[a,o]=e,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:c,targetRange:h,existingFilters:d}=n,u=vo(t,a,o,{smallestKeyInterval:r,xNeedsValueOf:l}),p=Math.min(u,Fc(Math.max(h,br))),f=d?.find(D=>D.maxRange===p),{indexData:y,valueData:b,negativeIndexData:x,negativeValueData:v}=So(t,s,i??s,a,o,p,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:f?.positiveIndexData,reuseValueData:f?.positiveValueData,reuseNegativeIndexData:f?.negativeIndexData,reuseNegativeValueData:f?.negativeValueData});if(!x||!v)throw new Error("Negative aggregation data missing in split mode");const S={maxRange:p,positiveIndices:Fa(p,y,f?.positiveIndices),positiveIndexData:y,positiveValueData:b,negativeIndices:Fa(p,x,f?.negativeIndices),negativeIndexData:x,negativeValueData:v};function M(){return II([a,o],t,i,s,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:d})?.filter(I=>I.maxRange!==p)??[]}return{immediate:[S],computeRemaining:M}}function o5(e,t,i,s,n,a,o,r){const[l,c]=oi(e,n);return II([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var r5=Ar(o5);function l5(e,t,i,s,n){const a=t.resolveKeysById(s,"xValue",i),o=t.hasColumnById(s,"yValue-start"),r=o?t.resolveColumnById(s,"yValue-start",i):void 0,l=o?t.resolveColumnById(s,"yValue-end",i):t.resolveColumnById(s,"yValue-raw",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,o?"yValue-end":"yValue-raw",i);if(n){const[u,p]=oi(e,c);return II([u,p],a,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:n})}return r5(e,a,r,l,c,i.reduced?.smallestKeyInterval,h,d)}function c5(e,t,i,s,n,a){const o=t.resolveKeysById(s,"xValue",i),r=t.hasColumnById(s,"yValue-start"),l=r?t.resolveColumnById(s,"yValue-start",i):void 0,c=r?t.resolveColumnById(s,"yValue-end",i):t.resolveColumnById(s,"yValue-raw",i),h=t.getDomain(s,"xValue","key",i),d=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,r?"yValue-end":"yValue-raw",i),[p,f]=oi(e,h);return a5([p,f],o,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:d,yNeedsValueOf:u,targetRange:n,existingFilters:a})}var AI=class extends Yn{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};g([m],AI.prototype,"placement",2),g([m],AI.prototype,"spacing",2);var Kt=class extends wf{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 Bo,this.label=new AI,this.tooltip=Lh(),this.sparklineMode=!1}};g([m],Kt.prototype,"xKey",2),g([m],Kt.prototype,"xName",2),g([m],Kt.prototype,"yKey",2),g([m],Kt.prototype,"yName",2),g([m],Kt.prototype,"yFilterKey",2),g([m],Kt.prototype,"stackGroup",2),g([m],Kt.prototype,"normalizedTo",2),g([m],Kt.prototype,"fill",2),g([m],Kt.prototype,"fillOpacity",2),g([m],Kt.prototype,"stroke",2),g([m],Kt.prototype,"strokeWidth",2),g([m],Kt.prototype,"strokeOpacity",2),g([m],Kt.prototype,"lineDash",2),g([m],Kt.prototype,"lineDashOffset",2),g([m],Kt.prototype,"cornerRadius",2),g([m],Kt.prototype,"crisp",2),g([m],Kt.prototype,"styler",2),g([m],Kt.prototype,"itemStyler",2),g([m],Kt.prototype,"simpleItemStyler",2),g([m],Kt.prototype,"shadow",2),g([m],Kt.prototype,"label",2),g([m],Kt.prototype,"tooltip",2),g([m],Kt.prototype,"sparklineMode",2);var CI=class extends Z2{constructor(e){super({moduleCtx:e,propertyKeys:Ju,propertyNames:ep,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Ef,label:wh}}),this.properties=new Kt,this.connectsToYAxis=!0,this.aggregationManager=new Tb,this.phantomGroup=this.contentGroup.appendChild(new Le({name:"phantom",zIndex:-1})),this.phantomSelection=pi.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new Le({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=pi.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(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:n}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:o}=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:f,yScaleType:y}=this.getScaleInformation({xScale:d,yScale:u}),b=`bar-stack-${a}-yValues`,x=`${b}-trailing`,v=this.visible?{}:{forceValue:0},S=this.properties.allowNullKeys??!1,M=[Hl(t,f,{id:"xValue",allowNullKey:S}),Lt(i,y,{id:"yValue-raw",invalidValue:null,...v})];this.crossFilteringEnabled()&&M.push(Lt(s,y,{id:"yFilterValue",invalidValue:null,...v})),l&&M.push(...nf(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...v},y),...nf(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:x,separateNegative:!0,...v},y)),p&&M.push(XT,qT),Be(n)&&M.push(Wx([b,x],Math.abs(n))),this.needsDataModelDiff()&&this.processedData&&M.push(Kx(this.id,this.processedData)),(h||!c)&&M.push(of());const{dataModel:D,processedData:I}=await this.requestDataModel(e,o,{props:M,groupByKeys:c,groupByData:!c});this.aggregateData(D,I),this.smallestDataInterval=I.reduced?.smallestKeyInterval,this.largestDataInterval=I.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(e){return e.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(i==null||t==null)return{domain:[]};if(e===this.getCategoryDirection()){const r=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","key",t);return r?.def.type==="key"&&r.def.valueType==="category"?l:{domain:this.padBandExtent(l.domain)}}const s=this.yCumulativeKey(i);let n=this.domainForClippedRange(e,[s],"xValue");const a=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t).domain:void 0;a!=null&&(n=[Math.min(n[0],a[0]),Math.max(n[1],a[1])]);const o=this.getValueAxis();if(o instanceof Xn&&!(o instanceof np)){const r=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return{domain:bn(r)}}else return{domain:bn(n)}}getSeriesRange(e,t){if((this.properties.direction==="horizontal"?"x":"y")!==e)return[];const s=this.yCumulativeKey(this.dataModel),[n,a]=this.domainForVisibleRange("y",[s],"xValue",t);return[Math.min(n,0),Math.max(a,0)]}getZoomRangeFittingItems(e,t,i){const s=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[s],e,t,i)}getVisibleItems(e,t,i){const s=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),va(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>c5(i.scale.type,e,t,this,s,a),computeFull:a=>l5(i.scale.type,e,t,this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ha.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources?.get(this.id);if(n==null)return;const a=e.scale,o=t.scale,r=Math.abs(a.range[1]-a.range[0]);this.aggregationManager.ensureLevelForRange(r);const l=this.aggregationManager.getFilterForRange(r),c=i.hasColumnById(this,"yValue-start"),{label:h}=this.properties,d=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:u,barOffset:p,barWidth:f}=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:o,xAxis:e,yAxis:t,groupOffset:u,barOffset:p,barWidth:f,range:r,yReversed:t.isReversed(),bboxBottom:o.convert(0),labelSpacing:h.spacing+(typeof h.padding=="number"?h.padding:0),crisp:l==null&&(this.properties.crisp??mP(e?.scale,e?.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()==="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("y").domain}}computeXPosition(e,t){const i=e.xScale.convert(e.xValues[t]);return Number.isFinite(i)?i+e.groupOffset+e.barOffset:Number.NaN}prepareNodeDatumState(e,t,i,s,n){if(!Number.isFinite(n))return;const a=e.xValues[i];if(a===void 0&&!this.properties.allowNullKeys)return;const o=e.dataSource?.data[i],r=e.yRawValues[i],l=e.yFilterValues==null?void 0:Number(e.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=e.label.enabled&&r!=null?this.getLabelText(l??r,o,e.yKey,"y",e.yDomain,e.label,{datum:o,value:l??r,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0,h=r>=0&&!Object.is(r,-0);return t.datum=o,t.xValue=a,t.yRawValue=r,t.yFilterValue=l,t.labelText=c,t.inset=l!=null&&l>r,t.isPositive=h,t.precomputedBottomY=l==null?void 0:e.yScale.convert(s),t.precomputedIsUpward=l==null?void 0:h!==e.yReversed,t}createSkeletonNodeDatum(e,t,i){const s=t.nodeDatumScratch;return{series:this,datum:s.datum,datumIndex:t.datumIndex,cumulativeValue:0,phantom:i,xValue:s.xValue??"",yValue:0,yKey:e.yKey,xKey:e.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:t.opacity,featherRatio:t.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:e.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(e,t){const i=this.prepareNodeDatumState(e,t.nodeDatumScratch,t.datumIndex,t.yStart,t.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const s=this.createSkeletonNodeDatum(e,t,!1);this.updateNodeDatum(e,s,t,i);let n;return i.yFilterValue!=null&&(n=this.createSkeletonNodeDatum(e,t,!0),this.updateNodeDatum(e,n,t)),{nodeData:s,phantomNodeData:n}}updateNodeDatum(e,t,i,s){if(s??(s=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!s)return;const n=t,a=t.phantom,o=i.yStart,r=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!==e.yReversed,f=e.yScale.convert(h),y=s.precomputedBottomY??e.yScale.convert(o),b=e.yScale.convert(d),x=i.width*.5*(1-(u??1)),v=e.barAlongX?Math.min(f,y):i.x+x,S=e.barAlongX?i.x+x:Math.min(f,y),M=e.barAlongX?Math.abs(y-f):i.width*(u??1),D=e.barAlongX?i.width*(u??1):Math.abs(y-f),I=e.barAlongX?Math.min(e.bboxBottom,b):i.x+x,k=e.barAlongX?i.x+x:Math.min(e.bboxBottom,b),C=e.barAlongX?Math.abs(e.bboxBottom-b):i.width*(u??1),A=e.barAlongX?i.width*(u??1):Math.abs(e.bboxBottom-b);n.datum=s.datum,n.datumIndex=i.datumIndex,n.cumulativeValue=l,n.xValue=s.xValue,n.yValue=r,n.x=I,n.y=k,n.width=C,n.height=A;const w=n.midPoint;w.x=v+M/2,w.y=S+D/2;const T=e.shouldFlipXY?D:M;n.capDefaults.lengthRatioMultiplier=T,n.capDefaults.lengthMax=T,n.opacity=i.opacity,n.featherRatio=i.featherRatio,n.topLeftCornerRadius=e.barAlongX!==p,n.topRightCornerRadius=p,n.bottomRightCornerRadius=e.barAlongX===p,n.bottomLeftCornerRadius=!p;const O=n.clipBBox;if(O?(O.x=v,O.y=S,O.width=M,O.height=D):n.clipBBox=new le(v,S,M,D),n.crisp=e.crisp,c==null)n.label=void 0;else{const z=G2({isUpward:p,isVertical:!e.barAlongX,placement:e.label.placement,spacing:e.labelSpacing,rect:{x:v,y:S,width:M,height:D}}),V=n.label;V?(V.text=c,V.x=z.x,V.y=z.y,V.textAlign=z.textAlign,V.textBaseline=z.textBaseline):n.label={text:c,...z}}n.missing=hh(r)}createNodeDataWithAggregation(e,t,i){const s=e.yReversed?-1:1;for(let n=0;n<2;n+=1){const a=n===0,o=a?e.dataAggregationFilter.positiveIndices:e.dataAggregationFilter.negativeIndices,r=a?e.dataAggregationFilter.positiveIndexData:e.dataAggregationFilter.negativeIndexData,l=a?Xs:qs,c=a?qs:Xs,h=this.visibleRangeIndices("xValue",e.xAxis.range,o),d=h[0],u=h[1];for(let p=d;p<u;p+=1){const f=p*Vn,y=r[f+Ys],b=r[f+Zs],x=r[f+l],v=r[f+c];if(y===Dl||e.xValues[v]==null||e.xValues[x]==null)continue;const S=t(Math.trunc((y+b)/2)),M=Math.abs(t(b)-t(y))+e.barWidth;if(S-M<0||S>e.range)continue;const D=Math.abs(b-y)+1,I=Ya.is(e.xScale)?Math.min(e.xScale.bandwidth*Math.max(D-1,1)/(e.xScale.step*D),1):1;if(i.datumIndex=v,i.x=S,i.width=M,i.opacity=I,e.isStacked)i.yStart=Number(e.yStartValues[x]),i.yEnd=Number(e.yEndValues[v]),i.featherRatio=0;else{const k=Number(e.yRawValues[v]),C=Number(e.yRawValues[x]);i.yStart=0,i.yEnd=k,i.featherRatio=(a?1:-1)*s*(1-C/k)}i.yRange=i.yEnd,this.upsertNodeDatum(e,i)}}}createNodeDataGrouped(e,t,i){const s=this.processedData,n=s.invalidData?.get(this.id),a=e.barWidth,o=e.isStacked?this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):-1,r=s.columnScopes.findIndex(u=>u.has(this.id)),l=s.groups,c=rf(1,l.length,e.xAxis.range,u=>{const f=l[u].keys[0];return this.xCoordinateRange(f)}),h=c[0],d=c[1];for(let u=h;u<d;u+=1){const p=l[u],f=p.aggregation,y=p.datumIndices[r];if(y!=null)for(const b of y){const x=u+b,v=t(x);if(n?.[x]===!0)continue;const S=e.yRawValues[x];if(S==null)continue;const M=S>=0&&!Object.is(S,-0),D=e.isStacked?Number(e.yStartValues?.[x]):0,I=e.isStacked?Number(e.yEndValues?.[x]):S;let k=I;e.isStacked&&(k=f[o][M?1:0]),i.datumIndex=x,i.x=v,i.width=a,i.yStart=D,i.yEnd=I,i.yRange=k,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(e,i)}}}createNodeDataSimple(e,t,i){const s=this.processedData.invalidData?.get(this.id),n=e.barWidth,a=this.visibleRangeIndices("xValue",e.xAxis.range);let o=a[0],r=a[1];this.processedData.input.count<1e3&&(o=0,r=this.processedData.input.count);for(let l=o;l<r;l+=1){if(s?.[l]===!0)continue;const c=e.yRawValues[l];if(c==null)continue;const h=t(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(e,i)}}upsertNodeDatum(e,t){const i=e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length,s=e.yFilterValues!=null,n=s&&e.canIncrementallyUpdate&&e.phantomIndex<e.phantomNodes.length;let a,o;if(i)a=e.nodes[e.nodeIndex],this.updateNodeDatum(e,a,t),e.nodeIndex>=e.labels.length&&e.labels.push(a);else{const r=this.createNodeDatum(e,t);r.nodeData&&(e.nodes.push(r.nodeData),e.labels.push(r.nodeData)),o=r.phantomNodeData}if(e.nodeIndex++,!s)return{nodeData:e.nodes[e.nodeIndex]};if(n)o=e.phantomNodes[e.phantomIndex],this.updateNodeDatum(e,o,t);else if(o)e.phantomNodes.push(o);else{const r=this.createNodeDatum(e,t);r.phantomNodeData&&e.phantomNodes.push(r.phantomNodeData)}return e.phantomIndex++,{nodeData:a,phantomNodeData:o}}populateNodeData(e){const t=s=>this.computeXPosition(e,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};e.dataAggregationFilter!=null?this.createNodeDataWithAggregation(e,t,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(e,t,i):this.createNodeDataSimple(e,t,i)}initializeResult(e){return{itemId:this.properties.yKey,nodeData:e.nodes,phantomNodeData:e.phantomNodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:KD(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(e){e.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(e.nodes,e.nodeIndex),this.trimIncrementalNodeArray(e.phantomNodes,e.phantomIndex),this.trimIncrementalNodeArray(e.labels,e.nodes.length))}assembleResult(e,t){return t.segments=yb(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene),t}nodeFactory(){return new kI}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(e){const t=super.updateHighlightSelectionItem(e),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}),t}updateNodes(e,t){super.updateNodes(e,t),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(e,t){const i=e.find(s=>s.datum===t.datum);return i==null?void 0:[{...i}]}updateDatumSelection(e){return va(this.processedData)?e.datumSelection.update(e.nodeData,void 0,this.getDatumId.bind(this)):e.datumSelection.update(e.nodeData)}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:o,stackGroup:r,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}=this.properties,p=ku(e??0);return{cornerRadius:i,fill:s,fillOpacity:n,highlightState:p,lineDash:a,lineDashOffset:o,seriesId:t,stackGroup:r,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}}makeItemStylerParams(e,t,i,s,n,a){const{id:o}=this,{xKey:r,yKey:l,stackGroup:c}=this.properties,h=t.dataSources.get(o)?.data?.[i],d=e.resolveColumnById(this,"yValue-raw",t)[i],u=e.getDomain(this,"xValue","key",t).domain,p=e.getDomain(this,this.yCumulativeKey(e),"value",t).domain,f=this.ctx.highlightManager?.getActiveHighlight(),y=this.getHighlightStateString(f,n,i),b=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,...WD(s,d,r,l,u,p),datum:h,xValue:s,yValue:d,stackGroup:c,highlightState:y,...a,fill:b}}getStyle(e,t){const{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!e&&h){const u=this.makeStylerParams(t);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??o,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}getItemStyle(e,t,i){const{properties:s,dataModel:n,processedData:a}=this,{itemStyler:o,simpleItemStyler:r}=s,l=this.getHighlightStyle(t,e,i);if(r&&a!=null&&e!=null){const h=a.dataSources.get(this.id)?.data?.[e],d=r(h);return re(d,l,this.getStyle(!1,i))}let c=re(l,this.getStyle(e===void 0,i));if(o&&n!=null&&a!=null&&e!=null){const h=n.resolveKeysById(this,"xValue",a)[e],d=this.cachedDatumCallback(us(this.getDatumId({xValue:h,phantom:!1}),t?"highlight":"node"),()=>{const u=this.makeItemStylerParams(n,a,e,h,t,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,u))});d&&(c=re(d,c))}return c}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight(),i=this;function s(n,a){if(!e.datumSelection.isGarbage(n)){const o=i.getHighlightState(t,e.isHighlight,a.datumIndex);a.style=i.getItemStyle(a.datumIndex,e.isHighlight,o)}}e.datumSelection.each(s)}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getCategoryDirection()==="x",a=this.getShapeFillBBox(),o=this.getBarDirection(),{drawingMode:r,isHighlight:l}=e,c=this,h=t.styles;function d(u,p){const f=p.style??h[c.getHighlightState(i,l,p.datumIndex)];u.setStyleProperties(f,a);const y=f.cornerRadius??0,b=n?(p.clipBBox?.width??p.width)>0:(p.clipBBox?.height??p.height)>0;u.setStaticProperties(r,p.topLeftCornerRadius?y:0,p.topRightCornerRadius?y:0,p.bottomRightCornerRadius?y:0,p.bottomLeftCornerRadius?y:0,b,p.crisp,s,o,p.featherRatio)}e.datumSelection.each(d)}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=1})}updateLabelNodes(e){const{isHighlight:t=!1}=e,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();e.labelSelection.each((n,a)=>{n.fillOpacity=this.getHighlightStyle(t,a?.datumIndex).opacity??1,H2(this,n,i,this.properties.label,a.label,t,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yKey:r,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=n.allowNullKeys??!1,p=this.getCategoryAxis(),f=this.getValueAxis();if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data?.[e],b=i.resolveKeysById(this,"xValue",s)[e],x=i.resolveColumnById(this,"yValue-raw",s)[e];if(b===void 0&&!u)return;const v=this.getItemStyle(e,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",b,y,a,c,u),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(f,"tooltip",x,y,r,c),missing:hh(x)}]},{seriesId:t,datum:y,title:l,xKey:a,xName:o,yKey:r,yName:l,legendItemName:c,stackGroup:h,...v,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.getStyle(!1,0);return{marker:{fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(e){const{showInLegend:t}=this.properties;if(e!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:a,yName:o,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:a}),label:{text:r??o??a},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!t}]}resetDatumAnimation(e){kb([e.datumSelection,this.phantomSelection])}animateReadyHighlight(e){kb([e,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const{phantomSelection:s}=this,n=Pf(Of(this.isVertical(),this.axes,"normal"),"unknown");ui(this.id,"nodes",this.ctx.animationManager,[e,s],n),ti(this,"labels",this.ctx.animationManager,t),ti(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{phantomSelection:t}=this,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:a,previousContextData:o}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const r=bP(this.id,i,this.getDatumId.bind(this),e.contextData,o,this.processedData,this.processedDataUpdated),l=o==null?"fade":"normal",c=Pf(Of(this.isVertical(),this.axes,l),"added");ui(this.id,"nodes",this.ctx.animationManager,[i,t],c,(h,d)=>this.getDatumId(d),r),(!r||r?.changed||!Ka(a.groupScale,o?.groupScale))&&(ti(this,"labels",this.ctx.animationManager,s),ti(this,"annotations",this.ctx.animationManager,...n))}getDatumId(e){return us(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return Yk(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};CI.className="BarSeries",CI.type="bar";var h5={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Ye,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:Mo,xOffset:3,yOffset:3,blur:5},highlight:Us,segmentation:vl}},_b={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:ue,dependencies:[ri],options:ju,predictAxis:kf,defaultAxes:Ld,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:h5,create:e=>new CI(e)},Hb=3,d5=5,XP=.05;function u5(e,t,i){const{xValues:s,yValues:n,xDomain:a,yDomain:o,xNeedsValueOf:r,yNeedsValueOf:l}=e,{x0:c,y0:h,x1:d,y1:u}=i;let p=0,f=1/0;const y=(c+d)/2,b=(h+u)/2;for(const x of t){const v=s[x],S=n[x];if(v==null||S==null)continue;const M=Bn(v,a.min,a.max,r),D=Bn(S,o.min,o.max,l),I=(M-y)**2+(D-b)**2;I<f&&(f=I,p=x)}return p}function p5(e,t,i){const{xValues:s,yValues:n,xDomain:a,yDomain:o,xNeedsValueOf:r,yNeedsValueOf:l}=e,{x0:c,y0:h,x1:d,y1:u}=i;let p=0;for(const f of t){const y=s[f],b=n[f];if(y==null||b==null)continue;const x=Bn(y,a.min,a.max,r),v=Bn(b,o.min,o.max,l);x>=c&&x<=d&&v>=h&&v<=u&&(p+=1)}return p}function g5(e,t,i){const{xValues:s,yValues:n,xDomain:a,yDomain:o,xNeedsValueOf:r,yNeedsValueOf:l}=e,{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:[]}],f=(c+d)/2,y=(h+u)/2;for(const x of t){const v=s[x],S=n[x];if(v==null||S==null)continue;const M=Bn(v,a.min,a.max,r),D=Bn(S,o.min,o.max,l),I=(M>f?1:0)+(D>y?2:0),k=p[I];k.indices.push(x),k.x0=Math.min(k.x0,M),k.y0=Math.min(k.y0,D),k.x1=Math.max(k.x1,M),k.y1=Math.max(k.y1,D)}const b=[];for(const x of p){const{indices:v,x0:S,x1:M,y0:D,y1:I}=x;if(v.length===0)continue;const k=wI(e,v,{x0:S,y0:D,x1:M,y1:I});b.push(k)}return b}function wI(e,t,i){const{x0:s,y0:n,x1:a,y1:o}=i;let l=t.length<d5&&a-s<XP&&o-n<XP||s===a&&n===o?null:g5(e,t,i);if(l?.length===1)return l[0];l?.length===0&&(l=null);const c=Math.hypot(a-s,o-n),h=u5(e,t,i);return{scale:c,x0:s,y0:n,x1:a,y1:o,indices:t,primaryDatumIndex:h,children:l}}function f5(e,t,i,s,n,a,o){const[r,l]=e,[c,h]=t,[d,u]=a,{xNeedsValueOf:p,yNeedsValueOf:f}=o,y={xValues:i,yValues:s,xDomain:{min:r,max:l},yDomain:{min:c,max:h},xNeedsValueOf:p,yNeedsValueOf:f},b=[];if(n!=null&&u>d){const x=Array.from({length:Hb},()=>[]);for(let v=0;v<n.length;v+=1){const M=(n[v]-d)/(u-d),D=Math.trunc(M*Hb);D>=0&&D<Hb&&x[D].push(v)}for(let v=0;v<x.length;v+=1){const S=x[v],M=wI(y,S,{x0:0,y0:0,x1:1,y1:1});if(M!=null){const D=v/Hb;b.push({sizeRatio:D,node:M})}}}else{const x=i.map((S,M)=>M),v=wI(y,x,{x0:0,y0:0,x1:1,y1:1});v!=null&&b.push({sizeRatio:0,node:v})}return b.length>0?{xValues:i,yValues:s,xd0:r,xd1:l,yd0:c,yd1:h,filters:b,xNeedsValueOf:p,yNeedsValueOf:f}:void 0}function m5(e,t,i,s,n,a,o,r,l,c){const[h,d]=oi(e,a),[u,p]=oi(t,o);return f5([h,d],[u,p],i,s,n,[r[0],r[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function y5(e,t,i,s,n,a,o){const r=i.resolveColumnById(o,"xValue",s),l=i.resolveColumnById(o,"yValue",s),c=a?i.resolveColumnById(o,"sizeValue",s):void 0,h=i.getDomain(o,"xValue","value",s),d=i.getDomain(o,"yValue","value",s),u=a?n.domain:[0,0],p=i.resolveColumnNeedsValueOf(o,"xValue",s),f=i.resolveColumnNeedsValueOf(o,"yValue",s);return m5(e,t,r,l,c,h,d,u,p,f)}function qP(e,t,i,s,n,a){const{xRange:o,yRange:r,xVisibleRange:[l,c],yVisibleRange:[h,d],minSize:u,maxSize:p}=i,{xValues:f,yValues:y,xd0:b,xd1:x,yd0:v,yd1:S,xNeedsValueOf:M,yNeedsValueOf:D}=t,I=1/Math.min(o/(c-l),r/(d-h)),k={xValues:f,yValues:y,xDomain:{min:b,max:x},yDomain:{min:v,max:S},xNeedsValueOf:M,yNeedsValueOf:D};for(const{sizeRatio:C,node:A}of t.filters){const w=.5*(u+C*(p-u)),T=w*I,O=e*T,z=l-w/o,V=c+w/o,E=h-w/r,_=d+w/r,G=[A];for(;G.length>0;){const B=G.pop();if(!(B.x1<z||B.x0>V||B.y1<E||B.y0>_))if(e!==1&&B.scale<=O)s!=null&&(s.count+=1),n?.push({datumIndex:B.primaryDatumIndex,count:B.indices.length,area:(B.x1-B.x0)*(B.y1-B.y0),dilation:ae(1,B.scale/T,e)});else if(B.children==null){const{indices:F}=B;if(s!=null){const Z=B.x0>=l&&B.x1<=c&&B.y0>=h&&B.y1<=d?F.length:p5(k,F,{x0:l,y0:h,x1:c,y1:d});s.count+=Z}a?.push(...F)}else G.push(...B.children)}}}function Gb(e,t,i){const s={count:0};return qP(e,t,i,s,void 0,void 0),s.count}var x5=100,b5=12;function v5(e,t,i){if(Gb(1,e,t)<=i)return 1;let s=1,n=2;for(;Gb(n,e,t)>i&&n<x5;)s*=2,n*=2;for(let a=0;a<b5;a+=1){const o=(n+s)/2;Gb(o,e,t)>i?s=o:n=o}return(s+n)/2}function S5(e,t,i){const s=[],n=[];return qP(e,t,i,void 0,s,n),{groupedAggregation:s,singleDatumIndices:n}}var LI=class extends sn{constructor(){super(...arguments),this.maxSize=30}};g([m,$()],LI.prototype,"maxSize",2),g([m,hu()],LI.prototype,"domain",2);var QP=class extends Yn{constructor(){super(...arguments),this.placement="top"}};g([m],QP.prototype,"placement",2);var St=class extends eo{constructor(){super(...arguments),this.label=new QP,this.tooltip=Lh(),this.maxRenderedItems=1/0,this.marker=new LI}};g([m],St.prototype,"xKey",2),g([m],St.prototype,"yKey",2),g([m],St.prototype,"sizeKey",2),g([m],St.prototype,"labelKey",2),g([m],St.prototype,"xFilterKey",2),g([m],St.prototype,"yFilterKey",2),g([m],St.prototype,"sizeFilterKey",2),g([m],St.prototype,"xName",2),g([m],St.prototype,"yName",2),g([m],St.prototype,"sizeName",2),g([m],St.prototype,"labelName",2),g([m],St.prototype,"title",2),g([Gt("marker.shape")],St.prototype,"shape",2),g([Gt("marker.size")],St.prototype,"size",2),g([Gt("marker.maxSize")],St.prototype,"maxSize",2),g([Gt("marker.domain")],St.prototype,"domain",2),g([Gt("marker.fill")],St.prototype,"fill",2),g([Gt("marker.fillOpacity")],St.prototype,"fillOpacity",2),g([Gt("marker.stroke")],St.prototype,"stroke",2),g([Gt("marker.strokeWidth")],St.prototype,"strokeWidth",2),g([Gt("marker.strokeOpacity")],St.prototype,"strokeOpacity",2),g([Gt("marker.lineDash")],St.prototype,"lineDash",2),g([Gt("marker.lineDashOffset")],St.prototype,"lineDashOffset",2),g([Gt("marker.itemStyler")],St.prototype,"itemStyler",2),g([m],St.prototype,"styler",2),g([m],St.prototype,"label",2),g([m],St.prototype,"tooltip",2),g([m],St.prototype,"maxRenderedItems",2);var M5=class extends _k{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},jb=class extends ec{constructor(e){super({moduleCtx:e,propertyKeys:{...Ju,label:["labelKey"],size:["sizeKey"]},propertyNames:{...ep,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:wh,datum:Ib},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=M5,this.properties=new St,this.dataAggregation=void 0,this.sizeScale=new Ah,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),a=this.sizeScale.type,{xKey:o,yKey:r,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,f=this.properties.allowNullKeys??!1,{dataModel:y,processedData:b}=await this.requestDataModel(e,this.data,{props:[Lt(o,s,{id:"xValue",allowNullKey:f}),Lt(r,n,{id:"yValue",allowNullKey:f}),...c==null?[]:[Lt(c,s,{id:"xFilterValue"})],...h==null?[]:[Lt(h,n,{id:"yFilterValue"})],...d==null?[]:[Lt(d,a,{id:"sizeFilterValue"})],...l?[Lt(l,a,{id:"sizeValue"})]:[],...u?[Lt(u,"category",{id:"labelValue"})]:[]]}),x=l?y.resolveProcessedDataIndexById(this,"sizeValue"):void 0,v=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=v??(x==null?void 0:b.domain.values[x])??[],this.dataAggregation=this.aggregateData(y,b),this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:o}=s,r=this.axes.x.scale.convert(e),l=o==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?a:n.convert(l[i]))*t;return[r-h,r+h]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:o}=s,r=this.axes.y.scale.convert(e[0]),l=o==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?a:n.convert(l[i]))*t;return[r-h,r+h]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};const s={x:"xValue",y:"yValue"},n=s[e],a=t.resolveProcessedDataDefById(this,n),o=t.getDomain(this,n,"value",i);if(a?.def.type==="value"&&a?.def.valueType==="category")return{domain:o.domain};const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l);return{domain:bn(Ga(c))}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){const{dataAggregation:s,axes:n}=this,a=n.x,o=n.y;if(s==null||a==null||o==null)return this.countVisibleItems("xValue",["yValue"],e,t,i);const r=this.aggregationOptions(a,o,e,t??[0,1]);return Gb(0,s,r)}aggregateData(e,t){if(t.type==="grouped"||t.input.count<=this.properties.maxRenderedItems)return;const i=this.axes.x,s=this.axes.y;if(i==null||s==null)return;const n=i.scale,a=s.scale;if(!(!mt.is(n)||!mt.is(a)))return y5(n.type,a.type,e,t,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(e,t,i=e.visibleRange,s=t.visibleRange){const{processedData:n,dataModel:a}=this,{sizeKey:o}=this.properties,[r,l]=this.getSizeRange(),c=Math.abs(e.range[1]-e.range[0]),h=Math.abs(t.range[1]-t.range[0]),d=Math.max(r,1),u=o?Math.max(l,1):d,p=e.scale,f=t.scale;return n!=null&&a!=null&&(mt.is(p)&&(i=Rg(i,p.domain.map(Ui),a.getDomain(this,"xValue","value",n).domain.map(Ui))),mt.is(f)&&(s=Rg(s,f.domain.map(Ui),a.getDomain(this,"yValue","value",n).domain.map(Ui)))),{xRange:c,yRange:h,minSize:d,maxSize:u,xVisibleRange:i,yVisibleRange:s}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,sizeScale:n,visible:a}=this;if(!i||!s)return;const o=s.dataSources.get(this.id)?.data;if(o==null)return;const{xKey:r,yKey:l,sizeKey:c,xFilterKey:h,yFilterKey:d,sizeFilterKey:u,labelKey:p,xName:f,yName:y,sizeName:b,labelName:x,label:v,legendItemName:S,marker:M}=this.properties,D=e.scale,I=t.scale,k=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:e,yAxis:t,rawData:o,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:D,yScale:I,sizeScale:n,xOffset:(D.bandwidth??0)/2,yOffset:(I.bandwidth??0)/2,xKey:r,yKey:l,sizeKey:c,labelKey:p,xName:f,yName:y,sizeName:b,labelName:x,legendItemName:S,labelsEnabled:v.enabled,labelPlacement:v.placement,labelAnchor:Li.anchor(M.shape),labelTextDomain:C,labelPadding:Au(v),labelTextMeasurer:et(v),label:v,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:a,canIncrementallyUpdate:k,nodes:k?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(e){this.sizeScale.range=this.getSizeRange();const t={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(e,t):this.createNodeDataWithAggregation(e,t,e.xAxis,e.yAxis,i)}initializeResult(e){const{marker:t}=this.properties;return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,styles:wb(this,this.properties,t)}}upsertBubbleNodeDatum(e,t,i){this.prepareNodeDatumState(e,t,i)&&Zk(e,{scratch:t,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(e,t){const i=e.rawData.length;for(let s=0;s<i;s++)t.count=1,t.dilation=1,t.area=0,this.upsertBubbleNodeDatum(e,t,s)}createNodeDataWithAggregation(e,t,i,s,n){const{maxRenderedItems:a}=this.properties,o=this.aggregationOptions(i,s),r=v5(n,o,a),{groupedAggregation:l,singleDatumIndices:c}=S5(r,n,o);for(const{datumIndex:h,count:d,dilation:u,area:p}of l)t.count=d,t.dilation=u,t.area=p,this.upsertBubbleNodeDatum(e,t,h);for(const h of c)t.count=1,t.dilation=1,t.area=0,this.upsertBubbleNodeDatum(e,t,h)}prepareNodeDatumState(e,t,i){const s=e.rawData[i],n=e.xDataValues[i],a=e.yDataValues[i],o=this.properties.allowNullKeys??!1;if((n===void 0||a===void 0)&&!o)return;const r=e.sizeDataValues?.[i],l=e.xScale.convert(n)+e.xOffset,c=e.yScale.convert(a)+e.yOffset;if(!Number.isFinite(l)||!Number.isFinite(c))return;let h;e.xFilterDataValues!=null&&e.yFilterDataValues!=null&&(h=e.xFilterDataValues[i]===n&&e.yFilterDataValues[i]===a,e.sizeFilterDataValues!=null&&h&&(h=e.sizeFilterDataValues[i]===r));let d;e.labelsEnabled?d=this.computeLabel(e,s,a,r,i):d={text:"",width:0,height:0};const u=r==null?e.sizeScale.range[0]:e.sizeScale.convert(r);return t.datum=s,t.xDatum=n,t.yDatum=a,t.sizeValue=r,t.x=l,t.y=c,t.selected=h,t.nodeLabel=d,t.markerSize=u,t}computeLabel(e,t,i,s,n){let a,o,r;e.labelKey&&e.labelDataValues?(a=e.labelDataValues[n],o=e.labelKey,r="label"):e.sizeKey?(a=s,o=e.sizeKey,r="size"):(a=i,o=e.yKey,r="y");const l=this.getLabelText(a,t,o,r,e.labelTextDomain,e.label,{value:a,datum:t,xKey:e.xKey,yKey:e.yKey,sizeKey:e.sizeKey,labelKey:e.labelKey,xName:e.xName,yName:e.yName,sizeName:e.sizeName,labelName:e.labelName,legendItemName:e.legendItemName});let{width:c,height:h}=De(l)?Js(l,e.label):e.labelTextMeasurer.measureLines(String(l));return c+=e.labelPadding.left+e.labelPadding.right,h+=e.labelPadding.bottom+e.labelPadding.top,{text:l,width:c,height:h}}createSkeletonNodeDatum(e,t,i){return{series:this,yKey:e.yKey,xKey:e.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:e.labelAnchor,placement:e.labelPlacement,count:1,dilation:1,area:0,selected:void 0}}updateNodeDatum(e,t,i,s){const n=t,{x:a,y:o,markerSize:r,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=e.labelAnchor,n.placement=e.labelPlacement;const c=n.point;c.x=a,c.y=o,c.size=Math.sqrt(l)*r;const h=n.midPoint;h.x=a,h.y=o}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;if(this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),!va(this.processedData))return i.update(t);const{sizeKey:s}=this.properties;let n;return s&&(n=a=>us(a.xValue,a.yValue,a.sizeValue,Ne(a.label.text))),i.update(t,void 0,n)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,sizeKey:a,labelKey:o,marker:r}=this.properties,l={xKey:s,yKey:n,sizeKey:a,labelKey:o},c=this.ctx.highlightManager.getActiveHighlight();t.each((h,d)=>{if(!t.isGarbage(h)){const u=this.getHighlightState(c,e.isHighlight,d.datumIndex),p=this.getStyle(u);d.style=this.getMarkerStyle(r,d,l,{isHighlight:i,highlightState:u,resolveMarkerSubPath:[]},p)}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s,drawingMode:n}=e;this.sizeScale.range=this.getSizeRange();const a=this.getShapeFillBBox(),o=this.dataAggregation!=null,r=this.ctx.highlightManager.getActiveHighlight();i.each((l,c,h)=>{const{point:{size:d},count:u,area:p,dilation:f}=c,y=this.getHighlightState(r,s,c.datumIndex),b={...c.style??t.styles[y]};if(b.size=d,f>1){const x=b.fillOpacity??0,v=.269669+683e-6*u+-37.534348*p+.004449*u*p+-0*u**2+44.428603*p**2;b.fillOpacity=ae(x/f,x/.1*v,1)}this.applyMarkerStyle(b,l,c.point,a,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(n,b),l.zIndex=o?[-u,h]:0}),s||this.properties.marker.markClean()}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.isSeriesHighlighted(e)&&e?.datum?e:void 0,i=t==null?[]:this.placedLabelData.filter(s=>s.datum.datumIndex===t.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(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((n,a)=>{const o=Ch(this,a,s,this.properties.label,t,i);n.text=a.label.text,n.fill=o.color,n.x=a.point?.x??0,n.y=a.point?.y??0,n.fontStyle=o.fontStyle,n.fontWeight=o.fontWeight,n.fontSize=o.fontSize,n.fontFamily=o.fontFamily,n.textBaseline="top",n.fillOpacity=this.getHighlightStyle(t,a.datumIndex).opacity??1,n.setBoxing(o)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1})}makeStylerParams(e){const{id:t,properties:{size:i,maxSize:s,shape:n,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,sizeKey:f,labelKey:y}}=this,b=ku(e??0);return this.type==="bubble"?{highlightState:b,size:i,maxSize:s,shape:n,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,seriesId:t,sizeKey:f,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:y}:this.type==="scatter"?{highlightState:b,size:i,shape:n,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,seriesId:t,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:y}:this.type}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:s,sizeKey:n,sizeName:a,labelKey:o,labelName:r,legendItemName:l}=this.properties;return{xKey:e,xName:t,yKey:i,yName:s,sizeKey:n,sizeName:a,labelKey:o,labelName:r,legendItemName:l}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a,ctx:o}=this,{formatManager:r}=o,{xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:f,labelName:y,title:b,tooltip:x,marker:v,legendItemName:S}=a,M=n.x,D=n.y;if(!i||!s||!M||!D)return;const I=s.dataSources.get(this.id)?.data?.[e],k=i.resolveColumnById(this,"xValue",s)[e],C=i.resolveColumnById(this,"yValue",s)[e],A=this.properties.allowNullKeys??!1;if(k===void 0&&!A)return;const w=[];if(this.isLabelEnabled()&&f!=null){const O=i.resolveColumnById(this,"labelValue",s)[e],z=r.format(this.callWithContext.bind(this),{type:"category",value:O,datum:I,seriesId:t,legendItemName:S,key:f,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});w.push({label:y,fallbackLabel:f,value:z??ya(O)})}if(w.push({label:c,fallbackLabel:l,value:this.getAxisValueText(M,"tooltip",k,I,l,S,A),missing:hh(k,A)},{label:d,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",C,I,h,S,A),missing:hh(C,A)}),u!=null){const O=i.resolveColumnById(this,"sizeValue",s)[e];if(O!=null){const z=i.getDomain(this,"sizeValue","value",s).domain,V=r.format(this.callWithContext.bind(this),{type:"number",value:O,datum:I,seriesId:t,legendItemName:S,key:u,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:z,fractionDigits:void 0,visibleDomain:void 0});w.push({label:p,fallbackLabel:u,value:V??ya(O)})}}const T=this.getMarkerStyle(v,{datum:I,datumIndex:e},{xKey:l,yKey:h,sizeKey:u,labelKey:f},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(x,{title:b,symbol:this.legendItemSymbol(),data:w},{seriesId:t,datum:I,title:h,xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:f,labelName:y,legendItemName:S,...T,...this.getModuleTooltipParams()})}legendItemSymbol(){const e=this.getStyle();return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},e)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:n,legendItemName:a,title:o,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:a??o??n??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){lY(this,this.ctx.animationManager,e),ti(this,"labels",this.ctx.animationManager,t)}resetDatumAnimation(e){Ab([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Li}getStyle(e){const{properties:t}=this;let i={};if(t.styler){const s=this.makeStylerParams(e),n=this.cachedCallWithContext(t.styler,s)??{};i=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],n,{pick:!1})??{}}return{fill:i.fill??t.fill,fillOpacity:i.fillOpacity??t.fillOpacity,lineDash:i.lineDash??t.lineDash,lineDashOffset:i.lineDashOffset??t.lineDashOffset,shape:i.shape??t.shape,size:i.size??t.size,maxSize:i.maxSize??t.maxSize,stroke:i.stroke??t.stroke,strokeOpacity:i.strokeOpacity??t.strokeOpacity,strokeWidth:i.strokeWidth??t.strokeWidth}}getSizeRange(){const{size:e,maxSize:t}=this.getStyle();return[e,t]}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:n,marker:a}=this.properties;return this.getMarkerStyle(a,e,{xKey:t,yKey:i,sizeKey:s,labelKey:n},{resolveMarkerSubPath:[]})}computeFocusBounds(e){return Cb(this,e)}hasItemStylers(){const{styler:e,itemStyler:t,marker:i,label:s}=this.properties;return!!(e??t??i.itemStyler??s.itemStyler)}initQuadTree(e){vb(e,this.datumNodesIter())}pickNodeDataClosestDatum(e){return Sb(this,e)}};jb.className="BubbleSeries",jb.type="bubble";var D5={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ba],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Ye,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:Us}},NI={type:"series",name:"bubble",chartType:"cartesian",version:ue,dependencies:[ri],options:lb,predictAxis:Ek,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:D5,create:e=>new jb(e)},Oi=class extends eo{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 Bo,this.label=new Yn,this.tooltip=Lh()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};g([m],Oi.prototype,"xKey",2),g([m],Oi.prototype,"yKey",2),g([m],Oi.prototype,"xName",2),g([m],Oi.prototype,"yName",2),g([m],Oi.prototype,"fill",2),g([m],Oi.prototype,"fillOpacity",2),g([m],Oi.prototype,"stroke",2),g([m],Oi.prototype,"strokeWidth",2),g([m],Oi.prototype,"strokeOpacity",2),g([m],Oi.prototype,"lineDash",2),g([m],Oi.prototype,"lineDashOffset",2),g([m],Oi.prototype,"cornerRadius",2),g([m],Oi.prototype,"areaPlot",2),g([m],Oi.prototype,"bins",2),g([m],Oi.prototype,"aggregation",2),g([m],Oi.prototype,"binCount",2),g([m],Oi.prototype,"shadow",2),g([m],Oi.prototype,"label",2),g([m],Oi.prototype,"tooltip",2);var JP=10,TI=class extends ec{constructor(e){super({moduleCtx:e,propertyKeys:Ju,propertyNames:ep,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:Ef,label:wh}}),this.properties=new Oi,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(e){const t=Wc(e[0],e[1],JP).ticks,i=$c(e[0],e[1],JP),[s]=t,n=a=>[a,a+i];return[[s-i,s],...t.map(n)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],n=t||1,{start:a,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,o,n)}getBins(e,t,i,s){const n=[],a=this.calculatePrecision(i);for(let o=0;o<s;o++){const r=Math.round((e+o*i)*a)/a;let l=Math.round((e+(o+1)*i)*a)/a;o===s-1&&(l=Math.max(l,t)),n[o]=[r,l]}return n}calculatePrecision(e){let t=10;if(Number.isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(e/a)*a,binSize:s}}async processData(e){const{visible:t}=this,{xKey:i,yKey:s,areaPlot:n,aggregation:a}=this.properties,o=this.axes.x?.scale,r=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:r,xScale:o}),h=t?{}:{forceValue:0},d=[Hl(i,l),uW];if(s){let v=zT("groupAgg",{visible:t});a==="count"||(a==="sum"?v=L4("groupAgg",{visible:t}):a==="mean"&&(v=T4("groupAgg",{visible:t}))),n&&(v=VT("groupAgg",v)),d.push(Lt(s,c,{invalidValue:void 0,...h}),v)}else{d.push(lW("count"));let v=zT("groupAgg",{visible:t});n&&(v=VT("groupAgg",v)),d.push(v)}let u=[];const p=v=>{const S=bn(v.domain.keys[0]);if(S.length===0)return v.domain.groups=[],()=>[];const M=gt(this.properties.binCount)?this.calculateNiceBins(S,this.properties.binCount):this.properties.bins??this.deriveBins(S),D=M.length;return u=[...M],I=>{let k=I[0];if(Cs(k)&&(k=k.getTime()),!gt(k))return[];for(let C=0;C<D;C++){const A=M[C];if(k>=A[0]&&k<A[1]||C===D-1&&k<=A[1])return A}return[]}},{dataModel:f,processedData:y}=await this.requestDataModel(e,this.data,{props:d,groupByFn:p}),b=y,x=new Map;for(const[v,S]of b.groups.entries()){const M=S.keys;x.set(us(...M),{group:S,groupIndex:v})}this.calculatedBins=u.map(v=>{const S=x.get(us(...v));if(S){const{group:M,groupIndex:D}=S,[[I,k]=[0,0]]=M.aggregation,C=[...f.forEachDatum(this,b,M,D)],A=this.frequency(M),w=I+k;return{domain:v,datum:C,groupIndex:D,frequency:A,total:w}}else return{domain:v,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return{domain:[]};const s=i.getDomain(this,"groupAgg","aggregate",t).domain,n=this.calculatedBins[0].domain[0],a=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return e==="x"?{domain:bn([n,a])}:{domain:bn(s)}}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[Number.NaN,Number.NaN];const a=this.axes.x.scale,o=0;let r=-1/0;for(const{keys:l,aggregation:c}of n.groups){const[[h,d]=[0,0]]=c,[u,p]=l,[f,y]=Tt([a.convert(u),a.convert(p)]);if(y>=t&&f<=i){const b=h+d;r=Math.max(r,b)}}return o>r?[Number.NaN,Number.NaN]:[o,r]}frequency(e){return e.datumIndices.reduce((t,i)=>t+i.length,0)}createNodeDatumContext(e,t){const{xKey:i,yKey:s,xName:n,yName:a,label:o}=this.properties,{contextNodeData:r,processedData:l}=this,c=r?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:e.scale,yScale:t.scale,yAxisReversed:t.isReversed(),rawData:[],xValues:[],xKey:i,yKey:s,xName:n,yName:a,label:o,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?r.nodeData:[],nodeIndex:0}}createLabelData(e,t,i,s,n,a){const{label:o,yKey:r,xKey:l,xName:c,yName:h}=e,{total:d,datum:u}=t;if(!(!o.enabled||d===0))return{x:i+n/2,y:s+a/2,text:this.getLabelText(d,u,r,"y",[],o,{value:d,datum:u,xKey:l,yKey:r,xName:c,yName:h})}}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:s}=e,{domain:n,datum:a,groupIndex:o,frequency:r,total:l}=t;return{series:this,datumIndex:o,datum:a,aggregatedValue:l,frequency:r,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(e,t,i){const{xScale:s,yScale:n,yAxisReversed:a}=e,{domain:o,datum:r,groupIndex:l,frequency:c,total:h}=i,d=t,[u,p]=o,f=s.convert(u),y=s.convert(p),b=n.convert(0),x=n.convert(h),v=Math.abs(y-f),S=Math.abs(x-b),M=Math.min(f,y),D=Math.min(b,x);d.datumIndex=l,d.datum=r,d.aggregatedValue=h,d.frequency=c,d.domain=o,d.x=M,d.y=D,d.xValue=f,d.yValue=x,d.width=v,d.height=S,d.midPoint?(d.midPoint.x=M+v/2,d.midPoint.y=D+S/2):d.midPoint={x:M+v/2,y:D+S/2},d.topLeftCornerRadius=!a,d.topRightCornerRadius=!a,d.bottomRightCornerRadius=a,d.bottomLeftCornerRadius=a,d.label=this.createLabelData(e,i,M,D,v,S)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}populateNodeData(e){const{processedData:t}=this;if(t?.type==="grouped")for(const i of this.calculatedBins)Zk(e,i,(s,n)=>this.createNodeDatum(s,n),(s,n,a)=>this.updateNodeDatum(s,n,a))}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||e.animationEnabled,styles:KD(this.getItemStyle.bind(this))}}finalizeNodeData(e){super.finalizeNodeData(e),e.nodes.sort((t,i)=>t.x-i.x)}nodeFactory(){return new Ci}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return va(this.processedData)?i.update(t,void 0,s=>us(...s.domain)):i.update(t)}getItemStyle(e,t,i){const{properties:s}=this,n=this.getHighlightStyle(t,e,i);return re(n,s.getStyle())}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e;t.each((s,n)=>{t.isGarbage(s)||(n.style=this.getItemStyle(n.datumIndex,i))})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getShapeFillBBox();e.datumSelection.each((a,o)=>{const r=o.style??t.styles[this.getHighlightState(i,e.isHighlight,o.datumIndex)],{cornerRadius:l=0}=r,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:d,bottomLeftCornerRadius:u}=o;a.setStyleProperties(r,n),a.topLeftCornerRadius=c?l:0,a.topRightCornerRadius=h?l:0,a.bottomRightCornerRadius=d?l:0,a.bottomLeftCornerRadius=u?l:0,a.crisp=o.crisp,a.fillShadow=s})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(e){const t=this.isLabelEnabled(),{isHighlight:i=!1}=e,s=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((n,a)=>{const o=Ch(this,a,this.properties,this.properties.label,i,s),{enabled:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=o;r&&t&&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(o)):n.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof Le&&vb(e,t.children())}pickNodeClosestDatum(e){return Sb(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a,ctx:{localeManager:o}}=this,{xKey:r,xName:l,yKey:c,yName:h,tooltip:d,legendItemName:u}=a,p=n.x,f=n.y;if(!i||s?.type!=="grouped"||!p||!f)return;const y=s.groups[e],{aggregation:b,keys:x}=y,[[v,S]=[0,0]]=b,M=this.frequency(y),D=x,[I,k]=D,C=v+S,A={data:[...i.forEachDatum(this,s,y,e)],aggregatedValue:C,frequency:M,domain:D},w=[{label:l,fallbackLabel:r,value:`${this.getAxisValueText(p,"tooltip",I,A,r,u)} - ${this.getAxisValueText(p,"tooltip",k,A,r,u)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(f,"tooltip",M,A,c,u)}];if(c!=null){let T;switch(a.aggregation){case"sum":T=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":T=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":T=o.t("seriesHistogramTooltipCount",{yName:h??c});break}w.push({label:T,value:this.getAxisValueText(f,"tooltip",C,A,c,u)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:w},{seriesId:t,datum:A,title:h,xKey:r,xName:l,yKey:c,yName:h,xRange:[I,k],frequency:M,...this.getItemStyle(e,!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:Te(e)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(e){kb([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Pf(Of(!0,this.axes,"normal"),"unknown");ui(this.id,"datums",this.ctx.animationManager,[e],i),ti(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Pf(Of(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};ui(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(s,n)=>us(...n.domain),i),i?.changed&&ti(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Yk(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.label.itemStyler!=null}};TI.className="HistogramSeries",TI.type="histogram";var k5={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},highlight:Us}},OI={type:"series",name:"histogram",chartType:"cartesian",version:ue,dependencies:[ri],options:ZK,predictAxis:kf,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:k5,create:e=>new TI(e)},I5=10;function Wb(e,t,i,s,n,a,o,r){const l=e[a];if(l===void 0)return!1;const c=Number.isFinite(t)?Bn(l,t,i,o):_c(a,r),h=Mg(c,n);return a===s[h+Ys]||a===s[h+Zs]||a===s[h+Xs]||a===s[h+qs]}function eE(e,t,i,s,n,a,o,r){let l=0;for(let d=0;d<o;d++)Wb(e,t,i,s,n,d,a,o)&&l++;const c=r?.length===l?r:new Uint32Array(l);let h=0;for(let d=0;d<o;d++)Wb(e,t,i,s,n,d,a,o)&&(c[h++]=d);return c}function A5(e,t,i,s,n,a,o,r,l){let c=0;for(const u of e)Wb(t,i,s,n,a,u,o,r)&&c++;const h=l?.length===c?l:new Uint32Array(c);let d=0;for(const u of e)Wb(t,i,s,n,a,u,o,r)&&(h[d++]=u);return h}function PI(e,t,i,s){const n=t.length;if(n<bo)return;const[a,o]=e,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:c}=s;let h=vo(t,a,o,{xNeedsValueOf:r});const d=c?.find(b=>b.maxRange===h);let{indexData:u,valueData:p}=So(t,i,i,a,o,h,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),f=eE(t,a,o,u,h,r,n,d?.indices);const y=[{maxRange:h,indices:f,indexData:u,valueData:p}];for(;f.length>I5&&h>64;){const b=h,x=Math.trunc(b/2),v=c?.find(M=>M.maxRange===x),S=kl(u,p,b,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=S.maxRange,u=S.indexData,p=S.valueData,f=A5(f,t,a,o,u,h,r,n,v?.indices),y.push({maxRange:h,indices:f,indexData:u,valueData:p})}return y.reverse(),y}function C5(e,t,i,s){const n=t.length;if(n<bo)return;const[a,o]=e,{xNeedsValueOf:r,yNeedsValueOf:l,targetRange:c,existingFilters:h}=s,d=vo(t,a,o,{xNeedsValueOf:r}),u=Math.min(d,Fc(Math.max(c,br))),p=h?.find(S=>S.maxRange===u),{indexData:f,valueData:y}=So(t,i,i,a,o,u,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),b=eE(t,a,o,f,u,r,n,p?.indices),x={maxRange:u,indices:b,indexData:f,valueData:y};function v(){return PI([a,o],t,i,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:h})?.filter(M=>M.maxRange!==u)??[]}return{immediate:[x],computeRemaining:v}}function w5(e,t,i,s,n,a){const[o,r]=oi(e,s);return PI([o,r],t,i,{xNeedsValueOf:n,yNeedsValueOf:a})}var L5=Ar(w5);function N5(e,t,i,s,n,a){const o=t.resolveColumnById(n,"xValue",i),r=t.resolveColumnById(n,s,i),l=t.getDomain(n,"xValue","value",i),c=t.resolveColumnNeedsValueOf(n,"xValue",i),h=t.resolveColumnNeedsValueOf(n,s,i);if(a){const[d,u]=oi(e,l);return PI([d,u],o,r,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:a})}return L5(e,o,r,l,c,h)}function T5(e,t,i,s,n,a,o){const r=t.resolveColumnById(n,"xValue",i),l=t.resolveColumnById(n,s,i),c=t.getDomain(n,"xValue","value",i),h=t.resolveColumnNeedsValueOf(n,"xValue",i),d=t.resolveColumnNeedsValueOf(n,s,i),[u,p]=oi(e,c);return C5([u,p],r,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:a,existingFilters:o})}var mi=class extends eo{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Ml,this.marker=new sn,this.label=new Yn,this.tooltip=Lh(),this.connectMissingData=!1,this.sparklineMode=!1}};g([m],mi.prototype,"xKey",2),g([m],mi.prototype,"yKey",2),g([m],mi.prototype,"xName",2),g([m],mi.prototype,"yName",2),g([m],mi.prototype,"yFilterKey",2),g([m],mi.prototype,"stackGroup",2),g([m],mi.prototype,"normalizedTo",2),g([m],mi.prototype,"title",2),g([m],mi.prototype,"stroke",2),g([m],mi.prototype,"strokeWidth",2),g([m],mi.prototype,"strokeOpacity",2),g([m],mi.prototype,"lineDash",2),g([m],mi.prototype,"lineDashOffset",2),g([m],mi.prototype,"interpolation",2),g([m],mi.prototype,"styler",2),g([m],mi.prototype,"marker",2),g([m],mi.prototype,"label",2),g([m],mi.prototype,"tooltip",2),g([m],mi.prototype,"connectMissingData",2),g([m],mi.prototype,"sparklineMode",2);var O5=.25,EI=class extends ec{constructor(e){super({moduleCtx:e,propertyKeys:Ju,propertyNames:ep,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:tI({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:wh,datum:(t,i)=>({...Ib(t),...zf(t,i)})},clipFocusBox:!1}),this.properties=new mi,this.aggregationManager=new Tb}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(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:a,yKey:o,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:u,xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:h,yScale:d}),y=n>1||c!=null,b={invalidValue:null};l&&y&&(b.invalidValue=0),y&&!i&&(b.forceValue=0);const x={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},v=[],S=this.properties.allowNullKeys??!1;(!u||y)&&v.push(Hl(a,p,{id:"xKey",allowNullKey:S})),v.push(Lt(a,p,{id:"xValue",allowNullKey:S}),Lt(o,f,{id:"yValueRaw",...b,invalidValue:void 0})),r!=null&&v.push(Lt(r,f,{id:"yFilterRaw"})),y&&v.push(...nf(o,"normal",{id:"yValueCumulative",...b,groupId:x.marker},f)),Mt(c)&&v.push(Lt(o,f,{id:"yValue",...b,groupId:x.value}),Wx(Object.values(x),c)),this.needsDataModelDiff()&&(v.push(of(u?["xValue"]:void 0)),this.processedData&&v.push(Kx(this.id,this.processedData)));const{dataModel:M,processedData:D}=await this.requestDataModel(e,t,{props:v,groupByKeys:y,groupByData:!y});this.aggregateData(M,D),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:s}=this;if(!t||!i)return{domain:[]};const n=s.y;if(e==="x"){const o=t.resolveProcessedDataDefById(this,"xValue"),r=t.getDomain(this,"xValue","value",i);if(o?.def.type==="value"&&o.def.valueType==="category"){const l=t.getKeySortMetadata(this,"xValue",i);return{domain:r.domain,sortMetadata:l}}return{domain:bn(Ga(r.domain))}}const a=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&n instanceof Xn&&!(n instanceof np)){const o=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:bn(o)}}else return{domain:bn(a)}}getSeriesRange(e,t){return this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||va(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>T5(i.scale.type,e,t,this.yCumulativeKey(t),this,s,a),computeFull:a=>N5(i.scale.type,e,t,this.yCumulativeKey(t),this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ha.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=e.scale,a=t.scale,o=s.dataSources.get(this.id)?.data??[],[r,l]=n.range,c=Math.abs(l-r);this.aggregationManager.ensureLevelForRange(c);const h=this.aggregationManager.getFilterForRange(c),d=this.canIncrementallyUpdateNodes(h!=null);return{xAxis:e,yAxis:t,rawData:o,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("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(e,t,i){if(t.datum=e.rawData[i],t.xDatum=e.xValues[i],t.yDatum=e.yRawValues[i],t.yCumulative=e.yCumulativeValues[i],t.selected=e.selectionValues?.[i],t.x=e.xScale.convert(t.xDatum)+e.xOffset,t.y=e.yScale.convert(t.yCumulative)+e.yOffset,!!Number.isFinite(t.x)){if(t.yDatum!=null){const s=e.labelsEnabled?this.getLabelText(t.yDatum,t.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:t.yDatum,datum:t.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const a=e.nodes[e.nodeIndex];a.datum=t.datum,a.datumIndex=i,a.point={x:t.x,y:t.y,size:e.size},a.midPoint={x:t.x,y:t.y},a.cumulativeValue=t.yCumulative,a.yValue=t.yDatum,a.xValue=t.xDatum,a.labelText=s,a.selected=t.selected}else e.nodes.push({series:this,datum:t.datum,datumIndex:i,yKey:e.yKey,xKey:e.xKey,point:{x:t.x,y:t.y,size:e.size},midPoint:{x:t.x,y:t.y},cumulativeValue:t.yCumulative,yValue:t.yDatum,xValue:t.xDatum,capDefaults:e.capDefaults,labelText:s,selected:t.selected});e.nodeIndex++}this.updateSpanPoints(e,t)}}updateSpanPoints(e,t){const i=e.spanPoints.at(-1);if(t.yDatum!=null){const s={point:{x:t.x,y:t.y},xDatum:t.xDatum,yDatum:t.yCumulative};Array.isArray(i)?i.push(s):i==null?e.spanPoints.push([s]):(i.skip+=1,e.spanPoints.push([s]))}else e.connectMissingData||(Array.isArray(i)||i==null?e.spanPoints.push({skip:0}):i.skip+=1)}populateNodeData(e){const t={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0},i=e.dataAggregationFilter?.indices;let[s,n]=this.visibleRangeIndices("xValue",e.xAxis.range,i);s=Math.max(s-1,0),n=Math.min(n+1,i?.length??e.xValues.length),this.processedData.input.count<1e3&&(s=0,n=this.processedData.input.count);for(let a=s;a<n;a+=1)this.handleDatum(e,t,i?.[a]??a)}initializeResult(e){return{itemId:e.yKey,nodeData:e.nodes,labelData:e.nodes,strokeData:{itemId:e.yKey,spans:[]},scales:this.calculateScaling(),visible:this.visible,crossFiltering:!1,styles:wb(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){const i=e.spanPoints.flatMap(s=>Array.isArray(s)?Tf(s,this.properties.interpolation):[]);return t.strokeData={itemId:e.yKey,spans:i},t.crossFiltering=e.selectionValues?.some((s,n)=>s===e.yRawValues[n])??!1,t.segments=yb(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene,!1),t}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],visible:i,animationEnabled:s}=e,n=this.contextNodeData?.crossFiltering===!0,a=re(this.getHighlightStyle(),this.getStyle()),{strokeWidth:o,stroke:r,strokeOpacity:l,lineDash:c,lineDashOffset:h,opacity:d}=a,u=this.contextNodeData?.segments;t.setProperties({segments:u,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:d,stroke:r,strokeWidth:o,strokeOpacity:l*(n?O5:1),lineDash:c,lineDashOffset:h}),t.datum=u,s||(t.visible=i),Lb(this,t)}updateDatumSelection(e){let{nodeData:t}=e;const{datumSelection:i}=e,{contextNodeData:s,processedData:n,axes:a,properties:o}=this,{marker:r}=o;return t=s?.crossFiltering===!0||Qk(n.input.count,a.x.scale,r)?t:[],r.isDirty()&&(i.clear(),i.cleanup()),va(this.processedData)?i.update(t,void 0,c=>us(c.xValue)):i.update(t)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();t.each((a,o)=>{if(!t.isGarbage(a)){const r=this.getHighlightState(n,e.isHighlight,o.datumIndex),l=this.getStyle(r),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,o.datumIndex,l.marker);o.style=this.getMarkerStyle(s,o,u,{isHighlight:i,highlightState:r},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,n=this.ctx.animationManager.isSkipped(),a=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(s,e.drawingMode);i.each((l,c)=>{const h=this.getHighlightState(o,s,c.datumIndex),d=c.style??t.styles[h];this.applyMarkerStyle(d,l,c.point,a,{applyTranslation:n,selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(r,d)}),s||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((n,a)=>{const o=Ch(this,a,s,this.properties.label,t,i),{enabled:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=o;r&&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(t,a.datumIndex).opacity??1,n.setBoxing(o)):n.visible=!1})}makeStylerParams(e){const{id:t}=this,{marker:i,lineDash:s,lineDashOffset:n,stroke:a,strokeOpacity:o,strokeWidth:r,xKey:l,yKey:c}=this.properties,h=ku(e??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:t,stroke:a,strokeOpacity:o,strokeWidth:r,xKey:l,yKey:c}}makeItemStylerParams(e,t,i,s){const{xKey:n,yKey:a}=this.properties,o=e.resolveColumnById(this,"xValue",t)[i],r=e.resolveColumnById(this,"yValueRaw",t)[i],l=e.getDomain(this,"xValue","key",t).domain,c=e.getDomain(this,this.yCumulativeKey(t),"value",t).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...WD(o,r,n,a,l,c),xValue:o,yValue:r,...s,fill:h}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,tooltip:h,legendItemName:d}=a,u=a.allowNullKeys??!1,p=n.x,f=n.y;if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data?.[e],b=i.resolveColumnById(this,"xValue",s)[e],x=i.resolveColumnById(this,"yValueRaw",s)[e];if(b===void 0&&!u)return;const v=this.getStyle(),S=this.makeItemStylerParams(i,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:y},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",b,y,o,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",x,y,l,d),missing:hh(x)}]},{seriesId:t,datum:y,title:c,xKey:o,xName:r,yKey:l,yName:c,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:e,strokeOpacity:t,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:e,strokeOpacity:t,strokeWidth:i,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,title:o,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:e,id:t,itemId:n,legendItemName:r,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:r??o??a??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,t){const i=t.strokeData.spans,[s]=e;s.path.clear(),$k(s,i),s.markDirty("LineSeries")}resetDatumAnimation(e){Ab([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,paths:a}=e,{animationManager:o}=this.ctx;this.updateLinePaths(a,n),Jk(this,o,...a),Xi([t],zf),qk(this,o,{...this.getAnimationDrawingModes(),phase:"initial"},t),ti(this,"labels",o,i),ti(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:a,paths:o,previousContextData:r}=e,[l]=o;if(a.visible===!1&&r?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,a)},h=()=>{t.skipCurrentBatch(),c()};if(a==null||r==null){c(),Rf(this,t,"added",this.getAnimationDrawingModes(),i),Vr(this.id,"path_properties",t,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),ti(this,"labels",t,s),ti(this,"annotations",t,...n);return}if(a.crossFiltering!==r.crossFiltering){h();return}const d=sY(a,r,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){h();return}else if(d.status==="no-op")return;ui(this.id,"path_properties",t,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(o,a):d.status==="removed"?this.updateLinePaths(o,r):Ob(this.id,"path_update",t,[l],d.stroke.path),d.hasMotion&&(Rf(this,t,void 0,this.getAnimationDrawingModes(),i),ti(this,"labels",t,s),ti(this,"annotations",t,...n)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(o,a)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Li}getStyle(e){const{styler:t,marker:i,lineDash:s,lineDashOffset:n,stroke:a,strokeOpacity:o,strokeWidth:r}=this.properties,{size:l,shape:c,fill:h="transparent",fillOpacity:d}=i;let u={};if(t){const p=this.makeStylerParams(e),f=this.cachedCallWithContext(t,p)??{};u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],f,{pick:!1})??{}}return u.marker??(u.marker={}),{lineDash:u.lineDash??s,lineDashOffset:u.lineDashOffset??n,stroke:u.stroke??a,strokeOpacity:u.strokeOpacity??o,strokeWidth:u.strokeWidth??r,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??o,strokeWidth:u.marker.strokeWidth??i.strokeWidth??r}}}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,t.marker);return this.getMarkerStyle(this.properties.marker,e,i,{isHighlight:!0},void 0,t)}computeFocusBounds(e){return Cb(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};EI.className="LineSeries",EI.type="line";var P5={series:{stroke:yr,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",Ba],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"}},label:{...Ye,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:Nd,segmentation:vl}},$b={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:ue,dependencies:[ri],options:mf,predictAxis:kf,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:P5,create:e=>new EI(e)},RI=class extends jb{};RI.className="ScatterSeries",RI.type="scatter";var E5={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ba],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Ye,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:Us}},zI={type:"series",name:"scatter",chartType:"cartesian",version:ue,dependencies:[ri],options:cb,predictAxis:Ek,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:E5,create:e=>new RI(e)},tE=class extends zt{constructor(){super(...arguments),this.showInLegend=!1}};g([m],tE.prototype,"showInLegend",2);var VI=class extends Yn{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};g([m],VI.prototype,"text",2),g([m],VI.prototype,"spacing",2);var BI=class extends X{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};g([m],BI.prototype,"fill",2),g([m],BI.prototype,"fillOpacity",2);var ap=class extends Yn{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([m],ap.prototype,"offset",2),g([m],ap.prototype,"minAngle",2),g([m],ap.prototype,"minSpacing",2),g([m],ap.prototype,"maxCollisionOffset",2),g([m],ap.prototype,"avoidCollisions",2);var FI=class extends Yn{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([m],FI.prototype,"positionOffset",2),g([m],FI.prototype,"positionRatio",2);var Hf=class extends X{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([m],Hf.prototype,"colors",2),g([m],Hf.prototype,"length",2),g([m],Hf.prototype,"strokeWidth",2),g([m],Hf.prototype,"itemStyler",2);var Ve=class extends Ua{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(gi),this.strokes=Object.values(Fr),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 Bi(VI),this.title=new tE,this.innerCircle=new BI,this.shadow=new Bo,this.calloutLabel=new ap,this.sectorLabel=new FI,this.calloutLine=new Hf,this.tooltip=Lh()}};g([m],Ve.prototype,"angleKey",2),g([m],Ve.prototype,"angleName",2),g([m],Ve.prototype,"angleFilterKey",2),g([m],Ve.prototype,"radiusKey",2),g([m],Ve.prototype,"radiusName",2),g([m],Ve.prototype,"radiusMin",2),g([m],Ve.prototype,"radiusMax",2),g([m],Ve.prototype,"calloutLabelKey",2),g([m],Ve.prototype,"calloutLabelName",2),g([m],Ve.prototype,"sectorLabelKey",2),g([m],Ve.prototype,"sectorLabelName",2),g([m],Ve.prototype,"legendItemKey",2),g([m],Ve.prototype,"defaultColorRange",2),g([m],Ve.prototype,"defaultPatternFills",2),g([m],Ve.prototype,"fills",2),g([m],Ve.prototype,"strokes",2),g([m],Ve.prototype,"fillOpacity",2),g([m],Ve.prototype,"strokeOpacity",2),g([m],Ve.prototype,"lineDash",2),g([m],Ve.prototype,"lineDashOffset",2),g([m],Ve.prototype,"cornerRadius",2),g([m],Ve.prototype,"itemStyler",2),g([m],Ve.prototype,"rotation",2),g([m],Ve.prototype,"outerRadiusOffset",2),g([m],Ve.prototype,"outerRadiusRatio",2),g([m],Ve.prototype,"innerRadiusOffset",2),g([m],Ve.prototype,"innerRadiusRatio",2),g([m],Ve.prototype,"strokeWidth",2),g([m],Ve.prototype,"sectorSpacing",2),g([m],Ve.prototype,"hideZeroValueSectorsInLegend",2),g([m],Ve.prototype,"innerLabels",2),g([m],Ve.prototype,"title",2),g([m],Ve.prototype,"innerCircle",2),g([m],Ve.prototype,"shadow",2),g([m],Ve.prototype,"calloutLabel",2),g([m],Ve.prototype,"sectorLabel",2),g([m],Ve.prototype,"calloutLine",2),g([m],Ve.prototype,"tooltip",2);function _I(e,t,i,s){const n=[i.convert(0),i.convert(1)],a=[s.convert(0),s.convert(1)],o=Math.PI/-2+lt(t),r=e?"initial":"update",l=({radius:f})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*f}),c=({radius:f})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*f});return{nodes:{toFn:(f,y,b,{prevLive:x})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D}=y;const{stroke:I,fill:k}=y.sectorFormat;if(b==="removed"&&x?(v=x.datum?.endAngle,S=x.datum?.endAngle):b==="removed"&&!x&&(v=o,S=o),b==="removed"){const A=l(y);M=A.innerRadius,D=A.outerRadius}return{startAngle:v,endAngle:S,outerRadius:D,innerRadius:M,stroke:I,...typeof k=="string"?{fill:k}:{}}},fromFn:(f,y,b,{prevFromProps:x})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D}=f,{fill:I,stroke:k}=y.sectorFormat;if(b==="updated"&&f.previousDatum==null&&(b="added"),b==="unknown"||b==="added"&&!x?(v=o,S=o,M=y.innerRadius,D=y.outerRadius):b==="added"&&x&&(v=x.endAngle??o,S=x.endAngle??o,M=x.innerRadius??y.innerRadius,D=x.outerRadius??y.outerRadius),b==="added"&&!e){const A=c(y);M=A.innerRadius,D=A.outerRadius}return b==="updated"&&(I=f.fill??I,k=(typeof f.stroke=="string"?f.stroke:void 0)??k),{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D,stroke:k,phase:r,...typeof I=="string"?{fill:I}:{}}}},innerCircle:{fromFn:(f,y)=>({size:f.previousDatum?.radius??f.size??0,phase:r}),toFn:(f,y)=>({size:y.radius??0})}}}function R5(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function z5(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,n=Math.atan2(i,s),a=e.getItemNodes();for(const o of a)if(o.datum.missing!==!0&&Qs(n,o.startAngle,o.endAngle)){const r=Math.hypot(s,i);let l=0;return r<o.innerRadius?l=o.innerRadius-r:r>o.outerRadius&&(l=r-o.outerRadius),{datum:o.datum,distance:l}}}var V5=class extends eb{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Kb=class extends iI{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...SP,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...MP,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:R5,label:wh}}),this.properties=new Ve,this.phantomNodeData=void 0,this.backgroundGroup=new ds({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Ah,this.radiusScale=new Ah,this.phantomGroup=this.contentGroup.appendChild(new Le({name:"phantom",zIndex:-1})),this.phantomSelection=pi.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new Le({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=pi.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Le({name:"pieCalloutLabels"})),this.calloutLabelSelection=new pi(this.calloutLabelGroup,Le),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Le({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Li({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Li({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Le({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Le({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=pi.select(this.innerLabelsGroup,xn),this.innerCircleSelection=pi.select(this.innerCircleGroup,()=>new Li({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=V5,this.angleScale=new Ah,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.backgroundGroup.remove()}setZIndex(e){super.setZIndex(e),this.backgroundGroup.zIndex=[0,e]}nodeFactory(){const e=new vs;return e.miterLimit=1e9,e}getSeriesDomain(e){return e==="angle"?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:a,radiusKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(x,v)=>t&&s.getItemEnabled({seriesId:i,itemId:v})?x:0,d=!this.ctx.animationManager.isSkipped(),u=this.properties.allowNullKeys??!1,p=[],f=[];c?p.push(Hl(c,"category",{id:"legendItemKey",allowNullKey:u})):r?p.push(Hl(r,"category",{id:"calloutLabelKey",allowNullKey:u})):l&&p.push(Hl(l,"category",{id:"sectorLabelKey",allowNullKey:u}));const y=this.radiusScale.type,b=this.angleScale.type;o&&f.push(hW(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Lt(o,y,{id:"radiusRaw",processor:h}),HD("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&f.push(Lt(r,"category",{id:"calloutLabelValue",allowNullKey:u})),l&&f.push(Lt(l,"category",{id:"sectorLabelValue",allowNullKey:u})),c&&f.push(Lt(c,"category",{id:"legendItemValue",allowNullKey:u})),a&&f.push(_D(a,b,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Lt(a,b,{id:"angleFilterRaw"}),HD("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&f.push(Kx(this.id,this.processedData)),f.push(of()),await this.requestDataModel(e,this.data,{props:[...p,_D(n,b,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Lt(n,b,{id:"angleRaw"}),HD("angleValue",[0,1],0,0),...f]});for(const x of this.processedData?.defs?.values??[]){const{id:v,missing:S,property:M}=x,D=FT(this,S);v!=="angleRaw"&&D>0&&K.warnOnce(`no value was found for the key '${String(M)}' on ${D} data element${D>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,e.length>0&&ha.record(`${this.type}:nodeData`,e.length),this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey==null?void 0:e.resolveColumnById(this,"angleFilterValue",t),a=this.properties.angleFilterKey==null?void 0:e.resolveColumnById(this,"angleFilterRaw",t),o=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,r=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:a,radiusValues:o,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:o,innerRadiusRatio:r}=this.properties;if(!i||t?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:h,angleFilterValues:d,angleFilterRawValues:u,radiusValues:p,radiusRawValues:f,legendItemValues:y}=l,b=u?.some((k,C)=>k>h[C])??!1;let x=0,v=0;const S=[],M=u==null?void 0:[],D=t.dataSources.get(this.id)?.data??[],I=t.invalidData?.get(this.id);for(const[k,C]of D.entries()){if(I?.[k]===!0)continue;const A=b?d[k]:c[k],w=u!=null&&!b?Math.sqrt(u[k]/h[k]):1,T=s.convert(x)+lt(o);x=A,v+=A;const O=s.convert(x)+lt(o),z=Math.abs(O-T),V=T+z/2,E=h[k],G=(p?.[k]??1)*w,B=f?.[k],F=y?.[k],Y=this.getLabels(k,C,V,z,l),Z=this.getItemStyle({datum:C,datumIndex:k},!1),ie={series:this,datum:C,datumIndex:k,angleValue:E,midAngle:V,midCos:Math.cos(V),midSin:Math.sin(V),startAngle:T,endAngle:O,radius:G,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(G),0),sectorFormat:Z,radiusValue:B,legendItemValue:F,enabled:a&&n.getItemEnabled({seriesId:e,itemId:k}),focusable:!0,...Y};S.push(ie),M?.push({...ie,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=v===0,this.zerosumInnerRing.visible=v===0&&r!=null&&r!==1&&r>0,{itemId:e,nodeData:S,labelData:S,phantomNodeData:M}}getLabelContent(e,t,i){const{id:s,ctx:n,properties:a}=this,{formatManager:o}=n,{calloutLabel:r,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:d}=a,u=a.allowNullKeys??!1,p=i.calloutLabelValues?.[e],f=i.sectorLabelValues?.[e],y=i.legendItemValues?.[e],b={datum:t,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},x={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(x.callout=this.getLabelText(p,t,c,"calloutLabel",[],r,{...b,value:p},u)),h&&(x.sector=this.getLabelText(f,t,h,"sectorLabel",[],l,{...b,value:f},u)),d!=null&&(y!=null||u)){const v=y??"";x.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:u?y:v,datum:t,seriesId:s,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??v}return x}getLabels(e,t,i,s,n){const{properties:a}=this,{calloutLabel:o,sectorLabel:r,legendItemKey:l}=a,c=this.getLabelContent(e,t,n),h={};return o.enabled&&c.callout&&s>=lt(o.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),r.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=wg(e),s=-.75*Math.PI,n=i-s,a=Math.floor(n/(Math.PI/2)),o=g0(a,t.length);return t[o]}getFillParams(e,t,i){if(!(!Qt(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getItemStyle({datum:e,datumIndex:t},i,s,n){const{fills:a,strokes:o,itemStyler:r}=this.properties,l=o[t],c=a[t],{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:f,lineDash:y,lineDashOffset:b,cornerRadius:x,opacity:v}=re(this.getHighlightStyle(i,t,s,n),{fill:c,stroke:l},this.properties);let S;return r&&(S=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>{const M=this.makeItemStylerParams(e,t,i,{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:f,lineDash:y,lineDashOffset:b,cornerRadius:x});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,M),{proxyPaths:{fill:["fills",`${t}`],stroke:["strokes",`${t}`]}})})),{fill:S?.fill??h,fillOpacity:S?.fillOpacity??d,stroke:S?.stroke??u,strokeWidth:S?.strokeWidth??p,strokeOpacity:S?.strokeOpacity??f,lineDash:S?.lineDash??y,lineDashOffset:S?.lineDashOffset??b,cornerRadius:S?.cornerRadius??x,opacity:v}}makeItemStylerParams(e,t,i,s){const{angleKey:n,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(s.fill)??s.fill;return{datum:e,angleKey:n,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l,...s,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,t),seriesId:this.id}}getCalloutLineStyle(e,t){const{properties:i}=this;let s={};if(i.calloutLine.itemStyler){const n=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),t,e.datumIndex),a={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:e.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:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);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 e=Math.max(0,this.radiusScale.range[1]);if(e===0)return Number.NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Hn(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),t){const n=this.getTitleTranslationY();t.node.y=Number.isFinite(n)?n:0;const a=t.node.getBBox();t.node.visible=t.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(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&e.node.remove(),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};for(const t of this.nodeData)e(t);if(this.phantomNodeData)for(const t of this.phantomNodeData)e(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:s,calloutLabelSelection:n,labelSelection:a,highlightLabelSelection:o,innerLabelsSelection:r}=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(e,this.nodeData),h(t,l),h(i,this.phantomNodeData??[]),h(s,c??[]),n.update(this.calloutNodeData,d=>{const u=new Kn;u.tag=0,u.pointerEvents=1,d.appendChild(u);const p=new xn;p.tag=1,p.pointerEvents=1,d.appendChild(p)}),a.update(this.nodeData),o.update(l),r.update(this.properties.innerLabels,d=>{d.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),a=1;t=Math.ceil(n*2+a)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=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),o=this.isSeriesHighlighted(t,a),r=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&o,this.labelGroup.visible=i,this.innerCircleSelection.each((p,{radius:f})=>{p.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:f})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),d=this.ctx.animationManager.isSkipped(),u=(p,f,y,b,x)=>{const v=this.getItemStyle(f,b,void 0,a);f.sectorFormat.fill=v.fill,f.sectorFormat.stroke=v.stroke,d&&(p.startAngle=f.startAngle,p.endAngle=f.endAngle,p.innerRadius=f.innerRadius,p.outerRadius=f.outerRadius),(b||d)&&(p.fill=v.fill,p.stroke=v.stroke);const S=this.getFillParams(v.fill,l,c);p.setStyleProperties(v,h,S),p.drawingMode=x,p.cornerRadius=v.cornerRadius,p.fillShadow=this.properties.shadow;const M=Math.max((this.properties.sectorSpacing+(v.stroke==null?0:v.strokeWidth))/2,0);p.inset=M,p.lineJoin=this.properties.sectorSpacing>=0||M>0?"miter":"round"};this.itemSelection.each((p,f,y)=>u(p,f,y,!1,"overlay")),this.phantomSelection.each((p,f,y)=>u(p,f,y,!1,"overlay")),this.highlightSelection.each((p,f,y)=>{u(p,f,y,!0,r),p.visible=f.datumIndex===t?.datumIndex}),this.phantomHighlightSelection.each((p,f,y)=>{u(p,f,y,!0,r),p.visible=f.datumIndex===t?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:e}=this.properties,{offset:t}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i);for(const n of this.calloutLabelSelection.selectByTag(0)){const a=n.closestDatum(),o=s&&this.isItemHighlighted(i,a.datumIndex)===!0,{length:r,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(a,!1),d=l,u=HM(h)?h:e,{calloutLabel:p,outerRadius:f,datumIndex:y}=a;if(p?.text&&!p.hidden&&f!==0){n.visible=!0,n.strokeWidth=d,n.stroke=c??u[y%u.length],n.strokeOpacity=this.getHighlightStyle(o,a.datumIndex).opacity??1,n.fill=void 0;const b=a.midCos*f,x=a.midSin*f;let v=a.midCos*(f+r),S=a.midSin*(f+r);if((p.collisionTextAlign??p.collisionOffsetY!==0)&&p.box!=null){const D=p.box;let I=v,k=S;v<D.x?I=D.x:v>D.x+D.width&&(I=D.x+D.width),S<D.y?k=D.y:S>D.y+D.height&&(k=D.y+D.height);const C=I-v,A=k-S,w=Math.sqrt(Math.pow(C,2)+Math.pow(A,2)),T=w-t;T>0&&(v=v+C*T/w,S=S+A*T/w)}n.x1=b,n.y1=x,n.x2=v,n.y2=S}else n.visible=!1}}getLabelOverflow(e,t){const i=-this.centerX,s=i+t.width,n=-this.centerY,a=n+t.height,o=1;let r=e.width;e.x+o<i?r=(e.x+e.width-i)/e.width:e.x+e.width-o>s&&(r=(s-e.x)/e.width);const l=e.y+o<n||e.y+e.height-o>a,c=this.bboxIntersectsSurroundingSeries(e);return{maxWidth:r,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t}=this.properties,{offset:i,minSpacing:s}=t,n=e.convert(0),a=b=>!b.calloutLabel||b.outerRadius===0,o=this.calloutNodeData,r=o.filter(b=>!a(b));for(const b of r){const x=b.calloutLabel;x!=null&&(x.hidden=!1,x.collisionTextAlign=void 0,x.collisionOffsetY=0)}if(r.length<=1)return;const l=r.filter(b=>b.midCos<0).sort((b,x)=>b.midSin-x.midSin),c=r.filter(b=>b.midCos>=0).sort((b,x)=>b.midSin-x.midSin),h=r.filter(b=>b.midSin<0&&b.calloutLabel?.textAlign==="center").sort((b,x)=>b.midCos-x.midCos),d=r.filter(b=>b.midSin>=0&&b.calloutLabel?.textAlign==="center").sort((b,x)=>b.midCos-x.midCos),u=b=>{const x=b.calloutLabel;if(x==null)return le.zero.clone();const v=this.getLabelStyle(b,t,"calloutLabel"),S=Au(v),M=this.getCalloutLineStyle(b,!1).length,D=b.outerRadius+M+i,I=b.midCos*D,k=b.midSin*D+x.collisionOffsetY,C=x.collisionTextAlign??x.textAlign,A=x.textBaseline;return xn.measureBBox(x.text,I,k,{font:this.properties.calloutLabel,textAlign:C,textBaseline:A}).grow(S)},p=(b,x,v)=>{const S=u(b).grow(s/2),M=u(x).grow(s/2);S.x<M.x+M.width&&S.x+S.width>M.x&&(v==="to-top"?S.y<M.y+M.height:S.y+S.height>M.y)&&(x.calloutLabel.collisionOffsetY=v==="to-top"?S.y-M.y-M.height:S.y+S.height-M.y)},f=b=>{const x=b.slice().sort((S,M)=>Math.abs(S.midSin)-Math.abs(M.midSin))[0],v=b.indexOf(x);for(let S=v-1;S>=0;S--){const M=b[S+1],D=b[S];p(M,D,"to-top")}for(let S=v+1;S<b.length;S++){const M=b[S-1],D=b[S];p(M,D,"to-bottom")}},y=b=>{const x=r.some(k=>k.calloutLabel.collisionOffsetY!==0),v=b.map(k=>u(k)),S=v.map(k=>k.clone().grow(s/2));let M=!1;for(let k=0;k<S.length&&!M;k++){const C=S[k];for(let A=k+1;A<b.length;A++){const w=S[A];if(C.collidesBBox(w)){M=!0;break}}}const D=o.map(k=>{const{startAngle:C,endAngle:A,outerRadius:w}=k;return{startAngle:C,endAngle:A,innerRadius:n,outerRadius:w}}),I=v.some(k=>D.some(C=>yY(k,C)));if(!(!M&&!x&&!I))for(const k of b){if(k.calloutLabel.textAlign!=="center")continue;const C=k.calloutLabel;k.midCos<0?C.collisionTextAlign="right":k.midCos>0?C.collisionTextAlign="left":C.collisionTextAlign="center"}};f(l),f(c),y(h),y(d)}getLabelStyle(e,t,i,s=!1){const n=this.ctx.highlightManager?.getActiveHighlight();return Ch(this,e,this.properties,t,s,n,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i}=this.properties,s=new xn,n=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(n);for(const o of this.calloutLabelSelection.selectByTag(1)){const r=o.closestDatum(),l=r.calloutLabel,c=t.convert(r.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){o.visible=!1;continue}const d=a&&this.isItemHighlighted(n,r.datumIndex)===!0,u=this.getLabelStyle(r,i,"calloutLabel",d),p=this.getCalloutLineStyle(r,!1).length,f=h+p+i.offset,y=r.midCos*f,b=r.midSin*f+l.collisionOffsetY,x={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};s.text=l.text,s.x=y,s.y=b,s.setFont(u),s.setAlign(x),s.setBoxing(u);const v=s.getBBox();let S=l.text,M=!0;if(i.avoidCollisions){const{maxWidth:D,hasVerticalOverflow:I}=this.getLabelOverflow(v,e);if(v.width>D){const k={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:D};S=qd(l.text,k)}M=!I}o.text=S,o.x=y,o.y=b,o.setFont(u),o.setAlign(x),o.setBoxing(u),o.fill=u.color,o.fillOpacity=this.getHighlightStyle(d,r.datumIndex).opacity??1,o.visible=M}}computeLabelsBBox(e,t){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 o=[],r=new xn;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(r.text=c.text,r.x=0,r.y=h,r.setFont(c),r.setAlign({textBaseline:"bottom",textAlign:"center"}),l=r.getBBox(),o.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,f=h.outerRadius+p+s,y=h.midCos*f,b=h.midSin*f+d.collisionOffsetY;r.text=d.text,r.x=y,r.y=b,r.setFont(u),r.setAlign({textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline}),r.setBoxing(u);const x=r.getBBox();if(d.box=x,Math.abs(d.collisionOffsetY)>n){d.hidden=!0;continue}if(l){const v=-this.centerY,S=new le(l.x-a,v,l.width+2*a,l.y+l.height+a-v);if(x.collidesBBox(S)){d.hidden=!0;continue}}if(e.hideWhenNecessary){const{maxWidth:v,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(x,t),D=x.width>v;if(S||D||M){d.hidden=!0;continue}}d.hidden=!1,o.push(x)}return o.length===0?null:le.merge(o)}updateSectorLabelNodes(){const{properties:e}=this,{positionOffset:t,positionRatio:i}=this.properties.sectorLabel,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(s),a=this.radiusScale.convert(0),o=a<=0&&this.ctx.legendManager.getData(this.id)?.filter(c=>c.enabled).length===1,r={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,d)=>{const{outerRadius:u,startAngle:p,endAngle:f}=d,y=n&&this.isItemHighlighted(s,d.datumIndex)===!0;let b=!1;if(d.sectorLabel&&u!==0){const x=this.getLabelStyle(d,e.sectorLabel,"sectorLabel",y),v=a*(1-i)+u*i+t;h.fill=x.color,h.fillOpacity=this.getHighlightStyle(y,d.datumIndex).opacity??1,h.text=d.sectorLabel.text,o?(h.x=0,h.y=0):(h.x=d.midCos*v,h.y=d.midSin*v),h.setFont(x),h.setAlign(r),h.setBoxing(x);const S=h.getBBox(),M=[[S.x,S.y],[S.x+S.width,S.y],[S.x+S.width,S.y+S.height],[S.x,S.y+S.height]],D={startAngle:p,endAngle:f,innerRadius:a,outerRadius:u};M.every(([I,k])=>lI(I,k,D))&&(b=!0)}h.visible=b});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,color:b}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=f,h.fontFamily=y,h.text=d.text,h.x=0,h.y=0,h.fill=b,h.textAlign="center",e.push(h.getBBox()),t.push(d.spacing)});const i=h=>h===0?0:t[h],s=h=>h===t.length-1?0:t[h],n=e.reduce((h,d)=>Math.max(h,d.width),0),a=e.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(a/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,d=-a/2;h<e.length;h++){const p=e[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]-e[u].height:h.y=c[u]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return z5(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:a}}=this,{legendItemKey:o,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:f,tooltip:y}=n,b=this.properties.title.node.getPlainText();if(!i||!s)return;const x=s.dataSources.get(this.id)?.data?.[e],v=this.getProcessedDataValues(i,s),{angleRawValues:S}=v,M=S[e],D=this.getLabelContent(e,x,v),I=D.legendItem??D.callout??D.sector??u,k=rd(i.getDomain(this,"angleRaw","value",s)),C=a.format(this.callWithContext.bind(this),{type:"number",value:M,datum:x,seriesId:t,legendItemName:void 0,key:d,source:"tooltip",property:"angle",domain:k,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??ya(M,3);return this.formatTooltipWithContext(y,{title:b,symbol:this.legendItemSymbol(e),data:[{label:Ne(I),fallbackLabel:d,value:C}]},{seriesId:t,datum:x,title:u,legendItemKey:o,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:f,...this.getItemStyle({datum:x,datumIndex:e},!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.data?.[e],i=this.getItemStyle({datum:t,datumIndex:e},!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return Qt(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:n,ctx:{legendManager:a}}=this;if(!s||!i||e!=="category")return[];const{angleKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===o)&&(!l||l===o))return[];const d=this.getProcessedDataValues(s,i),{angleRawValues:u}=d,p=this.properties.title?.showInLegend&&this.properties.title.text,f=[],y=this.properties.hideZeroValueSectorsInLegend,b=i.dataSources.get(this.id)?.data,x=i.invalidData?.get(this.id);for(let v=0;v<i.input.count;v++){const S=b?.[v],M=u[v];if(x?.[v]===!0||y&&M===0)continue;const D=[];p&&D.push(p);const I=this.getLabelContent(v,S,d);c&&I.legendItem!==void 0?D.push(I.legendItem):r&&r!==o&&I.callout!==void 0?D.push(I.callout):l&&l!==o&&I.sector!==void 0&&D.push(I.sector),D.length!==0&&f.push({legendType:"category",id:n,datum:S,itemId:v,seriesId:n,hideToggleOtherSeries:!0,enabled:t&&a.getItemEnabled({seriesId:n,itemId:v}),label:{text:D.map(k=>Ne(k)).join(" - ")},symbol:this.legendItemSymbol(v),legendItemName:c==null?void 0:S[c],hideInLegend:!h})}return f}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;for(const[n,a]of e.entries())i.toggleItem(a,t,n);i.update(),s.update(7)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=_I(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);ui(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),ui(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),ti(this,"callout",t,this.calloutLabelSelection),ti(this,"sector",t,this.labelSelection,this.highlightLabelSelection),ti(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:s,processedData:n,radiusScale:a,previousRadiusScale:o}=this,{animationManager:r}=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(f=>f.enabled),p=_I(!1,this.properties.rotation,a,o);ui(this.id,"nodes",r,[e,t,i,s],p.nodes,(f,y)=>this.getDatumId(y.datumIndex),l),ui(this.id,"innerCircle",r,[this.innerCircleSelection],p.innerCircle),ti(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ti(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,ti(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=_I(!1,this.properties.rotation,n,a);ui(this.id,"nodes",o,[e,t,i,s],r.nodes,(l,c)=>this.getDatumId(c.datumIndex)),ui(this.id,"innerCircle",o,[this.innerCircleSelection],r.innerCircle),xb(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),xb(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),xb(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return`${e}`;const{calloutLabelKey:s,sectorLabelKey:n,legendItemKey:a}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${e}`;if(a){const o=t.resolveKeysById(this,"legendItemKey",i);return us(o[e])}else if(s){const o=t.resolveKeysById(this,"calloutLabelKey",i);return us(o[e])}else if(n){const o=t.resolveKeysById(this,"sectorLabelKey",i);return us(o[e])}return`${e}`}hasItemStylers(){return!(this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(e=>e.itemStyler==null))}};Kb.className="DonutSeries",Kb.type="donut";var HI={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ki.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Ye,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",yy],["pattern",tt],["image",it]]}]},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:Mo,xOffset:3,yOffset:3,blur:5},highlight:vy},legend:{enabled:!0}},B5={...HI,series:{...HI.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...Ye,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:vy}},iE={type:"series",name:"donut",chartType:"polar",version:ue,dependencies:[Wr],options:NO,themeTemplate:B5,create:e=>new Kb(e)},GI=class extends Kb{};GI.className="PieSeries",GI.type="pie";var sE={type:"series",name:"pie",chartType:"polar",version:ue,dependencies:[Wr],options:To,themeTemplate:HI,create:e=>new GI(e)},jI=class extends hi{constructor(e){super(),this.ctx=e,this.localeText=void 0}};g([Xt(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),m],jI.prototype,"localeText",2),g([Xt(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),m],jI.prototype,"getLocaleText",2);var WI={type:"plugin",name:"locale",version:ue,options:{localeText:or,getLocaleText:Di(L)},create:e=>new jI(e)},$I={type:"axis",name:"number",chartType:"cartesian",version:ue,dependencies:[ri],options:Bu,themeTemplate:{line:{enabled:!1}},create:e=>new Xn(e)},nE={type:"axis",name:"log",chartType:"cartesian",version:ue,dependencies:[ri],options:Fu,themeTemplate:{base:10,line:{enabled:!1}},create:e=>new np(e)},KI={type:"axis",name:"time",chartType:"cartesian",version:ue,dependencies:[ri],options:_u,themeTemplate:{gridLine:{enabled:!1}},create:e=>new Vo(e)},aE={type:"axis",name:"category",chartType:"cartesian",version:ue,dependencies:[ri],options:zu,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:e=>new If(e)},oE={type:"axis",name:"grouped-category",chartType:"cartesian",version:ue,dependencies:[ri],options:Vu,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:e=>new Cf(e)},Kr=class extends IP{constructor(e){super(e,new Kl,!1),this.parentLevel=new Qu,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:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!0}processData(){super.processData();let e;const{domain:t}=this.dataDomain;if(t.length===2&&t[0].valueOf()===t[1].valueOf())e=ru(t[0]);else{const{boundSeries:i,direction:s,min:n,max:a}=this;e=F2(i,s,n,a)}Ht(this.defaultUnit,e)||(this.defaultUnit=e)}updateScale(){super.updateScale(),this.scale.interval=this.unit??this.defaultUnit}normaliseDataDomain(e){const{extent:t,clipped:i}=Pg(e,this.min,this.max,this.preferredMin,this.preferredMax);return{domain:t,clipped:i}}tickFormatParams(e,t,i,s){s??(s=Hg(t));const n=Gg(e),a=xa(s),o=ja(s),r=El(s);return{type:"date",unit:a,step:o,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){const a=this.unit??this.defaultUnit??"millisecond";s??(s=a);const{datum:o,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}=t,f=xa(s),y=ja(s),b=El(s);return{type:"date",value:en(a,e),datum:o,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p,unit:f,step:y,epoch:b,style:n}}};Kr.className="UnitTimeAxis",Kr.type="unit-time",g([m],Kr.prototype,"parentLevel",2),g([m],Kr.prototype,"min",2),g([m],Kr.prototype,"max",2),g([m],Kr.prototype,"preferredMin",2),g([m],Kr.prototype,"preferredMax",2),g([m],Kr.prototype,"unit",2);var rE={type:"axis",name:"unit-time",chartType:"cartesian",version:ue,dependencies:[ri],options:Hu,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:!1},parentLevel:{enabled:!0},interval:{placement:"between"}},create:e=>new Kr(e)},lE=[$I,nE,KI,aE,oE,rE],cE=[DI,_b,NI,OI,$b,zI],F5=[lE,cE,vI,WI].flat(),hE=[Wr,iE,sE,vI,WI],UI=[F5,hE,jP].flat(),Ub={};Ws(Ub,{Arc:()=>Fo,BBox:()=>le,Caption:()=>zt,CategoryScale:()=>Cu,Group:()=>Le,Line:()=>Kn,LinearScale:()=>Ah,Marker:()=>Li,Path:()=>Ai,RadialColumnShape:()=>to,Rect:()=>Ci,Scene:()=>Fx,Sector:()=>vs,Shape:()=>Jc,TranslatableGroup:()=>ds,getRadialColumnWidth:()=>TP,toRadians:()=>lt});var Yb={};Ws(Yb,{AGGREGATION_INDEX_UNSET:()=>Dl,AGGREGATION_INDEX_X_MAX:()=>Zs,AGGREGATION_INDEX_X_MIN:()=>Ys,AGGREGATION_INDEX_Y_MAX:()=>qs,AGGREGATION_INDEX_Y_MIN:()=>Xs,AGGREGATION_MAX_POINTS:()=>HL,AGGREGATION_MIN_RANGE:()=>br,AGGREGATION_SPAN:()=>Vn,AGGREGATION_THRESHOLD:()=>bo,AbstractModuleInstance:()=>hi,ActionOnSet:()=>_e,AdjacencyListGraph:()=>uM,AsyncAwaitQueue:()=>Lg,BASE_FONT_SIZE:()=>Va,BREAK_TRANSFORM_CHAIN:()=>dg,BaseProperties:()=>X,Border:()=>Mr,CANVAS_HEIGHT:()=>qL,CANVAS_TO_BUFFER_DEFAULTS:()=>QL,CANVAS_WIDTH:()=>XL,CARTESIAN_AXIS_TYPE:()=>R0,CARTESIAN_POSITION:()=>E0,CallbackCache:()=>eM,ChangeDetectableProperties:()=>Zc,ChartAxisDirection:()=>Sg,ChartTheme:()=>Qa,ChartUpdateType:()=>xr,CleanupRegistry:()=>pt,Color:()=>Oe,ConfiguredCanvasMixin:()=>JL,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Od,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>Rd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>zd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Vd,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Bd,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Pd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Ed,DEFAULT_CAPTION_ALIGNMENT:()=>Sr,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Do,DEFAULT_FIBONACCI_STROKES:()=>Td,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>rs,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ls,DEFAULT_POLAR_SERIES_STROKE:()=>kg,DEFAULT_SHADOW_COLOUR:()=>Mo,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Ig,DEFAULT_TEXTBOX_COLOR:()=>Hd,DEFAULT_TEXTBOX_FILL:()=>Fd,DEFAULT_TEXTBOX_STROKE:()=>_d,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Ag,DEFAULT_TOOLBAR_POSITION:()=>Gd,DIRECTION_SWAP_AXES:()=>Ld,Debug:()=>be,DebugMetrics:()=>ha,DeclaredSceneChangeDetection:()=>Ee,DeclaredSceneObjectChangeDetection:()=>du,Deprecated:()=>sN,DeprecatedAndRenamedTo:()=>nN,EllipsisChar:()=>pd,ErrorType:()=>l0,EventEmitter:()=>Pn,FILL_GRADIENT_BLANK_DEFAULTS:()=>G0,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>W0,FILL_GRADIENT_LINEAR_DEFAULTS:()=>Vi,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>j0,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>fy,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>gy,FILL_GRADIENT_RADIAL_DEFAULTS:()=>vg,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Ba,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>yy,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>my,FILL_IMAGE_BLANK_DEFAULTS:()=>U0,FILL_IMAGE_DEFAULTS:()=>it,FILL_PATTERN_BLANK_DEFAULTS:()=>$0,FILL_PATTERN_DEFAULTS:()=>tt,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>K0,FILL_PATTERN_KEYED_DEFAULTS:()=>by,FILL_PATTERN_SINGLE_DEFAULTS:()=>xy,FONT_SIZE:()=>P0,FONT_SIZE_RATIO:()=>ki,IS_DARK_THEME:()=>Il,InterpolationProperties:()=>Ml,LABEL_BOXING_DEFAULTS:()=>Ye,LEGEND_CONTAINER_THEME:()=>My,LRUCache:()=>Wp,LineSplitter:()=>sr,Logger:()=>K,MARKER_SERIES_HIGHLIGHT_STYLE:()=>Nd,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Us,MementoCaretaker:()=>Dy,ModuleRegistry:()=>fe,ModuleType:()=>VS,ObserveChanges:()=>Xt,PALETTE_ALT_DOWN_FILL:()=>Ey,PALETTE_ALT_DOWN_STROKE:()=>Oy,PALETTE_ALT_NEUTRAL_FILL:()=>Ry,PALETTE_ALT_NEUTRAL_STROKE:()=>zy,PALETTE_ALT_UP_FILL:()=>Py,PALETTE_ALT_UP_STROKE:()=>Ty,PALETTE_DOWN_FILL:()=>wy,PALETTE_DOWN_STROKE:()=>Ay,PALETTE_NEUTRAL_FILL:()=>Ny,PALETTE_NEUTRAL_STROKE:()=>Ly,PALETTE_UP_FILL:()=>Cy,PALETTE_UP_STROKE:()=>Iy,PART_WHOLE_HIGHLIGHT_STYLE:()=>vy,POLAR_AXIS_SHAPE:()=>V0,POLAR_AXIS_TYPE:()=>z0,PREV_NEXT_KEYS:()=>Ud,Padding:()=>Cr,ParallelStateMachine:()=>wM,PolarZIndexMap:()=>q0,PropertiesArray:()=>Bi,Property:()=>m,ProxyOnWrite:()=>YL,ProxyProperty:()=>Gt,ProxyPropertyOnWrite:()=>Dt,SAFE_FILLS_OPERATION:()=>H0,SAFE_FILL_OPERATION:()=>_0,SAFE_RANGE2_OPERATION:()=>yo,SAFE_STROKE_FILL_OPERATION:()=>yr,SEGMENTATION_DEFAULTS:()=>vl,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>Sy,SKIP_JS_BUILTINS:()=>hy,ScaleAlignment:()=>BS,SceneArrayChangeDetection:()=>hu,SceneChangeDetection:()=>$,SceneObjectChangeDetection:()=>Or,SceneRefChangeDetection:()=>Kg,SeriesContentZIndexMap:()=>X0,SeriesZIndexMap:()=>Z0,SimpleCache:()=>iN,SpanJoin:()=>YM,StateMachine:()=>de,StateMachineProperty:()=>Je,TRIPLE_EQ:()=>qc,TextMeasurer:()=>sx,TickIntervals:()=>_g,TrimCharsRegex:()=>QS,TrimEdgeGuard:()=>gd,UNIT_MAX:()=>Yi,UNIT_MIN:()=>ba,UnknownError:()=>Jp,ValidationError:()=>go,Vec2:()=>H,Vec4:()=>ve,Vertex:()=>pM,WeakCache:()=>lM,ZIndexMap:()=>Y0,addEscapeEventListener:()=>Xy,addFakeTransformToInstanceProperty:()=>m,addMouseCloseListener:()=>yM,addObserverToInstanceProperty:()=>oy,addOverrideFocusVisibleEventListener:()=>bM,addTouchCloseListener:()=>xM,addTransformToInstanceProperty:()=>gr,aggregationBucketForDatum:()=>GL,aggregationDatumMatchesIndex:()=>jL,aggregationDomain:()=>oi,aggregationIndexForXRatio:()=>Mg,aggregationRangeFittingPoints:()=>vo,aggregationXRatioForDatumIndex:()=>_c,aggregationXRatioForXValue:()=>Bn,and:()=>Fe,angleBetween:()=>_a,angularPadding:()=>Hy,appendEllipsis:()=>jm,applySkiaPatches:()=>tN,arcDistanceSquared:()=>aN,areScalingEqual:()=>Ka,array:()=>pn,arrayLength:()=>rr,arrayOf:()=>me,arrayOfDefs:()=>Ft,arraysEqual:()=>En,assignIfNotStrictlyEqual:()=>uy,attachDescription:()=>ze,attachListener:()=>st,autoSizedLabelOptionsDefs:()=>pr,barHighlightOptionsDef:()=>pa,bezier2DDistance:()=>WM,bezier2DExtrema:()=>GM,boolean:()=>R,borderOptionsDef:()=>cr,boxCollides:()=>jy,boxContains:()=>Ng,boxEmpty:()=>oM,boxesEqual:()=>Tg,buildDateFormatter:()=>Xc,cachedTextMeasurer:()=>et,calcLineHeight:()=>Rn,calculatePlacement:()=>ix,callWithContext:()=>ls,callback:()=>ot,callbackDefs:()=>Xe,callbackOf:()=>Di,ceilTo:()=>p0,checkDatum:()=>FM,circularSliceArray:()=>ca,clamp:()=>ae,clampArray:()=>Bc,clipLines:()=>TM,clipSpanX:()=>vx,collapseSpanToPoint:()=>UM,collectAggregationLevels:()=>WL,color:()=>te,colorStopsOrderValidator:()=>Jm,colorUnion:()=>ws,commonChartOptionsDefs:()=>ke,commonSeriesOptionsDefs:()=>qe,commonSeriesThemeableOptionsDefs:()=>Ke,compactAggregationIndices:()=>kl,compareDates:()=>$y,computeExtremesAggregation:()=>vr,computeExtremesAggregationPartial:()=>Dg,constant:()=>Ae,contextMenuItemsArray:()=>cg,countFractionDigits:()=>Pc,countLines:()=>a0,createAggregationIndices:()=>So,createButton:()=>cu,createCanvasContext:()=>rM,createCheckbox:()=>JM,createDeprecationWarning:()=>Yy,createElement:()=>ye,createElementId:()=>Ir,createIcon:()=>iD,createId:()=>Ii,createIdsGenerator:()=>jg,createNumberFormatter:()=>qm,createSelect:()=>eD,createSvgElement:()=>jt,createTextArea:()=>tD,createTicks:()=>Wc,date:()=>ns,dateToNumber:()=>Ui,dateTruncationForDomain:()=>Gg,datesSortOrder:()=>Uy,debounce:()=>qp,decodeIntervalValue:()=>zM,deepClone:()=>Te,deepFreeze:()=>Ks,defaultEpoch:()=>ux,defined:()=>ce,definedZoomState:()=>Rt,diffArrays:()=>cM,distribute:()=>GS,downloadUrl:()=>NM,dropFirstWhile:()=>_S,dropLastWhile:()=>HS,durationDay:()=>Pl,durationHour:()=>Ol,durationMinute:()=>wr,durationMonth:()=>ox,durationSecond:()=>jc,durationWeek:()=>OM,durationYear:()=>Jd,easeIn:()=>RN,easeInOut:()=>zN,easeInOutQuad:()=>FN,easeInQuad:()=>VN,easeOut:()=>Tr,easeOutQuad:()=>BN,encodedToTimestamp:()=>Lr,enterpriseRegistry:()=>zi,entries:()=>rt,errorBarOptionsDefs:()=>Cd,errorBarThemeableOptionsDefs:()=>Ad,estimateTickCount:()=>fx,evaluateBezier:()=>$a,every:()=>L0,expandLegendPosition:()=>Sl,extent:()=>Ga,extractDecoratedProperties:()=>C0,extractDomain:()=>rd,fillGradientDefaults:()=>ng,fillImageDefaults:()=>og,fillOptionsDef:()=>se,fillPatternDefaults:()=>ag,findMaxIndex:()=>Dr,findMaxValue:()=>Wy,findMinIndex:()=>Hc,findMinMax:()=>Tt,findMinValue:()=>ZL,findRangeExtent:()=>xo,first:()=>$s,flush:()=>XS,focusCursorAtEnd:()=>Vy,fontFamilyFull:()=>rg,fontOptionsDef:()=>$e,fontWeight:()=>kd,formatNumber:()=>dM,formatObjectValidator:()=>k0,formatPercent:()=>hM,formatValue:()=>ya,fromPairs:()=>N0,generateUUID:()=>Yd,geoJson:()=>Ll,getAngleRatioRadians:()=>nM,getAttribute:()=>wl,getChartTheme:()=>fb,getDOMMatrix:()=>Vm,getDocument:()=>dn,getElementBBox:()=>tM,getIconClassNames:()=>Al,getImage:()=>$S,getLastFocus:()=>ex,getMaxInnerRectSize:()=>Fy,getMidpointsForIndices:()=>Fa,getMinOuterRectSize:()=>KL,getOffscreenCanvas:()=>Kp,getPath:()=>cy,getPath2D:()=>Tc,getResizeObserver:()=>Bm,getSequentialColors:()=>mn,getTickTimeInterval:()=>au,getWindow:()=>Re,googleFont:()=>ty,gradientColorStops:()=>ig,gradientStrict:()=>sg,greaterThan:()=>os,groupBy:()=>cd,guardTextEdges:()=>i0,hasNoModifiers:()=>Kd,hasRequiredInPath:()=>xl,highlightOptionsDef:()=>ey,htmlElement:()=>Ym,inRange:()=>d0,initRovingTabIndex:()=>Qy,insertListItemsSorted:()=>tx,instanceOf:()=>TL,interpolationOptionsDefs:()=>hg,intervalCeil:()=>PM,intervalEpoch:()=>El,intervalExtent:()=>hx,intervalFloor:()=>en,intervalHierarchy:()=>nu,intervalMilliseconds:()=>cs,intervalNext:()=>cx,intervalPrevious:()=>EM,intervalRange:()=>Gn,intervalRangeCount:()=>Fg,intervalRangeNumeric:()=>RM,intervalRangeStartIndex:()=>dx,intervalStep:()=>ja,intervalUnit:()=>xa,inverseEaseOut:()=>nD,isArray:()=>De,isBetweenAngles:()=>Qs,isBoolean:()=>JS,isButtonClickEvent:()=>Jy,isColor:()=>t0,isContinuous:()=>Uc,isDate:()=>Cs,isDecoratedObject:()=>pg,isDefined:()=>Mt,isDenseInterval:()=>Rl,isDocumentFragment:()=>KS,isElement:()=>Fm,isEmptyObject:()=>md,isEnumKey:()=>wL,isEnumValue:()=>LL,isFiniteNumber:()=>Be,isFunction:()=>Pa,isGradientFill:()=>Qt,isGradientFillArray:()=>kN,isGradientOrPatternFill:()=>IN,isHTMLElement:()=>hd,isHtmlElement:()=>Hm,isImageFill:()=>Wa,isInputPending:()=>iM,isInteger:()=>u0,isKeyOf:()=>ml,isNegative:()=>Oc,isNode:()=>Up,isNumber:()=>gt,isNumberEqual:()=>He,isNumberObject:()=>BM,isObject:()=>ge,isObjectLike:()=>fd,isObjectWithProperty:()=>T0,isObjectWithStringProperty:()=>O0,isPatternFill:()=>jn,isPlainObject:()=>We,isPointLabelDatum:()=>$M,isProperties:()=>Vc,isRegExp:()=>e0,isScaleValid:()=>zl,isSegmentTruncated:()=>Xp,isString:()=>Bt,isStringFillArray:()=>HM,isStringObject:()=>mx,isSymbol:()=>yd,isTextTruncated:()=>nr,isTruncated:()=>n0,isUnitTimeCategoryScaling:()=>Nr,isValidDate:()=>fl,isValidNumberFormat:()=>f0,iterate:()=>mr,joinFormatted:()=>ar,jsonApply:()=>$d,jsonDiff:()=>Hn,jsonPropertyCompare:()=>fM,jsonWalk:()=>ko,kebabCase:()=>r0,labelBoxOptionsDef:()=>zn,legendPositionValidator:()=>Id,lessThan:()=>as,lessThanOrEqual:()=>h0,levenshteinDistance:()=>o0,lineDashOptionsDef:()=>oe,lineDistanceSquared:()=>kr,lineHighlightOptionsDef:()=>lr,lineSegmentOptions:()=>x0,lineSegmentation:()=>b0,linear:()=>sD,linearGaugeSeriesOptionsDef:()=>mo,linearGaugeSeriesThemeableOptionsDef:()=>xg,linearGaugeTargetOptionsDef:()=>mg,linearPoints:()=>ZM,listDecoratedProperties:()=>fr,lowestGranularityForInterval:()=>ou,lowestGranularityUnitForTicks:()=>Hg,lowestGranularityUnitForValue:()=>ru,makeAccessibleClickListener:()=>uN,mapValues:()=>Ec,markerOptionsDefs:()=>ga,markerStyleOptionsDefs:()=>ur,measureTextSegments:()=>Js,memo:()=>Zd,merge:()=>wd,mergeArrayDefaults:()=>ly,mergeDefaults:()=>re,modulus:()=>g0,multiSeriesHighlightOptionsDef:()=>_t,nearestSquared:()=>Xd,nearestSquaredInContainer:()=>DM,nextPowerOf2:()=>Fc,niceTicksDomain:()=>gx,normalisedExtentWithMetadata:()=>Gc,normalisedTimeExtentWithMetadata:()=>Pg,normalizeAngle180:()=>wg,normalizeAngle360:()=>Qe,normalizeAngle360FromDegrees:()=>Ha,normalizeAngle360Inclusive:()=>Wd,number:()=>W,numberFormatValidator:()=>fn,numberMin:()=>Xm,numberRange:()=>c0,object:()=>or,objectsEqual:()=>Ht,objectsEqualWith:()=>ry,optionsDefs:()=>Et,or:()=>Se,padding:()=>bl,paddingOptions:()=>v0,parseNumberFormat:()=>tg,partialAssign:()=>fg,pause:()=>Gy,pick:()=>gg,placeLabels:()=>KM,positiveNumber:()=>P,positiveNumberNonZero:()=>gn,previousPowerOf2:()=>ky,radialGaugeSeriesOptionsDef:()=>Rc,radialGaugeSeriesThemeableOptionsDef:()=>bg,radialGaugeTargetOptionsDef:()=>yg,range:()=>Kc,rangeValidator:()=>lg,ratio:()=>ne,readIntegratedWrappedValue:()=>yx,record:()=>ZS,required:()=>j,rescaleSpan:()=>Yc,rescaleVisibleRange:()=>Rg,resetIds:()=>gN,resolveOperation:()=>G5,rotatePoint:()=>_y,roundTo:()=>Sd,safeCall:()=>$m,seriesLabelOptionsDefs:()=>ft,seriesTooltipRangeValidator:()=>M0,setAttribute:()=>Pe,setAttributes:()=>ma,setDocument:()=>jS,setElementBBox:()=>jd,setElementStyle:()=>_n,setElementStyles:()=>aM,setPath:()=>dy,setWindow:()=>WS,shadowOptionsDefs:()=>Ra,shallowClone:()=>Nl,shapeHighlightOptionsDef:()=>Ct,shapeSegmentOptions:()=>y0,shapeSegmentation:()=>fo,shapeValidator:()=>hr,simpleMemorize:()=>Ki,simpleMemorize2:()=>Ar,smoothPoints:()=>qM,solveBezier:()=>$g,sortAndUniqueDates:()=>Ky,sortBasedOnArray:()=>FS,spanRange:()=>tn,splitBezier2D:()=>lu,stepPoints:()=>XM,stopPageScrolling:()=>vM,strictObjectKeys:()=>za,strictUnion:()=>eg,string:()=>L,stringLength:()=>Zm,stringifyValue:()=>xd,strokeOptionsDef:()=>q,textOrSegments:()=>$i,themeNames:()=>H5,themeOperator:()=>Dd,themeSymbols:()=>_5,themes:()=>wk,throttle:()=>Wm,tickFormat:()=>px,tickStep:()=>$c,toArray:()=>ld,toDegrees:()=>sM,toFontString:()=>Gm,toIterable:()=>w0,toPlainText:()=>Ne,toRadians:()=>lt,toTextString:()=>At,toolbarButtonOptionsDefs:()=>dr,tooltipOptionsDefs:()=>Ue,tooltipOptionsDefsWithArea:()=>I0,transformIntegratedCategoryValue:()=>Wg,truncateLine:()=>Tl,typeUnion:()=>yl,undocumented:()=>Q,unguardTextEdges:()=>s0,union:()=>U,unionSymbol:()=>bd,unique:()=>$p,validate:()=>Mi,withTimeout:()=>UL,without:()=>J,wrapLines:()=>Qd,wrapText:()=>Io,wrapTextOrSegments:()=>qd,wrapTextSegments:()=>ax});var _5={DEFAULT_ANNOTATION_HANDLE_FILL:Od,DEFAULT_ANNOTATION_STATISTICS_COLOR:Rd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:zd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:Vd,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:Bd,DEFAULT_ANNOTATION_STATISTICS_FILL:Pd,DEFAULT_ANNOTATION_STATISTICS_STROKE:Ed,DEFAULT_CAPTION_ALIGNMENT:Sr,DEFAULT_CAPTION_LAYOUT_STYLE:Do,DEFAULT_FIBONACCI_STROKES:Td,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:rs,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Ls,DEFAULT_POLAR_SERIES_STROKE:kg,DEFAULT_SHADOW_COLOUR:Mo,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:Ig,DEFAULT_TEXTBOX_COLOR:Hd,DEFAULT_TEXTBOX_FILL:Fd,DEFAULT_TEXTBOX_STROKE:_d,DEFAULT_TEXT_ANNOTATION_COLOR:Ag,DEFAULT_TOOLBAR_POSITION:Gd,IS_DARK_THEME:Il,PALETTE_ALT_DOWN_FILL:Ey,PALETTE_ALT_DOWN_STROKE:Oy,PALETTE_ALT_NEUTRAL_FILL:Ry,PALETTE_ALT_NEUTRAL_STROKE:zy,PALETTE_ALT_UP_FILL:Py,PALETTE_ALT_UP_STROKE:Ty,PALETTE_DOWN_FILL:wy,PALETTE_DOWN_STROKE:Ay,PALETTE_NEUTRAL_FILL:Ny,PALETTE_NEUTRAL_STROKE:Ly,PALETTE_UP_FILL:Cy,PALETTE_UP_STROKE:Iy},H5=Object.keys(wk);function G5(e){const t=Qa.getDefaultPublicParameters(),i=Qa.getDefaultColors();return new w2({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var Zb={};Ws(Zb,{Color:()=>Oe,interpolateColor:()=>TT});var j5={VERSION:ue,_Scene:Ub,_Theme:Yb,_Util:Zb,create:Da.create.bind(Da),createSparkline:Da.__createSparkline.bind(Da),setup:()=>{fe.setRegistryMode(fe.RegistryMode.Integrated),fe.registerModules(UI)},isEnterprise:!1},{Chart:W5}=N,YI=class extends W5{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,s=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=s,this.animationRect=s;for(const n of[t,i])n.translationX=Math.floor(s.x),n.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:e.layoutBox}})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const s of this.series)i.push(s.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};YI.className="StandaloneChart",YI.type="standalone";var{standaloneChartOptionsDefs:$5}=N,op={type:"chart",name:"standalone",enterprise:!0,version:ue,options:$5,create(e,t){return new YI(e,t)}};function dE(e,t,i){i||(t=K5(t));const s=new Map;for(const a of e){const o=a.datumIndex.type===0?`link-${a.datumIndex.index}`:`node-${a.datumIndex.index}`;s.set(a.id,{itemId:o,datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1})}let n=0;for(const[a,o]of s.entries())n=Math.max(n,ZI(s,t,o,a,-1,[])+ZI(s,t,o,a,1,[])+1);return{links:t,nodeGraph:s,maxPathLength:n}}function uE(e,t,i,s){const n=s.indexOf(t);if(n!==-1){for(let o=n;o<s.length;o+=1)i.add(s[o]);return}s.push(t);const{toNode:a}=t;for(const o of e)o.fromNode===a&&uE(e,o,i,s);s.pop()}function K5(e){const t=new Set;for(const i of e)uE(e,i,t,[]);return t.size!==0&&K.warnOnce("Some links formed circular references. These will be removed from the output."),t.size===0?e:e.filter(i=>!t.has(i))}function ZI(e,t,i,s,n,a){if(a.includes(s))return 1/0;let o=n===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(o===-1){o=0;const r=n===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:h}=l,d=n===-1?h.id:c.id,u=n===-1?c.id:h.id,p=s===d?e.get(u):void 0;p!=null&&(r.push({node:p,link:l}),a?.push(s),o=Math.max(o,ZI(e,t,p,u,n,a)+1),a?.pop())}n===-1?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{findNodeDatumInArray:U5,keyProperty:Y5,valueProperty:Xb,DataController:Z5,Group:Gf,HighlightState:pE,Selection:Th,Series:X5,TransformableText:q5}=N,Q5=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:n}=i,a=s.contextNodeData?.nodeData.find(o=>o.datumIndex.type===n.type&&o.datumIndex.index===n.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},gE=class extends X5{constructor(){super(...arguments),this.NodeEvent=Q5,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Gf({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Gf({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new Gf({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new Gf({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new Gf({name:"linkGroup"})),this.labelSelection=Th.select(this.labelGroup,q5),this.linkSelection=Th.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Th.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Th.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Th.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Th.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Th.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(t==null)return;const{fromKey:s,toKey:n,sizeKey:a,idKey:o,labelKey:r}=this.properties,l=new Z5("standalone",e.suppressFieldDotNotation,this.ctx.eventsHub),c=i==null?null:l.request(this.id,N.DataSet.wrap(i)??N.DataSet.empty(),{props:[Y5(o,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[Xb(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),h=e.request(this.id,t,{props:[Xb(s,void 0,{id:"fromValue",includeProperty:!1}),Xb(n,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[Xb(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c??Promise.resolve(null),h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(d==null){const f=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),y=u.dataModel.resolveColumnById(this,"toValue",u.processedData),b=v=>{const S=p.size,M=v;return{series:this,itemId:`node-${S}`,datum:{},datumIndex:{type:1,index:S},type:1,index:S,linksBefore:[],linksAfter:[],id:v,size:0,label:M,style:this.getNodeStyle({datumIndex:{type:1,index:S},datum:{},size:0,label:M},S,!1)}},x=u.processedData.dataSources.get(this.id)?.data;if(x)for(const[v]of x.entries()){const S=f[v],M=y[v];S==null||M==null||(p.has(S)||p.set(S,b(S)),p.has(M)||p.set(M,b(M)))}}else{const f=d.dataModel.resolveColumnById(this,"idValue",d.processedData),y=r==null?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData),b=d.processedData.dataSources.get(this.id)?.data;if(b)for(const[x,v]of b.entries()){const S=f[x],M=y?.[x],D={type:1,index:x};p.set(S,{series:this,itemId:`node-${x}`,datum:v,datumIndex:D,type:1,index:x,linksBefore:[],linksAfter:[],id:S,size:0,label:M,style:this.getNodeStyle({datumIndex:D,datum:v,size:0,label:M},x,!1)})}}this.processedNodes=p}findNodeDatum(e){return U5(e,this.contextNodeData?.nodeData)}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(s==null||n==null){const{links:y,nodeGraph:b,maxPathLength:x}=dE(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:b,links:y,maxPathLength:x}}const{sizeKey:a}=this.properties,o=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=a==null?void 0:s.resolveColumnById(this,"sizeValue",n),c=new Map;for(const y of this.processedNodes.values()){const b=e(y);c.set(y.id,b)}const h=[],d=n.dataSources.get(this.id)?.data;if(d)for(const[y,b]of d.entries()){const x=o[y],v=r[y],S=l==null?1:l[y],M=c.get(x),D=c.get(v);if(S<=0||M==null||D==null)continue;const I={type:0,index:y},k=t({series:this,itemId:`link-${y}`,datum:b,datumIndex:I,type:0,index:y,fromNode:M,toNode:D,size:S,style:this.getLinkStyle({datum:b,datumIndex:I},M.datumIndex,!1)});h.push(k)}const{links:u,nodeGraph:p,maxPathLength:f}=dE(c.values(),h,i);for(const y of p.values())y.datum.linksBefore=y.linksBefore.map(b=>b.link),y.datum.linksAfter=y.linksAfter.map(b=>b.link);return this.nodeCount=p.size,this.linkCount=u.length,{nodeGraph:p,links:u,maxPathLength:f}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[],a=this.getHighlightedDatum();this.contentGroup.visible=this.visible;const o=a==null?pE.None:pE.OtherItem;this.contentGroup.opacity=this.properties.highlight.getStyle(o).opacity??1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(d=>d.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(d=>d.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,l,c,h;a?.type===1?(r=s.filter(d=>d.type===0&&(d.toNode===a||d.fromNode===a)),l=r.map(d=>d.fromNode===a?d.toNode:d.fromNode),l.push(a),c=[],h=[a]):a?.type===0?(r=[a],l=[a.fromNode,a.toNode],c=[a],h=[]):(r=[],l=[],c=[],h=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:c,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:h,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this&&e.type==null){const{itemId:t}=e,i=this.contextNodeData?.nodeData??[];e=t==null?void 0:i.find(s=>s.type===1&&s.id===t)}else e?.series!==this&&(e=void 0);return e}isLabelHighlighted(e,t){return t==null?!1:t.type===1?t===e:t.type===0?t.fromNode===e||t.toNode===e:!1}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return{domain:[]}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:n}=this.properties,{fill:a=s[t%s.length],fillOpacity:o=1,stroke:r=n[t%n.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},n)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,n),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((n,a)=>{const o=n.distanceSquared(e,t);o<i&&(i=o,s=a)}),this.nodeSelection.each((n,a)=>{const o=n.distanceSquared(e,t);o<i&&(i=o,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}getDatumAriaText(e,t){if(e.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(e.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t})}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,s=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let n=s;if(i!==0||t===0)return;if(s?.type===0){const r=Array.from(this.linkSelection,h=>h.datum),c=r.indexOf(s)+t;c>=0&&c<r.length?n=r[c]:c>0?n=r.at(-1):n=Array.from(this.nodeSelection,d=>d.datum).at(-1)}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+t;c>=0&&c<r.length?n=r[c]:c<0?n=r[0]:n=Array.from(this.linkSelection,d=>d.datum)[0]}if(n==null)return;const a=n.type===1?Array.from(this.nodeSelection).find(r=>r.datum===n):Array.from(this.linkSelection).find(r=>r.datum===n);if(a==null)return;const o=this.computeFocusBounds(a.node);if(o!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}}getCategoryValue(e){}datumIndexForCategoryValue(e){}},{Path:J5}=N;function fE({radius:e,startAngle:t,endAngle:i,tension:s}){const n=e*Math.cos(t),a=e*Math.sin(t),o=e*Math.cos(i),r=e*Math.sin(i),l=n*s,c=a*s,h=o*s,d=r*s;return{x:[n,l,h,o],y:[a,c,d,r]}}var Ur=class extends J5{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,s,n,a,o,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(s-t)*h+t,(n-o)*h+o,(a-r)*h+r,o,r)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:a,startAngle2:o,endAngle2:r}=this;n>o&&([n,o]=[o,n],[a,r]=[r,a]),e.clear();const l=t+s*Math.cos(n),c=i+s*Math.sin(n);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(r),i+s*Math.sin(r)),e.arc(t,i,s,r,o,!0),this.tensionedCurveTo(t+s*Math.cos(o),i+s*Math.sin(o),t,i,t,i,t+s*Math.cos(a),i+s*Math.sin(a)),e.arc(t,i,s,a,n,!0),e.closePath()}};g([$()],Ur.prototype,"centerX",2),g([$()],Ur.prototype,"centerY",2),g([$()],Ur.prototype,"radius",2),g([$()],Ur.prototype,"startAngle1",2),g([$()],Ur.prototype,"endAngle1",2),g([$()],Ur.prototype,"startAngle2",2),g([$()],Ur.prototype,"endAngle2",2),g([$()],Ur.prototype,"tension",2);var{FillGradientDefaults:eZ,FillPatternDefaults:tZ,FillImageDefaults:iZ,makeSeriesTooltip:sZ,SeriesProperties:nZ,Label:aZ}=N,XI=class extends aZ{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};g([m],XI.prototype,"spacing",2),g([m],XI.prototype,"maxWidth",2);var _o=class extends X{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}=this,c=this.fill??e[i%e.length],h=this.stroke??t[i%e.length];return{fill:c,fillOpacity:s,stroke:h,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}}};g([m],_o.prototype,"fill",2),g([m],_o.prototype,"fillOpacity",2),g([m],_o.prototype,"stroke",2),g([m],_o.prototype,"strokeOpacity",2),g([m],_o.prototype,"strokeWidth",2),g([m],_o.prototype,"lineDash",2),g([m],_o.prototype,"lineDashOffset",2),g([m],_o.prototype,"tension",2),g([m],_o.prototype,"itemStyler",2);var so=class extends X{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this,l=this.fill??e[i%e.length],c=this.stroke??t[i%e.length];return{fill:l,fillOpacity:s,stroke:c,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}}};g([m],so.prototype,"spacing",2),g([m],so.prototype,"width",2),g([m],so.prototype,"fill",2),g([m],so.prototype,"fillOpacity",2),g([m],so.prototype,"stroke",2),g([m],so.prototype,"strokeOpacity",2),g([m],so.prototype,"strokeWidth",2),g([m],so.prototype,"lineDash",2),g([m],so.prototype,"lineDashOffset",2),g([m],so.prototype,"itemStyler",2);var Hi=class extends nZ{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new eZ,this.fillPatternDefaults=new tZ,this.fillImageDefaults=new iZ,this.fills=[],this.strokes=[],this.label=new XI,this.link=new _o,this.node=new so,this.tooltip=sZ()}};g([m],Hi.prototype,"fromKey",2),g([m],Hi.prototype,"toKey",2),g([m],Hi.prototype,"idKey",2),g([m],Hi.prototype,"idName",2),g([m],Hi.prototype,"labelKey",2),g([m],Hi.prototype,"labelName",2),g([m],Hi.prototype,"sizeKey",2),g([m],Hi.prototype,"sizeName",2),g([m],Hi.prototype,"nodes",2),g([m],Hi.prototype,"fillGradientDefaults",2),g([m],Hi.prototype,"fillPatternDefaults",2),g([m],Hi.prototype,"fillImageDefaults",2),g([m],Hi.prototype,"fills",2),g([m],Hi.prototype,"strokes",2),g([m],Hi.prototype,"label",2),g([m],Hi.prototype,"link",2),g([m],Hi.prototype,"node",2),g([m],Hi.prototype,"tooltip",2);var{SeriesNodePickMode:mE,createDatumId:qb,Sector:oZ,getShapeStyle:Qb,getLabelStyles:rZ,BBox:lZ}=N,Jb=e=>e.startAngle+_a(e.startAngle,e.endAngle)/2,qI=class extends gE{constructor(e){super({moduleCtx:e,pickModes:[mE.NEAREST_NODE,mE.EXACT_SHAPE_MATCH]}),this.properties=new Hi}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Ur}nodeFactory(){return new oZ}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:s}=this,{fromKey:n,toKey:a,sizeKey:o,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:h},node:{width:d,spacing:u}}=s,p=t/2,f=i/2;let y=[];const{nodeGraph:b,links:x}=this.getNodeGraph(E=>({...E,centerX:p,centerY:f,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),E=>({...E,centerX:p,centerY:f,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let v=0;for(const[E,{datum:_,linksBefore:G,linksAfter:B}]of b.entries()){const F=G.reduce((Y,{link:Z})=>Y+Z.size,0)+B.reduce((Y,{link:Z})=>Y+Z.size,0);if(F===0)b.delete(E);else{const{label:Y}=s;_.size=F,v+=_.size;const Z=Y.enabled?this.getLabelText(_.label,_.datum,r,"label",[],Y,{datum:_.datum,value:_.label,fromKey:n,toKey:a,sizeKey:o,size:_.size}):void 0;_.label=Ne(Z)}}let S=0;if(this.isLabelEnabled()){const E=et(this.properties.label);let _=0;for(const{datum:G}of b.values()){const{id:B,label:F}=G;if(F==null)continue;const Y=Io(F,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:Z}=E.measureLines(Y);_=Math.max(Z,_),y.push({id:B,text:Y,centerX:p,centerY:f,angle:Number.NaN,radius:Number.NaN,size:G.size,datumIndex:G.datumIndex,nodeDatum:G})}S=_+l}const M=b.size;let D=Math.min(t,i)/2-d-S,I=u/D;if(S!==0&&(M*I>=1.5*Math.PI||D<=0)&&(y=[],D=Math.min(t,i)/2-d,I=u/D),M*I>=2*Math.PI||D<=0){K.warnOnce("There was insufficient space to display the Chord Series.");return}const k=D,C=D+d,A=Math.max((2*Math.PI-M*I)/v,0);let w=0;for(const{datum:E}of b.values()){E.innerRadius=k,E.outerRadius=C,E.startAngle=w,E.endAngle=w+E.size*A,w=E.endAngle+I;const _=(E.innerRadius+E.outerRadius)/2,G=Jb(E);E.midPoint={x:E.centerX+_*Math.cos(G),y:E.centerY+_*Math.sin(G)}}const T=[];for(const{datum:E,linksBefore:_,linksAfter:G}of b.values()){const B=Jb(E),F=[..._.map(Z=>({link:Z.link,distance:_a(Jb(Z.node.datum),B),after:!1})),...G.map(Z=>({link:Z.link,distance:_a(Jb(Z.node.datum),B),after:!0}))];let Y=E.startAngle;for(const{link:Z,after:ie}of F.toSorted((ee,he)=>ee.distance-he.distance)){const ee=Z.size*A;ie?(Z.startAngle1=Y,Z.endAngle1=Y+ee):(Z.startAngle2=Y,Z.endAngle2=Y+ee),Y+=Z.size*A}T.push(E)}const{tension:O}=this.properties.link;for(const E of x){E.radius=D;const _=fE({radius:D,startAngle:E.startAngle1,endAngle:E.endAngle2,tension:O}),G=fE({radius:D,startAngle:E.startAngle2,endAngle:E.endAngle1,tension:O}),B=$a(..._.x,.5),F=$a(..._.y,.5),Y=$a(...G.x,.5),Z=$a(...G.y,.5);E.midPoint={x:E.centerX+(B+Y)/2,y:E.centerY+(F+Z)/2},T.push(E)}for(const E of y){const _=b.get(E.id)?.datum;_!=null&&(E.radius=C+l,E.angle=Qe(_.startAngle+_a(_.startAngle,_.endAngle)/2),E.datumIndex=_.datumIndex,E.nodeDatum=_)}y.sort((E,_)=>E.angle-_.angle);let z=1/0,V=-1/0;return y=y.filter(E=>{const _=Rn(h),G=Math.atan2(_/2,E.radius),B=E.angle-G,F=E.angle+G;return Qs(z,B,F)||Qs(V,B,F)?!1:(z=Math.min(B,z),V=Math.max(F,V),!0)}),{itemId:e,nodeData:T,labelData:y}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.getHighlightedDatum();e.labelSelection.each((s,n)=>{const{size:a,text:o,centerX:r,centerY:l,radius:c,angle:h,datumIndex:d,nodeDatum:u}=n;t.size=a;const p=this.isLabelHighlighted(u,i),f=this.getHighlightStyle(p,d),y=rZ(this,void 0,t,this.properties.label,p,i),{fontStyle:b,fontWeight:x,fontSize:v,fontFamily:S,color:M}=y;s.visible=!0,s.translationX=r+c*Math.cos(h),s.translationY=l+c*Math.sin(h),s.text=o,s.fill=M,s.fontStyle=b,s.fontWeight=x,s.fontSize=v,s.fontFamily=S,s.textBaseline="middle",Math.cos(h)>=0?(s.textAlign="left",s.rotation=h):(s.textAlign="right",s.rotation=h-Math.PI);const D=f.opacity??1;s.opacity=D,s.fillOpacity=D,s.setBoxing(y)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>qb(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:n,strokes:a,fillGradientDefaults:o,fillPatternDefaults:r,fillImageDefaults:l}=s,{itemStyler:c}=s.node,h=this.getHighlightStyle(i,e.datumIndex),d=re(h,s.node.getStyle(n,a,t));let u=Qb(d,o,r,l);if(c!=null&&e.datumIndex!=null){const p=this.cachedDatumCallback(qb(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const f=this.makeItemStylerParams(e,i,u);return this.callWithContext(c,f)});p&&(u=Qb(re(p,u),o,r,l))}return u.opacity=1,u}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},n,a){const{id:o}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,n,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,datum:e,highlightState:l,...a,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,a)=>{const{datumIndex:o}=a,r=this.getNodeStyle(a,o.index,i);n.setStyleProperties(r,s),n.centerX=a.centerX,n.centerY=a.centerY,n.innerRadius=a.innerRadius,n.outerRadius=a.outerRadius,n.startAngle=a.startAngle,n.endAngle=a.endAngle,n.inset=n.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>qb(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:n,properties:a}=this,{fills:o,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=a,{itemStyler:d}=a.link,u=this.getHighlightStyle(s,e),p=re(u,a.link.getStyle(o,r,i.index));let f=Qb(p,l,c,h);if(d!=null&&e!=null){const y=this.ctx.highlightManager?.getActiveHighlight(),b=this.cachedDatumCallback(qb(e.index,"link",s?"highlight":"node"),()=>{const x=this.getHighlightStateString(y,s,i);return this.callWithContext(d,{seriesId:n,datum:t,highlightState:x,...f})});b&&(f=Qb(re(b,f),l,c,h))}return f.opacity=1,f}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,a)=>{const o=a.fromNode.datumIndex,r=this.getLinkStyle(a,o,i);n.centerX=a.centerX,n.centerY=a.centerY,n.radius=a.radius,n.startAngle1=a.startAngle1,n.endAngle1=a.endAngle1,n.startAngle2=a.startAngle2,n.endAngle2=a.endAngle2,n.tension=r.tension,n.setStyleProperties(r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),s=(e-i)/2,n=(t-i)/2,a=new lZ(s,n,e,t);return{series:a,axis:a}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:n,ctx:{formatManager:a}}=this,{fromKey:o,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=n,d=this.contextNodeData?.nodeData.find(v=>v.datumIndex.type===e.type&&v.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,f=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let b;if(d.type===0){const v=d.fromNode.datumIndex;b=this.getLinkStyle({datumIndex:e,datum:f},v,!1)}else{const v=d.label;b=this.getNodeStyle({datumIndex:e,datum:f,size:y,label:v},e.index,!1)}const x=[];if(l!=null){const v=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:f,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});x.push({label:c,fallbackLabel:l,value:v??String(y)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,b),data:x},{seriesId:t,datum:f,title:p,fromKey:o,toKey:r,sizeKey:l,sizeName:c,size:y,...b})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};qI.className="ChordSeries",qI.type="chord";var{chordSeriesThemeableOptionsDef:cZ}=N,ev={...cZ,...qe,type:j(Ae("chord")),fromKey:j(L),toKey:j(L),sizeKey:L,sizeName:L};ev.fillGradientDefaults=Q(ng),ev.fillPatternDefaults=Q(ag),ev.fillImageDefaults=Q(og);var yE={type:"series",name:"chord",chartType:"standalone",enterprise:!0,solo:!0,version:ue,dependencies:[op],options:ev,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:Vi,fillPatternDefaults:tt,fillImageDefaults:it,highlight:Sy,label:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}},create:e=>new qI(e)},{BBox:hZ,Path:dZ}=N,xE=1e-6;function bE([e,t],[i,s]){return Math.abs(e-i)<=xE&&Math.abs(t-s)<=xE}var Ho=class extends dZ{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:n,y2:a,x3:o,y3:r}=this;return{x:(e+i+n+o)/4,y:(t+s+a+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:c}=this;return Math.min(kr(e,t,i,s,n,a,1/0),kr(e,t,n,a,o,r,1/0),kr(e,t,o,r,l,c,1/0),kr(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:n,y2:a,x3:o,y3:r}=this,l=Math.min(e,i,n,o),c=Math.max(e,i,n,o)-l,h=Math.min(t,s,a,r),d=Math.max(t,s,a,r)-h;return new hZ(l,h,c,d)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:n,x2:a,y2:o,x3:r,y3:l}=this,c=[[t,i],[s,n],[a,o],[r,l]];e.clear();let h,d;for(const u of c){if(h!=null&&bE(h,u)||d!=null&&bE(d,u))continue;const[p,f]=u;h==null?e.moveTo(p,f):e.lineTo(p,f),h??(h=u),d=u}e.closePath()}};g([$()],Ho.prototype,"x0",2),g([$()],Ho.prototype,"y0",2),g([$()],Ho.prototype,"x1",2),g([$()],Ho.prototype,"y1",2),g([$()],Ho.prototype,"x2",2),g([$()],Ho.prototype,"y2",2),g([$()],Ho.prototype,"x3",2),g([$()],Ho.prototype,"y3",2);var{SeriesProperties:uZ,makeSeriesTooltip:pZ,Label:vE,DropShadow:gZ}=N,fZ=class extends vE{},QI=class extends vE{constructor(){super(...arguments),this.spacing=0}};g([m],QI.prototype,"spacing",2),g([m],QI.prototype,"placement",2);var Gi=class extends uZ{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new gZ().set({enabled:!1}),this.label=new fZ,this.stageLabel=new QI,this.tooltip=pZ()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};g([m],Gi.prototype,"stageKey",2),g([m],Gi.prototype,"valueKey",2),g([m],Gi.prototype,"fills",2),g([m],Gi.prototype,"fillOpacity",2),g([m],Gi.prototype,"strokes",2),g([m],Gi.prototype,"strokeWidth",2),g([m],Gi.prototype,"strokeOpacity",2),g([m],Gi.prototype,"lineDash",2),g([m],Gi.prototype,"lineDashOffset",2),g([m],Gi.prototype,"direction",2),g([m],Gi.prototype,"reverse",2),g([m],Gi.prototype,"spacing",2),g([m],Gi.prototype,"aspectRatio",2),g([m],Gi.prototype,"itemStyler",2),g([m],Gi.prototype,"shadow",2),g([m],Gi.prototype,"label",2),g([m],Gi.prototype,"stageLabel",2),g([m],Gi.prototype,"tooltip",2);function SE(e,{x:t,y:i,top:s,right:n,bottom:a,left:o}){e.x0=t-s/2,e.x1=t+s/2,e.x2=t+a/2,e.x3=t-a/2,e.y0=i-o/2,e.y1=i-n/2,e.y2=i+n/2,e.y3=i+o/2}function mZ(e){return{fromFn:(n,a)=>{const{x:o,y:r}=a;let{top:l,right:c,bottom:h,left:d}=a;return e==="vertical"?(l=0,h=0):(d=0,c=0),{x:o,y:r,top:l,right:c,bottom:h,left:d}},toFn:(n,a)=>{const{x:o,y:r,top:l,right:c,bottom:h,left:d}=a;return{x:o,y:r,top:l,right:c,bottom:h,left:d}},applyFn:SE}}var{valueProperty:ME,SeriesNodePickMode:DE,createDatumId:yZ,BBox:JI,Group:eA,Selection:jf,Text:tA,PointerEvents:kE,fromToMotion:xZ,seriesLabelFadeInAnimation:bZ,getLabelStyles:vZ}=N,iA=class extends N.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[DE.EXACT_SHAPE_MATCH,DE.NEAREST_NODE]}),this.properties=new Gi,this.itemGroup=this.contentGroup.appendChild(new eA({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new eA({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new eA({name:"stageLabelGroup"})),this.datumSelection=jf.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=jf.select(this.itemLabelGroup,tA),this.stageLabelSelection=jf.select(this.stageLabelGroup,tA),this.highlightLabelSelection=jf.select(this.highlightLabelGroup,tA),this.highlightDatumSelection=jf.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.animationState=new de("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=kE.None,this.stageLabelGroup.pointerEvents=kE.None,this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new Ho}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}async processData(e){if(this.data==null)return;const{id:t,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:a}=this.properties,o="category",r="number",l=(d,u,p)=>i&&s.getItemEnabled({seriesId:t,itemId:p}),c=this.visible?{}:{forceValue:0},h=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[ME(n,o,{id:"xValue",allowNullKey:h}),ME(a,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:n,ctx:{legendManager:a}}=this,{stageKey:o,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:u,stageLabel:p}=s;if(t==null||i==null)return;const f=l==="horizontal",y=t.resolveColumnById(this,"xValue",i),b=t.resolveColumnById(this,"yValue",i),x=t.getDomain(this,"xValue","value",i).domain,v=t.getDomain(this,"yValue","value",i).domain,S=et(p);let M,D;f?(M="center",D=p.placement==="before"?"bottom":"top"):(M=p.placement==="after"?"left":"right",D="middle");const I=p.enabled?[]:void 0;let k=0,C=0,A=0;const w=i.dataSources.get(this.id)?.data??[];for(const[ee,he]of w.entries()){const Me=y[ee];if(Me===void 0&&!this.properties.allowNullKeys)continue;const Ce=b[ee],xe=n&&a.getItemEnabled({seriesId:e,itemId:ee});if(A+=Ce,I==null)continue;const Ge=this.getLabelText(Me,he,o,"x",x,this.properties.stageLabel,{datum:he,value:Ce,stageKey:o,valueKey:r},this.properties.allowNullKeys??!1),{width:je,height:dt}=De(Ge)?Js(Ge,u):S.measureLines(At(Ge));k=Math.max(k,je),C=Math.max(C,dt),I.push({x:Number.NaN,y:Number.NaN,text:Ge,textAlign:M,textBaseline:D,visible:xe})}const T=this._nodeDataDependencies?.seriesRectWidth??0,O=this._nodeDataDependencies?.seriesRectHeight??0,z=h*(i.input.count-1);let V;if(f){const ee=C+p.spacing;V=new JI(0,p.placement==="before"?ee:0,T,O-ee)}else{const ee=k+p.spacing;V=new JI(p.placement==="after"?0:ee,0,T-ee,O)}if(d!=null&&d!==0){const ee=l==="horizontal"?1/d:d,he=Math.min(V.width,V.height*ee),Me=he/ee;V=new JI(V.x+(V.width-he)/2,V.y+(V.height-Me)/2,he,Me)}let E,_;f?_=p.placement==="before"?V.y-p.spacing:V.y+V.height+p.spacing:E=p.placement==="after"?V.x+V.width+p.spacing:V.x-p.spacing;const G=V.width-(f?z:0),B=V.height-(f?0:z);if(G<0||B<0)return;const F=[],Y=[];let Z=0,ie=0;for(const[ee,he]of w.entries()){const Me=y[ee];if(Me===void 0&&!this.properties.allowNullKeys)continue;const Ce=b[ee],xe=n&&a.getItemEnabled({seriesId:e,itemId:ee}),Ge=Z+Ce,je=(Z+Ge)/(2*A),dt=(Ge-Z)/A,Ze=f?G*je+h*ee:G*.5,we=f?B*.5:B*je+h*ee,Ie=V.x+Ze,pe=V.y+we;if(I!=null){const It=I[ie++];It.x=E??Ie,It.y=_??pe}let yt,xt,ut,bt;if(f){const It=G*dt;yt=It,ut=It;const js=(Ze+It/2)*(B/V.width),cn=(Ze-It/2)*(B/V.width);xt=c?V.height-js:js,bt=c?V.height-cn:cn}else{const It=B*dt;xt=It,bt=It;const js=(we-It/2)*(G/V.height),cn=(we+It/2)*(G/V.height);yt=c?V.width-js:js,ut=c?V.width-cn:cn}const vt=this.getLabelText(Ce,he,r,"y",v,u,{datum:he,value:Ce,stageKey:o,valueKey:r}),Si={x:Ie,y:pe,text:vt,textAlign:"center",textBaseline:"middle",visible:xe};Y.push(Si),F.push({series:this,datum:he,datumIndex:ee,index:ee,xValue:Me,yValue:Ce,x:Ie,y:pe,top:yt,right:xt,bottom:ut,left:bt,label:Si,enabled:xe,midPoint:{x:Ie,y:pe},style:this.getItemStyle({datumIndex:ee,datum:he},!1)}),Z=Ge}return{itemId:e,nodeData:F,labelData:Y,stageLabelData:I,bounds:V}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n,highlightLabelSelection:a}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();o!=null&&(o.series!==this||o.datum==null)&&(o=void 0);const r=this.contextNodeData?.nodeData??[],l=this.contextNodeData?.labelData??[],c=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:l,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:c,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel,checkActiveHighlight:!0});const h=this.getHighlightLabelData(l,o)??[];this.highlightLabelSelection=a.update(h),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,labelProperties:this.properties.label,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o==null?[]:[o],datumSelection:n}),this.updateDatumStyles({datumSelection:n,isHighlight:!0}),this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{properties:s}=this,{itemStyler:n}=s,a=this.getHighlightStyle(i,e);let r=re(a,s.getStyle(e));if(n!=null&&e!=null){const l=this.cachedDatumCallback(yZ(e,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(t,e,i,r);return this.callWithContext(n,c)});l&&(r=re(l,r))}return r}makeItemStylerParams(e,t,i,s){const{id:n,properties:a}=this,{stageKey:o,valueKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,stageKey:o,valueKey:r,highlightState:c,...s,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){const{properties:t}=this,{shadow:i}=t,s=this.contextNodeData?.bounds,n=s?{series:s,axis:s}:void 0;e.each((a,o)=>{a.setStyleProperties(o.style,n),SE(a,o),a.fillShadow=i})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight(),{labelSelection:i,labelProperties:s,isHighlight:n=!1,checkActiveHighlight:a=!1}=e;i.each((o,r,l)=>{const{visible:c,x:h,y:d,text:u,textAlign:p,textBaseline:f}=r,y=n||a&&t?.datumIndex===l,b=this.getHighlightStyle(y,l),x=vZ(this,void 0,this.properties,s,y,t),{color:v,fontSize:S,fontStyle:M,fontWeight:D,fontFamily:I}=x;o.visible=c,o.x=h,o.y=d,o.text=u,o.fill=v,o.opacity=(b.opacity??1)*(x.fillOpacity??1),o.fillOpacity=(b.opacity??1)*(x.fillOpacity??1),o.fontStyle=M,o.fontWeight=D,o.fontSize=S,o.fontFamily=I,o.textAlign=p,o.textBaseline=f,o.setBoxing(x)})}getHighlightLabelData(e,t){if(t?.label)return[{...t.label}]}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0){for(const i of this.datumSelection)if(i.datum===t)return i.node}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{stageKey:a,valueKey:o,tooltip:r}=n;if(!i||!s)return;const l=s.dataSources.get(this.id)?.data[e],c=i.resolveColumnById(this,"xValue",s)[e],h=i.resolveColumnById(this,"yValue",s)[e],d=this.properties.allowNullKeys??!1;if(c===void 0&&!d)return;const u=this.getLabelText(c,l,a,"x",i.getDomain(this,"xValue","value",s).domain,this.properties.stageLabel,{datum:l,value:c,stageKey:a,valueKey:o}),p=this.getItemStyle({datumIndex:e,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:Ne(u),value:Ne(h)}]},{seriesId:t,datum:l,title:void 0,stageKey:a,valueKey:o,...p})}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(e,t);o<i&&(i=o,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}legendItemSymbol(e){const{fills:t,strokes:i,strokeWidth:s,fillOpacity:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this.properties,l=t[e]??"black",c=i[e]??"black";return{marker:{fill:l,fillOpacity:n,stroke:c,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}}}getLegendData(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:n},visible:a}=this;if(!i||!t||e!=="category")return[];const{showInLegend:o}=this.properties,r=i.resolveColumnById(this,"xValue",t);return(t.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=r[c],d=this.properties.allowNullKeys??!1;if(!(h==null&&!d))return{legendType:"category",id:s,datum:l,itemId:c,seriesId:s,enabled:a&&n.getItemEnabled({seriesId:s,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),hideInLegend:!o}}).filter(l=>l!=null)}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,s=mZ(i.direction);xZ(this.id,"nodes",this.ctx.animationManager,[e],s),bZ(this,"labels",this.ctx.animationManager,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};iA.className="PyramidSeries",iA.type="pyramid";var{pyramidSeriesThemeableOptionsDef:SZ}=N,MZ={...SZ,...qe,type:j(Ae("pyramid")),stageKey:j(L),valueKey:j(L)},DZ={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacing:2,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Vi],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},stageLabel:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},highlight:{unhighlightedItem:{opacity:.4}}}},IE={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,solo:!0,version:ue,dependencies:[op],options:MZ,themeTemplate:DZ,create:e=>new iA(e)},{BBox:kZ,Path:IZ}=N,Oh=class extends IZ{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[]}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new kZ(e,i,t,s)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.height-2*this.inset,s=i/2;let n=this.x1+t,a=this.y1+t;e.moveTo(n,a);for(const l of this.elbows)this.updatePathSection(n,a,l.x,l.y,i,-s),n=l.x,a=l.y;const o=this.x2-t,r=this.y2+t;this.updatePathSection(n,a,o,r,i,-s),e.lineTo(o,r+i),n=o,a=r;for(const l of this.elbows.toReversed())this.updatePathSection(n,a,l.x,l.y,i,s),n=l.x,a=l.y;this.updatePathSection(n,a,this.x1+t,this.y1+t,i,s),e.closePath()}updatePathSection(e,t,i,s,n,a){const{path:o}=this,r=H.from(e,t+a+n/2),l=H.from(i,s+a+n/2);if(Math.abs(l.y-r.y)<2){o.lineTo(l.x,l.y);return}let c=H.angle(H.sub(l,r));c<0&&(c=2*Math.PI+c);const h=0,d=Math.PI/2,u=Math.PI,p=Math.PI*1.5,f=AE(r,l,0),y=AE(r,l,n);if(f.radius<n){o.cubicCurveTo((r.x+l.x)/2,r.y,(r.x+l.x)/2,l.y,l.x,l.y);return}c>=p?(o.arc(r.x,t-f.radius,f.radius,d,d+y.angle,!0),o.arc(l.x,s+y.radius,y.radius,p+y.angle,p),o.lineTo(l.x,l.y)):c>h&&c<=d?(o.arc(r.x,t+y.radius,y.radius,p,p+y.angle),o.arc(l.x,s-f.radius,f.radius,d+f.angle,d,!0),o.lineTo(l.x,l.y)):c>d&&c<=u?(o.arc(r.x,t+y.radius,y.radius-n,p,p+y.angle,!0),o.arc(l.x,s-f.radius,f.radius+n,d+f.angle,d),o.lineTo(l.x,l.y)):(o.arc(r.x,t-f.radius,f.radius+n,d,d+f.angle),o.arc(l.x,s+y.radius,y.radius-n,p+y.angle,p,!0),o.lineTo(l.x,l.y))}};g([$()],Oh.prototype,"x1",2),g([$()],Oh.prototype,"x2",2),g([$()],Oh.prototype,"y1",2),g([$()],Oh.prototype,"y2",2),g([$()],Oh.prototype,"height",2),g([$()],Oh.prototype,"inset",2);function AE(e,t,i){const s=H.angle(H.sub(t,e)),n=H.distance(e,t),a=H.add(e,H.rotate(H.from(n/2,0),s)),o=-1/H.gradient(e,t),r=H.intercept(a,o),l=AZ(.1,.5,Math.PI/2-Math.abs(H.gradient(e,t))),c=H.intersectAtX(o,r,e.x),h=Math.max(i,H.distance(e,c)*l);return{angle:H.angle(H.sub(c,e),H.sub(c,a))/-(1.1-l),radius:h}}function AZ(e,t,i){return ae(e,(t-e)*i+e,t)}var{FillGradientDefaults:CZ,FillPatternDefaults:wZ,FillImageDefaults:LZ,makeSeriesTooltip:NZ,SeriesProperties:TZ,Label:OZ}=N,tv=class extends OZ{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};g([m],tv.prototype,"spacing",2),g([m],tv.prototype,"placement",2),g([m],tv.prototype,"edgePlacement",2);var Yr=class extends X{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],Yr.prototype,"fill",2),g([m],Yr.prototype,"fillOpacity",2),g([m],Yr.prototype,"stroke",2),g([m],Yr.prototype,"strokeOpacity",2),g([m],Yr.prototype,"strokeWidth",2),g([m],Yr.prototype,"lineDash",2),g([m],Yr.prototype,"lineDashOffset",2),g([m],Yr.prototype,"itemStyler",2);var nn=class extends X{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],nn.prototype,"spacing",2),g([m],nn.prototype,"minSpacing",2),g([m],nn.prototype,"width",2),g([m],nn.prototype,"alignment",2),g([m],nn.prototype,"verticalAlignment",2),g([m],nn.prototype,"sort",2),g([m],nn.prototype,"fill",2),g([m],nn.prototype,"fillOpacity",2),g([m],nn.prototype,"stroke",2),g([m],nn.prototype,"strokeOpacity",2),g([m],nn.prototype,"strokeWidth",2),g([m],nn.prototype,"lineDash",2),g([m],nn.prototype,"lineDashOffset",2),g([m],nn.prototype,"itemStyler",2);var yi=class extends TZ{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new CZ,this.fillPatternDefaults=new wZ,this.fillImageDefaults=new LZ,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new tv,this.link=new Yr,this.node=new nn,this.tooltip=NZ()}getStyle(e,t,i,s){const{fillOpacity:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l,fill:c=t[s%t.length],stroke:h=i[s%t.length]}=e?this.link:this.node;return{fill:c,fillOpacity:n,stroke:h,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}};g([m],yi.prototype,"nodes",2),g([m],yi.prototype,"fromKey",2),g([m],yi.prototype,"toKey",2),g([m],yi.prototype,"idKey",2),g([m],yi.prototype,"idName",2),g([m],yi.prototype,"labelKey",2),g([m],yi.prototype,"labelName",2),g([m],yi.prototype,"sizeKey",2),g([m],yi.prototype,"sizeName",2),g([m],yi.prototype,"fillGradientDefaults",2),g([m],yi.prototype,"fillPatternDefaults",2),g([m],yi.prototype,"fillImageDefaults",2),g([m],yi.prototype,"defaultColorRange",2),g([m],yi.prototype,"defaultPatternFills",2),g([m],yi.prototype,"fills",2),g([m],yi.prototype,"strokes",2),g([m],yi.prototype,"label",2),g([m],yi.prototype,"link",2),g([m],yi.prototype,"node",2),g([m],yi.prototype,"tooltip",2);var{Transformable:PZ,SeriesNodePickMode:CE,createDatumId:iv,getShapeStyle:wE,getLabelStyles:EZ,Rect:LE,BBox:NE}=N,sA=class extends gE{constructor(e){super({moduleCtx:e,pickModes:[CE.NEAREST_NODE,CE.EXACT_SHAPE_MATCH]}),this.properties=new yi}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Oh}nodeFactory(){return new LE}createNodeData(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this.properties.node.width,{nodeGraph:i,links:s,maxPathLength:n}=this.getNodeGraph(this.createNode.bind(this,t),this.createLink,{includeCircularReferences:!1}),a=i;if(a.size===0)return;const o=this.initialiseColumns(n);this.assignNodesToColumns(a,o,n);const r=et(this.properties.label),{columnLabelInsetBefore:l,columnLabelInsetAfter:c}=this.getColumnLabelInsets(o,r,n),h=(e-t-l-c)/(n-1);this.positionNodesInColumnsX(o,h,l),this.createGhostNodesAndColumnDiffs(a,o),this.weightNodes(o);const d=1,{sizeScale:u,nodeSpacing:p}=this.getScaleAndSpacing(o,d);if(u<0){K.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}this.positionNodesInColumnsY(o,d,u,p),this.sortAndPositionLinks(a,u);const f=[],y=[];return this.createNodesNodeData(f,a,o,h,r,y),this.createLinksNodeData(f,s,d,u),{itemId:this.id,nodeData:f,labelData:y}}createNode(e,t){return{...t,x:Number.NaN,y:Number.NaN,width:e,height:Number.NaN}}createLink(e){return{...e,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}}initialiseColumns(e){const t=[];for(let i=0;i<e;i+=1)t.push({index:i,size:0,nodes:[],x:0});return t}assignNodesToColumns(e,t,i){const{fromKey:s,toKey:n,sizeKey:a,labelKey:o}=this.properties;for(const r of e.values()){const{datum:l,linksBefore:c,linksAfter:h}=r,d=Math.max(c.reduce((y,{link:b})=>y+b.size,0),h.reduce((y,{link:b})=>y+b.size,0));if(c.length===0&&h.length===0||d===0){r.columnIndex=-1;continue}const u=this.getNodeColumn(t,r,i);l.size=d;const{label:p}=this.properties,f=p.enabled?this.getLabelText(l.label,l.datum,o,"label",[],this.properties.label,{datum:l.datum,value:l.label,fromKey:s,toKey:n,sizeKey:a,size:d}):void 0;l.label=Ne(f),u.nodes.push(r),u.size+=d,r.columnIndex=u.index}}getNodeColumn(e,t,i){const{node:{alignment:s}}=this.properties,{linksBefore:n,linksAfter:a,maxPathLengthBefore:o,maxPathLengthAfter:r}=t;let l;switch(s){case"left":l=e[o];break;case"right":l=e[i-1-r];break;case"center":{if(n.length!==0)l=e[o];else if(a.length===0)l=e[0];else{const c=a.reduce((h,d)=>Math.min(h,d.node.maxPathLengthBefore),i)-1;l=e[c]}break}case"justify":{l=a.length===0?e[i-1]:e[o];break}}return l}getColumnLabelInsets(e,t,i){const{label:{spacing:s,placement:n,edgePlacement:a},node:{width:o}}=this.properties,r=this._nodeDataDependencies?.seriesRectWidth??0;let l=0,c=0;if(this.isLabelEnabled()&&(a==="outside"||a==null)){const h=(d,u)=>{const p=u;if(p.datum.label==null||p.datum.label==="")return d;let f=(r-o)/(i-1)-s;n==="center"&&a==null&&(f/=2);const y=Io(p.datum.label,{maxWidth:f,maxHeight:p.datum.height,font:this.properties.label,textWrap:"never"});let{width:b}=t.measureLines(y);return n==="center"&&a==null&&(b/=2),Math.max(d,b)};(n!=="right"||a==="outside")&&(l=o+e[0].nodes.reduce(h,0)),(n!=="left"||a==="outside")&&(c=o+e.at(-1).nodes.reduce(h,0))}return{columnLabelInsetBefore:l,columnLabelInsetAfter:c}}positionNodesInColumnsX(e,t,i){for(let s=0;s<e.length;s++){const n=e[s];n.x=i+s*t;for(const a of n.nodes)a.datum.x=n.x}}createGhostNodesAndColumnDiffs(e,t){for(const i of e.values()){i.weight=0;let s=1/0;for(const n of i.linksAfter){const a=n.node;s=Math.min(s,a.columnIndex-i.columnIndex)}if(s===1/0)for(const n of i.linksBefore){const a=n.node;s=Math.min(s,i.columnIndex-a.columnIndex)}i.closestColumnDiff=s,this.createNodeGhostNodes(i,t,s)}}createNodeGhostNodes(e,t,i){for(const s of e.linksAfter){const n=s.node;if(!(n.columnIndex<=e.columnIndex))for(let a=n.columnIndex-1;a>e.columnIndex;a--){const o=s.link.size,r={ghost:!0,datum:{...e.datum,size:o,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:a-1,datum:{size:o}}}],linksAfter:[{node:{columnIndex:a+1,datum:{size:o}}}],link:s.link,columnIndex:e.columnIndex,size:e.datum.size,closestColumnDiff:i,fromNode:{y:n.datum.y},toNode:{y:0}};t[a].size+=o,t[a].nodes.push(r)}}}weightNodes(e){const{properties:t}=this;if(t.node.sort==="data")return;if(t.node.sort!=="auto"){for(const n of e)n.nodes.sort((a,o)=>this.sortNodes(a,o));return}const i=e.toSorted((n,a)=>{const o=n.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0);return a.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0)-o}),s={};for(let n=0;n<i.length;n++)s[i[n].index]=Math.pow(10,i.length-n-1);for(const n of e){for(const a of n.nodes){if("ghost"in a&&a.ghost){a.weight=a.size/n.size*s[n.index];continue}a.weight=a.datum.size/n.size*s[n.index]}n.nodes.sort((a,o)=>a.weight-o.weight)}for(const n of e){for(const a of n.nodes)"ghost"in a&&a.ghost||(a.weight+=a.linksBefore.reduce((o,r)=>{if(r.node.columnIndex!==n.index-1)return o;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*s[r.node.columnIndex];return Math.max(o,l)},0),a.weight+=a.linksAfter.reduce((o,r)=>{if(r.node.columnIndex!==n.index+1)return o;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*s[r.node.columnIndex];return Math.max(o,l)},0));n.nodes.sort((a,o)=>this.sortNodes(a,o))}}getScaleAndSpacing(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0,s=o=>e.reduce((r,{size:l,nodes:c})=>{const h=i-c.length*t,u=(1-(c.length-1)*o/h)/l;return Math.min(r,u)},1/0);let n=this.properties.node.spacing,a=s(n);for(;a<0&&n>this.properties.node.minSpacing;)n-=1,a=s(n);return{nodeSpacing:n,sizeScale:a}}positionNodesInColumnsY(e,t,i,s){const n=this._nodeDataDependencies?.seriesRectHeight??0;for(const a of e){let o=0;for(const c of a.nodes){const h=n*c.datum.size*i;c.datum.height=Math.max(t,h),o+=h}const r=s*(a.nodes.length-1);let l=0;this.properties.node.verticalAlignment==="bottom"?l=n-o-r:this.properties.node.verticalAlignment==="center"&&(l=(n-o-r)/2);for(const c of a.nodes)c.datum.y=l,l+=n*c.datum.size*i+s,"ghost"in c&&c.ghost&&c.link.elbows.push({x:a.x,y:c.datum.y})}}sortAndPositionLinks(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0;for(const{datum:s,linksBefore:n,linksAfter:a}of e.values()){let o=s.y;n.sort((l,c)=>this.sortNodes(l.node,c.node));for(const{link:l}of n)l.y2=o,o+=l.size*i*t;let r=s.y;a.sort((l,c)=>this.sortNodes(l.node,c.node,{invertColumnSort:!0}));for(const{link:l}of a)l.y1=r,r+=l.size*i*t}}createNodesNodeData(e,t,i,s,n,a){for(const[o,r]of i.entries()){const l=o===0,c=o===i.length-1;let h=-1/0;r.nodes.sort((d,u)=>d.datum.y-u.datum.y);for(const d of r.nodes){if("ghost"in d&&d.ghost)continue;const{datum:u}=d;u.midPoint={x:u.x+u.width/2,y:u.y+u.height/2},e.push(u),h=this.createNodeLabelData(t,s,n,a,u,l,c,h)}}}createNodeLabelData(e,t,i,s,n,a,o,r){if(n.label==null)return r;const{label:{spacing:l,edgePlacement:c,fontSize:h}}=this.properties,d=this._nodeDataDependencies?.seriesRectWidth??0,u=n.y+n.height/2;let p;if(!a&&!o){const S=Rn(h),M=u-S,D=u+S;let I=d;for(const{datum:C}of e.values())C.x>n.x&&Math.max(C.y,M)<=Math.min(C.y+C.height,D)&&(I=Math.min(I,C.x-l));const k=I-n.x-2*l;p=Io(n.label,{maxWidth:k,maxHeight:n.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(p==null||p===""){const S=c==null&&(a||o)?l:l*2;p=Io(n.label,{maxWidth:t-S,maxHeight:n.height,font:this.properties.label,textWrap:"never"})}if(p==="")return r;const{height:f}=i.measureLines(p),y=u-f/2,b=u+f/2,{x,textAlign:v}=this.getNodeLabelPlacement(n,a,o);return y>=r&&(s.push({x,y:u,textAlign:v,text:p,size:n.size,nodeDatum:n,datumIndex:n.datumIndex}),r=b),r}getNodeLabelPlacement(e,t,i){const{label:{spacing:s,placement:n,edgePlacement:a}}=this.properties;let o=e.x+e.width+s,r="left",l=n;return t&&a==null&&n==null&&(l="left"),a==="outside"?(t&&(l="left"),i&&(l="right")):a==="inside"&&(t&&(l="right"),i&&(l="left")),l==="left"?(o=e.x-s,r="right"):l==="center"&&(o=e.x+e.width/2,r="center"),{x:o,textAlign:r}}createLinksNodeData(e,t,i,s){const n=this._nodeDataDependencies?.seriesRectHeight??0,a=this.properties.node.width;for(const o of t){const{fromNode:r,toNode:l,size:c}=o;o.height=Math.max(i,n*c*s),o.x1=r.x+a,o.x2=l.x,o.midPoint={x:(o.x1+o.x2)/2,y:(o.y1+o.y2)/2+o.height/2},e.push(o)}}sortNodes(e,t,i){const{properties:s}=this;return s.node.sort==="ascending"?(e.datum.label??"").localeCompare(t.datum.label??""):s.node.sort==="descending"?(t.datum.label??"").localeCompare(e.datum.label??""):s.node.sort==="data"?0:e.columnIndex<t.columnIndex?i?.invertColumnSort?1:-1:e.columnIndex>t.columnIndex?i?.invertColumnSort?-1:1:e.weight===t.weight?e.datum.size-t.datum.size:e.closestColumnDiff<t.closestColumnDiff?1:e.closestColumnDiff>t.closestColumnDiff?-1:e.weight-t.weight}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t=this.getHighlightedDatum();e.labelSelection.each((i,s)=>{const{x:n,y:a,textAlign:o,text:r,datumIndex:l,nodeDatum:c}=s,h={fromKey:this.properties.fromKey,size:s.size,sizeKey:this.properties.sizeKey,toKey:this.properties.toKey},d=this.isLabelHighlighted(c,t),u=this.getHighlightStyle(d,l),p=EZ(this,void 0,h,this.properties.label,d,t),{color:f,fontStyle:y,fontWeight:b,fontSize:x,fontFamily:v}=p;i.visible=!0,i.x=n,i.y=a,i.text=r,i.fill=f,i.fontStyle=y,i.fontWeight=b,i.fontSize=x,i.fontFamily=v,i.textAlign=o,i.textBaseline="middle";const S=u.opacity??1;i.opacity=S,i.fillOpacity=S,i.setBoxing(p)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>iv(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:n,strokes:a,defaultColorRange:o,defaultPatternFills:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=s,{itemStyler:d}=s.node,u=o[t%o.length].map(v=>({color:v})),p=r[t%r.length],f=this.getHighlightStyle(i,e.datumIndex),y=re(f,s.getStyle(!1,n,a,t)),b=s.node.fill!=null;let x=wE(y,b?l:{...l.toJson(),colorStops:u},b?c:{...c.toJson(),fill:p,stroke:p},h);if(d!=null&&e.datumIndex!=null){const v=this.cachedDatumCallback(iv(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const S=this.makeItemStylerParams(e,i,x);return this.callWithContext(d,S)});v&&(x=re(v,x,{...l.toJson(),colorStops:u},{...c.toJson(),fill:p,stroke:p},h))}return x.opacity=1,x}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},n,a){const{id:o}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,n,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,datum:e,highlightState:l,...a,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,a)=>{const{datumIndex:o}=a,r=this.getNodeStyle(a,o.index,i);n.x=a.x,n.y=a.y,n.width=Math.max(a.width,0),n.height=Math.max(a.height,0),n.setStyleProperties(r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new NE(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>iv(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:n,properties:a}=this,{fills:o,strokes:r,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=a,{itemStyler:p}=a.link,f=l[i.index%l.length].map(M=>({color:M})),y=c[i.index%c.length],b=this.getHighlightStyle(s,e),x=re(b,a.getStyle(!0,o,r,i.index)),v=a.link.fill!=null;let S=wE(x,v?h:{...h.toJson(),colorStops:f},v?d:{...d.toJson(),fill:y,stroke:y},u);if(p!=null&&e!=null){const M=this.cachedDatumCallback(iv(e.index,"link",s?"highlight":"node"),()=>{const D=this.ctx.highlightManager?.getActiveHighlight(),I=this.getHighlightStateString(D,s,e);return this.callWithContext(p,{seriesId:n,datum:t,highlightState:I,...S})});M&&(S=re(M,S,{...h.toJson(),colorStops:f},{...d.toJson(),fill:y,stroke:y},u))}return S.opacity=1,S}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,a)=>{const o=a.fromNode.datumIndex,r=this.getLinkStyle(a,o,i);n.x1=a.x1,n.y1=a.y1,n.x2=a.x2,n.y2=a.y2,n.height=a.height,n.elbows=a.elbows,n.setStyleProperties(r,s),n.inset=n.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:n,ctx:{formatManager:a}}=this,{fromKey:o,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=n,d=this.contextNodeData?.nodeData.find(v=>v.datumIndex.type===e.type&&v.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,f=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let b;if(d.type===0){const v=d.fromNode.datumIndex;b=this.getLinkStyle({datumIndex:e,datum:f},v,!1)}else b=this.getNodeStyle({datumIndex:e,datum:f},e.index,!1);const x=[];if(l!=null){const v=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:f,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});x.push({label:c,fallbackLabel:l,value:v??String(y)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,b),data:x},{seriesId:t,datum:f,title:p,fromKey:o,toKey:r,sizeKey:l,sizeName:c,size:y,...b})}computeFocusBounds(e){if(e instanceof LE){const{x:t,y:i,width:s,height:n}=e,a=new NE(t,i,s,n);return PZ.toCanvas(this.contentGroup,a)}return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};sA.className="SankeySeries",sA.type="sankey";var{sankeySeriesThemeableOptionsDef:RZ}=N,rp={...RZ,...qe,type:j(Ae("sankey")),fromKey:j(L),toKey:j(L),sizeKey:L,sizeName:L};rp.fillGradientDefaults=Q(ng),rp.fillPatternDefaults=Q(ag),rp.fillImageDefaults=Q(og),rp.defaultColorRange=Q(me(me(te))),rp.defaultPatternFills=Q(me(te));var TE={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,solo:!0,version:ue,dependencies:[op],options:rp,themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:Vi,fillPatternDefaults:tt,fillImageDefaults:it,defaultColorRange:{$palette:"gradients"},defaultPatternFills:H0,highlight:{unhighlightedItem:{opacity:.5}},label:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:{$if:[{$greaterThan:[{$path:"./minSpacing"},20]},{$path:"./minSpacing"},20]},minSpacing:0,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}}},legend:{enabled:!1,toggleSeries:!1}},create:e=>new sA(e)};function zZ(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:n,minimumFontSize:a=n}=t,o=i-s,r=n-a;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||c>a;){const d=o>0?(l-s)/o:-1,u=r>0?(c-a)/r:-1;d>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function OE(e,t,i,s,{padding:n},a){const{spacing:o=0}=t,r=2*n,l=2*n+o,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>a(c+l,!1).height-l)return;const h=zZ(t,s),d={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,f;return Wy(0,h.length-1,y=>{const{labelFontSize:b,secondaryLabelFontSize:x}=h[y],v=y===0,S={...d,fontSize:b},M={...u,fontSize:x},D=et(S).lineHeight(),I=et(M).lineHeight(),k=a(D+I+l,v),C=k.width-r,A=k.height-l;if(D+I>A||(p?.fontSize!==b&&(p=EE(t,e,C,A,S,t.wrapping,v?t.overflowStrategy:"hide")),p==null||p.width>C||p.height>A)||(f?.fontSize!==x&&(f=EE(s,i,C,A,M,s.wrapping,v?s.overflowStrategy:"hide")),f==null))return;const w=p.height+f.height;if(!(f.width>C||w>A))return{width:Math.max(p.width,f.width),height:w+o,meta:k.meta,label:p,secondaryLabel:f}})}function Wf(e,t,{padding:i},s){const n=2*i,a=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),o={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return Wy(a,t.fontSize,r=>{const l={...o,fontSize:r},c=et(l),h=r===a,d=t.lineHeight??c.lineHeight(),u=s(d+n,h),p=u.width-n,f=u.height-n;if(d>f||p<0)return;const y=Qd(e,{maxWidth:p,maxHeight:f,font:l,textWrap:t.wrapping,overflow:(h?t.overflowStrategy:null)??"hide"});if(!y.length)return;const{width:b,height:x}=c.measureLines(y),v=y.join(`
`);return[{width:b,height:x,text:v,fontSize:r,lineHeight:d},u.meta]})}function PE(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function nA(e,t,i,s,n,a){const o=t.enabled?e:void 0,r=s.enabled?i:void 0;(PE(t)||PE(s))&&K.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;o!=null&&r!=null&&(l=OE(o,t,r,s,n,a));let c;if(l==null&&o!=null&&(c=Wf(o,t,n,a)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let h;if(l==null&&o==null&&r!=null&&(h=Wf(r,s,n,a)),h!=null){const[d,u]=h;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function EE(e,t,i,s,n,a,o){const r=Qd(t,{maxWidth:i,maxHeight:s,font:n,textWrap:a,overflow:o});if(!r.length)return;const l=et(n),c=e.lineHeight??l.lineHeight(),{width:h}=l.measureLines(r);return{width:h,lineHeight:c,text:r.join(`
`),height:r.length*c,fontSize:n.fontSize}}var lp=class extends N.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};g([m],lp.prototype,"wrapping",2),g([m],lp.prototype,"overflowStrategy",2),g([m],lp.prototype,"lineHeight",2),g([m],lp.prototype,"minimumFontSize",2);var cp=class extends lp{constructor(){super(...arguments),this.spacing=0}};g([m],cp.prototype,"spacing",2);var sv=class extends lp{},{HierarchySeriesProperties:VZ,makeSeriesTooltip:BZ,HighlightProperties:FZ}=N,oc=class extends X{};g([m],oc.prototype,"fill",2),g([m],oc.prototype,"fillOpacity",2),g([m],oc.prototype,"stroke",2),g([m],oc.prototype,"strokeWidth",2),g([m],oc.prototype,"strokeOpacity",2),g([m],oc.prototype,"opacity",2);var aA=class extends FZ{constructor(){super(...arguments),this.highlightedBranch=new oc,this.unhighlightedBranch=new oc}};g([m],aA.prototype,"highlightedBranch",2),g([m],aA.prototype,"unhighlightedBranch",2);var an=class extends VZ{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlight=new aA,this.label=new cp,this.secondaryLabel=new sv,this.tooltip=BZ()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:a}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:a,opacity:1}}};g([m],an.prototype,"sizeName",2),g([m],an.prototype,"labelKey",2),g([m],an.prototype,"secondaryLabelKey",2),g([m],an.prototype,"fillOpacity",2),g([m],an.prototype,"strokeWidth",2),g([m],an.prototype,"strokeOpacity",2),g([m],an.prototype,"cornerRadius",2),g([m],an.prototype,"sectorSpacing",2),g([m],an.prototype,"padding",2),g([m],an.prototype,"itemStyler",2),g([m],an.prototype,"highlight",2),g([m],an.prototype,"label",2),g([m],an.prototype,"secondaryLabel",2),g([m],an.prototype,"tooltip",2);var{fromToMotion:_Z,createDatumId:HZ,PointerEvents:GZ,Sector:RE,Group:nv,ScalableGroup:jZ,Selection:oA,TransformableText:rA,BBox:zE,getLabelStyles:WZ,toHierarchyHighlightString:$Z}=N,KZ=class extends N.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function VE(e,t=0,i=2*Math.PI/e.sumSize){for(const s of e.children){const n=t+s.sumSize*i;s.startAngle=t,s.endAngle=n,VE(s,t,i),t=n}}var lA=class extends N.HierarchySeries{constructor(e){super(e),this.NodeClass=KZ,this.properties=new an,this.scalingGroup=this.contentGroup.appendChild(new jZ),this.sectorGroup=this.scalingGroup.appendChild(new nv),this.highlightSectorGroup=this.scalingGroup.appendChild(new nv),this.sectorLabelGroup=this.scalingGroup.appendChild(new nv),this.datumSelection=oA.select(this.sectorGroup,RE),this.labelSelection=oA.select(this.sectorLabelGroup,nv),this.highlightSelection=oA.select(this.highlightSectorGroup,RE),this.sectorLabelGroup.pointerEvents=GZ.None}processData(){super.processData(),VE(this.rootNode)}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(t==null||t.seriesRect==null)return;const s=Array.from(this.rootNode),n=a=>{a.append([new rA({tag:0}),new rA({tag:1})])};this.datumSelection.update(s,void 0,a=>this.getDatumId(a)),this.labelSelection.update(s,n,a=>this.getDatumId(a))}getItemStyle(e,t){const{properties:i,colorScale:s}=this,{itemStyler:n}=i,a=e.datumIndex?.[0]??0,o=this.getActiveHighlightNode(),r=this.getHierarchyHighlightState(t,o,e),l=this.getHierarchyHighlightStyles(r,this.properties.highlight),c=re(l,i.getStyle(a));e.colorValue!=null&&l?.fill==null&&(c.fill=s.convert(e.colorValue));let h=c;if(n!=null&&e!=null){const d=this.cachedDatumCallback(HZ(this.getDatumId(e),t?"highlight":"node"),()=>{const u=this.makeItemStylerParams(e,h,$Z(r));return this.callWithContext(n,u)});d&&(h=re(d,h))}return h}makeItemStylerParams(e,t,i){const{id:s}=this,n=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:s,datum:e.datum,depth:e.depth??0,highlightState:i,...t,fill:n}}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(e==null||t==null)return;const{width:s,height:n}=e.seriesRect,{sectorSpacing:a=0,padding:o=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:f}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=n/2;const y=a*.5,b=Math.min(s,n)/2,x=b/(i+1),v=-Math.PI/2,S={series:new zE(-b,-b,2*b,2*b),axis:new zE(-b,-b,2*b,2*b)};this.rootNode?.walk(C=>{const{startAngle:A,endAngle:w}=C;if(C.depth!=null){const T=(A+w)/2+v,O=(C.depth+.5)*x;C.midPoint.x=Math.cos(T)*O,C.midPoint.y=Math.sin(T)*O}}),this.rootNode?.walk(C=>{const{datum:A,depth:w,startAngle:T,endAngle:O,parent:z,sumSize:V}=C;C.label=void 0,C.secondaryLabel=void 0,C.contentHeight=0;let E;if(A!=null&&w!=null&&d!=null){const vt=A[d];E=this.getLabelText(vt,A,d,"label",[],this.properties.label,{depth:w,datum:A,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:f,value:vt})}E===""&&(E=void 0);let _;if(A!=null&&w!=null&&u!=null){const vt=A[u];_=this.getLabelText(vt,A,u,"secondaryLabel",[],this.properties.secondaryLabel,{depth:w,datum:A,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:f,value:vt})}if(_===""&&(_=void 0),w==null)return;const G=w*x+y,B=(w+1)*x-y,F=G>y?y/G:y,Y=B>y?y/B:y,Z=T+F,ee=O+F-Z,he=T+Y,Ce=O+Y-he,xe=vt=>{if(w===0&&z?.sumSize===V)return{width:2*Math.sqrt(B**2-(vt*.5)**2),height:vt,meta:0};const It=vt,js=2*Math.sqrt(B**2-(G+It)**2),cn=ee<Math.PI?2*G*Math.tan(ee*.5):1/0,nd=Math.min(js,cn),Cm=Math.PI/4;let ir,Lc;return w===0?(ir=vt,Lc=Math.sqrt(B**2-(ir/2)**2)-vt/(2*Math.tan(Ce*.5))):Qe(ee)<Cm?(ir=2*G*Math.tan(ee*.5),Lc=Math.sqrt(B**2-(ir/2)**2)-G):(Lc=0,ir=0),nd>=Lc?{width:nd,height:It,meta:1}:{width:Lc,height:ir,meta:2}},Ge=nA(Ne(E),this.properties.label,Ne(_),this.properties.secondaryLabel,{padding:o},xe);if(Ge==null)return;const{width:je,height:dt,meta:Ze,label:we,secondaryLabel:Ie}=Ge,pe=v+(T+O)/2,yt=Math.sin(pe)>=0,xt=Math.cos(pe)>=0,ut=(yt?3:12)&(xt?6:9);let bt;switch(Ze){case 0:bt=0;break;case 1:{const Si=B-(x-dt)*.58,It=Math.sqrt((B-o)**2-(je/2)**2);bt=Math.min(Si,It);break}case 2:if(w===0){const vt=dt/(2*Math.tan(ee*.5))+je*.5,Si=Math.sqrt(B**2-(dt*.5)**2)-je*.5;bt=(vt+Si)*.5}else bt=(G+B)*.5;break}if(we!=null){const{fontStyle:vt="normal",fontFamily:Si,fontWeight:It="normal",color:js="black"}=this.properties.label;C.label={...we,fontStyle:vt,fontFamily:Si,fontWeight:It,color:js,labelPlacement:Ze,circleQuarter:ut,radius:bt,theta:pe}}if(Ie!=null){const{fontStyle:vt="normal",fontFamily:Si,fontWeight:It="normal",color:js="black"}=this.properties.secondaryLabel;C.secondaryLabel={...Ie,fontStyle:vt,fontFamily:Si,fontWeight:It,color:js,labelPlacement:Ze,circleQuarter:ut,radius:bt,theta:pe}}C.contentHeight=Ge.height});const M=(C,A,w)=>{const{depth:T,startAngle:O,endAngle:z}=C;if(T==null){A.visible=!1;return}A.visible=!0;const V=this.getItemStyle(C,w),E=V.fill,_=V.strokeWidth,G=Qt(E)&&E.bounds!=="item"?S:void 0;A.setStyleProperties(V,G),A.centerX=0,A.centerY=0,A.innerRadius=T*x,A.outerRadius=(T+1)*x,A.startAngle=O+v,A.endAngle=z+v,A.inset=y+_*.5,A.cornerRadius=r};this.datumSelection.each((C,A)=>{M(A,C,!1)}),this.highlightSelection.each((C,A)=>{M(A,C,!0)});const D=this.getActiveHighlightNode(),I=(C,A,w,T)=>{const{depth:O,contentHeight:z}=C,V=w===0,E=V?C.label:C.secondaryLabel;if(O==null||E==null){A.visible=!1;return}const{labelPlacement:_,circleQuarter:G,radius:B,theta:F}=E,Y=this.getHierarchyHighlightState(T,D,C),{opacity:Z}=this.getHierarchyHighlightStyles(Y,this.properties.highlight)??{},ie={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:C.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},ee=V?this.properties.label:this.properties.secondaryLabel,he=this.ctx.highlightManager?.getActiveHighlight(),Me=WZ(this,C,ie,ee,T,he);switch(A.text=E.text,A.fontSize=E.fontSize,A.lineHeight=E.lineHeight,A.fontStyle=E.fontStyle,A.fontFamily=E.fontFamily,A.fontWeight=E.fontWeight,A.fillOpacity=Z??1,A.fill=Me.color,A.setBoxing(Me),_){case 0:A.textAlign="center",A.textBaseline="top",A.translationX=0,A.translationY=(V?0:z-E.height)-z*.5,A.rotation=0;break;case 1:{const Ce=(G&3)!==0,xe=V===!Ce?B:B-(z-E.height);A.textAlign="center",A.textBaseline=Ce?"bottom":"top",A.translationX=Math.cos(F)*xe,A.translationY=Math.sin(F)*xe,A.rotation=Ce?F-Math.PI*.5:F+Math.PI*.5;break}case 2:{const Ce=(G&6)!==0,xe=V===!Ce?(z-E.height)*.5:(E.height-z)*.5;A.textAlign="center",A.textBaseline="middle",A.translationX=Math.cos(F)*B+Math.cos(F+Math.PI/2)*xe,A.translationY=Math.sin(F)*B+Math.sin(F+Math.PI/2)*xe,A.rotation=Ce?F:F+Math.PI;break}}A.visible=!0},k=this.getActiveHighlightNode();for(const C of this.labelSelection.selectByClass(rA)){const A=C.closestDatum();I(A,C,C.tag,A===k)}}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{labelKey:n,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:c,colorName:h,tooltip:d}=i,{formatManager:u}=s,p=e.reduce((I,k)=>I?.children[k],this.rootNode);if(p==null)return;const{datum:f,depth:y}=p;if(f==null||y==null)return;const b=[],x=r==null?void 0:f[r];if(x!=null){const I=[0,this.rootNode?.sumSize??0],k=u.format(this.callWithContext.bind(this),{type:"number",value:x,datum:f,seriesId:t,legendItemName:void 0,key:r,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:I,fractionDigits:void 0,visibleDomain:void 0});b.push({label:l,fallbackLabel:r,value:k??ya(x)})}const v=c==null?void 0:f[c];if(v!=null){const{colorDomain:I}=this,k=u.format(this.callWithContext.bind(this),{type:"number",value:v,datum:f,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:I,fractionDigits:void 0,visibleDomain:void 0});b.push({label:h,fallbackLabel:c,value:k??ya(v)})}const S=this.getItemStyle({...p,colorValue:v??p.colorValue},!1),D={shape:"square",fill:S.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return Qt(D.fill)&&(D.fill={...D.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:n==null?void 0:f[n],symbol:{marker:D},data:b},{seriesId:t,datum:f,title:void 0,depth:y,labelKey:n,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:c,colorName:h,...S})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){_Z(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};lA.className="SunburstSeries",lA.type="sunburst";var{sunburstSeriesThemeableOptionsDef:UZ}=N,YZ={...UZ,...J(qe,["highlightStyle","highlight","showInLegend"]),type:j(Ae("sunburst")),labelKey:L,secondaryLabelKey:L,childrenKey:L,sizeKey:L,colorKey:L,sizeName:L,colorName:L},ZZ={series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",yy],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:ki.LARGE},minimumFontSize:{$rem:9/Va},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:ki.SMALLEST},minimumFontSize:{$rem:7/Va},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},BE={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,solo:!0,version:ue,dependencies:[op],options:YZ,themeTemplate:ZZ,create:e=>new lA(e)},{HierarchySeriesProperties:XZ,makeSeriesTooltip:qZ,Label:QZ}=N,FE=class extends QZ{constructor(){super(...arguments),this.spacing=0}};g([m],FE.prototype,"spacing",2);var rc=class extends X{};g([m],rc.prototype,"fill",2),g([m],rc.prototype,"fillOpacity",2),g([m],rc.prototype,"stroke",2),g([m],rc.prototype,"strokeWidth",2),g([m],rc.prototype,"strokeOpacity",2),g([m],rc.prototype,"opacity",2);var cA=class extends X{constructor(){super(...arguments),this.highlightedItem=new rc,this.unhighlightedItem=new rc}};g([m],cA.prototype,"highlightedItem",2),g([m],cA.prototype,"unhighlightedItem",2);var Go=class extends X{};g([m],Go.prototype,"fill",2),g([m],Go.prototype,"fillOpacity",2),g([m],Go.prototype,"stroke",2),g([m],Go.prototype,"strokeWidth",2),g([m],Go.prototype,"strokeOpacity",2),g([m],Go.prototype,"opacity",2);var $f=class extends X{constructor(){super(...arguments),this.highlightedBranch=new Go,this.highlightedItem=new Go,this.unhighlightedItem=new Go,this.unhighlightedBranch=new Go}};g([m],$f.prototype,"highlightedBranch",2),g([m],$f.prototype,"highlightedItem",2),g([m],$f.prototype,"unhighlightedItem",2),g([m],$f.prototype,"unhighlightedBranch",2);var qn=class extends X{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new FE,this.highlight=new cA}};g([m],qn.prototype,"fill",2),g([m],qn.prototype,"fillOpacity",2),g([m],qn.prototype,"stroke",2),g([m],qn.prototype,"strokeWidth",2),g([m],qn.prototype,"strokeOpacity",2),g([m],qn.prototype,"cornerRadius",2),g([m],qn.prototype,"textAlign",2),g([m],qn.prototype,"gap",2),g([m],qn.prototype,"padding",2),g([m],qn.prototype,"interactive",2),g([m],qn.prototype,"label",2),g([m],qn.prototype,"highlight",2);var kn=class extends X{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new cp,this.secondaryLabel=new sv,this.highlight=new $f}};g([m],kn.prototype,"fill",2),g([m],kn.prototype,"fillOpacity",2),g([m],kn.prototype,"stroke",2),g([m],kn.prototype,"strokeWidth",2),g([m],kn.prototype,"strokeOpacity",2),g([m],kn.prototype,"cornerRadius",2),g([m],kn.prototype,"textAlign",2),g([m],kn.prototype,"verticalAlign",2),g([m],kn.prototype,"gap",2),g([m],kn.prototype,"padding",2),g([m],kn.prototype,"label",2),g([m],kn.prototype,"secondaryLabel",2),g([m],kn.prototype,"highlight",2);var jo=class extends XZ{constructor(){super(...arguments),this.tooltip=qZ(),this.group=new qn,this.tile=new kn,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,s){const{fillOpacity:n,strokeWidth:a,strokeOpacity:o,fill:r=e?t[s%t.length]:t[Math.min(s,t.length)],stroke:l=e?i[s%t.length]:i[Math.min(s,i.length)]}=e?this.tile:this.group;return{fill:r,fillOpacity:n,stroke:l,strokeWidth:a,strokeOpacity:o,opacity:1}}};g([m],jo.prototype,"sizeName",2),g([m],jo.prototype,"labelKey",2),g([m],jo.prototype,"secondaryLabelKey",2),g([m],jo.prototype,"itemStyler",2),g([m],jo.prototype,"tooltip",2),g([m],jo.prototype,"group",2),g([m],jo.prototype,"tile",2),g([m],jo.prototype,"undocumentedGroupFills",2),g([m],jo.prototype,"undocumentedGroupStrokes",2);var{createDatumId:JZ,Rect:_E,Group:HE,BBox:hp,Selection:hA,Text:dA,Transformable:eX,getLabelStyles:tX,HierarchyHighlightState:no,toHierarchyHighlightString:Kf}=N,iX=class extends N.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function lc(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var GE={left:0,center:.5,right:1},sX={top:0,middle:.5,bottom:1},xne=class extends N.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},uA=class extends N.HierarchySeries{constructor(){super(...arguments),this.NodeClass=iX,this.properties=new jo,this.rectGroup=this.contentGroup.appendChild(new HE),this.datumSelection=hA.select(this.rectGroup,_E),this.labelSelection=hA.select(this.labelGroup,HE),this.highlightSelection=hA.select(this.rectGroup,_E)}groupTitleHeight(e,t){const{label:s}=this.properties.group,{labelValue:n}=e,{fontSize:a}=s;if(s.enabled&&n!=null&&a<=t.width/3&&a<=t.height/3){const{height:o}=et(s).measureLines(n);return Math.max(o,a)}}getNodePadding(e,t){if(e.parent==null)return{top:0,right:0,bottom:0,left:0};if(e.children.length===0){const{padding:o}=this.properties.tile;return{top:o,right:o,bottom:o,left:o}}const{padding:i,label:{spacing:s}}=this.properties.group,n=this.groupTitleHeight(e,t),a=n==null?0:n+s;return{top:i+a,right:i,bottom:i,left:i}}sortChildren({children:e}){const t=Array.from(e,(s,n)=>n).filter(s=>lc(e[s])>0).sort((s,n)=>lc(e[n])-lc(e[s]));return{sortedChildrenIndices:t,childAt:s=>{const n=t[s];return e[n]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0){e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN;return}const n=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);e.parent==null?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN):(e.bbox=t,e.padding=n,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:a,childAt:o}=this.sortChildren(e),r=a.every(D=>s[D].children.length===0),l=1,c=t.width-n.left-n.right,h=t.height-n.top-n.bottom;if(c<=0||h<=0)return;const d=a.length;let u=0,p=0,f=1/0,y=a.reduce((D,I)=>D+lc(s[I]),0);const b=new hp(t.x+n.left,t.y+n.top,c,h),x=b.clone();let v=0;for(;v<d;){const D=lc(o(v)),I=lc(o(p)),k=x.width<x.height;u+=D;const C=k?x.height:x.width,A=k?x.width:x.height,w=A*I/u;let T=C*u/y;const O=Math.max(w,T)/Math.min(w,T),z=Math.abs(l-O);if(z<f){f=z,v++;continue}u-=D,T=C*u/y;let V=k?x.x:x.y;for(let E=p;E<v;E++){const _=o(E),G=lc(_),B=k?V:x.x,F=k?x.y:V,Y=A*G/u,Z=k?Y:T,ie=k?T:Y,ee=new hp(B,F,Z,ie);this.applyGap(b,ee,r),this.squarify(_,ee),y-=G,V+=Y}k?(x.y+=T,x.height-=T):(x.x+=T,x.width-=T),p=v,u=0,f=1/0}const S=x.width<x.height;let M=S?x.x:x.y;for(let D=p;D<d;D++){const I=o(D),k=S?M:x.x,C=S?x.y:M,A=lc(I)/y,w=x.width*(S?A:1),T=x.height*(S?1:A),O=new hp(k,C,w,T);this.applyGap(b,O,r),this.squarify(I,O),M+=S?w:T}}applyGap(e,t,i){const s=i?this.properties.tile.gap*.5:this.properties.group.gap*.5,n=l=>({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=n(e),o=n(t),r=["top","right","bottom","left"];for(const l of r)He(a[l],o[l])||t.shrink(s,l)}createNodeData(){}getItemStyle(e,t,i){const{properties:s,colorScale:n}=this,{itemStyler:a}=s,o=e.datumIndex?.[0]??0,r=t?s.fills:s.undocumentedGroupFills,l=t?s.strokes:s.undocumentedGroupStrokes,c=t?o:e.depth??-1,h=this.getActiveHighlightNode(),d=this.getHierarchyHighlightState(i,h,e),u=this.getGroupHighlightState(i,h,e),p=t?d:u,f=t?this.getTileHighlightStyle(d,u,h):this.getGroupHighlightStyle(u),y=re(f,s.getStyle(t,r,l,c));t&&e.colorValue!=null&&f?.fill==null&&(y.fill=n.convert(e.colorValue));let b=y;if(a!=null&&e!=null){const x=this.cachedDatumCallback(JZ(this.getDatumId(e),i?"highlight":"node"),()=>{const v=this.makeItemStylerParams(e,b,Kf(p));return this.callWithContext(a,v)});x&&(b=re(x,b))}return b}makeItemStylerParams(e,t,i){const{id:s}=this,n=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:s,datum:e.datum,depth:e.depth??-1,highlightState:i,...t,fill:n}}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),s=n=>{n.append([new dA({tag:0}),new dA({tag:1})])};this.datumSelection.update(i,void 0,n=>this.getDatumId(n)),this.labelSelection.update(i,s,n=>this.getDatumId(n))}getActiveHighlightNode(){const e=super.getActiveHighlightNode();if(!(e?.children.length&&!this.properties.group.interactive))return e}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,tile:c,group:h}=this.properties,{seriesRect:d}=this.chart??{};if(!d||!t)return;this.rootNode?.walk(v=>{const{datum:S,depth:M,children:D}=v,I=D.length===0,k=I?c.label:h.label;let C;if(k.enabled&&S!=null&&M!=null&&a!=null){const w=S[a];C=this.getLabelText(w,S,a,"label",[],k,{depth:M,datum:S,childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:w})}C===""&&(C=void 0);let A;if(c.secondaryLabel.enabled&&I&&S!=null&&M!=null&&o!=null){const w=S[o];A=this.getLabelText(w,S,o,"secondaryLabel",[],c.secondaryLabel,{depth:M,datum:S,childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:w})}A===""&&(A=void 0),v.labelValue=Ne(C),v.secondaryLabelValue=Ne(A)});const{width:u,height:p}=d;this.squarify(e,new hp(0,0,u,p)),this.rootNode?.walk(v=>{const{bbox:S,children:M,labelValue:D,secondaryLabelValue:I}=v;if(v.label=void 0,v.secondaryLabel=void 0,S!=null)if(M.length===0){const k={width:S.width,height:S.height,meta:null},C=nA(D,this.properties.tile.label,I,this.properties.tile.secondaryLabel,{padding:c.padding},()=>k);if(C==null)return;const{height:A,label:w,secondaryLabel:T}=C,{textAlign:O,verticalAlign:z,padding:V}=c,E=GE[O]??.5,_=S.x+V+(S.width-2*V)*E,G=sX[z]??.5,B=S.y+V+A*.5+(S.height-2*V-A)*G;if(w!=null){const{fontStyle:F="normal",fontFamily:Y,fontWeight:Z="normal",color:ie="black"}=this.properties.tile.label;v.label={text:w.text,fontSize:w.fontSize,lineHeight:w.lineHeight,fontStyle:F,fontFamily:Y,fontWeight:Z,color:ie,textAlign:O,verticalAlign:"middle",x:_,y:B-(A-w.height)*.5}}if(T!=null){const{fontStyle:F="normal",fontFamily:Y,fontWeight:Z="normal",color:ie="black"}=this.properties.tile.secondaryLabel;v.secondaryLabel={text:T.text,fontSize:T.fontSize,lineHeight:T.fontSize,fontStyle:F,fontFamily:Y,fontWeight:Z,color:ie,textAlign:O,verticalAlign:"middle",x:_,y:B+(A-T.height)*.5}}}else{if(D==null)return;{const{padding:k,textAlign:C}=h,A=this.groupTitleHeight(v,S);if(A==null)return;const w=S.width-2*k,T=Io(D,{maxWidth:S.width-2*k,font:h.label,textWrap:"never"}),O=GE[C]??.5,{fontStyle:z="normal",fontFamily:V,fontWeight:E="normal",color:_="black"}=this.properties.group.label;v.label={text:T,fontSize:h.label.fontSize,lineHeight:Rn(h.label.fontSize),fontStyle:z,fontFamily:V,fontWeight:E,color:_,textAlign:C,verticalAlign:"middle",x:S.x+k+w*O,y:S.y+k+A*.5}}}});const f={series:new hp(0,0,u,p),axis:new hp(0,0,u,p)},y=(v,S,M)=>{const{bbox:D}=v;if(D==null){S.visible=!1;return}const{depth:I=-1}=v,k=v.children.length===0,C=this.getItemStyle(v,k,M);S.crisp=!0,S.setStyleProperties(C,f),S.cornerRadius=k?c.cornerRadius:h.cornerRadius,S.zIndex=[0,I,M?1:0];const A=v.parent?.children.every(O=>O.children.length===0),w=v.parent==null?void 0:v.parent.bbox,T=v.parent==null?void 0:v.parent.padding;A===!0&&w!=null&&T!=null?(S.clipBBox=D,S.x=w.x+T.left,S.y=w.y+T.top,S.width=w.width-(T.left+T.right),S.height=w.height-(T.top+T.bottom)):(S.clipBBox=void 0,S.x=D.x,S.y=D.y,S.width=D.width,S.height=D.height),S.visible=!0};this.datumSelection.each((v,S)=>y(S,v,!1)),this.highlightSelection.each((v,S)=>{y(S,v,!0)});const b=(v,S,M,D)=>{const I=v.children.length===0,k=M===0?v.label:v.secondaryLabel;if(k==null){S.visible=!1;return}let C,A;M===0?(C=I?c.label:h.label,A=["series",`${this.declarationOrder}`,I?"tile":"group","label"]):(C=c.secondaryLabel,A=["series",`${this.declarationOrder}`,"tile","secondaryLabel"]);const{opacity:w}=this.getItemStyle(v,I,D)??{},T={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:v.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},O=this.ctx.highlightManager?.getActiveHighlight(),z=tX(this,v,T,C,D,O,A);S.text=k.text,S.fontSize=k.fontSize,S.lineHeight=k.lineHeight,S.fontStyle=k.fontStyle,S.fontFamily=k.fontFamily,S.fontWeight=k.fontWeight,S.fillOpacity=w??1,S.fill=z.color,S.setBoxing(z),S.textAlign=k.textAlign,S.textBaseline=k.verticalAlign,S.x=k.x,S.y=k.y,S.visible=!0,S.zIndex=1},x=this.getActiveHighlightNode();for(const v of this.labelSelection.selectByClass(dA)){const S=v.closestDatum();b(S,v,v.tag,S===x)}}getGroupHighlightState(e,t,i){const s=i.datumIndex,n=t?.datumIndex,a=this.isDescendantDatumIndex(s,n);if(i.children?.length===0)return s==null||t==null||t.children?.length===0?no.None:a?no.Item:no.OtherItem;if(t==null||t.children?.length===0)return no.None;const o=i.depth!=null&&t.depth!=null&&i.depth===t.depth;return a&&!o?no.None:e?no.Item:no.OtherItem}getTileHighlightStyle(e,t,i){if(i?.children&&i.children.length>0){const n=this.getGroupHighlightStyle(t);return n?.fillOpacity==null&&n?.strokeOpacity==null?void 0:{fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity}}return this.getHierarchyHighlightStyles(e,this.properties.tile.highlight)}getGroupHighlightStyle(e){const{highlight:t}=this.properties.group;switch(e){case no.Item:return t.highlightedItem;case no.OtherItem:return t.unhighlightedItem;default:return}}getHighlightStateString(e,t,i){if(i==null)return Kf(no.None);const s=i.reduce((r,l)=>r?.children[l],this.rootNode),n=this.getActiveHighlightNode();if(s==null)return Kf(no.None);if((s.children?.length??0)===0){const r=this.getHierarchyHighlightState(t??!1,n,s);return Kf(r)}const o=this.getGroupHighlightState(t??!1,n,s);return Kf(o)}isDescendantDatumIndex(e,t){if(t==null||t.length===0)return!0;if(e==null||e.length<t.length)return!1;for(let i=0;i<t.length;i+=1)if(e[i]!==t[i])return!1;return!0}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return t.length!==0?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{formatManager:n}=s,{labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:d,tooltip:u}=i,p=e.reduce((A,w)=>A?.children[w],this.rootNode);if(p==null)return;const{datum:f,depth:y,children:b}=p;if(f==null||y==null)return;const x=b.length===0,v=[],S=l==null?void 0:f[l];if(S!=null){const A=[0,this.rootNode?.sumSize??0],w=n.format(this.callWithContext.bind(this),{type:"number",value:S,datum:f,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:A,fractionDigits:void 0,visibleDomain:void 0});v.push({label:c,fallbackLabel:l,value:w??ya(S)})}const M=h==null?void 0:f[h];if(M!=null){const{colorDomain:A}=this,w=n.format(this.callWithContext.bind(this),{type:"number",value:M,datum:f,seriesId:t,legendItemName:void 0,key:h,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:A,fractionDigits:void 0,visibleDomain:void 0});v.push({label:d,fallbackLabel:h,value:w??ya(M)})}const D=this.getItemStyle({...p,colorValue:M??p.colorValue},x,!1),k={shape:"square",fill:D.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};Qt(k.fill)&&(k.fill={...k.fill,gradient:"linear",rotation:0,reverse:!1});const C=x?{marker:k}:void 0;return this.formatTooltipWithContext(u,{title:a==null?void 0:f[a],symbol:C,data:v},{seriesId:t,datum:f,title:void 0,depth:y,labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:d,...D})}computeFocusBounds(e){return eX.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};uA.className="TreemapSeries",uA.type="treemap";var{treemapSeriesThemeableOptionsDef:nX}=N,pA={...nX,...J(qe,["highlightStyle","highlight","showInLegend"]),type:j(Ae("treemap")),labelKey:L,secondaryLabelKey:L,childrenKey:L,sizeKey:L,colorKey:L,sizeName:L,colorName:L};pA.undocumentedGroupFills=Q(me(te)),pA.undocumentedGroupStrokes=Q(me(te));var jE={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,solo:!0,version:ue,dependencies:[op],options:pA,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Vi],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...Ye,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left",highlight:{unhighlightedItem:{opacity:.2,fillOpacity:.2,strokeOpacity:.2}}},tile:{label:{...Ye,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:ki.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...Ye,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:ki.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},create:e=>new uA(e)},av=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.cleanup.register(()=>e.animationManager.skip(!0))}};g([Xt((e,t)=>{e.ctx.animationManager.skip(!t)}),m],av.prototype,"enabled",2),g([Xt((e,t)=>{t!=null&&(e.ctx.animationManager.defaultDuration=t)}),m],av.prototype,"duration",2),g([Xt((e,t)=>{e.ctx.animationManager.maxAnimatableItems=t??1/0}),m],av.prototype,"maxAnimatableItems",2);var Uf={type:"plugin",name:"animation",enterprise:!0,version:ue,options:{enabled:R,duration:P},themeTemplate:{enabled:!0},create:e=>new av(e)};Uf.options.maxAnimatableItems=Q(P);var WE=class Pm extends hi{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),t==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new N.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(n,a)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const o=i.getBounds().width;i.setBounds({x:n.x,y:n.y,width:o}),n.shrink({left:o+i.horizontalSpacing+(a??0)})},addToolbarListener:(n,a)=>i.addToolbarListener(n,o=>{const r=this.getSectionIndex(t,o.button.index);if(r<0)return;const l={...o,button:this.sectionButtons[t][r]};a(l)}),updateButtons:n=>{this.sectionButtons[t]=n;const a=Pm.SECTION_ORDER.flatMap(o=>this.sectionButtons[o]);i.updateButtons(a)},updateButtonByIndex:(n,a)=>{i.updateButtonByIndex(this.getIndex(t,n),a)},toggleActiveButtonByIndex:n=>{i.toggleActiveButtonByIndex(this.getIndex(t,n))},toggleButtonEnabledByIndex:(n,a)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,n),a)},setHidden:n=>{n?this.activeSections.delete(t):this.activeSections.add(t);let a=0;for(const o of Pm.SECTION_ORDER){if(o!==t){a+=this.sectionButtons[o].length;continue}for(const r of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(a+r,n)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const n of Pm.SECTION_ORDER){if(n===t)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(t,i){let s=0;for(const n of Pm.SECTION_ORDER){if(n===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};WE.SECTION_ORDER=["chartToolbar","annotations"];var $E=WE,aX='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>',KE="text-input",UE="canvas-overlay",oX=class{constructor(e){this.ctx=e,this.cleanup=new pt,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(UE,KE),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>e.domManager.removeChild(UE,KE))}setKeyDownHandler(e){this.cleanup.register(st(this.element,"keydown",e))}show(e){this.element.innerHTML=aX;const t=this.element.firstElementChild;ma(t,{role:"textbox","data-preventdefault":!1}),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight=typeof e.styles?.fontWeight=="number"?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",Vy(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",i=>{i.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:n,getTextPosition:a,alignment:o,textAlign:r}=this.layout;e.style.setProperty("width",s?`${s}px`:"unset");const l=t.getBoundingClientRect(),c=n(l.height);let h=c.x;o==="center"?h-=(s??l.width)/2:o==="right"&&(h-=s??l.width);const d=a();let u=c.y;d==="center"?u-=l.height/2:d==="bottom"&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",`${i.width-h}px`),e.style.setProperty("text-align",o),t.style.setProperty("text-align",r)}getBBox(){const{left:e,top:t,width:i,height:s}=this.element.getBoundingClientRect();return new N.BBox(e,t,p0(i,2),s)}destroy(){this.cleanup.flush()}},gA=class extends X{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};g([m],gA.prototype,"enabled",2),g([m],gA.prototype,"axes",2);var fA=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(fA||{}),rX=Object.values(fA);function lX(e){for(const t of rX)if(t===e)return t}var Yf=class extends X{};g([m],Yf.prototype,"x",2),g([m],Yf.prototype,"y",2);var cX=class extends Vs(Zr(qE(X))){},mA=class extends Vs(Zr(Wo(bA(Rh(X))))){constructor(){super(...arguments),this.cornerRadius=2}};g([m],mA.prototype,"enabled",2),g([m],mA.prototype,"cornerRadius",2);var hX=class extends Wo(X){},dX=class extends Vs(Zr(Wo(X))){},Ph=class extends Rh(X){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};g([m],Ph.prototype,"label",2),g([m],Ph.prototype,"position",2),g([m],Ph.prototype,"alignment",2);var uX=class extends Rh(X){},Zf=class extends Rh(X){constructor(){super(...arguments),this.label=""}};g([m],Zf.prototype,"label",2),g([m],Zf.prototype,"position",2),g([m],Zf.prototype,"alignment",2);function Eh(e){class t extends gX(qE(e)){constructor(){super(...arguments),this.id=Yd()}}return t}function yA(e){class t extends e{constructor(){super(...arguments),this.start=new Yf,this.end=new Yf}}return g([m],t.prototype,"start",2),g([m],t.prototype,"end",2),t}function YE(e){class t extends e{}return g([m],t.prototype,"x",2),g([m],t.prototype,"y",2),t}function ZE(e){class t extends e{}return g([m],t.prototype,"value",2),t}function xA(e){class t extends e{constructor(){super(...arguments),this.background=new hX}}return g([m],t.prototype,"background",2),t}function cc(e){class t extends e{constructor(){super(...arguments),this.handle=new dX}}return g([m],t.prototype,"handle",2),t}function XE(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new mA}}return g([m],t.prototype,"axisLabel",2),t}function bA(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return g([m],t.prototype,"padding",2),g([m],t.prototype,"textAlign",2),g([m],t.prototype,"formatter",2),t}function pX(e){class t extends e{}return t}function vA(e){class t extends e{}return g([m],t.prototype,"extendStart",2),g([m],t.prototype,"extendEnd",2),t}function gX(e){class t extends e{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return g([m],t.prototype,"locked",2),g([m],t.prototype,"readOnly",2),t}function SA(e){class t extends e{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return t}function qE(e){class t extends e{}return g([m],t.prototype,"visible",2),t}function Wo(e){class t extends e{}return g([m],t.prototype,"fill",2),g([m],t.prototype,"fillOpacity",2),t}function Vs(e){class t extends e{}return g([m],t.prototype,"stroke",2),g([m],t.prototype,"strokeOpacity",2),g([m],t.prototype,"strokeWidth",2),t}function Zr(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return g([m],t.prototype,"lineDash",2),g([m],t.prototype,"lineDashOffset",2),g([m],t.prototype,"lineStyle",2),t}function Rh(e){class t extends e{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return g([m],t.prototype,"fontStyle",2),g([m],t.prototype,"fontWeight",2),g([m],t.prototype,"fontSize",2),g([m],t.prototype,"fontFamily",2),g([m],t.prototype,"color",2),t}function QE(e){return gt(e)||Bt(e)||Cs(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Pi(e){return QE(e)?.value}function on(e,t){if(e.start==null||e.end==null)return;const i=ii(e.start,t),s=ii(e.end,t);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function ii(e,t){const i=Xr(e.x,t.xAxis),s=Xr(e.y,t.yAxis);return{x:i,y:s}}function Xr(e,t){if(e==null)return 0;const{value:i,groupPercentage:s}=QE(e),{scale:n,snapToGroup:a}=t,o=n.bandwidth===0?n.step??0:n.bandwidth??0,r=a?o/2:o*s;return n.convert(i)+r}function rn(e,t){const i=ov(e.x,t.xAxis),s=ov(e.y,t.yAxis);return{x:i,y:s}}function ov(e,t){const{scale:i}=t;if(t.continuous&&i.step==null)return t.scaleInvert(e);const s=t.scaleInvertNearest(e),n=i.bandwidth===0?i.step:i.bandwidth??0,a=i.convert(s),o=a+n,r=a===o?0:(e-a)/(o-a);return{value:s,groupPercentage:r}}var MA=class extends Eh(yA(cc(X))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},JE=class extends SA(bA(Rh(MA))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return ii(this.end,e)}getTextPosition(){return this.position}};g([m],JE.prototype,"text",2);var fX={top:6,right:12,bottom:9,left:12},ao=class extends Wo(Vs(JE)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return ge(e)&&e.type==="callout"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Oe.fromString(this.color??"#888888");return new Oe(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...fX}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding(),n=s.left??0,a=s.bottom??0;return{x:i.x+n,y:i.y-a}}};g([m],ao.prototype,"type",2);var rv=class extends Eh(YE(cc(bA(Rh(X))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return ii(this,e)}getTextPosition(){return this.position}};g([m],rv.prototype,"text",2);var lv={top:8,right:14,bottom:8,left:14},$o=class extends Wo(Vs(rv)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return ge(e)&&e.type==="comment"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Oe.fromString(this.color??"#888888");return new Oe(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,lv.top),bottom:Math.max(t*.4,lv.bottom),left:Math.max(t*.8,lv.left),right:Math.max(t*.8,lv.right)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};g([m],$o.prototype,"type",2);function Xf(e,t){return e?"dashed":t??"solid"}function eR(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function dp(e,t,i,s){const n=Xf(e,i);return t??e??eR(s??1,n)}function up(e,t,i){const s=Xf(t,i);return e??s==="dotted"?"round":void 0}function mX(e,t){const[i,s]=H.from(e),n=t.height,a=H.gradient(s,i,n),o=H.intercept(s,a,n),r=[{x:i.x,y:n??0},{x:i.x,y:n==null?t.height:n-t.height}];if(a===1/0)return r;let l=[H.intersectAtY(a,o,0,n),H.intersectAtY(a,o,t.height,n),H.intersectAtX(a,o,0,n),H.intersectAtX(a,o,t.width,n)];return l=l.filter(c=>c.x>=t.x&&c.x<=t.width&&c.y>=t.y&&c.y<=t.height).sort((c,h)=>c.x===h.x?0:c.x<h.x?-1:1),l.length!==2?r:l}var yX=class extends Vs(X){},DA=class extends Rh(Wo(Vs(X))){constructor(){super(...arguments),this.divider=new yX}};g([m],DA.prototype,"divider",2);var kA=class extends Wo(Vs(cc(X))){constructor(){super(...arguments),this.statistics=new DA}};g([m],kA.prototype,"statistics",2);var pp=class extends SA(xA(Vs(Zr(MA)))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new DA,this.getVolume=()=>{},this.text=new Ph}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return dp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return up(this.lineCap,this.lineDash,this.lineStyle)}};g([m],pp.prototype,"statistics",2),g([m],pp.prototype,"text",2);function IA(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function AA(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var ka=class extends IA(pp){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return ge(e)&&e.type==="date-range"}};g([m],ka.prototype,"type",2),g([m],ka.prototype,"extendAbove",2),g([m],ka.prototype,"extendBelow",2);var Ia=class extends AA(pp){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return ge(e)&&e.type==="price-range"}};g([m],Ia.prototype,"type",2),g([m],Ia.prototype,"extendLeft",2),g([m],Ia.prototype,"extendRight",2);var qr=class extends IA(AA(pp)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return ge(e)&&e.type==="date-price-range"}};g([m],qr.prototype,"type",2);var Qn=class extends IA(AA(pp)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new kA,this.down=new kA,this.direction="both"}static is(e){return ge(e)&&e.type==="quick-date-price-range"}};g([m],Qn.prototype,"type",2),g([m],Qn.prototype,"up",2),g([m],Qn.prototype,"down",2);var{BBox:xX}=N,cv=1.38;function hv(e,t,i){return i?Io(t,{maxWidth:i,font:e,textWrap:"always",avoidOrphans:!1}):t}function bX(e,t){const{lineMetrics:i,width:s}=et(e).measureLines(t),n=i.length*Rn(e.fontSize,cv);return{width:s,height:n}}function CA(e,t,i,s){let n=s?.width??0,a=s?.height??0;if(!s){const o=e.width==null?t:hv(e,t,e.width);({width:n,height:a}=bX(e,o))}return new xX(i.x,i.y,n,a)}function tR(e,t,i,s,{x:n,y:a},o){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=s,p=Rn(c,cv);o??(o=s.position=="center"?"middle":s.position);const f=i?s.getPlaceholderColor():s.color;e.setProperties({x:n,y:a,visible:r,text:t,fill:f,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:o})}var vX=10,SX=11,iR=20,MX=22,DX=10,sR=iR+DX,nR=34,kX=class extends Wo(Vs(X)){},In=class extends Wo(Vs(rv)){constructor(){super(...arguments),this.type="note",this.background=new kX,this.position="bottom",this.alignment="center",this.width=200}static is(e){return ge(e)&&e.type==="note"}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??vX;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,n=super.getTextInputCoords(e,t),a=this.getPadding().top,o=CA(this,s,n);o.x=ae(i/2,o.x,e.seriesRect.width-i/2);const r=o.y-sR-a*2,l=o.y+SX+a*2,c=Math.max(o.height,t);return r-c-nR<0?(o.y=l,this.position="top"):(o.y=r+a,this.position="bottom"),{x:o.x,y:o.y}}isHoverable(){return!0}};g([m],In.prototype,"type",2),g([m],In.prototype,"background",2);var IX=class extends Eh(YE(cc(X))){getDefaultColor(e){}getDefaultOpacity(e){}},wA=class D_ extends Wo(IX){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof D_}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}},Bs=class extends Eh(ZE(cc(XE(Vs(Zr(X)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Ph}static is(e){return ge(e)&&e.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return dp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return up(this.lineCap,this.lineDash,this.lineStyle)}};g([m],Bs.prototype,"type",2),g([m],Bs.prototype,"text",2);var Ko=class extends Eh(ZE(cc(XE(Vs(Zr(X)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Ph}static is(e){return ge(e)&&e.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return dp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return up(this.lineCap,this.lineDash,this.lineStyle)}};g([m],Ko.prototype,"type",2),g([m],Ko.prototype,"text",2);var Aa=class extends Eh(xA(yA(cc(vA(Vs(Zr(X))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Zf,this.snapToAngle=45}static is(e){return ge(e)&&e.type==="disjoint-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):K.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return dp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return up(this.lineCap,this.lineDash,this.lineStyle)}};g([m],Aa.prototype,"type",2),g([m],Aa.prototype,"startHeight",2),g([m],Aa.prototype,"endHeight",2),g([m],Aa.prototype,"text",2);var dv=class extends SA(pX(vA(Vs(Zr(MA))))){constructor(){super(...arguments),this.text=new Ph}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return dp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return up(this.lineCap,this.lineDash,this.lineStyle)}};g([m],dv.prototype,"text",2);var Qr=class extends dv{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return ge(e)&&e.type==="arrow"}};g([m],Qr.prototype,"type",2);var Jr=class extends dv{constructor(){super(...arguments),this.type="line"}static is(e){return ge(e)&&e.type==="line"}};g([m],Jr.prototype,"type",2);var el=class extends dv{constructor(){super(...arguments),this.label=new uX,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};g([m],el.prototype,"label",2),g([m],el.prototype,"reverse",2),g([m],el.prototype,"showFill",2),g([m],el.prototype,"isMultiColor",2),g([m],el.prototype,"strokes",2),g([m],el.prototype,"rangeStroke",2),g([m],el.prototype,"bands",2);var Uo=class extends el{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new Yf}static is(e){return ge(e)&&e.type==="fibonacci-retracement-trend-based"}};g([m],Uo.prototype,"type",2),g([m],Uo.prototype,"endRetracement",2);var tl=class extends el{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return ge(e)&&e.type==="fibonacci-retracement"}};g([m],tl.prototype,"type",2);var Ca=class extends Eh(xA(yA(cc(vA(Vs(Zr(X))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new cX,this.text=new Zf,this.snapToAngle=45}static is(e){return ge(e)&&e.type==="parallel-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.height,e.end.y-=this.height):K.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return dp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return up(this.lineCap,this.lineDash,this.lineStyle)}};g([m],Ca.prototype,"type",2),g([m],Ca.prototype,"height",2),g([m],Ca.prototype,"middle",2),g([m],Ca.prototype,"text",2);var il=class extends rv{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return ge(e)&&e.type==="text"}};g([m],il.prototype,"type",2);function hc(e){return Qn.is(e)}function uv(e){return Jr.is(e)||Bs.is(e)||Ko.is(e)||Qr.is(e)||aR(e)}function sl(e){return Aa.is(e)||Ca.is(e)}function aR(e){return tl.is(e)||Uo.is(e)}function Yo(e){return ao.is(e)||$o.is(e)||In.is(e)||il.is(e)}function qf(e){return ka.is(e)||Ia.is(e)||qr.is(e)||Qn.is(e)}function LA(e){return Yo(e)&&!In.is(e)}function dc(e){return uv(e)||sl(e)||qf(e)&&!Qn.is(e)}function AX(e){return uv(e)||sl(e)||qf(e)||ao.is(e)||In.is(e)}function CX(e){return In.is(e)}function wX(e){return sl(e)||qf(e)||ao.is(e)||$o.is(e)||wA.is(e)}function LX(e){return Yo(e)&&!In.is(e)}function gp(e){return(uv(e)||sl(e)||qf(e))&&!hc(e)&&ge(e.text)}function NX(e,t){"fontSize"in e&&(e.fontSize=t),gp(e)&&(e.text.fontSize=t)}function oR(e,t){const i=t?.strokeWidth??e.strokeWidth??1,s=t?.type??e.lineStyle,n=s??Xf(e.lineDash,s),a=eR(i,n);e.strokeWidth=i,e.computedLineDash=a,e.lineStyle=n,e.lineCap=n==="dotted"?"round":void 0}function pv(e,t,i,s,n,a){switch(t){case"fill-color":{"fill"in e&&(e.fill=s),"fillOpacity"in e&&(e.fillOpacity=n),"background"in e&&(e.background.fill=s,e.background.fillOpacity=n);break}case"line-color":{"axisLabel"in e&&(e.axisLabel.fill=s,e.axisLabel.fillOpacity=n,e.axisLabel.stroke=s,e.axisLabel.strokeOpacity=n),"fill"in e&&"fillOpacity"in e&&CX(e)?(e.fill=s,e.fillOpacity=n):("strokeOpacity"in e&&(e.strokeOpacity=n),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=a,e.rangeStroke=s):"stroke"in e&&(e.stroke=s));break}case"text-color":{"color"in e&&(e.color=i),gp(e)&&(e.text.color=s);break}}}var TX=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(fA).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:Te(this.colors),fontSizes:Te(this.fontSizes),lineStyles:Te(this.lineStyles),lineTextAlignments:Te(this.lineTextAlignments),lineTextPositions:Te(this.lineTextPositions),fibonacciOptions:Te(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=Te(i.colors),this.fontSizes=Te(i.fontSizes),this.lineStyles=Te(i.lineStyles),this.lineTextAlignments=Te(i.lineTextAlignments),this.lineTextPositions=Te(i.lineTextPositions),this.fibonacciOptions=Te(i.fibonacciOptions)}setDefaultColor(e,t,i,s,n,a){this.colors.get(e)?.set(t,[i,s,n,a])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if(e!="fibonacci-retracement"&&e!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(e);s[t]=i,this.fibonacciOptions.set(e,s)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[s,[n,a,o,r]=[]]of i)n&&a&&o!=null&&r!=null&&pv(e,s,n,a,o,r);for(const[t,i]of this.fontSizes)e.type!==t||i==null||NX(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||oR(e,i);for(const[t,i]of this.lineTextPositions)e.type!==t||i==null||(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type!==t||i==null||(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)if(!(e.type!==t||i==null))for(const s of Object.keys(i)){const n=i[s];n!=null&&e.set({[s]:n})}}},OX='<div class="ag-charts-color-picker__palette" role="slider" tabindex="0"></div><div class="ag-charts-color-picker__color-row" role="presentation"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button" role="switch"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field" role="presentation"><span class="ag-charts-color-picker__color-label" aria-hidden="true"></span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',rR=e=>{try{const t=Oe.fromString(e),[i,s,n]=t.toHSB();return[i,s,n,t.a]}catch{return}},lR=class extends N.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),s=this.showWithChildren([t],{initialFocus:i,...e});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(e){const{localeManager:t}=this.ctx;let i=e.isMultiColor??!1,[s,n,a,o]=rR(e.color??"#f00")??[0,1,.5,1];o=e.opacity??o;const r=ye("div","ag-charts-color-picker__content");r.innerHTML=OX,r.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=r.querySelector(".ag-charts-color-picker__palette"),c=r.querySelector(".ag-charts-color-picker__hue-input"),h=r.querySelector(".ag-charts-color-picker__multi-color-button"),d=r.querySelector(".ag-charts-color-picker__alpha-input"),u=r.querySelector(".ag-charts-color-picker__color-input"),p=r.querySelector(".ag-charts-color-picker__color-label"),f=S=>{const M={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[S];l.ariaValueText=t.t(M,{s:n,v:a})};this.i18nUpdater=()=>{l.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),l.ariaLabel=t.t("ariaLabelColorPickerPalette"),c.ariaLabel=t.t("ariaLabelColorPickerHue"),h.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),d.ariaLabel=t.t("ariaLabelColorPickerAlpha"),u.ariaLabel=t.t("ariaLabelColor"),f("s")},this.i18nUpdater(),h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const y=(S=!0)=>{const D=Oe.fromHSB(s,n,a,o).toHexString();if(r.style.setProperty("--h",`${s}`),r.style.setProperty("--s",`${n}`),r.style.setProperty("--v",`${a}`),r.style.setProperty("--a",`${o}`),r.style.setProperty("--color",D.slice(0,7)),r.style.setProperty("--color-a",D),c.value=`${s}`,d.value=`${o}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",o===1),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),p.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==u&&(h.ariaChecked=i.toString(),u.value=i?t.t("ariaLabelColorPickerMultiColor"):D.toUpperCase()),S||e.color==null){const I=Oe.fromHSB(s,n,a,1).toHexString();e.onChange?.(D,I,o,i)}S&&(this.hasChanged=!0)};y(!1);const b=S=>S.preventDefault(),x=S=>S.stopPropagation(),v=S=>{S.preventDefault();const M=S.currentTarget;M.focus();const D=M.getBoundingClientRect(),I=({clientX:C,clientY:A})=>{i=!1,n=Math.min(Math.max((C-D.left)/D.width,0),1),a=1-Math.min(Math.max((A-D.top)/D.height,0),1),y(),f("s")};I(S);const k=st(Re(),"pointermove",I);Re().addEventListener("pointerup",k,{once:!0})};return r.addEventListener("mousedown",x),r.addEventListener("touchstart",x),r.addEventListener("touchmove",x),r.addEventListener("keydown",S=>{switch(S.stopPropagation(),S.key){case"Enter":case"Escape":this.hide();break;default:return}S.preventDefault()}),l.addEventListener("pointerdown",v),l.addEventListener("touchstart",b,{passive:!1}),l.addEventListener("touchmove",b,{passive:!1}),l.addEventListener("keydown",S=>{if(S.key==="ArrowLeft")n=ae(0,n-.01,1),f("s");else if(S.key==="ArrowRight")n=ae(0,n+.01,1),f("s");else if(S.key==="ArrowUp")a=ae(0,a+.01,1),f("v");else if(S.key==="ArrowDown")a=ae(0,a-.01,1),f("v");else return;S.preventDefault(),y()}),l.addEventListener("focus",()=>{f("s")}),h.addEventListener("click",()=>{i=!i,y()}),c.addEventListener("input",S=>{i=!1,s=S.currentTarget.valueAsNumber??0,y()}),d.addEventListener("input",S=>{i=!1,o=S.currentTarget.valueAsNumber??0,y()}),u.addEventListener("input",S=>{i=!1;const M=rR(S.currentTarget.value);M!=null&&([s,n,a,o]=M,y())}),u.addEventListener("blur",()=>y()),u.addEventListener("keydown",S=>{S.key==="Enter"&&(S.currentTarget.blur(),y())}),{element:r,initialFocus:l}}},nl=class extends X{};g([m],nl.prototype,"icon",2),g([m],nl.prototype,"label",2),g([m],nl.prototype,"ariaLabel",2),g([m],nl.prototype,"tooltip",2);function cR(e){return!(e instanceof N.LogScale)&&!(e instanceof N.BandScale)}var PX=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:cR},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:cR}],EX=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],RX=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],zX=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],VX=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],BX=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],hR=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],Qf=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],dR=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{FloatingToolbar:FX,Menu:NA,ToolbarButtonWidget:_X}=N,fp=class extends nl{constructor(){super(...arguments),this.checkedOverrides=new nl}};g([m],fp.prototype,"value",2),g([m],fp.prototype,"checkedOverrides",2),g([m],fp.prototype,"color",2),g([m],fp.prototype,"strokeWidth",2),g([m],fp.prototype,"isMultiColor",2);var HX=class extends _X{update(e){super.update(e),e.value==="line-stroke-width"&&this.updateLineStrokeWidth(e),(e.value==="fill-color"||e.value==="line-color"||e.value==="text-color")&&this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},GX=class extends FX{createButtonWidget(){return new HX(this.localeManager)}},TA=class extends X{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new Bi(fp),this.cleanup=new pt,this.events=new Pn,this.visibleButtons=[],this.toolbar=new GX(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new lR(this.ctx),this.textSizeMenu=new NA(this.ctx,"text-size"),this.lineStyleTypeMenu=new NA(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new NA(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":dc(e),"line-stroke-width":dc(e),"line-color":AX(e),"text-color":LX(e),"fill-color":wX(e),"text-size":LA(e),settings:gp(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>t[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(t!=null&&i!=null){const{r:n,g:a,b:o}=Oe.fromString(t);t=Oe.fromArray([n,a,o,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:e==null?void 0:String(e)})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}onButtonPress({event:e,button:t,buttonWidget:i}){const s=this.getActiveDatum();if(s)switch(this.hideOverlays(),t.value){case"line-style-type":{const n=dc(s)?Xf(s.lineDash,s.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:Qf,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:n,onPress:a=>this.onLineStyleTypeMenuPress(a,s),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const n=dc(s)?s.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:hR,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:n,onPress:a=>this.onLineStrokeWidthMenuPress(a,s),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:s?.getDefaultColor(t.value),opacity:s?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in s,isMultiColor:"isMultiColor"in s&&s?.isMultiColor,onChange:s==null?void 0:this.onColorPickerChange.bind(this,t.value,s),onChangeHide:(n=>{this.events.emit("saved-color",{type:s.type,colorPickerType:t.value,color:s.getDefaultColor(n)})}).bind(this,t.value)});break}case"text-size":{const n=Yo(s)?s.fontSize:void 0;this.textSizeMenu.show(i,{items:dR,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:n,onPress:a=>this.onTextSizeMenuPress(a,s),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{s.locked=!s.locked,this.refreshButtons(s),this.events.emit("pressed-lock",{locked:s.locked});break}case"settings":{this.toolbar.toggleActiveButtonByIndex(t.index),this.events.emit("pressed-settings",e);break}}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[a,o]of t.entries()){const r=this.visibleButtons.at(a);if(!r)continue;const l={x:o.x,y:o.y+o.height-1},c={y:o.y};switch(r.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(e,t,i,s,n,a){this.events.emit("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:a}),this.updateColorPickerColor(e,i,n,a)}onTextSizeMenuPress(e,t){if(!LA(t))return;const i=e.value;this.events.emit("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!dc(t))return;const i=e.value;this.events.emit("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!dc(t))return;const i=e.value;this.events.emit("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,t),this.updateButtonByIndex(i,t?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!t));LA(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!dc(e))return;const t=e.strokeWidth??1,i=Xf(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(Qf.find(s=>s.value===i)??Qf[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(s=>s.value===e);i!==-1&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};g([m],TA.prototype,"enabled",2),g([m],TA.prototype,"buttons",2);var xi=class extends de{constructor(e){const t=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:i,context:s})=>{this.hasMoved=H.lengthSquared(H.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),e.update()},dragEnd:{target:de.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=be.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};g([Je()],xi.prototype,"snapping",2),g([Je()],xi.prototype,"datum",2),g([Je()],xi.prototype,"node",2);var uc=class extends wA{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return ge(e)&&e.type==="arrow-down"}};g([m],uc.prototype,"type",2);var mp=class extends N.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}},uR=class k_ extends N.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-i.x,y:t.y-i.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=k_.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,i){return this.handle.containsPoint(t,i)}};uR.INACTIVE_STROKE_WIDTH=2;var pc=uR,OA=class I_ extends pc{constructor(){super(),this.handle=new mp({shape:"circle"}),this.glow=new mp({shape:"circle"}),this.append([this.handle]),this.handle.size=I_.HANDLE_SIZE,this.handle.strokeWidth=pc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:pc.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};OA.HANDLE_SIZE=7,OA.GLOW_SIZE=9;var gc=OA,gv=class On extends pc{constructor(){super(),this.handle=new N.Rect,this.glow=new N.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=On.CORNER_RADIUS,this.handle.width=On.HANDLE_SIZE,this.handle.height=On.HANDLE_SIZE,this.handle.strokeWidth=pc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=On.CORNER_RADIUS,this.glow.width=On.GLOW_SIZE,this.glow.height=On.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const i=(On.HANDLE_SIZE-gc.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=gc.HANDLE_SIZE,this.handle.height=gc.HANDLE_SIZE,this.glow.width=gc.GLOW_SIZE,this.glow.height=gc.GLOW_SIZE}else this.handle.cornerRadius=On.CORNER_RADIUS,this.handle.width=On.HANDLE_SIZE,this.handle.height=On.HANDLE_SIZE,this.glow.width=On.GLOW_SIZE,this.glow.height=On.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(On.HANDLE_SIZE-gc.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};gv.HANDLE_SIZE=12,gv.GLOW_SIZE=16,gv.CORNER_RADIUS=4;var yp=gv,PA=class Em extends pc{constructor(){super(),this.handle=new mp({shape:"circle"}),this.glow=new mp({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=Em.HANDLE_SIZE,this.handle.strokeWidth=pc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=Em.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=gc.HANDLE_SIZE,this.glow.size=gc.GLOW_SIZE):(this.handle.size=Em.HANDLE_SIZE,this.glow.size=Em.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(t){this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked&&(delete t.fill,delete t.strokeWidth),this.handle.setProperties(t),this.glow.setProperties({...t,strokeWidth:0,fill:t.stroke})}getCursor(){return"pointer"}};PA.HANDLE_SIZE=11,PA.GLOW_SIZE=17;var si=PA,Ji=class extends N.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=12}static isCheck(e,t){return ge(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e,t,i){i!==!0&&this.toggleHandles(e||t)}computeBBoxWithoutHandles(){return N.Transformable.toCanvas(this,N.Group.computeChildrenBBox(this.excludeChildren({instance:pc})))}updateNode(e,t,i){if(!i&&t){t.remove();return}return i&&t==null&&(t=new e,this.appendChild(t)),t}},{ContinuousScale:jX}=N;function Jf(e,t,i=!1,s,n=1){if(!i)return rn(e,t);const a=s?ii(s,t):H.origin();return rn(fv(e,a,n),t)}function fv(e,t,i){const s=H.sub(e,t),n=lt(i),a=Math.round(H.angle(s)/n)*n;return H.rotate(s,a,t)}function mv(e,t){const i={};for(const[s,n]of rt(e))i[s]=ii(n,t);return i}function al(e,t,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:n,yAxis:a}=i,o=Object.keys(e),r=[],l=[],c=new Set(s.translateVectors??o),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),u=H.multiply(t,H.from(1,-1));for(const x of o)d.has(x)&&(e[x]=H.add(e[x],h.has(x)?u:t),s.snap&&(e[x]=fv(e[x],s.snap.vectors[x],s.snap.angle))),r.push(n.getRangeOverflow(e[x].x)),l.push(a.getRangeOverflow(e[x].y));const p=(x,v)=>Math.abs(x)-Math.abs(v),f=(x,v,S)=>s.overflowContinuous===0||!jX.is(x)?S.toSorted(p).at(-1)??0:o.length===d.size?S.toSorted(p).at(-s.overflowContinuous-1)??0:S.filter(D=>D!==0).length<=s.overflowContinuous?0:S.filter((D,I)=>D!==0&&Math.abs(D)<=Math.abs(v)&&d.has(o[I])).toSorted(p).at(-1)??0,y=H.from(f(n.scale,t.x,r),f(a.scale,t.y,l));if(!H.equal(y,H.origin()))for(const x of o)d.has(x)&&(e[x]=H.round(H.sub(e[x],y),4));const b={};for(const x of o)b[x]=rn(e[x],i);return b}var pR=class extends Ji{constructor(){super(...arguments),this.handle=new si,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=ii(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...mv({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(!e.isWriteable()||!s)return;const{point:n}=al({point:s.handle},H.sub(t,s.offset),i);e.x=n.x,e.y=n.y}translate(e,t,i){if(!e.isWriteable())return;const{point:s}=al({point:ii(e,i)},t,i);e.x=s.x,e.y=s.y}toggleHandles(e){this.handle.visible=!!e,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const s=ii(e,i),n=rn({x:s.x-30,y:s.y-30},i);return t.x=n.x,t.y=n.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:s,y:n}=this.getHandleCoords(e,t,i),a=this.getHandleStyles(e);this.handle.update({...a,x:s,y:n}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const s=this.getHandleCoords(e,t);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},gR=class extends pR{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=ii(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},fR=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function mR(e){N.drawMarkerUnitPolygon(e,fR)}mR.anchor={x:.5,y:0};var yv=class extends gR{constructor(){super(),this.type="arrow-up",this.shape=new mp({shape:mR}),this.append([this.shape])}static is(e){return Ji.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=si.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y-=i,s}},WX=fR.map(([e,t])=>[e,1-t]);function yR(e){N.drawMarkerUnitPolygon(e,WX)}yR.anchor={x:.5,y:1};var xv=class extends gR{constructor(){super(),this.type="arrow-down",this.shape=new mp({shape:yR}),this.append([this.shape])}static is(e){return Ji.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i);return s.y-=e.size,s}getHandleCoords(e,t){const i=si.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y+=i,s}},EA=class extends de{constructor(e){const t=({point:s})=>{const n=this.createDatum();n.set({x:s.x,y:s.y}),e.create(n)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:de.parent,reset:de.parent},"waiting-first-render":{render:{target:de.parent,action:i}}}),this.debug=be.create(!0,"annotations")}};g([Je()],EA.prototype,"node",2);var $X=class extends EA{createDatum(){return new uc}},xR={type:"arrow-down",datum:uc,scene:xv,isDatum:uc.is,translate:(e,t,i,s)=>{uc.is(t)&&xv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(uc.is(t)&&uc.is(i)&&xv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{uc.is(t)&&xv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new $X({...e,create:t("arrow-down")}),dragState:e=>new xi(e)},fc=class extends wA{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return ge(e)&&e.type==="arrow-up"}};g([m],fc.prototype,"type",2);var KX=class extends EA{createDatum(){return new fc}},bR={type:"arrow-up",datum:fc,scene:yv,isDatum:fc.is,translate:(e,t,i,s)=>{fc.is(t)&&yv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(fc.is(t)&&fc.is(i)&&yv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{fc.is(t)&&yv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new KX({...e,create:t("arrow-up")}),dragState:e=>new xi(e)},vR=class extends Ji{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:s},n,a){const o={x1:e,y1:t,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return o;const[r,l]=mX(o,a.yAxis.bounds),c=o.x2<o.x1,h=o.y1>=o.y2,d=o.x2===o.x1;return n.extendEnd&&(d?o.y2=h?l.y:r.y:(o.x2=c?r.x:l.x,o.y2=c?r.y:l.y)),n.extendStart&&(d?o.y1=h?r.y:l.y:(o.x1=c?l.x:r.x,o.y1=c?l.y:r.y)),o}dragStart(e,t,i){this.dragState={offset:t,...mv({start:e.start,end:e.end},i)}}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,H.sub(t,s.offset),i)}translate(e,t,i){e.isWriteable()&&this.translatePoints(e,ii(e.start,i),ii(e.end,i),t,i)}copy(e,t,i){const s=on(e,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),a={x:-n.width/2,y:-n.height/2};return this.translatePoints(t,ve.start(s),ve.end(s),a,i),t}translatePoints(e,t,i,s,n){const a=this.getTranslatePointsVectors(t,i),o=al(a,s,n,{overflowContinuous:this.overflowContinuous});e.start.x=o.start.x,e.end.x=o.end.x,e.start.y=o.start.y,e.end.y=o.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},RA=class extends vR{constructor(){super(...arguments),this.start=new si,this.end=new si,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=on(e,t);i!=null&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of rt(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=n==="start"?"end":"start",r=s?{vectors:{[n]:ii(e[o],i)},angle:e.snapToAngle}:void 0,{[n]:l}=al({[n]:a[n]},H.sub(t,a.offset),i,{overflowContinuous:0,snap:r});e[n].x=l.x,e[n].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):!1}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,s){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return i==="start"?ve.start(t):ve.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},UX=class extends RA{constructor(){super(...arguments),this.label=new N.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=on(e,t);if(i==null)return;const s=this.getTextBBox(e,i);this.updateLabel(e,s,i),this.updateHandles(e,i,s),this.updateShape(e,s,i),this.updateAnchor(e,i,t,s)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return CA(e,i,ve.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:s,isPlaceholder:n}=e.getText();tR(this.label,s,n,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return ve.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:YX,Path:ZX}=N,bv=class extends UX{constructor(){super(),this.type="callout",this.shape=new ZX,this.append([this.shape,this.label,this.start,this.end])}static is(e){return Ji.isCheck(e,"callout")}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle==="end"?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const s=e.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:n.x+s.left,y:n.y-s.bottom}}getHandleStyles(e,t){return t==="start"?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,s){const{bodyBounds:n}=this.getDimensions(e,s,t)??{},a=n??s;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:s}=this;s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeWidth=e.strokeWidth??1,s.strokeOpacity=e.strokeOpacity??1;const{tailPoint:n,bodyBounds:a}=this.getDimensions(e,t,i)??{};!n||!a||this.updatePath(n,a)}updatePath(e,t){const{x:i,y:s}=e,{x:n,y:a,width:o,height:r}=t,l=a-r,c=n+o,h=this.calculateCalloutPlacement({x:i,y:s},t),d=8,u=[{coordinates:{x0:n,x1:n+d,y0:l+d,y1:l,cx:h==="topLeft"?i:n+d,cy:h==="topLeft"?s:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:n+d,x1:c-d,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?s:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:a-d,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:a-d,y1:a,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?s:a-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:n+d,y0:a,y1:a,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:n+d,x1:n,y0:a,y1:a-d,cx:h==="bottomLeft"?i:n+d,cy:h==="bottomLeft"?s:a-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:a-d,y1:l+d,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(n,l+d);for(const{coordinates:f,type:y}of u)this.drawPath(p,f,d,y);p.closePath()}drawPath(e,{x0:t,y0:i,x1:s,y1:n,cx:a,cy:o},r,l){switch(l){case"calloutCorner":{e.lineTo(a,o),e.lineTo(s,n);break}case"corner":{YX(e,{x0:t,x1:s,y0:i,y1:n,cx:a,cy:o},r,!1);break}case"calloutSide":{if(t===s){const h=i>n?-1:1,d=Math.min(i,n)+Math.abs(i-n)/2;e.lineTo(t,d-6*h),e.lineTo(a,o),e.lineTo(t,d+6*h),e.lineTo(s,n)}else{const h=t>s?-1:1,d=Math.min(t,s)+Math.abs(s-t)/2;e.lineTo(d-6*h,i),e.lineTo(a,o),e.lineTo(d+6*h,i),e.lineTo(s,n)}break}case"side":default:{e.lineTo(s,n);break}}}calculateCalloutPlacement(e,t){const i=t.x+t.width,s=t.y-t.height;let n,a;return e.x>i?n="right":e.x<t.x&&(n="left"),e.y>t.y?a="bottom":e.y<s&&(a="top"),n&&a?`${a}${n[0].toUpperCase()}${n.substring(1)}`:a??n}getDimensions(e,t,i){const{fontSize:s}=e,n=e.getPadding(),a=n.left+n.right,o=n.top+n.bottom,r=t.width+a,l=Math.max(t.height+o,s+o);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:r,height:l}}}containsPoint(e,t){const{start:i,end:s,shape:n}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const a=s.containsPoint(e,t)||n.containsPoint(e,t);return a&&(this.activeHandle="end"),a}};function zA({key:e}){return e==="Escape"}function VA({key:e,shiftKey:t}){return!t&&e==="Enter"}var BA=class extends de{constructor(e){const t=({point:u})=>{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),e.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},a=u=>{this.node?.setTextInputBBox(u),e.update()},o=({point:u})=>{const{datum:p,node:f}=this;p?.set({end:u}),f?.toggleActive(!0),f?.toggleHandles({end:!1}),e.update()},r=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:f,opacity:y,isMultiColor:b})=>{const{datum:x}=this;x&&(u==="text-color"&&e.updateTextInputColor(f),pv(x,u,p,f,y,b),e.update())},c=u=>{const{datum:p,node:f}=this;!p||!f||!Yo(p)||(p.fontSize=u,e.updateTextInputFontSize(u),e.update())},h=()=>{e.delete()},d=({textInputValue:u,bbox:p})=>{const{datum:f}=this;if(p!=null&&u!=null&&u.length>0){if(!Yo(f))return;const y=hv(f,u,p.width);f?.set({text:y}),e.update(),e.recordAction(`Create ${f?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:de.parent,reset:de.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:de.parent,action:h},cancel:{target:de.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:zA,target:de.parent,action:h},{guard:VA,target:de.parent,action:d}],click:{target:de.parent,action:d},dragStart:{target:de.parent,action:d},resize:{target:de.parent,action:d},onExit:n,cancel:{target:de.parent,action:h}}}),this.debug=be.create(!0,"annotations")}};g([Je()],BA.prototype,"datum",2),g([Je()],BA.prototype,"node",2);var XX=class extends BA{createDatum(){return new ao}},SR={type:"callout",datum:ao,scene:bv,isDatum:ao.is,translate:(e,t,i,s)=>{if(ao.is(t)&&bv.is(e))return e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ao.is(t)&&ao.is(i)&&bv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ao.is(t)&&bv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new XX({...e,create:t("callout")}),dragState:e=>new xi(e)},FA=class extends pR{constructor(){super(...arguments),this.label=new N.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=ii(e,t),s=this.getTextBBox(e,i,t);this.updateLabel(e,s),this.updateHandle(e,i,s),this.updateShape(e,s),this.anchor=this.updateAnchor(e,s,t)}copy(e,t,i){const s=ii(e,i),n=this.getTextBBox(e,s,i),a=e.getPadding(),o=a.left+a.right,r=a.top+a.bottom,l=(n.width+o)/2,c=n.height+r,h=rn({x:s.x-l,y:s.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:s}=e.getText();return CA(e,s,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:s}=e.getText();tR(this.label,i,s,e,this.getLabelCoords(e,t),this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return e.position=="center"?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:_A}=N,vv=class extends FA{constructor(){super(),this.type="comment",this.shape=new N.Path,this.append([this.shape,this.label,this.handle])}static is(e){return Ji.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i),n=e.getPadding();return s.y-=n.bottom+n.top,s}updatePath(e,t){const i=e.getPadding(),{x:s,y:n}=t;let{width:a,height:o}=t;const{fontSize:r}=e,l=i.left+i.right,c=i.top+i.bottom;a=a+l,o=Math.max(o+c,r+c);const h=n-o,d=s+a,u=(Rn(r,cv)+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,h+u),_A(p,{x0:s,x1:s+u,y0:h+u,y1:h,cx:s+u,cy:h+u},u,!1),p.lineTo(d-u,h),_A(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,n-u),_A(p,{x0:d,x1:d-u,y0:n-u,y1:n,cx:d-u,cy:n-u},u,!1),p.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},em=class extends de{constructor(e){const t=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),e.create(d)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},a=h=>{this.node?.setTextInputBBox(h),e.update()},o=({colorPickerType:h,colorOpacity:d,color:u,opacity:p,isMultiColor:f})=>{this.datum&&(h==="text-color"&&e.updateTextInputColor(u),pv(this.datum,h,d,u,p,f),e.update())},r=h=>{const{datum:d,node:u}=this;!d||!u||!Yo(d)||(d.fontSize=h,e.updateTextInputFontSize(h),e.update())},l=()=>{e.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!Yo(u))return;const p=hv(u,h,d.width);u?.set({text:p}),e.update(),e.recordAction(`Create ${u?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:de.parent,reset:de.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:a,color:o,fontSize:r,textInput:[{guard:zA,target:de.parent,action:l},{guard:VA,target:de.parent,action:c}],click:{target:de.parent,action:c},dragStart:{target:de.parent,action:c},resize:{target:de.parent,action:c},onExit:n,cancel:{target:de.parent,action:l}}}),this.debug=be.create(!0,"annotations")}};g([Je()],em.prototype,"datum",2),g([Je()],em.prototype,"node",2);var qX=class extends em{createDatum(){return new $o}},MR={type:"comment",datum:$o,scene:vv,isDatum:$o.is,translate:(e,t,i,s)=>{$o.is(t)&&vv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if($o.is(t)&&$o.is(i)&&vv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{$o.is(t)&&vv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new qX({...e,create:t("comment")}),dragState:e=>new xi(e)},{calculateLabelTranslation:QX}=N,DR=class extends N.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new N.Text({zIndex:1}),this.rect=new N.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:s,fontSize:n,fontStyle:a,fontFamily:o,textAlign:r,color:l="white",formatter:c}=t,h=c?c({value:e}):i.formatScaleValue(e,"annotation-label");this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:a,fontFamily:o,textAlign:r,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:a,strokeOpacity:o}=e;t.fill=s,t.fillOpacity=n??1,t.stroke=a,t.strokeOpacity=o??1,t.cornerRadius=i??0}updatePosition({x:e,y:t,context:i,styles:{padding:s}}){const{label:n,rect:a}=this,o=n.getBBox()?.clone(),r=s??8,l=s??4,{xTranslation:c,yTranslation:h}=QX({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:o});o.grow(r,"horizontal"),o.grow(l,"vertical");const d=e+c,u=t+h;n.x=d,n.y=u,a.y=u-Math.round(o.height/2),a.x=d-Math.round(o.width/2),a.height=o.height,a.width=o.width}};DR.className="AxisLabel";var An=class extends N.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e){return super.setProperties(e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:s,x2:n,y2:a}=this;let o=t+e;o%2===0&&(o+=1);const r=H.from(i,s-Math.floor(o/2)),l=H.from(n,a),c=H.distance(r,l);this.collisionBBox=new N.BBox(r.x,r.y,c,o)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:n,x2:a,y2:o}=this;if(!i)return!1;const r=H.from(s,n),l=H.from(a,o),c=H.sub(H.from(e,t),r),h=H.sub(l,r),d=H.rotate(c,H.angle(c,h),r);return i.containsPoint(d.x,d.y)??!1}render(e){const{clipMask:t}=this,{ctx:i}=e;if(t.size===0){super.render(e);return}i.save();try{for(const s of this.clipMask.values()){const{x:n,y:a,radius:o}=s;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(n,a,o,o,0,Math.PI*2,0,!0),i.clip()}super.render(e)}finally{i.restore()}}setClipMask(e,t){const i=this.clipMask.get(e);Hn(i,t)!=null&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}},zh=class extends N.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}};function xp(e,t,i,s,n,a,o){if(!a||!n||!s){t.setClipMask(e);return}const{alignment:r,position:l}=s,c=IR(i,s.fontSize,o),{point:h,textBaseline:d}=AR(c,l,r);CR(n,a,s,h,c.angle,d);const{x:u,y:p,width:f,height:y}=n.getBBox(),b=H.length(H.from(f,y)),x={x:u+f/2,y:p+y/2,radius:b/2+H.length(c.offset)};return l==="center"?t.setClipMask(e,x):t.setClipMask(e),{clipMask:x,numbers:c}}function kR(e,t,i,s,n,a,o){if(!o||!a)return;const{alignment:r,position:l}=s,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let d=c;l==="bottom"?d=h:l==="inside"&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=IR(d,s.fontSize,n),{point:p,textBaseline:f}=AR(u,l==="inside"?"center":l,r,e);CR(a,o,s,p,u.angle,f)}function IR(e,t,i){let[s,n]=H.from(e);s.x>n.x&&([s,n]=[n,s]);const a=H.normalized(H.sub(n,s)),o=H.angle(a),r=H.multiply(a,si.HANDLE_SIZE/2+(t??14)/2),l=H.multiply(a,(i??2)/2+(t??14)/3);return{left:s,right:n,normal:a,angle:o,inset:r,offset:l}}function AR({left:e,right:t,normal:i,angle:s,inset:n,offset:a},o,r,l){let c;r==="right"?c=H.sub(t,n):r==="center"?c=H.add(e,H.multiply(i,H.distance(e,t)/2)):c=H.add(e,n);let h="bottom";return o==="bottom"?(c=H.rotate(a,s+Math.PI/2,c),h="top"):o==="center"&&!l?h="middle":c=H.rotate(a,s-Math.PI/2,c),{point:c,textBaseline:h}}function CR(e,t,i,s,n,a){e.setProperties({text:t,x:s.x,y:s.y,rotation:n,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var mc=class extends Ji{constructor(){super(),this.type="cross-line",this.line=new An,this.middle=new yp,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return Ji.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=Bs.is(e);const s=this.isHorizontal?t.yAxis:t.xAxis,n=this.convertCrossLine(e,s);if(n==null){this.visible=!1;return}this.visible=e.visible??!0,this.visible&&(this.updateLine(e,n),this.updateHandle(e,n),this.updateText(e,n),this.updateAxisLabel(e,s,n))}updateLine(e,t){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:o}=e,{x1:r,y1:l,x2:c,y2:h}=t;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:o,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:a,strokeOpacity:o}=e,r={fill:e.handle.fill,stroke:e.handle.stroke??n,strokeOpacity:e.handle.strokeOpacity??o,strokeWidth:e.handle.strokeWidth??a},l=H.sub(ve.center(t),H.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(zh,this.text,!!e.text.label),xp(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new DR;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:n}=this,{direction:a,position:o}=t;if(e.axisLabel.enabled){s.visible=this.visible;const r=o==="left"||o==="top"?ve.start(i):ve.end(i),l=a==="x"?r.x:r.y;if(!t.inRange(l)){s.visible=!1;return}const c=Pi(e.value);s.update({...H.add(r,H.required(n)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const s=Bs.is(e)?{x:t.x,y:Xr(e.value,i.yAxis)}:{x:Xr(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:s}}drag(e,t,i){const{activeHandle:s,dragState:n}=this;!e.isWriteable()||!n||(s&&this[s].toggleDragging(!0),this.translatePoint(e,n.middle,H.sub(t,n.offset),i))}translate(e,t,i){if(!e.isWriteable())return;const s=Bs.is(e)?H.from(0,Xr(e.value,i.yAxis)):H.from(Xr(e.value,i.xAxis),0);this.translatePoint(e,s,t,i)}translatePoint(e,t,i,s){const n=Bs.is(e);n?i.x=0:i.y=0;const{point:a}=al({point:t},i,s);e.value=n?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const s=Bs.is(e),n=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(e,n);if(!a)return;const o=s?-30:0,r=s?0:-30,l=rn({x:a.x1+r,y:a.y1+o},i);return t.set({value:s?l.y:l.x}),t}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):s.isPointInPath(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.line.isPointInPath(e,t))return"line";if(this.middle.containsPoint(e,t))return"handle"}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(e.value==null)return;let i=0,s=0,n,a;const{bounds:o}=t,r=Xr(e.value,t);return Bs.is(e)?(n=o.width,s=r,a=r):(i=r,n=r,a=o.height),{x1:i,y1:s,x2:n,y2:a}}},HA=class extends de{constructor(e,t){const i=({point:n})=>{const a=e==="horizontal",o=a?new Bs:new Ko;o.set({value:a?n.y:n.x}),t.create(o),t.recordAction(`Create ${a?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:de.parent,cancel:de.parent},"waiting-first-render":{render:{target:de.parent,action:s}}}),this.debug=be.create(!0,"annotations")}};g([Je()],HA.prototype,"node",2);var wR={type:"horizontal-line",datum:Bs,scene:mc,isDatum:Bs.is,translate:(e,t,i,s)=>{Bs.is(t)&&mc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Bs.is(t)&&Bs.is(i)&&mc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Bs.is(t)&&mc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new HA("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new xi(e)},LR={type:"vertical-line",datum:Ko,scene:mc,isDatum:Ko.is,translate:(e,t,i,s)=>{Ko.is(t)&&mc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ko.is(t)&&Ko.is(i)&&mc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ko.is(t)&&mc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new HA("vertical",{...e,create:t("vertical-line")}),dragState:e=>new xi(e)},NR=class{static updateBackground(e,t,i,s){const{background:n}=this,{seriesRect:a}=s;n.path.clear(!0);const o=ve.from(0,0,a.width,a.height),r=this.getBackgroundPoints(e,t,i,o);for(let c=0;c<r.length;c++){const h=r[c];c===0?n.path.moveTo(h.x,h.y):n.path.lineTo(h.x,h.y)}n.path.closePath(),n.checkPathDirty();const l=this.getBackgroundStyles?.(e)??e.background;n.fill=l.fill,n.fillOpacity=l.fillOpacity??1}},TR=class extends vR{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new An,this.bottomLine=new An,this.background=new N.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=NR.updateBackground.bind(this)}update(e,t){const{locked:i,visible:s}=e,n=on(e,t),a=on(e.bottom,t);if(n==null||a==null){this.visible=!1;return}else this.visible=s??!0;const o=this.extendLine(n,e,t),r=this.extendLine(a,e,t);this.updateLines(e,o,r,t,n,a),this.updateHandles(e,n,a),this.updateText(e,n,a),this.updateBackground(e,o,r,t),this.updateAnchor(n,a);for(const l of Object.values(this.handles))l.toggleLocked(i??!1)}toggleHandles(e){const{handles:t}=this;if(typeof e=="boolean"){for(const[i,s]of Object.entries(t))s.visible=e,s.toggleHovered(this.activeHandle===i);return}for(const[i,s]of Object.entries(e)){const n=t[i];n.visible=s??!0,n.toggleHovered(this.activeHandle===i)}}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;e!=null&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return this.activeHandle==null?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:s,bottomLine:n,text:a}=this;this.activeHandle=void 0;for(const[o,r]of Object.entries(i))if(r.containsPoint(e,t))return this.activeHandle=o,!0;return s.containsPoint(e,t)||n.containsPoint(e,t)||!!a?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[,i]of Object.entries(this.handles))if(i.containsPoint(e,t))return"handle"}updateAnchor(e,t){const{x:i,y:s}=N.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i,this.anchor.y=s}},Sv=class extends TR{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new si,topRight:new si,bottomLeft:new si,bottomRight:new yp},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Ji.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,s){const{activeHandle:n,handles:a}=this;if(n==null)return;const{offset:o}=a[n].drag(t);a[n].toggleDragging(!0),n==="bottomRight"&&(o.x=0);let r=[],l=[],c=s;switch(n){case"topLeft":r=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":r=["bottomLeft"],l=["topLeft"];break;case"topRight":r=["topRight"],l=["bottomRight"];break;case"bottomRight":r=["bottomLeft","bottomRight"],c=!1;break}const h=on(e,i),d=on(e.bottom,i);if(!h||!d)return;const u={topLeft:ve.start(h),topRight:ve.end(h),bottomLeft:ve.start(d),bottomRight:ve.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:e.snapToAngle},f=al(u,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,invertYVectors:l,snap:c?p:void 0});e.start.x=f.topLeft.x,e.start.y=f.topLeft.y,e.end.x=f.topRight.x,e.end.y=f.topRight.y,e.startHeight=f.topLeft.y-f.bottomLeft.y,e.endHeight=f.topRight.y-f.bottomRight.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,bottomRight:s,topLeft:n,topRight:a}=this.handles,o=i.getBBox().y-n.getBBox().y,r=s.getBBox().y-a.getBBox().y,l=H.add(e,H.from(0,o)),c=H.add(t,H.from(0,r));return{start:e,end:t,bottomStart:l,bottomEnd:c}}updateLines(e,t,i){const{topLine:s,bottomLine:n}=this,{lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=e,c={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l};s.setProperties({...t,...c}),n.setProperties({...i,...c})}updateHandles(e,t,i){const{handles:{topLeft:s,topRight:n,bottomLeft:a,bottomRight:o}}=this,r={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...r,...ve.start(t)}),n.update({...r,...ve.end(t)}),a.update({...r,...ve.start(i)}),o.update({...r,...H.sub(ve.end(i),H.from(o.handle.width/2,o.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(zh,this.text,!!e.text.label),kR(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const n=t.x1>t.x2,a=t.y1>t.y2,o=a?s.y2:s.y1,r=a?s.y1:s.y2,l=H.from(t);return e.extendEnd&&t.y2===r&&l.push(H.from(n?s.x1:s.x2,a?s.y1:s.y2)),e.extendEnd&&i.y2===o&&l.push(H.from(n?s.x1:s.x2,a?s.y2:s.y1)),l.push(...H.from(i).reverse()),e.extendStart&&i.y1===r&&l.push(H.from(n?s.x2:s.x1,a?s.y1:s.y2)),e.extendStart&&t.y1===o&&l.push(H.from(n?s.x2:s.x1,a?s.y2:s.y1)),l}},Mv=class extends de{constructor(e){const t=({point:l})=>{const c=new Aa;c.set({start:l,end:l,startHeight:0,endHeight:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:Jf(l,c,d,h.start,h.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,d=Pi(c?.end.y),u=Pi(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=(u-d)*2+f,b={x:c?.start.x,y:u-y},x={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(b,{overflowContinuous:!0})||!e.validatePoint(x,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:f}),e.update())},o=({point:l})=>{const{datum:c,node:h}=this,d=Pi(c?.end.y),u=Pi(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=(u-d)*2+f,b={x:c.start.x,y:u-f},x={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!e.validatePoint(b,{overflowContinuous:!0})||!e.validatePoint(x,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:f}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:de.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:de.parent,action:r},cancel:{target:de.parent,action:r}},height:{hover:a,click:{target:de.parent,action:o},drag:{target:de.parent,action:o},reset:{target:de.parent,action:r},cancel:{target:de.parent,action:r}}}),this.debug=be.create(!0,"annotations"),this.snapping=!1}};g([Je()],Mv.prototype,"datum",2),g([Je()],Mv.prototype,"node",2),g([Je()],Mv.prototype,"snapping",2);var OR={type:"disjoint-channel",datum:Aa,scene:Sv,isDatum:Aa.is,translate:(e,t,i,s)=>{Aa.is(t)&&Sv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Aa.is(t)&&Aa.is(i)&&Sv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Aa.is(t)&&Sv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Mv({...e,create:t("disjoint-channel")}),dragState:e=>new xi(e)},GA=[0,23.6,38.2,50,61.8,78.6,100],JX=[161.8,261.8,361.8,423.6],e6=[...GA,...JX],t6={10:e6,6:GA,4:GA.filter(e=>e!==78.6&&e!==23.6)},i6=10;function s6(e,t){const{x2:i,y1:s,y2:n}=e,a=s-n;return t==null?{x1:i,x2:i,y1:n-a,y2:n}:{x1:t.x1,x2:t.x2,y1:t.y2-a,y2:t.y2}}function PR({x1:e,y1:t,x2:i,y2:s},n,a,o,r=10){const l=t-s,c=a?-1:1;let h=o;const d=[];for(const[u,p]of t6[r].entries()){const f=o+l*(p/100)*c,y=n.yAxis.scaleInvert(f);d.push({id:u,x1:e,x2:i,y1:h,y2:f,tag:p==100?0:1,label:{x1:Math.min(e,i)-i6,x2:i,y1:f,y2:f,text:`${(p/100).toFixed(3)} (${y.toFixed(2)})`}}),h=f}return d}var ER=class extends Ji{constructor(){super(),this.trendLine=new An,this.rangeFillsGroup=new N.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=N.Selection.select(this.rangeFillsGroup,N.Range),this.rangeStrokesGroup=new N.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=N.Selection.select(this.rangeStrokesGroup,An),this.labelsGroup=new N.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=N.Selection.select(this.labelsGroup,zh),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=on(e,t);if(i==null){this.visible=!1;return}if(i=ve.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,n=this.extendLine(i,e,t),a=s?n.y1:n.y2,o=s?n.y2:n.y1,r=PR(n,t,e.reverse,a,e.bands);this.updateRanges(e,r,t);const l={...n,y1:o,y2:o};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:s},n,a){const o={x1:e,y1:t,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return o;const{x:r,width:l}=a.xAxis.bounds;return n.extendEnd&&(o[e>i?"x1":"x2"]=r+l),n.extendStart&&(o[e>i?"x2":"x1"]=r),o}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:a,stroke:o}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:a,fillOpacity:0,stroke:o})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:a,isMultiColor:o}=e;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,f=o?n[u%n.length]:a;r.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:f,strokeOpacity:s,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:d})})}updateRanges(e,t,i){const s=n=>n.id;this.rangeFillsGroupSelection.update(t,void 0,s),this.rangeStrokesGroupSelection.update(t,void 0,s),this.labelsGroupSelection.update(t,void 0,s),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:a,showFill:o,isMultiColor:r}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const f=r?n[p%n.length]:a;if(!o){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,stroke:f,strokeOpacity:s,fill:f,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:n,rangeStroke:a,isMultiColor:o,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=e,u={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(t,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((f,y,b)=>{const x=d??(o?s[b%s.length]:a),v=i.at(b);if(!v)return;const{text:S,...M}=y.label;if(p)f.setProperties({...u,text:S,x:M.x1,y:M.y1,textBaseline:"middle",textAlign:"end",fill:x}),xp(f.id,v,M);else{const D={...u,label:S,position:"center",alignment:"left",color:x};xp(f.id,v,M,D,f,S,n)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:s,...n}=i.datum.label;i.setProperties({...t,text:s,x:n.x1,y:n.y1,textBaseline:"middle",textAlign:"end"});const{x:a}=i.getBBox();return a>=e.bounds.x&&a<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=e;this.text=this.updateNode(zh,this.text,!!s.label),xp(i.id,i,t,s,this.text,s.label,n)}updateAnchor(e,t,i,s){const n=ve.topCenter(t);H.apply(this.anchor,N.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let a=!1;return s.each(o=>a||(a=o.isPointInPath(e,t))),a||i.isPointInPath(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.trendLine.isPointInPath(e,t))return"line"}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:RR}=N;function Dv(e,t,i={overflowContinuous:!1},s){if(t.x==null||t.y==null)return s&&K.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:n,yAxis:a}=e,o=i.overflowContinuous&&RR.is(n.scale),r=i.overflowContinuous&&RR.is(a.scale),l=o||zR(t.x,n),c=r||zR(t.y,a);if(l&&c)return!0;if(s){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=Pi(t.x),u=Pi(t.y);K.warnOnce(`${s}is outside the ${h}, ignoring. - x: [${d}], y: ${u}]`)}return!1}function zR(e,t){const{domain:i}=t.scale,s=Pi(e);return i&&s!=null&&t.continuous?s>=i[0]&&s<=i.at(-1):!0}var kv=class extends ER{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new An,this.start=new si,this.end=new si,this.endRetracement=new si,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return Ji.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(i==null||s==null){this.visible=!1;return}if(i=ve.round(i),s=ve.round(s),this.visible=e.visible??!0,!this.visible)return;(e.endRetracement.x==null||e.endRetracement.y==null)&&(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:n,bands:a}=e,o=s6(i,s),r=this.extendLine(o,e,t),l=r.y2,c=r.y1,h=s?PR(r,t,n,l,a):[];this.updateRanges(e,h,t);const d={...r,y1:c,y2:c};this.updateText(e,d)}containsPoint(e,t){const{start:i,end:s,endRetracement:n,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):n.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):a.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...mv({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:H.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(e,t,i):rn(this[n].drag(t).point,i);!o||!Dv(i,o)||(e[n].x=o.x,e[n].y=o.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const a=(n.indexOf(s)+1)%n.length,o=n[a];this[s].toggleDragging(!0);const r=ii(e[o],i);return rn(fv(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:s,translation:n,context:a}){const o=al({start:t,end:i,endRetracement:s},n,a,{overflowContinuous:2});e.start.x=o.start.x,e.end.x=o.end.x,e.endRetracement.x=o.endRetracement.x,e.start.y=o.start.y,e.end.y=o.end.y,e.endRetracement.y=o.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:ii(e.start,i),end:ii(e.end,i),endRetracement:ii(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:n}=this.getCoords(e,i);if(!s||!n)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:ve.start(s),end:ve.end(s),endRetracement:ve.end(n),translation:{x:-a.width/2,y:-a.height/2},context:i}),t}getCoords(e,t){return{coords1:on(e,t),coords2:on({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of rt(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?ve.start(t):ve.end(t)}},Iv=class extends de{constructor(e){const t=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),e.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},s=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({end:Jf(c,h,u,d.start,d.snapToAngle)}),e.update())},n=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),e.update())},a=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({endRetracement:Jf(c,h,u,d.end,d.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},r=()=>e.delete(),l=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:de.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:n},drag:s,dragEnd:{target:"endRetracement",action:n},reset:{target:de.parent,action:r},cancel:{target:de.parent,action:r},onExit:l},endRetracement:{hover:a,click:{target:de.parent,action:o},drag:{target:de.parent,action:o},reset:{target:de.parent,action:r},cancel:{target:de.parent,action:r}}}),this.debug=be.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Uo}};g([Je()],Iv.prototype,"datum",2),g([Je()],Iv.prototype,"node",2),g([Je()],Iv.prototype,"snapping",2);var VR={type:"fibonacci-retracement-trend-based",datum:Uo,scene:kv,isDatum:Uo.is,translate:(e,t,i,s)=>{Uo.is(t)&&kv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Uo.is(t)&&Uo.is(i)&&kv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Uo.is(t)&&kv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Iv({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new xi(e)},Av=class extends ER{constructor(){super(),this.type="fibonacci-retracement",this.start=new si,this.end=new si,this.append([this.start,this.end])}static is(e){return Ji.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...mv({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:H.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(e,t,i):rn(this[n].drag(t).point,i);!o||!Dv(i,o)||(e[n].x=o.x,e[n].y=o.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,a=["start","end"].find(r=>r!==s);if(!s||!a)return;this[s].toggleDragging(!0);const o=ii(e[a],i);return rn(fv(t,o,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:s,context:n}){const a=al({start:t,end:i},s,n,{overflowContinuous:1});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}translate(e,t,i){this.translatePoints({datum:e,start:ii(e.start,i),end:ii(e.end,i),translation:t,context:i})}copy(e,t,i){const s=on(e,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.height/2},context:i}),t}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of rt(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?ve.start(t):ve.end(t)}},bp=class extends de{constructor(e){const t=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),e.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},s=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:Jf(r,l,h,c.start,c.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({end:!0}),e.update()},a=()=>e.delete(),o=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:de.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:de.parent,action:n},drag:s,dragEnd:{target:de.parent,action:n},reset:{target:de.parent,action:a},cancel:{target:de.parent,action:a},onExit:o}}),this.debug=be.create(!0,"annotations"),this.snapping=!1}};g([Je()],bp.prototype,"datum",2),g([Je()],bp.prototype,"node",2),g([Je()],bp.prototype,"snapping",2);var n6=class extends bp{createDatum(){return new Qr}},a6=class extends bp{createDatum(){return new Jr}},o6=class extends bp{createDatum(){return new tl}},BR={type:"fibonacci-retracement",datum:tl,scene:Av,isDatum:tl.is,translate:(e,t,i,s)=>{tl.is(t)&&Av.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(tl.is(t)&&tl.is(i)&&Av.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{tl.is(t)&&Av.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new o6({...e,create:t("fibonacci-retracement")}),dragState:e=>new xi(e)},r6=class extends N.Group{},Cv=class extends r6{constructor(){super(),this.type="arrow",this.path=new N.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:n,...a}=e,o=H.from(i,s),r=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=H.rotate(H.from(0,l),n+r,o),h=H.rotate(H.from(l,0),n-r,o);t.setProperties(a),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(o.x,o.y),t.path.lineTo(h.x,h.y)}},{Transformable:l6}=N,yc=class extends RA{constructor(){super(),this.type="line",this.line=new An,this.append([this.line,this.start,this.end])}static is(e){return Ji.isCheck(e,"line")}update(e,t){let i=on(e,t);if(i==null){this.visible=!1;return}i=ve.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))}updateLine(e,t,i){const{line:s}=this,{lineDashOffset:n,stroke:a,strokeWidth:o,strokeOpacity:r}=e,l=this.extendLine(t,e,i);s.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:a,strokeWidth:o,strokeOpacity:r,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(zh,this.text,!!e.text.label),xp(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!e.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:n}=e,[a,o]=H.from(t),r=H.angle(H.sub(o,a));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.startCap.remove(),this.startCap=void 0),this.startCap==null&&(this.startCap=new Cv,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.endCap.remove(),this.endCap=void 0),this.endCap==null&&(this.endCap=new Cv,this.append([this.endCap])),this.endCap.update({x:o.x,y:o.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(e,t,i,s){const n=ve.topCenter(t);H.apply(this.anchor,l6.toCanvasPoint(this.line,n.x,n.y))}containsPoint(e,t){const{line:i,text:s}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:n,endCap:a}=this;let[o,r]=H.from(t);const l=H.angle(H.sub(r,o));return n&&(o=H.rotate(H.from(0,-si.HANDLE_SIZE/2),l,o)),a&&(r=H.rotate(H.from(0,si.HANDLE_SIZE/2),l,r)),i==="start"?o:r}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},FR={type:"line",datum:Jr,scene:yc,isDatum:Jr.is,translate:(e,t,i,s)=>{Jr.is(t)&&yc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Jr.is(t)&&Jr.is(i)&&yc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Jr.is(t)&&yc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new a6({...e,create:t("line")}),dragState:e=>new xi(e)},_R={type:"arrow",datum:Qr,scene:yc,isDatum:Qr.is,translate:(e,t,i,s)=>{Qr.is(t)&&yc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Qr.is(t)&&Qr.is(i)&&yc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Qr.is(t)&&yc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new n6({...e,create:t("arrow")}),dragState:e=>new xi(e)};function HR(e,t=0,i=0){let s=t;for(const n of e)if(Array.isArray(n)){for(const a of n)GR(a,s);s+=N.Group.computeChildrenBBox(n).width+i}else GR(n,s),s+=n.getBBox().width+i}function c6(e,t=0,i=0){let s=t;for(const n of e)if(Array.isArray(n)){for(const a of n)jR(a,s);s+=N.Group.computeChildrenBBox(n).height+i}else jR(n,s),s+=n.getBBox().height+i}function GR(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function jR(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function WR(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function $R(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var KR=class extends N.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new N.Rect,this.dateRangeBarsText=new N.Text,this.dateRangeDivider=new N.Line,this.dateRangeValueText=new N.Text,this.priceRangeValueText=new N.Text,this.priceRangeDivider=new N.Line,this.priceRangePercentageText=new N.Text,this.volumeText=new N.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,s,n,a,o){this.verticalDirection=a;const r=this.updateStatistics(e,t,i,o),l=N.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(e,l,c),this.reposition(r,c,n),this.checkVisibility(e,n,s)}checkVisibility(e,t,i){const s=ve.from(t.seriesRect);this.visible=ve.collides(i,s)&&(e.visible??!0)}updateStatistics(e,t,i,s){const{dateRangeBarsText:n,dateRangeDivider:a,dateRangeValueText:o,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,u=6,p=e.statistics.fontSize+3,f=-2,y=this.getTextStyles(e),b={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:p},x=[n,a,o],v=[r,l,c],S=[];return t.priceRange&&(r.setProperties({...y,text:this.formatPriceRangeValue(t.priceRange.value,s)}),l.setProperties(b),c.setProperties({...y,text:this.formatPriceRangePercentage(t.priceRange.percentage,s)}),HR(v,i.x,d),S.push(v)),t.dateRange&&(n.setProperties({...y,text:this.formatDateRangeBars(t.dateRange.bars,s)}),a.setProperties(b),o.setProperties({...y,text:this.formatDateRangeValue(t.dateRange.value)}),HR(x,i.x,d),S.push(x)),t.volume==null?h.visible=!1:(h.setProperties({...y,x:i.x,text:this.formatVolume(t.volume,s),visible:!0}),S.push(h)),c6(S,i.y,u),l.y1+=f,l.y2+=f,a.y1+=f,a.y2+=f,S}updateBackground(e,t,i){const s=this.getBackgroundStyles(e);this.background.setProperties({...s,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:s,height:n}=i.seriesRect,a=ve.from(this.background.getBBox());let o=0;a.x1<0&&(o=-a.x1),a.x2>s&&(o=s-a.x2);const r=Math.min(t,n-a.y2);for(const l of e)if(Array.isArray(l)){const c=N.Group.computeChildrenBBox(l).width;for(const h of l)WR(h,o-c/2),$R(h,r)}else WR(l,o-l.getBBox().width/2),$R(l,r);this.background.x+=o,this.background.y+=r}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const s=1e3*60,n=s*60,a=n*24,o=Math.floor(e/s),r=Math.floor(e/n),l=Math.floor(e/a),c=r%(a/n),h=o%(n/s);return l>=1&&t.push(`${l}d`),r>=1&&(e<a||c!==0)&&t.push(`${c}h`),(e<n||h!==0)&&t.push(`${h}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i=Number.isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},h6=class extends KR{getDirectionStyles(e){return this.verticalDirection==="down"?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},Jn=class extends RA{constructor(){super(),this.type="measurer",this.horizontalLine=new An,this.verticalLine=new An,this.horizontalStartLine=new An,this.horizontalEndLine=new An,this.verticalStartLine=new An,this.verticalEndLine=new An,this.horizontalEndCap=new Cv,this.verticalEndCap=new Cv,this.background=new N.Path({zIndex:-1}),this.updateBackground=NR.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return Ji.isCheck(e,"measurer")}createStatisticsScene(){return new KR}update(e,t){const i=on(e,t);if(i==null){this.visible=!1;return}if(this.visible=e.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,e,t),n={...s,y2:s.y1},a={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,s),this.updateBackground(e,n,a,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const s={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[n,a]=H.from(i.yAxis.bounds);return ka.is(t)?(t.extendAbove&&(s.y1=n.y),t.extendBelow&&(s.y2=a.y)):Ia.is(t)&&(t.extendLeft&&(s.x1=n.x),t.extendRight&&(s.x2=a.x)),s}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:n,verticalEndLine:a,verticalEndCap:o}=this,{direction:r}=e;n.visible=r!=="vertical",a.visible=r!=="vertical",s.visible=r!=="vertical",t.visible=r!=="horizontal",i.visible=r!=="horizontal",o.visible=r!=="horizontal"}updateLines(e,t){const{horizontalLine:i,verticalLine:s}=this,{direction:n}=e,{x1:a,y1:o,x2:r,y2:l}=t,c=H.round(ve.center(t),0),h=this.getLineStyles(e);n!=="vertical"&&i.setProperties({...h,x1:a,x2:r,y1:c.y,y2:c.y}),n!=="horizontal"&&s.setProperties({...h,x1:c.x,x2:c.x,y1:o,y2:l})}updateText(e,t){const{direction:i}=e,s=H.round(ve.center(t),0);let n;const a={...t};i==="vertical"?(n=this.verticalLine,a.x1=s.x,a.x2=s.x):(n=this.horizontalLine,a.y1=s.y,a.y2=s.y),this.text=this.updateNode(zh,this.text,!!e.text.label);const{id:o}=n,r=xp(o,n,a,e.text,this.text,e.text.label,e.strokeWidth);let l;if(i==="both"&&r&&this.text){const c=ve.from(this.text.getBBox()),{offset:h}=r.numbers;c.x1<=s.x+h.x&&c.x2>=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+H.length(h)})}this.verticalLine.setClipMask(o,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=e,{x1:a,y1:o,x2:r,y2:l}=t,c=H.round(ve.center(t),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(e),p={stroke:h,strokeWidth:d,strokeOpacity:u};if(n!=="vertical"){const f=a<=r?0:Math.PI;let y=r;n==="horizontal"&&(y+=a<=r?-2:2),i.update({...p,x:y,y:c.y,angle:f})}if(n!=="horizontal"){const f=o<=l?Math.PI/2:Math.PI/-2;let y=l;n==="vertical"&&(y+=o<=l?-2:2),s.update({...p,x:c.x,y,angle:f})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:a}=this,{direction:o}=e,{x1:r,y1:l,x2:c,y2:h}=t,d=this.getLineStyles(e);o==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),o==="vertical"&&(n.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),a.setProperties({...d,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const s=H.add(ve.bottomCenter(t),H.from(0,10)),n={volume:this.getVolume(e)};e.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,n,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,s){const n=ve.topCenter(t);H.apply(this.anchor,N.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(e,t,i,s){const[n,a]=H.from(t),[o,r]=H.from(i);return[n,a,r,o]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:n}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:n,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:s,verticalLine:n,horizontalStartLine:a,horizontalEndLine:o,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||n.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||o.visible&&o.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(ve.width(e)/i)*s:0}getDateRangeValue(e){const t=Pi(e.start.x),i=Pi(e.end.x);if(!Cs(t)||!Cs(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Pi(e.end.y),i=Pi(e.start.y);if(!gt(t)||!gt(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Pi(e.end.y),i=Pi(e.start.y);if(!gt(t)||!gt(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},wv=class extends Jn{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return Ji.isCheck(e,"quick-measurer")}createStatisticsScene(){return new h6}getDirectionStyles(e){return this.verticalDirection==="down"?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},vp=class extends de{constructor(e){const t=({point:o})=>{const r=this.createDatum();r.set({start:o,end:o}),e.create(r)},i=({point:o})=>{const{datum:r,node:l}=this;r?.set({end:o}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>e.delete(),a=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:de.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:de.parent,action:s},dragEnd:{target:de.parent,action:s},reset:{target:de.parent,action:n},cancel:{target:de.parent,action:n},onExit:a}}),this.debug=be.create(!0,"annotations")}};g([Je()],vp.prototype,"datum",2),g([Je()],vp.prototype,"node",2);var d6=class extends vp{createDatum(){return new ka}},u6=class extends vp{createDatum(){return new Ia}},p6=class extends vp{createDatum(){return new qr}},g6=class extends vp{createDatum(){return new Qn}},UR={type:"date-range",datum:ka,scene:Jn,isDatum:ka.is,translate:(e,t,i,s)=>{ka.is(t)&&Jn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ka.is(t)&&ka.is(i)&&Jn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ka.is(t)&&Jn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new d6({...e,create:t("date-range")}),dragState:e=>new xi(e)},YR={type:"price-range",datum:Ia,scene:Jn,isDatum:Ia.is,translate:(e,t,i,s)=>{Ia.is(t)&&Jn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ia.is(t)&&Ia.is(i)&&Jn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ia.is(t)&&Jn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new u6({...e,create:t("date-range")}),dragState:e=>new xi(e)},ZR={type:"date-price-range",datum:qr,scene:Jn,isDatum:qr.is,translate:(e,t,i,s)=>{qr.is(t)&&Jn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(qr.is(t)&&qr.is(i)&&Jn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{qr.is(t)&&Jn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new p6({...e,create:t("date-range")}),dragState:e=>new xi(e)},XR={type:"quick-date-price-range",datum:Qn,scene:wv,isDatum:Qn.is,translate:(e,t,i,s)=>{Qn.is(t)&&wv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Qn.is(t)&&Qn.is(i)&&wv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Qn.is(t)&&wv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new g6({...e,create:t("quick-date-price-range")}),dragState:e=>new xi(e)},Lv=class extends FA{constructor(){super(),this.type="note",this.shape=new N.Rect,this.iconBackground=new N.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new N.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new N.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return Ji.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=ae(0,s.x,i.seriesRect.width-e.width);const n=e.getPadding().top,a=s.y-sR-n*2,o=s.y+si.HANDLE_SIZE+n*2;return a-s.height-nR<0?(s.y=o,e.position="top"):(s.y=a+n,e.position="bottom"),s}updateLabel(e,t){const i=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=Io(e.text,{maxWidth:200,font:e,textWrap:"always",avoidOrphans:!1})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const s=e.getPadding().top,n=e.position==="top";i.x=t.x-s,i.width=e.width+s*2,i.height=t.height+s*2,i.y=t.y+(n?0:-t.height)-s}updateIcon(e,t){const{active:i,iconBackground:s,iconLines:n}=this,{x:a,y:o}=ii(e,t);s.translationX=a-MX/2,s.translationY=o-iR,n.translationX=s.translationX,n.translationY=s.translationY,s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeOpacity=e.strokeOpacity??1,s.strokeWidth=e.strokeWidth??1,n.fill=e.stroke,i?s.fillShadow.color=e.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const s=e.getPadding().top,n=e.position==="top",a=n?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+a*(t.height+s),position:n?"below":"above"}}getLabelCoords(e,t){const i=e.position==="top",s=e.getPadding().top+Rn(e.fontSize,cv)/2;return{x:t.x,y:t.y+(i?s/2:0)}}getTextBaseline(e){return e.position==="top"?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+si.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e,t,i){super.toggleHovered(e,t,i);const s=e||t&&!i;this.label.visible=s,this.shape.visible=s,this.zIndex=s?13:12}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return this.shape.visible&&this.shape.containsPoint(e,t)||this.iconBackground.containsPoint(e,t)?!0:super.containsPoint(e,t)}},f6=class extends em{createDatum(){return new In}},qR={type:"note",datum:In,scene:Lv,isDatum:In.is,translate:(e,t,i,s)=>{In.is(t)&&Lv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(In.is(t)&&In.is(i)&&Lv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{In.is(t)&&Lv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new f6({...e,create:t("note")}),dragState:e=>new xi(e)},Nv=class extends TR{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new si,topMiddle:new yp,topRight:new si,bottomLeft:new si,bottomMiddle:new yp,bottomRight:new si},this.middleLine=new An,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Ji.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:n,handles:a}=this;if(n==null)return;const{offset:o}=a[n].drag(t);a[n].toggleDragging(!0),(n==="topMiddle"||n==="bottomMiddle")&&(o.x=0);let r=[],l=s;switch(n){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],o.y-=yp.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],o.y-=yp.HANDLE_SIZE/2,l=!1;break}const c=on(e,i),h=on(e.bottom,i);if(!c||!h)return;const d={topLeft:ve.start(c),topRight:ve.end(c),bottomLeft:ve.start(h),bottomRight:ve.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:e.snapToAngle},p=al(d,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});e.start.x=p.topLeft.x,e.start.y=p.topLeft.y,e.end.x=p.topRight.x,e.end.y=p.topRight.y,e.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:s}=this.handles,n=i.getBBox().y-s.getBBox().y,a=H.add(e,H.from(0,n)),o=H.add(t,H.from(0,n));return{start:e,end:t,bottomStart:a,bottomEnd:o}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,s,n,a){const{topLine:o,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=e,p=e.getLineDash(),f={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};o.setProperties({...t,...f}),l.setProperties({...i,...f});const y=this.extendLine({x1:n.x1,y1:a.y1+(n.y1-a.y1)/2,x2:n.x2,y2:a.y2+(n.y2-a.y2)/2},e,s);r.setProperties({...y,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??d,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:n,topRight:a,bottomLeft:o,bottomMiddle:r,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...ve.start(t)}),a.update({...c,...ve.end(t)}),o.update({...c,...ve.start(i)}),l.update({...c,...ve.end(i)}),n.update({...c,...H.sub(ve.center(t),H.from(n.handle.width/2,n.handle.height/2))}),r.update({...c,...H.sub(ve.center(i),H.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(zh,this.text,!!e.text.label),kR(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const n=t.x1>t.x2,a=t.y1>t.y2,o=t.x1!==i.x1&&t.y1!==i.y1,r=t.x2!==i.x2&&t.y2!==i.y2,l=H.from(t);return e.extendEnd&&r&&l.push(H.from(n?s.x1:s.x2,a?s.y1:s.y2)),l.push(...H.from(i).reverse()),e.extendStart&&o&&l.push(H.from(n?s.x2:s.x1,a?s.y2:s.y1)),l}},Tv=class extends de{constructor(e){const t=({point:l})=>{const c=new Ca;c.set({start:l,end:l,height:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:Jf(l,c,d,h.start,h.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,d=Pi(c?.end.y),u=Pi(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=u-f;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:f}),e.update())},o=({point:l})=>{const{datum:c,node:h}=this,d=Pi(c?.end.y),u=Pi(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=u-f;h?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:f}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:de.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:de.parent,action:r},cancel:{target:de.parent,action:r}},height:{hover:a,click:{target:de.parent,action:o},drag:{target:de.parent,action:o},reset:{target:de.parent,action:r},cancel:{target:de.parent,action:r}}}),this.debug=be.create(!0,"annotations"),this.snapping=!1}};g([Je()],Tv.prototype,"datum",2),g([Je()],Tv.prototype,"node",2),g([Je()],Tv.prototype,"snapping",2);var QR={type:"parallel-channel",datum:Ca,scene:Nv,isDatum:Ca.is,translate:(e,t,i,s)=>{Ca.is(t)&&Nv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ca.is(t)&&Ca.is(i)&&Nv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ca.is(t)&&Nv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Tv({...e,create:t("parallel-channel")}),dragState:e=>new xi(e)},Ov=class extends FA{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return Ji.isCheck(e,"text")}getHandleCoords(e,t){const i=si.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},m6=class extends em{createDatum(){return new il}},JR={type:"text",datum:il,scene:Ov,isDatum:il.is,translate:(e,t,i,s)=>{il.is(t)&&Ov.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(il.is(t)&&il.is(i)&&Ov.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{il.is(t)&&Ov.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new m6({...e,create:t("text")}),dragState:e=>new xi(e)},ea={[FR.type]:FR,[wR.type]:wR,[LR.type]:LR,[QR.type]:QR,[OR.type]:OR,[BR.type]:BR,[VR.type]:VR,[SR.type]:SR,[MR.type]:MR,[qR.type]:qR,[JR.type]:JR,[_R.type]:_R,[bR.type]:bR,[xR.type]:xR,[UR.type]:UR,[YR.type]:YR,[ZR.type]:ZR,[XR.type]:XR};function Vh(e){for(const{isDatum:t}of Object.values(ea))if(t(e))return e}var Pv=class extends wM{constructor(e){super(new y6(t=>{this.snapping=t}),new x6(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new xc(e,t=>{this.active=t,this.datum=this.active==null?void 0:e.datum(this.active),this.node=this.active==null?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};g([Je()],Pv.prototype,"snapping",2),g([Je()],Pv.prototype,"datum",2),g([Je()],Pv.prototype,"node",2);var y6=class extends de{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},x6=class extends de{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},xc=class extends de{constructor(e,t){const i=S=>M=>{e.create(S,M),this.active=e.selectLast()},s=()=>{this.active!=null&&e.delete(this.active),this.active=void 0,e.select()},n={createDatum:i},a={...e,delete:s,showTextInput:()=>{this.active!=null&&e.showTextInput(this.active)},deselect:()=>{const S=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,S)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},o=Object.fromEntries(Object.entries(ea).map(([S,M])=>[S,M.createState(a,n)])),r=Object.fromEntries(Object.entries(ea).map(([S,M])=>[S,M.dragState(e,n)])),l=({colorPickerType:S,colorOpacity:M,color:D,opacity:I,isMultiColor:k})=>{this.datum&&(S==="text-color"&&e.updateTextInputColor(D),pv(this.datum,S,M,D,I,k),e.update())},c=S=>{const{datum:M,node:D}=this;!M||!D||(Yo(M)?(M.fontSize=S,e.updateTextInputFontSize(S)):gp(M)&&(M.text.fontSize=S),e.update())},h=S=>{const{datum:M,node:D}=this;!M||!D||!dc(M)||(oR(M,S),e.update())},d=S=>{const{node:M}=this;!M||!("setTextInputBBox"in M)||(M.setTextInputBBox(S),e.update())},u=({textInputValue:S,bbox:M})=>{const{datum:D}=this;if(M!=null&&S!=null&&S.length>0){if(!Yo(D))return;const I=hv(D,S,M.width);D.set({text:I}),e.update(),e.recordAction(`Change ${D.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${D?.type} annotation`)},p=()=>{e.updateTextInputBBox(void 0)},f=()=>this.active!=null,y=()=>this.copied!=null,b=()=>{const{active:S,datum:M}=this;return S==null||!M?!1:gp(M)&&M.isWriteable()},x=()=>this.active!=null&&!hc(this.datum),v=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:S})=>{this.hovered=e.hoverAtCoords(S,this.active,this.hovered),this.hoverCoords=S},translate:{guard:f,target:"translating",action:({translation:S})=>{e.startInteracting(),e.translate(this.active,S),e.update()}},copy:{guard:x,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:x,action:()=>{this.copied=e.copy(this.active),s()}},paste:{guard:y,action:()=>{e.paste(this.copied)}},selectLast:()=>{const S=this.active;this.active=e.selectLast(),e.select(this.active,S)},click:[{guard:()=>{const{active:S,hovered:M,datum:D}=this;return S==null||M!==S||!D?!1:Yo(D)&&D.isWriteable()},target:"text-input"},{action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S)}}],dblclick:{guard:b,action:({offset:S})=>{const M=e.getNodeAtCoords(S,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,M)}},dragStart:[{guard:v,target:"dragging",action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S),e.startInteracting()}},{action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S)}}],color:{guard:f,action:l},fontSize:{guard:f,action:c},lineProps:{guard:f,action:S=>{const M=Vh(this.datum);M?.set(S),e.update(),e.recordAction(`Change ${M?.type} ${Object.entries(S).map(([D,I])=>`${D} to ${I}`).join(", ")}`)}},lineStyle:{guard:f,action:h},lineText:{guard:f,action:S=>{const M=Vh(this.datum);gp(M)&&(sl(M)&&S.position==="center"&&(S.position="inside"),M.text.set(S),e.update())}},updateTextInputBBox:{guard:f,action:d},toolbarPressSettings:{guard:b,action:S=>{e.showAnnotationSettings(this.active,S)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!hc(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...o},dragging:{onEnter:(S,M)=>{if(this.active==null)return;const D=e.getAnnotationType(this.active);D&&(this.transitionRoot(D),this.transitionRoot("dragStart",M))},...r},translating:{onEnter:()=>{},translate:{guard:f,target:"translating",action:({translation:S})=>{e.startInteracting(),e.translate(this.active,S),e.update()}},translateEnd:{guard:f,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const S=Vh(this.datum);!S||!("getTextInputCoords"in S)||(e.startInteracting(),e.showTextInput(this.active),S.visible=!1,e.update())},updateTextInputBBox:{guard:f,action:d},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:zA,target:"idle",action:p},{guard:VA,target:"idle",action:u}],color:{guard:f,action:l},fontSize:{guard:f,action:c},cancel:{target:"idle",action:p},onExit:()=>{e.stopInteracting(),e.hideTextInput();const S=this.active;if(this.active=this.hovered=void 0,e.select(this.active,S),S==null)return;const M=e.datum(S),D=e.node(S);!M||!D||(M.visible=!0)}}}),this.setActive=t,this.debug=be.create(!0,"annotations"),this.snapping=!1}};g([_e({changeValue(e){this.setActive(e)}}),Je()],xc.prototype,"active",2),g([Je()],xc.prototype,"hovered",2),g([Je()],xc.prototype,"hoverCoords",2),g([Je()],xc.prototype,"copied",2),g([Je()],xc.prototype,"snapping",2),g([Je()],xc.prototype,"datum",2),g([Je()],xc.prototype,"node",2);var{LayoutElement:b6,Menu:v6}=N,ez=class extends nl{};g([m],ez.prototype,"value",2);var Ev=class extends X{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new Bi(ez),this.events=new Pn,this.annotationMenu=new v6(this.ctx,"annotations"),this.cleanup=new pt,this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(b6.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i,buttonWidget:s}){const n=this.ctx.axisManager.getAxisContext("y")[0].scale;switch(t.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsLineAnnotations",PX.filter(a=>a.visible?a.visible(n):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsFibonacciAnnotations",EX);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsTextAnnotations",zX);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsShapeAnnotations",VX);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsMeasurerAnnotations",BX);break}}onToolbarButtonPressShowMenu(e,t,i,s,n,a){this.events.emit("pressed-show-menu",null);const o=this.buttons.findIndex(r=>r.value===s);this.toolbar.toggleActiveButtonByIndex(o),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show(i,{items:a,ariaLabel:this.ctx.localeManager.t(n),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,s)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(s=>s.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.events.emit("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){e.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};g([m,_e({changeValue(e){this.toolbar?.setHidden(!e)}})],Ev.prototype,"enabled",2),g([m],Ev.prototype,"padding",2),g([m],Ev.prototype,"buttons",2);var{InteractionState:tm}=N,im="ag-charts-annotations__axis-button",tz=class extends hi{constructor(e,t,i,s){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!t.scale.bandwidth,e.domManager.addEventListener("focusin",({target:n})=>{const a=n instanceof HTMLElement?n:void 0;!(a&&e.domManager.contains(a,"series-area"))&&a!==this.button.getElement()&&this.hide()}),this.cleanup.register(e.widgets.seriesWidget.addListener("drag-move",n=>this.onMouseDrag(n)),e.widgets.seriesWidget.addListener("mousemove",n=>this.onMouseMove(n)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter?.events.on("click",n=>this.onClick(n)),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.hide()),e.eventsHub.on("zoom:change-complete",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new Bf.ButtonWidget;return e.addClass(im),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",im)}onMouseMove(e){this.ctx.interactionManager.isState(tm.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(tm.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(tm.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(tm.Clickable)&&e.device==="touch"&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:s}=e;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(t.target))){this.hide();return}this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(tm.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:a,axisCtx:o,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,n.height],[u,p]=[0,n.width];if(a&&(e=Xr(ov(e-n.x,o),o)+n.x,t=Xr(ov(t-n.y,o),o)+n.y),i==="x"){const y=c-Math.max(0,r-5);e=e-l/2,t=s==="top"?h-c+y:d-y}else{const y=l-Math.max(0,r-9);e=s==="left"?u-l+y:p-y,t=t-c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(t==null)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${im}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(`<span class="${Al("zoom-in")} ${im}-icon"></span>`)}};g([m],tz.prototype,"enabled",2);var{DraggablePopover:S6,NativeWidget:jA}=N,iz=class dL extends S6{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new lR(this.ctx,{detached:!0}),this.cleanup.register(t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,i){const s=super.showWithChildren(t,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",n=>{n.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),Re().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(t){super.updatePosition(t);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(t,i,s){const n=ye("div","ag-charts-dialog__tabs"),a=Ec(s,()=>Ir()),o=Ec(s,()=>Ir());for(const[p,f]of rt(s))ma(f.panel,{id:o[p],role:"tabpanel","aria-labelledby":a[p]});const r=p=>{for(const[f,y]of rt(s))y.panel.classList.toggle("ag-charts-dialog__tab-panel--active",f===p),h[f].classList.toggle("ag-charts-dialog__tab-button--active",f===p),Pe(h[f],"aria-selected",f===p),f===p&&y.onShow?.()},l=new jA(ye("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:f}=p;f.target instanceof Element&&f.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new D6;this.setDragHandle(c);const h=Ec(s,(p,f)=>cu({label:this.ctx.localeManager.t(p.label),onPress:()=>r(f)},{id:a[f],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[f]})),d=ye("div","ag-charts-dialog__tab-list");ma(d,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),n.append(l.getElement(),...Object.values(s).map(p=>p.panel)),r(i),Qy({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[i]}}createTabPanel(){return ye("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return ye("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:s,onChange:n}){const a=this.createInputGroup(t);ma(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const o="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,d=this.ctx.localeManager.t(h),u=cu({icon:c,altText:d,onPress:()=>{for(const p of Array.from(a.children))p.classList.remove(o),p.ariaChecked="false";u.classList.add(o),u.ariaChecked="true",n(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===s&&u.classList.add(o),a.appendChild(u),r.push(u)}return Qy({orientation:"horizontal",buttons:r}),a}createSelect({altText:t,label:i,options:s,value:n,onChange:a}){const o=this.createInputGroup(i),r=this.ctx.localeManager.t(t),l=eD({value:n,options:s,onChange:a},{class:"ag-charts-dialog__select","aria-label":r,title:r});return o.append(l),o}createTextArea({placeholder:t,value:i,onChange:s}){const n=t?this.ctx.localeManager.t(t):void 0;return tD({value:i,onChange:s},{placeholder:n})}createCheckbox({label:t,checked:i,onChange:s}){const n=Ir(),a=this.createInputGroup(t,{for:n}),o=JM({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return a.append(o),a}createColorPicker({color:t,opacity:i,label:s,altText:n,onChange:a,onChangeHide:o,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(n),d=cu({label:h,onPress:u=>{const{anchor:p,fallbackAnchor:f}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:p,fallbackAnchor:f,color:t,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(y,b,x,v)=>{d.style.setProperty("--color",y),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",v),a(y,b,x,v)},onChangeHide:o})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const u=Oe.fromString(t),p=new Oe(u.r,u.g,u.b,i);d.style.setProperty("--color",p.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return cu({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const s=ye("div","ag-charts-dialog__input-group"),n=ye("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(t),Pe(n,"for",i?.for),s.appendChild(n),s}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||t.key!=="Escape"||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=i.domManager.getBoundingClientRect(),a=H.from(0,t.y),o=H.from(n.width,t.height),r=H.from(s),l=H.from(.5,1);let c;if(t.width>1e3){const h=H.sub(H.add(a,H.multiply(o,l)),H.multiply(r,l));c=H.sub(h,H.from(0,dL.offset))}else{const h=H.sub(H.add(a,o),r);c=H.sub(h,dL.offset)}this.updatePosition(c)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),n=H.sub(H.from(i.x,i.y),H.from(s.left,s.top)),a=H.add(n,H.from(0,i.height+5)),o=H.sub(n,H.from(0,5));return{anchor:a,fallbackAnchor:o}}};iz.offset=60;var M6=iz,D6=class extends jA{constructor(){super(ye("div","ag-charts-dialog__drag-handle"));const e=new jA(ye("span",Al("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},k6=class extends M6{constructor(e){super(e,"settings"),this.events=new Pn,this.hideFns.push(()=>this.events.emit("hidden",null))}show(e,t){const i=this.createLinearLineTab(e,t),s=this.createLinearTextTab(e,t);let n="dialogHeaderLine";sl(e)?n="dialogHeaderChannel":aR(e)?n="dialogHeaderFibonacciRange":e.type==="date-range"?n="dialogHeaderDateRange":e.type==="price-range"?n="dialogHeaderPriceRange":e.type==="date-price-range"&&(n="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});t.initialFocus=o,this.showWithChildren([a],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),a="isMultiColor"in e,o=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),a?e.isMultiColor:!1,a,t.onChangeLineColor,t.onChangeHideLineColor),r=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(s.append(o),"background"in e){const c=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);s.append(c),n.append(r)}else"showFill"in e?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:c=>t.onChangeLine({showFill:c})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,c=>t.onChangeLine({bands:c}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:sl(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:sl(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:c=>t.onChangeLine({extendEnd:c})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:c=>t.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:c=>t.onChangeLine({extendBelow:c})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:c=>t.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:c=>t.onChangeLine({extendRight:c})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:c=>t.onChangeLine({reverse:c})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:h=>t.onChangeText({label:h})}),n=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),a=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),o=e.text.position==="inside"?"center":e.text.position,r=this.createPositionRadioGroup(o??"top",h=>t.onChangeText({position:h})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",h=>t.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(n,a,r,l),i.append(s,c),{panel:i,onShow:()=>Vy(s)}}createColorPickerInput(e,t,i,s,n,a,o){const r=e==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=e==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:t,opacity:i,isMultiColor:s,hasMultiColorOption:n,onChange:a,onChangeHide:o})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:hR.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:RX.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:dR.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(e),onChange:i=>t(Number(i))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function WA(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function I6(e,t,i){for(const{update:s}of Object.values(ea))s(e,t,i)}var{InteractionState:Cn,keyProperty:A6,valueProperty:C6,Selection:w6,BBox:L6}=N,Sp=class A_ extends hi{constructor(t){super(),this.ctx=t,this.toolbar=new Ev(this.ctx),this.optionsToolbar=new TA(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return Vh(this.annotationData.at(i))}),this.axesButtons=new gA,this.enabled=!0,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new Bi(A_.createAnnotationDatum),this.defaults=new TX,this.container=new N.Group({name:"static-annotations"}),this.annotations=new w6(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new k6(this.ctx),this.textInput=new oX(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy(),this.textInput.destroy()})}setupStateMachine(){const{ctx:t}=this;return new Pv({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(Cn.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,n)=>{let a;return this.annotations.each((o,r,l)=>{if(!r.isHoverable())return;const c=o.containsPoint(i.x,i.y);c&&(a??(a=l)),o.toggleHovered(c,s===l,r.readOnly)}),a!=null?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),(a==null||!this.annotationData.at(a)?.readOnly)&&this.ctx.domManager.updateCursor("annotations",a==null?void 0:this.annotations.at(a)?.getCursor()),a!==n&&this.update(),a},getNodeAtCoords:(i,s)=>{const n=this.annotations.at(s);if(n)return n.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const n=this.annotations.at(i),a=Vh(this.annotationData.at(i));if(!(!n||!a))return this.translateNode(n,a,s)},copy:i=>{const s=this.annotations.at(i),n=Vh(this.annotationData.at(i));if(!(!s||!n))return this.createAnnotationDatumCopy(s,n)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:n,optionsToolbar:a,toolbar:o}=this;this.hideOverlays(),o.clearActiveButton(),o.resetButtonIcons();const r=i==null?null:n.at(i),l=s==null?null:n.at(s),c=i==null?null:this.annotationData.at(i);l===r&&r!=null||(l?.toggleActive(!1),a.hide(),r&&!c?.readOnly?(this.pushAnnotationState(Cn.AnnotationsSelected),r.toggleActive(!0),hc(c)||(a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(r)}))):(this.popAnnotationState(Cn.AnnotationsSelected),this.popAnnotationState(Cn.Annotations)),hc(c)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Cn.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Cn.Annotations)},stopInteracting:()=>{this.popAnnotationState(Cn.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(s=>{if(s.readOnly===!0)return s});this.annotationData.splice(0,this.annotationData.length);for(const s of i)this.annotationData.push(s)},validatePoint:(i,s)=>{const n=this.getAnnotationContext();return n?Dv(n,i,s):!0},getAnnotationType:i=>lX(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),s=i==null?null:this.annotations.at(i);s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=Vh(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const a={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},o=this.getAnnotationContext(),r=c=>H.add(s.getTextInputCoords(o,c),H.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:a,layout:{getTextInputCoords:r,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||hc(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,n="line")=>{const a=this.annotationData.at(i);if(!uv(a)&&!sl(a)&&!qf(a)||hc(a))return;const o=c=>(h,d,u,p)=>{this.setColorAndDefault(a.type,c,h,d,u,p),this.optionsToolbar.updateColorPickerColor(c,d,u,p)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${a.type} ${c} to ${a.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:n,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(a.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(a.type,c.position),this.recordActionAfterNextUpdate(`Change ${a.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:o("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:o("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(a.type,c),this.optionsToolbar.updateLineStyleType(Qf.find(h=>h.value===c)??Qf[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(a.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:o("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(a.type,c)}};this.settingsDialog.show(a,l)}})}setupListeners(){const{ctx:t,optionsToolbar:i,settingsDialog:s,toolbar:n}=this,{seriesWidget:a,seriesDragInterpreter:o,chartWidget:r}=t.widgets;o&&this.cleanup.register(o.events.on("click",this.hoverTouchPreHandler.bind(this)),o.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),o.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),o.events.on("mousemove",this.onHover.bind(this)),o.events.on("click",this.onClick.bind(this)),o.events.on("dblclick",this.onDoubleClick.bind(this)),o.events.on("drag-start",this.onDragStart.bind(this)),o.events.on("drag-move",this.onDrag.bind(this)),o.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(a.addListener("keydown",this.onKeyDown.bind(this)),a.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),t.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.eventsHub.on("zoom:change-complete",()=>this.onResize()),t.eventsHub.on("dom:resize",()=>this.onResize()),n.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Cn.Annotations),this.state.transition(l),this.update()}),n.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",({locked:l})=>{this.recordActionAfterNextUpdate(l?"Locked":"Unlocked"),this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:d,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,d,u,p)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:i,optionsToolbar:s}=this;this.cleanup.register(t.annotationManager.attachNode(this.container),()=>{t.domManager.removeStyles(im),i.destroy(),s.destroy()})}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[A6(this.xKey,void 0,{id:"date"}),C6(this.volumeKey,"number",{id:"volume"})],s=N.DataSet.wrap(this.data)??N.DataSet.empty(),{dataModel:n,processedData:a}=await t.request("annotations",s,{props:i});this.dataModel=n,this.processedData=a}createAnnotationScene(t){if(t.type in ea)return new ea[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(ea)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in ea)return new ea[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(ea)}], ignoring.`)}createAnnotation(t,i,s=!0){if(this.annotationData.push(i),s){const n=this.ctx.annotationManager.getAnnotationTypeStyles(t);n&&i.set(n),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,i){const{dataModel:s,processedData:n}=this;let a=Pi(t),o=Pi(i);if(!fl(a)||!fl(o)||!s||!n||this.volumeKey==null)return;a>o&&([a,o]=[o,a]);const r=s.resolveKeysById({id:"annotations"},"date",n),l=s.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let h=0;h<n.input.count;h++){const d=r[h];fl(d)&&d>=a&&d<=o&&(c+=l[h])}return c}translateNode(t,i,s){const n=this.getAnnotationConfig(i),a=this.getAnnotationContext();a&&n.translate(t,i,s,a)}createAnnotationDatumCopy(t,i){const s=this.getAnnotationConfig(i),n=new s.datum;n.set(i.toJson());const a=this.getAnnotationContext();if(a)return s.copy(t,i,n,a)}getAnnotationConfig(t){if(t.type in ea)return ea[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(ea)}], ignoring.`)}onRestoreAnnotations(t){this.enabled&&(this.clear(),this.annotationData.set(t.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(t){if(!this.enabled)return;const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i),this.xAxis=this.getAxis(t.axes.x,i,this.xAxis?.button),this.yAxis=this.getAxis(t.axes.y,i,this.yAxis?.button),this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(n=>n.hasData),s=this.yAxis.context.seriesIds().some(n=>this.ctx.chartService.series.find(o=>o.id===n)?.visible);return t&&s}animateAnnotations({from:t,to:i,phase:s}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:t,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(a){n.each(o=>{o.opacity=a,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(a)})},onStop(){n.each(a=>{a.opacity=i,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(i)})}})}onPreRender(){this.enabled&&(this.updateAnnotations(),this.state.transition("render"))}getAxis(t,i,s){const n=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:a="bottom",direction:o}=n,r=t.gridPadding+t.seriesAreaPadding,l=new L6(0,0,i.width,i.height).grow(r,a),c=o==="x"?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===o)){s??(s=new tz(this.ctx,{...n,snapToGroup:d},f=>this.onAxisButtonClick(f,c),i));const p=WA(t);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:t,context:n,bounds:l,button:s}}recordActionAfterNextUpdate(t,i=["annotations"]){const{defaults:s,ctx:{annotationManager:n,historyManager:a}}=this,o=i.map(r=>r==="defaults"?s:n);this.postUpdateFns.push(()=>{a.record(t,...o),n.fireChangedEvent()})}setColorAndDefault(t,i,s,n,a,o){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:n,opacity:a,isMultiColor:o}),this.defaults.setDefaultColor(t,i,s,n,a,o)}setFontSizeAndDefault(t,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(t,i),this.recordActionAfterNextUpdate(`Change ${t} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(t,i),this.recordActionAfterNextUpdate(`Change ${t} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(t,i),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:i,seriesRect:s,ctx:{annotationManager:n}}=this,a=this.getAnnotationContext();if(!s||!a)return;n.updateData(t.toJson());const o=this.showAnnotations();this.toolbar.refreshButtonsEnabled(o),this.toolbar.toggleClearButtonEnabled(t.length>0&&o),i.update(t??[],void 0,r=>r.id).each((r,l)=>{if(!o){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),I6(r,l,a)});for(const r of this.postUpdateFns)r();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:s,snap:n}=this;if(t&&i&&s)return{seriesRect:t,xAxis:{...i.context,bounds:i.bounds,labelPadding:WA(i.layout),snapToGroup:n},yAxis:{...s.context,bounds:s.bounds,labelPadding:WA(i.layout),snapToGroup:n}}}onHover(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=t.sourceEvent.shiftKey,a=H.from(t),o=rn(a,s);i.transition("hover",{offset:a,point:o,shiftKey:n,context:s})}onClick(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=t.sourceEvent.shiftKey,a=rn(H.from(t),s),o=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:a,shiftKey:n,textInputValue:o,bbox:r})}onDoubleClick(t){const{state:i}=this;if(!this.getAnnotationContext())return;const n=H.from(t);i.transition("dblclick",{offset:n})}onAxisButtonClick(t,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:n}=this;this.pushAnnotationState(Cn.Annotations);const a=i==="horizontal";if(n.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const o=rn(t,s);Dv(s,o)&&(n.transition("click",{point:o,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:i})}hoverTouchPreHandler(t){t.device==="touch"&&this.onHover(t)}dragMoveTouchPreHandler(t){t.device==="touch"&&this.ctx.interactionManager.isState(Cn.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(Cn.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=H.from(t),n=rn(s,i),a=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:n,textInputValue:a,bbox:o})}onDrag(t){if(!this.ctx.interactionManager.isState(Cn.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=H.from(t),n=rn(s,i),a=t.sourceEvent.shiftKey,o=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:n,shiftKey:a,textInputValue:o,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:i}=t??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:n,shiftKey:a}=t,o=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:n,shiftKey:a,textInputValue:o,bbox:r,context:s})}onKeyDown(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:n}=t,{shiftKey:a,ctrlKey:o,metaKey:r}=n,l=o||r,c=o||a;i.transition("keyDown",{shiftKey:a,context:s});const h={x:0,y:0},d=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(n.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),n.stopPropagation(),n.preventDefault()),!!l)switch(n.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(t){const{shiftKey:i}=t.sourceEvent,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let t=!1;for(const[i,s]of this.annotationData.entries())hc(s)&&(this.annotationData.splice(i,1),t=!0);t&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(t){this.ctx.interactionManager.pushState(t),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(t){this.ctx.interactionManager.popState(t),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Cn.Annotations)||this.ctx.interactionManager.isState(Cn.AnnotationsSelected)}update(t=8){this.ctx.updateService.update(t)}};g([m],Sp.prototype,"toolbar",2),g([m],Sp.prototype,"optionsToolbar",2),g([m],Sp.prototype,"axesButtons",2),g([m,Xt((e,t)=>{const i=t??!0;e.toolbar.enabled=i,e.optionsToolbar.enabled=i,e.axesButtons.enabled=i})],Sp.prototype,"enabled",2),g([m],Sp.prototype,"snap",2);var N6=Sp,wa={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},Ss={fill:Od,strokeOpacity:1,strokeWidth:2},Bh={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:ki.LARGE},fontFamily:{$ref:"fontFamily"}},sz={...Bh,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Rv={...Bh,textAlign:"left"},Fh={...Bh,position:"top",alignment:"center",color:{$ref:"textColor"}},nz={...Bh,position:"top",alignment:"center",color:{$ref:"textColor"}},$A={...Bh,fontSize:{$ref:"fontSize"},color:Rd,fill:Pd,stroke:Ed,strokeWidth:1,divider:{stroke:zd,strokeWidth:1,strokeOpacity:.5}},KA={...wa,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ss},text:{...Fh},statistics:{...$A}},T6={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},O6={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}},P6={enabled:!1,line:{...wa,handle:{...Ss},text:{...Fh}},"horizontal-line":{...wa,handle:{...Ss},axisLabel:{...sz},text:{...Fh}},"vertical-line":{...wa,handle:{...Ss},axisLabel:{...sz},text:{...Fh}},"disjoint-channel":{...wa,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ss},text:{...nz}},"parallel-channel":{...wa,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ss},text:{...nz}},"fibonacci-retracement":{...wa,strokes:Td,rangeStroke:{$ref:"foregroundColor"},handle:{...Ss},text:{...Fh,position:"center"},label:{...Bh,color:void 0,fontSize:{$rem:ki.SMALLER}}},"fibonacci-retracement-trend-based":{...wa,strokes:Td,rangeStroke:{$ref:"foregroundColor"},handle:{...Ss},text:{...Fh,position:"center"},label:{...Bh,color:void 0,fontSize:{$rem:ki.SMALLER}}},callout:{...wa,...Rv,color:{$ref:"textColor"},handle:{...Ss},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Rv,fontWeight:700,handle:{...Ss},fill:{$ref:"foregroundColor"}},note:{...Rv,color:Hd,fill:Ls,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Ss},background:{fill:Fd,stroke:_d,strokeWidth:1}},text:{...Rv,color:{$ref:"textColor"},handle:{...Ss}},arrow:{...wa,handle:{...Ss},text:{...Fh}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Ss,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Ss,stroke:{$ref:"foregroundColor"}}},"date-range":{...KA},"price-range":{...KA},"date-price-range":{...KA},"quick-date-price-range":{up:{...wa,fill:rs,fillOpacity:.2,handle:{...Ss},statistics:{...$A,color:"#fff",fill:rs,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...wa,stroke:Bd,fill:Vd,fillOpacity:.2,handle:{...Ss,stroke:Bd},statistics:{...$A,color:"#fff",fill:Vd,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:T6,optionsToolbar:O6},UA={type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,version:ue,options:N.annotationOptionsDef,themeTemplate:P6,create:e=>new N6(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new $E(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}},{Range:E6,TranslatableGroup:R6,BBox:z6,FillGradientDefaults:V6,FillImageDefaults:B6,FillPatternDefaults:F6,getShapeFill:_6,InteractionState:zv}=N,ta=class extends hi{constructor(e){super(),this.ctx=e,this.id=Ii(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new V6,this.fillPatternDefaults=new F6,this.fillImageDefaults=new B6,this.bounds=new z6(0,0,0,0),this.bandHighlightGroup=new R6({name:"bandHighlight",zIndex:1}),this.rangeNode=this.bandHighlightGroup.appendChild(new E6),this.activeAxisHighlight=void 0,this.axisCtx=e.parent,this.hideBand(),e.domManager.addEventListener("focusin",({target:a})=>{const o=a instanceof HTMLElement&&e.domManager.contains(a,"series-area");this.bandHighlightGroup.visible&&!o&&(this.hideBand(),this.ctx.updateService.update(9))});const{widgets:{seriesWidget:t,seriesDragInterpreter:i},animationManager:s,eventsHub:n}=e;this.cleanup.register(e.scene.attachNode(this.bandHighlightGroup),t.addListener("mousemove",a=>this.onHoverLikeEvent(a)),t.addListener("mouseleave",()=>this.clearAllHighlight()),s.addListener("animation-start",()=>this.clearAllHighlight()),n.on("layout:complete",a=>this.layout(a)),n.on("series:focus-change",()=>this.onKeyPress()),n.on("zoom:pan-start",()=>this.clearAllHighlight()),n.on("zoom:change-complete",()=>this.clearAllHighlight()),n.on("dom:resize",()=>this.clearAllHighlight()),n.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",a=>this.onHoverLikeEvent(a)),i.events.on("click",a=>this.onClick(a)))}axisChange(){this.onHighlightChange()}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(e){e.device==="touch"&&this.onHoverLikeEvent(e)}clearAllHighlight(){this.ctx.interactionManager.isState(zv.Clickable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(zv.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?zv.Clickable:zv.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&this.handleHoverHighlight(e)}handleHoverHighlight(e){if(!e)return;const{currentX:t,currentY:i}=e;this.onHighlightChange(this.axisCtx.pickBand({x:t,y:i}))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;const{position:s="left",axisId:n}=this.axisCtx,a=i[n];if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding,s);const{bandHighlightGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,fill:a,fillOpacity:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:h,axisLayout:d}=this;d&&(e.stroke=t,e.strokeWidth=i,e.strokeOpacity=s,e.lineDash=n,e.lineDashOffset=h,e.fill=_6(a,r,l,c),e.fillOpacity=o,e.startLine=!0,e.endLine=!0)}isVertical(){return this.axisCtx.direction==="x"}onHighlightChange(e){this.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.updateService.update(9))}updateBandPosition(){const{rangeNode:e,bounds:t}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let s=Math.min(...i),n=Math.max(...i);if(n-s<1){const a=(s+n)/2;s=a-.5,n=a+.5}this.isVertical()?(e.y1=0,e.y2=t.height,e.x1=s,e.x2=n,e.horizontal=!0):(e.y1=s,e.y2=n,e.x1=0,e.x2=t.width,e.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};ta.className="BandHighlight",g([m],ta.prototype,"enabled",2),g([m],ta.prototype,"stroke",2),g([m],ta.prototype,"lineDash",2),g([m],ta.prototype,"lineDashOffset",2),g([m],ta.prototype,"strokeWidth",2),g([m],ta.prototype,"strokeOpacity",2),g([m],ta.prototype,"fill",2),g([m],ta.prototype,"fillOpacity",2),g([m],ta.prototype,"fillGradientDefaults",2),g([m],ta.prototype,"fillPatternDefaults",2),g([m],ta.prototype,"fillImageDefaults",2);var YA={type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",axisTypes:["category","ordinal-time","unit-time","grouped-category"],enterprise:!0,version:ue,themeTemplate:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}},create:e=>new ta(e)},{LayoutElement:H6,Menu:G6}=N,ZA=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],az=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new G6(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(H6.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t,buttonWidget:i}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show(i,{items:ZA,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:s=>{this.setChartType(s.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=ZA.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>K.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!ZA.some(t=>t.value===e)?"candlestick":e}};g([m,_e({changeValue(e){this.toolbar?.setHidden(!e)}})],az.prototype,"enabled",2);var Vv={type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,version:ue,options:{enabled:R},create:e=>new az(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new $E(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}};function XA(e,t){return e==="always"?!0:e==="series-area"?t==="series-area"||t==="series-node":e===t}function oz(e,t,i){let s=!0;if(t.type==="separator"){const n=i.at(-1);s=n!==void 0&&n.type!=="separator"}if(s&&(s=XA(t.showOn??"always",e)),s){const n=new $6(t);return i.push(n),n}}function rz(e,t,i,s){t.isVisible(i)&&oz(e,t.builtins.items[i],s)}function j6(e,t,i,s){const{builtins:n}=t;if(ml(i,n.lists))for(const a of n.lists[i])rz(e,t,a,s);else rz(e,t,i,s)}function W6(e,t,i){const s=[],{builtins:n}=i;for(const a of t)if(typeof a=="string"&&ml(a,n.lists))for(const o of n.lists[a])s.push(o);else s.push(a);return s.filter(a=>{if(typeof a=="string"){const o=i.builtins.items[a].showOn??"always";return i.isVisible(a)&&XA(o,e)}else return XA(a.showOn??"always",e)})}function lz(e,t,i,s){for(const n of i)if(typeof n=="string")j6(e,t,n,s);else{const a=oz(e,n,s);n.items&&a&&n.items.length>0&&lz(e,t,n.items,a.items)}s.at(-1)?.type==="separator"&&s.pop()}var $6=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)e[t]!==void 0&&this.setField(t,this,e[t])}},ol="ag-charts-context-menu",{ContextMenuRegistry:sm}=N,qA="context-menu",K6=["angleKey","calloutLabelKey","colorKey","labelKey","radiusKey","sectorLabelKey","sizeKey","xKey","yKey"],nm=class extends hi{constructor(e){if(super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new Bf.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",qA),this.element.classList.add(ol),this.element.style.display="none",this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:t})=>{this.collapsingSubMenus>0||(t==null||t instanceof Node&&!this.element.contains(t))&&this.hide()}),this.cleanup.register(()=>this.element.remove(),()=>this.menuWidget.destroy(),e.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("collapse-widget",()=>this.onCollapse())),this.menuWidget.addClass(`${ol}__menu`),typeof MutationObserver<"u"){const t=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.cleanup.register(()=>t.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&(i=t.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{K.error("Unable to download chart",s)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",t=>this.onContext(t)))}makeGetItemsParams(e){const{showOn:t}=e,{context:i}=this.ctx.chartService,s=W6(t,this.items,this.ctx.contextMenuRegistry);switch(t){case"always":case"series-area":return{showOn:t,context:i,defaultItems:s};case"series-node":{if(this.pickedNode==null)throw new Error("this.pickedNode is null");const c={showOn:t,context:i,seriesId:this.pickedNode.series.id,datum:this.pickedNode.datum,defaultItems:s};for(const h of K6)this.pickedNode[h]!==void 0&&(c[h]=this.pickedNode[h]);return c}case"legend-item":if(this.pickedLegendItem==null)throw new Error("this.pickedLegendItem is null");const{itemId:n,seriesId:a,label:o,enabled:r}=this.pickedLegendItem,l=Ne(o.text);if(typeof n!="string")throw new Error(`unexpected itemId type: [${typeof n}] (expected [string])`);return{showOn:t,context:i,itemId:n,seriesId:a,text:l,visible:r,defaultItems:s};default:return t}}expandItemsOptions(e){const t=[];let i;if(this.getItems){const s=this.makeGetItemsParams(e);i=this.getItems(s)}return i??(i=this.items),lz(e.showOn,this.ctx.contextMenuRegistry,i,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,sm.check("series-node",e)?this.pickedNode=e.context.pickedNode:sm.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e);t.length!==0&&this.show(e.widgetEvent,t)}show(e,t){const{sourceEvent:i}=e;this.interactionManager.pushState(N.InteractionState.ContextMenu),this.element.style.display="block";const s=i.pointerType==="touch"?!1:void 0;s!==void 0&&this.ctx.chartService.overrideFocusVisible(s),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:s})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(N.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const s=this.ctx.domManager.getBoundingClientRect(),n=e.getBoundingClientRect(),a=s.right-n.right,o=n.left-s.left,{offsetWidth:r,offsetHeight:l}=t.getElement();let c=i.y;if(s.height>l){const h=s.bottom-n.top;h<l&&(c-=l-h)}if(a>=r)t.setBounds({x:i.x+i.width,y:c});else{const h=i.x-r,d=o+h;d>=0?t.setBounds({x:h,y:c}):t.setBounds({x:h-d,y:c})}}onSubMenuCollapse(e,t){e.setFocusOverride(void 0),this.collapsingSubMenus++,t.remove(),this.collapsingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":{e.addSeparator().classList.add(`${ol}__divider`);break}case"action":{if(i.items.length===0){const s=new Bf.MenuItemWidget;this.initButtonElement(s,i),e.addChild(s)}else{const{subMenuButton:s,subMenu:n}=e.addSubMenu();n.addClass(`${ol}__menu`),n.addListener("expand-widget",()=>this.onSubMenuExpand(s,n)),n.addListener("collapse-widget",()=>this.onSubMenuCollapse(s,n)),this.initButtonElement(s,i),this.createMenuItems(n,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return sm.checkCallback("legend-item",e,t)?i=>{const s=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:n,itemId:a,label:o}=this.pickedLegendItem,{chartService:r}=this.ctx;if(typeof a!="string"){K.error(`unexpected itemId type: [${typeof a}] (expected [string])`);return}const c=[r.series.find(d=>d.id===n)?.properties,r],h={type:"contextmenu",seriesId:n,itemId:a,text:Ne(o.text),event:s};ls(c,t,h),this.hide()}else K.error("legend item not found")}:sm.checkCallback("series-area",e,t)?()=>{const i=this.ctx.chartService,s={type:"seriesContextMenuAction",event:this.showEvent};ls(i,t,s),this.hide()}:sm.checkCallback("series-node",e,t)?()=>{const{showEvent:i}=this,{chartService:s}=this.ctx,n=this.pickedNode,a=[n?.series.properties,s],o=n?.series.createNodeContextMenuActionEvent(i,n);o?ls(a,t,o):K.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,s={type:"contextMenuEvent",event:this.showEvent};ls(i,t,s),this.hide()}}initTableCells(e){const t=ye("div"),i=ye("div"),s=ye("div");return t.classList.toggle(`${ol}__icon`,!0),i.classList.toggle(`${ol}__cell`,!0),s.classList.toggle(`${ol}__cell`,!0),t.ariaHidden="true",i.role="presentation",s.ariaHidden="true",e.append(t,i,s),{cellIcon:t,cellLabel:i,cellArrow:s}}initButtonElement(e,t){e.addClass(`${ol}__item`),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),s=`${ol}__cellpadding`,{cellIcon:n,cellLabel:a,cellArrow:o}=this.initTableCells(e.getElement());if(a.textContent=i,a.classList.add(s),t.iconUrl!=null){const c=ye("img");c.src=t.iconUrl,n.append(c),n.classList.add(s)}if(t.items.length>0){const c=ye("span",Al("chevron-right"));o.append(c),o.classList.add(s)}const{showOn:r,action:l}=t;l!=null&&e.addListener("click",this.createButtonOnClick(r,l)),t.items.length===0&&(e.addListener("mouseleave",()=>e.setFocusOverride(!1)),e.addListener("mouseenter",()=>e.setFocusOverride(void 0)))}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:n}=this.element;e=ae(0,e,i.width-s),t=ae(0,t,i.height-n),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(qA),this.ctx.domManager.removeChild("canvas-overlay",qA)}};g([m],nm.prototype,"enabled",2),g([m],nm.prototype,"darkTheme",2),g([m],nm.prototype,"items",2),g([m],nm.prototype,"getItems",2);var am={type:"plugin",name:"contextMenu",enterprise:!0,version:ue,options:{enabled:R,items:cg,getItems:Di(cg,"a menu items array")},themeTemplate:{enabled:!0,darkTheme:Il},create:e=>new nm(e)};am.options.darkTheme=Q(R);function om(e){return typeof e?.datum=="object"?e.datum:null}var{FormatManager:U6}=N,Y6="ag-charts-crosshair-label",bc=class extends X{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:a}=this,{domain:o,boundSeries:r}=s;let l;if(n!=null){const c=s.type==="number"?s.fractionDigits:void 0,h=s.type==="date"?s.unit:void 0,d=s.type==="date"?s.step:void 0;l=e(n,{value:i,domain:o,fractionDigits:c,unit:h,step:d,boundSeries:r})}if(a!=null){let c=this._cachedFormatter;(c?.type!==t||c?.format!==a)&&(c={type:t,format:a,formatter:U6.getFormatter(t,a)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};g([m],bc.prototype,"enabled",2),g([m],bc.prototype,"xOffset",2),g([m],bc.prototype,"yOffset",2),g([m],bc.prototype,"formatter",2),g([m],bc.prototype,"format",2),g([m],bc.prototype,"renderer",2);var cz=class extends bc{constructor(e,t,i){super(),this.domManager=e,this.id=Ii(this),this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(Y6),Pe(this.element,"aria-hidden",!0),this.element.dataset.key=t,this.element.dataset.axisId=i}show(e){const{element:t}=this,i=e.x+this.xOffset,s=e.y+this.yOffset;t.style.top=`${Math.round(s)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:e,styles:t}){if(e!==void 0&&(this.element.innerHTML=e),t!==void 0){const i=this.element.children[0]??this.element;Object.assign(i.style,t)}}getBBox(){const{element:e}=this;return new N.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if(typeof e=="string")return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:s=t.color,backgroundColor:n=t.backgroundColor,opacity:a=t.opacity??1}=e,o={opacity:a,"background-color":n?.toLowerCase(),color:s};return{html:`<div class="ag-charts-crosshair-label-content">
<span>${i}</span>
</div>`,styles:o}}};cz.className="CrosshairLabel";var{Group:Z6,TranslatableGroup:X6,Line:q6,BBox:hz,InteractionState:rm}=N,Zo=class extends hi{constructor(e){super(),this.ctx=e,this.id=Ii(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new bc,this.seriesRect=new hz(0,0,0,0),this.bounds=new hz(0,0,0,0),this.crosshairGroup=new X6({name:"crosshairs",zIndex:9}),this.lineGroup=this.crosshairGroup.appendChild(new Z6({name:`${this.id}-crosshair-lines`,zIndex:9})),this.lineGroupSelection=N.Selection.select(this.lineGroup,q6,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:i})=>{if(this.checkInteractionState())return;const s=i instanceof HTMLElement&&e.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!s&&(this.hideCrosshairs(),this.ctx.updateService.update(9))});const{seriesDragInterpreter:t}=e.widgets;this.cleanup.register(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),e.eventsHub.on("zoom:change-complete",()=>this.onMouseOut()),e.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),e.eventsHub.on("layout:complete",i=>this.layout(i)),()=>{for(const i of Object.values(this.labels))i.destroy()}),t&&this.cleanup.register(t.events.on("drag-move",i=>this.onMouseHoverLike(i)),t.events.on("click",i=>this.onClick(i)))}checkInteractionState(){return this.ctx.interactionManager.isState(rm.Frozen)}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:n}=this.axisCtx,a=i[n];if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding+a.seriesAreaPadding,s);const{crosshairGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l),this.refreshPositions()}updateSelections(e){this.lineGroupSelection.update(e,void 0,t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new cz(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s])}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:n,renderer:a}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=n,e.renderer=a}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,axisLayout:r}=this;if(!r)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=n,c.lineDash=a,c.lineDashOffset=o,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction==="x"}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){return Ne(this.axisCtx.formatScaleValue(e,"crosshair",this.label))}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?rm.Clickable:rm.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(9))}onMouseOut(){this.ctx.interactionManager.isState(rm.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(9))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(rm.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:n}=e.currentHighlight??{},a=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=a?e.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const o=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(o),t.visible=!0}}isInRange(e){return this.axisCtx.inRange(e)}refreshPositions(){this.activeHighlight&&this.updatePositions(this.getActiveHighlightData(this.activeHighlight))}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((s,n)=>{const a=e[n];if(!a){s.visible=!1,this.hideLabel(n);return}s.visible=!0;const{value:o,position:r}=a;let l=0,c=0;this.isVertical()?(l=r,s.x=Math.round(l)):(c=r,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,o,n):this.hideLabel(n)})}getData(e){const{axisCtx:t}=this,i="pointer",{xKey:s="",yKey:n=""}=this.activeHighlight??{},{currentX:a,currentY:o}=e,r=om(this.activeHighlight),l=this.isVertical(),c=l?a:o;let h=r?.[l?s:n]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{series:i,xKey:s="",aggregatedValue:n,cumulativeValue:a,midPoint:o}=e,r=om(e),l=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=i.axes[t.direction]?.id===t.axisId,d=l.includes("yKey")&&h,u=l.includes("xKey")&&h,p=n??a;if(d&&p!==void 0){const y=t.scale.convert(p)+c;return this.isInRange(y)?{yKey:{value:p,position:y}}:{}}if(u){const y=(this.isVertical()?o?.x:o?.y)??0,b=t.continuous?t.scaleInvert(y):r?.[s];return this.isInRange(y)?{xKey:{value:b,position:y}}:{}}const f={};for(const y of l){const b=i.properties[y],x=r?.[b],v=t.scale.convert(x)+c;this.isInRange(v)&&(f[y]={value:x,position:v})}return f}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:n}=this,a=this.labels[s],o=this.getLabelHtml(i,a);a.setLabelHtml(o);const{width:r,height:l}=a.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction==="x"?(h-=4,a.show({x:e-r/2,y:c==="bottom"?n.y+n.height+h:n.y-l-h})):(h-=8,a.show({x:c==="right"?n.x+n.width+h:n.x-r-h,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};Zo.className="Crosshair",g([m],Zo.prototype,"enabled",2),g([m],Zo.prototype,"stroke",2),g([m],Zo.prototype,"lineDash",2),g([m],Zo.prototype,"lineDashOffset",2),g([m],Zo.prototype,"strokeWidth",2),g([m],Zo.prototype,"strokeOpacity",2),g([m],Zo.prototype,"snap",2),g([m],Zo.prototype,"label",2);var QA={type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,version:ue,themeTemplate:{enabled:{$if:[{$or:[{$eq:[{$path:"../type"},"number"]},{$eq:[{$path:"../type"},"log"]},{$eq:[{$path:"../type"},"time"]},{$eq:[{$path:"../type"},"unit-time"]},{$eq:[{$path:"../type"},"ordinal-time"]}]},!0,!1]},snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}},create:e=>new Zo(e)},Mp=class extends hi{constructor(e){super(),this.enabled=!0,this.getData=()=>Promise.resolve(),this.dataService=e.dataService;let t=!1;this.cleanup.register(e.eventsHub.on("data:load",()=>{t=!0}),e.eventsHub.on("layout:complete",()=>{t&&e.zoomManager.updateZoom({source:"data-update",sourceDetail:"dataSource"})}))}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};g([_e({newValue(e){this.updateCallback(e,this.getData)}}),m],Mp.prototype,"enabled",2),g([_e({newValue(e){this.updateCallback(this.enabled,e)}}),m],Mp.prototype,"getData",2),g([_e({newValue(e){this.dataService.requestThrottle=e}})],Mp.prototype,"requestThrottle",2),g([_e({newValue(e){this.dataService.dispatchThrottle=e}})],Mp.prototype,"updateThrottle",2),g([_e({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],Mp.prototype,"updateDuringInteraction",2);var Bv={type:"plugin",name:"dataSource",enterprise:!0,version:ue,options:{getData:ot,requestThrottle:Q(P),updateThrottle:Q(P),updateDuringInteraction:Q(R)},create:e=>new Mp(e)},{BBox:vc}=N,Q6=class{constructor(e){this.components=e,this.union=vc.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},J6=class extends N.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new N.Path,this.capsPath=new N.Path,this.bboxes=new Q6([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:n,lengthMax:a}=t,o=s??i*n;return Math.min(o,a)}getItemStylerParams(e,t,i,s){const{datum:n}=this;if(n==null||e.itemStyler==null)return;const{xLowerKey:a,xUpperKey:o,yLowerKey:r,yUpperKey:l}=e;return{...t,datum:n.datum,seriesId:n.series.id,xKey:n.xKey,yKey:n.yKey,xLowerKey:a,xUpperKey:o,yLowerKey:r,yUpperKey:l,highlighted:i,highlightState:s}}formatStyles(e,t,i,s,n){let{cap:a,...o}=e;const r=this.getItemStylerParams(t,e,s,n);if(r!=null&&t.itemStyler!=null){const l=i.callWithContext(t.itemStyler,r);o=re(l,o),a=re(l?.cap,l,a)}return{whiskerStyle:o,capsStyle:a}}applyStyling(e,t){fg(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,s,n){if(this.datum===void 0)return;const{whiskerStyle:a,capsStyle:o}=this.formatStyles(e,t,i,s,n),{xBar:r,yBar:l,capDefaults:c}=this.datum,h=this.whiskerPath;this.applyStyling(h,a),h.path.clear(!0),l!==void 0&&(h.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),h.path.lineTo(l.upperPoint.x,l.upperPoint.y)),r!==void 0&&(h.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),h.path.lineTo(r.upperPoint.x,r.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(o??{},c);const d=this.capLength/2,u=this.capsPath;this.applyStyling(u,o),u.path.clear(!0),l!==void 0&&(u.path.moveTo(l.lowerPoint.x-d,l.lowerPoint.y),u.path.lineTo(l.lowerPoint.x+d,l.lowerPoint.y),u.path.moveTo(l.upperPoint.x-d,l.upperPoint.y),u.path.lineTo(l.upperPoint.x+d,l.upperPoint.y)),r!==void 0&&(u.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-d),u.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+d),u.path.moveTo(r.upperPoint.x,r.upperPoint.y-d),u.path.lineTo(r.upperPoint.x,r.upperPoint.y+d)),u.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},a=e/2,o=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;o.push(new vc(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,r),new vc(s.lowerPoint.x-a,s.lowerPoint.y,e,i.strokeWidth),new vc(s.upperPoint.x-a,s.upperPoint.y,e,i.strokeWidth))}if(n!==void 0){const r=n.upperPoint.x-n.lowerPoint.x;o.push(new vc(n.lowerPoint.x,n.upperPoint.y,r,t.strokeWidth),new vc(n.lowerPoint.x,n.lowerPoint.y-a,i.strokeWidth,e),new vc(n.upperPoint.x,n.upperPoint.y-a,i.strokeWidth,e))}this.bboxes.components=o,this.bboxes.union=vc.merge(o)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=Xd(e,t,s.components);return{nearest:this,distanceSquared:n}}},eq=class extends N.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=DM(e,t,{children:this.children()});if(i!==void 0&&!Number.isNaN(s))return{datum:i.datum,distanceSquared:s}}},rl=class extends X{};g([m],rl.prototype,"visible",2),g([m],rl.prototype,"stroke",2),g([m],rl.prototype,"strokeWidth",2),g([m],rl.prototype,"strokeOpacity",2),g([m],rl.prototype,"lineDash",2),g([m],rl.prototype,"lineDashOffset",2),g([m],rl.prototype,"length",2),g([m],rl.prototype,"lengthRatio",2);var Ms=class extends X{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new rl}};g([m],Ms.prototype,"yLowerKey",2),g([m],Ms.prototype,"yLowerName",2),g([m],Ms.prototype,"yUpperKey",2),g([m],Ms.prototype,"yUpperName",2),g([m],Ms.prototype,"xLowerKey",2),g([m],Ms.prototype,"xLowerName",2),g([m],Ms.prototype,"xUpperKey",2),g([m],Ms.prototype,"xUpperName",2),g([m],Ms.prototype,"visible",2),g([m],Ms.prototype,"stroke",2),g([m],Ms.prototype,"strokeWidth",2),g([m],Ms.prototype,"strokeOpacity",2),g([m],Ms.prototype,"lineDash",2),g([m],Ms.prototype,"lineDashOffset",2),g([m],Ms.prototype,"itemStyler",2),g([m],Ms.prototype,"cap",2);var{fixNumericExtent:tq,groupAccumulativeValueProperty:iq,valueProperty:Fv}=N,sq=class Rm extends hi{constructor(t){super(),this.properties=new Ms;const i=t.series,{annotationGroup:s,annotationSelections:n}=i;this.cartesianSeries=i,this.groupNode=new eq({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=N.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),i.addEventListener("seriesVisibilityChange",a=>this.onToggleSeriesItem(a)),this.cleanup.register(i.events.on("data-processed",a=>this.onDataProcessed(a)),i.events.on("data-update",a=>this.onDataUpdate(a)),t.eventsHub.on("highlight:change",a=>this.onHighlightChange(a)),()=>this.groupNode.remove(),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties;return Mt(t)&&Mt(i)||Mt(s)&&Mt(n)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:o,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=t;return a!=null&&o!=null&&i.push(Fv(a,h,{id:`${l}-lower`}),Fv(o,h,{id:`${l}-upper`})),s!=null&&n!=null&&i.push(Fv(s,c,{id:`${r}-lower`}),Fv(n,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:s}=this,{xLowerKey:n,xUpperKey:a,yLowerKey:o,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=t,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},f=(b,x,v,S)=>iq(b,"normal",{id:`${x}-${v}`,groupId:`errorGroup-${u}-${v}`,...p},S),y=(b,x,v,S)=>{i.push(...f(b,v,"lower",S),...f(x,v,"upper",S))};return o!=null&&r!=null&&y(o,r,c,d),n!=null&&a!=null&&y(n,a,l,h),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:s,xErrorsID:n,yLowerKey:a,yUpperKey:o,yErrorsID:r}=this.getMaybeFlippedKeys();if(t==="x"?Mt(i)&&Mt(s):Mt(a)&&Mt(o)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const u={x:n,y:r}[t],p=c.getDomain(d,`${u}-lower`,"value",h).domain,f=c.getDomain(d,`${u}-upper`,"value",h).domain,y=[Math.min(...p,...f),Math.max(...p,...f)];return tq(y)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,Mt(t.dataModel)&&Mt(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes.x?.scale,s=this.cartesianSeries.axes.y?.scale;if(!(!i||!s||!t))for(let n=0;n<t.length;n++){const{midPoint:a,xLower:o,xUpper:r,yLower:l,yUpper:c}=this.getDatum(t,n);if(a!=null){let h,d;Mt(o)&&Mt(r)&&(h={lowerPoint:{x:this.convert(i,o),y:a.y},upperPoint:{x:this.convert(i,r),y:a.y}}),Mt(l)&&Mt(c)&&(d={lowerPoint:{x:a.x,y:this.convert(s,l)},upperPoint:{x:a.x,y:this.convert(s,c)}}),t[n].xBar=h,t[n].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties,[a,o]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([t,s]=[s,t],[i,n]=[n,i],[a,o]=[o,a]),{xLowerKey:t,xUpperKey:i,xErrorsID:a,yLowerKey:s,yUpperKey:n,yErrorsID:o}}static getDatumKey(t,i,s){if(i==null)return;const a=om(t)?.[i];if(a!=null){if(typeof a!="number"){K.warnOnce(`Found [${i}] error value of type ${typeof a}. Expected number type`);return}return a+s}}getDatum(t,i){const{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:o}=this.getMaybeFlippedKeys(),r=t[i],l=r.cumulativeValue==null||!this.isStacked()?0:r.cumulativeValue-r.yValue,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:Rm.getDatumKey(r,s,c),xUpper:Rm.getDatumKey(r,n,c),yLower:Rm.getDatumKey(r,a,h),yUpper:Rm.getDatumKey(r,o,h)}}convert(t,i){const s=(t.bandwidth??0)/2;return t.convert(i)+s}update(){const t=this.getNodeData();t!=null&&(this.selection.update(t),this.selection.each((i,s,n)=>this.updateNode(i,s,n)))}updateNode(t,i,s){t.datum=i,t.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1,"none"),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:s}=t,n=this.groupNode.pickNode(i,s);if(n!=null)return{datum:n.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t,i){let s,n=[1/0,1/0];const a=[t.x,t.y];i==="y"&&a.reverse();for(const o of this.groupNode.children()){const r=o.getBBox(),l=[r.x+r.width/2,r.y+r.height/2];i==="y"&&l.reverse();const c=[];for(let h=0;h<a.length;h++)c.push(Math.abs(a[h]-l[h]));(c[0]<n[0]||c[0]==n[0]&&c[1]<n[1])&&(s=o.datum,n=c)}if(s)return{datum:s,distanceSquared:Math.pow(n[0],2)+Math.pow(n[1],2)}}getTooltipParams(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n,xLowerName:a=t,xUpperName:o=i,yLowerName:r=s,yUpperName:l=n}=this.properties;return{xLowerKey:t,xLowerName:a,xUpperKey:i,xUpperName:o,yLowerKey:s,yLowerName:r,yUpperKey:n,yUpperName:l}}onToggleSeriesItem(t){this.groupNode.visible=t.visible}makeStyle(t){return{visible:t.visible,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity,cap:re(this.properties.cap,t)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(t,i,s){const n=this.getNodeData();if(n!=null){for(let a=0;a<n.length;a++)if(t===n[a]){this.selection.at(a)?.update(i,this.properties,this.cartesianSeries,s,s?"highlighted-item":"unhighlighted-item");break}}}onHighlightChange(t){const{previousHighlight:i,currentHighlight:s}=t;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new J6}getWhiskerProperties(){const{stroke:t,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties;return{stroke:t,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}}},JA={type:"series:plugin",name:"errorBar",chartType:"cartesian",seriesTypes:["bar","line","scatter"],enterprise:!0,version:ue,options:Cd,themeTemplate:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{lengthRatio:{$if:[{$eq:[{$path:"../../type"},"bar"]},.3,1]}}},create:e=>new sq(e)};function nq(e){for(const t of["x","y"])for(const i of e.axisManager.getAxisContext(t))if(N.BandScale.is(i.scale))return i}var Sc=class extends X{constructor(e){super(),this.ctx=e,this.enabled=!1,this.item="chart",this.color="#cfeeff",this.opacity=1,this.flashDuration=100,this.fadeDuration=900,this.cleanup=new pt,this.element=this.ctx.domManager.addChild("canvas-background","flashOnUpdate"),this.element.role="presentation";let t=!0;const i=s=>{t?t=!1:this.onDataUpdate(s)};this.cleanup.register(this.ctx.eventsHub.on("data:update",i),this.ctx.eventsHub.on("datamodel:diff",s=>this.onDataModelDiff(s)))}destroy(){this.ctx.domManager.removeChild("canvas-background","flashOnUpdate"),this.cleanup.flush()}clearFlash(){this.element.innerHTML="",clearTimeout(this.animationTimeout),this.animationTimeout=void 0}flashElem(e){const{flashDuration:t,fadeDuration:i}=this,s=t+i;e.animate([{background:this.color,offset:0},{background:this.color,offset:t/s},{background:"transparent",offset:1}],{duration:s,easing:"ease-out"})}flashCategoryBands(e){const t=nq(this.ctx);if(!t)return;this.clearFlash();const i=this.computeCategoryFlashBounds(t,e);for(const n of i){const a=ye("div");Pe(a,"role","presentation"),_n(a,"position","absolute"),jd(a,n),this.element.appendChild(a),this.flashElem(a)}const s=this.flashDuration+this.fadeDuration;this.animationTimeout=setTimeout(()=>this.clearFlash(),s)}computeCategories(e){const t=new Set;for(const i of Object.keys(e))for(const s of["updated","added","moved"])for(const n of e[i][s])t.add(n);return t}computeCategoryFlashBounds(e,t){const i=this.ctx.widgets.seriesWidget.getBounds(),s=e.direction==="x"?([o,r])=>({x:i.x+o,y:i.y,width:r-o,height:i.height}):([o,r])=>({x:i.x,y:i.y+o,width:i.width,height:r-o}),n=[],a=this.computeCategories(t);for(const o of a){const r=e.measureBand(o);r?.band&&n.push(s(r.band))}return n}onDataUpdate(e){!this.enabled||this.item!=="chart"||!e||this.flashElem(this.ctx.widgets.containerWidget.getElement())}onDataModelDiff(e){!this.enabled||this.item!=="category"||this.flashCategoryBands(e.diff)}};Sc.className="FlashOnUpdate",g([m],Sc.prototype,"enabled",2),g([m],Sc.prototype,"item",2),g([m],Sc.prototype,"color",2),g([m],Sc.prototype,"opacity",2),g([m],Sc.prototype,"flashDuration",2),g([m],Sc.prototype,"fadeDuration",2);var dz={type:"plugin",name:"flashOnUpdate",enterprise:!0,version:ue,options:{enabled:R,item:eg()("chart","category"),color:te,opacity:ne,flashDuration:P,fadeDuration:P},themeTemplate:{enabled:!1,item:"chart",color:"#cfeeff",opacity:1,flashDuration:100,fadeDuration:900},create:e=>new Sc(e)},{TranslatableGroup:aq}=N,eC=class extends aq{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:n,y:a,width:o,height:r}=t,l=Tc(),c=new l;c.roundRect(n+s,a+s,o-2*s,r-2*s,i),e.clip(c)}};g([$()],eC.prototype,"inset",2),g([$()],eC.prototype,"cornerRadius",2);var{CategoryAxis:oq,Group:_h,BBox:uz,stackCartesianSeries:rq}=N,tC=class{constructor(){this.top=0,this.bottom=0}};g([m],tC.prototype,"top",2),g([m],tC.prototype,"bottom",2);var Dp=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new tC,this.root=new _h({name:"root"}),this.seriesRoot=this.root.appendChild(new eC({name:"Series-root",zIndex:7,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new _h({name:"Axes-Grids",zIndex:2})),this.axisGroup=this.root.appendChild(new _h({name:"Axes-Grids",zIndex:2})),this.axisLabelGroup=this.root.appendChild(new _h({name:"Axes-Labels",zIndex:15})),this.axisCrosslineRangeGroup=this.root.appendChild(new _h({name:"Axes-Crosslines-Range",zIndex:6})),this.axisCrosslineLineGroup=this.root.appendChild(new _h({name:"Axes-Crosslines-Line",zIndex:10})),this.axisCrosslineLabelGroup=this.root.appendChild(new _h({name:"Axes-Crosslines-Label",zIndex:15})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=new N.ChartAxes,this.series=[],this.cleanup.register(this.ctx.eventsHub.on("data:update",t=>this.updateData(t)))}destroy(){this._destroyed||(super.destroy(),this.destroySeries(this.series),this.axes.destroy(),this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(s=>!e.includes(s))??[];this.destroySeries(i);for(const s of e)t?.includes(s)||(s.attachSeries(this.seriesRoot,this.seriesRoot,void 0),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!1}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled"));this.seriesRect=void 0}destroySeries(e){if(e)for(const t of e)t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)}assignAxesToSeries(){const e={};for(const t of this.axes){const i=t.direction;(e[i]??(e[i]=[])).push(t)}for(const t of this.series)for(const i of t.directions){const s=t.getKeyAxis(i)??i,n=this.axes.findById(s);if(!n){K.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}t.axes[i]=n}}updateData(e){for(const t of this.series)t.setChartData(e);this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready";for(const t of this.series)t.resetAnimation("disabled")})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(async t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new Cr;if(!this.enabled)return e;for(const{position:t,thickness:i,line:s,label:n}of this.axes){if(t==null)continue;let a;i?a=i:a=(s.enabled?s.width:0)+(n.enabled?Rn(n.fontSize??0)+n.spacing:0),e[t]=Math.ceil(a)}return e}async layout(e,t){var i;const{padding:s}=this,n=this.seriesRect!=null,a=new uz(0,0,e,t-(s.top+s.bottom)),o=this.seriesRect?.width!==e||this.seriesRect?.height!==t;this.seriesRect=a,this.seriesRoot.translationY=s.top,this.seriesRoot.setClipRectCanvasSpace(new uz(0,-s.top,e,t));for(const r of this.axes){const{position:l="left"}=r;switch(l){case"top":case"bottom":r.range=[0,a.width],r.gridLength=a.height;break;case"right":case"left":{const c=r instanceof oq;r.range=c?[0,a.height]:[a.height,0],r.gridLength=a.width;break}}if(r.gridPadding=0,r.translation.x=0,r.translation.y=0,l==="right"?r.translation.x=e:l==="bottom"&&(r.translation.y=t),n||r.resetAnimation("initial"),r.crossLines)for(const c of r.crossLines)c instanceof N.CartesianCrossLine&&(c.position=r.position??"top",(i=c.label).parallel??(i.parallel=r.label?.parallel));r.calculateLayout(),r.update()}o&&rq(this.series),await Promise.all(this.series.map(async r=>r.update({seriesRect:a})))}};g([m],Dp.prototype,"enabled",2),g([Gt(["seriesRoot","inset"])],Dp.prototype,"inset",2),g([Gt(["seriesRoot","cornerRadius"])],Dp.prototype,"cornerRadius",2),g([_e({changeValue(e,t=new N.ChartAxes){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],Dp.prototype,"axes",2),g([_e({changeValue(e,t){this.onSeriesChange(e,t)}})],Dp.prototype,"series",2);var{SliderWidget:pz}=N,lq=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const n=this.sliders[i];n.step=pz.STEP_HUNDRETH,n.keyboardStep=pz.STEP_ONE,n.orientation="horizontal",n.setPreventsDefault(!1),n.addListener("drag-start",a=>this.onDragStart(i,a,s)),n.addListener("drag-move",a=>this.onDrag(n,a,s)),n.addListener("drag-end",()=>this.updateSliderRatios()),n.addListener("contextmenu",a=>this.onContextMenu(n,a))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;e==null||t==null||this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"navigatorDOM"},{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(e*100)/100,t=Math.round(t*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const s=this.sliders[e],n=this.toolbar.cssLeft(),a=s.cssLeft();this.dragStartX=n+a+t.offsetX,this.moveToFront(e),t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:s}=t,{x:n,y:a}=this.toolbar.getBounds(),{x:o,y:r}=e.getBounds(),l=i+n+o,c=s+a+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=ae(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{BBox:cq,ExtendedPath2D:hq}=N,Mc=class extends N.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new hq}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,s,n,a,o,r,l){const c=e.align(i+n*o)+l,h=c+e.align(i+n*o,n*(r-o))-2*l,d=e.align(s+a/2);e.setCenter(c,d),t.setCenter(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this,n=e-i/2,a=t-s/2;return new cq(n,a,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:n,cornerRadius:a,grip:o}=this,r=n/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(e-c+r,t-h+r,2*(c-r),2*(h-r),a);const d=3;if(o)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(e+u*d,t+p*d,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};Mc.className="RangeHandle",g([m,$()],Mc.prototype,"width",2),g([m,$()],Mc.prototype,"height",2),g([m,$()],Mc.prototype,"cornerRadius",2),g([m,$()],Mc.prototype,"grip",2);var{Path:dq,BBox:iC,ExtendedPath2D:uq,clippedRoundRect:pq}=N,sC=class extends dq{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new uq}layout(e,t,i,s,n,a){n=Number.isNaN(n)?this.min:n,a=Number.isNaN(a)?this.max:a,(e!==this.x||t!==this.y||i!==this.width||this.height!==s||n!==this.min||a!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=s,this.min=n,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new iC(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:n,max:a}=this,o=e+i*n,r=e+i*a;return new iC(o,t,r-o,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:n,height:a,min:o,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const d=this.align(i)+h,u=this.align(s)+h,p=this.align(i,n)-2*h,f=this.align(s,a)-2*h,y=this.align(i+n*o)+h,b=y+this.align(i+n*o,n*(r-o))-2*h,x={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},v=(S,M,D)=>{if(D-M<1)return;const I=new iC(M,u,D-M,f);pq(S,d,u,p,f,x,I)};v(e,d,y),v(e,b,p+d),v(t,y,b)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};sC.className="RangeMask",g([m,$()],sC.prototype,"cornerRadius",2);var gq=class extends N.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:17}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new N.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,n,a){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=n,this.rOffset=a,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){e?.remove(),t!=null&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:n,rOffset:a}=this;return new N.BBox(e-n,t,i+(n+a),s)}},kp=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new sC,this.minHandle=new Mc,this.maxHandle=new Mc,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new gq([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",()=>this.updateZoom()),e.layoutManager.registerElement(N.LayoutElement.Navigator,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",t=>this.onZoomChange(t))),this.domProxy=new lq(e,this),this.updateGroupVisibility(),this.miniChart=new Dp(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"navigator"},{x:{min:0,max:1}}))}onLayoutStart({layoutBox:e}){if(this.enabled){const t=this.height+this.spacing;e.shrink(t,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:a,_max:o}=this.domProxy;this.layoutNodes(t,s,i,n,a,o),this.domProxy.updateBounds({x:t,y:s,width:i,height:n})}this.x=t,this.width=i,this.miniChart?.layout(i,n).catch(a=>K.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(N.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:n}=this,{minRange:a}=this.domProxy;let{_min:o,_max:r}=this.domProxy;const l=(t-s)/n;if(e==="min")o=ae(0,l,r-a);else if(e==="max")r=ae(o+a,l,1);else if(e==="pan"&&i!=null){const c=r-o;o=ae(0,l-i,1-c),r=o+c}this.domProxy._min=o,this.domProxy._max=r,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:n,height:a}=this,{min:o,max:r}=t;this.domProxy.updateMinMax(o,r),this.layoutNodes(i,s,n,a,o,r)}layoutNodes(e,t,i,s,n,a){const{rangeSelector:o,mask:r,minHandle:l,maxHandle:c}=this;r.layout(e,t,i,s,n,a),o.layout(e,t,i,s,l.width/2,c.width/2),Mc.align(l,c,e,t,i,s,n,a,r.strokeWidth/2),n+(a-n)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3);for(const[h,d]of[l,this.maskVisibleRange,c].entries()){const u=d.getBBox(),p={x:u.x-e,y:u.y-t,height:u.height,width:u.width};this.domProxy.updateSliderBounds(h,p)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}async processData(e){return this.miniChart?.processData(e)}};g([Xt((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],kp.prototype,"miniChart",2),g([m,Xt((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],kp.prototype,"enabled",2),g([m],kp.prototype,"height",2),g([m,Xt((e,t)=>{e.mask.cornerRadius=t})],kp.prototype,"cornerRadius",2),g([m],kp.prototype,"spacing",2);function fq(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function mq(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{Path:yq,Scalable:xq,ExtendedPath2D:bq,BBox:Hh,clippedRoundRect:gz}=N,ji=class extends xq(yq){constructor(){super(...arguments),this.wickPath=new bq,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:e,center:t,thickness:i,min:s,max:n}=this;return e?new Hh(Math.min(s,n),t-i/2,Math.abs(n-s),i):new Hh(t-i/2,Math.min(s,n),i,Math.abs(n-s))}computeDefaultGradientFillBBox(){const{horizontal:e,center:t,thickness:i,q1:s,q3:n}=this;return e?new Hh(Math.min(s,n),t-i/2,Math.abs(n-s),i):new Hh(t-i/2,Math.min(s,n),i,Math.abs(n-s))}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:e,crisp:t}=this;let{center:i,min:s,q1:n,median:a,q3:o,max:r}=this,l=i-e/2,c=i+e/2;if(t&&e>1){s=this.align(s),n=this.align(n),a=this.align(a),o=this.align(o),r=s+this.align(s,r-s);const h=this.align(e/2);i=this.align(i),l=i-h,c=i+h}return{center:i,x0:l,x1:c,min:s,max:r,q1:n,median:a,q3:o}}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,wickStroke:o,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d,cornerRadius:u,capLengthRatio:p,horizontal:f}=this,{center:y,x0:b,x1:x,min:v,max:S,q1:M,median:D,q3:I}=this.alignedCoordinates(),k=this.layerManager?.canvas.pixelRatio??1,C=this.wickStrokeAlignment>0?k/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const w=o!=null&&o!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==a?this.wickPath:e;if(Math.abs(x-b)<=3){Ip(w,f,y,v),Ap(w,f,y,S);return}const T=Math.min(v,S),O=Math.max(v,S),z=Math.min(M,I),V=Math.max(M,I),E=y-Math.abs((x-b)*p)/2,_=y+Math.abs((x-b)*p)/2;Ip(w,f,E,T-C),Ap(w,f,_,T-C),Ip(w,f,y-C,T-C),Ap(w,f,y-C,z+i/2),Ip(w,f,y-C,O+C),Ap(w,f,y-C,V-i/2),Ip(w,f,E,O+C),Ap(w,f,_,O+C);const G=i/2+d,B=i/2-d,F=V-z-2*B;if(F>0){const Y=b+G,Z=z+B,ie=x-b-2*G,ee={topLeft:u,topRight:u,bottomRight:u,bottomLeft:u};fz(e,f,Y,Z,ie,F,ee,new Hh(Y,Z,ie,D-Z)),fz(e,f,Y,Z,ie,F,ee,new Hh(Y,D,ie,Z+F-D))}else{const Y=(z+V)/2;Ip(e,f,b,Y),Ap(e,f,x,Y)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=n,wickLineDash:h=a,wickLineDashOffset:d=o}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};g([$()],ji.prototype,"horizontal",2),g([$()],ji.prototype,"center",2),g([$()],ji.prototype,"thickness",2),g([$()],ji.prototype,"min",2),g([$()],ji.prototype,"q1",2),g([$()],ji.prototype,"median",2),g([$()],ji.prototype,"q3",2),g([$()],ji.prototype,"max",2),g([$()],ji.prototype,"cornerRadius",2),g([$()],ji.prototype,"crisp",2),g([$()],ji.prototype,"strokeAlignment",2),g([$()],ji.prototype,"wickStroke",2),g([$()],ji.prototype,"wickStrokeWidth",2),g([$()],ji.prototype,"wickStrokeOpacity",2),g([hu()],ji.prototype,"wickLineDash",2),g([$()],ji.prototype,"wickLineDashOffset",2),g([$()],ji.prototype,"capLengthRatio",2),g([$()],ji.prototype,"wickStrokeAlignment",2);function Ip(e,t,i,s){t?e.moveTo(s,i):e.moveTo(i,s)}function Ap(e,t,i,s){t?e.lineTo(s,i):e.lineTo(i,s)}function fz(e,t,i,s,n,a,o,r){t?gz(e,s,i,a,n,o,r==null?void 0:new Hh(r.y,r.x,r.height,r.width)):gz(e,i,s,n,a,o,r)}var{AbstractBarSeriesProperties:vq,makeSeriesTooltip:Sq}=N,mz=class extends X{constructor(){super(...arguments),this.lengthRatio=.5}};g([m],mz.prototype,"lengthRatio",2);var Cp=class extends X{};g([m],Cp.prototype,"stroke",2),g([m],Cp.prototype,"strokeWidth",2),g([m],Cp.prototype,"strokeOpacity",2),g([m],Cp.prototype,"lineDash",2),g([m],Cp.prototype,"lineDashOffset",2);var Nt=class extends vq{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new mz,this.whisker=new Cp,this.tooltip=Sq()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:n}=this,a=super.toJson();return a.whisker=re(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:n}),a}};g([m],Nt.prototype,"xKey",2),g([m],Nt.prototype,"minKey",2),g([m],Nt.prototype,"q1Key",2),g([m],Nt.prototype,"medianKey",2),g([m],Nt.prototype,"q3Key",2),g([m],Nt.prototype,"maxKey",2),g([m],Nt.prototype,"xName",2),g([m],Nt.prototype,"yName",2),g([m],Nt.prototype,"minName",2),g([m],Nt.prototype,"q1Name",2),g([m],Nt.prototype,"medianName",2),g([m],Nt.prototype,"q3Name",2),g([m],Nt.prototype,"maxName",2),g([m],Nt.prototype,"fill",2),g([m],Nt.prototype,"fillOpacity",2),g([m],Nt.prototype,"stroke",2),g([m],Nt.prototype,"strokeWidth",2),g([m],Nt.prototype,"strokeOpacity",2),g([m],Nt.prototype,"lineDash",2),g([m],Nt.prototype,"lineDashOffset",2),g([m],Nt.prototype,"cornerRadius",2),g([m],Nt.prototype,"styler",2),g([m],Nt.prototype,"itemStyler",2),g([m],Nt.prototype,"cap",2),g([m],Nt.prototype,"whisker",2),g([m],Nt.prototype,"tooltip",2);var{fixNumericExtent:Mq,keyProperty:Dq,SeriesNodePickMode:yz,SMALLEST_KEY_INTERVAL:kq,valueProperty:lm,diff:Iq,animationValidation:Aq,computeBarFocusBounds:Cq,createDatumId:xz,HighlightState:nC,motion:bz,getItemStyles:wq,calculateSegments:Lq,toHighlightString:Nq,processedDataIsAnimatable:Tq,upsertNodeDatum:Oq}=N,Pq=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},aC=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[yz.NEAREST_NODE,yz.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new Nt,this.NodeEvent=Pq}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:n,q3Key:a,maxKey:o}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];this.needsDataModelDiff()&&this.processedData&&p.push(Iq(this.id,this.processedData)),r&&p.push(Aq());const f=this.properties.allowNullKeys??!1,{processedData:y}=await this.requestDataModel(e,this.data,{props:[Dq(t,d,{id:"xValue",allowNullKey:f}),lm(i,u,{id:"minValue"}),lm(s,u,{id:"q1Value"}),lm(n,u,{id:"medianValue"}),lm(a,u,{id:"q3Value"}),lm(o,u,{id:"maxValue"}),...h?[kq]:[],...p]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{index:n,def:a}=i.resolveProcessedDataDefById(this,"xValue"),o=t.domain.keys[n];if(a.type==="key"&&a.valueType==="category"){const r=i.getKeySortMetadata(this,"xValue",t);return{domain:o,sortMetadata:r}}return{domain:this.padBandExtent(o)}}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return{domain:Mq(s)}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["maxValue","minValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:n}=this;if(!i||!s)return;const a=n?.nodeData!=null&&s.changeDescription!=null,o=!this.ctx.animationManager.isSkipped(),{groupOffset:r,barOffset:l,barWidth:c}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:s.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",s),minValues:i.resolveColumnById(this,"minValue",s),q1Values:i.resolveColumnById(this,"q1Value",s),medianValues:i.resolveColumnById(this,"medianValue",s),q3Values:i.resolveColumnById(this,"q3Value",s),maxValues:i.resolveColumnById(this,"maxValue",s),xScale:e.scale,yScale:t.scale,groupOffset:r,barOffset:l,barWidth:c,isVertical:this.isVertical(),xKey:this.properties.xKey,animationEnabled:o,canIncrementallyUpdate:a,nodes:a?n.nodeData:[],nodeIndex:0}}validateBoxPlotValues(e,t,i,s,n){return[e,t,i,s,n].every(a=>typeof a=="number")&&e<=t&&t<=i&&i<=s&&s<=n}computeScaledValues(e,t,i){const s=e.xScale.convert(e.xValues[i]);return Number.isFinite(s)?(t.xValue=s+e.groupOffset+e.barOffset+e.barWidth/2,t.minValue=e.yScale.convert(e.minValues[i]),t.q1Value=e.yScale.convert(e.q1Values[i]),t.medianValue=e.yScale.convert(e.medianValues[i]),t.q3Value=e.yScale.convert(e.q3Values[i]),t.maxValue=e.yScale.convert(e.maxValues[i]),!0):!1}createSkeletonNodeDatum(e,t){return{series:this,datum:t.datum,datumIndex:t.datumIndex,xKey:e.xKey,bandwidth:e.barWidth,scaledValues:{xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},midPoint:{x:0,y:0},focusRect:{x:0,y:0,width:0,height:0}}}updateNodeDatum(e,t,i){const{isVertical:s,barWidth:n}=e,a=i.scaledValues,o=t;o.datum=i.datum,o.datumIndex=i.datumIndex,o.bandwidth=n;const r=o.scaledValues;r.xValue=a.xValue,r.minValue=a.minValue,r.q1Value=a.q1Value,r.medianValue=a.medianValue,r.q3Value=a.q3Value,r.maxValue=a.maxValue;const l=Math.abs(a.q3Value-a.q1Value),c=a.xValue,h=Math.min(a.q3Value,a.q1Value)+l/2,d=s?c:h,u=s?h:c;o.midPoint?(o.midPoint.x=d,o.midPoint.y=u):o.midPoint={x:d,y:u};const p=o.focusRect;s?(p.x=d-n/2,p.y=a.minValue,p.width=n,p.height=a.maxValue-a.minValue):(p.x=a.minValue,p.y=u-n/2,p.width=a.maxValue-a.minValue,p.height=n)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}initializeResult(e){return{itemId:this.properties.xKey,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),visible:this.visible,groupScale:void 0,styles:void 0,segments:void 0}}populateNodeData(e){const t={xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},i={datumIndex:0,datum:void 0,scaledValues:t};for(let s=0;s<e.rawData.length;s++){const n=e.rawData[s];if(e.xValues[s]===void 0&&!this.properties.allowNullKeys)continue;const o=e.minValues[s],r=e.q1Values[s],l=e.medianValues[s],c=e.q3Values[s],h=e.maxValues[s];this.validateBoxPlotValues(o,r,l,c,h)&&this.computeScaledValues(e,t,s)&&(i.datumIndex=s,i.datum=n,Oq(e,i,(d,u)=>this.createNodeDatum(d,u),(d,u,p)=>this.updateNodeDatum(d,u,p)))}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}assembleResult(e,t){const i=Lq(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene);return t.groupScale=this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),t.styles=wq(this.getItemStyle.bind(this)),t.segments=i,t}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.getStyle(!1,nC.None);return{marker:{fill:Te(e),fillOpacity:s,stroke:t,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:o,legendItemName:r}=this.properties;return!n||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:r??a??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!o}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:f,minName:y,maxKey:b,maxName:x,legendItemName:v,tooltip:S}=n,M=this.getCategoryAxis(),D=this.getValueAxis();if(!i||!s||!M||!D)return;const I=s.dataSources.get(this.id)?.data[e],k=i.resolveKeysById(this,"xValue",s)[e],C=i.resolveColumnById(this,"minValue",s)[e],A=i.resolveColumnById(this,"q1Value",s)[e],w=i.resolveColumnById(this,"medianValue",s)[e],T=i.resolveColumnById(this,"q3Value",s)[e],O=i.resolveColumnById(this,"maxValue",s)[e],z=this.properties.allowNullKeys??!1;if(k===void 0&&!z)return;const V=this.getItemStyle(e,!1),E=[{label:y,fallbackLabel:f,value:this.getAxisValueText(D,"tooltip",C,I,f,v),missing:N.isTooltipValueMissing(C)},{label:d,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",A,I,h,v),missing:N.isTooltipValueMissing(A)},{label:c,fallbackLabel:l,value:this.getAxisValueText(D,"tooltip",w,I,l,v),missing:N.isTooltipValueMissing(w)},{label:p,fallbackLabel:u,value:this.getAxisValueText(D,"tooltip",T,I,u,v),missing:N.isTooltipValueMissing(T)},{label:x,fallbackLabel:b,value:this.getAxisValueText(D,"tooltip",O,I,b,v),missing:N.isTooltipValueMissing(O)}];return this.formatTooltipWithContext(S,{heading:this.getAxisValueText(M,"tooltip",k,I,a,v),title:v??r,symbol:this.legendItemSymbol(),data:E},{seriesId:t,datum:I,title:r,xKey:a,xName:o,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:f,minName:y,maxKey:b,maxName:x,...V})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=fq(t);bz.resetMotion([e],mq(t)),bz.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return Tq(this.processedData)?e.datumSelection.update(t,void 0,i=>xz(i.datumIndex)):e.datumSelection.update(t)}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,cap:{lengthRatio:s},fill:n,fillOpacity:a,lineDash:o,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,maxKey:d,maxName:u,medianKey:p,medianName:f,minKey:y,minName:b,q1Key:x,q1Name:v,q3Key:S,q3Name:M,whisker:{lineDash:D,lineDashOffset:I,stroke:k,strokeOpacity:C,strokeWidth:A},xKey:w,xName:T,yName:O}=this.properties,z=Nq(e??nC.None);return{cap:{lengthRatio:s},cornerRadius:i,fill:n,fillOpacity:a,highlightState:z,lineDash:o,lineDashOffset:r,maxKey:d,maxName:u??d,medianKey:p,medianName:f??p,minKey:y,minName:b??y,q1Key:x,q1Name:v??x,q3Key:S,q3Name:M??S,seriesId:t,stroke:l,strokeOpacity:c,strokeWidth:h,whisker:{lineDash:D??o,lineDashOffset:I??r,stroke:k??l,strokeOpacity:C??c,strokeWidth:A??h},xKey:w,xName:T??w,yName:O}}getStyle(e,t){const{cap:i,cornerRadius:s,fill:n,fillOpacity:a,lineDash:o,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,styler:d,whisker:u}=this.properties;let p={};if(!e&&d){const f=this.makeStylerParams(t);p=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(d,f)??{},{pick:!1})??{}}return{cornerRadius:p.cornerRadius??s,fill:p.fill??n,fillOpacity:p.fillOpacity??a,lineDash:p.lineDash??o,lineDashOffset:p.lineDashOffset??r,opacity:1,stroke:p.stroke??l,strokeOpacity:p.strokeOpacity??c,strokeWidth:p.strokeWidth??h,cap:{lengthRatio:p.cap?.lengthRatio??i.lengthRatio},whisker:{lineDash:p.whisker?.lineDash??u.lineDash,lineDashOffset:p.whisker?.lineDashOffset??u.lineDashOffset,stroke:p.whisker?.stroke??u.stroke,strokeOpacity:p.whisker?.strokeOpacity??u.strokeOpacity,strokeWidth:p.whisker?.strokeWidth??u.strokeWidth}}}getItemStyle(e,t,i){const{properties:s}=this,{itemStyler:n}=s,a=this.getHighlightStyle(t,e,i);let o=re(a,this.getStyle(e===void 0,i));if(n!=null&&e!=null){const u=this.cachedDatumCallback(xz(e,t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,t,o);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(n,p))});u&&(o=re(u,o))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=o;return o.whisker=re(o.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}),o}makeItemStylerParams(e,t,i){const{id:s}=this,{xKey:n,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:c}=this.properties,h=this.processedData?.dataSources.get(s)?.data[e],d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,t,e),p=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:h,xKey:n,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:c,highlightState:u,...i,fill:p}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,n)=>{const a=this.getHighlightState(i,t,n.datumIndex);n.style=this.getItemStyle(n.datumIndex,t,a)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const n=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getShapeFillBBox(),r=this.getStyle(!1,nC.None).strokeWidth/2,l=s.whisker.strokeWidth??s.strokeWidth;e.each((c,h)=>{const d=h.style??i.styles[this.getHighlightState(a,t,h.datumIndex)];c.setFillProperties(d.fill,o);const u=d.opacity??1,p=d.whisker?.strokeOpacity??d.strokeOpacity;c.fill=d.fill,c.fillOpacity=d.fillOpacity*u,c.stroke=d.stroke,c.strokeWidth=d.strokeWidth,c.strokeOpacity=d.strokeOpacity*u,c.lineDash=d.lineDash,c.lineDashOffset=d.lineDashOffset,c.wickStroke=d.whisker.stroke,c.wickStrokeWidth=d.whisker.strokeWidth,c.wickStrokeOpacity=p*u,c.wickLineDash=d.whisker.lineDash,c.wickLineDashOffset=d.whisker.lineDashOffset,c.cornerRadius=d.cornerRadius,c.crisp=!0,c.horizontal=!n,c.center=h.scaledValues.xValue,c.thickness=h.bandwidth,c.min=h.scaledValues.minValue,c.q1=h.scaledValues.q1Value,c.median=h.scaledValues.medianValue,c.q3=h.scaledValues.q3Value,c.max=h.scaledValues.maxValue,c.capLengthRatio=d.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new ji}computeFocusBounds({datumIndex:e}){return Cq(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};aC.className="BoxPlotSeries",aC.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:Eq}=N,Rq={...qe,...Eq,type:j(Ae("box-plot")),xKey:j(L),minKey:j(L),q1Key:j(L),medianKey:j(L),q3Key:j(L),maxKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,minName:L,q1Name:L,medianName:L,q3Name:L,maxName:L,grouped:R,legendItemName:L,segmentation:fo,width:gn,widthRatio:ne},zq={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[_0,{$ref:"chartBackgroundColor"},.7]}]},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:{unhighlightedItem:{opacity:.5},unhighlightedSeries:{opacity:.1}},segmentation:vl},axes:{number:{crosshair:{snap:!1}},category:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{predictCartesianNonPrimitiveAxis:Vq}=N,oC={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,groupable:!0,version:ue,dependencies:[ri],options:Rq,matchingKeys:["xKey","lowKey","q1Key","medianKey","q3Key","highKey","outlierKey","normalizedTo"],predictAxis:Vq,defaultAxes:Ld,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:zq,create:e=>new aC(e)};function Bq(e,t,i,s,n,a,o,r){const[l,c]=oi(e,n);return vr([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var Fq=Ar(Bq);function _q(e,t,i,s,n){const a=t.resolveKeysById(s,"xValue",i),o=t.resolveColumnById(s,"highValue",i),r=t.resolveColumnById(s,"lowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i);if(n){const[d,u]=oi(e,l);return vr([d,u],a,o,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:n})}return Fq(e,a,o,r,l,i.reduced?.smallestKeyInterval,c,h)}function Hq(e,t,i,s,n,a){const o=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"highValue",i),l=t.resolveColumnById(s,"lowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i),[u,p]=oi(e,c);return Dg([u,p],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:n,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:a})}var{Path:Gq,BBox:jq}=N,ll=class extends Gq{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}setStaticProperties(e,t,i,s,n,a,o){this.__centerX=e,this.__width=t,this.__y=i,this.__height=s,this.__yOpen=n,this.__yClose=a,this.__crisp=o,this.dirtyPath=!0,this.markDirty()}computeBBox(){const{__centerX:e,__y:t,__width:i,__height:s}=this;return new jq(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.__centerX,y:this.__y+this.__height/2}}alignedCoordinates(){const{__y:e,__width:t,__height:i,__crisp:s}=this;let{__centerX:n,__yOpen:a,__yClose:o}=this,r=n-t/2,l=n+t/2,c=e,h=e+i;if(s&&t>1){if(n=this.align(n),a<=o){const u=this.align(a,o-a);a=this.align(a),o=a+u}else{const u=this.align(o,a-o);o=this.align(o),a=o+u}const d=this.align(t/2);r=n-d,l=n+d,c=this.align(e),h=c+this.align(c,i)}return{centerX:n,x0:r,x1:l,y0:c,y1:h,yOpen:a,yClose:o}}executeStroke(e,t){const{__width:i,strokeWidth:s}=this;i<s&&(e.lineWidth=i),super.executeStroke(e,t)}};g([Ee()],ll.prototype,"centerX",2),g([Ee()],ll.prototype,"y",2),g([Ee()],ll.prototype,"width",2),g([Ee()],ll.prototype,"height",2),g([Ee()],ll.prototype,"yOpen",2),g([Ee()],ll.prototype,"yClose",2),g([Ee()],ll.prototype,"crisp",2);var vz=class extends ll{constructor(){super(...arguments),this.strokeAlignment=0}updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:s,y0:n,y1:a,yOpen:o,yClose:r}=this.alignedCoordinates(),l=this.layerManager?.canvas.pixelRatio??1,c=this.__strokeAlignment>0?l/this.__strokeAlignment/2%1:0;e.clear(),e.moveTo(t-c,n),e.lineTo(t-c,a),Math.abs(s-i)>1&&(e.moveTo(i,o-c),e.lineTo(t-c,o-c),e.moveTo(t-c,r-c),e.lineTo(s,r-c))}};g([Ee()],vz.prototype,"strokeAlignment",2);var Wq=Ys,$q=qs,Kq=Xs,Sz=Zs,Mz=Vn,{AggregationManager:Uq,fixNumericExtent:Yq,keyProperty:Zq,createDatumId:rC,SeriesNodePickMode:Dz,SMALLEST_KEY_INTERVAL:Xq,valueProperty:_v,diff:qq,animationValidation:Qq,computeBarFocusBounds:Jq,visibleRangeIndices:kz,BandScale:e9,processedDataIsAnimatable:lC,getItemStylesPerItemId:t9}=N,i9=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}};function s9(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const n of i){const a=n.datum;a!=null&&n.setStaticProperties(a.centerX,a.width,a.y,a.height,a.yOpen,a.yClose,a.crisp)}t.cleanup()})}}var Iz=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Dz.AXIS_ALIGNED,Dz.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=i9,this.aggregationManager=new Uq}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:n,lowKey:a}=this.properties,o=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];this.needsDataModelDiff()&&this.processedData&&u.push(qq(this.id,this.processedData)),o&&u.push(Qq()),i&&u.push(_v(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const p=this.properties.allowNullKeys??!1,{dataModel:f,processedData:y}=await this.requestDataModel(e,this.data,{props:[Zq(t,h,{id:"xValue",allowNullKey:p}),_v(s,d,{id:"closeValue"}),_v(n,d,{id:"highValue"}),_v(a,d,{id:"lowValue"}),...c?[Xq]:[],...u]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.aggregateData(f,y),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||lC(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>Hq(i.scale.type,e,t,this,s,a),computeFull:a=>_q(i.scale.type,e,t,this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ha.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(!e)return-1;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{def:n}=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return n.type==="key"&&n.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}const s=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return{domain:Yq(s)}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["highValue","lowValue"],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}buildDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources.get(this.id)?.data??[];if(n.length===0)return;const a=e.scale,o=t.scale,r=e9.is(a),[l,c]=a.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const d=this.aggregationManager.getFilterForRange(h),u=d==null,p=this.contextNodeData?.nodeData!=null&&(s.changeDescription!=null||!lC(s)||d!=null),{groupOffset:f,barWidth:y}=this.getBarDimensions();return{rawData:n,xValues:i.resolveKeysById(this,"xValue",s),openValues:i.resolveColumnById(this,"openValue",s),closeValues:i.resolveColumnById(this,"closeValue",s),highValues:i.resolveColumnById(this,"highValue",s),lowValues:i.resolveColumnById(this,"lowValue",s),xScale:a,yScale:o,xAxis:e,yAxis:t,groupOffset:f,barWidth:y,applyWidthOffset:r,crisp:u,xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey,dataAggregationFilter:d,range:h,nodeDatumStateScratch:{datum:void 0,xValue:void 0,openValue:0,closeValue:0,highValue:0,lowValue:0,isRising:!0,itemType:"up"},canIncrementallyUpdate:p,nodeIndex:0,nodeData:p?this.contextNodeData.nodeData:[]}}prepareOhlcNodeDatumState(e,t){const i=e.xValues[t];if(i===void 0&&!this.properties.allowNullKeys)return;const s=e.openValues[t],n=e.closeValues[t],a=e.highValues[t],o=e.lowValues[t],r=o!=null&&o<=s&&o<=n,l=a!=null&&a>=s&&a>=n;if(!r){K.warnOnce(`invalid low value for key [${e.lowKey}] in data element, low value cannot be higher than datum open or close values`);return}if(!l){K.warnOnce(`invalid high value for key [${e.highKey}] in data element, high value cannot be lower than datum open or close values.`);return}const c=e.rawData[t],h=n>s,d=h?"up":"down",u=e.nodeDatumStateScratch;return u.datum=c,u.xValue=i,u.openValue=s,u.closeValue=n,u.highValue=a,u.lowValue=o,u.isRising=h,u.itemType=d,u}createSkeletonNodeDatum(e,t,i,s,n,a){const o=e.applyWidthOffset?n/2:0,r=s+o,l=e.yScale.convert(t.openValue),c=e.yScale.convert(t.closeValue),h=e.yScale.convert(t.highValue),d=e.yScale.convert(t.lowValue),u=Math.min(h,d),p=Math.max(h,d)-u;return{series:this,itemType:t.itemType,datum:t.datum,datumIndex:i,xKey:e.xKey,xValue:t.xValue,openValue:t.openValue,closeValue:t.closeValue,highValue:t.highValue,lowValue:t.lowValue,midPoint:{x:r,y:u+p/2},aggregatedValue:t.closeValue,isRising:t.isRising,centerX:r,width:n,y:u,height:p,yOpen:l,yClose:c,crisp:a}}updateNodeDatum(e,t,i,s,n,a,o){const r=t,l=e.applyWidthOffset?a/2:0,c=n+l,h=e.yScale.convert(i.openValue),d=e.yScale.convert(i.closeValue),u=e.yScale.convert(i.highValue),p=e.yScale.convert(i.lowValue),f=Math.min(u,p),y=Math.max(u,p)-f;r.datum=i.datum,r.datumIndex=s,r.itemType=i.itemType,r.xValue=i.xValue,r.openValue=i.openValue,r.closeValue=i.closeValue,r.highValue=i.highValue,r.lowValue=i.lowValue,r.aggregatedValue=i.closeValue,r.isRising=i.isRising,r.centerX=c,r.width=a,r.y=f,r.height=y,r.yOpen=h,r.yClose=d,r.crisp=o;const b=r.midPoint;b.x=c,b.y=f+y/2}upsertNodeDatum(e,t,i,s,n){const a=this.prepareOhlcNodeDatumState(e,t);if(!a)return;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodeData.length)this.updateNodeDatum(e,e.nodeData[e.nodeIndex],a,t,i,s,n);else{const r=this.createSkeletonNodeDatum(e,a,t,i,s,n);e.nodeData.push(r)}e.nodeIndex++}createNodeData(){const{visible:e}=this,t=this.getCategoryAxis(),i=this.getValueAxis();if(!t||!i)return;const s=this.buildDatumContext(t,i),n={itemId:this.properties.xKey,nodeData:s?.nodeData??[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:t9(this.getItemStyle.bind(this),"up","down")};if(!e||!s)return n;const a=o=>{const r=s.xScale.convert(s.xValues[o]);return Number.isFinite(r)?r+s.groupOffset:Number.NaN};if(s.dataAggregationFilter==null){const o=this.processedData.invalidData?.get(this.id);let[r,l]=kz(1,s.rawData.length,s.xAxis.range,c=>{const h=s.applyWidthOffset?0:-s.barWidth/2,d=a(c)+h;return[d,d+s.barWidth]});this.processedData.input.count<1e3&&(r=0,l=this.processedData.input.count);for(let c=r;c<l;c+=1){if(o?.[c]===!0)continue;const h=a(c);this.upsertNodeDatum(s,c,h,s.barWidth,s.crisp)}s.canIncrementallyUpdate&&s.nodeIndex<s.nodeData.length&&(s.nodeData.length=s.nodeIndex)}else{const{maxRange:o,indexData:r,midpointIndices:l}=s.dataAggregationFilter,[c,h]=kz(1,o,s.xAxis.range,d=>{const u=d*Mz,p=r[u+Sz],f=l[d];if(f===-1)return;const y=s.applyWidthOffset?0:-s.barWidth/2;return[a(f)+y,a(p)+y+s.barWidth]});for(let d=c;d<h;d+=1){const u=d*Mz,p=r[u+Wq],f=r[u+Sz],y=r[u+$q],b=r[u+Kq],x=l[d];if(x===-1)continue;const v=this.prepareOhlcNodeDatumState(s,x);if(!v)continue;v.openValue=s.openValues[p],v.closeValue=s.closeValues[f],v.highValue=s.highValues[y],v.lowValue=s.lowValues[b],v.isRising=v.closeValue>v.openValue,v.itemType=v.isRising?"up":"down";const S=a(x),M=Math.abs(a(f)-a(p))+s.barWidth;if(s.canIncrementallyUpdate&&s.nodeIndex<s.nodeData.length)this.updateNodeDatum(s,s.nodeData[s.nodeIndex],v,x,S,M,!1);else{const I=this.createSkeletonNodeDatum(s,v,x,S,M,!1);s.nodeData.push(I)}s.nodeIndex++}s.canIncrementallyUpdate&&s.nodeIndex<s.nodeData.length&&(s.nodeData.length=s.nodeIndex)}return n}isVertical(){return!0}isLabelEnabled(){return!1}resetDatumAnimation(e){s9([e.datumSelection])}updateDatumSelection(e){const t=e.nodeData??[];return lC(this.processedData)?e.datumSelection.update(t,void 0,i=>rC(i.xValue)):e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemStyle(e,t,i,s="up"){const{properties:n,dataModel:a,processedData:o}=this,{itemStyler:r}=n,l=this.getHighlightStyle(t,e,i);let h=re(l,n.getStyle(s));if(r&&a!=null&&o!=null&&e!=null){const d=a.resolveKeysById(this,"xValue",o)[e],u=this.cachedDatumCallback(rC(rC(d),t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(s,e,t,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",s],this.callWithContext(r,p))});u&&(h=re(u,h))}return h}makeItemStylerParams(e,t,i,s){const{id:n,properties:a,processedData:o}=this,{xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:d}=a,u=o.dataSources.get(n)?.data[t],p=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(p,i,t),y={seriesId:n,datum:u,itemType:e,xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:d,highlightState:f,...s};return"fill"in y&&"fill"in s&&(y.fill=this.filterItemStylerFillParams(s.fill)??s.fill),y}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:f,closeName:y,legendItemName:b,tooltip:x}=n,v=this.getCategoryAxis(),S=this.getValueAxis();if(!i||!s||!v||!S)return;const M=s.dataSources.get(this.id)?.data[e],D=i.resolveKeysById(this,"xValue",s)[e],I=i.resolveColumnById(this,"openValue",s)[e],k=i.resolveColumnById(this,"highValue",s)[e],C=i.resolveColumnById(this,"lowValue",s)[e],A=i.resolveColumnById(this,"closeValue",s)[e],w=this.properties.allowNullKeys??!1;if(D===void 0&&!w)return;const T=A>=I?"up":"down",O=this.properties.item[T],z=this.getItemStyle(e,!1),V={fill:O.fill??O.stroke,fillOpacity:O.fillOpacity??O.strokeOpacity??1,stroke:O.stroke,strokeWidth:O.strokeWidth??1,strokeOpacity:O.strokeOpacity??1,lineDash:O.lineDash??[0],lineDashOffset:O.lineDashOffset??0};return this.formatTooltipWithContext(x,{heading:this.getAxisValueText(v,"tooltip",D,M,a,b),title:b,symbol:{marker:V},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",I,M,l,b),missing:N.isTooltipValueMissing(I)},{label:d,fallbackLabel:h,value:this.getAxisValueText(S,"tooltip",k,M,h,b),missing:N.isTooltipValueMissing(k)},{label:p,fallbackLabel:u,value:this.getAxisValueText(S,"tooltip",C,M,u,b),missing:N.isTooltipValueMissing(C)},{label:y,fallbackLabel:f,value:this.getAxisValueText(S,"tooltip",A,M,f,b),missing:N.isTooltipValueMissing(A)}]},{seriesId:t,datum:M,title:r,itemType:T,xKey:a,xName:o,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:f,closeName:y,...z})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:n,height:a}=t,o={x:i-n/2,y:s,width:n,height:a};return Jq(this,o)}},{ExtendedPath2D:n9,BBox:a9}=N,Gh=class extends ll{constructor(){super(...arguments),this.wickPath=new n9,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}setWickProperties(e,t,i,s,n){this.__wickStroke=e,this.__wickStrokeWidth=t,this.__wickStrokeOpacity=i,this.wickLineDash=s,this.__wickLineDashOffset=n,this.dirtyPath=!0,this.markDirty()}computeDefaultGradientFillBBox(){const{__width:e,__centerX:t,__yOpen:i,__yClose:s}=this,n=Math.min(i,s),o=Math.max(i,s)-n,r=t-e/2,l=t+e/2;return new a9(r,n,l-r,o)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,__wickStroke:o,__wickStrokeWidth:r,__wickStrokeOpacity:l,wickLineDash:c,__wickLineDashOffset:h}=this,{centerX:d,x0:u,x1:p,y0:f,y1:y,yOpen:b,yClose:x}=this.alignedCoordinates(),v=this.layerManager?.canvas.pixelRatio??1,S=this.__wickStrokeAlignment>0?v/this.__wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const D=o!=null&&o!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==a?this.wickPath:e;if(Math.abs(p-u)<=3){D.moveTo(d-S,f),D.lineTo(d-S,y);return}const I=Math.min(b,x),k=Math.max(b,x),C=i/2;D.moveTo(d-S,f),D.lineTo(d-S,I+C),D.moveTo(d-S,y),D.lineTo(d-S,k-C);const A=k-I-2*C;if(A>0)e.rect(u+C,I+C,p-u-2*C,A);else{const w=(I+k)/2;e.moveTo(u,w),e.lineTo(p,w)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,__wickStroke:r=i,__wickStrokeWidth:l=s,__wickStrokeOpacity:c=n,wickLineDash:h=a,__wickLineDashOffset:d=o}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};g([Ee()],Gh.prototype,"wickStroke",2),g([Ee()],Gh.prototype,"wickStrokeWidth",2),g([Ee()],Gh.prototype,"wickStrokeOpacity",2),g([hu()],Gh.prototype,"wickLineDash",2),g([Ee()],Gh.prototype,"wickLineDashOffset",2),g([Ee()],Gh.prototype,"wickStrokeAlignment",2);var{AbstractBarSeriesProperties:o9,makeSeriesTooltip:r9}=N,jh=class extends X{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],jh.prototype,"stroke",2),g([m],jh.prototype,"strokeWidth",2),g([m],jh.prototype,"strokeOpacity",2),g([m],jh.prototype,"lineDash",2),g([m],jh.prototype,"lineDashOffset",2);var cC=class extends X{constructor(){super(...arguments),this.up=new jh,this.down=new jh}};g([m],cC.prototype,"up",2),g([m],cC.prototype,"down",2);var ia=class extends o9{};g([m],ia.prototype,"xKey",2),g([m],ia.prototype,"openKey",2),g([m],ia.prototype,"closeKey",2),g([m],ia.prototype,"highKey",2),g([m],ia.prototype,"lowKey",2),g([m],ia.prototype,"xName",2),g([m],ia.prototype,"yName",2),g([m],ia.prototype,"openName",2),g([m],ia.prototype,"closeName",2),g([m],ia.prototype,"highName",2),g([m],ia.prototype,"lowName",2);var Hv=class extends ia{constructor(){super(...arguments),this.tooltip=r9(),this.item=new cC}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:s,lineDash:n,lineDashOffset:a}=this.item[e];return{stroke:s,strokeWidth:t,strokeOpacity:i,lineDash:n,lineDashOffset:a,opacity:1}}};g([m],Hv.prototype,"tooltip",2),g([m],Hv.prototype,"item",2),g([m],Hv.prototype,"itemStyler",2);var{makeSeriesTooltip:l9}=N,wp=class extends X{};g([m],wp.prototype,"stroke",2),g([m],wp.prototype,"strokeWidth",2),g([m],wp.prototype,"strokeOpacity",2),g([m],wp.prototype,"lineDash",2),g([m],wp.prototype,"lineDashOffset",2);var oo=class extends X{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new wp}};g([m],oo.prototype,"fill",2),g([m],oo.prototype,"fillOpacity",2),g([m],oo.prototype,"stroke",2),g([m],oo.prototype,"strokeWidth",2),g([m],oo.prototype,"strokeOpacity",2),g([m],oo.prototype,"lineDash",2),g([m],oo.prototype,"lineDashOffset",2),g([m],oo.prototype,"cornerRadius",2),g([m],oo.prototype,"wick",2);var hC=class extends X{constructor(){super(...arguments),this.up=new oo,this.down=new oo}};g([m],hC.prototype,"up",2),g([m],hC.prototype,"down",2);var Gv=class extends ia{constructor(){super(...arguments),this.item=new hC,this.tooltip=l9()}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:s,strokeOpacity:n,stroke:a,lineDash:o,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[e];return{fill:t,fillOpacity:i,stroke:a,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};g([m],Gv.prototype,"item",2),g([m],Gv.prototype,"tooltip",2),g([m],Gv.prototype,"itemStyler",2);var dC=class extends Iz{constructor(){super(...arguments),this.properties=new Gv}nodeFactory(){const e=new Gh;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:o}=s.item,r=this.getShapeFillBBox(),l=this;e.each(function(h,d){const{centerX:u,width:p,y:f,height:y,yOpen:b,yClose:x,crisp:v}=d,S=d.isRising?a:o,M=l.getHighlightState(n,t,d.datumIndex),D=d.style??i.styles[d.itemType][M];h.setStaticProperties(u,p,f,y,b,x,v),h.setStyleProperties(D,r);const I=D?.wick;h.setWickProperties(I?.stroke,I?.strokeWidth,I?.strokeOpacity,I?.lineDash,I?.lineDashOffset),h.wickStrokeAlignment=S.wick.strokeWidth??S.strokeWidth})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=Qt(e.fill)?e.fill.colorStops.map(o=>typeof o=="string"?o:{color:o.color,stop:o.stop==null?void 0:o.stop*.5}):[{color:jn(e.fill)||Wa(e.fill)?e.stroke:e.fill,stop:0},{color:jn(e.fill)||Wa(e.fill)?e.stroke:e.fill,stop:.5}],s=Qt(t.fill)?t.fill.colorStops.map(o=>typeof o=="string"?o:{color:o.color,stop:o.stop==null?void 0:o.stop*.5}):[{color:jn(t.fill)||Wa(t.fill)?t.stroke:t.fill,stop:.5}],n={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...s],reverse:!1},a={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:n,fillOpacity:e.fillOpacity,stroke:a,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:a,yName:o,showInLegend:r,legendItemName:l}=this.properties;return!i?.data.length||!a||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&n.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??o??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};dC.className="CandleStickSeries",dC.type="candlestick";var{candlestickSeriesThemeableOptionsDef:c9}=N,uC={...qe,...c9,type:j(Ae("candlestick")),xKey:j(L),openKey:j(L),highKey:j(L),lowKey:j(L),closeKey:j(L),xName:L,yName:L,openName:L,highName:L,lowName:L,closeName:L,xKeyAxis:L,yKeyAxis:L};uC.pickOutsideVisibleMinorAxis=Q(R),uC.focusPriority=Q(W);function Az(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",fy(e)],["image",it],["pattern",by(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}var h9={series:{item:{up:Az("up"),down:Az("down")},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Us},animation:{enabled:!1},axes:{number:{crosshair:{snap:!1}},"ordinal-time":{groupPaddingInner:0,crosshair:{enabled:!0}}}},{predictCartesianFinancialAxis:d9}=N,jv={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,groupable:!1,version:ue,dependencies:[ri],options:uC,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:d9,defaultAxes:{y:{type:"number",position:"left"},x:{type:"ordinal-time",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:h9,create:e=>new dC(e)},{CartesianSeriesProperties:u9,makeSeriesTooltip:p9}=N,es=class extends u9{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new cp,this.tooltip=p9()}};g([m],es.prototype,"title",2),g([m],es.prototype,"xKey",2),g([m],es.prototype,"yKey",2),g([m],es.prototype,"colorKey",2),g([m],es.prototype,"xName",2),g([m],es.prototype,"yName",2),g([m],es.prototype,"colorName",2),g([m],es.prototype,"colorRange",2),g([m],es.prototype,"stroke",2),g([m],es.prototype,"strokeOpacity",2),g([m],es.prototype,"strokeWidth",2),g([m],es.prototype,"textAlign",2),g([m],es.prototype,"verticalAlign",2),g([m],es.prototype,"itemPadding",2),g([m],es.prototype,"itemStyler",2),g([m],es.prototype,"label",2),g([m],es.prototype,"tooltip",2);var{SeriesNodePickMode:Cz,computeBarFocusBounds:g9,getMissCount:f9,valueProperty:pC,DEFAULT_CARTESIAN_DIRECTION_KEYS:m9,DEFAULT_CARTESIAN_DIRECTION_NAMES:y9,createDatumId:x9,ColorScale:b9,Rect:v9,PointerEvents:S9,addHitTestersToQuadtree:M9,findQuadtreeMatch:wz,updateLabelNode:D9,upsertNodeDatum:k9}=N,I9=class extends N.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},A9={left:-.5,center:0,right:-.5},C9={top:-.5,middle:0,bottom:-.5},gC=class extends N.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...m9,color:["colorKey"]},propertyNames:{...y9,color:["colorName"]},categoryKey:void 0,pickModes:[Cz.NEAREST_NODE,Cz.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new es,this.NodeEvent=I9,this.colorScale=new b9}async processData(e){const t=this.axes.x,i=this.axes.y;if(!t||!i)return;const{xKey:s,yKey:n,colorRange:a,colorKey:o}=this.properties,r=this.axes.x?.scale,l=this.axes.y?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,u=this.properties.allowNullKeys??!1,{dataModel:p,processedData:f}=await this.requestDataModel(e,this.data,{props:[pC(s,c,{id:"xValue",allowNullKey:u}),pC(n,h,{id:"yValue",allowNullKey:u}),...o?[pC(o,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const y=p.resolveProcessedDataIndexById(this,"colorValue"),b=f.domain.values[y].filter(v=>v!=null),x=Ga(b);if(this.colorScale.domain=x??[],x?.length&&x[0]===x[1]){const v=Math.floor(a.length/2);this.colorScale.range=[a[v],a[v]]}else this.colorScale.range=a;this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=f9(this,i.defs.values[s].missing),o=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[o].filter(c=>c!=null).length;return!(n===0||n===a||r===0)}xCoordinateRange(e,t){const i=this.axes.x.scale,s=t*(i.bandwidth??0)/2,n=i.convert(e)+s,a=t*(i.bandwidth??10);return[n,n+a]}yCoordinateRange(e,t){const i=this.axes.y.scale,s=t*(i.bandwidth??0)/2,n=i.convert(e[0])+s,a=t*(i.bandwidth??10);return[n,n+a]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?{domain:[]}:e==="x"?{domain:t.getDomain(this,"xValue","value",i).domain}:{domain:t.getDomain(this,"yValue","value",i).domain}}getSeriesRange(){return[Number.NaN,Number.NaN]}validateCreateNodeDataPreconditions(){const e=super.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e;if(t.type!=="category"||i.type!=="category"){K.warnOnce(`Heatmap series expected axes to have "category" type, but received "${t.type}" and "${i.type}" instead.`);return}return e}populateNodeData(e){for(const[t,i]of e.rawData.entries()){const s=k9(e,{datumIndex:t,datum:i},(n,a)=>this.createNodeDatum(n,a.datumIndex,a.datum),(n,a,o)=>this.updateNodeDatum(n,a,o.datumIndex,o.datum));if(s){const n=this.createLabelDatum(e,t,i,s);n&&e.labels.push(n)}}}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:n}=this;if(!i||!s)return;const{xKey:a,xName:o,yKey:r,yName:l,colorKey:c,colorName:h,textAlign:d,verticalAlign:u,itemPadding:p}=this.properties,f=e.scale,y=t.scale,b=i.resolveColumnById(this,"xValue",s),x=i.resolveColumnById(this,"yValue",s),v=c?i.resolveColumnById(this,"colorValue",s):void 0,S=c?i.getDomain(this,"colorValue","value",s).domain:[],M=f.bandwidth??10,D=y.bandwidth??10,I=s.dataSources.get(this.id)?.data??[],k=n?.nodeData!=null&&s.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:f,yScale:y,rawData:I,xValues:b,xKey:a,yKey:r,xName:o,yName:l,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:k,nodes:k?n.nodeData:[],nodeIndex:0,xOffset:(f.bandwidth??0)/2,yOffset:(y.bandwidth??0)/2,width:M,height:D,textAlignFactor:(M-2*p)*A9[d],verticalAlignFactor:(D-2*p)*C9[u],yValues:x,colorKey:c,colorName:h,colorValues:v,colorDomain:S,itemPadding:p,labels:[],labelIndex:0}}createSkeletonNodeDatum(e,t,i){const{xKey:s,yKey:n,width:a,height:o,colorValues:r}=e,l=e.xValues[t],c=e.yValues[t],h=r?.[t];return{series:this,datumIndex:t,yKey:n,xKey:s,xValue:l,yValue:c,colorValue:h,datum:i,point:{x:0,y:0,size:0},width:a,height:o,midPoint:{x:0,y:0},missing:r!=null&&h==null,style:{}}}updateNodeDatum(e,t,i,s){const{xScale:n,yScale:a,xOffset:o,yOffset:r,width:l,height:c,xKey:h,yKey:d,colorValues:u}=e,p=t,f=e.xValues[i],y=e.yValues[i],b=n.convert(f)+o,x=a.convert(y)+r;if(!Number.isFinite(b)||!Number.isFinite(x))return;const v=u?.[i];p.datumIndex=i,p.datum=s,p.yKey=d,p.xKey=h,p.xValue=f,p.yValue=y,p.colorValue=v,p.width=l,p.height=c,p.missing=u!=null&&v==null;const S=p.point;S.x=b,S.y=x,S.size=0,p.midPoint.x=b,p.midPoint.y=x,p.style=this.getItemStyle({datumIndex:i,datum:s,colorValue:v},!1)}createNodeDatum(e,t,i){const{xScale:s,yScale:n,xOffset:a,yOffset:o}=e,r=e.xValues[t],l=e.yValues[t],c=s.convert(r)+a,h=n.convert(l)+o;if(!Number.isFinite(c)||!Number.isFinite(h))return;const d=this.createSkeletonNodeDatum(e,t,i);return this.updateNodeDatum(e,d,t,i),d}createLabelDatum(e,t,i,s){const{label:n}=this.properties,{width:a,height:o,textAlignFactor:r,verticalAlignFactor:l,itemPadding:c,colorKey:h,colorName:d,colorDomain:u,xKey:p,yKey:f,xName:y,yName:b}=e,x=e.colorValues?.[t],v=n.enabled&&x!=null?this.getLabelText(x,i,h,"color",u,n,{value:x,datum:i,colorKey:h,colorName:d,xKey:p,yKey:f,xName:y,yName:b}):void 0,S=()=>({width:a,height:o,meta:null}),M=nA(Ne(v),this.properties.label,void 0,this.properties.label,{padding:c},S);if(M?.label==null)return;const{text:D,fontSize:I,lineHeight:k,height:C}=M.label,{fontStyle:A,fontFamily:w,fontWeight:T,color:O}=this.properties.label,{textAlign:z,verticalAlign:V}=this.properties,E=s.point.x+r*(a-2*c),_=s.point.y+l*(o-2*c)-(M.height-C)*.5;return{series:this,datum:i,datumIndex:t,text:D,fontSize:I,lineHeight:k,fontStyle:A,fontFamily:w,fontWeight:T,color:O,textAlign:z,textBaseline:V,x:E,y:_,style:s.style}}nodeFactory(){return new v9}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle({datumIndex:e,datum:t,colorValue:i},s,n){const{properties:a}=this,{itemStyler:o,stroke:r,strokeWidth:l,strokeOpacity:c}=a,h=this.getHighlightStyle(s,e,n),d=re(h,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:r,strokeWidth:l,strokeOpacity:c,opacity:1});let u;return o!=null&&e!=null&&(u=this.cachedDatumCallback(x9(e,s?"highlight":"node"),()=>{const p=this.makeItemStylerParams(t,e,s,d);return this.callWithContext(o,p)})),u?re(u,d):d}makeItemStylerParams(e,t,i,s){const{id:n,properties:a}=this,{xKey:o,yKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,xKey:o,yKey:r,highlightState:c,...s,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager?.getActiveHighlight();e.each((s,n)=>{const a=this.getHighlightState(i,t,n.datumIndex);n.style=this.getItemStyle(n,t,a)})}updateDatumNodes({datumSelection:e}){const t=this.axes.x,[i,s]=t?.visibleRange??[],a=!(i!==0||s!==1);e.each((o,r)=>{const{point:l,width:c,height:h,style:d}=r;o.setStyleProperties(d),o.crisp=a,o.x=Math.floor(l.x-c/2),o.y=Math.floor(l.y-h/2),o.width=Math.ceil(c),o.height=Math.ceil(h)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,n=s?t:[];return i.update(n)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{s.pointerEvents=S9.None,s.text=n.text,s.fillOpacity=this.getHighlightStyle(t,n.datumIndex)?.opacity??1,D9(this,s,this.properties,this.properties.label,n,t,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a,colorScale:o,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:f,colorRange:y,title:b,legendItemName:x,tooltip:v}=a,S=n.x,M=n.y;if(!i||!s||!S||!M)return;const D=s.dataSources.get(this.id)?.data[e],I=i.resolveColumnById(this,"xValue",s)[e],k=i.resolveColumnById(this,"yValue",s)[e],C=p!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[e]:void 0,A=this.properties.allowNullKeys??!1;if(I===void 0&&!A)return;const w=[];let T;if(C==null)T=y[0];else{T=o.convert(C);const V=i.getDomain(this,"colorValue","value",s).domain,E=l.format(this.callWithContext.bind(this),{type:"number",value:C,datum:D,seriesId:t,legendItemName:x,key:p,source:"tooltip",property:"color",domain:V,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});w.push({label:f,fallbackLabel:p,value:E??ya(C)})}w.push({label:h,fallbackLabel:c,value:this.getAxisValueText(S,"tooltip",I,D,c,x)},{label:u,fallbackLabel:d,value:this.getAxisValueText(M,"tooltip",k,D,d,x)});const O=this.getItemStyle({datumIndex:e,datum:D,colorValue:C},!1);O.fill!=null&&(T=O.fill);const z=T==null?void 0:{marker:{shape:"square",fill:T,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(v,{title:b??x,symbol:z,data:w},{seriesId:t,datum:D,title:b,xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:f,...O})}getLegendData(e){return e!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:s,midPoint:n}=t,a={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return g9(this,a)}initQuadTree(e){M9(e,this.datumNodesIter())}pickNodesExactShape(e){const t=wz(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return wz(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null||this.isColorScaleValid()}};gC.className="HeatmapSeries",gC.type="heatmap";var{heatmapSeriesThemeableOptionsDef:w9}=N,L9={...J(w9,["showInLegend"]),...J(qe,["showInLegend"]),type:j(Ae("heatmap")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,colorKey:L,xName:L,yName:L,colorName:L,colorRange:me(te)},Lz={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},label:{...Ye,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:{unhighlightedItem:{opacity:.6}}},gradientLegend:{enabled:!0}};Lz.series.colorRange={$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},yo]};var fC={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,version:ue,dependencies:[ri],options:L9,defaultAxes:{y:{type:"category",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:Lz,create:e=>new gC(e)},mC=class extends Iz{constructor(){super(...arguments),this.properties=new Hv}nodeFactory(){const e=new vz;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:o}=s.item,r=this;e.each(function(c,h){const{centerX:d,width:u,y:p,height:f,yOpen:y,yClose:b,crisp:x}=h,v=h.isRising?a:o;c.setStaticProperties(d,u,p,f,y,b,x);const S=h.style??i.styles[h.itemType][r.getHighlightState(n,t,h.datumIndex)];c.setStyleProperties(S),c.strokeAlignment=v.strokeWidth})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:a,yName:o,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.data.length||!a||e!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??o??t},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};mC.className="ohlc",mC.type="ohlc";var{ohlcSeriesThemeableOptionsDef:N9}=N,yC={...qe,...N9,type:j(Ae("ohlc")),xKey:j(L),openKey:j(L),highKey:j(L),lowKey:j(L),closeKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,openName:L,highName:L,lowName:L,closeName:L};yC.pickOutsideVisibleMinorAxis=Q(R),yC.focusPriority=Q(W);var{predictCartesianFinancialAxis:T9}=N,O9={animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Us},axes:{number:{crosshair:{snap:!1}},"ordinal-time":{groupPaddingInner:0,crosshair:{enabled:!0}}}},Wv={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,version:ue,dependencies:[ri],options:yC,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:T9,defaultAxes:{y:{type:"number",position:"left"},x:{type:"ordinal-time",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:O9,create:e=>new mC(e)};function P9(e,t,i,s,n,a,o,r){const[l,c]=oi(e,n);return vr([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var E9=Ar(P9);function R9(e,t,i,s,n){const a=t.resolveKeysById(s,"xValue",i),o=t.resolveColumnById(s,"yHighValue",i),r=t.resolveColumnById(s,"yLowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i);if(n){const[d,u]=oi(e,l);return vr([d,u],a,o,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:n})}return E9(e,a,o,r,l,i.reduced?.smallestKeyInterval,c,h)}function z9(e,t,i,s,n,a){const o=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i),l=t.resolveColumnById(s,"yLowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),[u,p]=oi(e,c);return Dg([u,p],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:n,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:a})}function Nz({span:e},t){switch(e.type){case"linear":case"step":case"multi-line":{const i=(t-e.x0)/(e.x1-e.x0);return e.y0+i*(e.y1-e.y0)}case"cubic":{const{cp0x:i,cp0y:s,cp1x:n,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:c}=e;let h=.5;const d=1e-6;for(let p=0;p<10;p++){const f=1-h,b=f*f*f*i+3*f*f*h*n+3*f*h*h*o+h*h*h*l-t;if(Math.abs(b)<d)break;const x=3*f*f*(n-i)+6*f*h*(o-n)+3*h*h*(l-o);if(Math.abs(x)<1e-12)break;h=h-b/x,h=Math.max(0,Math.min(1,h))}const u=1-h;return u*u*u*s+3*u*u*h*a+3*u*h*h*r+h*h*h*c}}}function Tz(e,t,i=0){for(let s=i;s<e.length;s++){const n=e[s],[a,o]=tn(n.span);if(t>=a.x&&t<=o.x)return{span:n,index:s};if(t<a.x)break}return{span:null,index:i}}function V9(e,t,i,s,n){const a=Tz(e,i,n),o=Tz(t,i,n);if(!a.span||!o.span)return{intersection:null,spanIndex:a.index,isInverted:s};const r=Nz(a.span,i),l=Nz(o.span,i),c=r>l;return{intersection:s===c?null:{x:i,y:r},spanIndex:a.index,isInverted:c}}function B9(e,t,i,s,n=!1){if(e.length===0||t.length===0)return[];const a=[];let o=n,r=0;for(let l=i;l<=s;l+=.5){const c=V9(e,t,l,o,r);c.intersection&&a.push(c.intersection.x),r=c.spanIndex,o=c.isInverted}return a}function F9(e,t,i,s,n={}){const a=Math.max(t.x,i.width-(t.x+t.width)),o=Math.max(t.y,i.height-(t.y+t.height)),r=[],l=(h,d)=>({x0:h,y0:-o,x1:d,y1:t.height+o});s&&r.push({clipRect:l(-a,e[0]??t.width+a),...n});const c=s?1:0;for(let h=c;h<e.length;h+=2)r.push({clipRect:l(e[h],e[h+1]??t.width+a),...n});return r}var{CartesianSeriesProperties:_9,SeriesMarker:H9,makeSeriesTooltip:G9,DropShadow:j9,Label:W9}=N,xC=class extends W9{constructor(){super(...arguments),this.placement="outside",this.spacing=0}};g([m],xC.prototype,"placement",2),g([m],xC.prototype,"spacing",2);var $v=class{constructor(){this.enabled=!1,this.fillOpacity=1}};g([m],$v.prototype,"enabled",2),g([m],$v.prototype,"fill",2),g([m],$v.prototype,"fillOpacity",2);var Dc=class extends X{constructor(){super(...arguments),this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new H9}};g([m],Dc.prototype,"stroke",2),g([m],Dc.prototype,"strokeWidth",2),g([m],Dc.prototype,"strokeOpacity",2),g([m],Dc.prototype,"lineDash",2),g([m],Dc.prototype,"lineDashOffset",2),g([m],Dc.prototype,"marker",2);var bC=class extends X{constructor(){super(...arguments),this.low=new Dc,this.high=new Dc}};g([m],bC.prototype,"low",2),g([m],bC.prototype,"high",2);var La=class extends X{};g([m],La.prototype,"enabled",2),g([m],La.prototype,"shape",2),g([m],La.prototype,"size",2),g([m],La.prototype,"fill",2),g([m],La.prototype,"fillOpacity",2),g([m],La.prototype,"stroke",2),g([m],La.prototype,"strokeWidth",2),g([m],La.prototype,"strokeOpacity",2),g([m],La.prototype,"lineDash",2),g([m],La.prototype,"lineDashOffset",2),g([m],La.prototype,"itemStyler",2);var Ut=class extends _9{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Ml,this.item=new bC,this.invertedStyle=new $v,this.shadow=new j9().set({enabled:!1}),this.marker=new La,this.label=new xC,this.tooltip=G9(),this.connectMissingData=!1}};g([m],Ut.prototype,"xKey",2),g([m],Ut.prototype,"yLowKey",2),g([m],Ut.prototype,"yHighKey",2),g([m],Ut.prototype,"xName",2),g([m],Ut.prototype,"yName",2),g([m],Ut.prototype,"yLowName",2),g([m],Ut.prototype,"yHighName",2),g([m],Ut.prototype,"fill",2),g([m],Ut.prototype,"fillOpacity",2),g([m],Ut.prototype,"stroke",2),g([m],Ut.prototype,"strokeWidth",2),g([m],Ut.prototype,"strokeOpacity",2),g([m],Ut.prototype,"lineDash",2),g([m],Ut.prototype,"lineDashOffset",2),g([m],Ut.prototype,"interpolation",2),g([m],Ut.prototype,"styler",2),g([m],Ut.prototype,"item",2),g([m],Ut.prototype,"invertedStyle",2),g([m],Ut.prototype,"shadow",2),g([m],Ut.prototype,"marker",2),g([m],Ut.prototype,"label",2),g([m],Ut.prototype,"tooltip",2),g([m],Ut.prototype,"connectMissingData",2);var{CollapseMode:Kv,pairUpSpans:Uv,prepareAreaFillAnimationFns:$9,plotInterpolatedLinePathStroke:Lp,prepareLinePathPropertyAnimation:K9}=N;function U9(e,t,i,s){const n=(l,c)=>{Lp(l,c,t.removed),Lp(l,c,i.removed)},a=(l,c)=>{Lp(l,c,t.moved),Lp(l,c,i.moved)},o=(l,c)=>{Lp(l,c,t.added),Lp(l,c,i.added)},r=K9(e,s);return{status:e,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:n},pathProperties:r}}function Y9(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!zl(e.scales.x)||!zl(t.scales.x))return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const o=Uv({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},Kv.Split);if(o==null)return;const r=Uv({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},Kv.Split);if(r==null)return;const l=Uv({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},Kv.Split);if(l==null)return;const c=Uv({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},Kv.Split);if(c==null)return;const h="fade",d=$9(a,o,r,h),u=U9(a,l,c,h),p=(i?.changed??!0)||!Ka(e.scales.x,t.scales.x)||!Ka(e.scales.y,t.scales.y)||a!=="updated";return{status:a,fill:d,stroke:u,hasMotion:p}}var Z9=qs,X9=Xs,q9=Vn,{valueProperty:Oz,keyProperty:Q9,updateLabelNode:J9,fixNumericExtent:Pz,buildResetPathFn:e8,resetLabelFn:t8,resetMarkerFn:i8,resetMarkerPositionFn:Ez,pathSwipeInAnimation:s8,resetMotion:n8,markerSwipeScaleInAnimation:a8,seriesLabelFadeInAnimation:vC,animationValidation:o8,diff:r8,updateClipPath:SC,computeMarkerFocusBounds:Rz,plotAreaPathFill:l8,plotLinePathStroke:zz,interpolatePoints:Vz,pathFadeInAnimation:MC,markerFadeInAnimation:Bz,fromToMotion:DC,pathMotion:kC,PointerEvents:Yv,Marker:c8,BBox:h8,processedDataIsAnimatable:IC,markerEnabled:d8,getMarkerStyles:u8,calculateSegments:p8,toHighlightString:g8,HighlightState:f8,AggregationManager:m8,resetMarkerSelectionsDirect:y8,createDatumId:x8,visibleRangeIndices:Fz}=N,b8=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},AC=class extends N.CartesianSeries{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[N.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:e8({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:t8,datum:(t,i)=>({...i8(t),...Ez(t,i)})},clipFocusBox:!1}),this.properties=new Ut,this.NodeEvent=b8,this.aggregationManager=new m8}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,n=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:o,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();this.needsDataModelDiff()&&this.processedData&&l.push(r8(this.id,this.processedData)),c&&l.push(o8());const h=this.properties.allowNullKeys??!1,{dataModel:d,processedData:u}=await this.requestDataModel(e,this.data,{props:[Q9(t,o,{id:"xValue",allowNullKey:h}),Oz(i,r,{id:"yLowValue"}),Oz(s,r,{id:"yHighValue"}),...l]});this.aggregateData(d,u),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||IC(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>z9(i.scale.type,e,t,this,s,a),computeFull:a=>R9(i.scale.type,e,t,this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ha.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources.get(this.id)?.data??[],a=e.scale,o=t.scale,r=e.range,[l,c]=a.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const d=this.aggregationManager.getFilterForRange(h),u=this.contextNodeData?.nodeData,p=!this.ctx.animationManager.isSkipped(),f=u!=null&&(s.changeDescription!=null||!IC(s)||d!=null);return{xAxis:e,yAxis:t,rawData:n,xValues:i.resolveKeysById(this,"xValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s),xScale:a,yScale:o,xAxisRange:r,xOffset:(a.bandwidth??0)/2,dataAggregationFilter:d,range:h,labelsEnabled:this.properties.label.enabled,animationEnabled:p,canIncrementallyUpdate:f,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,item:this.properties.item,yDomain:this.getSeriesDomain("y").domain,connectMissingData:this.properties.connectMissingData,interpolation:this.properties.interpolation,nodes:f?u:[],labelData:[],spanPoints:[],nodeIndex:0}}xCoordinateRange(e){const t=this.axes.x.scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes.y.scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};const{domain:{keys:[s]}}=t;if(e==="x"){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:a}}return{domain:Pz(Ga(s))}}else{const n=this.domainForClippedRange("y",["yHighValue","yLowValue"],"xValue"),a=Tt(n);return{domain:Pz(a)}}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yHighValue","yLowValue"],"xValue",t)}handleDatumPoint(e,t,i,s,n){if(t.xValue=e.xValues[i],t.xValue===void 0&&!this.properties.allowNullKeys)return;t.datum=e.rawData[i],t.yHighValue=s??e.yHighValues[i],t.yLowValue=n??e.yLowValues[i];const a=e.spanPoints.at(-1);if(Number.isFinite(t.yHighValue)&&Number.isFinite(t.yLowValue)){if(t.inverted=t.yLowValue>t.yHighValue,t.x=e.xScale.convert(t.xValue)+e.xOffset,!Number.isFinite(t.x))return;t.yHighCoordinate=e.yScale.convert(t.yHighValue),t.yLowCoordinate=e.yScale.convert(t.yLowValue),this.upsertMarkerDatum(e,t,i,"high",t.yHighValue,t.yHighCoordinate),this.upsertMarkerDatum(e,t,i,"low",t.yLowValue,t.yLowCoordinate);const o={high:{point:{x:t.x,y:t.yHighCoordinate},xDatum:t.xValue,yDatum:t.yHighValue},low:{point:{x:t.x,y:t.yLowCoordinate},xDatum:t.xValue,yDatum:t.yLowValue}};Array.isArray(a)?a.push(o):a==null?e.spanPoints.push([o]):(a.skip+=1,e.spanPoints.push([o]))}else e.connectMissingData||(Array.isArray(a)||a==null?e.spanPoints.push({skip:0}):a.skip+=1)}upsertMarkerDatum(e,t,i,s,n,a){const{size:o}=e.item[s].marker;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const l=e.nodes[e.nodeIndex];l.index=i,l.itemType=s,l.datum=t.datum,l.datumIndex=i,l.midPoint={x:t.x,y:a},l.yHighValue=t.yHighValue,l.yLowValue=t.yLowValue,l.xValue=t.xValue,l.point={x:t.x,y:a,size:o}}else e.nodes.push({index:i,series:this,itemType:s,datum:t.datum,datumIndex:i,midPoint:{x:t.x,y:a},yHighValue:t.yHighValue,yLowValue:t.yLowValue,xValue:t.xValue,xKey:e.xKey,yLowKey:e.yLowKey,yHighKey:e.yHighKey,point:{x:t.x,y:a,size:o},enabled:!0});if(e.nodeIndex++,e.labelsEnabled){const l=this.createLabelData({datumIndex:i,point:{x:t.x,y:a},value:n,yLowValue:t.yLowValue,yHighValue:t.yHighValue,itemType:s,inverted:t.inverted,datum:t.datum,series:this});e.labelData.push(l)}}populateNodeData(e){const{processedData:t}=this;if(!t)return;const i={datum:void 0,xValue:void 0,yHighValue:0,yLowValue:0,x:0,yHighCoordinate:0,yLowCoordinate:0,inverted:!1},s=n=>e.xScale.convert(e.xValues[n])+e.xOffset;if(t.input.count<1e3||e.dataAggregationFilter==null){let[n,a]=Fz(1,e.xValues.length,e.xAxisRange,o=>{const r=s(o);return[r,r]});t.input.count<1e3&&(n=0,a=t.input.count),n=Math.max(n-1,0),a=Math.min(a+1,e.xValues.length);for(let o=n;o<a;o+=1)this.handleDatumPoint(e,i,o)}else{const{maxRange:n,indexData:a,midpointIndices:o}=e.dataAggregationFilter,[r,l]=Fz(1,n,e.xAxisRange,c=>{const h=o[c];if(h!==Dl)return[s(h),s(h)]});for(let c=r;c<l;c+=1){if(o[c]===Dl)continue;const d=c*q9,u=a[d+Z9],p=a[d+X9];this.handleDatumPoint(e,i,u,e.yHighValues[u],e.yLowValues[p])}}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){return{itemId:`${e.yLowKey}-${e.yHighKey}`,labelData:e.labelData,nodeData:e.nodes,fillData:{itemType:"high",spans:[],phantomSpans:[]},highStrokeData:{itemType:"high",spans:[]},lowStrokeData:{itemType:"low",spans:[]},scales:this.calculateScaling(),visible:this.visible,styles:{low:this.getLowOrHighMarkerStyles("low"),high:this.getLowOrHighMarkerStyles("high")},segments:void 0,intersectionSegments:void 0}}assembleResult(e,t){const i=this.axes.x,s=this.axes.y;if(!i||!s||!this.chart?.seriesRect)return t;const n=e.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(h=>h.high);return Vz(c,e.interpolation)}),a=e.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(h=>h.low);return Vz(c,e.interpolation)}),o=p8(this.properties.segmentation,i,s,this.chart.seriesRect,this.ctx.scene,!1);let r;if(this.properties.invertedStyle.enabled){const l=e.yHighValues[0]<e.yLowValues[0],c=B9(n,a,e.xScale.range[0],e.xScale.range[1],l);r=F9(c,this.chart.seriesRect,this.ctx.scene,l,this.properties.invertedStyle)}return t.fillData={itemType:"high",spans:n,phantomSpans:a},t.highStrokeData={itemType:"high",spans:n},t.lowStrokeData={itemType:"low",spans:a},t.segments=o,t.intersectionSegments=r,t}getLowOrHighMarkerStyles(e){const{fill:t,fillOpacity:i,item:s}=this.properties,n=s[e],{stroke:a,strokeWidth:o,strokeOpacity:r}=n,l={fill:t,fillOpacity:i,stroke:a,strokeWidth:o,strokeOpacity:r};return u8(this,n,n.marker,l)}createLabelData({datumIndex:e,point:t,value:i,itemType:s,inverted:n,datum:a,series:o}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:u,yHighName:p,legendItemName:f,label:y}=this.properties,{placement:b}=y,x=y.spacing+(typeof y.padding=="number"?y.padding:0);let v=s;n&&(v=s==="low"?"high":"low");const S=b==="outside"&&v==="high"||b==="inside"&&v==="low"?-1:1,M=this.getSeriesDomain("y").domain;return{x:t.x,y:t.y+x*S,series:o,itemType:s,datum:a,datumIndex:e,text:this.getLabelText(i,a,s==="high"?c:l,"y",M,y,{value:i,datum:a,itemType:s,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:p,yName:d,legendItemName:f}),textAlign:"center",textBaseline:S===-1?"bottom":"top"}}isPathOrSelectionDirty(){const{low:e,high:t}=this.properties.item;return e.marker.isDirty()||t.marker.isDirty()}strokewidthChange(){const e=t=>{const i=this.properties.item[t].strokeWidth??0,s=this.properties.highlight.highlightedSeries.item?.[t]?.strokeWidth??i,n=this.properties.highlight.highlightedItem.item?.[t]?.strokeWidth??i;return i>n||s>n};return e("low")||e("high")}updatePathNodes(e){const{visible:t}=e,[i,s,n]=e.paths,a=this.contextNodeData?.segments,o=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightState(o,!1),l=this.getHighlightStyle(),{item:c,fill:h,fillOpacity:d,opacity:u}=re(l,this.getStyle(r));s.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:Yv.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:u,visible:t}),n.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:Yv.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:u,visible:t});const p=this.getShapeFillBBox();i.setFillProperties(h,p),i.setStyleProperties({stroke:void 0,fill:h,fillOpacity:d,opacity:u},p);const f=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:f,pointerEvents:Yv.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:u,visible:t}),i.datum=f,SC(this,i),SC(this,s),SC(this,n)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),l8(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,s]=e;i.path.clear(),s.path.clear(),zz(i,t.lowStrokeData.spans),zz(s,t.highStrokeData.spans),i.markDirty("RangeArea"),s.markDirty("RangeArea")}resetDatumAnimation(e){y8([e.datumSelection])}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{processedData:s,axes:n,properties:a}=this,o=a.styler?this.getStylerMarkerOptions().item:a.item,{low:r,high:l}=o,c=d8(s.input.count,n.x.scale,{enabled:r.marker.enabled||l.marker.enabled});(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let h;if(c)if(r.marker.enabled&&l.marker.enabled)h=t;else{h=[];for(const d of t)o[d.itemType].marker.enabled&&h.push(d)}else h=[];return IC(this.processedData)?i.update(h,void 0,d=>x8(d.xValue,d.itemType)):i.update(h)}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,n)=>{const a=this.getHighlightState(i,t,n.datumIndex),o=this.getStyle(a),{fill:r,fillOpacity:l,item:c}=o,{stroke:h,strokeWidth:d,strokeOpacity:u}=c[n.itemType],{marker:p}=this.properties.item[n.itemType],f=this.makeItemStylerParams(n.itemType);n.style=this.getMarkerStyle(p,n,f,{isHighlight:t,highlightState:a,resolveMarkerSubPath:["item",n.itemType,"marker"]},o.item[n.itemType].marker,{fill:r,fillOpacity:l,stroke:h,strokeWidth:d,strokeOpacity:u})})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,n=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(s,e.drawingMode);i.each((r,l)=>{const{itemType:c}=l,h=l.style??t.styles[c][this.getHighlightState(a,s,l.datumIndex)];this.applyMarkerStyle(h,r,l.point,n),r.drawingMode=o}),s||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=Yv.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:s=!1,labelSelection:n}=e;n.each((a,o)=>{a.fillOpacity=this.getHighlightStyle(s,o.datumIndex).opacity??1,J9(this,a,t,this.properties.label,o,s,i)})}getHighlightLabelData(e,t){return e?.length?e.filter(i=>i.datum===t.datum):[]}getHighlightData(e,t){const i=e.filter(s=>s.datum===t.datum).map(s=>({...s}));return i.length>0?i:void 0}getStyle(e){return this.getStylerCouple(e)[0]}getStylerMarkerOptions(){return this.getStylerCouple()[1]}getStylerCouple(e){const{fill:t,fillOpacity:i,item:s,styler:n}=this.properties;let a={};if(n){const c=this.makeStylerParams(e);a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(n,c)??{},{pick:!1})??{}}const o={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},r=c=>{const h=a.item?.[c],{lineDash:d,lineDashOffset:u,marker:p,stroke:f,strokeOpacity:y,strokeWidth:b}=s[c];return o.item[c].marker.enabled=h?.marker?.enabled??p.enabled,{marker:{fill:h?.marker?.fill??p.fill??t,fillOpacity:h?.marker?.fillOpacity??p.fillOpacity,shape:h?.marker?.shape??p.shape,size:h?.marker?.size??p.size,lineDash:h?.marker?.lineDash??p.lineDash,lineDashOffset:h?.marker?.lineDashOffset??p.lineDashOffset,stroke:h?.marker?.stroke??p.stroke??f,strokeOpacity:h?.marker?.strokeOpacity??p.strokeOpacity,strokeWidth:h?.marker?.strokeWidth??p.strokeWidth},lineDash:h?.lineDash??d,lineDashOffset:h?.lineDashOffset??u,stroke:h?.stroke??f,strokeOpacity:h?.strokeOpacity??y,strokeWidth:h?.strokeWidth??b}};return[{fill:a.fill??t,fillOpacity:a.fillOpacity??i,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:r("low"),high:r("high")}},o]}makeStylerParams(e){const{id:t}=this,{fill:i,fillOpacity:s,item:n,xKey:a,yHighKey:o,yLowKey:r}=this.properties,l=g8(e??f8.None),c=h=>{const{lineDash:d,lineDashOffset:u,marker:p,stroke:f,strokeOpacity:y,strokeWidth:b}=n[h];return{marker:{fill:p.fill??i,fillOpacity:p.fillOpacity,size:p.size,shape:p.shape,stroke:p.stroke??f,strokeOpacity:p.strokeOpacity,strokeWidth:p.strokeWidth,lineDash:p.lineDash,lineDashOffset:p.lineDashOffset},lineDash:d,lineDashOffset:u,stroke:f,strokeOpacity:y,strokeWidth:b}};return{item:{low:c("low"),high:c("high")},fill:i,fillOpacity:s,highlightState:l,seriesId:t,xKey:a,yLowKey:r,yHighKey:o}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties;return{xKey:t,yLowKey:i,yHighKey:s,itemType:e}}getTooltipContent(e,t){const i=t?.itemType??"high",{id:s,dataModel:n,processedData:a,axes:o,properties:r}=this,{xName:l,yName:c,yLowKey:h,yLowName:d,xKey:u,yHighKey:p,yHighName:f,tooltip:y,legendItemName:b}=r,x=o.x,v=o.y;if(!n||!a||!x||!v)return;const S=a.dataSources.get(this.id)?.data[e],M=n.resolveKeysById(this,"xValue",a)[e],D=n.resolveColumnById(this,"yHighValue",a)[e],I=n.resolveColumnById(this,"yLowValue",a)[e],k=this.properties.allowNullKeys??!1;if(M===void 0&&!k)return;const C=this.getStyle(),A=this.makeItemStylerParams(i),w=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:S},A,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},C.item[i].marker),T=`${this.getAxisValueText(v,"tooltip",I,S,h,b)} - ${this.getAxisValueText(v,"tooltip",D,S,p,b)}`;return this.formatTooltipWithContext(y,{heading:this.getAxisValueText(x,"tooltip",M,S,u,b),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${d??h} - ${f??p}`,value:T,missing:N.isTooltipValueMissing(D)&&N.isTooltipValueMissing(I)}]},{seriesId:s,datum:S,title:c,itemType:i,xName:l,yName:c,yLowKey:h,yLowName:d,xKey:u,yHighKey:p,yHighName:f,legendItemName:b,...w})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(),{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,marker:o}=t;return{marker:{shape:o.shape,fill:o.fill??e,stroke:o.stroke??i,fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},line:{enabled:!0,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yLowKey:s,yHighKey:n,yName:a,yLowName:o,yHighName:r,legendItemName:l,showInLegend:c}=this.properties,h=l??a??`${o??s} - ${r??n}`,d=`${s}-${n}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new c8}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),s8(this,a,...n),n8([t],Ez),a8(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),vC(this,"labels",a,i,this.highlightLabelSelection)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:o}=e,[r,l,c]=a;if(r==null&&l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,n)},d=()=>{t.skipCurrentBatch(),h()};if(n==null||o==null){h(),Bz(this,t,"added",this.getAnimationDrawingModes(),i),MC(this,"fill_path_properties",t,"add",r),MC(this,"low_stroke_path_properties",t,"add",l),MC(this,"high_stroke_path_properties",t,"add",c),vC(this,"labels",t,s,this.highlightLabelSelection);return}const u=Y9(n,o,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){d();return}else if(u.status==="no-op")return;DC(this.id,"fill_path_properties",t,[r],u.fill.pathProperties),DC(this.id,"low_stroke_path_properties",t,[l],u.stroke.pathProperties),DC(this.id,"high_stroke_path_properties",t,[c],u.stroke.pathProperties),u.status==="added"?this.updateAreaPaths(a,n):u.status==="removed"?this.updateAreaPaths(a,o):(kC(this.id,"fill_path_update",t,[r],u.fill.path),kC(this.id,"low_stroke_path_update",t,[l],u.stroke.path),kC(this.id,"high_stroke_path_update",t,[c],u.stroke.path)),u.hasMotion&&(Bz(this,t,void 0,this.getAnimationDrawingModes(),i),vC(this,"labels",t,s,this.highlightLabelSelection)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)})}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(e.itemType);return this.getMarkerStyle(this.properties.item[e.itemType].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemType,"marker"]},void 0,t)}getMarkerStyle(e,t,i,s,n,a){return e.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(e,t,i,s,n,a)}computeFocusBounds(e){const t=Rz(this,e),i=Rz(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return h8.merge([t,i])}isDatumEnabled(e,t){return t%2===0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};AC.className="RangeAreaSeries",AC.type="range-area";var{rangeAreaSeriesThemeableOptionsDef:v8}=N,CC={...qe,...v8,type:j(Ae("range-area")),xKey:j(L),yLowKey:j(L),yHighKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,yLowName:L,yHighName:L,legendItemName:L,segmentation:fo,invertedStyle:{enabled:R,...se}};CC.pickOutsideVisibleMinorAxis=Q(R),CC.focusPriority=Q(W);var _z={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",Ba],["image",it],["pattern",tt]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ba],["image",it],["pattern",tt]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},S8={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["pattern",tt]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ba],["image",it],["pattern",tt]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:_z,high:_z},label:{...Ye,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Nd,segmentation:vl,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{number:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:M8}=N,Zv={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,version:ue,dependencies:[ri],options:CC,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:M8,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:S8,create:e=>new AC(e)};function D8(e,t,i,s,n,a,o,r){const[l,c]=oi(e,n);return vr([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var k8=Ar(D8);function I8(e,t,i,s,n){const a=t.resolveKeysById(s,"xValue",i),o=t.resolveColumnById(s,"yHighValue",i),r=t.resolveColumnById(s,"yLowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i);if(n){const[d,u]=oi(e,l);return vr([d,u],a,o,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:n})}return k8(e,a,o,r,l,i.reduced?.smallestKeyInterval,c,h)}function A8(e,t,i,s,n,a){const o=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i),l=t.resolveColumnById(s,"yLowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),[u,p]=oi(e,c);return Dg([u,p],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:n,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:a})}var{AbstractBarSeriesProperties:C8,makeSeriesTooltip:w8,DropShadow:L8,Label:N8}=N,wC=class extends N8{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};g([m],wC.prototype,"placement",2),g([m],wC.prototype,"spacing",2);var bi=class extends C8{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new L8().set({enabled:!1}),this.label=new wC,this.tooltip=w8()}};g([m],bi.prototype,"xKey",2),g([m],bi.prototype,"yLowKey",2),g([m],bi.prototype,"yHighKey",2),g([m],bi.prototype,"xName",2),g([m],bi.prototype,"yName",2),g([m],bi.prototype,"yLowName",2),g([m],bi.prototype,"yHighName",2),g([m],bi.prototype,"fill",2),g([m],bi.prototype,"fillOpacity",2),g([m],bi.prototype,"stroke",2),g([m],bi.prototype,"strokeWidth",2),g([m],bi.prototype,"strokeOpacity",2),g([m],bi.prototype,"lineDash",2),g([m],bi.prototype,"lineDashOffset",2),g([m],bi.prototype,"cornerRadius",2),g([m],bi.prototype,"styler",2),g([m],bi.prototype,"itemStyler",2),g([m],bi.prototype,"shadow",2),g([m],bi.prototype,"label",2),g([m],bi.prototype,"tooltip",2);var{SeriesNodePickMode:Hz,valueProperty:Gz,keyProperty:T8,checkCrisp:O8,updateLabelNode:P8,SMALLEST_KEY_INTERVAL:E8,LARGEST_KEY_INTERVAL:R8,diff:z8,prepareBarAnimationFunctions:jz,midpointStartingBarPosition:Wz,resetBarSelectionsFn:V8,resetBarSelectionsDirect:B8,fixNumericExtent:F8,seriesLabelFadeInAnimation:$z,resetLabelFn:_8,animationValidation:H8,computeBarFocusBounds:G8,visibleRangeIndices:j8,createDatumId:W8,Rect:$8,PointerEvents:K8,motion:Kz,processedDataIsAnimatable:LC,getItemStyles:U8,calculateSegments:Y8,toHighlightString:Z8,HighlightState:Uz,AggregationManager:X8,upsertNodeDatum:NC}=N,q8=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},TC=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Hz.AXIS_ALIGNED,Hz.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:V8,label:_8}}),this.properties=new bi,this.aggregationManager=new X8,this.NodeEvent=q8}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,n=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:o,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:n,yScale:a}),c=[];this.needsDataModelDiff()&&this.processedData&&c.push(z8(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||c.push(H8());const h=this.visible?{}:{forceValue:0},d=this.properties.allowNullKeys??!1,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[T8(t,r,{id:"xValue",allowNullKey:d}),Gz(i,l,{id:"yLowValue",invalidValue:null,...h}),Gz(s,l,{id:"yHighValue",invalidValue:null,...h}),...o?[E8,R8]:[],...c],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.aggregateData(u,p),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||LC(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>A8(i.scale.type,e,t,this,s,a),computeFull:a=>I8(i.scale.type,e,t,this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&ha.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale==null)return 0;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n?.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:a}}return{domain:this.padBandExtent(s)}}else{const n=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),a=Tt(n);return{domain:F8(a)}}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yHighValue","yLowValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources?.get(this.id)?.data;if(n==null)return;const a=e.scale,o=t.scale,r=this.getBarDirection()==="x",l=O8(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval),[c,h]=a.range,d=Math.abs(h-c);this.aggregationManager.ensureLevelForRange(d);const u=this.aggregationManager.getFilterForRange(d),p=!this.ctx.animationManager.isSkipped(),f=this.contextNodeData?.nodeData!=null&&(s.changeDescription!=null||!LC(s)||u!=null),{groupOffset:y,barOffset:b,barWidth:x}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:n,xValues:i.resolveKeysById(this,"xValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s),xScale:a,yScale:o,groupOffset:y,barOffset:b,barWidth:x,barAlongX:r,crisp:l,dataAggregationFilter:u,animationEnabled:p,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,labelEnabled:this.properties.label.enabled,labelPlacement:this.properties.label.placement,labelPadding:(this.properties.label.spacing+(typeof this.properties.label.padding=="number"?this.properties.label.padding:0))*(this.properties.label.placement==="outside"?1:-1),canIncrementallyUpdate:f,nodes:f?this.contextNodeData.nodeData:[],nodeIndex:0}}prepareNodeDatumState(e,t,i){const s=e.rawData[i],n=e.xValues[i];if(n===void 0&&!this.properties.allowNullKeys)return;const a=e.yLowValues[i],o=e.yHighValues[i];if(!Number.isFinite(a?.valueOf())||!Number.isFinite(o?.valueOf()))return;const[r,l]=a<o?[a,o]:[o,a];return t.datum=s,t.xValue=n,t.yLowValue=r,t.yHighValue=l,t.rawLowValue=a,t.rawHighValue=o,t}createSkeletonNodeDatum(e,t){const i=t.nodeDatumScratch;return{index:t.groupedDataIndex,series:this,datum:i.datum,datumIndex:t.datumIndex,xValue:i.xValue,yLowValue:0,yHighValue:0,yLowKey:e.yLowKey,yHighKey:e.yHighKey,xKey:e.xKey,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:t.crisp,labels:[]}}createNodeDatum(e,t,i,s){const n=this.prepareNodeDatumState(e,t.nodeDatumScratch,t.datumIndex);if(!n)return;const a=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,a,t,s,n),a}updateNodeDatum(e,t,i,s,n){if(n??(n=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex)),!n)return;const a=t;a.index=i.groupedDataIndex,a.datum=n.datum,a.datumIndex=i.datumIndex,a.xValue=n.xValue,a.yLowValue=n.rawLowValue,a.yHighValue=n.rawHighValue,a.crisp=i.crisp;const o=Math.round(e.yScale.convert(i.yHigh)),r=Math.round(e.yScale.convert(i.yLow)),l=Math.max(s,Math.abs(r-o)),c={x:e.barAlongX?Math.min(o,r):i.x,y:e.barAlongX?i.x:Math.min(o,r),width:e.barAlongX?l:i.width,height:e.barAlongX?i.width:l};a.x=c.x,a.y=c.y,a.width=c.width,a.height=c.height;const h=a.midPoint;h.x=c.x+c.width/2,h.y=c.y+c.height/2;const d=a.clipBBox;d&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height);const u=i.labelParamsScratch;u.labels=a.labels,u.datumIndex=i.datumIndex,u.rectX=c.x,u.rectY=c.y,u.rectWidth=c.width,u.rectHeight=c.height,u.yLowValue=n.yLowValue,u.yHighValue=n.yHighValue,u.datum=n.datum,this.updateLabelData(e,u)}createNodeDataWithAggregation(e,t,i,s,n,a){const{maxRange:o,indexData:r,midpointIndices:l}=a,[c,h]=j8(1,o,e.xAxis.range,d=>{const u=d*Vn,p=r[u+Zs],f=l[d];if(f!==-1)return[t(f),t(p)+e.barWidth]});for(let d=c;d<h;d+=1){const u=d*Vn,p=r[u+Ys],f=r[u+Zs],y=r[u+Xs],b=r[u+qs],x=l[d];x===-1||e.xValues[x]===void 0&&!this.properties.allowNullKeys||(i.datumIndex=x,i.groupedDataIndex=0,i.x=t(x),i.width=Math.abs(t(p)-t(f))+e.barWidth,i.yLow=e.yLowValues[y],i.yHigh=e.yHighValues[b],i.crisp=!1,NC(e,i,(S,M)=>this.createNodeDatum(S,M,s,n),(S,M,D)=>this.updateNodeDatum(S,M,D,n)))}}createNodeDataSimple(e,t,i,s,n,a){const o=a.invalidData?.get(this.id);let[r,l]=this.visibleRangeIndices("xValue",e.xAxis.range);a.input.count<1e3&&(r=0,l=a.input.count);for(let c=r;c<l;c+=1)o?.[c]!==!0&&(i.datumIndex=c,i.groupedDataIndex=0,i.x=t(c),i.width=e.barWidth,i.yLow=e.yLowValues[c],i.yHigh=e.yHighValues[c],i.crisp=e.crisp,NC(e,i,(h,d)=>this.createNodeDatum(h,d,s,n),(h,d,u)=>this.updateNodeDatum(h,d,u,n)))}createNodeDataGrouped(e,t,i,s,n){const a=this.processedData;for(const{datumIndex:o,groupIndex:r}of this.dataModel.forEachGroupDatum(this,a))i.datumIndex=o,i.groupedDataIndex=r,i.x=t(o),i.width=e.barWidth,i.yLow=e.yLowValues[o],i.yHigh=e.yHighValues[o],i.crisp=e.crisp,NC(e,i,(l,c)=>this.createNodeDatum(l,c,s,n),(l,c,h)=>this.updateNodeDatum(l,c,h,n))}populateNodeData(e){const{processedData:t}=this;if(!t)return;const{yLowKey:i,yHighKey:s,strokeWidth:n}=this.properties,a=`${i}-${s}`,o=l=>{const c=e.xScale.convert(e.xValues[l]);return Number.isFinite(c)?Math.round(c)+e.groupOffset+e.barOffset:Number.NaN},r={nodeDatumScratch:{datum:void 0,xValue:void 0,yLowValue:0,yHighValue:0,rawLowValue:void 0,rawHighValue:void 0},labelParamsScratch:{labels:[],datumIndex:0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,yLowValue:0,yHighValue:0,datum:void 0},datumIndex:0,groupedDataIndex:0,x:0,width:0,yLow:0,yHigh:0,crisp:!1};e.dataAggregationFilter!=null?this.createNodeDataWithAggregation(e,o,r,a,n,e.dataAggregationFilter):t.type==="ungrouped"?this.createNodeDataSimple(e,o,r,a,n,t):this.createNodeDataGrouped(e,o,r,a,n)}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){const{yLowKey:t,yHighKey:i}=this.properties,s=`${t}-${i}`,n=this.getCategoryAxis(),a=this.getValueAxis(),o=n&&a&&this.chart?.seriesRect?Y8(this.properties.segmentation,n,a,this.chart.seriesRect,this.ctx.scene):void 0;return{itemId:s,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:U8(this.getItemStyle.bind(this)),segments:o}}assembleResult(e,t){for(const i of e.nodes)t.labelData.push(...i.labels);return t}updateLabelData(e,t){const i=t.labels;if(!e.labelEnabled){i.length>0&&(i.length=0);return}const{xKey:s,yLowKey:n,yHighKey:a,xName:o,yLowName:r,yHighName:l,yName:c,legendItemName:h,label:d}=this.properties,u=e.barAlongX,p=e.labelPlacement,f=e.labelPadding,y=t.rectX,b=t.rectY,x=t.rectWidth,v=t.rectHeight,S=y+(u?-f:x/2),M=b+(u?v/2:v+f);let D;p==="outside"?D=u?"right":"center":D=u?"left":"center";let I;p==="outside"?I=u?"middle":"top":I=u?"middle":"bottom";const k=y+(u?x+f:x/2),C=b+(u?v/2:-f);let A;p==="outside"?A=u?"left":"center":A=u?"right":"center";let w;p==="outside"?w=u?"middle":"bottom":w=u?"middle":"top";const T=t.datum,O=t.yLowValue,z=t.yHighValue,V=t.datumIndex,E={datum:T,xKey:s,yLowKey:n,yHighKey:a,xName:o,yLowName:r,yHighName:l,yName:c,legendItemName:h},_=this.getSeriesDomain("y").domain,G=this.getLabelText(O,T,n,"y",_,d,{itemType:"low",value:O,...E}),B=this.getLabelText(z,T,a,"y",_,d,{itemType:"high",value:z,...E});if(i.length>0&&i[0].itemType==="low"){const F=i[0];F.datumIndex=V,F.x=S,F.y=M,F.textAlign=D,F.textBaseline=I,F.text=G,F.datum=T}else i[0]={datumIndex:V,x:S,y:M,textAlign:D,textBaseline:I,text:G,itemType:"low",datum:T,series:this};if(i.length>1&&i[1].itemType==="high"){const F=i[1];F.datumIndex=V,F.x=k,F.y=C,F.textAlign=A,F.textBaseline=w,F.text=B,F.datum=T}else i[1]={datumIndex:V,x:k,y:C,textAlign:A,textBaseline:w,text:B,itemType:"high",datum:T,series:this};i.length=2}nodeFactory(){return new $8}getStyle(e,t){const{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!e&&h){const u=this.makeStylerParams(t);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??o,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:d,yHighKey:u}=this.properties,p=Z8(e??Uz.None);return{cornerRadius:i,fill:s,fillOpacity:n,highlightState:p,lineDash:a,lineDashOffset:o,seriesId:t,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:d,yHighKey:u}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return LC(this.processedData)?i.update(s,void 0,n=>this.getDatumId(n)):i.update(s)}getItemStyle(e,t,i){const{properties:s,dataModel:n,processedData:a}=this,{itemStyler:o}=s,r=this.getHighlightStyle(t,e,i);let l=re(r,this.getStyle(e===void 0,i));if(o&&n!=null&&a!=null&&e!=null){const c=n.resolveKeysById(this,"xValue",a)[e],h=this.cachedDatumCallback(W8(this.getDatumId({xValue:c}),t?"highlight":"node"),()=>{const d=this.makeItemStylerParams(e,t,l);return this.callWithContext(o,d)});h&&(l=re(h,l))}return l}makeItemStylerParams(e,t,i){const{id:s,properties:n,processedData:a}=this,{xKey:o,yHighKey:r,yLowKey:l}=n,c=a.dataSources.get(s)?.data[e],h=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(h,t,e),u=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:c,xKey:o,yHighKey:r,yLowKey:l,highlightState:d,...i,fill:u}}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight();e.datumSelection.each((i,s)=>{if(!e.datumSelection.isGarbage(i)){const n=this.getHighlightState(t,e.isHighlight,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,e.isHighlight,n)}})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),n=this.getCategoryDirection()==="x",a=this.getShapeFillBBox(),o=this;e.each(function(l,c){const h=c.style??i.styles[o.getHighlightState(s,t,c.datumIndex)];l.setStyleProperties(h,a),l.setStaticProperties("overlay",h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,n?c.width>0:c.height>0,c.crisp,void 0)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=K8.None})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},s=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((n,a)=>{n.fillOpacity=this.getHighlightStyle(t,a?.datumIndex).opacity??1,P8(this,n,i,this.properties.label,a,t,s)})}getHighlightLabelData(e,t){return t.labels?.length?t.labels:super.getHighlightLabelData(e,t)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u,legendItemName:p}=n,f=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!s||!f||!y)return;const b=s.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"xValue",s)[e],v=i.resolveColumnById(this,"yHighValue",s)[e],S=i.resolveColumnById(this,"yLowValue",s)[e],M=this.properties.allowNullKeys??!1;if(x===void 0&&!M)return;const D=this.getItemStyle(e,!1),I=`${this.getAxisValueText(y,"tooltip",S,b,l,p)} - ${this.getAxisValueText(y,"tooltip",v,b,c,p)}`;return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(f,"tooltip",x,b,a,p),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${d??c}`,value:I,missing:N.isTooltipValueMissing(v)&&N.isTooltipValueMissing(S)}]},{seriesId:t,datum:b,title:r,xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,legendItemName:p,...D})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.getStyle(!1,Uz.None);return{marker:{fill:e,stroke:t,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yName:s,yLowName:n,yHighName:a,yLowKey:o,yHighKey:r,legendItemName:l,showInLegend:c}=this.properties,h=l??s??`${n??o} - ${a??r}`,d=`${o}-${r}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}resetDatumAnimation(e){B8([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=jz(Wz(this.isVertical(),"normal"),"unknown");Kz.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),$z(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,previousContextData:n}=e,a=N.calculateDataDiff(this.id,t,this.getDatumId.bind(this),s,n,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=n==null?"fade":"normal",r=jz(Wz(this.isVertical(),o),"added");Kz.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),a),(a?.changed||!Ka(s.groupScale,n?.groupScale))&&$z(this,"labels",this.ctx.animationManager,i,this.highlightLabelSelection)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return G8(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};TC.className="RangeBarSeries",TC.type="range-bar";var{rangeBarSeriesThemeableOptionsDef:Q8}=N,OC={...qe,...Q8,type:j(Ae("range-bar")),xKey:j(L),yLowKey:j(L),yHighKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,yLowName:L,yHighName:L,legendItemName:L,segmentation:fo,width:gn,widthRatio:ne};OC.pickOutsideVisibleMinorAxis=Q(R),OC.focusPriority=Q(W);var J8={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:Us,segmentation:vl},axes:{number:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:eQ}=N,Xv={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,groupable:!0,version:ue,dependencies:[ri],options:OC,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:eQ,defaultAxes:Ld,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:J8,create:e=>new TC(e)},{AbstractBarSeriesProperties:tQ,makeSeriesTooltip:iQ,DropShadow:sQ,Label:nQ}=N,qv=class extends X{};g([m],qv.prototype,"totalType",2),g([m],qv.prototype,"index",2),g([m],qv.prototype,"axisLabel",2);var Yz=class extends X{};g([m],Yz.prototype,"renderer",2);var PC=class extends nQ{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};g([m],PC.prototype,"placement",2),g([m],PC.prototype,"spacing",2);var Fs=class extends X{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new sQ().set({enabled:!1}),this.label=new PC,this.tooltip=new Yz}};g([m],Fs.prototype,"name",2),g([m],Fs.prototype,"fill",2),g([m],Fs.prototype,"stroke",2),g([m],Fs.prototype,"fillOpacity",2),g([m],Fs.prototype,"strokeOpacity",2),g([m],Fs.prototype,"lineDash",2),g([m],Fs.prototype,"lineDashOffset",2),g([m],Fs.prototype,"strokeWidth",2),g([m],Fs.prototype,"cornerRadius",2),g([m],Fs.prototype,"itemStyler",2),g([m],Fs.prototype,"shadow",2),g([m],Fs.prototype,"label",2),g([m],Fs.prototype,"tooltip",2);var Wh=class extends X{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};g([m],Wh.prototype,"enabled",2),g([m],Wh.prototype,"stroke",2),g([m],Wh.prototype,"strokeOpacity",2),g([m],Wh.prototype,"lineDash",2),g([m],Wh.prototype,"lineDashOffset",2),g([m],Wh.prototype,"strokeWidth",2);var Qv=class extends X{constructor(){super(...arguments),this.positive=new Fs,this.negative=new Fs,this.total=new Fs}};g([m],Qv.prototype,"positive",2),g([m],Qv.prototype,"negative",2),g([m],Qv.prototype,"total",2);var cl=class extends tQ{constructor(){super(...arguments),this.item=new Qv,this.totals=new Bi(qv),this.line=new Wh,this.tooltip=iQ()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:s,fill:n,stroke:a,lineDash:o,lineDashOffset:r,cornerRadius:l}=this.item[e==="subtotal"?"total":e];return{fill:n,fillOpacity:t,stroke:a,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:r,cornerRadius:l,opacity:1}}};g([m],cl.prototype,"xKey",2),g([m],cl.prototype,"yKey",2),g([m],cl.prototype,"xName",2),g([m],cl.prototype,"yName",2),g([m],cl.prototype,"item",2),g([m],cl.prototype,"totals",2),g([m],cl.prototype,"line",2),g([m],cl.prototype,"tooltip",2);var{adjustLabelPlacement:aQ,SeriesNodePickMode:Zz,fixNumericExtent:oQ,valueProperty:Xz,keyProperty:rQ,accumulativeValueProperty:Jv,trailingAccumulatedValueProperty:lQ,createDatumId:EC,checkCrisp:cQ,updateLabelNode:hQ,prepareBarAnimationFunctions:dQ,collapsedStartingBarPosition:uQ,resetBarSelectionsDirect:pQ,resetBarSelectionsFn:gQ,seriesLabelFadeInAnimation:fQ,resetLabelFn:mQ,animationValidation:yQ,DEFAULT_CARTESIAN_DIRECTION_KEYS:xQ,DEFAULT_CARTESIAN_DIRECTION_NAMES:bQ,computeBarFocusBounds:vQ,Rect:SQ,motion:MQ,getItemStylesPerItemId:DQ,DataSet:kQ,processedDataIsAnimatable:IQ,upsertNodeDatum:AQ}=N,RC=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:xQ,propertyNames:bQ,categoryKey:void 0,pickModes:[Zz.NEAREST_NODE,Zz.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:gQ,label:mQ}}),this.properties=new cl,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:s}=this.properties,{data:n}=this;if(!this.visible)return;const a=S=>Uc(S)&&Number(S)>=0,o=S=>Uc(S)&&Number(S)>=0,r=S=>S==="total"||S==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((S,M)=>{const D=S.get(M.index);return D?D.push(M):S.set(M.index,[M]),S},new Map);for(const[S,M]of n?.data.entries()??[]){c.push(M);const D=h.get(S);if(D)for(const I of D)c.push({...I.toJson(),[t]:I.axisLabel})}const d=[];this.ctx.animationManager.isSkipped()||d.push(yQ());const u=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:y,yScaleType:b}=this.getScaleInformation({xScale:u,yScale:p}),x=this.properties.allowNullKeys??!1,{processedData:v}=await this.requestDataModel(e,kQ.wrap(c),{props:[rQ(t,y,{id:"xValue",allowNullKey:x}),Jv(i,b,{...l,id:"yCurrent"}),Jv(i,b,{...l,missingValue:0,id:"yCurrentTotal"}),Jv(i,b,{...l,id:"yCurrentPositive",validation:a}),Jv(i,b,{...l,id:"yCurrentNegative",validation:o}),lQ(i,b,{...l,id:"yPrevious"}),Xz(i,b,{id:"yRaw"}),Xz("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...f?[N.SMALLEST_KEY_INTERVAL,N.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=v.reduced?.smallestKeyInterval,this.largestDataInterval=v.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s],values:n}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category"){const l=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:l}}const o=e==="y",r=this.getCategoryAxis().isReversed();return{domain:this.padBandExtent(s,r!==o)}}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),o=n[a],r=[Math.min(0,o[0]),Math.max(0,o[1])];return{domain:oQ(r)}}}getSeriesRange(){return[Number.NaN,Number.NaN]}populateNodeData(e){let t=0;const i={datumIndex:0,datum:void 0,xDatum:void 0,value:void 0,cumulativeValue:void 0,trailingValue:void 0,datumType:void 0};for(const[s,n]of e.rawData.entries()){const a=e.totalTypeValues[s],o=this.isSubtotal(a),r=this.isTotal(a),l=r||o,c=e.xValues[s];if(c===void 0&&!this.properties.allowNullKeys)continue;const h=e.yRawValues[s],{cumulativeValue:d,trailingValue:u}=this.computeWaterfallValues(e,s,r,o,t);l&&(t=d??0);const p=this.computeDisplayValue(r,o,h,d,u);i.datumIndex=s,i.datum=n,i.xDatum=c,i.value=p,i.cumulativeValue=d,i.trailingValue=u,i.datumType=a;const f=AQ(e,i,(y,b)=>this.createNodeDatum(y,b),(y,b,x)=>this.updateNodeDatum(y,b,x));if(f){const y=this.createPointDatum(e,f,d,u,l);e.pointData.push(y)}}}finalizeNodeData(e){e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){return{itemId:this.properties.yKey,nodeData:e.nodes,labelData:e.nodes,pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:DQ(this.getItemStyle.bind(this),"total","subtotal","positive","negative")}}assembleResult(e,t){const i=this.properties.line.enabled;return e.yCurrValues!=null&&i&&(t.pointData=e.pointData),t}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s||s.type!=="ungrouped")return;const n=this.getCategoryAxis(),a=this.getValueAxis();if(!n||!a)return;const o=e.scale,r=t.scale,l=i.resolveKeysById(this,"xValue",s),c=i.resolveColumnById(this,"yRaw",s),h=i.resolveColumnById(this,"totalTypeValue",s),d=i.resolveColumnById(this,"yCurrent",s),u=i.resolveColumnById(this,"yPrevious",s),p=i.resolveColumnById(this,"yCurrentTotal",s),f=s.dataSources.get(this.id)?.data??[],{xKey:y,yKey:b,xName:x,yName:v,line:S}=this.properties,{contextNodeData:M}=this,D=!this.ctx.animationManager.isSkipped(),I=M?.nodeData!=null&&s.changeDescription!=null,{barWidth:k}=this.getBarDimensions();return{xAxis:e,yAxis:t,xScale:o,yScale:r,categoryAxis:n,valueAxis:a,barAlongX:this.getBarDirection()==="x",barWidth:k,categoryAxisReversed:n.isReversed(),valueAxisReversed:a.isReversed(),crisp:cQ(n.scale,n.visibleRange,this.smallestDataInterval,this.largestDataInterval),animationEnabled:D,xKey:y,yKey:b,xName:x,yName:v,lineStrokeWidth:S.strokeWidth,yDomain:this.getSeriesDomain("y").domain,xValues:l,rawData:f,yRawValues:c,totalTypeValues:h,yCurrValues:d,yPrevValues:u,yCurrTotalValues:p,canIncrementallyUpdate:I,nodes:I?M.nodeData:[],nodeIndex:0,pointData:[]}}computeWaterfallValues(e,t,i,s,n){return i||s?{cumulativeValue:e.yCurrTotalValues[t],trailingValue:s?n:0}:{cumulativeValue:e.yCurrValues[t],trailingValue:e.yPrevValues[t]}}computeDisplayValue(e,t,i,s,n){return e?s:t?(s??0)-(n??0):i}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:s,crisp:n}=e,{datumIndex:a,datum:o,xDatum:r,value:l,cumulativeValue:c,datumType:h}=t,d=(l??0)>=0,u=this.getSeriesItemType(d,h);return{index:a,series:this,itemType:u,datum:o,datumIndex:a,cumulativeValue:c??0,xValue:r,yValue:l,yKey:s,xKey:i,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:n,label:{text:"",x:0,y:0,textAlign:"center",textBaseline:"middle"}}}updateNodeDatum(e,t,i){const{xScale:s,yScale:n,barAlongX:a,barWidth:o,valueAxisReversed:r,xKey:l,yKey:c,xName:h,yName:d,yDomain:u,crisp:p}=e,{datumIndex:f,datum:y,xDatum:b,value:x,cumulativeValue:v,trailingValue:S,datumType:M}=i,D=t,I=Math.round(s.convert(b));if(!Number.isFinite(I))return;const k=(x??0)>=0,C=this.getSeriesItemType(k,M),{strokeWidth:A,label:w}=this.getItemConfig(C),T=Math.round(n.convert(v)),O=Math.round(n.convert(S)),z=k?T:O,V=k?O:T,E=Math.max(A,Math.abs(V-z)),_=a?Math.min(z,V):I,G=a?I:Math.min(z,V),B=a?E:o,F=a?o:E;if(D.index=f,D.itemType=C,D.datum=y,D.datumIndex=f,D.cumulativeValue=v??0,D.xValue=b,D.yValue=x,D.x=_,D.y=G,D.width=B,D.height=F,D.crisp=p,D.midPoint?(D.midPoint.x=_+B/2,D.midPoint.y=G+F/2):D.midPoint={x:_+B/2,y:G+F/2},w.enabled){const Y=C==="subtotal"?"total":C,Z=this.getLabelText(x,y,c,"y",u,w,{itemType:Y,value:x,datum:y,xKey:l,yKey:c,xName:h,yName:d}),ie=w.spacing+(typeof w.padding=="number"?w.padding:0),ee=aQ({isUpward:(x??-1)>=0!==r,isVertical:!a,placement:w.placement,spacing:ie,rect:{x:_,y:G,width:B,height:F}});D.label.text=Z,D.label.x=ee.x,D.label.y=ee.y,D.label.textAlign=ee.textAlign,D.label.textBaseline=ee.textBaseline}else D.label.text=""}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}createPointDatum(e,t,i,s,n){const{yScale:a,barAlongX:o,categoryAxisReversed:r,lineStrokeWidth:l}=e,c=Math.round(a.convert(i)),h=Math.round(a.convert(s)),d=n?c:h,u=Math.floor(l)%2/2,p=r?c:d,f=r?d:c,y={x:t.x,y:t.y,width:t.width,height:t.height};let b,x;return o?(b={x:p+u,y:y.y},x={x:f+u,y:y.y+y.height}):(b={x:y.x,y:p+u},x={x:y.x+y.width,y:f+u}),{x:r?x.x:b.x,y:r?x.y:b.y,x2:r?b.x:x.x,y2:r?b.y:x.y,size:0}}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const s=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=e.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[s]??[],r=i.domain.values[n]??[];o.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[a];if(l)for(const c of l)(c==="total"||c==="subtotal")&&t.add("total")}isSubtotal(e){return e==="subtotal"}isTotal(e){return e==="total"}nodeFactory(){return new SQ}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return IQ(this.processedData)?i.update(s,void 0,n=>EC(n.datumIndex)):i.update(s)}getItemStyle(e,t,i,s="total"){const{properties:n}=this,{datumIndex:a=0,datum:o}=e??{},r=s==="subtotal"?"total":s,l=n.item[r],c=this.getHighlightStyle(t,a,i),h=re(c,n.getStyle(s)),{itemStyler:d}=l;let u=h;if(d!=null&&e!=null){const p=this.cachedDatumCallback(EC(a,t?"highlight":"node"),()=>{const f=this.makeItemStylerParams(s,a,o,t,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(d,f))});p&&(u=re(p,u))}return u}makeItemStylerParams(e,t,i,s,n){const{id:a,properties:o}=this,{xKey:r,yKey:l}=o,c=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(c,s,t),d=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:a,itemType:e,datum:i,xKey:r,yKey:l,highlightState:h,...n,fill:d}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),n=this.getCategoryDirection()==="x",a=this.getShapeFillBBox();e.each((o,r)=>{const l=r.style??i.styles[r.itemType][this.getHighlightState(s,t,r.datumIndex)];o.setStyleProperties(l,a),o.cornerRadius=l.cornerRadius??0,o.visible=n?r.width>0:r.height>0,o.crisp=r.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(t.length===0)return i.update([]);const s=t.filter(n=>{const{label:a}=this.getItemConfig(n.itemType);return a.enabled});return i.update(s)}updateLabelNodes({labelSelection:e,isHighlight:t}){const i={itemType:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},s=this.ctx.highlightManager?.getActiveHighlight();e.each((n,a)=>{i.itemType=a.itemType;const o=this.getHighlightStyle(t,a.datumIndex)?.opacity??1;n.visible=!0,n.fillOpacity=o;const r=this.getItemConfig(a.itemType).label;hQ(this,n,i,r,a.label,t,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yKey:r,yName:l,tooltip:c,legendItemName:h}=n,d=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.data[e],f=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yRaw",s)[e],b=i.resolveColumnById(this,"yCurrentTotal",s),x=i.resolveColumnById(this,"totalTypeValue",s),v=this.properties.allowNullKeys??!1;if(f===void 0&&!v)return;const S=x[e],M=(y??0)>=0,D=this.getSeriesItemType(M,S);let I;if(this.isTotal(S))I=b[e];else if(this.isSubtotal(S)){I=b[e];for(let A=e-1;A>=0;A-=1)if(this.isSubtotal(x[A])){I=I-b[A];break}}else I=y;const k=this.contextNodeData?.nodeData?.[e],C=this.getItemStyle(k,!1,void 0,k?.itemType);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",f,p,a,h),symbol:this.legendItemSymbol(D),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(u,"tooltip",I,p,r,h),missing:N.isTooltipValueMissing(I)}]},{seriesId:t,datum:p,title:l,itemType:D,xKey:a,xName:o,yKey:r,yName:l,...C})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.getItemConfig(e);return{marker:{fill:t,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,seriesItemTypes:i}=this,s=[],n=o=>o.charAt(0).toUpperCase()+o.substring(1),{showInLegend:a}=this.properties;for(const o of i){const{name:r}=this.getItemConfig(o);s.push({legendType:"category",id:t,itemId:EC(o),seriesId:t,enabled:!0,label:{text:r??n(o)},symbol:this.legendItemSymbol(o),hideInLegend:!a,isFixed:!0})}return s}toggleSeriesItem(){}resetDatumAnimation(e){pQ([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s}=e,n=dQ(uQ(this.isVertical(),this.axes,"normal"),"unknown");MQ.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n),fQ(this,"labels",this.ctx.animationManager,i);const{pointData:a}=s;a&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),a=n?.isReversed(),o=a?(h,d)=>h<d:(h,d)=>h>d,r=n?.scale.convert(0),l=t.reduce((h,d)=>(o(d.x,h)&&(h=d.x),h),a?1/0:0),c=(h,d,u,p,f)=>(h-d)/(u-d)*(f-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Tr,collapsable:!1,onUpdate(h){s.clear(!0);for(const[d,u]of t.entries()){const p=c(h,r,l,r,u.x),f=c(h,r,l,r,u.x2);d!==0&&s.lineTo(p,u.y),s.moveTo(f,u.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),a=n?.isReversed(),o=a?(h,d)=>h>d:(h,d)=>h<d,r=n?.scale.convert(0),l=t.reduce((h,d)=>(o(d.y,h)&&(h=d.y),h),a?0:1/0),c=(h,d,u,p,f)=>(h-d)/(u-d)*(f-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Tr,collapsable:!1,onUpdate(h){s.clear(!0);for(const[d,u]of t.entries()){const p=c(h,r,l,r,u.y),f=c(h,r,l,r,u.y2);d!==0&&s.lineTo(u.x,p),s.moveTo(u.x2,f)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(t.length===0)return;const[i]=t;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:n}=e;if(n){for(const[a,o]of n.entries())a!==0&&s.lineTo(o.x,o.y),s.moveTo(o.x2,o.y2);i.checkPathDirty()}}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,lineJoin:"round",pointerEvents:N.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}computeFocusBounds({datumIndex:e}){return vQ(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return e.itemStyler!=null||e.label.itemStyler!=null||t.itemStyler!=null||t.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};RC.className="WaterfallSeries",RC.type="waterfall";var{waterfallSeriesThemeableOptionsDef:CQ}=N,wQ={...CQ,...qe,type:j(Ae("waterfall")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,totals:Ft({totalType:j(U("total","subtotal")),index:j(P),axisLabel:j(L)},"a total definition options array"),width:gn};function zC(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",fy(e)],["image",it],["pattern",by(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...Ye,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var LQ={series:{item:{positive:zC("altUp",0),negative:zC("altDown",1),total:zC("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:Sy},legend:{enabled:!0,toggleSeries:!1}},VC={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,solo:!0,version:ue,dependencies:[ri],options:wQ,defaultAxes:Ld,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:LQ,create:e=>new RC(e)},qz={width:P,height:P,grip:R,fill:te,stroke:te,strokeWidth:P,cornerRadius:P},wn=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],Qz=[...wn,"errorBar","label","legendItemName"],Jz=[...wn,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],eV=[...wn,"title","label","labelKey","labelName","sizeName"],tV=[...wn,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],iV=[...wn,"label"],sV=[...wn,"errorBar","title","label"],nV=[...wn,"label","yLowName","yHighName"],aV=[...wn,"direction","label","yLowName","yHighName"],oV=[...wn,"errorBar","title","label","labelKey","labelName"],rV=[...wn,"direction"],NQ={enabled:R,height:P,spacing:P,cornerRadius:W,mask:{fill:te,fillOpacity:ne,stroke:te,strokeWidth:P},minHandle:qz,maxHandle:qz,miniChart:{enabled:R,padding:{top:P,bottom:P},label:{enabled:R,avoidCollisions:R,spacing:P,format:fn,formatter:Di($i),interval:{minSpacing:P,maxSpacing:P,values:pn,step:W},...$e},series:Ft(yl({area:J(DI.options,[...wn,"type"]),bar:J(_b.options,[...Qz,"type"]),"box-plot":J(oC.options,[...Jz,"type"]),bubble:J(NI.options,[...eV,"type"]),candlestick:J(jv.options,[...wn,"type"]),heatmap:J(fC.options,[...tV,"type"]),histogram:J(OI.options,[...iV,"type"]),line:J($b.options,[...sV,"type"]),ohlc:J(Wv.options,[...wn,"type"]),"range-area":J(Zv.options,[...nV,"type"]),"range-bar":J(Xv.options,[...aV,"type"]),scatter:J(zI.options,[...oV,"type"]),waterfall:J(VC.options,[...rV,"type"])},"miniChart series options"))}},TQ=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],OQ=["itemStyler","simpleItemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function lV(e,t){return{$merge:[{$switch:[t,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[t,wn,["bar",Qz],["box-plot",Jz],["bubble",eV],["heatmap",tV],["histogram",iV],["line",[...sV,...OQ]],["range-area",nV],["range-bar",aV],["scatter",oV],["waterfall",rV]]},e]}]}}var PQ={enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:ki.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[lV({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:TQ.map(e=>({$eq:[{$path:"/series/0/type"},e]}))},{$map:[lV({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},BC={type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,version:ue,options:NQ,themeTemplate:PQ,create:e=>new kp(e)},cV=class extends nl{};g([m],cV.prototype,"value",2);var{userInteraction:EQ,LayoutElement:RQ,Toolbar:zQ}=N,FC=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new Bi(cV),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new zQ(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(RQ.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("zoom:change-complete",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.toolbar.getElement().remove(),this.toolbar.destroy()}onLayoutStart({layoutBox:e}){const{buttons:t,ctx:i,enabled:s,toolbar:n,verticalSpacing:a}=this;if(!s||!i.zoomManager.isZoomEnabled()){n.setHidden(!0);return}n.setHidden(!1),n.updateButtons(t);const o=n.getBounds().height;n.setBounds({x:e.x,y:e.y+e.height-o,width:e.width,height:o}),e.shrink({bottom:o+a})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i,n=EQ(`zoom-range-button-${e}`);s==null?t.resetZoom(n):typeof s=="number"?t.extendToEnd(n,"x",s):Array.isArray(s)?t.updateWith(n,"x",()=>s):typeof s=="function"&&t.updateWith(n,"x",s),this.toolbar.toggleActiveButtonByIndex(e)}};g([m],FC.prototype,"enabled",2),g([m],FC.prototype,"buttons",2);var hV=1e3*60*60*24,_C=hV*30,VQ=hV*365,HC={type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,version:ue,options:{enabled:R,buttons:Ft({...dr,value:Se(W,Fe(me(Se(W,ns)),rr(2,2)),ot)},"range button options array")},themeTemplate:{enabled:!1,buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:_C},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*_C},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*_C},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:VQ},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:void 0}]}},create:e=>new FC(e)},{SliderWidget:dV}=N,uV=400,BQ=50,FQ=class{constructor(e){this.applyStep=e}start(e){this.setTarget(e),this.run(uV)}updateTarget(e){this.setTarget(e),this.isActive()||this.run(uV)}stop(e=!0){this.clearTimer(),e&&(this.target=void 0)}setTarget(e){this.target=ae(0,e,1)}run(e){if(this.target==null){this.stop();return}if(this.applyStep(this.target)){this.stop();return}this.schedule(e)}schedule(e){this.isActive()||(this.timer=setTimeout(()=>{this.timer=void 0,this.run(BQ)},e))}clearTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=void 0)}isActive(){return this.timer!=null}},_Q=class{constructor(){this.min=0,this.span=1,this.thumbSpan=1}update(e,t,i=this.thumbSpan){const s=ae(0,t-e,1);this.span=s,this.thumbSpan=ae(0,i,1),this.min=this.clampMin(e,s)}clampMin(e,t=this.span){return ae(0,e,1-t)}getThumbBounds(e=this.min,t=this.thumbSpan){const i=this.clampMin(e,t);return{start:i,end:i+t}}isWithinThumb(e){const{start:t,end:i}=this.getThumbBounds();return e>=t&&e<=i}getJumpRange(e){if(!this.canScroll())return;let t=this.clampMin(e-this.thumbSpan/2,this.thumbSpan);return t=this.clampMin(t),{min:t,max:t+this.span}}getStepRange(e){if(!this.canScroll())return;const t=ae(0,e,1),{start:i,end:s}=this.getThumbBounds();if(t>=i&&t<=s)return;const n=t<i,a=n?i-t:t-s,o=Math.min(this.span,a),r=this.clampMin(this.min+(n?-o:o));return{min:r,max:r+this.span}}canScroll(){return this.span>0&&this.span<1}},HQ=class{constructor(e,t,i,s){this.ctx=e,this.orientation=t,this.onChange=i,this.onHoverChange=s,this.dragStartRatio=0,this.interactionMode="none",this.state=new _Q,this.repeater=new FQ(o=>this.applyStepToward(o)),this.container=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`scrollbar-${t}`,classList:["ag-charts-proxy-scrollbar",`ag-charts-proxy-scrollbar-${t}`],ariaLabel:void 0,role:"presentation"});const n=t==="horizontal"?"ariaLabelScrollbarHorizontal":"ariaLabelScrollbarVertical";this.slider=e.proxyInteractionService.createProxyElement({type:"slider",domIndex:0,tabIndex:0,ariaLabel:{id:n},role:"slider",parent:this.container,classList:["ag-charts-proxy-scrollbar-slider"]});const a=this.slider.getElement();a.ariaValueMin="0",a.ariaValueMax="100",this.slider.step=dV.STEP_HUNDRETH,this.slider.keyboardStep=dV.STEP_ONE,this.slider.orientation=t,this.slider.setPreventsDefault(!1),this.slider.addListener("change",()=>this.onSliderChange()),this.slider.addListener("keydown",o=>this.onSliderKeyDown(o)),this.slider.addListener("drag-start",o=>this.onDragStart(o)),this.slider.addListener("drag-move",o=>this.onDragMove(o)),this.slider.addListener("drag-end",o=>this.onDragEnd(o)),this.slider.addListener("mouseenter",o=>this.handleHoverEvent(o)),this.slider.addListener("mousemove",o=>this.handleHoverEvent(o)),this.slider.addListener("mouseleave",()=>this.onMouseLeave()),this.thumbFocus=e.proxyInteractionService.createProxyElement({type:"region",parent:this.container,classList:["ag-charts-proxy-scrollbar-thumb-focus"],role:"presentation"}),this.thumbFocus.setAriaHidden(!0),this.thumbFocus.setPointerEvents("none")}destroy(){this.interactionBounds=void 0,this.repeater.stop(),this.container.destroy()}updateBounds(e){this.interactionBounds=void 0,this.container.setBounds(e),this.slider.setBounds({x:0,y:0,width:e.width,height:e.height})}updateVisibility(e){this.container.setHidden(!e)}updateMinMax(e,t,i=this.state.thumbSpan,s){this.state.update(e,t,i);const n=this.ctx.localeManager.t("ariaValuePanRange",{min:Math.round(e*100)/100,max:Math.round(t*100)/100}),a=this.slider.getElement();a.ariaValueText=n,(!s?.skipSliderUpdate||Math.abs(this.slider.getValueRatio()-e)>1e-9)&&this.slider.setValueRatio(e,{ariaValueText:n})}updateThumbBounds(e,t,i){const s=Math.max(0,i??0);this.thumbFocus.getElement().style.borderRadius=`${s}px`,this.thumbFocus.setBounds({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height})}update(e,t,i){this.onChange(e,t),this.updateMinMax(e,t,void 0,i)}onSliderChange(){const e=this.state.clampMin(this.slider.getValueRatio()),t=e+this.state.span;this.update(e,t,{skipSliderUpdate:!0})}onSliderKeyDown(e){const{code:t}=e.sourceEvent,i=this.orientation==="vertical",s=i&&t==="ArrowUp"||!i&&t==="ArrowLeft",n=i&&t==="ArrowDown"||!i&&t==="ArrowRight";if(!s&&!n)return;e.sourceEvent.preventDefault();const a=this.slider.getElement();a.step=this.slider.keyboardStep?.attributeValue??"1",s?a.stepDown():n&&a.stepUp(),this.onSliderChange()}onDragMove(e){if(e.sourceEvent.preventDefault(),this.interactionMode==="drag"){const{isHorizontal:n,size:a,start:o}=this.getInteractionBounds()??{};if(o==null||a==null)return;const r=(n?e.originDeltaX:e.originDeltaY)/a,l=this.state.clampMin(this.dragStartRatio+r),c=l+this.state.span;this.update(l,c);return}if(this.interactionMode!=="step")return;const t=this.getPointerInfo(e);if(t==null||!Number.isFinite(t.ratio))return;const{ratio:i,inCrossBounds:s}=t;if(!s){this.repeater.stop();return}this.repeater.updateTarget(i)}onDragEnd(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0,this.setInteraction("none"),this.onHoverChange(!1)}onDragStart(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0;const t=this.getClickInfo(e);if(t?.inBounds){if(t.inThumb){this.dragStartRatio=this.slider.getValueRatio(),this.setInteraction("drag");return}if(e.sourceEvent.shiftKey){this.jumpTo(t.ratio),this.setInteraction("none");return}this.beginStepRepeat(t.ratio)}}onMouseLeave(){this.onHoverChange(!1)}getClickInfo(e){const t=this.getPointerRatio(e);return t==null?void 0:t>=0&&t<=1?{ratio:t,inBounds:!0,inThumb:this.isWithinThumb(t)}:{ratio:0,inBounds:!1,inThumb:!1}}getPointerRatio(e){return this.getPointerInfo(e)?.ratio}getPointerInfo(e){if(e.device==="keyboard")return;const{isHorizontal:t,size:i,start:s,crossStart:n,crossSize:a}=this.getInteractionBounds(),o=t?e.clientX:e.clientY,r=t?e.clientY:e.clientX,l=(o-s)/i,c=r>=n&&r<=n+a;return{ratio:l,inCrossBounds:c}}jumpTo(e){const t=this.state.getJumpRange(e);t&&this.update(t.min,t.max)}applyStepToward(e){const t=this.state.getStepRange(e);return t?(this.update(t.min,t.max),!1):!0}beginStepRepeat(e){this.setInteraction("step"),this.repeater.start(e)}setInteraction(e){this.interactionMode=e,e!=="step"&&this.repeater.stop()}getInteractionBounds(){if(this.interactionBounds)return this.interactionBounds;const{width:e,height:t,left:i,top:s}=this.container.getBoundingClientRect(),n=this.orientation==="horizontal",a=n?e:t,o=n?i:s,r=n?s:i,l=n?t:e;return this.interactionBounds={isHorizontal:n,size:a,start:o,crossStart:r,crossSize:l},this.interactionBounds}isWithinThumb(e){return this.state.isWithinThumb(e)}handleHoverEvent(e){if(this.interactionMode==="drag")return;const t=this.getPointerInfo(e);if(!t){this.onHoverChange(!1);return}const i=this.isWithinThumb(t.ratio);this.onHoverChange(i)}},sa=class extends Zc{constructor(){super(...arguments),this.enabled=!1,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.opacity=1}};g([m,$()],sa.prototype,"enabled",2),g([m,$()],sa.prototype,"fill",2),g([m,$()],sa.prototype,"fillOpacity",2),g([m,$()],sa.prototype,"stroke",2),g([m,$()],sa.prototype,"strokeWidth",2),g([m,$()],sa.prototype,"strokeOpacity",2),g([m],sa.prototype,"lineDash",2),g([m],sa.prototype,"lineDashOffset",2),g([m],sa.prototype,"cornerRadius",2),g([m],sa.prototype,"opacity",2);var GC=class extends Zc{};g([m,$()],GC.prototype,"fill",2),g([m,$()],GC.prototype,"stroke",2);var eS=class extends sa{constructor(){super(...arguments),this.minSize=20,this.hoverStyle=new GC}};g([m,$()],eS.prototype,"minSize",2),g([m],eS.prototype,"hoverStyle",2);var Xo=class extends Zc{constructor(){super(...arguments),this.enabled=!1,this.thickness=12,this.spacing=4,this.tickSpacing=0,this.placement="outer",this.visible="auto",this.track=new sa,this.thumb=new eS}};g([m,$()],Xo.prototype,"enabled",2),g([m,$()],Xo.prototype,"thickness",2),g([m,$()],Xo.prototype,"spacing",2),g([m,$()],Xo.prototype,"tickSpacing",2),g([m,$()],Xo.prototype,"placement",2),g([m,$()],Xo.prototype,"visible",2),g([m],Xo.prototype,"track",2),g([m],Xo.prototype,"thumb",2);var pV=class extends Xo{};g([m,$()],pV.prototype,"position",2);var gV=class extends Xo{};g([m,$()],gV.prototype,"position",2);var{BBox:Np,Group:GQ,Rect:fV,LayoutElement:jQ,InteractionState:WQ}=N,ro=class extends hi{constructor(e){super(),this.ctx=e,this.track=new sa,this.thumb=new eS,this.horizontal=new pV,this.vertical=new gV,this.state={horizontal:this.createOrientationState("horizontal"),vertical:this.createOrientationState("vertical")},this.cleanup.register(e.scene.attachNode(this.state.horizontal.group),e.scene.attachNode(this.state.vertical.group),e.layoutManager.registerElement(jQ.Scrollbar,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",()=>this.updateThumbs()))}createOrientationState(e){const t=new GQ({name:`scrollbar-${e}`,zIndex:17}),i=new fV,s=new fV;t.append(i),t.append(s);const n=new HQ(this.ctx,e,(o,r)=>this.handleUserChange(e,o,r),o=>this.handleHoverChange(e,o)),a=this.resolveProperties(e);return{orientation:e,group:t,track:i,thumb:s,dom:n,properties:a,position:this.getDefaultPosition(e),positionHasAxis:!1,hovered:!1}}resolveProperties(e){return e==="horizontal"?this.horizontal:this.vertical}getDefaultPosition(e){return e==="horizontal"?"bottom":"left"}resolveAxis(e,t){const i=e==="horizontal"?"x":"y",s=this.ctx.axisManager.getAxisContext(i);if(s.length===0)return{position:this.getDefaultPosition(e),positionHasAxis:!1};if(t==null){const a=s[0];return{axis:a,position:a.position??this.getDefaultPosition(e),positionHasAxis:!0}}const n=s.find(a=>a.position===t);return n?{axis:n,position:t,positionHasAxis:!0}:{axis:s[0],position:t,positionHasAxis:!1}}onLayoutStart({scrollbars:e,layoutBox:t}){for(const i of["horizontal","vertical"]){const s=this.state[i],n=this.resolveProperties(i),{min:a,max:o}=this.getZoomRange(s.orientation),r=ae(0,o-a,1),{axis:{axisId:l}={},position:c,positionHasAxis:h}=this.resolveAxis(i,n.position);s.properties=n,s.axisId=l,s.position=c,s.positionHasAxis=h;const d=this.updateVisibility(s,r);if(!d||l==null)continue;const{thickness:u,spacing:p,placement:f,tickSpacing:y}=n;h?e[l]={enabled:d,thickness:u,spacing:p,tickSpacing:y,placement:f}:t.shrink(p+u,c),this.updateStyles(s)}}onLayoutComplete(e){this.seriesRect=e.series.rect;for(const t of["horizontal","vertical"]){const i=this.state[t],{properties:{enabled:s,visible:n}}=i;if(!s||n==="never")continue;const a=this.getLayoutRect(i,t,e);i.layoutRect=a,a&&(this.updateTrack(i,a),this.updateThumb(i,a))}}getLayoutRect(e,t,i){const{properties:{thickness:s,spacing:n},position:a,positionHasAxis:o}=e,r=e.axisId?i.axes[e.axisId]:void 0;if(!r)return;const{x:l,y:c,width:h,height:d}=i.series.rect,u=t==="horizontal";if(!o)if(u){const b=a==="bottom"?c+d+n:c-n-s;return new Np(l,b,h,s)}else{const b=a==="right"?l+h+n:l-n-s;return new Np(b,c,s,d)}const{scrollbar:p,translation:f}=r;if(!p?.enabled)return;const y=u?f.y+p.offset:f.x+p.offset;return u?new Np(l,y,h,s):new Np(y,c,s,d)}updateStyles({track:e,thumb:t,properties:i,hovered:s}){e.setStyleProperties(i.track),e.cornerRadius=i.track.cornerRadius??0,e.opacity=i.track.opacity??1,t.setStyleProperties(i.thumb),t.cornerRadius=i.thumb.cornerRadius??0,t.opacity=i.thumb.opacity??1;const n=i.thumb.hoverStyle;t.fill=s?n?.fill??i.thumb.fill:i.thumb.fill,t.stroke=s?n?.stroke??i.thumb.stroke:i.thumb.stroke}updateTrack(e,t){e.track.x=t.x,e.track.y=t.y,e.track.width=t.width,e.track.height=t.height,e.dom.updateBounds(t)}updateThumb(e,t){const{min:i,max:s}=this.getZoomRange(e.orientation),n=ae(0,s-i,1);if(!this.updateVisibility(e,n)||t.width<=0||t.height<=0)return;const o=e.properties.thumb.minSize??0;let r;if(e.orientation==="horizontal"){const l=Math.min(Math.max(o,t.width*n),t.width),c=ae(t.x,t.x+t.width*i,t.x+t.width-l);e.thumb.x=c,e.thumb.y=t.y,e.thumb.width=l,e.thumb.height=t.height,r=ae(0,l/t.width,1)}else{const l=Math.min(Math.max(o,t.height*n),t.height),c=ae(t.y,t.y+t.height*i,t.y+t.height-l);e.thumb.x=t.x,e.thumb.y=c,e.thumb.width=t.width,e.thumb.height=l,r=ae(0,l/t.height,1)}e.dom.updateThumbBounds(e.thumb,t,e.properties.thumb.cornerRadius),e.dom.updateMinMax(i,s,r)}updateThumbs(){if(this.seriesRect)for(const e of["horizontal","vertical"]){const t=this.state[e],i=t.layoutRect;if(!i||!t.properties.enabled||t.properties.visible==="never")continue;const s=e==="horizontal"?new Np(this.seriesRect.x,i.y,this.seriesRect.width,t.properties.thickness):new Np(i.x,this.seriesRect.y,t.properties.thickness,this.seriesRect.height);this.updateThumb(t,s)}}updateVisibility(e,t){const i=e.properties.enabled&&e.axisId!=null&&e.properties.visible!=="never"&&(e.properties.visible==="always"||t<1);return e.group.visible=i,e.track.visible=i,e.thumb.visible=i,e.dom.updateVisibility(i),i}getZoomRange(e){const t=this.ctx.zoomManager.getZoom(),i=e==="horizontal",s=i?t?.x:t?.y;return!i&&s!=null?{min:1-(s.max??1),max:1-(s.min??0)}:{min:s?.min??0,max:s?.max??1}}handleUserChange(e,t,i){if(!this.ctx.interactionManager.isState(WQ.ZoomDraggable))return;const s=e==="horizontal";s||([t,i]=[1-i,1-t]);const n=s?{x:{min:t,max:i}}:{y:{min:t,max:i}};this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},n)}handleHoverChange(e,t){const i=this.state[e],s=t&&i.group.visible;i.hovered!==s&&(i.hovered=s,this.updateStyles(i),this.ctx.updateService.update(9))}destroy(){super.destroy(),this.state.horizontal.dom.destroy(),this.state.vertical.dom.destroy()}};g([m],ro.prototype,"enabled",2),g([m],ro.prototype,"thickness",2),g([m],ro.prototype,"spacing",2),g([m],ro.prototype,"tickSpacing",2),g([m],ro.prototype,"placement",2),g([m],ro.prototype,"visible",2),g([m],ro.prototype,"track",2),g([m],ro.prototype,"thumb",2),g([m],ro.prototype,"horizontal",2),g([m],ro.prototype,"vertical",2);var jC={...se,...q,...oe,cornerRadius:P,opacity:ne},mV={...jC,minSize:P,hoverStyle:{fill:se.fill,stroke:q.stroke}},yV={enabled:R,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:jC,thumb:mV},$Q={...yV,position:U("top","bottom")},KQ={...yV,position:U("left","right")},UQ={enabled:R,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:jC,thumb:mV,horizontal:$Q,vertical:KQ},xV={enabled:{$path:"../enabled"},thickness:{$path:"../thickness"},spacing:{$path:"../spacing"},tickSpacing:{$path:"../tickSpacing"},placement:{$path:"../placement"},visible:{$path:"../visible"},track:{fill:{$path:"../../track/fill"},stroke:{$path:"../../track/stroke"},fillOpacity:{$path:"../../track/fillOpacity"},strokeWidth:{$path:"../../track/strokeWidth"},lineDash:{$path:"../../track/lineDash"},lineDashOffset:{$path:"../../track/lineDashOffset"},opacity:{$path:"../../track/opacity"},cornerRadius:{$path:"../../track/cornerRadius"}},thumb:{fill:{$path:"../../thumb/fill"},stroke:{$path:"../../thumb/stroke"},fillOpacity:{$path:"../../thumb/fillOpacity"},strokeWidth:{$path:"../../thumb/strokeWidth"},lineDash:{$path:"../../thumb/lineDash"},lineDashOffset:{$path:"../../thumb/lineDashOffset"},opacity:{$path:"../../thumb/opacity"},cornerRadius:{$path:"../../thumb/cornerRadius"},minSize:{$path:"../../thumb/minSize"},hoverStyle:{fill:{$path:"../../../thumb/hoverStyle/fill"},stroke:{$path:"../../../thumb/hoverStyle/stroke"}}}},YQ={enabled:!1,thickness:12,spacing:16,tickSpacing:0,placement:"outer",visible:"auto",track:{fill:{$foregroundBackgroundMix:.03},stroke:{$foregroundBackgroundMix:.177},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6},thumb:{fill:{$foregroundBackgroundMix:.125},stroke:{$foregroundBackgroundMix:.364},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6,minSize:20,hoverStyle:{fill:{$mix:[{$path:"../fill"},{$ref:"foregroundColor"},.075]},stroke:{$mix:[{$path:"../stroke"},{$ref:"foregroundColor"},.075]}}},vertical:xV,horizontal:xV},bV={type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,version:ue,options:UQ,themeTemplate:YQ,create:e=>new ro(e)},{LayoutElement:ZQ,Group:XQ,Label:cm,Rect:qQ,Text:ts}=N,vV={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},QQ={up:"positive",down:"negative"},JQ={hlc:"altNeutral"},WC=class extends X{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};g([m],WC.prototype,"fill",2),g([m],WC.prototype,"fillOpacity",2);var Ln=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new cm,this.positive=new cm,this.negative=new cm,this.neutral=new cm,this.altNeutral=new cm,this.background=new WC,this.layoutStyle="block",this.id="status-bar",this.layer=new XQ({name:"StatusBar",zIndex:14}),this.labelGroup=this.layer.appendChild(new N.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new qQ),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new ts),value:this.labelGroup.appendChild(new ts),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(e.scene.attachNode(this.layer),e.layoutManager.registerElement(ZQ.Overlay,t=>this.startPerformLayout(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("highlight:change",()=>this.updateHighlight()),e.eventsHub.on("data:update",t=>{this.chartData=t}))}updateDomainsFromSeries(){if(!this.enabled)return;const e=this.ctx.chartService.series;if(e.length===0)return;let t,i;for(const s of e){const a=s.getDomain("y")?.domain;!Array.isArray(a)||a.length<2||(s.type==="bar"?i=[a[0],a.at(-1)]:t=[a[0],a.at(-1)])}for(const s of this.labels){if(this[s.key]==null){s.domain=void 0;continue}s.domain=s.key==="volumeKey"?i:t}}startPerformLayout({layoutBox:e}){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled){this.labelGroup.visible=!1;return}this.updateDomainsFromSeries();const t=4,i=12,s=0,n=8;this.labelGroup.translationY=e.y+s;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),o=Rn(a),r=vV[this.getChartType()]??0;let l=0,c,h="alphabetic";if(this.layoutStyle==="block")e.shrink(s+o+n,"top"),c=a+(o-a)/2;else{const{title:d}=this.ctx.chartService;if(h="top",c=s+d.padding,d.enabled){const u=d.node.getBBox();l=u.x+u.width+i}else l=d.padding}for(const{label:d,configuration:u,title:p,value:f,domain:y,formatter:b}of this.labels){if(y==null||!(r&u)){p.visible=!1,f.visible=!1;continue}const x=et(this.positive),v=et(this.negative),S=Math.max(x.textWidth(b.format(y[0])),x.textWidth(b.format(y[1])),v.textWidth(b.format(y[0])),v.textWidth(b.format(y[1])));p.visible=!0,f.visible=!0;const M=et(this.title).measureLines(d);p.setFont(this.title),p.fill=this.title.color,p.text=d,p.textBaseline=h,p.y=c,p.x=l,l+=M.width+t,f.textBaseline=h,f.y=c,f.x=l,l+=S+i}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=l-i,this.backgroundNode.height=o+s+n,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.chartData?.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let s=i==null?void 0:QQ[i];s==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]<t[this.closeKey]?s="positive":s="negative");for(const{domain:n,value:a,key:o,formatter:r,style:l}of this.labels){if(n==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=JQ[this.getChartType()]??c);const h=this[o],d=h==null?void 0:t?.[h];a.setFont(this[c]),a.fill=this[c].color,a.text=typeof d=="number"?r.format(d):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(e==null||vV[e]==null)&&(e="candlestick"),e}};g([m],Ln.prototype,"enabled",2),g([m],Ln.prototype,"openKey",2),g([m],Ln.prototype,"highKey",2),g([m],Ln.prototype,"lowKey",2),g([m],Ln.prototype,"closeKey",2),g([m],Ln.prototype,"volumeKey",2),g([m],Ln.prototype,"title",2),g([m],Ln.prototype,"positive",2),g([m],Ln.prototype,"negative",2),g([m],Ln.prototype,"neutral",2),g([m],Ln.prototype,"altNeutral",2),g([m],Ln.prototype,"background",2),g([m],Ln.prototype,"layoutStyle",2);var $C={type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,version:ue,themeTemplate:{enabled:!1,layoutStyle:Do,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"chartBackgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}},create:e=>new Ln(e)},{CartesianAxis:KC,ContinuousScale:SV,TimeScale:e7,UnitTimeScale:t7,TooltipManager:i7}=N,qo=be.create("sync");function MV(e,t,i){const s=e.getKeys(t),n=e.getKeys(i);return e.shouldFlipXY?.()?[n,s]:[s,n]}function UC(e="x"){switch(e){case"x":return["x"];case"y":return["y"];case"xy":return["x","y"]}}function s7(e,t,i){return e7.is(e)||t7.is(e)?!En(t.map(s=>s?.valueOf()),i.map(s=>s?.valueOf())):!En(t,i)}var kc=class extends X{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="id",this.domainSync=new Lg}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))qo("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=3){qo("ChartSync.updateChart()",e.id,xr[t],e),t===3?e.ctx.updateService.update(t,{forceNodeDataRefresh:!0}):e.ctx.updateService.update(t)}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change-complete",t=>this.onZoom(t))}onZoom(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(this.groupId)){if(!i.modulesManager.getModule("sync")?.zoom)continue;const n=i.modulesManager.getModule("zoom");if(!n)continue;const a=this.prepareZoomUpdate();e.source!=="sync"&&(qo("ChartsSyncManager.enabledZoomSync()",i.id,a),n.updateSyncZoom(a))}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.();const e=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this)),t=this.moduleContext.eventsHub.on("active:load-memento",this.onActiveLoadMemento.bind(this));this.disableNodeInteractionSync=()=>{e(),t()}}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;qo("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[s]=UC(this.axes),n=s==="x"?"y":"x",[a,o]=i?MV(i,s,n):[],r=om(e.currentHighlight);let l=a?.[0]?r?.[a[0]]:void 0,c=!1;if(Cs(l)&&(c=!0,l=l.getTime()),!e.currentHighlight?.datum){for(const d of t.getGroupSiblings(this.groupId))d.modulesManager.getModule("sync")?.nodeInteraction&&(d.ctx.highlightManager.updateHighlight(`${d.id}-sync`,void 0,!0),d.ctx.tooltipManager.removeTooltip(`${d.id}-sync`,void 0,!0));return}const h=t.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(s,n,h?o:[],c,l,e)}onActiveLoadMemento(e){const{activeItem:t,chartId:i}=e;if(t===void 0){this.moduleContext.highlightManager.updateHighlight(`${i}-sync`,void 0,!1),this.moduleContext.tooltipManager.removeTooltip(`${i}-sync`,void 0,!1);for(const s of this.moduleContext.syncManager.getGroupSiblings(this.groupId))s.onSyncActiveClear()}}findMatchingHighlightNodes(e,t,i,s,n,a){const{syncManager:o}=this.moduleContext;qo("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const r of o.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let c=!1;for(const h of r.axes){if(!KC.is(h)||h.direction!==e)continue;const d=r.series.filter(u=>{if(!u.visible)return!1;if(i.length>0){const[,p]=MV(u,e,t);return i.every(f=>p.includes(f))}return!0}).map(this.findMatchingNodes(h,e,s,n)).filter(Mt);if(d.length===1&&d[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,d[0].nodeDatum),c=!0;break}}c||(qo("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,a),this.dispatchHighlightUpdate(r))}}findMatchingNodes(e,t,i,s){return n=>{if(n.getKeyAxis(e.direction)!==e.id)return;const o=n.contextNodeData?.nodeData??[];if(!o?.length)return;const r=o[0],l=`${t}Key`;if(!O0(r,l))return;const c=r[l],h=o.find(d=>{const u=d.datum[c];return i?u.getTime()===s:u===s});return h?{series:n,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){qo("ChartSync.dispatchHighlightUpdate()",e.id,t);const i=t==null;e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t,i);const s=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&s){const n=e.seriesAreaBoundingBox,a=n.x+(t.midPoint?.x??t.point?.x??0),o=n.y+(t.midPoint?.y??t.point?.y??0),r=i7.makeTooltipMeta({type:"pointermove",canvasX:a,canvasY:o},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,r,e.getTooltipContent(t.series,t.datumIndex,t,"tooltip"))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`,void 0,!0);this.updateChart(e,7)}async getSyncedDomain(e){if(!KC.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,idDomains:s,positionDomains:n}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(e,n):this.domainMode==="direction"?this.calculateDerivedDomain(e,i):this.calculateDerivedDomain(e,s)}updateDomainState(e){var t,i,s,n,a;const{syncManager:o}=this.moduleContext,r=o.getChart().id,l=e.id,c=o.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),d=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0}),u=(i=d.sources)[r]??(i[r]={});u[l]=e.dataDomain.domain,d.dirty=!0;const p=c.domainsById??(c.domainsById={}),f=p[l]??(p[l]={derived:[],sources:{},dirty:!0}),y=(s=f.sources)[r]??(s[r]={});y[l]=e.dataDomain.domain,f.dirty=!0;const b=c.domainsByPosition??(c.domainsByPosition={}),x=b[n=e.position]??(b[n]={derived:[],sources:{},dirty:!0}),v=(a=x.sources)[r]??(a[r]={});return v[l]=e.dataDomain.domain,x.dirty=!0,{groupState:c,directionDomains:d,idDomains:f,positionDomains:x}}validateAxis(e,t){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";UC(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:s,nice:n,reverse:a}=e,o=new Set(e.boundSeries.flatMap(r=>r.getKeys(e.direction)));for(const r of t.members){const{axes:l,modulesManager:c}=r,h=c.getModule("sync"),d=UC(h?.axes),u=l.filter(f=>d.includes(f.direction)).filter(f=>f.boundSeries.some(y=>y.getKeys(f.direction).some(b=>o.has(b))));if(u.length===0)continue;const[p]=u;if(p.min!==i||p.max!==s||p.nice!==n||p.reverse!==a){K.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(e,t){const i=t.members,[{axes:s}]=i,{direction:n,min:a,max:o,nice:r,reverse:l}=e;for(const c of s)if(n===c.direction&&(r!==c.nice||l!==c.reverse||a!==c.min&&(Be(a)||Be(c.min))||o!==c.max&&(Be(o)||Be(c.max)))){K.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;let i=t.derived;const s=Object.values(t.sources).map(a=>Object.values(a));let n;return SV.is(e.scale)?n=s.flat(2):n=s.flat().toSorted((a,o)=>a.length>o.length?-1:1).flat(),t.derived=$p(n),SV.is(e.scale)&&(i=Tt(i),t.derived=Tt(t.derived)),t.dirty=!1,s7(e.scale,i,t.derived)&&(qo(e.id,"updated",{before:i,after:t.derived}),this.updateSiblings()),t.derived}removeAxis(e){if(!KC.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),s=t.getChart().id,n=e.id;delete i?.domains?.[e.direction]?.sources?.[s]?.[n],delete i?.domainsByPosition?.[e.position]?.sources?.[s]?.[n],delete i?.domainsById?.[n]?.sources?.[s]?.[n]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)qo("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.waitForCompletion(),t++;t>0&&qo("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:e}=this.moduleContext,t=e.getZoom();return this.axes==="x"?delete t?.y:this.axes==="y"&&delete t?.x,Rt(t)}onEnabledChange(){const{syncManager:e,highlightManager:t}=this.moduleContext;this.enabled?(e.subscribe(this.groupId),t.unhighlightDelay=0):(e.unsubscribe(this.groupId),t.unhighlightDelay=100),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};kc.className="Sync",g([m,Xt(e=>e.onEnabledChange())],kc.prototype,"enabled",2),g([m,Xt((e,t,i)=>e.onGroupIdChange(t,i))],kc.prototype,"groupId",2),g([m,Xt(e=>e.onAxesChange())],kc.prototype,"axes",2),g([m,Xt(e=>e.onNodeInteractionChange())],kc.prototype,"nodeInteraction",2),g([m,Xt(e=>e.onZoomChange())],kc.prototype,"zoom",2),g([m,Xt(e=>e.onAxesChange())],kc.prototype,"domainMode",2);var YC={type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,version:ue,options:{enabled:R,groupId:L,axes:U("x","y","xy"),nodeInteraction:R,zoom:R},themeTemplate:{enabled:!1},create:e=>new kc(e)},DV="#2196f3",n7="#8a8a8a",kV=class extends N.Rect{constructor(){super(),this.fill=DV,this.fillOpacity=.2,this.zIndex=5}updateValid(){this.fill=DV}updateInvalid(){this.fill=n7}};kV.className="ZoomRect";var ZC=class extends X{constructor(){super(),this.enabled=!1,this.padding=0}};g([m],ZC.prototype,"enabled",2),g([m],ZC.prototype,"padding",2);var a7=class{constructor(e,t,i,s,n){this.properties=e,this.zoomManager=t,this.deps=i,this.manuallyAdjusted=!1,n.register(s.on("zoom:save-memento",a=>this.onSaveMemento(a)),s.on("zoom:load-memento",a=>this.onLoadMemento(a)),s.on("zoom:change-request",a=>this.onChangeRequest(a)))}get enabled(){return this.deps.enabled&&this.properties.enabled&&!this.manuallyAdjusted}onManualAdjustment(e){e==="y"&&(this.manuallyAdjusted=!0)}onChangeRequest(e){const t=this.hasYAxisChange(e);if(e.sourceDetail==="scrollbar"&&t&&(this.manuallyAdjusted=!0),e.isReset&&t&&(this.manuallyAdjusted=!1),this.enabled){const i=this.autoScaleYZoom(e.state);i&&e.constrainChanges(i)}}hasYAxisChange(e){for(const t of e.changedAxes)if(e.state[t]?.direction==="y")return!0;return!1}onSaveMemento(e){e.memento.autoScaledAxes=this.enabled?["y"]:void 0}onLoadMemento(e){const{zoom:t,memento:i,navigatorModule:s,zoomModule:n}=e;if(!s||n){let a=i?.autoScaledAxes?.includes("y");if(i?.rangeY)a??(a=!1),t.y=this.zoomManager.rangeToRatioDirection("y",i.rangeY)??{min:0,max:1};else if(i?.ratioY)a??(a=!1),t.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{a??(a=!0);const o=a?this.getAutoScaleYZoom(t.x):void 0;t.y=o??{min:0,max:1}}a!=null&&(this.manuallyAdjusted=!a)}}getAutoScaleYZoom(e){if(!this.enabled)return;const{padding:t}=this.properties;let i;return this.deps.enableIndependentAxes?i=this.primaryAxisZoom("y",e,{padding:t}):i=this.combinedAxisZoom("y",e,{padding:t}),e.min===0&&e.max===1?i==null?void 0:{min:0,max:1}:i}autoScaleYZoom(e){const t=this.zoomManager.getZoom();if(t&&e){const s=this.zoomManager.getAxisZooms();for(const n of["x","y"])for(const a of za(e))if(s[a]?.direction===n){t[n]=e[a];break}}if(t?.x==null)return;const i=this.getAutoScaleYZoom(t.x);if(!(i==null||Ht(t.y,i)))return this.zoomManager.toCoreZoomState({x:t.x,y:i})}zoomBounds(e,t,i,s){const n=e.scale,a=n.range;n.range=[0,1];const o=t.scale,r=o.range;o.range=[0,1];let l=1,c=!1,h=0,d=!1;for(const f of t.boundSeries){if(!f.visible)continue;const{connectsToYAxis:y}=f,b=f.getRange("y",[i.min,i.max]);for(const x of b){const v=o.convert(x);Number.isFinite(v)&&(v<l&&(l=v,c=!y||x<0),v>h&&(h=v,d=!y||x>0))}}if(Be(t.min)&&(l=0),Be(t.max)&&(h=1),n.range=a,o.range=r,l>=h)return;const u=(c?s:0)+(d?s:0),p=Math.min((h-l)*(1+u),1);if(!(p<=0)){if(c&&d){const f=(h+l)/2;l=f-p/2,h=f+p/2}else!c&&d?h=l+p:c&&!d&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=this.zoomManager.getPrimaryAxis(s),a=this.zoomManager.getPrimaryAxis(e);if(!(n==null||a==null))return this.zoomBounds(n,a,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=this.zoomManager.getAxes(),n=e==="x"?"y":"x",a=new Map;for(const c of s)if(c.direction===n)for(const h of c.boundSeries)a.set(h,c);let o=1,r=0;for(const c of s)if(c.direction===e)for(const h of c.boundSeries){const d=a.get(h);if(d==null)continue;const u=this.zoomBounds(d,c,t,i);if(u==null)return;o=Math.min(o,u.min),r=Math.max(r,u.max)}const l=1e-6;if(o<l&&(o=0),r>1-l&&(r=1),!(o>r))return{min:o,max:r}}},$h=Yi-ba,IV="end",AV="middle",CV=300,tS=(e,t=ba,i=Yi)=>ae(t,e,i);function is(e){return e.x.max-e.x.min}function na(e){return e.y.max-e.y.min}function wV(e,t){return He(e.min,t.min)&&He(e.max,t.max)}function LV(e,t){return wV(e.x,t.x)&&wV(e.y,t.y)}function Tp(e){return LV(e,Rt())}function hl(e,t,i){if(!e)return{x:0,y:0};const s=tS(t-e.x,0,e.x+e.width),n=tS(i-e.y,0,e.y+e.height),a=1/e.width*s,o=1-1/e.height*n;return{x:tS(a),y:tS(o)}}function Kh(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function iS(e,t,i){return{x:{min:e.x.min,max:e.x.min+is(e)*t},y:{min:e.y.min,max:e.y.min+na(e)*i}}}function NV(e,t,i){const s=is(e),n=na(e),a=e.x.min+s/2,o=e.y.min+n/2;return{x:{min:a-s*t/2,max:a+s*t/2},y:{min:o-n*i/2,max:o+n*i/2}}}function aa(e,t,i,s){const{min:n,max:a}=t,o=n+(a-n)/2,r=e.max-e.min;switch(i){case"start":return{min:n,max:t.min+r};case"end":return{min:t.max-r,max:a};case"middle":return{min:o-r/2,max:o+r/2};case"pointer":return o7(e,t,s??o);default:return{min:n,max:a}}}function o7(e,t,i){const s=e.max-e.min,n=t.max-t.min,a=i*(1-(n-s)),o=i-a,r=e.min+o,l=e.max+o;return{min:r,max:l}}function r7(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function Na(e){return{x:sS(e.x),y:sS(e.y)}}function sS(e){const t=e.max-e.min;let i=e.max>Yi?Yi-t:e.min,s=e.min<ba?t:e.max;return i=Math.max(ba,i),s=Math.min(Yi,s),{min:i,max:s}}function TV(e){const t=e.getCoreZoom(),i=e.getRestoredZoom();return Hn(t,i)!=null}var l7=class{update(e,t,i,s,n,a){return this.oldZoom??(this.oldZoom=Rt(t==="x"?{...n,x:a}:{...n,y:a})),this.updateCoords(e.offsetX,e.offsetY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:n}=this;let a=Rt(n);if(!s||!n)return e==="x"?a.x:a.y;const o=hl(i,s.x1,s.y1),r=hl(i,s.x2,s.y2);if(e==="x"){const c=(r.x-o.x)*is(n);return a.x.max+=c,a.x=aa(a.x,n.x,t,o.x),a=Na(a),a.x}const l=(r.y-o.y)*na(n);return a.y.max-=l,a.y=aa(a.y,n.y,t,o.y),a=Na(a),a.y}},{userInteraction:XC}=N,c7=class{constructor(e,t,i,s,n,a,o){this.eventsHub=e,this.contextMenuRegistry=t,this.zoomManager=i,this.getModuleProperties=s,this.getRect=n,this.updateZoom=a,this.isZoomValid=o}registerActions(e){const{contextMenuRegistry:t}=this,i=e?"show":"hide";if(t.toggle("zoom-to-cursor",i),t.toggle("pan-to-cursor",i),t.toggle("reset-zoom",i),!e)return;t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),t.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const s=o=>{const r=this.getRect();if(!r)return!0;const l=hl(r,o.x,o.y);return this.iterateFindNextZoomAtPoint(l)!=null},n=()=>!Tp(Rt(this.zoomManager.getZoom())),a=this.eventsHub.on("context-menu:setup",o=>{t.builtins.items["zoom-to-cursor"].enabled=s(o),t.builtins.items["pan-to-cursor"].enabled=n(),t.builtins.items["reset-zoom"].enabled=TV(this.zoomManager)});return()=>{a(),t.toggle("zoom-to-cursor","hide"),t.toggle("pan-to-cursor","hide"),t.toggle("reset-zoom","hide")}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const s={x:0,y:0,width:t.width,height:t.height};return hl(s,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(XC("contextmenu-zoom-to-cursor"),i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=Rt(this.zoomManager.getZoom()),s=is(i),n=na(i),a=t.x*s,o=t.y*n,r=$h/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};l=NV(l,s,n),l=Kh(l,i.x.min-t.x+a,i.y.min-t.y+o),this.updateZoom(XC("contextmenu-pan-to-cursor"),Na(l))}onResetZoom(e){this.zoomManager.resetZoom(XC("contextmenu-reset"))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const s=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=Rt(this.zoomManager.getZoom()),a=e.x*is(n),o=e.y*na(n),r=$h/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};return l=NV(l,i?is(n)*t:$h,s?na(n)*t:$h),l=Kh(l,n.x.min-e.x+a,n.y.min-e.y+o),Na(l)}},h7=class{constructor(e){this.axesHandlers=e,this.axes=[],this.overlappingAxisIds=new Set}destroy(){for(const e of this.axes)e.div.destroy()}update(e,t,i,s,n){this.seriesRect=n;const a=!e||!t&&!i;for(const d of this.axes)d.div.setHidden(a);if(a)return;const{X:o,Y:r}=Sg,l=[...s.axisManager.getAxisContext(o),...s.axisManager.getAxisContext(r)],{removed:c,added:h}=this.diffAxisIds(l);c.length>0&&(this.axes=this.axes.filter(d=>c.includes(d.axisId)?(d.div.destroy(),this.overlappingAxisIds.delete(d.axisId),this.hoveredAxisId===d.axisId&&(this.hoveredAxisId=void 0),this.activeAxisId===d.axisId&&(this.activeAxisId=void 0),!1):!0));for(const d of h){const{axisId:u,direction:p}=d;this.axes.push(this.initAxis(s,u,this.axesHandlers,p))}for(const d of this.axes){const p=l.find(f=>f.axisId===d.axisId).getCanvasBounds();d.div.setHidden(oM(p)),p==null?d.bounds=void 0:(d.div.setBounds(p),d.bounds=new N.BBox(p.x,p.y,p.width,p.height))}this.updateOverlappingAxisPointerEvents(t,i)}setAxisCursor(e){this.cursor=e;for(const t of this.axes)t.div.setCursor(this.getCursor(t.direction))}toggleAxisDraggingCursor(e,t){for(const i of this.axes)i.direction===e&&i.div.setCursor(t?this.getCursor(e):void 0)}updateOverlappingAxisPointerEvents(e,t){this.overlappingAxisIds.clear();const i=(e||t)&&this.seriesRect;for(const s of this.axes){if(!i){s.div.setPointerEvents(void 0);continue}!!s.bounds?.collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(s.axisId),s.div.setPointerEvents("none")):s.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.activeAxisId&&!this.overlappingAxisIds.has(this.activeAxisId)&&(this.activeAxisId=void 0)}pickAxisAtPoint(e){for(const t of this.axes)if(this.overlappingAxisIds.has(t.axisId)&&t.bounds?.containsPoint(e.canvasX,e.canvasY))return{axisId:t.axisId,direction:t.direction}}setHoveredAxis(e){this.overlappingAxisIds.has(e)&&(this.hoveredAxisId=e)}clearHoveredAxis(){this.activeAxisId||(this.hoveredAxisId=void 0)}beginDelegatedAxisDrag(e){return this.overlappingAxisIds.has(e)?(this.activeAxisId=e,this.hoveredAxisId=void 0,!0):!1}endDelegatedAxisDrag(e){this.activeAxisId===e&&(this.activeAxisId=void 0),this.hoveredAxisId=void 0}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getHoveredAxis(){if(!this.hoveredAxisId)return;const e=this.axes.find(t=>t.axisId===this.hoveredAxisId);return e?{axisId:e.axisId,direction:e.direction}:void 0}getCursor(e){return this.cursor?this.cursor:e==="x"?"ew-resize":"ns-resize"}initAxis(e,t,i,s){const n="afterend",a=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:n});return a.setCursor(this.getCursor(s)),a.addListener("drag-start",o=>{o.device==="touch"&&o.sourceEvent.preventDefault(),this.activeAxisId=t,i.onAxisDragStart(s)}),a.addListener("drag-move",o=>i.onAxisDragMove(t,s,o)),a.addListener("drag-end",()=>{this.activeAxisId=void 0,this.hoveredAxisId=void 0,i.onAxisDragEnd()}),a.addListener("dblclick",()=>i.onAxisDoubleClick(t,s)),a.addListener("wheel",o=>i.onAxisWheel(s,o)),{axisId:t,div:a,direction:s}}diffAxisIds(e){const t=this.axes.map(a=>a.axisId),i=e.map(a=>a.axisId),s=t.filter(a=>!i.includes(a)),n=e.filter(a=>!t.includes(a.axisId));return{removed:s,added:n}}},{userInteraction:d7}=N;function u7(e){return e.x.min===0&&e.x.max===1&&e.y.min===0&&e.y.max===1}function p7(e,t){return e.stickToEnd&&t.x.max===1}function OV(e,t,i){const{domainMin:s,domainMax:n}=t,a=n-s;return{axisId:e,visibleMin:s+a*i.min,visibleMax:s+a*i.max}}function PV(e,t){const{domainMin:i,domainMax:s}=e,{visibleMin:n,visibleMax:a}=t,o=s-i;return{direction:"x",min:ae(0,(n-i)/o,1),max:ae(0,(a-i)/o,1)}}var qC=class extends X{constructor(){super(...arguments),this.strategy="preserveDomain",this.stickToEnd=!1}};g([m],qC.prototype,"strategy",2),g([m],qC.prototype,"stickToEnd",2);var g7=class{constructor(e,t,i,s){this.onConstrainChangesCallback=e,this.properties=t,this.ctx=i;const n=()=>{i.eventsHub.off("layout:complete",n),s.register(i.eventsHub.on("data:load",a=>this.onDataLoad(a)),i.eventsHub.on("data:update",a=>this.onDataUpdate(a)))};s.register(i.eventsHub.on("layout:complete",n),i.eventsHub.on("zoom:change-request",a=>this.onZoomChangeRequest(a)))}destroy(){}onDataLoad(e){this.performUpdateStrategy()}onDataUpdate(e){this.performUpdateStrategy()}onZoomChangeRequest(e){e.sourceDetail==="internal-requiredWidth"&&(this.desiredChanges=void 0);const t=this.popDesiredChanges();t&&(e.constrainChanges(t),this.onConstrainChangesCallback(e))}computeDomainMinMax(e){const t=this.ctx.axisManager.getAxisIdContext(e);if(!t?.continuous||t.scale.domain.length===0)return;const[i,s]=t.scale.getDomainMinMax();if(typeof i=="number"&&typeof s=="number")return{domainMin:i,domainMax:s};if(i instanceof Date&&s instanceof Date)return{domainMin:i.getTime(),domainMax:s.getTime()};K.error(`Unexpected range types: start (${typeof i}), end (${typeof s})`)}popDesiredChanges(){const{desiredChanges:e}=this;if(e)switch(this.desiredChanges=void 0,e.type){case"domain":{const i={};for(const s of e.domains){const n=this.computeDomainMinMax(s.axisId);n&&(i[s.axisId]=PV(n,s))}return i}case"stickToEnd":{const{axisId:i,difference:s}=e,n=this.computeDomainMinMax(i);if(n){const a={axisId:i,visibleMin:n.domainMax-s,visibleMax:n.domainMax};return{[i]:PV(n,a)}}break}default:return(i=>i)(e)}}performUpdateStrategy(){const e=Rt(this.ctx.zoomManager.getZoom());if(!u7(e)){if(p7(this.properties,e))return this.performStickToEnd();switch(this.properties.strategy){case"reset":return this.ctx.zoomManager.resetZoom(d7("onDataChange-reset"));case"preserveRatios":return;case"preserveDomain":return this.performPreserveDomain();default:return(i=>i)(this.properties.strategy)}}}performPreserveDomain(){this.desiredChanges={type:"domain",domains:[]};const e=this.ctx.zoomManager.getAxes().filter(t=>t.direction==="x");for(const{id:t}of e){const i=this.computeDomainMinMax(t);if(i){const s=this.ctx.zoomManager.getAxisZoom(t),n=OV(t,i,s);this.desiredChanges.domains.push(n)}}}performStickToEnd(){const e=this.ctx.zoomManager.getPrimaryAxisId("x");if(!e)return;const t=this.computeDomainMinMax(e);if(!t)return;const i=this.ctx.zoomManager.getAxisZoom(e);if(!i)return;const{visibleMin:s,visibleMax:n}=OV(e,t,i),a=n-s;this.desiredChanges={type:"stickToEnd",axisId:e,difference:a}}},EV=16,f7={off:1,short:.01,long:.002},m7=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:f7[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?t-s:0,deltaY:this.isPanningY()?i-n:0})}start(e){this.direction=e,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const n=this.zoomCoordsHistoryIndex%EV;let a=n-1;a<0&&(a=e.length-1);let o=n;o>=e.length&&(o=0);const r=e[a],l=e[o];t=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,s=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const n=t/s,a=i/s,o=Math.hypot(n,a),r=Math.atan2(a,n),l=performance.now();this.inertiaHandle=Re().requestAnimationFrame(c=>{this.animateInertia(c,c,l,o,r)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:n}=e,a=Date.now();t[i%EV]={x:s,y:n,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,n){const a=1-this.decelerationValue,o=-s/Math.log(a),r=s*(a**(t-i)-1)/Math.log(a),l=s*(a**(e-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(n)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(n)*(l-r):0}),!(l>=o-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,e,i,s,n)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}isPanningX(){return this.direction==null||this.direction==="x"}isPanningY(){return this.direction==null||this.direction==="y"}translateZooms(e,t,i,s){const n=hl(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),a=Math.sign(i)*n.x,o=-Math.sign(s)*n.y,r={};for(const[l,c]of rt(t)){if(c==null||c.min===ba&&c.max===Yi)continue;const{direction:h}=c;let d=Rt({[h]:c});d=Na(Kh(d,a*is(d),o*na(d)));const{min:u,max:p}=d[h];r[l]={direction:h,min:u,max:p}}return r}},y7=200,x7=class{update(e,t,i,s){const n=e.deltaX*t*y7;return this.translateZooms(i,s,n)}translateZooms(e,t,i){const s={},n=hl(e,e.x+Math.abs(i),0),a=i<0?-n.x:n.x;for(const[o,r]of rt(t)){if(r?.direction!=="x")continue;const{direction:l,min:c,max:h}=r;let d=Rt({x:{min:c,max:h}});d=Na(Kh(d,a*is(d),0)),s[o]={direction:l,min:d.x.min,max:d.x.max}}return s}},b7=class{updateAxes(e,t,i,s){const n=e.sourceEvent,a={},{anchorPointX:o,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=t,d=hl(i,n.offsetX??n.clientX,n.offsetY??n.clientY);for(const[u,p]of rt(s)){if(p==null)continue;const{direction:f,min:y,max:b}=p;let x={min:y,max:b};const v=h*e.deltaY*(b-y);if(f==="x"&&l)x.max+=v,x=aa(x,p,o,d.x);else if(f==="y"&&c)x.max+=v,x=aa(x,p,r,d.y);else continue;if(x.max<x.min)continue;const S=sS(x);a[u]={direction:f,min:S.min,max:S.max}}return a}update(e,t,i,s){const{anchorPointX:n,anchorPointY:a,isScalingX:o,isScalingY:r,scrollingStep:l}=t,c=e.offsetX+i.x,h=e.offsetY+i.y,d=hl(i,c,h),u=e.deltaY;let p=Rt(s);if(p.x.max+=o?l*u*is(s):0,p.y.max+=r?l*u*na(s):0,!(p.x.max<p.x.min||p.y.max<p.y.min))return o&&(p.x=aa(p.x,s.x,n,d.x)),r&&(p.y=aa(p.y,s.y,a,d.y)),p=Na(p),p}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:n,isScalingX:a,isScalingY:o,scrollingStep:r}=t;let l=Rt(i);return l.x.max+=a?r*-e*is(i):0,l.y.max+=o?r*-e*na(i):0,a&&(l.x=aa(l.x,i.x,s)),o&&(l.y=aa(l.y,i.y,n)),l=Na(l),l}},v7=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const s=e.currentX+(i?.x??0),n=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,n,t,i),this.updateRect(i)}stop(e,t,i){let s=Rt();if(!e||!t)return s;this.coords&&(s=this.createZoomFromCoords(t,i));const n=t.width/e.width,a=t.height/e.height;if(s=Na(r7(s,n,a)),this.reset(),this.isZoomValid(s))return s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:n}=this;if(n.x2=e,n.y2=t,!s)return;const{isScalingX:a,isScalingY:o,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&o){const c=s.width/s.height;n.y2<n.y1?n.y2=Math.min(n.y1-l.width/c,n.y1):n.y2=Math.max(n.y1+l.width/c,n.y1)}a||(n.x1=s.x,n.x2=s.x+s.width),o||(n.y1=s.y,n.y2=s.y+s.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:s,height:n}=i;let{x:a,y:o}=i;a=Math.max(a,e.x),a-=Math.max(0,a+s-(e.x+e.width)),o=Math.max(o,e.y),o-=Math.max(0,o+n-(e.y+e.height)),t.x=a,t.y=o,t.width=s,t.height=n;const r=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(r)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=Rt(t),s=this.getNormalisedDimensions(),n=hl(e,s.x,s.y+s.height),a=s.width/e.width,o=s.height/e.height;let r=iS(i,a,o);const l=n.x*is(i),c=n.y*na(i);return r=Kh(r,l,c),r=Na(r),r}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:s=0}=this.coords??{},n=Math.min(e,i),a=Math.min(t,s),o=e<=i?i-e:e-i,r=t<=s?s-t:t-s;return{x:n,y:a,width:o,height:r}}},{userInteraction:RV,NativeWidget:S7,Toolbar:M7}=N,QC=class extends nl{};g([m],QC.prototype,"value",2),g([m],QC.prototype,"section",2);var Op=class extends X{constructor(e,t,i,s,n,a){super(),this.ctx=e,this.getModuleProperties=t,this.updateZoom=i,this.updateAxisZoom=s,this.resetZoom=n,this.isZoomValid=a,this.enabled=!1,this.buttons=new Bi(QC),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.cleanup=new pt,this.toggleButtonsDebounced=qp(this.toggleButtons.bind(this),CV,{leading:!0,trailing:!0}),this.container=new S7(ye("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new M7(e,"ariaLabelZoomToolbar","horizontal"),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toolbar.setHidden(!this.enabled),this.toggleVisibility(this.visible==="always"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}toggleVisibleZoomed(e){this.visible==="zoomed"&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){if(!this.enabled)return;const{buttons:t,container:i}=this,{rect:s}=e.series;for(const a of t)if(a.tooltip==null&&a.label==null){const o={"pan-end":"toolbarZoomPanEnd","pan-left":"toolbarZoomPanLeft","pan-right":"toolbarZoomPanRight","pan-start":"toolbarZoomPanStart","zoom-in":"toolbarZoomZoomIn","zoom-out":"toolbarZoomZoomOut",reset:"toolbarZoomReset"};a.tooltip=o[a.value]}this.toolbar.updateButtons(t),this.toggleButtonsDebounced();const n=i.getBounds().height;i.setBounds({y:s.y+s.height-n})}onHover(e){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:s}}=this,{currentY:n,sourceEvent:{target:a}}=e,o=t.getElement(),r=o.offsetTop-i,l=n>r&&n<s.canvas.element.offsetHeight||a===o;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:s,verticalSpacing:n}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const a=s.getElement();a.style.transitionDuration=t?"0s":"",a.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+n}px)`}toggleButtons(){const e=Rt(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&LV(this.previousZoom,e))){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=e.x.min>ba;break;case"pan-end":s=e.x.max<Yi;break;case"pan-left":s=e.x.min>ba;break;case"pan-right":s=e.x.max<Yi;break;case"zoom-out":s=!Tp(e);break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=TV(this.ctx.zoomManager);break}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&e.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,n]of rt(i)){if(n==null)continue;const{direction:a,min:o,max:r}=n;this.onButtonPressAxis(e,t,s,a,{min:o,max:r})}}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,n){const{isScalingX:a,isScalingY:o,scrollingStep:r}=t;let l={...n};const c=n.max-n.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=Yi;break;case"pan-left":l.min-=c*r,l.max-=c*r;break;case"pan-right":l.min+=c*r,l.max+=c*r;break;case"zoom-in":case"zoom-out":{const h=s==="x",d=h&&a||!h&&o;let u=e.value==="zoom-in"?1-r:1+r;d||(u=1);const p=h?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*u,l=aa(l,n,p);break}}this.updateAxisZoom(RV(`zoom-button-${e.value}`),i,s,sS(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=Rt(this.ctx.zoomManager.getZoom());let n=Rt(s);switch(e.value){case"reset":this.resetZoom("zoom-button-reset");return;case"pan-start":n.x.max=is(n),n.x.min=0;break;case"pan-end":n.x.min=Yi-is(n),n.x.max=Yi;break;case"pan-left":n=Kh(n,-is(n)*i,0);break;case"pan-right":n=Kh(n,is(n)*i,0);break;case"zoom-in":case"zoom-out":{n=this.getNextZoomStateUnified(e.value,s,t);break}}this.updateZoom(RV(`zoom-button-${e.value}`),Na(n))}getNextZoomStateUnified(e,t,i){const{isScalingX:s,isScalingY:n,scrollingStep:a}=i,o=e==="zoom-in"?1-a:1+a,r=iS(t,s?o:1,n?o:1);return r.x=aa(r.x,t.x,this.getAnchorPointX(i)),r.y=aa(r.y,t.y,this.getAnchorPointY(i)),r}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return t==="pointer"?IV:t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return t==="pointer"?AV:t}};g([m,_e({changeValue(e){this.toolbar?.setHidden(!e)}})],Op.prototype,"enabled",2),g([m],Op.prototype,"buttons",2),g([m,_e({changeValue(e,t){if(t==null)return;const i=e==="always",s=e==="zoomed"&&this.previousZoom!=null&&!Tp(this.previousZoom);this.toggleVisibility(i||s)}})],Op.prototype,"visible",2),g([m],Op.prototype,"anchorPointX",2),g([m],Op.prototype,"anchorPointY",2);var Uh=1e6;function nS({min:e,max:t},i,s,n){return n===0?0:Uh*((i-s)/n*(t-e)+e)}function D7(e,t,i,s,n,a){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,s]=[Math.min(i,s),Math.max(i,s)];const o=Uh*(i-n)/a,r=Uh*(s-n)/a,l=(i-n)/(s-n),c=(e-l*t)/(Uh-o+l*(r-Uh)),h=(t+(r-Uh)*c)/r;return{min:c,max:h}}function zV(e,t,i,s){t===0&&(t=30),s===0&&(s=30);const n=e-t,a=e+t,o=i-s,r=i+s;return!(a<o||r<n)}var k7=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:Number.NaN,normalY:Number.NaN},{identifier:0,normalX:Number.NaN,normalY:Number.NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:Number.NaN,a2:Number.NaN,b1:Number.NaN,b2:Number.NaN}}start(e,t,i){if(e.sourceEvent.targetTouches.length!==2)return!1;e.sourceEvent.preventDefault();const s=Array.from(e.sourceEvent.targetTouches),{x:n,y:a,width:o,height:r}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1;for(const f of this.touchStart.origins)f.identifier=0;this.previous.a1=Number.NaN,this.previous.a2=Number.NaN,this.previous.b1=Number.NaN,this.previous.b2=Number.NaN;for(const f of[0,1]){const y=s[f].clientX,b=a+r-s[f].clientY;this.touchStart.origins[f].identifier=s[f].identifier,this.touchStart.origins[f].normalX=nS(this.initialZoom.x,y,n,o),this.touchStart.origins[f].normalY=nS(this.initialZoom.y,b,a,r)}const[l,c]=s,[h,d]=this.touchStart.origins,u=zV(l.clientX,l.radiusX,c.clientX,c.radiusX);return zV(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=d.normalY=(h.normalY+d.normalY)/2),u&&(h.normalX=d.normalX=(h.normalX+d.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:s,y:n,width:a,height:o}=t.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(x=>i.find(v=>v.identifier===r[x].identifier)),c=r[0].normalX,h=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,f=r[1].normalY,y=n+o-l[0].clientY,b=n+o-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,f,y,b,s,n,a,o)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,n,a,o,r,l,c,h,d){const{initialZoom:u,previous:p}=this,f=VV(e,t,i,s,p,"a1","a2",l,h,u.x),y=VV(n,a,o,r,p,"b1","b2",c,d,u.y);return{x:f,y}}};function VV(e,t,i,s,n,a,o,r,l,c){if(e==t){const h=nS(c,i,r,l),d=nS(c,s,r,l),u=(h+d)/2,p=(e-u)/Uh;return{min:c.min+p,max:c.max+p}}else{const h=n[a],d=n[o];return Math.abs(i-h)+Math.abs(s-d)<=1?(i=h,s=d):(n[a]=i,n[o]=s),D7(e,t,i,s,r,l)}}var I7=class{constructor(){this.isFirstWheelEvent=!0,this.debouncedWheelReset=qp(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100)}onWheel(e,t){if(e.sourceEvent.cancelable===!1)return;const i=t();if(i==="abort")return;const s=i==="capped";this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==e.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=s,this.firstWheelEventDirection=e.deltaY<0,s||e.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}},{userInteraction:Yh,InteractionState:hm}=N,aS=e=>Sd(e,10),Pp="zoom-cursor",dm="zoom-tooltip",ci=class extends hi{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=$h/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=IV,this.anchorPointY=AV,this.autoScaling=new ZC,this.axisDraggingMode="zoom",this.buttons=new Op(this.ctx,this.getModuleProperties.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.onDataChange=new qC,this.axisDragger=new l7,this.panner=new m7,this.scroller=new b7,this.scrollPanner=new x7,this.twoFingers=new k7,this.deceleration="short",this.dragState=0,this.isState=s=>this.ctx.interactionManager.isState(s),this.destroyContextMenuActions=void 0,this.wheelSequencer=new I7,this.previousZoomValid=!0,this.previousAxisZoomValid={x:!0,y:!0},this.toggleAxisDraggingCursorsDebounced=qp(this.toggleAxisDraggingCursors.bind(this),CV,{leading:!0,trailing:!0});const t=new kV;this.selector=new v7(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new c7(e.eventsHub,e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this));const i=s=>{if(this.minVisibleItems>0){const n=s.stateAsDefinedZoom();s.constrainZoom(this.constrainZoom(n))}};this.dataChangeHandler=new g7(i,this.onDataChange,this.ctx,this.cleanup),this.domProxy=new h7({onAxisDragStart:s=>this.onAxisDragStart(s),onAxisDragMove:(s,n,a)=>this.onAxisDragMove(s,n,a),onAxisDragEnd:()=>this.onAxisDragEnd(),onAxisDoubleClick:s=>this.onAxisDoubleClick(s),onAxisWheel:(s,n)=>this.onAxisWheel(s,n)}),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",s=>this.onSeriesAreaDoubleClick(s)),e.widgets.seriesDragInterpreter.events.on("drag-move",s=>this.onSeriesAreaDragMove(s)),e.widgets.seriesDragInterpreter.events.on("drag-start",s=>this.onSeriesAreaDragStart(s)),e.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(e.scene.attachNode(t),e.eventsHub.on("series-area:hover",s=>this.onSeriesAreaHoverEvent(s)),e.eventsHub.on("series-area:click",s=>this.onSeriesAreaClickEvent(s)),e.eventsHub.on("series:keynav-zoom",s=>this.onNavZoom(s)),e.widgets.seriesWidget.addListener("wheel",s=>this.onWheel(s)),e.widgets.seriesWidget.addListener("touchstart",(s,n)=>this.onTouchStart(s,n)),e.widgets.seriesWidget.addListener("touchmove",(s,n)=>this.onTouchMove(s,n)),e.widgets.seriesWidget.addListener("touchend",s=>this.onTouchEnd(s)),e.widgets.seriesWidget.addListener("touchcancel",s=>this.onTouchEnd(s)),e.updateService.addListener("process-data",s=>this.onProcessData(s)),e.eventsHub.on("layout:complete",s=>this.onLayoutComplete(s)),e.eventsHub.on("zoom:change-request",s=>this.onZoomChangeRequested(s)),e.eventsHub.on("zoom:pan-start",s=>this.onZoomPanStart(s)),this.panner.addListener("update",s=>this.onPanUpdate(s)),()=>this.teardown()),this.autoScaler=new a7(this.autoScaling,e.zoomManager,this,e.eventsHub,this.cleanup)}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.domProxy.destroy(),this.dataChangeHandler.destroy()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){return e?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?Tp(this.getZoom()):!0}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this;!t||!i||e?.preventZoomDblClick||!this.isState(hm.ZoomClickable)||this.resetZoom("zoom-seriesarea-dblclick")}onSeriesAreaHoverEvent(e){if(!this.shouldHandleAxisHover(e)){this.clearHoveredAxis();return}const t=this.domProxy.pickAxisAtPoint(e);t?(this.domProxy.setHoveredAxis(t.axisId),this.ctx.domManager.updateCursor(Pp,this.domProxy.getCursor(t.direction))):this.clearHoveredAxis()}onSeriesAreaClickEvent(e){if(!this.shouldHandleAxisClick(e))return;const t=this.domProxy.pickAxisAtPoint(e);t&&e.sourceEvent?.type==="dblclick"&&this.onAxisDoubleClick(t.axisId)}shouldHandleAxisHover(e){const{enabled:t,enableAxisDragging:i,enableAxisScrolling:s,dragState:n}=this;return t&&(i||s)&&!e.consumed&&!this.activeAxis&&n===0&&this.domProxy.hasOverlappingAxes()}shouldHandleAxisClick(e){const{enabled:t,enableAxisDragging:i,enableAxisScrolling:s,enableDoubleClickToReset:n}=this;return t&&!this.activeAxis&&!e.consumed&&(i||s||n)}clearHoveredAxis(){this.activeAxis||(this.domProxy.clearHoveredAxis(),this.dragState===0&&this.ctx.domManager.updateCursor(Pp))}tryBeginAxisDelegation(e){const t=this.domProxy.getHoveredAxis();if(!this.enabled||!this.enableAxisDragging||!t||!this.domProxy.beginDelegatedAxisDrag(t.axisId))return!1;this.activeAxis=t,this.onAxisDragStart(t.direction);const i=this.dragState===2?"grabbing":this.domProxy.getCursor(t.direction);return this.ctx.domManager.updateCursor(Pp,i),e.device==="touch"&&e.sourceEvent.preventDefault(),!0}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:s,ctx:{domManager:n,zoomManager:a}}=this;if(!t||!this.isState(hm.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)||(this.panner.stopInteractions(),this.tryBeginAxisDelegation(e)))return;let o=0;const r=this.isPanningKeyPressed(e.sourceEvent);i&&(!s||r)?(n.updateCursor(Pp,"grabbing"),o=2,this.panner.start()):s&&!r&&(o=3),(this.dragState=o)!==0&&a.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(e){const{dragState:t,enabled:i,paddedRect:s,panner:n,selector:a,ctx:{interactionManager:o,tooltipManager:r,updateService:l}}=this;if(this.activeAxis){this.onAxisDragMove(this.activeAxis.axisId,this.activeAxis.direction,e);return}if(!(!i||!s||!this.isState(hm.ZoomDraggable)||this.isIgnoredTouch(e))){switch(o.pushState(N.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault(),t){case 2:n.update(e);break;case 3:a.update(e,this.getModuleProperties(),s);break;case 0:return}r.updateTooltip(dm),l.update(5,{skipAnimations:!0})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:e}}=this;if(this.activeAxis){this.handleAxisDragEnd();return}e.popState(N.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState())}handleAxisDragEnd(){this.onAxisDragEnd(),this.domProxy.endDelegatedAxisDrag(this.activeAxis.axisId),this.activeAxis=void 0,this.clearHoveredAxis()}handleRegularDragEnd(){const{panner:e,selector:t}=this;switch(this.dragState){case 2:e.stop();break;case 3:if(t.didUpdate()){const i=t.stop(this.seriesRect,this.paddedRect,this.getZoom());i?this.updateZoom(Yh("zoom-seriesarea-selector"),i):this.ctx.updateService.update()}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(Pp),this.ctx.tooltipManager.removeTooltip(dm)}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,ctx:{zoomManager:s}}=this;!t||!i||!this.isState(hm.ZoomClickable)||(this.previousAxisZoomValid={x:!0,y:!0},s.resetAxisZoom({source:"user-interaction",sourceDetail:"zoom-axis-dblclick"},e))}onAxisDragStart(e){const{axisDraggingMode:t,domProxy:i,enabled:s,enableAxisDragging:n,panner:a,ctx:{zoomManager:o}}=this;!s||!n||(a.stopInteractions(),t==="pan"?(i.setAxisCursor("grabbing"),this.dragState=2,this.panner.start(e),o.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(e,t,i){const{anchorPointX:s,anchorPointY:n,axisDragger:a,dragState:o,enabled:r,enableAxisDragging:l,seriesRect:c,shouldFlipXY:h,ctx:{interactionManager:d,tooltipManager:u,updateService:p,zoomManager:f}}=this;if(!r||!l||!c)return;d.pushState(N.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const y=this.getZoom();if(o===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let b=t==="x"?s:n;h&&(b=t==="x"?n:s);const x=f.getAxisZoom(e),v=a.update(i,t,b,c,y,x);this.autoScaler.onManualAdjustment(t),this.updateAxisZoom(Yh("zoom-axis-drag"),e,t,v,{directional:!0})}u.updateTooltip(dm),p.update(5,{skipAnimations:!0})}onAxisDragEnd(){const{axisDraggingMode:e,axisDragger:t,dragState:i,domProxy:s,enabled:n,enableAxisDragging:a,ctx:{domManager:o,interactionManager:r,tooltipManager:l}}=this;r.popState(N.InteractionState.ZoomDrag),!(!n||!a||i===0)&&(this.dragState=0,e==="pan"&&(s.setAxisCursor("grab"),this.panner.stop()),t.stop(),o.updateCursor(Pp),l.removeTooltip(dm))}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(N.InteractionState.Default)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(Yh(`keyboard(${e.delta})`),s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:n}=this;if(!t||!s||!n||!this.isState(hm.ZoomWheelable))return;const{deltaX:a,deltaY:o}=e.sourceEvent,r=a!=null&&o!=null&&Math.abs(a)>Math.abs(o);i&&r?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,ctx:{zoomManager:n}}=this;if(!s)return;e.sourceEvent.preventDefault();const a=i.update(e,t,s,n.getAxisZooms());this.updateChanges(Yh("zoom-seriesarea-wheel"),a)}onWheelScrolling(e){const t=this.getZoom(),i=e.deltaY>0&&Tp(t);this.wheelSequencer.onWheel(e,()=>this.handleWheelScrolling(e,i))}onAxisWheel(e,t){if(!this.enableAxisScrolling||e!=="x"&&e!=="y")return;const i=e==="x",s=!i,n=this.getModuleProperties({isScalingX:i,isScalingY:s}),a=this.getZoom(),o=t.deltaY>0&&a[e].min===ba&&a[e].max===Yi;this.autoScaler.onManualAdjustment(e),this.wheelSequencer.onWheel(t,()=>this.handleWheelScrolling(t,o,n))}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{enableIndependentAxes:s,scroller:n,seriesRect:a,ctx:{zoomManager:o}}=this;if(!a)return"abort";let r=!0;const l=Yh("zoom-axis-wheel");if(s===!0){const c=n.updateAxes(e,i,a,o.getAxisZooms());for(const[h,{direction:d,min:u,max:p}]of rt(c)){const f=d==="x"?this.constrainZoom({x:{min:u,max:p},y:{min:Yi,max:Yi}}).x:{min:u,max:p};r&&(r=this.updateAxisZoom(l,h,d,f))}}else{const c=n.update(e,i,a,this.getZoom());if(c==null)return"abort";r=this.updateUnifiedZoom(l,c,{directional:!0})}return t||e.deltaY<0&&!r?"capped":"uncapped"}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(Yh("zoom-seriesarea-twofingers"),Na(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enabled,this.enableAxisDragging,this.enableAxisScrolling,this.ctx,e.series.rect),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursorsDebounced())}onZoomChangeRequested(e){e.sourceDetail!=="zoom-seriesarea-panner"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(Tp(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:n}}=this;if(!i)return;const a=t.translateZooms(i,n.getAxisZooms(),e.deltaX,e.deltaY);this.updateChanges(Yh("zoom-seriesarea-panner"),a),s.updateTooltip(dm)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}constrainZoom(e){return this.ctx.zoomManager.constrainZoomToItemCount(e,this.minVisibleItems,this.autoScaler.enabled)}isZoomValid(e,t){const{minVisibleItems:i,ctx:{zoomManager:s}}=this;if(i===0)return this.previousZoomValid=!0,!0;const n=this.getZoom(),a=aS(is(e))<aS(is(n)),o=aS(na(e))<aS(na(n));if(!a&&!o)return this.previousZoomValid=!0,!0;if(!this.previousZoomValid&&t?.directional)return!1;const r=t?.includeYVisibleRange??!1,l=this.autoScaler.enabled,c=s.isVisibleItemsCountAtLeast(e,i,{includeYVisibleRange:r,autoScaleYAxis:l});return this.previousZoomValid=t?.directional?c:!0,c}isAxisZoomValid(e,t,i){const{minVisibleItems:s,ctx:{zoomManager:n}}=this,a=this.getZoom(),o=t.max-t.min,r=a[e].max-a[e].min,l={...a,[e]:t};if(o>=r)return this.previousAxisZoomValid[e]=!0,!0;if(!this.previousAxisZoomValid[e]&&i?.directional)return!1;const c={includeYVisibleRange:!1,autoScaleYAxis:this.autoScaler.enabled},h=n.isVisibleItemsCountAtLeast(l,s,c);return this.previousAxisZoomValid[e]=i?.directional?h:!0,h}resetZoom(e){this.previousZoomValid=!0,this.previousAxisZoomValid={x:!0,y:!0},this.ctx.zoomManager.resetZoom({source:"user-interaction",sourceDetail:e})}updateSyncZoom(e){this.updateZoom({source:"sync",sourceDetail:"internal-updateSyncZoom"},e)}updateChanges(e,t){const i=this.ctx.zoomManager.toZoomState(t)??{},s=Rt(this.ctx.zoomManager.getZoom());this.updateZoom(e,{x:i.x??s.x,y:i.y??s.y})}updateZoom(e,t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e,t):this.updateUnifiedZoom(e,t)}updateUnifiedZoom(e,t,i){return t=this.constrainZoom(t),this.isZoomValid(t,i)?(this.ctx.zoomManager.updateZoom(e,t),!0):(this.ctx.updateService.update(9,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e,t){this.updatePrimaryAxisZoom(e,t,"x"),this.updatePrimaryAxisZoom(e,t,"y")}updatePrimaryAxisZoom(e,t,i){const s=this.ctx.zoomManager.getPrimaryAxisId(i);s!=null&&this.updateAxisZoom(e,s,i,t[i])}updateAxisZoom(e,t,i,s,n){const{enableIndependentAxes:a,ctx:{zoomManager:o}}=this;if(!s)return!1;const r=this.getZoom();if(a!==!0)return r[i]=s,this.updateUnifiedZoom(e,r,n);if(!this.isAxisZoomValid(i,s,n))return!1;const{source:l,sourceDetail:c}=e;return o.updateChanges({source:l,sourceDetail:c,changes:{[t]:s},isReset:!1}),!0}updateAxisCursor(e){if(!this.domProxy)return;const{enableAxisDragging:t=this.enableAxisDragging,enableAxisScrolling:i=this.enableAxisScrolling,axisDraggingMode:s=this.axisDraggingMode}=e;t?this.domProxy.setAxisCursor(s==="pan"?"grab":void 0):i?this.domProxy.setAxisCursor("default"):this.domProxy.setAxisCursor(void 0)}toggleAxisDraggingCursors(){const{anchorPointX:e,anchorPointY:t,domProxy:i}=this,s=this.getZoom();let n=is(s)!==$h,a=na(s)!==$h;if(!n){const o=iS(s,.999,1);o.x=aa(o.x,s.x,e),n=this.isZoomValid(o,{includeYVisibleRange:!0})}if(!a){const o=iS(s,1,.999);o.y=aa(o.y,s.y,t),a=this.isZoomValid(o,{includeYVisibleRange:!0})}i.toggleAxisDraggingCursor("x",n),i.toggleAxisDraggingCursor("y",a)}getZoom(){return Rt(this.ctx.zoomManager.getZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};g([_e({newValue(e){this.onEnabledChange(e)}}),m],ci.prototype,"enabled",2),g([_e({changeValue(e){this.updateAxisCursor({enableAxisDragging:e})}}),m],ci.prototype,"enableAxisDragging",2),g([_e({changeValue(e){this.updateAxisCursor({enableAxisScrolling:e})}}),m],ci.prototype,"enableAxisScrolling",2),g([m],ci.prototype,"enableDoubleClickToReset",2),g([_e({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),m],ci.prototype,"enableIndependentAxes",2),g([m],ci.prototype,"enablePanning",2),g([m],ci.prototype,"enableScrolling",2),g([m],ci.prototype,"enableSelecting",2),g([m],ci.prototype,"enableTwoFingerZoom",2),g([m],ci.prototype,"panKey",2),g([m],ci.prototype,"axes",2),g([m],ci.prototype,"scrollingStep",2),g([m],ci.prototype,"keepAspectRatio",2),g([m],ci.prototype,"minVisibleItems",2),g([m],ci.prototype,"anchorPointX",2),g([m],ci.prototype,"anchorPointY",2),g([m],ci.prototype,"autoScaling",2),g([_e({changeValue(e){this.updateAxisCursor({axisDraggingMode:e})}}),m],ci.prototype,"axisDraggingMode",2),g([m],ci.prototype,"buttons",2),g([m],ci.prototype,"onDataChange",2),g([Gt("panner.deceleration"),m],ci.prototype,"deceleration",2);var oS=U("pointer","start","middle","end"),Ep={type:"plugin",name:"zoom",enterprise:!0,version:ue,options:{enabled:R,enableAxisDragging:R,enableAxisScrolling:R,enableDoubleClickToReset:R,enablePanning:R,enableScrolling:R,enableSelecting:R,enableTwoFingerZoom:R,keepAspectRatio:R,anchorPointX:oS,anchorPointY:oS,axisDraggingMode:U("pan","zoom"),axes:U("x","y","xy"),deceleration:Se(U("off","short","long"),ne),minVisibleItems:P,panKey:U("alt","ctrl","meta","shift"),scrollingStep:ne,autoScaling:{enabled:R,padding:ne},onDataChange:{strategy:eg()("reset","preserveDomain","preserveRatios"),stickToEnd:R},buttons:{enabled:R,buttons:Ft({...dr,value:U("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:L},"zoom button options array"),visible:U("always","zoomed","hover")}},themeTemplate:{enabled:!1,enableAxisDragging:!0,enableAxisScrolling:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$and:[{$eq:[{$path:"../axes"},"x"]},{$not:{$eq:[{$path:"/series/0/direction"},"horizontal"]}}]},padding:.05},onDataChange:{strategy:"preserveDomain",stickToEnd:!1},anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:{$path:"../enabled"},visible:"hover",buttons:{$shallowSimple:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]}}},create:e=>new ci(e)};Ep.options.enableIndependentAxes=Q(R),Ep.options.buttons.anchorPointX=Q(oS),Ep.options.buttons.anchorPointY=Q(oS);function um(e,t,i){return ls(e.chartService,t,i)}var{AxisInterval:A7,AxisLabel:C7,LinearScale:w7,BBox:L7,TranslatableGroup:N7,Selection:T7,Text:O7}=N,rS=class uL{constructor(t,i){this.ctx=t,this.dataProvider=i,this.id=Ii(this),this.axisGroup=new N7({name:`${this.id}-AxisTicks`,zIndex:3}),this.labelSelection=T7.select(this.axisGroup,O7),this.interval=new A7,this.label=new C7,this.scale=new w7,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const{placement:t,translationX:i,translationY:s,horizontal:n,label:a}=this;function o(u){}let r,l;switch(t){case"top":case"top-right":case"top-left":r="bottom",l="center",a.mirrored=!1,a.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":r="top",l="center",a.mirrored=!1,a.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":r="middle",l="left",a.mirrored=!0,a.parallel=!1;break;default:}const c=[],h=this.generateTicks(),{ticks:d}=h;return this.labelSelection.update(d,void 0,u=>u.tickId),this.axisGroup.setProperties({translationX:i,translationY:s}),this.labelSelection.each((u,p)=>{u.fontFamily=a.fontFamily,u.fontSize=a.fontSize,u.fontStyle=a.fontStyle,u.fontWeight=a.fontWeight,u.fill=a.color,u.textBaseline=r,u.textAlign=l,u.text=p.tickLabel,u.x=n?p.translation:0,u.y=n?0:p.translation,c.push(u.getBBox())}),c.length>0?L7.merge(c).translate(i,s):void 0}tickFormatter(t,i,s,n){const{ctx:a}=this,{formatManager:o}=a,r=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:t,boundSeries:r,fractionDigits:n,visibleDomain:void 0};return this.label.formatValue((d,u)=>um(a,d,u),h,c)??o.format((d,u)=>um(a,d,u),h)??o.defaultFormat(h)}}inRange(t,i=.001){const[s,n]=Tt(this.scale.range);return t>=s-i&&t<=n+i}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:a}=fx(xo(this.scale.range),1,t,i,uL.DefaultTickCount,uL.DefaultMinSpacing),o=this.getTicksData({nice:[!0,!0],interval:this.interval.step,tickCount:a,minTickCount:n,maxTickCount:s});if(this.placement==="bottom"||this.placement==="top"){const r=et(this.label),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;o.ticks=o.ticks.filter(u=>{if(Math.sign(u.translation-d)!==h)return!1;const{width:p}=De(u.tickLabel)?Js(u.tickLabel,this.label):r.measureLines(At(u.tickLabel));return d=u.translation+p*h,!0})}return o}getTicksData(t){const i=[],s=t.nice?this.scale.niceDomain(t):this.scale.domain,n=this.scale.ticks(t,s)?.ticks??[],a=n.reduce((l,c)=>Math.max(l,Pc(c)),0),o=jg(),r=this.tickFormatter(s,n,!1,a);for(let l=0;l<n.length;l++){const c=n[l],h=this.scale.convert(c);if(!this.inRange(h))continue;const d=r(c,l);if(d==null||d==="")continue;const u=o(Ne(d));i.push({tick:c,tickId:u,tickLabel:d,translation:h})}return{rawTicks:n,fractionDigits:a,ticks:i}}};rS.className="AxisTicks",rS.DefaultTickCount=5,rS.DefaultMinSpacing=10;var P7=rS,{LayoutElement:E7,Group:R7,Rect:BV,Marker:z7,TranslatableGroup:V7,BBox:JC}=N,ew=class extends X{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};g([m],ew.prototype,"thickness",2),g([m],ew.prototype,"preferredLength",2);var lS=class extends X{constructor(e){super(),this.axisTicks=e}};g([Gt("axisTicks.label")],lS.prototype,"label",2),g([Gt("axisTicks.interval")],lS.prototype,"interval",2),g([Gt("axisTicks.padding")],lS.prototype,"padding",2);var oa=class extends X{constructor(e){super(),this.ctx=e,this.id=Ii(this),this.legendGroup=new V7({name:"legend",zIndex:16}),this.containerNode=this.legendGroup.appendChild(new BV({name:"legend-container"})),this.gradientRect=new BV,this.arrow=new z7({shape:"triangle"}),this.ticksGroup=new R7({name:"legend-axis-group"}),this.cleanup=new pt,this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new ew,this.spacing=20,this.border=new Mr(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new P7(e,this),this.axisTicks.attachAxis(this.ticksGroup),this.scale=new lS(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.cleanup.register(e.eventsHub.on("highlight:change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(E7.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){const{placement:e}=Sl(this.position);return e.startsWith("right")||e.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout({layoutBox:e}){const[t]=this.data;if(!this.enabled||!t?.enabled||t.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t),{strokeWidth:s,padding:n}=this.getContainerStyles(),a=this.updateGradientRect(e,i),o=this.updateAxis(t,a)??new JC(0,0,0,0),r=JC.merge([a,o]);r.grow(n).grow(s);const{left:l,top:c}=this.getMeasurements(e,r);this.updateContainer(r),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,n]=t,a=i.length;return t=i.map((o,r)=>r===0?s:r===a-1?n:s+(n-s)*r/(a-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i,gradient:s}=this,{preferredLength:n,thickness:a}=s,o=new JC(0,0,0,0),r=Math.max(t.length-1,1);let l;return this.isVertical()?(l=0,o.width=a,o.height=Math.min(e.height,n)):(l=90,o.width=Math.min(e.width,n),o.height=a),i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((c,h)=>({stop:h/r,color:c})),rotation:l},o}updateAxis(e,t){const{axisTicks:i,gradient:s,scale:n}=this,{placement:a}=Sl(this.position),o=this.isVertical(),r=this.reverseOrder!==o;i.placement=a;const l=s.thickness+(n.padding??0);return i.translationX=o?l:t.x,i.translationY=o?t.y:l,i.scale.domain=r?e.colorDomain.slice().reverse():e.colorDomain,i.scale.range=o?[t.x,t.height]:[t.y,t.width],i.calculateLayout()}updateContainer(e){const t=this.getContainerStyles();this.containerNode.setStyleProperties(t),this.containerNode.cornerRadius=t.cornerRadius,this.containerNode.x=e.x,this.containerNode.y=e.y,this.containerNode.width=e.width,this.containerNode.height=e.height}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null){t.visible=!1;return}const{scale:i,label:s}=this.axisTicks,n=s.fontSize??0,a=i.convert(e.colorValue);let{x:o,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(o-=n/2,r+=a,l/=2):(o+=a,r-=n/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=n,t.translationX=o,t.translationY=r}getMeasurements(e,t){const i=u=>{};let{x:s,y:n}=e;const{width:a,height:o}=t,{placement:r,floating:l,xOffset:c,yOffset:h}=Sl(this.position),d=this.getContainerStyles();switch(s+=d.strokeWidth+d.padding.left,n+=d.strokeWidth+d.padding.top,r){case"left":n+=e.height/2-o/2;break;case"right":s+=e.width-a,n+=e.height/2-o/2;break;case"top":s+=e.width/2-a/2;break;case"bottom":s+=e.width/2-a/2,n+=e.height-o;break;case"right-top":case"top-right":s+=e.width-a;break;case"right-bottom":case"bottom-right":s+=e.width-a,n+=e.height-o;break;case"left-bottom":case"bottom-left":n+=e.height-o;break;case"left-top":case"top-left":break;default:i(r)}if(!l)switch(r){case"left":case"left-top":case"left-bottom":e.shrink(a+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":e.shrink(a+this.spacing,"right");break;case"top":case"top-left":case"top-right":e.shrink(o+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":e.shrink(o+this.spacing,"bottom");break;default:i(r)}return s+=c,n+=h,{top:n,left:s}}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:a,padding:o}=this,r=typeof o=="number";return{cornerRadius:s,fill:n,fillOpacity:a,padding:{top:r?o:o.top??0,right:r?o:o.right??0,bottom:r?o:o.bottom??0,left:r?o:o.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0}}onChartHoverChange(){this.enabled&&this.updateArrow()}};oa.className="GradientLegend",g([m],oa.prototype,"enabled",2),g([m],oa.prototype,"position",2),g([m],oa.prototype,"reverseOrder",2),g([m],oa.prototype,"gradient",2),g([m],oa.prototype,"spacing",2),g([m],oa.prototype,"border",2),g([m],oa.prototype,"cornerRadius",2),g([m],oa.prototype,"fill",2),g([m],oa.prototype,"fillOpacity",2),g([m],oa.prototype,"padding",2),g([m],oa.prototype,"scale",2);var cS={type:"plugin",name:"gradientLegend",enterprise:!0,version:ue,options:{enabled:R,position:Id,spacing:P,reverseOrder:R,border:cr,cornerRadius:W,padding:bl,fill:ws,fillOpacity:ne,gradient:{preferredLength:P,thickness:P},scale:{label:{...$e,minSpacing:P,format:fn,formatter:ot},padding:P,interval:{step:W,values:pn,minSpacing:Fe(P,as("maxSpacing")),maxSpacing:Fe(P,os("minSpacing"))}}},themeTemplate:{...My,enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1,fill:{$applySwitch:[{$path:"type"},{$ref:"chartBackgroundColour"},["gradient",G0],["pattern",$0],["image",U0]]}},create:e=>{const t=new oa(e);return t.attachLegend(e.scene),t}},{OrdinalTimeScale:B7,ApproximateOrdinalTimeScale:F7,APPROXIMATE_THRESHOLD:_7,TimeAxisParentLevel:H7,minimumTimeAxisDatumGranularity:G7}=N,hS=class extends N.DiscreteTimeAxis{constructor(e){const t=new B7;super(e,t),this.parentLevel=new H7,this.accurateScale=t,this.approximateScale=new F7,this.approximateScale.setSourceScale(t),Object.defineProperty(this,"scale",{get:()=>this.getActiveScale(),configurable:!0})}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}getActiveScale(){const e=this.accurateScale.bandCount(this.visibleRange);return(this.accurateScale.getUniformityCache(this.visibleRange)?.isUniform??!1)&&e>=_7?this.approximateScale:this.accurateScale}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=G7(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=Hg(t));const n=Gg(e),a=xa(s),o=ja(s),r=El(s);return{type:"date",unit:a,step:o,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:b}=this,x=ru(e);b!=null&&cs(b)<cs(x)?s=b:s=x}const{datum:a,seriesId:o,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u}=t,p=xa(s),f=ja(s),y=El(s);return{type:"date",value:e,datum:a,seriesId:o,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u,unit:p,step:f,epoch:y,style:n}}};hS.className="OrdinalTimeAxis",hS.type="ordinal-time",g([m],hS.prototype,"parentLevel",2);var tw={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,version:ue,options:N.ordinalTimeAxisOptionsDefs,themeTemplate:{groupPaddingInner:0,label:{autoRotate:!1,minSpacing:40},gridLine:{enabled:!1},interval:{placement:"between"}},create:e=>new hS(e)},FV=[lE,tw].flat(),Rp={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},_V={$clone:{$omit:[["placement","spacing"],{$path:"/series/0/stageLabel"}]}},HV={y:{type:{$if:[Rp,"number","category"]},position:{$if:[Rp,"left",{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},"right","left"]}]},label:{$if:[Rp,void 0,_V]}},x:{type:{$if:[Rp,"category","number"]},position:{$if:[Rp,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},"top","bottom"]},"bottom"]},label:{$if:[Rp,_V,void 0]}}},j7={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",gy],["pattern",xy],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},highlight:{unhighlightedItem:{opacity:.6}}},axes:{number:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},category:{line:{enabled:!1}}}},{NODE_UPDATE_STATE_TO_PHASE_MAPPING:W7}=N;function GV(e,t,i,s){const{x0:n,y0:a,x1:o,y1:r,x2:l,y2:c,x3:h,y3:d,opacity:u}=e;return i?{x0:(n+h)/2,y0:(a+d)/2,x1:(o+l)/2,y1:(r+c)/2,x2:(o+l)/2,y2:(r+c)/2,x3:(n+h)/2,y3:(a+d)/2,opacity:u}:{x0:(n+o)/2,y0:(a+r)/2,x1:(n+o)/2,y1:(a+r)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function $7(e,t){const i=a=>a==null;return{fromFn:(a,o,r)=>{r==="updated"&&i(o)?r="removed":r==="updated"&&i(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&t==="fade"?l={...pm(a,o),opacity:0}:r==="unknown"||r==="added"?l=GV(o,a.previousDatum,e,t):l={x0:a.x0,y0:a.y0,x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,x3:a.x3,y3:a.y3,opacity:a.opacity};const c=W7[r];return{...l,phase:c}},toFn:(a,o,r)=>{let l;return r==="removed"&&a.datum==null&&t==="fade"?l={...pm(a,o),opacity:0}:r==="removed"||i(o)?l=GV(o,a.previousDatum,e,t):l=pm(a,o),l}}}function pm(e,t){const{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:jV,valueProperty:K7,keyProperty:U7,updateLabelNode:Y7,SMALLEST_KEY_INTERVAL:Z7,LARGEST_KEY_INTERVAL:X7,diff:q7,fixNumericExtent:Q7,seriesLabelFadeInAnimation:WV,resetMotion:J7,resetLabelFn:eJ,animationValidation:tJ,computeBarFocusBounds:iJ,Group:sJ,Selection:nJ,PointerEvents:$V,motion:aJ,checkCrisp:oJ,createDatumId:rJ}=N,lJ=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},KV=class extends N.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[jV.AXIS_ALIGNED,jV.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:eJ}}),this.NodeEvent=lJ,this.connectorNodeGroup=this.contentGroup.appendChild(new sJ({name:`${this.id}-series-connectorNodes`,zIndex:0})),this.connectorSelection=nJ.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=$V.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[0,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new Ho}getKeyAxis(e){if(e==="x")return this.properties.xKeyAxis;if(e==="y")return this.properties.yKeyAxis}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:n}=this,a=(y,b,x)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:x}),o=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:r}),d=[];this.needsDataModelDiff()&&this.processedData&&d.push(q7(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||d.push(tJ());const u=this.visible?{}:{forceValue:0},p=this.properties.allowNullKeys??!1,{processedData:f}=await this.requestDataModel(e,this.data,{props:[U7(t,c,{id:"xValue",allowNullKey:p}),K7(i,h,{id:"yValue",...u,validation:a,invalidValue:0}),...l?[Z7,X7]:[],...d],groupByKeys:!1});this.smallestDataInterval=f.reduced?.smallestKeyInterval,this.largestDataInterval=f.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!t||!i)return{domain:[]};const{keys:[a]}=t.domain;if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category"){if(!this.hasData)return{domain:[]};const r=a.filter((c,h)=>n.getItemEnabled({seriesId:s,itemId:h})),l=i.getKeySortMetadata(this,"xValue",t);return{domain:r,sortMetadata:l}}return{domain:this.padBandExtent(a)}}else{const o=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...o),l=[-r,r];return{domain:Q7(l)}}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,processedData:s,id:n,ctx:{legendManager:a}}=this,o=this.getCategoryAxis(),r=this.getValueAxis();if(!(e&&t&&o&&r&&i&&s?.type==="ungrouped"))return;const l=o.scale,c=r.scale,h=this.getBarDirection()==="x",{stageKey:d,valueKey:u}=this.properties,p=`${u}`,f={itemId:p,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible},y=this.visible;if(!y)return f;const b=i.resolveKeysById(this,"xValue",s),x=i.resolveColumnById(this,"yValue",s),{groupOffset:v,barOffset:S,barWidth:M}=this.getBarDimensions(),D=oJ(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let I;const k=s.dataSources.get(this.id)?.data??[];for(const[C,A]of k.entries()){const w=y&&a.getItemEnabled({seriesId:n,itemId:C}),T=b[C];if(T===void 0&&!this.properties.allowNullKeys)continue;const O=l.convert(T);if(!Number.isFinite(O))continue;const z=Math.round(O)+v+S,V=x[C],E=Math.round(c.convert(-V)),_=Math.round(c.convert(V)),G=this.getItemStyle({datum:A,datumIndex:C},!1),B=Math.max(G.strokeWidth??0,Math.abs(_-E)),F={x:h?Math.min(_,E):z,y:h?z:Math.min(_,E),width:h?B:M,height:h?M:B},Y={x:F.x+F.width/2,y:F.y+F.height/2},Z=this.createLabelData({datumIndex:C,rect:F,barAlongX:h,yDatum:V,datum:A,visible:w}),ie={index:C,series:this,datum:A,datumIndex:C,xValue:T,yValue:V,xKey:d,yKey:u,x:F.x,y:F.y,width:F.width,height:F.height,midPoint:Y,crisp:D,label:Z,visible:w};if(f.nodeData.push(ie),Z!=null&&f.labelData.push(Z),I!=null){const ee=I.rect,he=I.nodeDatum,Me=I.datumIndex;h?f.connectorData.push({datum:he,datumIndex:Me,x0:ee.x,y0:ee.y+ee.height,x1:ee.x+ee.width,y1:ee.y+ee.height,x2:F.x+F.width,y2:F.y,x3:F.x,y3:F.y,opacity:1}):f.connectorData.push({datum:he,datumIndex:Me,x0:ee.x+ee.width,y0:ee.y,x1:F.x,y1:F.y,x2:F.x,y2:F.y+F.height,x3:ee.x+ee.width,y3:ee.y+ee.height,opacity:1})}w&&(I={itemId:p,rect:F,nodeDatum:ie,datumIndex:C})}return f}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:s}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,n=>this.getDatumId(n))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const t=this.getShapeFillBBox();e.connectorSelection.each((i,s)=>{const{fill:n,fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.connectorStyle(s.datumIndex);i.setProperties(pm(i,s)),i.setStyleProperties({fill:n,stroke:o,fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h},t)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=$V.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:s=!1,labelSelection:n}=e;n.each((a,o)=>{const r=this.getHighlightStyle(s,o.datumIndex);a.visible=o.visible||s,a.fillOpacity=r.opacity??1,a.opacity=r.opacity??1,Y7(this,a,t,this.properties.label,o,s,i)})}getHighlightLabelData(e,t){if(t.label)return[{...t.label}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{stageKey:a,valueKey:o,tooltip:r,legendItemName:l}=n,c=this.getCategoryAxis(),h=this.getValueAxis();if(!i||!s||!c||!h)return;const d=s.dataSources.get(this.id)?.data[e],u=i.resolveKeysById(this,"xValue",s)[e],p=i.resolveColumnById(this,"yValue",s)[e],f=this.properties.allowNullKeys??!1;if(!(u===void 0&&!f))return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",u,d,a,l),value:this.getAxisValueText(h,"tooltip",p,d,o,l)}]},{seriesId:t,datum:d,title:a,stageKey:a,valueKey:o,...this.tooltipStyle(d,e)})}resetAllAnimation(e){super.resetAllAnimation(e),J7([this.connectorSelection],pm)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),n=$7(i,"normal");aJ.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],n),WV(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),WV(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return rJ(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return iJ(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,fill:o,stroke:r}=this.properties.getStyle(e);return{marker:{fill:o,fillOpacity:i,stroke:r,strokeWidth:t,strokeOpacity:s,lineDash:n,lineDashOffset:a}}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:n},visible:a}=this;if(!s||!i||e!=="category")return[];const{showInLegend:o}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=r[c],d=this.properties.allowNullKeys??!1;if(!(h==null&&!d))return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:a&&n.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!o}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}},{Label:cJ,AbstractBarSeriesProperties:hJ,makeSeriesTooltip:dJ,AxisLabel:uJ}=N,iw=class extends cJ{constructor(){super(...arguments),this.spacing=0}};g([m],iw.prototype,"placement",2),g([m],iw.prototype,"spacing",2);var UV=class extends uJ{};g([m],UV.prototype,"placement",2);var ra=class extends hJ{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new iw,this.stageLabel=new UV,this.tooltip=dJ()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};g([m],ra.prototype,"stageKey",2),g([m],ra.prototype,"valueKey",2),g([m],ra.prototype,"fills",2),g([m],ra.prototype,"fillOpacity",2),g([m],ra.prototype,"strokes",2),g([m],ra.prototype,"strokeWidth",2),g([m],ra.prototype,"strokeOpacity",2),g([m],ra.prototype,"lineDash",2),g([m],ra.prototype,"lineDashOffset",2),g([m],ra.prototype,"label",2),g([m],ra.prototype,"stageLabel",2),g([m],ra.prototype,"tooltip",2);function YV(e,{x:t,y:i,width:s,height:n,opacity:a}){return{x1:t,y1:i,x2:t+s,y2:i+n,opacity:a??1}}var{Line:pJ}=N,sw=class extends KV{constructor(e){super({moduleCtx:e,animationResetFns:{datum:YV}}),this.properties=new ra}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.data.reduce((s,n,a)=>s+(t.getItemEnabled({seriesId:e,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:e},t){return this.properties.getStyle(e)}connectorStyle(e){return this.properties.getStyle(e)}nodeFactory(){return new pJ}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:n,visible:a}){const{stageKey:o,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;if(!l.enabled)return;let d,u,p,f;if(i)switch(d=t.x+t.width/2,p="center",h){case"before":u=t.y-c,f="bottom";break;case"after":u=t.y+t.height+c,f="top";break;default:u=t.y+t.height/2,f="middle"}else switch(u=t.y+t.height/2,f="middle",h){case"before":d=t.x-c,p="right";break;case"after":d=t.x+t.width+c,p="left";break;default:d=t.x+t.width/2,p="center"}const y=this.getSeriesDomain("y").domain,b=this.getLabelText(s,n,r,"y",y,l,{itemId:r,value:s,datum:n,stageKey:o,valueKey:r});return{x:d,y:u,textAlign:p,textBaseline:f,text:b,itemId:r,datum:n,datumIndex:e,series:this,visible:a}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each((i,s)=>{i.setProperties(YV(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0,i.opacity=t?.opacity??1})}tooltipStyle(e,t){const{fill:i,stroke:s,fillOpacity:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.getStyle(t);return{fill:i,fillOpacity:n,stroke:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};sw.className="ConeFunnelSeries",sw.type="cone-funnel";var{coneFunnelSeriesThemeableOptionsDef:gJ}=N,fJ={...J(qe,["showInLegend"]),...gJ,type:j(Ae("cone-funnel")),stageKey:j(L),valueKey:j(L)},mJ={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},yo]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",gy],["pattern",xy],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},yo]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:{highlightedItem:{stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},seriesArea:{padding:{top:20,bottom:20}},axes:{number:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},category:{line:{enabled:!1}}}},ZV={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:ue,dependencies:[ri],options:fJ,defaultAxes:HV,themeTemplate:mJ,create:e=>new sw(e)},{Label:yJ,DropShadow:xJ,AbstractBarSeriesProperties:bJ,makeSeriesTooltip:vJ,AxisLabel:SJ}=N,MJ=class extends yJ{},XV=class extends SJ{};g([m],XV.prototype,"placement",2);var dl=class extends X{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:e,stroke:t,fillOpacity:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this;return{fill:e,fillOpacity:i,stroke:t,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,opacity:1}}};g([m],dl.prototype,"enabled",2),g([m],dl.prototype,"fill",2),g([m],dl.prototype,"fillOpacity",2),g([m],dl.prototype,"stroke",2),g([m],dl.prototype,"strokeWidth",2),g([m],dl.prototype,"strokeOpacity",2),g([m],dl.prototype,"lineDash",2),g([m],dl.prototype,"lineDashOffset",2);var Ds=class extends bJ{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new dl,this.shadow=new xJ().set({enabled:!1}),this.label=new MJ,this.stageLabel=new XV,this.tooltip=vJ()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};g([m],Ds.prototype,"stageKey",2),g([m],Ds.prototype,"valueKey",2),g([m],Ds.prototype,"fills",2),g([m],Ds.prototype,"fillOpacity",2),g([m],Ds.prototype,"strokes",2),g([m],Ds.prototype,"strokeWidth",2),g([m],Ds.prototype,"strokeOpacity",2),g([m],Ds.prototype,"lineDash",2),g([m],Ds.prototype,"lineDashOffset",2),g([m],Ds.prototype,"spacingRatio",2),g([m],Ds.prototype,"itemStyler",2),g([m],Ds.prototype,"dropOff",2),g([m],Ds.prototype,"shadow",2),g([m],Ds.prototype,"label",2),g([m],Ds.prototype,"stageLabel",2),g([m],Ds.prototype,"tooltip",2);var{resetBarSelectionsFn:DJ,prepareBarAnimationFunctions:qV,midpointStartingBarPosition:QV,createDatumId:kJ,Rect:IJ,motion:JV}=N,nw=class extends KV{constructor(e){super({moduleCtx:e,animationResetFns:{datum:DJ}}),this.properties=new Ds}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(e){return re(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new IJ}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:n}){const{valueKey:a,stageKey:o,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain("y").domain,c=this.getLabelText(i,s,a,"y",l,r,{itemId:a,value:i,datum:s,stageKey:o,valueKey:a});return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:o,datum:s,datumIndex:e,series:this,visible:n}}getItemStyle({datum:e,datumIndex:t},i){const{id:s,properties:n}=this,{stageKey:a,valueKey:o,itemStyler:r}=n,l=this.getHighlightStyle(i,t);let h=re(l,n.getStyle(t));if(r!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),u=this.cachedDatumCallback(kJ(t,i?"highlight":"node"),()=>{const p=this.getHighlightStateString(d,i,t);return this.callWithContext(r,{seriesId:s,datum:e,highlightState:p,stageKey:a,valueKey:o,...h})});u&&(h=re(u,h))}return h}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:s}=this.properties,n=this.getCategoryDirection()==="x",a=this.getShapeFillBBox();e.each((o,r)=>{const l=this.getItemStyle(r,t);o.setStyleProperties(l,a),o.visible=n?r.width>0:r.height>0,o.crisp=r.crisp,o.fillShadow=s})}tooltipStyle(e,t){return this.getItemStyle({datum:e,datumIndex:t},!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),n=qV(QV(i,"normal"),"unknown");JV.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=qV(QV(this.isVertical(),"fade"),"added");JV.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n,(a,o)=>o.xValue,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};nw.className="FunnelSeries",nw.type="funnel";var{funnelSeriesThemeableOptionsDef:AJ}=N,CJ={...AJ,...J(qe,["showInLegend"]),type:j(Ae("funnel")),stageKey:j(L),valueKey:j(L)},eB={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:ue,dependencies:[ri],options:CJ,defaultAxes:HV,themeTemplate:j7,create:e=>new nw(e)},tB=[cE,oC,jv,ZV,eB,fC,Wv,Zv,Xv,VC].flat(),iB=[FV,tB,Uf,UA,YA,Vv,am,QA,Bv,JA,dz,cS,BC,HC,bV,$C,YC,Ep].flat(),{DEFAULT_ANNOTATION_HANDLE_FILL:wJ,DEFAULT_ANNOTATION_STATISTICS_COLOR:LJ,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:NJ,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:sB,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:nB,DEFAULT_ANNOTATION_STATISTICS_FILL:TJ,DEFAULT_ANNOTATION_STATISTICS_STROKE:OJ,DEFAULT_FIBONACCI_STROKES:aB,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:zp,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:ul,DEFAULT_TEXTBOX_COLOR:PJ,DEFAULT_TEXTBOX_FILL:EJ,DEFAULT_TEXTBOX_STROKE:RJ,DEFAULT_TEXT_ANNOTATION_COLOR:zJ}=mL,Ta={stroke:ul},ks={fill:wJ},oB={color:"white",fill:ul},pl={color:ul},Zh={color:zJ,fontSize:{$rem:ki.LARGE},fontFamily:{$ref:"fontFamily"}},aw={...Zh,fontSize:{$ref:"fontSize"},color:LJ,fill:TJ,stroke:OJ,strokeWidth:1,divider:{stroke:NJ,strokeWidth:1,strokeOpacity:.5}},ow={...Ta,background:{fill:zp,fillOpacity:.2},handle:{...ks},text:{...pl},statistics:{...aw}},VJ={line:{...Ta,handle:{...ks},text:{...pl}},"horizontal-line":{...Ta,handle:{...ks},axisLabel:{...oB},text:{...pl}},"vertical-line":{...Ta,handle:{...ks},axisLabel:{...oB},text:{...pl}},"disjoint-channel":{...Ta,background:{fill:zp,fillOpacity:.2},handle:{...ks},text:{...pl}},"parallel-channel":{...Ta,background:{fill:zp,fillOpacity:.2},handle:{...ks},text:{...pl}},"fibonacci-retracement":{...Ta,strokes:aB,rangeStroke:ul,handle:{...ks},text:{...pl,position:"center"},label:{...Zh,color:void 0,fontSize:{$rem:ki.SMALLER}}},"fibonacci-retracement-trend-based":{...Ta,strokes:aB,rangeStroke:ul,handle:{...ks},text:{...pl,position:"center"},label:{...Zh,color:void 0,fontSize:{$rem:ki.SMALLER}}},callout:{...Ta,...Zh,color:{$ref:"textColor"},handle:{...ks},fill:zp,fillOpacity:.2},comment:{...Zh,color:"white",fontWeight:700,handle:{...ks},fill:ul},note:{...Zh,color:PJ,fill:ul,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ks},background:{fill:EJ,stroke:RJ,strokeWidth:1}},text:{...Zh,handle:{...ks}},arrow:{...Ta,handle:{...ks},text:{...pl}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...ks,stroke:ul}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...ks,stroke:ul}},"date-range":{...ow},"price-range":{...ow},"date-price-range":{...ow},"quick-date-price-range":{up:{...Ta,fill:zp,fillOpacity:.2,handle:{...ks},statistics:{...aw,color:"#fff",fill:zp,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Ta,stroke:nB,fill:sB,fillOpacity:.2,handle:{...ks,stroke:nB},statistics:{...aw,color:"#fff",fill:sB,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},BJ=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],FJ=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function _J(e,t,i){const{dateKey:s="date",highKey:n="high",openKey:a="open",lowKey:o="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:d=!0,rangeButtons:u=!0,statusBar:p=!0,toolbar:f=!0,zoom:y=!0,sync:b=!1,theme:x,data:v,formatter:S,...M}=e,D=GJ(c,s,n,o,a,r),I=HJ(i,s,a,r,d,l),C={navigator:{enabled:h,...d?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:yr,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},A={annotations:{enabled:f,optionsToolbar:{enabled:f},snap:!0,toolbar:{enabled:f,buttons:FJ,padding:0},data:v,xKey:s,volumeKey:d?l:void 0}},w=p?{statusBar:{enabled:!0,highKey:n,openKey:a,lowKey:o,closeKey:r,volumeKey:d?l:void 0}}:null,T={zoom:{enabled:y,autoScaling:{enabled:!0},onDataChange:{stickToEnd:!0},enableIndependentAxes:!0}},O={ranges:{enabled:u}},z=b?{sync:{enabled:b,nodeInteraction:!0,zoom:!0}}:null,V=d?{yVolume:{type:"number",position:"left",label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}}:{};return{theme:{baseTheme:typeof x=="string"?x:"ag-financial",...re(typeof x=="object"?x:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:f},annotations:{...VJ},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}},category:{gridLine:{enabled:!0}},time:{gridLine:{enabled:!0}},"unit-time":{gridLine:{enabled:!0}},"ordinal-time":{gridLine:{enabled:!0}}}},bar:{series:{fillOpacity:.5,highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},line:{series:{marker:{enabled:!1},highlight:{unhighlightedSeries:{opacity:1}},...dS(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...dS(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},ohlc:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},"range-area":{series:{fillOpacity:.3,strokeWidth:2,highlight:{bringToFront:!1,unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...dS(c,{hlc:{fill:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.fill"},{$palette:"down.fill"}]},stroke:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.stroke"},{$palette:"down.stroke"}]}}})}},"range-bar":{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...dS(c,{"high-low":{fill:{$palette:"neutral.fill"},stroke:{$palette:"neutral.stroke"}}})}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...I,...D],axes:{y:{type:"number",position:"right",crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...V,x:{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}},tooltip:{enabled:!1},data:v,formatter:S,...A,...C,...w,...T,...O,...z,...M}}function HJ(e,t,i,s,n,a){return n?[{type:"bar",xKey:t,yKey:a,yKeyAxis:"yVolume",tooltip:{enabled:!1},simpleItemStyler(o){const{up:r,down:l}=e().palette;return{fill:o[i]<o[s]?r?.fill:l?.fill}},focusPriority:1,highlight:{unhighlightedSeries:{opacity:1}}}]:[]}var rB="range-area";function GJ(e,t,i,s,n,a){const o={xKey:t,openKey:n,closeKey:a,highKey:i,lowKey:s},r={xKey:t,yKey:a},l={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return jJ(l,o);case"line":case"step-line":return WJ(l,r);case"hlc":return $J(l,r,o);case"high-low":return KJ(l,o);case"candlestick":case"hollow-candlestick":return lB(l,o);default:return K.warnOnce(`unknown chart type: ${e}; expected one of: ${BJ.join(", ")}`),lB(l,o)}}function jJ(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function WJ(e,t){return[{type:"line",focusPriority:0,...e,...t}]}function $J(e,t,{xKey:i,highKey:s,closeKey:n,lowKey:a}){return[{type:rB,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:n},{type:rB,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:a},{type:"line",...e,...t}]}function KJ(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,tooltip:{range:"nearest"},focusPriority:0}]}function lB(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function dS(e,t){return t[e]??t.default}var UJ={chartType:U("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:L,openKey:L,highKey:L,lowKey:L,closeKey:L,volumeKey:L,navigator:R,volume:R,rangeButtons:R,statusBar:R,toolbar:R,zoom:R,sync:R,theme:ce,container:ce,width:ce,height:ce,minWidth:ce,minHeight:ce,listeners:ce,initialState:ce,title:ce,data:pn,formatter:ce},YJ={theme:ce,container:ce,animation:ce,background:ce,contextMenu:ce,context:()=>!0,listeners:ce,locale:ce,width:ce,height:ce,minWidth:ce,minHeight:ce,title:ce,subtitle:ce,footnote:ce,padding:ce,tooltip:{...Ue,...ke.tooltip}};YJ.overrideDevicePixelRatio=Q(P);var ZJ={type:"preset",name:"price-volume",enterprise:!0,dependencies:[Vv,$C],version:ue,options:UJ,create:_J},cB=[ZJ,_b,$b,jv,Wv,Xv,Zv,Uf,UA,YA,Vv,am,QA,Bv,JA,cS,BC,HC,YC,Ep,tw,KI,$I];function hB(e){const{enabled:t,mode:i,showArrow:s,range:n,position:a,pagination:o,delay:r,wrapping:l,interaction:c,renderer:h,...d}=e,u={enabled:t,showArrow:s,range:n,position:a,interaction:c,renderer:h,...d};return{chartTooltipOptions:{mode:i,pagination:o,delay:r,wrapping:l,...d},seriesTooltipOptions:u}}function XJ(e){const{animation:t,background:i,container:s,contextMenu:n,context:a,footnote:o,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:b,title:x,width:v,type:S,cursor:M,nodeClickRange:D,tooltip:I,value:k,scale:C={},startAngle:A,endAngle:w,highlight:T,segmentation:O,bar:z,needle:V,targets:E,outerRadius:_,innerRadius:G,outerRadiusRatio:B,innerRadiusRatio:F,cornerRadius:Y,cornerMode:Z,label:ie,secondaryLabel:ee,spacing:he,...Me}=e,Ce=I!=null,xe=I??{},{chartTooltipOptions:Ge,seriesTooltipOptions:je}=hB(xe),dt={...Me,type:S,cursor:M,context:a,nodeClickRange:D,value:k,scale:C,startAngle:A,endAngle:w,highlight:T,segmentation:O,bar:z,targets:E,outerRadius:_,innerRadius:G,outerRadiusRatio:B,innerRadiusRatio:F,cornerRadius:Y,cornerMode:Z,label:ie,secondaryLabel:ee,spacing:he};return Ce&&(dt.tooltip=je),V!=null&&(dt.needle={enabled:!0,...V}),{animation:t,background:i,container:s,contextMenu:n,context:a,footnote:o,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:b,title:x,width:v,...Ce?{tooltip:Ge}:{},series:[dt]}}function qJ(e){const{animation:t,background:i,container:s,contextMenu:n,context:a,footnote:o,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:b,title:x,width:v,type:S,cursor:M,nodeClickRange:D,tooltip:I,value:k,scale:C={},direction:A="vertical",thickness:w,highlight:T,segmentation:O,bar:z,targets:V,cornerRadius:E,cornerMode:_,label:G,...B}=e,F=I!=null,Y=I??{},{chartTooltipOptions:Z,seriesTooltipOptions:ie}=hB(Y),ee={...B,type:S,cursor:M,nodeClickRange:D,value:k,scale:C,direction:A,thickness:w,highlight:T,segmentation:O,bar:z,targets:V,cornerRadius:E,cornerMode:_,label:G};return F&&(ee.tooltip=ie),{animation:t,background:i,container:s,contextMenu:n,context:a,footnote:o,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:b,title:x,width:v,...F?{tooltip:Z}:{},series:[ee]}}function dB(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=re(e,s),e.targets!=null&&i!=null&&(e.type,e.targets=ly(e.targets,i)),e}function QJ(e,t){switch(e.type){case"radial-gauge":return XJ(dB(e,t));case"linear-gauge":return qJ(dB(e,t));default:return{series:[]}}}var uS={theme:ce,container:ce,animation:ce,background:ce,contextMenu:ce,context:()=>!0,listeners:ce,locale:ce,width:ce,height:ce,minWidth:ce,minHeight:ce,title:ce,subtitle:ce,footnote:ce,padding:ce,tooltip:{...Ue,...ke.tooltip}};uS.overrideDevicePixelRatio=Q(P),uS.foreground=Q(ce);var uB={type:"preset",name:"gauge-preset",enterprise:!0,version:ue,dependencies:[op],options:yl({"linear-gauge":{...J(mo,["type"]),...uS},"radial-gauge":{...J(Rc,["type"]),...uS}},"gauge options"),create:QJ},pB=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const n=e.nodes();if(n.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const a=n[0],o=n.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??n.at(-1);this.node.datum=this.datum=a.datum,s(this.node,a,o)}}},gB={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function fB(e,t){if(e==null)return"";const{min:i,max:s}=t,n=i===0?0:Math.ceil(Math.log10(Math.abs(i))),a=s===0?0:Math.ceil(Math.log10(Math.abs(s))),o=Math.max(2-Math.max(n,a),0);return e.toFixed(o)}function gm(e,t,i,s){if(i.text!=null)return i.text;const n=s??i.value;let a;return i?.formatter!=null&&(a=um(t,i.formatter,{seriesId:e,datum:void 0,value:n})),a==null||De(a)?a:String(a)}function mB({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}function yB(e,t){const i=mr(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function xB(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),s=ae(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:n,selection:a}=i[s];if(n==null||n.length===0)return;const o=ae(0,t.datumIndex,n.length-1),r=n[o];for(const l of a)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:o,otherIndex:s}}function bB(e,t){return N.findNodeDatumInArray(t,e.contextNodeData?.nodeData)??N.findNodeDatumInArray(t,e.contextNodeData?.targetData)}var pS=class extends X{getSegments(e,t){const{values:i,step:s,count:n}=this,a=Math.min(...e.domain),o=Math.max(...e.domain);let r;if(i!=null){const l=i.filter(c=>c>a&&c<o).sort((c,h)=>c-h);r=[a,...l,o]}else if(s!=null){const l=[];for(let c=a;c<o;c+=s)l.push(c);l.push(o),r=l}else if(n==null){const l=e.ticks({nice:[!0,!0],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter(c=>c>a&&c<o);r=l==null?void 0:[a,...l,o]}else{const l=n+1;r=Array.from({length:l+1},(c,h)=>h/l*(o-a)+a)}return r!=null&&r.length>t&&(K.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[a,o]),r}};g([m],pS.prototype,"values",2),g([m],pS.prototype,"step",2),g([m],pS.prototype,"count",2);var fm=class extends X{constructor(){super(...arguments),this.enabled=!1,this.interval=new pS,this.spacing=0}};g([m],fm.prototype,"enabled",2),g([m],fm.prototype,"interval",2),g([m],fm.prototype,"spacing",2);var{makeSeriesTooltip:JJ,SeriesProperties:eee,Label:tee,AxisLabel:iee,getColorStops:see}=N,vB=class extends tee{};g([m],vB.prototype,"spacing",2);var Is=class extends X{constructor(){super(...arguments),this.value=0,this.label=new vB}getStyle(e){const{fill:t=e.fill??"black",fillOpacity:i=e.fillOpacity??1,stroke:s=e.stroke??"black",strokeWidth:n=e.strokeWidth??0,strokeOpacity:a=e.strokeOpacity??1,lineDash:o=e.lineDash??[0],lineDashOffset:r=e.lineDashOffset??0}=this;return{fill:t,fillOpacity:i,stroke:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}}};g([m],Is.prototype,"text",2),g([m],Is.prototype,"value",2),g([m],Is.prototype,"shape",2),g([m],Is.prototype,"placement",2),g([m],Is.prototype,"spacing",2),g([m],Is.prototype,"size",2),g([m],Is.prototype,"rotation",2),g([m],Is.prototype,"fill",2),g([m],Is.prototype,"fillOpacity",2),g([m],Is.prototype,"stroke",2),g([m],Is.prototype,"strokeWidth",2),g([m],Is.prototype,"strokeOpacity",2),g([m],Is.prototype,"lineDash",2),g([m],Is.prototype,"lineDashOffset",2),g([m],Is.prototype,"label",2);var la=class extends X{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fill:s,fills:n,fillMode:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:s??MB(n,a,e,i,t),fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};g([m],la.prototype,"enabled",2),g([m],la.prototype,"thickness",2),g([m],la.prototype,"thicknessRatio",2),g([m],la.prototype,"fills",2),g([m],la.prototype,"fillMode",2),g([m],la.prototype,"fill",2),g([m],la.prototype,"fillOpacity",2),g([m],la.prototype,"stroke",2),g([m],la.prototype,"strokeWidth",2),g([m],la.prototype,"strokeOpacity",2),g([m],la.prototype,"lineDash",2),g([m],la.prototype,"lineDashOffset",2);var mm=class extends X{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};g([m],mm.prototype,"values",2),g([m],mm.prototype,"step",2),g([m],mm.prototype,"minSpacing",2),g([m],mm.prototype,"maxSpacing",2);var SB=class extends iee{constructor(){super(...arguments),this.placement=void 0}};g([m],SB.prototype,"placement",2);var _s=class extends X{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new mm,this.label=new SB}getStyle(e,t,i,s){const{fill:n,fills:a,defaultFill:o,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}=this;return{fill:n??(e&&a.length===0?o:void 0)??MB(a,r,t,s,i),fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}}};g([m],_s.prototype,"min",2),g([m],_s.prototype,"max",2),g([m],_s.prototype,"fills",2),g([m],_s.prototype,"fillMode",2),g([m],_s.prototype,"fill",2),g([m],_s.prototype,"fillOpacity",2),g([m],_s.prototype,"stroke",2),g([m],_s.prototype,"strokeWidth",2),g([m],_s.prototype,"strokeOpacity",2),g([m],_s.prototype,"lineDash",2),g([m],_s.prototype,"lineDashOffset",2),g([m],_s.prototype,"defaultFill",2),g([m],_s.prototype,"interval",2),g([m],_s.prototype,"label",2);var gS=class extends cp{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};g([m],gS.prototype,"text",2),g([m],gS.prototype,"placement",2),g([m],gS.prototype,"avoidCollisions",2);var Hs=class extends eee{constructor(){super(...arguments),this.value=0,this.segmentation=new fm,this.defaultColorRange=[],this.targets=new Bi(Is),this.defaultTarget=new Is,this.defaultScale=new _s,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new _s,this.bar=new la,this.label=new gS,this.tooltip=JJ()}};g([m],Hs.prototype,"value",2),g([m],Hs.prototype,"segmentation",2),g([m],Hs.prototype,"defaultColorRange",2),g([m],Hs.prototype,"targets",2),g([m],Hs.prototype,"defaultTarget",2),g([m],Hs.prototype,"defaultScale",2),g([m],Hs.prototype,"direction",2),g([m],Hs.prototype,"thickness",2),g([m],Hs.prototype,"cornerRadius",2),g([m],Hs.prototype,"cornerMode",2),g([m],Hs.prototype,"margin",2),g([m],Hs.prototype,"scale",2),g([m],Hs.prototype,"bar",2),g([m],Hs.prototype,"label",2),g([m],Hs.prototype,"tooltip",2);function MB(e,t,i,s,n){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:see(e,i,s.domain,t),rotation:n?90:0,bounds:"series"}}var{BBox:nee}=N;function rw(e){const{x0:t,y0:i,x1:s,y1:n,horizontalInset:a,verticalInset:o}=e,r=Math.min(t,s)+a,l=Math.min(i,n)+o,c=Math.max(Math.abs(s-t)-2*a,0),h=Math.max(Math.abs(n-i)-2*o,0);return{x:r,y:l,width:c,height:h}}function aee(e,t){if(t==null)return!0;const i=rw(e),s=1e-6,n=i.x+s,a=i.y+s,o=i.x+i.width-s,r=i.y+i.height-s,l=t.x,c=t.x+t.width,h=t.y,d=t.y+t.height;return Math.max(n,l)<=Math.min(o,c)&&Math.max(a,h)<=Math.min(r,d)}function lw(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:n}=e;return t!=null&&i!=null||s!=null&&n!=null}function oee(e){if(!lw(e))return;const{x0:t,y0:i,x1:s,y1:n}=e,{x:a,y:o,width:r,height:l}=rw(e);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=e;(c==null||h==null)&&(c=t,h=s),(d==null||u==null)&&(d=i,u=n);const p=Math.min(c,h),f=Math.min(d,u),y=Math.abs(h-c),b=Math.abs(u-d);return c=Math.max(a,p),d=Math.max(o,f),h=Math.min(a+r,p+y),u=Math.min(o+l,f+b),new nee(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}function DB(e,t){const i=e?"initial":"update";return{node:{fromFn(n,a){const o=n.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:f}=o??a;const{horizontalInset:y,verticalInset:b}=a,x=o!=null&&lw(o),v=lw(a);return x&&v||(!x&&v?({x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:f}=a,e&&(t?p=a.clipX0:f=a.clipY0)):x&&!v?({x0:r,y0:l,x1:c,y1:h}=a,d=void 0,u=void 0,p=void 0,f=void 0):e&&(t?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:f,horizontalInset:y,verticalInset:b,phase:i}},toFn(n,a){const{x0:o,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:f,verticalInset:y}=a;return{x0:o,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:f,verticalInset:y}},applyFn(n,a){n.setProperties(ym(n,a))}}}}function ym(e,t){const{x:i,y:s,width:n,height:a}=rw(t),o=oee(t),r=aee(t,o);return{x:i,y:s,width:n,height:a,clipBBox:o,visible:r}}var ree={Before:"right",Center:"center",After:"left"},lee={Before:"top",Center:"middle",After:"bottom"},cee={Before:-1,Center:-.5,After:0},hee={Before:0,Center:-.5,After:-1};function dee(e,t,i,s,n,a){const{seriesRect:o,gaugeRect:r,barRect:l}=n,{padding:c,horizontal:h}=s;i.each((d,u)=>{const p=gm(e.id,t,u,a?.label);let f,y;u.placement==="outside-start"?h?(f=r.x,y=o.height):(f=o.width,y=o.height-(r.y+r.height)):u.placement==="outside-end"?h?(f=o.width-(r.x+r.width),y=o.height):(f=o.width,y=r.y):u.avoidCollisions&&(f=r.width,y=r.height);let b;if(p==null)return;if(f!=null&&y!=null){const E=()=>({width:f,height:y,meta:null});b=Wf(Ne(p),u,{padding:c},E)?.[0]}else{const E=et(u),{width:_,height:G}=De(p)?Js(p,u):E.measureLines(At(p));b={text:p,fontSize:u.fontSize,lineHeight:u.lineHeight??E.lineHeight(),width:_,height:G}}if(b==null){d.visible=!1;return}const x=h?r.x:r.y+r.height,v=h?r.x+r.width:r.y,S=h?l.x:l.y+l.height,M=h?l.x+l.width:l.y,D=u.spacing*(h?1:-1);let I,k,C,A;switch(u.placement){case"outside-start":I=-1/0,k=1/0,C=x-D,A="Before";break;case"outside-end":I=-1/0,k=1/0,C=v+D,A="After";break;case"inside-start":I=x,k=M,C=x+D,A="After";break;case"inside-end":I=M,k=v,C=v-D,A="Before";break;case"inside-center":I=x,k=v,C=(x+v)/2,A="Center";break;case"bar-inside":I=S,k=M,C=(S+M)/2,A="Center";break;case"bar-inside-end":I=S,k=M,C=M-D,A="Before";break;case"bar-outside-end":I=M,k=v,C=M+D,A="After";break;case"bar-end":I=-1/0,k=1/0,C=M,A="Center";break}const w=h?C:r.x+r.width/2,T=h?r.y+r.height/2:C;let O,z;h?(O=w+cee[A]*b.width,z=O+b.width):(O=T+hee[A]*b.height,z=O+b.height);const V=Math.min(O,z)>=Math.min(I,k)&&Math.max(O,z)<=Math.max(I,k);if(u.avoidCollisions&&!V){d.visible=!1;return}d.visible=!0,d.text=b.text,d.fontSize=b.fontSize,d.lineHeight=b.lineHeight,d.textAlign=h?ree[A]:"center",d.textBaseline=h?"middle":lee[A],d.x=w,d.y=T})}var{fromToMotion:cw,resetMotion:uee,SeriesNodePickMode:kB,createDatumId:IB,BBox:Qo,Group:Xh,PointerEvents:AB,Selection:qh,Rect:pee,Text:CB,TransformableText:gee,Marker:fee,LinearScale:mee,generateTicks:yee,NiceMode:wB}=N,xee={before:180,middle:0,after:0},bee={before:90,middle:0,after:-90},hw=class extends N.Series{constructor(e){super({moduleCtx:e,pickModes:[kB.EXACT_SHAPE_MATCH,kB.NEAREST_NODE]}),this.properties=new Hs,this.seriesRect=Qo.NaN,this.gaugeRect=Qo.NaN,this.scale=new mee,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Xh({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Xh({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Xh({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Xh({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Xh({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Xh({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Xh({name:"tickGroup"})),this.scaleSelection=qh.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=qh.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=qh.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=qh.select(this.itemTargetLabelGroup,CB),this.labelSelection=qh.select(this.itemLabelGroup,CB),this.highlightTargetSelection=qh.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=qh.select(this.tickGroup,gee),this.datumUnion=new pB,this.animationState=new de("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=AB.None,this.tickGroup.pointerEvents=AB.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const e=new pee;return e.crisp=!0,e}markerFactory(){return new fee}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return fB(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:n}=this,{thickness:a}=e,o=xo(n.range),r=new Qo(t,i,s?o:a,s?a:o);return{axis:r,series:r}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:n=t.value??0,shape:a=t.shape??"triangle",rotation:o=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:d=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:p=t.label.fontWeight??"normal",fontSize:f=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:b=t.label.spacing??0}=i.label;return{text:s,value:n,shape:a,placement:r,spacing:l,size:c,rotation:o,label:{enabled:h,color:d,fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,spacing:b},style:i.getStyle(t)}})}getTargetPoint(e){const{properties:t,originX:i,originY:s,horizontal:n,scale:a,gaugeRect:o}=this,{thickness:r}=t,{value:l,placement:c,spacing:h,size:d}=e,u=a.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=r+h+d/2;break;default:p=r/2;break}return{x:i+o.x+(n?u:p),y:s+o.y+(n?p:u)}}getTargetLabel(e){const{size:t,placement:i,label:s}=e,{spacing:n,color:a,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,d=t/2+n;let u,p,f=0,y=0;return this.horizontal?(u="center",i==="after"?(p="top",y=d):(p="bottom",y=-d)):(p="middle",i==="before"?(u="right",f=-d):(u="left",f=d)),{offsetX:f,offsetY:y,fill:a,textAlign:u,textBaseline:p,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(e,t){const{placement:i,avoidCollisions:s,spacing:n,text:a,color:o,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:f,formatter:y=b=>this.formatLabel(b.value)}=e;return{placement:i,avoidCollisions:s,spacing:n,text:a,value:t,fill:o,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:f,formatter:y}}verticalLabelInset(){const{label:e}=this.properties,t=et(e),i=e.text?.split(`
`),s=(e.lineHeight??t.lineHeight())*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,n=s.text?.split(`
`),a=et(s),o=i.interval.values??e.ticks({nice:[!1,!1],interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(n??o?.map(c=>gm(this.id,this.ctx,this.labelDatum(s,c))??"")).reduce((c,h)=>{const{width:d}=De(h)?Js(h,s):a.measureLines(At(h));return Math.max(c,d)},0);return s.spacing+l}tickFormatter(e,t){const{format:i,formatter:s}=this.properties.scale.label;let n;return i!=null&&(n=px(t,typeof i=="string"?i:void 0)),(a,o)=>{let r;return s&&(r??(r=um(this.ctx,s,{value:a,index:o,domain:e,boundSeries:void 0}))),r??(r=n?.(a)),r??this.formatLabel(a)}}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:n}=this,{value:a,segmentation:o,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u,defaultColorRange:p,defaultScale:f}=t;s.domain=[d.min,d.max],s.range=i?[0,n.width]:[n.height,0];let y,b;i?(b=1,y=Math.PI/-2):d.label.placement==="before"?(b=1,y=0):(b=-1,y=0);let x,v,S,M;i?(x=0,v=n.width,S=(n.height-r)/2,M=S+r,u.placement==="outside-start"?x+=this.horizontalLabelInset():u.placement==="outside-end"&&(v-=this.horizontalLabelInset())):(x=(n.width-r)/2,v=x+r,M=0,S=n.height,u.placement==="outside-start"?S-=this.verticalLabelInset():u.placement==="outside-end"&&(M+=this.verticalLabelInset())),this.gaugeRect=new Qo(Math.min(x,v),Math.min(S,M),Math.abs(v-x),Math.abs(M-S));const D=0,I=0;s.domain=[d.min,d.max],s.range=i?[x,v]:[S,M];const k=re({parallel:i},d.label,f.label),{tickData:{ticks:C}}=yee({scale:s,label:k,interval:d.interval,tickFormatter:(Ie,pe)=>this.tickFormatter(Ie,pe),domain:s.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:[wB.Off,wB.Off],labelOffset:0,axisRotation:y,sideFlag:b}),A=!1,w=this.getTargets(),T=[],O=[],z=[],V=[],[E,_]=s.range,G=Math.abs(_-E),B=i?s.convert(a):v,F=i?M:s.convert(a),Y=o.enabled?o.spacing/2:0,Z=i?Y:0,ie=i?0:Y,ee=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),he=-(r-ee)/2,Me=i?0:he,Ce=i?he:0,xe=c==="item",Ge=Math.ceil(G);let je=o.enabled?o.interval.getSegments(s,Ge):void 0;const dt=h.getStyle(p,i,s),Ze=d.getStyle(h.enabled,p,i,s);if(je==null&&xe){const Ie=Math.min(...s.domain),pe=Math.max(...s.domain),yt={value:a,segmentStart:Ie,segmentEnd:pe};if(h.enabled){const It=Math.min(l,ee/2,G/2)*(A?-1:1),js=i?It:0,cn=i?0:It;T.push({series:this,itemId:"value",datum:yt,datumIndex:{type:0},type:0,x0:D+x-js-Me,y0:I+S-cn-Ce,x1:D+B+js+Me,y1:I+F+cn+Ce,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:Z,verticalInset:ie,style:dt})}const ut=Math.min(l,r/2,G/2)*(A?-1:1),bt=i?ut:0,vt=i?0:ut;V.push({series:this,itemId:"scale",datum:yt,datumIndex:{type:0},type:0,x0:D+x-bt,y0:I+S-vt,x1:D+v+bt,y1:I+M+vt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:Z,verticalInset:ie,style:Ze})}else{je??(je=s.domain);const Ie=D+x-Me,pe=I+S-Ce,yt=D+B+Me,xt=I+F+Ce;for(let ut=0;ut<je.length-1;ut+=1){const bt=je[ut+0],vt=je[ut+1],Si={value:a,segmentStart:bt,segmentEnd:vt},It=ut===0,js=ut===je.length-2,cn=s.convert(bt),nd=s.convert(vt),Cm=xe||It?l:0,ir=xe||js?l:0,Lc=i?Cm:ir,sL=ir,t_=i?ir:Cm,i_=Cm;h.enabled&&T.push({series:this,itemId:`value-${ut}`,datum:Si,datumIndex:{type:0},type:0,x0:D+(i?cn:x),y0:I+(i?S:cn),x1:D+(i?nd:v),y1:I+(i?M:nd),clipX0:Ie,clipY0:pe,clipX1:yt,clipY1:xt,topLeftCornerRadius:Lc,topRightCornerRadius:sL,bottomRightCornerRadius:t_,bottomLeftCornerRadius:i_,horizontalInset:Z,verticalInset:ie,style:dt}),V.push({series:this,itemId:`scale-${ut}`,datum:Si,datumIndex:{type:0},type:0,x0:D+(i?cn:x),y0:I+(i?S:cn),x1:D+(i?nd:v),y1:I+(i?M:nd),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:Lc,topRightCornerRadius:sL,bottomRightCornerRadius:t_,bottomLeftCornerRadius:i_,horizontalInset:Z,verticalInset:ie,style:Ze})}}for(const Ie of[V,T])for(const pe of Ie){const yt=pe.clipX0??pe.x0,xt=pe.clipX1??pe.x1,ut=pe.clipY0??pe.y0,bt=pe.clipY1??pe.y1;pe.midPoint={x:(yt+xt)/2,y:(ut+bt)/2}}u.enabled&&z.push(this.labelDatum(u,a));const we=i?xee:bee;for(let Ie=0;Ie<w.length;Ie+=1){const pe=w[Ie],{value:yt,text:xt,shape:ut,size:bt,style:vt}=pe,Si=this.getTargetPoint(pe),It=lt(pe.rotation+we[pe.placement]);O.push({series:this,itemId:`target-${Ie}`,midPoint:Si,datum:{value:yt},datumIndex:{type:1,index:Ie},type:1,value:yt,text:xt,x:Si.x,y:Si.y,shape:ut,size:bt,rotation:It,label:this.getTargetLabel(pe),style:vt})}return{itemId:e,nodeData:T,tickData:C,targetData:O,labelData:z,scaleData:V}}findNodeDatum(e){return bB(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,targetSelection:s,targetLabelSelection:n,scaleSelection:a,highlightTargetSelection:o,tickSelection:r}=this;this.seriesRect=e??Qo.NaN;const l=this.checkResize(e);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],f=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:n}),this.updateTargetLabelNodes({targetLabelSelection:n}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:f==null?[]:[f],targetSelection:o}),this.updateTargetNodes({targetSelection:o,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>IB(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i}=this,s=i.animationManager.isSkipped(),n=this.getShapeFillBBox();t.each((o,r)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=r;o.setStyleProperties(r.style,n),o.topLeftCornerRadius=l,o.topRightCornerRadius=c,o.bottomRightCornerRadius=h,o.bottomLeftCornerRadius=d,o.pointerEvents=this.properties.bar.enabled?N.PointerEvents.All:N.PointerEvents.None,(s||o.previousDatum==null)&&o.setProperties(ym(o,r))});const{horizontal:a}=this;this.datumUnion.update(t,this.itemGroup,N.Rect,(o,r,l)=>{const c=Math.min(r.x,l.x),h=Math.max(r.x+r.width,l.x+l.width),d=Math.min(r.y,l.y),u=Math.max(r.y+r.height,l.y+l.height),p=h-c,f=u-d;o.pointerEvents=N.PointerEvents.None,o.x=c,o.y=d,o.width=p,o.height=f,o.topLeftCornerRadius=a?r.topLeftCornerRadius:l.topLeftCornerRadius,o.topRightCornerRadius=l.topRightCornerRadius,o.bottomRightCornerRadius=a?l.bottomRightCornerRadius:r.bottomRightCornerRadius,o.bottomLeftCornerRadius=r.bottomLeftCornerRadius;const y=r.clipBBox,b=l.clipBBox??y;y&&b?o.clipBBox=Qo.merge([y,b]).intersection(a?new Qo(c,-1/0,p,1/0):new Qo(-1/0,d,1/0,f)):o.clipBBox=void 0})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>IB(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,i=this.getShapeFillBBox();t.each((s,n)=>{const{topLeftCornerRadius:a,topRightCornerRadius:o,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=n;s.setStyleProperties(n.style,i),s.setProperties(ym(s,n)),s.topLeftCornerRadius=a,s.topRightCornerRadius=o,s.bottomRightCornerRadius=r,s.bottomLeftCornerRadius=l,s.setProperties(ym(s,n))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((s,n)=>{const{x:a,y:o,shape:r,size:l,rotation:c}=n,h=this.getTargetStyle(i,n);s.setStyleProperties(h),s.size=l,s.shape=r==="line"?mB:r,s.translationX=a,s.translationY=o,s.rotation=c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return re(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{x:n,y:a,text:o}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:f,textBaseline:y}=s.label;i.visible=!0,i.x=n+r,i.y=a+l,i.text=o,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textAlign=f,i.textBaseline=y})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:n,color:a,fontFamily:o=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=lt(i.scale.label.rotation??0);let p,f,y,b;this.horizontal?(d??(d="after"),p="center",f=d==="before"?"bottom":"top",b=this.originY+t.y+(d==="before"?-h:t.height+h)):(d??(d="before"),p=d==="before"?"end":"start",f="middle",y=this.originX+t.x+(d==="before"?-h:t.width+h)),e.tickSelection.each((x,v)=>{if(!n){x.visible=!1;return}const S=y??v.translation,M=b??v.translation;x.visible=!0,x.text=v.tickLabel,x.fill=a,x.fontFamily=o,x.fontSize=r,x.fontStyle=l,x.fontWeight=c,x.textBaseline=f,x.textAlign=p,x.x=S,x.y=M,x.rotationCenterX=S,x.rotationCenterY=M,x.rotation=u})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:n,gaugeRect:a}=this,{x:o,y:r,width:l,height:c}=a,h=e?.label??this.properties.value;let d;if(i){const f=s.convert(h);d=new Qo(o,r,f-o,c)}else{const f=s.convert(h);d=new Qo(o,f,l,c-f)}const u={seriesRect:n,gaugeRect:a,barRect:d},{margin:p}=this.properties;dee(this,this.ctx,t,{padding:p,horizontal:i},u,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),uee([this.datumSelection],ym),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each((n,a)=>{n.opacity=1,i=n.previousDatum?.value??e.from??a.value,s=a.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;t.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:e.phase??"update",ease:Tr,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:s})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=DB(!0,this.horizontal);cw(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),cw(this.id,"label",e,[this.labelSelection],gB,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=DB(!1,this.horizontal);cw(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return{domain:[0,1]}}dataCount(){return Number.NaN}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;if(e==null)return;let n,a,o;if(e.type===0?(n=i.value,a=i.label.text,o=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:n,text:a}=i.targets[e.index],o=this.ctx.localeManager.t("ariaLabelGaugeTarget")),n!=null)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:o,value:this.formatLabel(n)}]},{seriesId:t,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(e){return yB(this,e)}pickFocus(e){return xB(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};hw.className="LinearGaugeSeries",hw.type="linear-gauge";var vee={minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},yo]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",yr,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...Ye,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:12,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}},LB={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,dependencies:[uB],version:ue,options:mo,themeTemplate:vee,create:e=>new hw(e)},{LinearScale:dw}=N,NB=class pL extends dw{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,n]=i;let a=dw.getTickStep(s,n,t);const o=Number.isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(n-s)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>o&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(h=>!Number.isFinite(h))||s<=0)return{ticks:[],count:0};const{nice:n,interval:a}=t,[o,r]=i;if(a){const h=Math.abs(a),d=this.getPixelRange();if(!Rl((r-o)/h,d)){const u=Kc(o,r,h);return{ticks:u.ticks,count:u.count}}}let l;if(n&&this.hasNiceRange()){const h=super.niceDomain(t,i);l=pL.getNiceStepAndTickCount(t,h).step}else l=dw.getTickStep(o,r,t);const c=Kc(o,r,l);return{ticks:c.ticks,count:c.count}}hasNiceRange(){const t=this.range.slice().sort((s,n)=>s-n);return[Math.PI,2*Math.PI].some(s=>He(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],a=n?s[1]:s[0],{step:o,count:r}=pL.getNiceStepAndTickCount(t,s),l=1/o,c=o>=1?Math.ceil(a/o+r)*o:Math.ceil((a+r*o)*l)/l;return n?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{SvgPath:See,Rotatable:Mee,Translatable:Dee,Scalable:kee}=N,uw=class extends Mee(kee(Dee(See))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};uw.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{getColorStops:Iee}=N,{makeSeriesTooltip:Aee,SeriesProperties:Cee,AxisLabel:wee,Label:Lee}=N,TB=class extends Lee{};g([m],TB.prototype,"spacing",2);var As=class extends X{constructor(){super(...arguments),this.label=new TB}getStyle(){const{fill:e="black",fillOpacity:t=1,stroke:i="black",strokeWidth:s=0,strokeOpacity:n=1,lineDash:a=[0],lineDashOffset:o=0}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}}};g([m],As.prototype,"text",2),g([m],As.prototype,"value",2),g([m],As.prototype,"shape",2),g([m],As.prototype,"placement",2),g([m],As.prototype,"spacing",2),g([m],As.prototype,"size",2),g([m],As.prototype,"rotation",2),g([m],As.prototype,"fill",2),g([m],As.prototype,"fillOpacity",2),g([m],As.prototype,"stroke",2),g([m],As.prototype,"strokeWidth",2),g([m],As.prototype,"strokeOpacity",2),g([m],As.prototype,"lineDash",2),g([m],As.prototype,"lineDashOffset",2),g([m],As.prototype,"label",2);var lo=class extends X{constructor(){super(...arguments),this.enabled=!0,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t){const{enabled:i,fill:s,fills:n,fillMode:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:i?s??EB(n,a,e,t):"none",fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};g([m],lo.prototype,"enabled",2),g([m],lo.prototype,"fills",2),g([m],lo.prototype,"fillMode",2),g([m],lo.prototype,"fill",2),g([m],lo.prototype,"fillOpacity",2),g([m],lo.prototype,"stroke",2),g([m],lo.prototype,"strokeWidth",2),g([m],lo.prototype,"strokeOpacity",2),g([m],lo.prototype,"lineDash",2),g([m],lo.prototype,"lineDashOffset",2);var xm=class extends X{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};g([m],xm.prototype,"values",2),g([m],xm.prototype,"step",2),g([m],xm.prototype,"minSpacing",2),g([m],xm.prototype,"maxSpacing",2);var Nee=class extends wee{},ln=class extends X{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new xm,this.label=new Nee}getStyle(e,t,i){const{fill:s,fills:n,defaultFill:a,fillMode:o,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=this;return{fill:s??(e&&n.length===0?a:void 0)??EB(n,o,t,i),fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}}};g([m],ln.prototype,"min",2),g([m],ln.prototype,"max",2),g([m],ln.prototype,"fills",2),g([m],ln.prototype,"fillMode",2),g([m],ln.prototype,"fill",2),g([m],ln.prototype,"fillOpacity",2),g([m],ln.prototype,"stroke",2),g([m],ln.prototype,"strokeWidth",2),g([m],ln.prototype,"strokeOpacity",2),g([m],ln.prototype,"lineDash",2),g([m],ln.prototype,"lineDashOffset",2),g([m],ln.prototype,"defaultFill",2),g([m],ln.prototype,"interval",2),g([m],ln.prototype,"label",2);var co=class extends X{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],co.prototype,"enabled",2),g([m],co.prototype,"radiusRatio",2),g([m],co.prototype,"spacing",2),g([m],co.prototype,"fill",2),g([m],co.prototype,"fillOpacity",2),g([m],co.prototype,"stroke",2),g([m],co.prototype,"strokeWidth",2),g([m],co.prototype,"strokeOpacity",2),g([m],co.prototype,"lineDash",2),g([m],co.prototype,"lineDashOffset",2);var OB=class extends cp{};g([m],OB.prototype,"text",2);var PB=class extends sv{};g([m],PB.prototype,"text",2);var vi=class extends Cee{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new fm,this.defaultColorRange=[],this.targets=new Bi(As),this.defaultTarget=new As,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new ln,this.bar=new lo,this.needle=new co,this.label=new OB,this.secondaryLabel=new PB,this.tooltip=Aee()}};g([m],vi.prototype,"value",2),g([m],vi.prototype,"startAngle",2),g([m],vi.prototype,"endAngle",2),g([m],vi.prototype,"segmentation",2),g([m],vi.prototype,"defaultColorRange",2),g([m],vi.prototype,"targets",2),g([m],vi.prototype,"defaultTarget",2),g([m],vi.prototype,"outerRadiusRatio",2),g([m],vi.prototype,"innerRadiusRatio",2),g([m],vi.prototype,"outerRadius",2),g([m],vi.prototype,"innerRadius",2),g([m],vi.prototype,"cornerRadius",2),g([m],vi.prototype,"cornerMode",2),g([m],vi.prototype,"spacing",2),g([m],vi.prototype,"scale",2),g([m],vi.prototype,"bar",2),g([m],vi.prototype,"needle",2),g([m],vi.prototype,"label",2),g([m],vi.prototype,"secondaryLabel",2),g([m],vi.prototype,"tooltip",2);function EB(e,t,i,s){const{domain:n,range:a}=s,[o,r]=a,l=Qe((o+r)/2+Math.PI),c=Wd(r-o);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:Iee(e,i,n,t).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(o+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),bounds:"series",rotation:sM(l)+90}}var{SectorBox:pw}=N;function Tee(e){const{startAngle:t,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:a,outerRadius:o}=e;if(!(s==null||n==null))return new pw(Math.max(s,t),Math.min(n,i),a,o)}function RB(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function gw(e){return e.clipStartAngle!=null&&e.clipEndAngle!=null}function fw(e,t){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:a}=e;return new pw(i,t?i:s,n,a)}function zB(e,t){const i=e?"initial":"update";return{node:{fromFn(a,o){const r=a.previousDatum;let{startAngle:l,endAngle:c}=r??o;const h=r!=null&&gw(r)?fw(r,e):void 0,d=gw(o)?fw(o,e):void 0;let u;return h!=null&&d!=null?u=h:h==null&&d!=null?(u=d,l=o.startAngle,c=o.endAngle):h!=null&&d==null?(u=void 0,l=o.startAngle,c=o.endAngle):e&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(a,o){const{startAngle:r,endAngle:l}=o;let c;return gw(o)&&(c=fw(o,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(a,o){const{startAngle:r,endAngle:l}=o;let{clipSector:c}=o;c!=null&&(c=new pw(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||RB(r,l,c);a.startAngle=r,a.endAngle=l,a.clipSector=c,a.visible=h}},needle:{fromFn(a){let{angle:o}=a.previousDatum??a.datum;return e&&(o=t),{rotation:o,phase:i}},toFn(a,o){const{angle:r}=o;return{rotation:r}}}}}function mw(e,t){const{startAngle:i,endAngle:s}=t,n=Tee(t),a=n==null||RB(i,s,n);return{startAngle:i,endAngle:s,clipSector:n,visible:a}}function VB(e,t){const{angle:i}=t;return{rotation:i}}var Oee={top:0,middle:.5,bottom:1};function Pee(e,t,i,s,n,a){const{padding:o,textAlign:r,verticalAlign:l}=s;let c,h;if(i.each((D,I)=>{I.label==="primary"?c=I:I.label==="secondary"&&(h=I)}),c==null)return;const d=gm(e.id,t,c,a?.label);if(d==null)return;const u=h==null?void 0:gm(e.id,t,h,a?.secondaryLabel),p={padding:o},f=r==="center"?2:1,y=l==="middle"?2:1,b=D=>({width:Math.sqrt(Math.max(n**2-(D/y)**2,0))*f,height:Math.min(D,y*n),meta:null});let x,v,S;if(h!=null&&u!=null){const D=OE(Ne(d),c,Ne(u),h,p,b);x=D?.label,v=D?.secondaryLabel,S=D?.height??0}else{const D=Wf(Ne(d),c,p,b);x=D?.[0],v=void 0,S=D?.[0].height??0}const M=S*Oee[l];i.each((D,I)=>{let k;if(I.label==="primary"?k=x:I.label==="secondary"&&(k=v),k==null){D.visible=!1;return}D.visible=!0,D.text=k.text,D.fontSize=k.fontSize,D.lineHeight=k.lineHeight,D.textAlign=r,D.textBaseline="middle";const C=I.label==="primary"?k.height/2:S-k.height/2;D.y=I.centerY+C-M,D.x=I.centerX})}var{fromToMotion:bm,resetMotion:BB,SeriesNodePickMode:FB,createDatumId:yw,sectorBox:Eee,BBox:Ree,Group:Ic,PointerEvents:fS,Selection:Ac,Sector:zee,SectorBox:Vee,Transformable:Bee,TransformableText:Fee,Text:_B,Marker:_ee}=N,Hee={inside:90,middle:0,outside:-90},Gee=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],jee=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],xw=class extends N.Series{constructor(e){super({moduleCtx:e,pickModes:[FB.EXACT_SHAPE_MATCH,FB.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new vi,this.scale=new NB,this.scaleGroup=this.contentGroup.appendChild(new Ic({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Ic({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Ic({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Ic({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Ic({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Ic({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Ic({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Ic({name:"tickGroup"})),this.scaleSelection=Ac.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Ac.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Ac.select(this.itemNeedleGroup,uw),this.targetSelection=Ac.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Ac.select(this.itemTargetLabelGroup,_B),this.labelSelection=Ac.select(this.itemLabelGroup,_B),this.highlightTargetSelection=Ac.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Ac.select(this.tickGroup,N.TransformableText),this.datumUnion=new pB,this.animationState=new de("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=fS.None,this.tickGroup.pointerEvents=fS.None,this.itemNeedleGroup.pointerEvents=fS.None,this.itemLabelGroup.pointerEvents=fS.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new zee}markerFactory(){const e=new _ee;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return fB(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:n,outerRadius:a}=this.properties,{min:o,max:r,label:l,interval:c}=n,h=lt(t.startAngle-90),d=lt(t.endAngle-90),p=Wd(d-h)>Math.PI,f=p||Qs(1.5*Math.PI,h,d),y=p||Qs(0*Math.PI,h,d),b=p||Qs(.5*Math.PI,h,d),x=p||Qs(1*Math.PI,h,d);let v;x&&!y?v="right":!x&&y?v="left":v="center";let S;f&&!b?S="bottom":!f&&b?S="top":S="middle";const M=Eee({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),D=-(M.x+M.width/2)*2,I=-(M.y+M.height/2)*2,k=Math.min(i/M.width,s/M.height);e.domain=[o,r],e.range=[h,d],e.arcLength=k/2;const{maxSpacing:C,minSpacing:A}=c,{arcLength:w}=e,T=C?Math.floor(w/C):1,O=A?Math.floor(w/A):1/0,z=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),V=Math.max(T,Math.min(O,z)),E=c.values??e.ticks({nice:[!1,!1],interval:c.step,minTickCount:T,maxTickCount:O,tickCount:V})?.ticks??[],_=px(E,typeof l.format=="string"?l.format:void 0),G=[];for(const[ie,ee]of E.entries()){let he;l.formatter&&(he=um(this.ctx,l.formatter,{value:ee,index:ie,domain:e.domain,boundSeries:void 0})),he??(he=_?.(ee)),he!=null&&G.push({index:ie,value:ee,text:he})}const B=.5*k,F=l.enabled&&a==null&&G.length>0?this.getTickLabelInset({tickData:G,radius:B,centerXOffset:D,centerYOffset:I,seriesRectWidth:i,seriesRectHeight:s,spacing:l.spacing,rotation:lt(l.rotation??0)}):0,Y=Math.max(B-F,0),Z=a??Y;return this.centerX=i/2+D*Z,this.centerY=s/2+I*Z,this.radius=Z,this.textAlign=v,this.verticalAlign=S,G}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this,s=new Ree(e-i,t-i,2*i,2*i);return{series:s,axis:s}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return e.targets.map(i=>{const{text:s=t.text,value:n=t.value??0,shape:a=t.shape??"triangle",rotation:o=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:d=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:p=t.label.fontWeight??"normal",fontSize:f=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:b=t.label.spacing??0}=i.label;return{text:s,value:n,shape:a,placement:r,spacing:l,size:c,rotation:o,label:{enabled:h,color:d,fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,spacing:b},style:i.getStyle()}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:a,spacing:o,size:r}=e,l=t*n,c=t*s;switch(a){case"inside":return Math.max(c-o-r/2,0);case"outside":return l+o+r/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:n,label:a}=e,{spacing:o,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=a,u=t.convert(i),p=Math.trunc(Qe(u)/(Math.PI/2)),f=s/2+o;let y,b,x,v;switch(n){case"outside":({textAlign:y,textBaseline:b}=Gee[p]),x=f*Math.cos(u),v=f*Math.sin(u);break;case"inside":({textAlign:y,textBaseline:b}=jee[p]),x=-f*Math.cos(u),v=-f*Math.sin(u);break;default:y="center",b="bottom",x=0,v=-f;break}return{offsetX:x,offsetY:v,fill:r,textAlign:y,textBaseline:b,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:n,centerX:a,centerY:o}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:f,scale:y,label:b,secondaryLabel:x}=s,{outerRadius:v=n*c,innerRadius:S=n*l,defaultColorRange:M}=s,D=this.getTargets(),I=[],k=[],C=[],A=[],w=[],T=u==="item",O=i.convert(i.domain[0]),z=i.convert(r),V=Math.ceil(Wd(z-O)*n);let E=h.enabled?h.interval.getSegments(i,V):void 0;const _=f.getStyle(M,i),G=y.getStyle(f.enabled,M,i);if(E==null&&T){const B=Math.min(...i.domain),F=Math.max(...i.domain),Y={value:r,segmentStart:B,segmentEnd:F},ie=Math.min(d,(v-S)/2)/((S+v)/2);I.push({series:this,itemId:"value",datum:Y,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:v,innerRadius:S,startAngle:O-ie,endAngle:z+ie,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:_}),w.push({series:this,itemId:"scale",datum:Y,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:v,innerRadius:S,startAngle:i.range[0]-ie,endAngle:i.range[1]+ie,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:G})}else{E??(E=i.domain);for(let B=0;B<E.length-1;B++){const F=E[B],Y=E[B+1],Z={value:r,segmentStart:F,segmentEnd:Y},ie=B===0,ee=B===E.length-2,he=i.convert(F),Me=i.convert(Y);I.push({series:this,itemId:`value-${B}`,datum:Z,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:v,innerRadius:S,startAngle:he,endAngle:Me,clipStartAngle:O,clipEndAngle:z,startCornerRadius:T||ie?d:0,endCornerRadius:T||ee?d:0,style:_}),w.push({series:this,itemId:`scale-${B}`,datum:Z,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:v,innerRadius:S,startAngle:he,endAngle:Me,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:T||ie?d:0,endCornerRadius:T||ee?d:0,style:G})}}if(!p.enabled&&b.enabled){const{text:B,color:F,fontSize:Y,minimumFontSize:Z,fontStyle:ie,fontWeight:ee,fontFamily:he,lineHeight:Me,formatter:Ce=xe=>this.formatLabel(xe.value)}=b;A.push({label:"primary",centerX:a,centerY:o,text:B,value:r,fill:F,fontSize:Y,minimumFontSize:Z,fontStyle:ie,fontWeight:ee,fontFamily:he,lineHeight:Me,formatter:Ce})}if(!p.enabled&&x.enabled){const{text:B,color:F,fontSize:Y,minimumFontSize:Z,fontStyle:ie,fontWeight:ee,fontFamily:he,lineHeight:Me,formatter:Ce}=x;A.push({label:"secondary",centerX:a,centerY:o,text:B,value:r,fill:F,fontSize:Y,minimumFontSize:Z,fontStyle:ie,fontWeight:ee,fontFamily:he,lineHeight:Me,formatter:Ce})}if(p.enabled){let B=p.radiusRatio==null?S:n*p.radiusRatio;B=Math.max(B-p.spacing,0);const F=i.convert(r);C.push({centerX:a,centerY:o,radius:B,angle:F,series:this})}for(let B=0;B<D.length;B+=1){const F=D[B],{value:Y,text:Z,size:ie,shape:ee,style:he}=F;if(Y<Math.min(...i.domain)||Y>Math.max(...i.domain))continue;const Me=this.getTargetRadius(F),Ce=i.convert(Y),xe=lt(F.rotation+Hee[F.placement]);k.push({series:this,itemId:`target-${B}`,midPoint:{x:Me*Math.cos(Ce)+a,y:Me*Math.sin(Ce)+o},datum:{value:Y},datumIndex:{type:1,index:B},type:1,value:Y,text:Z,centerX:a,centerY:o,shape:ee,radius:Me,angle:Ce,rotation:xe,size:ie,label:this.getTargetLabel(F),style:he})}return{itemId:t,nodeData:I,needleData:C,targetData:k,labelData:A,scaleData:w,tickData:e}}findNodeDatum(e){return bB(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:s,targetSelection:n,targetLabelSelection:a,scaleSelection:o,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],f=this.contextNodeData?.scaleData??[],y=this.contextNodeData?.tickData??[],b=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:f,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:n}),this.updateTargetStyles({targetSelection:n,isHighlight:!1}),this.updateTargetNodes({targetSelection:n}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:b==null?[]:[b],targetSelection:r}),this.updateTargetStyles({targetSelection:r,isHighlight:!0}),this.updateTargetNodes({targetSelection:r}),this.tickSelection=this.updateTickSelection({tickData:y,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>yw(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{segmentation:n}=s,a=n.spacing??0,o=i.animationManager.isSkipped(),r=this.getShapeFillBBox();t.each((l,c)=>{const{centerX:h,centerY:d,innerRadius:u,outerRadius:p,startCornerRadius:f,endCornerRadius:y}=c;l.centerX=h,l.centerY=d,l.innerRadius=u,l.outerRadius=p,l.pointerEvents=this.properties.bar.enabled?N.PointerEvents.All:N.PointerEvents.None,l.setStyleProperties(c.style,r),l.startOuterCornerRadius=f,l.startInnerCornerRadius=f,l.endOuterCornerRadius=y,l.endInnerCornerRadius=y,l.radialEdgeInset=(a+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,c.midPoint=l.getBBox().computeCenter(),(o||l.previousDatum==null)&&l.setProperties(mw(l,c))}),this.datumUnion.update(t,this.itemGroup,N.Sector,(l,c,h)=>{l.clipSector??(l.clipSector=new Vee(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),l.centerX=c.centerX,l.centerY=c.centerY,l.outerRadius=l.clipSector.outerRadius=c.outerRadius,l.innerRadius=l.clipSector.innerRadius=c.innerRadius,l.startAngle=l.clipSector.startAngle=c.startAngle,l.startInnerCornerRadius=c.startInnerCornerRadius,l.startOuterCornerRadius=c.startOuterCornerRadius,l.endAngle=h.endAngle,l.clipSector.endAngle=h.clipSector?.endAngle??h.endAngle,l.endInnerCornerRadius=h.endInnerCornerRadius,l.endOuterCornerRadius=h.endOuterCornerRadius,l.pointerEvents=N.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>yw(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{segmentation:i}=this.properties,s=i.spacing??0,n=this.getShapeFillBBox();t.each((a,o)=>{const{centerX:r,centerY:l,innerRadius:c,outerRadius:h,startCornerRadius:d,endCornerRadius:u}=o;a.centerX=r,a.centerY=l,a.innerRadius=c,a.outerRadius=h,a.setStyleProperties(o.style,n),a.startOuterCornerRadius=d,a.startInnerCornerRadius=d,a.endOuterCornerRadius=u,a.endInnerCornerRadius=u,a.radialEdgeInset=(s+a.strokeWidth)/2,a.concentricEdgeInset=a.strokeWidth/2,a.setProperties(mw(a,o))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>yw(0))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((h,d)=>{const{centerX:u,centerY:p,radius:f}=d,y=f*2;h.d=uw.defaultPathData,h.setStyleProperties({fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o/y,lineDash:r.map(b=>b/y),lineDashOffset:l/y}),h.translationX=u,h.translationY=p,h.scalingX=y,h.scalingY=y,c&&h.setProperties(VB(h,d))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetStyles({targetSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getTargetStyle(t,s)})}updateTargetNodes({targetSelection:e}){e.each((t,i)=>{const{centerX:s,centerY:n,angle:a,radius:o,shape:r,size:l,rotation:c}=i;t.setStyleProperties(i.style),t.size=l,t.shape=r==="line"?mB:r,t.translationX=s+o*Math.cos(a),t.translationY=n+o*Math.sin(a),t.rotation=a+c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return re(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{centerX:n,centerY:a,radius:o,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:d,fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,textAlign:b,textBaseline:x}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=n+o*Math.cos(r)+c,i.y=a+o*Math.sin(r)+h,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=p,i.fontSize=f,i.fontFamily=y,i.textAlign=b,i.textBaseline=x})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>t.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:n,properties:a}=this,{enabled:o,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=a.scale.label,p=lt(a.scale.label.rotation??0);e.tickSelection.each((f,y)=>{if(!o){f.visible=!1;return}f.visible=!0,f.text=y.text,f.fill=r,f.fontFamily=l,f.fontSize=c,f.fontStyle=h,f.fontWeight=d;const b=t.convert(y.value),{textAlign:x,textBaseline:v}=this.getTickLabelAlign(b),S=s+(i+u)*Math.cos(b),M=n+(i+u)*Math.sin(b);f.textAlign=x,f.textBaseline=v,f.x=S,f.y=M,f.rotationCenterX=S,f.rotationCenterY=M,f.rotation=p})}getTickLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,n;const a=He(t,0),o=He(i,0),r=t>0&&!a,l=i>0&&!o;return s="right",a?s="center":r&&(s="left"),n="bottom",o?n="middle":l&&(n="top"),{textAlign:s,textBaseline:n}}getTickLabelInset(e){const{tickData:t,radius:i,centerXOffset:s,centerYOffset:n,seriesRectWidth:a,seriesRectHeight:o,spacing:r,rotation:l}=e,{label:c}=this.properties.scale,h=a/2+s*i,d=o/2+n*i,u=new Fee;u.fontFamily=c.fontFamily,u.fontSize=c.fontSize,u.fontStyle=c.fontStyle,u.fontWeight=c.fontWeight,u.rotation=l;const p=1e-6;let f=0;for(const y of t){const b=this.scale.convert(y.value),x=Math.cos(b),v=Math.sin(b),S=h+(i+r)*x,M=d+(i+r)*v,{textAlign:D,textBaseline:I}=this.getTickLabelAlign(b);u.text=y.text,u.x=S,u.y=M,u.textAlign=D,u.textBaseline=I,u.rotationCenterX=S,u.rotationCenterY=M;const k=l?Bee.toCanvas(u):u.getBBox();if(k==null)continue;const C=k.x,A=k.x+k.width,w=k.y,T=k.y+k.height,O=Math.max(0,-C),z=Math.max(0,A-a),V=Math.max(0,-w),E=Math.max(0,T-o),_=s+x;Math.abs(_)>p&&(z>0&&_>0?f=Math.max(f,z/_):O>0&&_<0&&(f=Math.max(f,O/-_)));const G=n+v;Math.abs(G)>p&&(E>0&&G>0?f=Math.max(f,E/G):V>0&&G<0&&(f=Math.max(f,V/-G)))}return f}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:n}=this,{spacing:a,innerRadiusRatio:o}=this.properties;Pee(this,this.ctx,t,{padding:a,textAlign:s,verticalAlign:n},i*o,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),BB([this.datumSelection],mw),BB([this.needleSelection],VB),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,s,n,a;if(this.labelSelection.each((o,r)=>{o.opacity=1,r.label==="primary"?(i=o.previousDatum?.value??e.from??r.value,s=r.value):r.label==="secondary"&&(n=o.previousDatum?.value??e.from??r.value,a=r.value)}),!this.labelsHaveExplicitText())if(s==null||a==null)this.formatLabelText();else if(i===s&&n===a)this.formatLabelText({label:s,secondaryLabel:a});else{const o=`${this.id}_labels`;t.animate({id:o,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:a},phase:e.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:s,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=zB(!0,this.scale.range[0]);bm(this.id,"node",e,[this.datumSelection],t,(s,n)=>n.itemId),bm(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),bm(this.id,"label",e,[this.labelSelection],gB,(s,n)=>n.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=zB(!1,this.scale.range[0]);bm(this.id,"node",e,[this.datumSelection],t,(s,n)=>n.itemId),bm(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let n,a,o;if(e.type===0?(n=i.value,a=i.label.text,o=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:n,text:a}=i.targets[e.index],o=this.ctx.localeManager.t("ariaLabelGaugeTarget")),n!=null)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:o,value:this.formatLabel(n)}]},{seriesId:t,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(e){return yB(this,e)}pickFocus(e){return xB(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((i,s)=>{const n=gm(this.id,this.ctx,s);n!=null&&t.push(Ne(n))}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};xw.className="RadialGaugeSeries",xw.type="radial-gauge";var HB={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,dependencies:[uB],version:ue,options:Rc,themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},yo]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",yr,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...Ye,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...Ye,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ki.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}},create:e=>new xw(e)},GB=[LB,HB];function bw(e,t,i){const s=Math.floor(e.length/2);return jB(e,t,s,t,i)||jB(e,e.length-t,s,-t,i)}function jB(e,t,i,s,n){let a=e[0];for(let o=t;s>0?o<=i:o>i;o+=s){const r=e[o];if(n(a,r))return!0;a=r}return!1}var{AxisInterval:Wee}=N,vw=class extends Wee{};g([m],vw.prototype,"minSpacing",2);var{Group:Sw,LabelStyle:$ee}=N,Vp=class extends $ee{constructor(){super(...arguments),this.padding=5}};g([m],Vp.prototype,"enabled",2),g([m],Vp.prototype,"padding",2),g([m],Vp.prototype,"text",2),g([m],Vp.prototype,"parallel",2);var Gs=class extends X{constructor(){super(...arguments),this.id=Ii(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Vp,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="angle",this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Sw({name:this.id}),this.rangeGroup=new Sw({name:this.id}),this.labelGroup=new Sw({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,n){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=s,e.rotation=n,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.setFont(a),e.setBoxing(a),e.visible=!0}};Gs.className="PolarCrossLine",g([m],Gs.prototype,"enabled",2),g([m],Gs.prototype,"type",2),g([m],Gs.prototype,"range",2),g([m],Gs.prototype,"value",2),g([m],Gs.prototype,"defaultColorRange",2),g([m],Gs.prototype,"fill",2),g([m],Gs.prototype,"fillOpacity",2),g([m],Gs.prototype,"stroke",2),g([m],Gs.prototype,"strokeWidth",2),g([m],Gs.prototype,"strokeOpacity",2),g([m],Gs.prototype,"lineDash",2),g([m],Gs.prototype,"shape",2),g([m],Gs.prototype,"label",2);var{getCrossLineValue:Kee,validateCrossLineValue:Uee,Group:Yee,Path:WB,Sector:Zee,RotatableText:Xee,ContinuousScale:qee}=N,Mw=class extends Gs{constructor(){super(),this.direction="angle",this.polygonNode=new WB,this.sectorNode=new Zee,this.lineNode=new WB,this.crossLineRange=new Yee,this.labelNode=new Xee,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!qee.is(this.scale))return!0;const[e,t]=this.scale.domain,i=Kee(this);if(this.type==="range"){const[s,n]=i;return s>=e&&s<=t&&n>=s&&n<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!Uee(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:n}=this;if(!e||i!=="line"||!t){n.visible=!1;return}const a=t.convert(s);if(Number.isNaN(a)){n.visible=!1;return}const{axisInnerRadius:o,axisOuterRadius:r}=this;n.visible=!0,n.stroke=this.stroke,n.strokeOpacity=this.strokeOpacity??1,n.strokeWidth=this.strokeWidth??1,n.fill=void 0,n.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),h=o*Math.cos(a),d=o*Math.sin(a);n.path.clear(!0),n.path.moveTo(h,d),n.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:n,type:a,ticks:o}=this;if(!e||a!=="range"||n!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=o.indexOf(i[0]),h=o.indexOf(i[1]),u=(c<=h?o.slice(c,h+1):o.slice(c).concat(o.slice(0,h+1))).map(f=>s.convert(f));t.visible=!0,this.setSectorNodeProps(t);const{path:p}=t;p.clear(!0);for(const[f,y]of u.entries()){const b=l*Math.cos(y),x=l*Math.sin(y);f===0?p.moveTo(b,x):p.lineTo(b,x)}if(r===0)p.lineTo(0,0);else{const f=u.slice().reverse();for(const y of f){const b=r*Math.cos(y),x=r*Math.sin(y);p.lineTo(b,x)}}t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:n,type:a}=this;if(!e||a!=="range"||n!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:o,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,h=s instanceof N.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=o,t.outerRadius=r,t.startAngle=l[0]-h,t.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:n,type:a,ticks:o}=this;if(!e||t.enabled===!1||!t.text||!n||a==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,d,u;if(a==="line"){const p=Qe(n.convert(this.value)),f=1.5*Math.PI,y=He(p,f)||p>f||p<Math.PI/2,b=(r+l)/2*Math.cos(p),x=(r+l)/2*Math.sin(p);c=b+t.padding*Math.cos(p+Math.PI/2),h=x+t.padding*Math.sin(p+Math.PI/2),u=y?"top":"bottom",d=y?p:p-Math.PI}else{const[p,f]=s.map(v=>Qe(n.convert(v)));let y=(p+f)/2;p>f&&(y-=Math.PI),y=Qe(y);const b=(He(y,0)||y>0)&&y<Math.PI;let x;this.shape==="circle"||o.length<3?x=l-t.padding:x=l*Math.cos(Math.PI/o.length)-t.padding,c=x*Math.cos(y),h=x*Math.sin(y),u=b?"bottom":"top",d=b?y-Math.PI/2:y+Math.PI/2}this.setLabelNodeProps(i,c,h,u,d)}};Mw.className="AngleCrossLine";var{Path:Qee,RotatableText:Jee,Transformable:ete,BBox:tte,Selection:$B,Line:KB}=N,Dw=class extends N.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};g([m],Dw.prototype,"orientation",2);var vm=class extends N.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=$B.select(this.tickLineGroup,KB,!1),this.gridLineGroupSelection=$B.select(this.gridLineGroup,KB,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new N.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new Qee),this.includeInvisibleDomains=!0}get direction(){return"angle"}createLabel(){return new Dw}calculateRotations(){const e=lt(this.startAngle),t=Qe(e),i=Qe(e-Math.PI/2);return{rotation:e,parallelFlipRotation:t,regularFlipRotation:i}}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:[t,t],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=t?i.niceDomain(s,e):e,a=this.generateAngleTicks(n);this.tickData=a;const o=a.map(l=>l.value),r=o.reduce((l,c)=>Math.max(typeof c=="number"?Pc(c):0,l),0);return{niceDomain:n,tickDomain:n,ticks:o,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Qe(-Math.PI/2+lt(this.startAngle)),t=this.endAngle==null?2*Math.PI:Wd(lt(this.endAngle)-lt(this.startAngle)),i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();for(const{x:n,y:a,moveTo:o,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0}of i)r?t.arc(n,a,l,c,h):o?t.moveTo(n,a):t.lineTo(n,a);s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,n]=this.range,a=He(n-s,2*Math.PI),o=[];if(t==="circle")a?o.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):o.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Qe(s),endAngle:Qe(n),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));if(r&&r.length>2)for(const[l,c]of r.entries()){const h=i*Math.cos(c),d=i*Math.sin(c),u=l===0;o.push({x:h,y:d,moveTo:u})}}return{points:o,closePath:a}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&t>0))return;const a=t*n,o=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:d,lineDash:u}=i[c%o],p=e.convert(h);r.x1=a*Math.cos(p),r.y1=a*Math.sin(p),r.x2=t*Math.cos(p),r.y2=t*Math.sin(p),r.stroke=d,r.strokeWidth=s,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,n)=>{const a=this.labelData[n];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(e),i.fill=e.color,i.x=a.x,i.y=a.y,i.setAlign(a),i.setBoxing(e),i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((n,a)=>{const{value:o}=a,r=e.convert(o),l=Math.cos(r),c=Math.sin(r);n.x1=t*l,n.y1=t*c,n.x2=(t+i.size)*l,n.y2=(t+i.size)*c,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:n,scale:a,tick:o}=this;if(!s.enabled)return[];const r=new Jee,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,h),u=e.map((p,f)=>{const{value:y}=p,b=n+s.spacing+o.size,x=a.convert(y),v=Math.cos(x),S=Math.sin(x),M=b*v,D=b*S,{textAlign:I,textBaseline:k}=this.getLabelAlign(x),C=f===e.length-1&&y!==e[0]&&He(Qe(x),Qe(a.convert(e[0]))),A=this.getLabelRotation(x);let w=d(y,f);r.text=w,r.x=M,r.y=D,r.setFont(s),r.textAlign=I,r.textBaseline=k,r.rotation=A,A&&(r.rotationCenterX=M,r.rotationCenterY=D);let T=A?ete.toCanvas(r):r.getBBox();if(T&&t.hideWhenNecessary&&!A){const O=l-T.x,z=T.x+T.width-c,V=1;if(O>V||z>V){const _={maxWidth:T.width-Math.max(O,z),font:s,textWrap:"never"};w=qd(w,_),r.text=w,T=r.getBBox()}}return{text:w,x:M,y:D,textAlign:I,textBaseline:k,hidden:w===""||(p.hidden??C),rotation:A,box:T}});return s.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:tte.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof Dw?e.orientation:"fixed"}getLabelRotation(e){let t=lt(this.label.rotation??0);e=Qe(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):i==="perpendicular"&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,n;const a=this.getLabelOrientation(),o=He(t,0),r=He(i,0),l=He(t,1),c=He(i,-1),h=t>0&&!o,d=i>0&&!r;return a==="parallel"?(s="center",n=l&&r||d?"top":"bottom"):a==="perpendicular"?(s=c||h?"left":"right",n="middle"):(s="right",o?s="center":h&&(s="left"),n="bottom",r?n="middle":d&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;for(const s of this.crossLines)s instanceof Mw&&(s.ticks=this.tickData.map(n=>n.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i);super.updateCrossLines()}};vm.CrossLineConstructor=Mw,g([m],vm.prototype,"startAngle",2),g([m],vm.prototype,"endAngle",2);var{CategoryScale:ite}=N,Qh=class extends vm{constructor(e){super(e,new ite),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new vw}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:s,minSpacing:n}=this.interval,a={nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},o=s??t.ticks(a,e)?.ticks??[];if(o.length<2||n==null)return o.map(d=>({value:d,visible:!0}));const r=o[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let d=1;d<o.length-1;d++){const u=o[d],p=t.convert(u);if(p-l>Math.PI)break;const f=i*Math.cos(p),y=i*Math.sin(p);if(Math.hypot(f-c,y-h)>n){const x=new Set([r]);return bw(o,d,(v,S)=>{x.add(S)}),o.map(v=>{const S=x.has(v);return{value:v,visible:S}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return h.collidesBBox(d)},s=e[0],n=e.at(-1),a=new Set([s]),o=He(s.x,n.x)&&He(s.y,n.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=o?e.slice(0,-1):e;if(!bw(c,l,i)){bw(c,l,(d,u)=>{a.add(u)});break}}for(const l of e)a.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:n,key:a,source:o,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:n,key:a,source:o,property:r,domain:l,boundSeries:c}}};Qh.className="AngleCategoryAxis",Qh.type="angle-category",g([m],Qh.prototype,"groupPaddingInner",2),g([m],Qh.prototype,"paddingInner",2),g([m],Qh.prototype,"interval",2);var UB={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,version:ue,options:N.angleCategoryAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},create:e=>new Qh(e)},Cc=class extends vm{constructor(e){super(e,new NB),this.shape="circle",this.interval=new vw}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:o}=Gc(e.domain,t,i,s,n,void 0,e.sortMetadata?.sortOrder);return{domain:a,clipped:o}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e),s=_a(t,i)||2*Math.PI,n=this.gridLength;return s*n}generateAngleTicks(e){const{scale:t,range:i,nice:s}=this,{values:n,step:a,minSpacing:o,maxSpacing:r}=this.interval;let l;if(n==null){const{arcLength:c}=t,h=r?Math.floor(c/r):1,d=o?Math.floor(c/o):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(h,Math.min(d,u)),f={nice:[s,s],interval:a,tickCount:p,minTickCount:h,maxTickCount:d};l=t.ticks(f,e)?.ticks??[]}else{const[c,h]=Tt(e.map(Number));l=n.filter(d=>d>=c&&d<=h).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,o)=>{if(a.hidden||o.hidden)return!1;if(t==null)return a.box.collidesBBox(o.box);const r=a.box.clone().grow(t/2),l=o.box.clone().grow(t/2);return r.collidesBBox(l)},s=e[0],n=e.at(-1);s!==n&&He(s.x,n.x)&&He(s.y,n.y)&&(n.hidden=!0);for(let a=1;a<e.length;a*=2){let o=!1;for(let r=a;r<e.length;r+=a){const l=e[r],c=e[r-a];if(i(c,l)){o=!0;break}}if(!o){for(const[r,l]of e.entries())r%a>0&&(l.hidden=!0,l.box=void 0);return}}for(const[a,o]of e.entries())a>0&&(o.hidden=!0,o.box=void 0)}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i,visibleDomain:void 0}}};Cc.className="AngleNumberAxis",Cc.type="angle-number",g([m],Cc.prototype,"min",2),g([m],Cc.prototype,"max",2),g([m],Cc.prototype,"preferredMin",2),g([m],Cc.prototype,"preferredMax",2),g([m],Cc.prototype,"interval",2);var YB={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,version:ue,options:N.angleNumberAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1}},create:e=>new Cc(e)},{validateCrossLineValue:ste,Group:nte,Path:ate,Sector:ote,RotatableText:rte}=N,ZB=class extends Vp{constructor(){super(...arguments),this.positionAngle=void 0}};g([m],ZB.prototype,"positionAngle",2);var kw=class extends Gs{constructor(){super(),this.direction="radius",this.label=new ZB,this.polygonNode=new ate,this.sectorNode=new ote,this.crossLineRange=new nte,this.labelNode=new rte,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!ste(this,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;e&&(e=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:n}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=l=>n+s-l;let o,r;if(i==="line")o=a(t.convert(this.value)),r=o;else{const l=Math.abs(t?.bandwidth??0),c=e.map(h=>t.convert(h));o=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=o,this.innerRadius=r}drawPolygon(e,t,i){for(const[s,n]of t.entries()){const a=e*Math.cos(n),o=e*Math.sin(n);s===0?i.path.moveTo(a,o):i.path.lineTo(a,o)}i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:n,type:a,innerRadius:o,outerRadius:r}=this;if(!e||n!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),h=a==="line"?r-l:o+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:n,shape:a,innerRadius:o,outerRadius:r}=this;if(!e||a!=="circle"||!s){n.visible=!1;return}n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const l=this.getPadding(),c=ae(t,o+l,i),h=ae(t,r-l,i);n.innerRadius=Math.min(c,h),n.outerRadius=Math.max(c,h),this.setSectorNodeProps(n)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:n,shape:a,type:o}=this;if(!e||i.enabled===!1||!i.text||!n){s.visible=!1;return}const r=Ha((i.positionAngle??0)-90),l=(He(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let h;const d=this.gridAngles??[];o==="line"?h=t+i.padding:a==="circle"||d.length<3?h=t-i.padding:h=t*Math.cos(Math.PI/d.length)-i.padding;const u=h*Math.cos(r),p=h*Math.sin(r);let f;o==="line"?f=l?"top":"bottom":f=l?"bottom":"top",this.setLabelNodeProps(s,u,p,f,c)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof N.BandScale?(i-t)/2:0}};kw.className="RadiusCrossLine";var{Caption:lte,Group:cte,TransformableGroup:XB,Path:hte,Line:qB,Selection:QB,generateTicks:dte,AxisGroupZIndexMap:ute}=N,Iw=class extends N.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};g([m],Iw.prototype,"autoRotate",2),g([m],Iw.prototype,"autoRotateAngle",2);var mS=class extends N.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=QB.select(this.gridLineGroup,qB,!1),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new XB({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new XB({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new qB({name:`${this.id}-Axis-line`,zIndex:ute.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new cte({name:`${this.id}-gridPaths`,zIndex:2})),this.gridPathSelection=QB.select(this.gridPathGroup,hte),this.headingLabelGroup.appendChild(this.title.caption.node),this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return"radius"}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,n=e*s,a=lt(i);return{translationX:t.x,translationY:t.y-e-n,rotation:a,rotationCenterX:0,rotationCenterY:e+n}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const s=[0,1],n=this.label.getSideFlag(),a=n*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),{range:o,reverse:r,defaultTickMinSpacing:l}=this,c=dte({scale:this.scale,label:this.label,interval:this.interval,tickFormatter:(...v)=>this.tickFormatter(...v),domain:e,range:o,reverse:r,niceMode:t,visibleRange:s,defaultTickMinSpacing:l,labelOffset:a,sideFlag:n,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:h}=c,{ticks:d,rawTicks:u,rawTickCount:p,tickDomain:f,fractionDigits:y,niceDomain:b=e}=h,x=d.map(v=>this.getTickLabelProps(v,c));return this.generatedTicks={ticks:d,labels:x},{ticks:u,tickDomain:f,niceDomain:b,rawTickCount:p,fractionDigits:y,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=N.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const n=e.length,a=(u,p)=>{const{stroke:f,lineDash:y}=e[p%n];u.stroke=f,u.strokeWidth=t,u.lineDash=y,u.fill=void 0},[o,r]=this.gridRange??[0,2*Math.PI],l=He(r-o,2*Math.PI),d=i==="circle"?(u,p)=>{const{path:f}=u;f.clear(!0);const y=this.getTickRadius(p);l?(f.moveTo(y,0),f.arc(0,0,y,0,2*Math.PI)):(f.moveTo(y*Math.cos(o),y*Math.sin(o)),f.arc(0,0,y,Qe(o),Qe(r))),l&&f.closePath()}:(u,p)=>{const{path:f}=u,y=this.gridAngles;if(f.clear(!0),!y||y.length<3)return;const b=this.getTickRadius(p);for(const[x,v]of y.entries()){const S=b*Math.cos(v),M=b*Math.sin(v);x===0?f.moveTo(S,M):f.lineTo(S,M);for(const[D,I]of y.entries()){const k=b*Math.cos(I),C=b*Math.sin(I);D===0?f.moveTo(k,C):f.lineTo(k,C)}f.closePath()}f.closePath()};this.gridPathSelection.each((u,p,f)=>{a(u,f),d(u,p)})}updateTitle(){const e=o=>o.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let n=!1;const a=t.caption.node;t.enabled&&(n=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-lte.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain))),a.visible=n}updateCrossLines(){for(const e of this.crossLines)if(e instanceof kw){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:n}=this,a=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=a,e.axisInnerRadius=a*n}super.updateCrossLines()}createLabel(){return new Iw}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:n,textAlign:a}=t,o=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null,d=s;return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:d,text:r,textAlign:a,textBaseline:n,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:o}}};mS.CrossLineConstructor=kw,g([m],mS.prototype,"positionAngle",2);var{CategoryScale:JB}=N,Jh=class extends mS{constructor(e){super(e,new JB),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],n=s*i;if(JB.is(t)){const a=t.domain,o=a.length-1-a.indexOf(e.tick);return o===0?n:t.inset+t.step*(o-.5)+t.bandwidth/2}else{const a=(s-n)/t.domain.length;return s-e.translation+n-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:n,key:a,source:o,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:n,key:a,source:o,property:r,domain:l,boundSeries:c}}};Jh.className="RadiusCategoryAxis",Jh.type="radius-category",g([m],Jh.prototype,"groupPaddingInner",2),g([Dt("scale","paddingInner"),m],Jh.prototype,"paddingInner",2),g([Dt("scale","paddingOuter"),m],Jh.prototype,"paddingOuter",2);var eF={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,version:ue,options:N.radiusCategoryAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},label:{minSpacing:5}},create:e=>new Jh(e)},{LinearScale:pte}=N,ed=class extends mS{constructor(e){super(e,new pte),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:s})=>s!==i).sort((s,n)=>n.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translation+s}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:o}=Gc(e.domain,t,i,s,n,void 0,e.sortMetadata?.sortOrder);return{domain:a,clipped:o}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:a,key:o,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i,visibleDomain:void 0}}};ed.className="RadiusNumberAxis",ed.type="radius-number",g([m],ed.prototype,"min",2),g([m],ed.prototype,"max",2),g([m],ed.prototype,"preferredMin",2),g([m],ed.prototype,"preferredMax",2);var tF={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,version:ue,options:N.radiusNumberAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0},label:{minSpacing:5}},create:e=>new ed(e)},{createDatumId:gte,toHighlightString:fte}=N;function mte(e,t){const{id:i}=e,{angleKey:s,cornerRadius:n,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,radiusKey:c,stackGroup:h,stroke:d,strokeOpacity:u,strokeWidth:p}=e.properties,f=fte(t??N.HighlightState.None);return{angleKey:s,cornerRadius:n,fill:a,fillOpacity:o,highlightState:f,lineDash:r,lineDashOffset:l,radiusKey:c,seriesId:i,stackGroup:h,stroke:d,strokeOpacity:u,strokeWidth:p}}function Aw(e,t,i){const{styler:s}=e.properties;let n={};if(!t&&s){const a=mte(e,i);n=e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.cachedCallWithContext(s,a)??{},{pick:!1})??{}}return{cornerRadius:n.cornerRadius??e.properties.cornerRadius,fill:n.fill??e.properties.fill,fillOpacity:n.fillOpacity??e.properties.fillOpacity,lineDash:n.lineDash??e.properties.lineDash,lineDashOffset:n.lineDashOffset??e.properties.lineDashOffset,stroke:n.stroke??e.properties.stroke,strokeOpacity:n.strokeOpacity??e.properties.strokeOpacity,strokeWidth:n.strokeWidth??e.properties.strokeWidth,opacity:1}}function yte(e,t,i,s){const{id:n,properties:a}=e,{angleKey:o,radiusKey:r}=a,l=e.ctx.highlightManager?.getActiveHighlight(),c=e.getHighlightStateString(l,i,t.datumIndex),h=e.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:t.datum,highlightState:c,angleKey:o,radiusKey:r,...s,fill:h}}function Bp(e,t,i,s){const{properties:n}=e,{itemStyler:a}=n,o=e.getHighlightStyle(i,t?.datumIndex,s);let l=re(o,Aw(e,t===void 0,s));if(a!=null&&t!=null){const c=e.cachedDatumCallback(gte(e.getDatumId(t),i?"highlight":"node"),()=>{const h=yte(e,t,i,l);return e.callWithContext(a,h)});c&&(l=re(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS:xte,DEFAULT_POLAR_DIRECTION_NAMES:bte,PolarAxis:vte,diff:Ste,fixNumericExtent:Mte,groupAccumulativeValueProperty:iF,keyProperty:Dte,normaliseGroupTo:kte,resetLabelFn:Ite,seriesLabelFadeInAnimation:Ate,seriesLabelFadeOutAnimation:Cte,valueProperty:wte,animationValidation:Lte,createDatumId:Nte,SeriesNodePickMode:sF,CategoryScale:Tte,motion:nF,updateLabelNode:aF,getItemStyles:Ote}=N,Pte=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},oF=class extends N.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:xte,propertyNames:bte,canHaveAxes:!0,pickModes:[sF.NEAREST_NODE,sF.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:Ite}}),this.NodeEvent=Pte,this.groupScale=new Tte,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e==="angle")return t.getDomain(this,"angleValue","key",i);{const s=t.getDomain(this,"radiusValue-end","value",i).domain,n=Number.isFinite(s[1]-s[0])?[Math.min(s[0],0),Math.max(s[1],0)]:[];return{domain:Mte(n)}}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),o=`${a}-trailing`,r=[];Mt(s)&&r.push(kte([a,o],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&r.push(Ste(this.id,this.processedData)),n&&r.push(Lte());const l=this.visible?{}:{forceValue:0},c=this.axes.radius?.scale.type,h=this.axes.angle?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[Dte(t,h,{id:"angleValue",allowNullKey:d}),wte(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...iF(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...iF(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:o,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e!==s.r||t!==s.cx||i!==s.cy?(this.circleCache={r:e,cx:t,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes.radius?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes.radius;return e instanceof vte?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||e?.type!=="grouped")return;const s=this.axes.angle,n=this.axes.radius,a=s?.scale,o=n?.scale;if(!a||!o)return;const r=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),h=t.resolveColumnById(this,"radiusValue-raw",e);let d=0,u=0;s instanceof Qh&&(d=s.groupPaddingInner,u=s.paddingInner);const f=(a.bandwidth??0)*(1-u),{index:y,visibleGroupCount:b}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:b}).map((B,F)=>String(F)),i.range=[-f/2,f/2],i.paddingInner=b>1?d:0;const x=this.isRadiusAxisReversed(),v=this.getAxisInnerRadius(),S=this.radius,M=S+v,{angleKey:D,radiusKey:I,angleName:k,radiusName:C,legendItemName:A,label:w}=this.properties,T=this.getSeriesDomain("radius").domain,O=(B,F,Y,Z)=>{const ie=this.getLabelText(F,B,I,"radius",T,w,{value:F,datum:B,angleKey:D,radiusKey:I,angleName:k,radiusName:C,legendItemName:A});if(ie)return{x:Y,y:Z,text:ie,textAlign:"center",textBaseline:"middle"}},z=[],V=Ote((B,F,Y)=>Bp(this,B,F,Y)),E={itemId:I,nodeData:z,labelData:z,styles:V};if(!this.visible)return E;const{dataSources:_}=e,G=_.get(this.id)?.data??[];for(const{datumIndex:B}of t.forEachGroupDatum(this,e)){const F=G[B],Y=r[B];if(Y===void 0&&!this.properties.allowNullKeys)return;const Z=h[B],ie=Z>=0&&!Object.is(Z,-0),ee=l[B],he=c[B],Me=ie===x;if(ee===void 0||he===void 0)return;let Ce,xe,Ge;if(G.length===1)Ce=-.5*Math.PI,xe=1.5*Math.PI,Ge=Ce;else{const xt=a.convert(Y);Ce=Qe(xt+i.convert(String(y))),xe=Qe(Ce+i.bandwidth),Ge=Ce+i.bandwidth/2}const je=M-o.convert(ee),dt=M-o.convert(he),Ze=(je+dt)/2,we=Math.cos(Ge)*Ze,Ie=Math.sin(Ge)*Ze,pe=this.properties.label.enabled?O(F,Z,we,Ie):void 0,yt=this.getColumnWidth(Ce,xe);z.push({series:this,datum:F,datumIndex:B,point:{x:we,y:Ie,size:0},midPoint:{x:we,y:Ie},label:pe,angleValue:Y,radiusValue:Z,negative:Me,innerRadius:je,outerRadius:dt,stackInnerRadius:je,stackOuterRadius:dt,startAngle:Ce,endAngle:xe,midAngle:Ge,axisInnerRadius:v,axisOuterRadius:S,columnWidth:yt,index:B})}return{itemId:I,nodeData:z,labelData:z,styles:V}}getColumnWidth(e,t){return Number.NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight();let n=[];const a=this.ctx.highlightManager?.getActiveHighlight();t?a?.datum&&a.series===this&&n.push(a):n=this.nodeData;const o=this.isRadiusAxisReversed(),r=o?this.radius:this.getAxisInnerRadius(),l=o?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),h=this.hasItemStylers();e.update(n,void 0,d=>this.getDatumId(d)).each((d,u)=>{const{midPoint:p}=u;if(h){const v=this.getHighlightState(a,t,u.datumIndex);u.style=Bp(this,u,t,v)}const f=u.style??i.styles[this.getHighlightState(s,t,u.datumIndex)],y=f.fill,x=Qt(y)&&y.bounds==="item"?{centerX:p?.x??0,centerY:p?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:l};this.updateItemPath(d,u,t),d.setStyleProperties(f,c,x),d.cornerRadius=f.cornerRadius??0,d.lineJoin="round"})}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=e?.series===this&&e?.datum?e:void 0,i=t?[t]:[];this.labelSelection.update(this.nodeData).each((s,n)=>{aF(this,s,this.properties,this.properties.label,n.label,!1,e),s.fillOpacity=this.getHighlightStyle(!1,n.datumIndex).opacity??1}),this.highlightLabelSelection.update(i,void 0,s=>this.getDatumId(s)).each((s,n)=>{aF(this,s,this.properties,this.properties.label,n.label,!0,e),s.fillOpacity=this.getHighlightStyle(!0,n.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();nF.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),Ate(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();nF.fromToMotion(this.id,"datums",t,[e],i),Cte(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=a,u=n.angle,p=n.radius,f=this.nodeData?.[e];if(!i||!s||!u||!p||!f)return;const y=s.dataSources.get(this.id)?.data[e],b=i.resolveKeysById(this,"angleValue",s)[e],x=i.resolveColumnById(this,"radiusValue-raw",s)[e];if(b===void 0&&!this.properties.allowNullKeys)return;const v=Bp(this,f,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(u,"tooltip",b,y,o,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(p,"tooltip",x,y,l,void 0),missing:N.isTooltipValueMissing(x)}]},{seriesId:t,datum:y,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...v})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=Aw(this,!1,N.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o};return Qt(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{radiusKey:s,radiusName:n,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:a??n??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}getDatumId(e){return Nte(e.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:Ete,makeSeriesTooltip:Rte,Label:zte}=N,Yt=class extends Ete{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new zte,this.tooltip=Rte()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};g([m],Yt.prototype,"angleKey",2),g([m],Yt.prototype,"angleName",2),g([m],Yt.prototype,"radiusKey",2),g([m],Yt.prototype,"radiusName",2),g([m],Yt.prototype,"angleKeyAxis",2),g([m],Yt.prototype,"radiusKeyAxis",2),g([m],Yt.prototype,"legendItemName",2),g([m],Yt.prototype,"fill",2),g([m],Yt.prototype,"fillOpacity",2),g([m],Yt.prototype,"stroke",2),g([m],Yt.prototype,"strokeWidth",2),g([m],Yt.prototype,"strokeOpacity",2),g([m],Yt.prototype,"lineDash",2),g([m],Yt.prototype,"lineDashOffset",2),g([m],Yt.prototype,"cornerRadius",2),g([m],Yt.prototype,"styler",2),g([m],Yt.prototype,"itemStyler",2),g([m],Yt.prototype,"rotation",2),g([m],Yt.prototype,"stackGroup",2),g([m],Yt.prototype,"normalizedTo",2),g([m],Yt.prototype,"label",2),g([m],Yt.prototype,"tooltip",2);var{motion:Vte}=N;function rF(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(o,r,l)=>{for(const c of t){const h=e[c];let d=(l==="removed"||l==="updated"?o:r)[c],u=(l==="removed"?o:r)[c];Number.isNaN(u)&&(u=o.previousDatum?.[c]??Number.NaN);const p=d-u;Math.abs(p)>Math.PI&&(d-=Math.sign(p)*2*Math.PI),h.set(r,{from:d,to:u})}},s=(o,r)=>({startAngle:e.startAngle.get(o)[r],endAngle:e.endAngle.get(o)[r]});return{calculate:i,from:o=>s(o,"from"),to:o=>s(o,"to")}}function lF(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.startAngle)||Number.isNaN(e.previousDatum.endAngle))return"added";if(Number.isNaN(t.startAngle)||Number.isNaN(t.endAngle))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function Bte(e){const t=rF();return{toFn:(n,a,o)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,h,d,u,p;return o==="removed"?(c=n.innerRadius,h=n.innerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=Number.isNaN(a.innerRadius)?e:a.innerRadius,h=Number.isNaN(a.outerRadius)?e:a.outerRadius,d=Number.isNaN(a.columnWidth)?n.columnWidth:a.columnWidth,u=a.axisInnerRadius,p=a.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l}},fromFn:(n,a,o)=>{o=lF(n,a,o),t.calculate(n,a,o);const{startAngle:r,endAngle:l}=t.from(a);let c,h,d,u,p;o==="removed"||o==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=e,h=e,d=a.columnWidth,u=a.axisInnerRadius,p=a.axisOuterRadius);const f=Vte.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l,phase:f}}}}function Fte(e,{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:a,startAngle:o,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:a,startAngle:o,endAngle:r}}var{SectorBox:yS,motion:_te}=N;function Cw(e){const{negative:t,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:a}=e;return{innerRadius:t?a:n,outerRadius:t?n:a,clipInnerRadius:t?s:i,clipOuterRadius:t?i:s}}function Hte(e){const t=rF();return{toFn:(n,a,o)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,h,d;if(o==="removed")c=e,h=e,d=new yS(r,l,c,h);else{let u,p;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:p}=Cw(a)),Number.isNaN(c)&&(c=e),Number.isNaN(h)&&(h=e),Number.isNaN(u)&&(u=e),Number.isNaN(p)&&(p=e),d=new yS(r,l,u,p)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d}},fromFn:(n,a,o)=>{o=lF(n,a,o),t.calculate(n,a,o);const{startAngle:r,endAngle:l}=t.from(a);let c,h,d;o==="removed"||o==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.clipSector):(c=e,h=e),d??(d=new yS(r,l,c,h));const u=_te.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d,phase:u}}}}function Gte(e,t){const{startAngle:i,endAngle:s}=t,{innerRadius:n,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=Cw(t),l=new yS(i,s,o,r);return{innerRadius:n,outerRadius:a,startAngle:i,endAngle:s,clipSector:l}}var{Sector:jte,SectorBox:Wte}=N,ww=class extends oF{constructor(e){super(e,{animationResetFns:{item:Gte}}),this.properties=new Yt}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,1,e],this.highlightGroup.zIndex=[0,2,e],this.labelGroup.zIndex=[0,3,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new jte}updateItemPath(e,t,i){const{negative:s}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=s?0:this.properties.cornerRadius,e.endOuterCornerRadius=s?0:this.properties.cornerRadius,e.startInnerCornerRadius=s?this.properties.cornerRadius:0,e.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:n,endAngle:a}=t,{innerRadius:o,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=Cw(t);e.innerRadius=o,e.outerRadius=r,e.startAngle=n,e.endAngle=a,e.clipSector=new Wte(n,a,l,c)}}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Hte(e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};ww.className="NightingaleSeries",ww.type="nightingale";var{nightingaleSeriesThemeableOptionsDef:$te}=N,Lw={...qe,...$te,type:j(Ae("nightingale")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L,grouped:R,stacked:R,stackGroup:L,normalizedTo:W};Lw.angleKeyAxis=Q(L),Lw.radiusKeyAxis=Q(L);var Kte={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",my],["image",it],["pattern",tt]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:{...Us,bringToFront:!1}},axes:{"angle-category":{shape:{$findFirstSiblingNotOperation:"circle"},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},"radius-number":{shape:{$findFirstSiblingNotOperation:"circle"}}}},cF={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,stackedByDefault:!0,version:ue,dependencies:[Wr],options:Lw,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:Kte,create:e=>new ww(e)},hF={series:{stroke:{$palette:"stroke"},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ba],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:Nd,tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{"angle-category":{label:{spacing:10}}}},Ute=re({series:{stroke:yr,strokeWidth:2}},hF),Yte=re({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},hF),{Label:Zte,SeriesMarker:Xte,SeriesProperties:qte,makeSeriesTooltip:Qte}=N,Ei=class extends qte{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new Xte,this.label=new Zte,this.tooltip=Qte(),this.connectMissingData=!1}};g([m],Ei.prototype,"angleKey",2),g([m],Ei.prototype,"radiusKey",2),g([m],Ei.prototype,"angleName",2),g([m],Ei.prototype,"radiusName",2),g([m],Ei.prototype,"angleKeyAxis",2),g([m],Ei.prototype,"radiusKeyAxis",2),g([m],Ei.prototype,"legendItemName",2),g([m],Ei.prototype,"stroke",2),g([m],Ei.prototype,"strokeWidth",2),g([m],Ei.prototype,"strokeOpacity",2),g([m],Ei.prototype,"lineDash",2),g([m],Ei.prototype,"lineDashOffset",2),g([m],Ei.prototype,"rotation",2),g([m],Ei.prototype,"styler",2),g([m],Ei.prototype,"marker",2),g([m],Ei.prototype,"label",2),g([m],Ei.prototype,"tooltip",2),g([m],Ei.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:Jte,DEFAULT_POLAR_DIRECTION_NAMES:eie,PolarAxis:tie,SeriesNodePickMode:dF,keyProperty:iie,valueProperty:sie,fixNumericExtent:nie,seriesLabelFadeInAnimation:aie,markerFadeInAnimation:oie,resetMarkerFn:rie,resetLabelFn:lie,animationValidation:cie,computeMarkerFocusBounds:hie,BBox:die,Group:uie,Path:pie,Selection:Nw,Text:gie,Marker:fie,updateLabelNode:uF,getMarkerStyles:mie}=N,yie=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},Tw=class extends N.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:Jte,propertyNames:eie,pickModes:[dF.NEAREST_NODE,dF.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:rie,label:lie},clipFocusBox:!1}),this.NodeEvent=yie,this.lineGroup=this.contentGroup.appendChild(new uie({name:"radar-line"})),this.lineSelection=Nw.select(this.lineGroup,pie),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}renderToOffscreenCanvas(){return(this.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}nodeFactory(){return new fie}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e==="angle"){const s=t.getDomain(this,"angleValue","key",i).domain,n=t.getKeySortMetadata(this,"angleValue",i);return{domain:s,sortMetadata:n}}else{const s=t.getDomain(this,"radiusValue","value",i).domain,n=Ga(s.length===0?s:[0].concat(s));return{domain:nie(n)}}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(cie());const n=this.axes.radius?.scale.type,a=this.axes.angle?.scale.type,o=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[iie(t,a,{id:"angleValue",allowNullKey:o}),sie(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes.radius;return e instanceof tie?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:n,radiusName:a,legendItemName:o,marker:r,label:l}=this.properties,c=this.axes.angle?.scale,h=this.axes.radius?.scale;if(!c||!h)return;const d=t.resolveKeysById(this,"angleValue",e),u=t.resolveColumnById(this,"radiusValue",e),p=this.getAxisInnerRadius(),f=this.getSeriesDomain("radius").domain,y=e.dataSources.get(this.id)?.data??[],b=this.properties.allowNullKeys??!1,x=[];for(let v=0;v<y.length;v++){const S=y[v],M=d[v];if(M===void 0&&!b)continue;const D=u[v],I=c.convert(M),k=this.radius+p-h.convert(D),C=Math.cos(I),A=Math.sin(I),w=C*k,T=A*k;let O;if(l.enabled){const z=this.getLabelText(D,S,s,"radius",f,l,{value:D,datum:S,angleKey:i,radiusKey:s,angleName:n,radiusName:a,legendItemName:o});if(z){let V="right";He(C,0)?V="center":C>0&&(V="left");let E="bottom";He(A,0)?E="middle":A>0&&(E="top"),O={x:w+C*r.size,y:T+A*r.size,text:z,textAlign:V,textBaseline:E}}}x.push({series:this,datum:S,datumIndex:v,index:v,point:{x:w,y:T,size:r.size},midPoint:{x:w,y:T},label:O,angleValue:M,radiusValue:D,missing:!Be(I)||!Be(k)})}return{itemId:s,nodeData:x,labelData:x,styles:mie(this,this.properties,r)}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0));const n=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateMarkers(this.itemSelection,!1,"overlay"),this.updateMarkers(this.highlightSelection,!0,n),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=Nw.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,s=this.visible&&e.shape&&i?this.nodeData:[];this.itemSelection.update(s)}updateHighlightSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=Nw.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.visible&&e.shape&&i&&s?.datum?[{...s}]:[];this.highlightSelection.update(n)}getMarkerFill(e){return e?.fill??this.getStyle().marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:s,radiusKey:n}=i;return{seriesId:t,datum:e,angleKey:s,radiusKey:n}}updateDatumStyles(e,t){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,n)=>{const a=this.getHighlightState(i,t,n.datumIndex),o=this.getStyle(a),{stroke:r,strokeWidth:l,strokeOpacity:c}=o;n.style=this.getMarkerStyle(this.properties.marker,n,this.getDatumStylerProperties(n.datum),{isHighlight:t,highlightState:a},o.marker,{stroke:r,strokeWidth:l,strokeOpacity:c})})}updateMarkers(e,t,i){const s=this.getShapeFillBBox(),{contextNodeData:n}=this;if(!n)return;const a=this.ctx.highlightManager.getActiveHighlight();i=this.getDrawingMode(t,i),e.each((o,r)=>{const l=r.style??n.styles[this.getHighlightState(a,t,r.datumIndex)];this.applyMarkerStyle(l,o,r.point,s),o.drawingMode=i})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?[{...t}]:[];this.labelSelection.update(this.nodeData).each((s,n)=>{n.label&&(s.fillOpacity=this.getHighlightStyle(!1,n.datumIndex).opacity??1,uF(this,s,e,e.label,n.label,!1,t))}),this.highlightLabelSelection.update(i).each((s,n)=>{n.label&&(s.fillOpacity=this.getHighlightStyle(!0,n.datumIndex).opacity??1,uF(this,s,e,e.label,n.label,!0,t))})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d,marker:u}=a,p=n.angle,f=n.radius;if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data[e],b=i.resolveKeysById(this,"angleValue",s)[e],x=i.resolveColumnById(this,"radiusValue",s)[e],v=this.properties.allowNullKeys??!1;if(b===void 0&&!v)return;const S=this.getMarkerStyle(u,{datum:y,datumIndex:e},this.getDatumStylerProperties(y),{isHighlight:!1});return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",b,y,o,void 0,v),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",x,y,l,void 0),missing:N.isTooltipValueMissing(x)}]},{seriesId:t,datum:y,title:r,angleKey:o,radiusKey:l,angleName:r,radiusName:c,legendItemName:h,...S})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,marker:n}=this.getStyle();return{marker:{shape:n.shape,enabled:n.enabled||t<=0,fill:this.getMarkerFill()??n.stroke??e??"rgba(0, 0, 0, 0)",stroke:n.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??a??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!r}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:s}=this,{x:n,y:a}=e,o=this.radius;if(Math.hypot(n-i,a-s)>o+this.maxChartMarkerSize)return;let l=1/0,c;for(const h of t){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(u))continue;const p=Math.hypot(e.x-d-i,e.y-u-s);p<l&&(l=p,c=h)}if(c){const h=Math.max(l-(c.point?.size??0)/2,0);return{datum:c,distance:h}}}computeLabelsBBox(){const{label:e}=this.properties;this.maybeRefreshNodeData();const t=[],i=new gie;for(const s of this.nodeData){if(!e.enabled||!s.label)continue;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(e),i.setAlign(s.label);const n=i.getBBox();t.push(n)}return t.length===0?null:die.merge(t)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){this.updatePathNodes()}getPathNodesStyle(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.getHighlightState(e),i=this.getHighlightStyle(void 0,void 0,t),s=this.getStyle(t);return re(i,s)}getLinePoints(){const{nodeData:e,resetInvalidToZero:t}=this,{connectMissingData:i}=this.properties;if(e.length===0)return[];const s=this.axes.radius,a=this.axes.angle?.isReversed(),r=s?.isReversed()&&!a?[...e].reverse():e,l=[];let c=!1,h;for(const[d,u]of r.entries()){let{x:p,y:f}=u.point;const y=Number.isNaN(p)||Number.isNaN(f);y||(h??(h=u)),y&&!i&&(p=0,f=0);const b=d===0||!t&&!i&&(y||c);l.push({x:p,y:f,moveTo:b}),c=y}return h!==void 0&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(e,t,i){const{path:s}=e;s.clear(!0);const n=this.getAxisInnerRadius(),a=this.axes.radius,r=a?.isReversed()?this.radius+n-a?.scale.convert(0):n;for(const l of t){const{x:c,y:h,arc:d,radius:u=0,startAngle:p=0,endAngle:f=0,moveTo:y}=l,b=Math.atan2(h,c),x=r*Math.cos(b),v=r*Math.sin(b),S=i,M=x*(1-S)+c*S,D=v*(1-S)+h*S;d?s.arc(c,h,u,p,f):y?s.moveTo(M,D):s.lineTo(M,D)}e.checkPathDirty()}animatePaths(e){const t=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,t,e)}animateEmptyUpdateReady(){const{itemSelection:e,labelSelection:t}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:s=>this.animatePaths(s),onStop:()=>this.animatePaths(1)}),oie(this,i,"added",this.getAnimationDrawingModes(),e),aie(this,"labels",i,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints(),s=this.getStyle();e.fill=void 0,e.stroke=s.stroke,e.strokeWidth=s.strokeWidth,e.strokeOpacity=s.strokeOpacity,e.lineDash=s.lineDash,e.lineDashOffset=s.lineDashOffset,t.clear(!0);for(const{x:n,y:a,moveTo:o}of i)o?t.moveTo(n,a):t.lineTo(n,a);return e.checkPathDirty(),s}}getStylerResult(e,t){const{styler:i}=this.properties;if(i){const s=this.makeStylerParams(t),n=this.cachedCallWithContext(i,s)??{},a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],n,{pick:!1});a&&(e=a)}return e}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{angleKey:t,radiusKey:i},{isHighlight:!0})}computeFocusBounds(e){return hie(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Tw.className="RadarSeries";var Ow=class extends Ei{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};g([m],Ow.prototype,"fill",2),g([m],Ow.prototype,"fillOpacity",2);var{Group:xie,HighlightState:bie,Path:vie,PointerEvents:pF,Selection:Sie,toHighlightString:Mie}=N,Pw=class extends Tw{constructor(e){super(e),this.properties=new Ow,this.areaGroup=this.contentGroup.appendChild(new xie({name:"radar-area"})),this.areaSelection=Sie.select(this.areaGroup,vie),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){if(e?.fill!=null)return e.fill;const t=this.getStyle();return t.marker.fill??t.fill}updatePathNodes(){const e=this.getPathNodesStyle(),{fill:t,fillOpacity:i,strokeWidth:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:l}=e,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:pF.None,opacity:l,stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r});const h=this.getAreaNode();h&&(h.setStyleProperties({fill:t,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),h.setProperties({lineJoin:"round",pointerEvents:pF.None,opacity:l}))}animatePaths(e){super.animatePaths(e);const t=this.getAreaNode();t&&this.animateSinglePath(t,this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=o=>{const r=this.axes[o];return r instanceof N.PolarAxis?r:void 0},i=t("radius"),s=t("angle");if(!i?.isReversed())return e;const a=s?.getAxisLinePoints()?.points??[];return e.concat(...a)}resetPaths(){const e=super.resetPaths(),t=this.getAreaNode();if(t){const{path:i}=t,s=this.getAreaPoints(),n=e??this.getStyle(),a=this.getShapeFillBBox();t.setStyleProperties({fill:n.fill,stroke:void 0,fillOpacity:n.fillOpacity,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},a),t.lineJoin=t.lineCap="round",i.clear(!0);for(const{x:o,y:r,moveTo:l,arc:c,radius:h=0,startAngle:d=0,endAngle:u=0}of s)c?i.arc(o,r,h,d,u):l?i.moveTo(o,r):i.lineTo(o,r);return i.closePath(),t.checkPathDirty(),n}}makeStylerParams(e){const{properties:t}=this,i=Mie(e??bie.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,fill:t.fill,fillOpacity:t.fillOpacity,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,fill:i,fillOpacity:s,lineDash:n,lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=this.properties,{size:c,shape:h,fill:d="transparent",fillOpacity:u}=t,p=this.getStylerResult({},e);return p.marker??(p.marker={}),{fill:p.fill??i,fillOpacity:p.fillOpacity??s,lineDash:p.lineDash??n,lineDashOffset:p.lineDashOffset??a,stroke:p.stroke??o,strokeOpacity:p.strokeOpacity??r,strokeWidth:p.strokeWidth??l,marker:{enabled:p.marker.enabled??t.enabled,fill:p.marker.fill??d,fillOpacity:p.marker.fillOpacity??u,shape:p.marker.shape??h,size:p.marker.size??c,lineDash:p.marker.lineDash??t.lineDash??n,lineDashOffset:p.marker.lineDashOffset??t.lineDashOffset??a,stroke:p.marker.stroke??t.stroke??o,strokeOpacity:p.marker.strokeOpacity??t.strokeOpacity??r,strokeWidth:p.marker.strokeWidth??t.strokeWidth??l}}}};Pw.className="RadarAreaSeries",Pw.type="radar-area";var{radarAreaSeriesThemeableOptionsDef:Die}=N,Ew={...qe,...Die,type:j(Ae("radar-area")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L};Ew.angleKeyAxis=Q(L),Ew.radiusKeyAxis=Q(L);var gF={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,version:ue,dependencies:[Wr],options:Ew,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:Yte,create:e=>new Pw(e)},{HighlightState:kie,PointerEvents:Iie,toHighlightString:Aie}=N,Rw=class extends Tw{constructor(){super(...arguments),this.properties=new Ei}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const e=this.getLineNode();if(!e)return;const t=this.getPathNodesStyle(),{strokeWidth:i,stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,opacity:r}=t;e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:Iie.None,opacity:r,stroke:s,strokeWidth:i,strokeOpacity:n,lineDash:a,lineDashOffset:o})}makeStylerParams(e){const{properties:t}=this,i=Aie(e??kie.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,lineDash:i,lineDashOffset:s,stroke:n,strokeOpacity:a,strokeWidth:o}=this.properties,{size:r,shape:l,fill:c="transparent",fillOpacity:h}=t,d=this.getStylerResult({},e);return d.marker??(d.marker={}),{lineDash:d.lineDash??i,lineDashOffset:d.lineDashOffset??s,stroke:d.stroke??n,strokeOpacity:d.strokeOpacity??a,strokeWidth:d.strokeWidth??o,marker:{enabled:d.marker.enabled??t.enabled,fill:d.marker.fill??c,fillOpacity:d.marker.fillOpacity??h,shape:d.marker.shape??l,size:d.marker.size??r,lineDash:d.marker.lineDash??t.lineDash??i,lineDashOffset:d.marker.lineDashOffset??t.lineDashOffset??s,stroke:d.marker.stroke??t.stroke??n,strokeOpacity:d.marker.strokeOpacity??t.strokeOpacity??a,strokeWidth:d.marker.strokeWidth??t.strokeWidth??o}}}};Rw.className="RadarLineSeries",Rw.type="radar-line";var{radarLineSeriesThemeableOptionsDef:Cie}=N,zw={...qe,...Cie,type:j(Ae("radar-line")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L};zw.angleKeyAxis=Q(L),zw.radiusKeyAxis=Q(L);var fF={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,version:ue,dependencies:[Wr],options:zw,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:Ute,create:e=>new Rw(e)},{SeriesProperties:wie,makeSeriesTooltip:Lie,Label:Nie}=N,ni=class extends wie{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Nie,this.tooltip=Lie()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};g([m],ni.prototype,"angleKey",2),g([m],ni.prototype,"radiusKey",2),g([m],ni.prototype,"angleName",2),g([m],ni.prototype,"radiusName",2),g([m],ni.prototype,"angleKeyAxis",2),g([m],ni.prototype,"radiusKeyAxis",2),g([m],ni.prototype,"legendItemName",2),g([m],ni.prototype,"fill",2),g([m],ni.prototype,"fillOpacity",2),g([m],ni.prototype,"stroke",2),g([m],ni.prototype,"strokeWidth",2),g([m],ni.prototype,"strokeOpacity",2),g([m],ni.prototype,"lineDash",2),g([m],ni.prototype,"lineDashOffset",2),g([m],ni.prototype,"cornerRadius",2),g([m],ni.prototype,"styler",2),g([m],ni.prototype,"itemStyler",2),g([m],ni.prototype,"rotation",2),g([m],ni.prototype,"stackGroup",2),g([m],ni.prototype,"normalizedTo",2),g([m],ni.prototype,"label",2),g([m],ni.prototype,"tooltip",2);var{SectorBox:mF,motion:Tie}=N;function Oie(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.innerRadius)||Number.isNaN(e.previousDatum.outerRadius))return"added";if(Number.isNaN(t.innerRadius)||Number.isNaN(t.outerRadius))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function yF(e){return{toFn:(s,n,a)=>{let o,r,l,c,h;return a==="removed"?(o=e,r=e,l=n.innerRadius,c=n.outerRadius,h=new mF(o,r,l,c)):(o=n.startAngle,r=n.endAngle,l=Number.isNaN(n.innerRadius)?s.innerRadius:n.innerRadius,c=Number.isNaN(n.outerRadius)?s.outerRadius:n.outerRadius,h=n.clipSector),{startAngle:o,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,n,a)=>{a=Oie(s,n,a);let o,r,l,c,h;a==="removed"||a==="updated"?(o=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(o=e,r=e,l=n.innerRadius,c=n.outerRadius),h??(h=new mF(o,r,l,c));const d=Tie.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:o,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function Pie(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:Eie,DEFAULT_POLAR_DIRECTION_NAMES:Rie,PolarAxis:zie,diff:Vie,groupAccumulativeValueProperty:xF,keyProperty:Bie,normaliseGroupTo:Fie,valueProperty:_ie,fixNumericExtent:Hie,resetLabelFn:Gie,seriesLabelFadeInAnimation:jie,seriesLabelFadeOutAnimation:Wie,animationValidation:$ie,createDatumId:Kie,CategoryScale:Uie,Sector:Yie,SectorBox:Zie,motion:bF,updateLabelNode:vF,getItemStyles:Xie}=N,qie=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},Vw=class extends N.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:Eie,propertyNames:Rie,canHaveAxes:!0,animationResetFns:{item:Pie,label:Gie}}),this.properties=new ni,this.NodeEvent=qie,this.groupScale=new Uie,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new Yie}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e==="angle"){const s=t.getDomain(this,"angleValue-end","value",i).domain,n=[Math.min(s[0],0),Math.max(s[1],0)];return{domain:Hie(n)}}else return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),o=`${a}-trailing`,r=[];Mt(s)&&r.push(Fie([a,o],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&r.push(Vie(this.id,this.processedData)),n&&r.push($ie());const l=this.visible?{}:{forceValue:0},c=this.axes.radius?.scale.type,h=this.axes.angle?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[Bie(i,c,{id:"radiusValue",allowNullKey:d}),_ie(t,h,{id:"angleValue-raw",invalidValue:null,...l}),...xF(t,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...xF(t,"trailing",{id:"angleValue-start",invalidValue:null,groupId:o,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes.radius;return e instanceof zie?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||e?.type!=="grouped")return;const i=this.axes.angle,s=this.axes.radius,n=i?.scale,a=s?.scale;if(!n||!a)return;const o=t.resolveKeysById(this,"radiusValue",e),r=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof Jh&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:f}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:f}).map((B,F)=>String(F)),u.range=[0,Math.abs(a.bandwidth??0)],u.paddingInner=f>1?d:0;const y=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,b=i.isReversed(),x=s.isReversed(),v=x?this.radius:this.getAxisInnerRadius(),M=(x?this.getAxisInnerRadius():this.radius)+v,D=this.getSeriesDomain("angle").domain,{angleKey:I,radiusKey:k,angleName:C,radiusName:A,legendItemName:w,label:T}=this.properties,O=(B,F,Y,Z)=>{const ie=this.getLabelText(F,B,I,"angle",D,T,{value:F,datum:B,angleKey:I,radiusKey:k,angleName:C,radiusName:A,legendItemName:w});if(ie)return{x:Y,y:Z,text:ie,textAlign:"center",textBaseline:"middle"}},z=[],V=Xie((B,F,Y)=>Bp(this,B,F,Y)),E={itemId:k,nodeData:z,labelData:z,styles:V};if(!this.visible)return E;const{dataSources:_}=e,G=_.get(this.id)?.data??[];for(const{datumIndex:B,group:F}of t.forEachGroupDatum(this,e)){const Y=G[B],Z=o[B];if(Z===void 0&&!this.properties.allowNullKeys)return;const ie=c[B],ee=r[B],he=l[B],Me=ie>=0&&!Object.is(ie,-0),Ce=F.aggregation[h][Me?1:0],xe=Me===b;let Ge=n.convert(ee,{clamp:!0}),je=n.convert(he,{clamp:!0}),dt=n.convert(0,{clamp:!0}),Ze=n.convert(Ce,{clamp:!0});xe&&([dt,Ze]=[Ze,dt],[Ge,je]=[je,Ge]);const Ie=M-a.convert(Z)+u.convert(String(p)),pe=Ie+y,yt=(Ie+pe)/2,xt=Ge+_a(Ge,je)/2,ut=Math.cos(xt)*yt,bt=Math.sin(xt)*yt,vt=this.properties.label.enabled?O(Y,ie,ut,bt):void 0,Si=new Zie(Ge,je,Ie,pe);z.push({series:this,datum:Y,datumIndex:B,point:{x:ut,y:bt,size:0},midPoint:{x:ut,y:bt},label:vt,angleValue:ie,radiusValue:Z,innerRadius:Ie,outerRadius:pe,startAngle:dt,endAngle:Ze,clipSector:Si,reversed:xe,index:B})}return E}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){let i=[];const s=this.ctx.highlightManager?.getActiveHighlight();t?s?.datum&&s.series===this&&i.push(s):i=this.nodeData;const{contextNodeData:n}=this;if(!n)return;const a=this.ctx.highlightManager.getActiveHighlight(),o=this.getShapeFillBBox(),r=this.hasItemStylers();e.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const h=om(c);if(h==null)return;if(r){const y=this.getHighlightState(s,t,c.datumIndex);c.style=Bp(this,c,t,y)}const d=c.style??n.styles[this.getHighlightState(a,t,c.datumIndex)],u=d.cornerRadius,p=d.fill,f=Qt(p)&&p.bounds!=="item"?{centerX:0,centerY:0}:void 0;l.setStyleProperties(d,o,f),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=h.reversed?u:0,l.startOuterCornerRadius=h.reversed?u:0,l.endInnerCornerRadius=h.reversed?0:u,l.endOuterCornerRadius=h.reversed?0:u,t&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.clipSector=c.clipSector,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius)})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?t:void 0,s=i?[i]:[];this.labelSelection.update(this.nodeData).each((n,a)=>{vF(this,n,e,e.label,a.label,!1,t),n.fillOpacity=this.getHighlightStyle(!1,a.datumIndex).opacity??1}),this.highlightLabelSelection.update(s,void 0,n=>this.getDatumId(n)).each((n,a)=>{vF(this,n,e,e.label,a.label,!0,t),n.fillOpacity=this.getHighlightStyle(!0,a.datumIndex).opacity??1})}getBarTransitionFunctions(){const e=this.axes.angle?.scale;let t=0;if(!e)return yF(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),yF(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();bF.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),jie(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();bF.fromToMotion(this.id,"datums",t,[e],i),Wie(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=a,u=n.angle,p=n.radius,f=this.nodeData?.[e];if(!i||!s||!u||!p||!f)return;const y=s.dataSources.get(this.id)?.data[e],b=i.resolveKeysById(this,"radiusValue",s)[e],x=i.resolveColumnById(this,"angleValue-raw",s)[e];if(b===void 0&&!this.properties.allowNullKeys)return;const v=Bp(this,f,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",b,y,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:o,value:this.getAxisValueText(u,"tooltip",x,y,o,void 0),missing:N.isTooltipValueMissing(x)}]},{seriesId:t,datum:y,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...v})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=Aw(this,!1,N.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o};return Qt(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{angleKey:s,angleName:n,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:a??n??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}getDatumId(e){return Kie(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};Vw.className="RadialBarSeries",Vw.type="radial-bar";var{radialBarSeriesThemeableOptionsDef:Qie}=N,Bw={...qe,...Qie,type:j(Ae("radial-bar")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L,grouped:R,stacked:R,stackGroup:L,normalizedTo:W};Bw.angleKeyAxis=Q(L),Bw.radiusKeyAxis=Q(L);var Jie={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",W0],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:Us},axes:{"radius-category":{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},SF={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:ue,dependencies:[Wr],options:Bw,defaultAxes:{angle:{type:"angle-number"},radius:{type:"radius-category"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:Jie,create:e=>new Vw(e)},Fw=class extends Yt{};g([m],Fw.prototype,"columnWidthRatio",2),g([m],Fw.prototype,"maxColumnWidthRatio",2);var{PolarAxis:ese,RadialColumnShape:tse,getRadialColumnWidth:ise}=N,_w=class extends oF{constructor(e){super(e,{animationResetFns:{item:Fte}}),this.properties=new Fw}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new tse}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Bte(e)}isRadiusAxisCircle(){const e=this.axes.radius;return e instanceof ese?e.shape==="circle":!1}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return ise(e,t,this.radius,i,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};_w.className="RadialColumnSeries",_w.type="radial-column";var{radialColumnSeriesThemeableOptionsDef:sse}=N,Hw={...qe,...sse,type:j(Ae("radial-column")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L,grouped:R,stacked:R,stackGroup:L,normalizedTo:W};Hw.angleKeyAxis=Q(L),Hw.radiusKeyAxis=Q(L);var nse={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",my],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Us},axes:{"angle-category":{shape:{$findFirstSiblingNotOperation:"circle"},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},"radius-number":{shape:{$findFirstSiblingNotOperation:"circle"},innerRadiusRatio:.5}}},MF={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:ue,dependencies:[Wr],options:Hw,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:nse,create:e=>new _w(e)},DF=[hE,YB,UB,tF,eF,cF,gF,fF,SF,MF,Uf,am,Bv,cS].flat(),{Chart:ase,MercatorScale:kF}=N;function ose(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var xS=class extends ase{constructor(e,t){super(e,t),this.xAxis={id:Ii(N.Axis),direction:"x"},this.yAxis={id:Ii(N.Axis),direction:"y"},this.ctx.zoomManager.setAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}updateData(){super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const i of this.series)ose(i)&&i.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,s=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=s,this.animationRect=s;const n=this.series,a=n.reduce((l,c)=>{if(!c.visible)return l;const h=c.topologyBounds;return h==null?l:l==null?h:l.merge(h)},void 0);let o;if(a!=null){const{lon0:l,lat0:c,lon1:h,lat1:d}=a,u=[[l,c],[h,d]],p=kF.bounds(u),{width:f,height:y}=s,b=Math.min(f/p.width,y/p.height),x=p.width*b,v=p.height*b,S=(f-x)/2,M=(y-v)/2,D=S,I=M,k=S+x,C=M+v,A=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),w=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),T=(k-D)/(A.max-A.min),O=D-T*A.min,z=(C-I)/(1-w.min-(1-w.max)),V=I-z*(1-w.max);o=new kF(u,[[O,V],[O+T,V+z]])}for(const l of n)l.scale=o;const r=this.series.some(l=>l.visible);t.visible=r;for(const l of[t,i])l.translationX=Math.floor(s.x),l.translationY=Math.floor(s.y),l.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:r,rect:s,paddedRect:e.layoutBox}})}};xS.className="TopologyChart",xS.type="topology",g([m],xS.prototype,"topology",2);var{topologyChartOptionsDefs:rse}=N,Sm={type:"chart",name:"topology",enterprise:!0,version:ue,options:rse,create(e,t){return new xS(e,t)}},Mm={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1}};function Jo(e){const t=Te(e);return ko(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}var lse=1e-9;function IF(e,t,i,s){const[n,a]=e,[o,r]=t,l=o-n,c=r-a,h=l*l+c*c;let d,u;if(Math.abs(h)<lse)d=n,u=a;else{let y=((i-n)*l+(s-a)*c)/h;y=Math.max(0,Math.min(1,y)),d=n+y*(o-n),u=a+y*(r-a)}const p=i-d,f=s-u;return p*p+f*f}function AF(e,t,i){let s=1/0,n=e.at(-1);for(const a of e)s=Math.min(s,IF(n,a,t,i)),n=a;return Math.sqrt(s)}function Gw(e){let[t,i]=e[0],s=0;for(let n=1;n<e.length;n+=1){const[a,o]=e[n],r=Math.hypot(a-t,o-i);s+=r,t=a,i=o}return s}function bS(e){if(e.length===0)return;const t=Gw(e)/2;let[i,s]=e[0],n=0;for(let a=1;a<e.length;a+=1){const[o,r]=e[a],l=Math.hypot(o-i,r-s),c=n+l;if(c>t){const h=(t-n)/l,d=[i+(o-i)*h,s+(r-s)*h],u=Math.atan2(r-s,o-i);return{point:d,angle:u}}n=c,i=o,s=r}}var Dm=class C_{constructor(t,i,s,n){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=n}extend(t,i,s,n){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,s),this.lat1=Math.max(this.lat1,n),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,s,n,a){return t?t.extend(i,s,n,a):new C_(i,s,n,a)}};function Fp(e,t){for(const i of e){const[s,n]=i;t=Dm.extend(t,s,n,s,n)}return t}function cse(e){if(e.length===0)return;let t=0,i=0,s=0,[n,a]=e.at(-1);for(const[o,r]of e){const l=n*r-o*a;s+=l,t+=(n+o)*l,i+=(a+r)*l,n=o,a=r}return s*=3,[t/s,i/s]}function vS(e,t,i){let s=!1,n=1/0;for(const a of e){let o=a.at(-1),[r,l]=o;for(const c of a){const[h,d]=c;d>i!=l>i&&t<(r-h)*(i-d)/(l-d)+h&&(s=!s),n=Math.min(n,IF(o,c,t,i)),o=c,r=h,l=d}}return(s?-1:1)*Math.sqrt(n)}var{Path:hse,ExtendedPath2D:dse,BBox:use}=N,_p=class extends hse{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new dse}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=e==null?void 0:this.drawGeometry(e,void 0)}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(e,t)?!1:this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,e,t);return s>0?s*s:0}geometryDistance(e,t,i){const{renderMode:s,strokeWidth:n}=this,a=(s&1)!==0,o=(s&2)!==0,r=Math.max(n/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,t,i)),1/0);case"MultiPolygon":return a?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(vS(c,t,i),0)),1/0):1/0;case"Polygon":return a?Math.max(vS(e.coordinates,t,i),0):1/0;case"MultiLineString":return o?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(AF(c,t,i)-r,0)),1/0):1/0;case"LineString":return o?Math.max(AF(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}shouldDrawPolygons(){return(this.renderMode&1)!==0}shouldDrawLines(){return(this.renderMode&2)!==0}drawGeometryCollection(e,t){for(const i of e)t=this.drawGeometry(i,t);return t}drawMultiPolygon(e,t){if(!this.shouldDrawPolygons())return t;for(const i of e)t=this.drawPolygon(this.path,i,t);return t}drawSinglePolygon(e,t){return this.shouldDrawPolygons()?this.drawPolygon(this.path,e,t):t}drawMultiLineString(e,t){if(!this.shouldDrawLines())return t;for(const i of e)t=this.drawLineString(this.strokePath,i,t,!1);return t}drawSingleLineString(e,t){return this.shouldDrawLines()?this.drawLineString(this.strokePath,e,t,!1):t}drawGeometry(e,t){switch(e.type){case"GeometryCollection":return this.drawGeometryCollection(e.geometries,t);case"MultiPolygon":return this.drawMultiPolygon(e.coordinates,t);case"Polygon":return this.drawSinglePolygon(e.coordinates,t);case"MultiLineString":return this.drawMultiLineString(e.coordinates,t);case"LineString":return this.drawSingleLineString(e.coordinates,t);case"Point":case"MultiPoint":return t}}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let s=1;s<t.length;s+=1){const n=t[s];this.drawLineString(e,n,void 0,!0)}return i}drawLineString(e,t,i,s){if(t.length<2)return i;const n=s?t.length-1:t.length;for(let a=0;a<n;a+=1){const[o,r]=t[a];if(a===0?e.moveTo(o,r):e.lineTo(o,r),i==null)i=new use(o,r,0,0);else{const{x:l,y:c}=i,h=l+i.width,d=c+i.height;i.x=Math.min(l,o),i.y=Math.min(c,r),i.width=Math.max(h,o)-i.x,i.height=Math.max(d,r)-i.y}}return s&&e.closePath(),i}};g([Or({equals:Ht})],_p.prototype,"projectedGeometry",2),g([$()],_p.prototype,"renderMode",2);function CF(e){const t=Fp(e[0],void 0);return t==null?0:Math.abs(t.lat1-t.lat0)*Math.abs(t.lon1-t.lon0)}function SS(e,t){let i,s;for(const n of e){const a=t(n);a!=null&&(i==null||a>i)&&(i=a,s=n)}return s}function Hp(e,t){if(e.bbox!=null){const[i,s,n,a]=e.bbox;return t=Dm.extend(t,i,s,n,a),t}switch(e.type){case"GeometryCollection":for(const i of e.geometries)t=Hp(i,t);break;case"MultiPolygon":for(const i of e.coordinates)i.length>0&&(t=Fp(i[0],t));break;case"Polygon":e.coordinates.length>0&&(t=Fp(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=Fp(i,t);break;case"LineString":t=Fp(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[s,n]=i;t=Dm.extend(t,s,n,s,n)}break;case"Point":{const[i,s]=e.coordinates;t=Dm.extend(t,i,s,i,s);break}}return t}function MS(e){switch(e.type){case"Polygon":return e.coordinates;case"MultiPolygon":return SS(e.coordinates,CF);case"GeometryCollection":{const t=e.geometries.map(MS).filter(i=>i!=null);return SS(t,CF)}case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function DS(e){switch(e.type){case"LineString":return e.coordinates;case"MultiLineString":return SS(e.coordinates,Gw);case"GeometryCollection":{const t=e.geometries.map(DS).filter(i=>i!=null);return SS(t,Gw)}case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function jw(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>jw(i,t));case"MultiPolygon":case"Polygon":return(t&1)!==0;case"MultiLineString":case"LineString":return(t&2)!==0;case"MultiPoint":case"Point":return(t&4)!==0}}function td(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>td(i,t))};case"Polygon":return{type:"Polygon",coordinates:Ww(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:pse(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:Ww(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:$w(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:$w(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function pse(e,t){return e.map(i=>Ww(i,t))}function Ww(e,t){return e.map(i=>$w(i,t))}function $w(e,t){return e.map(i=>t.convert(i))}var bne=class extends N.SeriesProperties{},km=class extends N.DataModelSeries{constructor(e){super(e),this.cleanup.register(this.ctx.eventsHub.on("data:update",()=>{}),this.ctx.eventsHub.on("legend:item-click",t=>{this.onLegendItemClick(t)}),this.ctx.eventsHub.on("legend:item-double-click",t=>{this.onLegendItemDoubleClick(t)}))}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:t}=this.properties,i=t!=null&&e?.datum==null&&t===e?.legendItemName;return e!=null&&(e.series!==this&&!i||e.datum==null)&&(e=void 0),e}},{SeriesProperties:gse,makeSeriesTooltip:fse}=N,wc=class extends gse{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=fse()}};g([m],wc.prototype,"topology",2),g([m],wc.prototype,"stroke",2),g([m],wc.prototype,"strokeOpacity",2),g([m],wc.prototype,"strokeWidth",2),g([m],wc.prototype,"lineDash",2),g([m],wc.prototype,"lineDashOffset",2),g([m],wc.prototype,"tooltip",2);var{createDatumId:mse,Group:yse,Selection:xse,PointerEvents:wF}=N,Kw=class extends km{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new wc,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new yse({name:"itemGroup"})),this.datumSelection=xse.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=wF.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new _p;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=wF.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:Hp(s,t)},void 0),e==null&&K.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,strokeWidth:l}=s,c=[],h=[];for(const[d,u]of t.features.entries()){const{geometry:p}=u,f=p!=null&&i!=null?td(p,i):void 0;f!=null&&c.push({series:this,datum:u,datumIndex:0,index:d,projectedGeometry:f,style:{stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,strokeWidth:l}})}return{itemId:e,nodeData:c,labelData:h}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>mse(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:n}=s;if(n==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=n,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};Kw.className="MapLineBackgroundSeries",Kw.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:bse}=N,vse={...bse,type:j(Ae("map-line-background")),topology:Ll},LF={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,version:ue,dependencies:[Sm],options:vse,themeTemplate:{...Mm,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}},create:e=>new Kw(e)};function Sse(){return{fromFn:(i,s,n)=>n==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,n)=>n==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function NF(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(i!==void 0){for(const s of e.datumSelection.nodes())if(s.datum===i)return s}}var{SeriesProperties:Mse,makeSeriesTooltip:Dse,Label:kse}=N,Zt=class extends Mse{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new kse,this.tooltip=Dse()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n,opacity:1}}};g([m],Zt.prototype,"topology",2),g([m],Zt.prototype,"title",2),g([m],Zt.prototype,"legendItemName",2),g([m],Zt.prototype,"idKey",2),g([m],Zt.prototype,"topologyIdKey",2),g([m],Zt.prototype,"idName",2),g([m],Zt.prototype,"labelKey",2),g([m],Zt.prototype,"labelName",2),g([m],Zt.prototype,"sizeKey",2),g([m],Zt.prototype,"sizeName",2),g([m],Zt.prototype,"colorKey",2),g([m],Zt.prototype,"colorName",2),g([m],Zt.prototype,"sizeDomain",2),g([m],Zt.prototype,"colorRange",2),g([m],Zt.prototype,"maxStrokeWidth",2),g([m],Zt.prototype,"stroke",2),g([m],Zt.prototype,"strokeOpacity",2),g([m],Zt.prototype,"strokeWidth",2),g([m],Zt.prototype,"lineDash",2),g([m],Zt.prototype,"lineDashOffset",2),g([m],Zt.prototype,"itemStyler",2),g([m],Zt.prototype,"label",2),g([m],Zt.prototype,"tooltip",2);var{getMissCount:Ise,getLabelStyles:Ase,createDatumId:TF,SeriesNodePickMode:OF,valueProperty:Im,ColorScale:Cse,LinearScale:wse,Selection:kS,Text:PF,Transformable:Lse}=N,Uw=class extends km{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[OF.EXACT_SHAPE_MATCH,OF.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Zt,this._chartTopology=void 0,this.colorScale=new Cse,this.sizeScale=new wse,this.datumSelection=kS.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=kS.select(this.labelGroup,PF),this.highlightDatumSelection=kS.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=kS.select(this.highlightLabelGroup,PF),this.placedLabelData=[],this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new _p;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:a,idKey:o,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,u=new Map;for(const S of i?.features.values()??[]){const M=S.properties?.[a];M==null||!jw(S.geometry,2)||u.set(M,S)}const p=this.sizeScale.type,f=this.colorScale.type,y=this.scale?.type,{dataModel:b,processedData:x}=await this.requestDataModel(e,t,{props:[Im(o,y,{id:"idValue",includeProperty:!1}),Im(o,y,{id:"featureValue",includeProperty:!1,processor:()=>S=>u.get(S)}),...c==null?[]:[Im(c,"category",{id:"labelValue"})],...r==null?[]:[Im(r,p,{id:"sizeValue"})],...l==null?[]:[Im(l,f,{id:"colorValue"})]]}),v=b.resolveColumnById(this,"featureValue",x);if(this.topologyBounds=v.reduce((S,M)=>{const D=M?.geometry;return D==null?S:Hp(D,S)},void 0),r!=null){const S=b.resolveProcessedDataIndexById(this,"sizeValue"),M=x.domain.values[S]??[];s.domain=h??M}if(d!=null&&this.isColorScaleValid()){const S=b.resolveProcessedDataIndexById(this,"colorValue");n.domain=x.domain.values[S],n.range=d,n.update()}i==null&&K.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=Ise(this,i.defs.values[s].missing);return!(n===0||n===a)}getLabelDatum(e,t,i,s,n,a){if(s==null||n==null||i==null)return;const o=DS(n);if(o==null)return;const{idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f,label:y}=this.properties;if(p==null||!y.enabled)return;const b=this.getLabelText(s,e,p,"label",[],y,{value:s,datum:e,idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f});if(b==null)return;const x=a.measureLines(String(b)),v=bS(o);if(v==null)return;const[S,M]=v.point,{width:D,height:I}=x;return{point:{x:S,y:M,size:0},label:{width:D,height:I,text:b},anchor:void 0,placement:void 0,datumIndex:t,idValue:i}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveLineDataColumns(e){const{sizeKey:t,colorKey:i,labelKey:s}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e),labelValues:this.resolveColumn(s,"labelValue",e),sizeValues:this.resolveColumn(t,"sizeValue",e),colorValues:this.resolveColumn(i,"colorValue",e)}}prepareProjectedLineGeometries(e,t,i){const s=new Map;for(const[n]of i.dataSources.get(this.id)?.data.entries()??[]){const a=e[n],o=t[n]?.geometry,r=o!=null&&this.scale!=null?td(o,this.scale):void 0;a!=null&&r!=null&&s.set(a,r)}return s}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}K.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n}=this,{label:a,legendItemName:o,colorKey:r}=n;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const l=this.resolveLineDataColumns(i),c=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,c),c];const h=et(a),d=this.prepareProjectedLineGeometries(l.idValues,l.featureValues,i),u=[],p=[],f=[],y=i.dataSources.get(this.id)?.data??[];for(const[b,x]of y.entries()){const v={idValue:l.idValues[b],colorValue:l.colorValues?.[b],sizeValue:l.sizeValues?.[b],labelValue:l.labelValues?.[b]},S=d.get(v.idValue);if(S==null&&f.push(v.idValue),r!=null&&v.colorValue==null)continue;const M=this.getLabelDatum(x,b,v.idValue,v.labelValue,S,h);M!=null&&p.push(M),u.push({series:this,datum:x,datumIndex:b,...v,projectedGeometry:S,legendItemName:o,style:this.getItemStyle({datumIndex:b,datum:x,colorValue:v.colorValue,sizeValue:v.sizeValue},!1)})}return this.warnMissingGeometries(f),{itemId:e,nodeData:u,labelData:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const i=this.ctx.chartService.highlight?.drawingMode??"overlay",s=this.getHighlightedDatum(),n=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1,drawingMode:"overlay"}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s==null?[]:[s],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0,drawingMode:i}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(s)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>TF(t.idValue))}getItemStyle({datumIndex:e=0,datum:t,colorValue:i,sizeValue:s},n){const{properties:a,colorScale:o,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,h=a.getStyle();i!=null&&(h.stroke=this.isColorScaleValid()?o.convert(i):l?.[0]??a.stroke);const d=this.getHighlightStyle(n,e),u=re(d,h);s!=null&&(u.strokeWidth=r.convert(s,{clamp:!0}));let p;return c!=null&&(p=this.cachedDatumCallback(TF(e,n?"highlight":"node"),()=>{const f=this.makeItemStylerParams(t,e,n,u);return this.callWithContext(c,f)})),p?re(u,p):u}makeItemStylerParams(e,t,i,s){const{id:n}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,i,t);return{seriesId:n,datum:e,highlightState:o,...s}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){e.each((i,s)=>{const{projectedGeometry:n,style:a}=s;if(n==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=n,i.setProperties(a),i.drawingMode=t})}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=N.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.getHighlightedDatum();t.each((n,a)=>{const{x:o,y:r,width:l,height:c,text:h,datum:d}=a,u=Ase(this,void 0,i,i.label,e,s),{color:p,fontStyle:f,fontWeight:y,fontSize:b,fontFamily:x}=u;n.visible=!0,n.x=o+l/2,n.y=r+c/2,n.text=h,n.fill=p,n.fontStyle=f,n.fontWeight=y,n.fontSize=b,n.fontFamily=x,n.textAlign="center",n.textBaseline="middle";const v=d?.datumIndex;n.fillOpacity=this.getHighlightStyle(e,v).opacity??1,n.setBoxing(u)})}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=e?.idValue,i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(s=>s.datum.idValue===t);this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0&&this.highlightLabelSelection.cleanup(),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(e,t);o<i&&(i=o,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=i==null?void 0:DS(i),n=s==null?void 0:bS(s)?.point,a=n==null?void 0:{x:n[0],y:n[1]};return this._previousDatumMidPoint={datum:e,point:a},a}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{strokeWidth:n,strokeOpacity:a,lineDash:o}=s;let{stroke:r}=s;if(e!=null&&this.isColorScaleValid()){const c=t.resolveColumnById(this,"colorValue",i)[e];c!=null&&(r=this.colorScale.convert(c))}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{enabled:!0,stroke:r,strokeWidth:n,strokeOpacity:a,lineDash:o}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:n}=this,{title:a,legendItemName:o,idKey:r,idName:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const u=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:u}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:o??a??l??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:a}}=this,{idKey:o,idName:r,colorKey:l,colorName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,title:f,legendItemName:y,tooltip:b}=n;if(!i||!s)return;const x=s.dataSources.get(this.id)?.data[e],v=i.resolveColumnById(this,"idValue",s),S=h==null?void 0:i.resolveColumnById(this,"sizeValue",s)[e],M=l==null?void 0:i.resolveColumnById(this,"colorValue",s)[e];if(l!=null&&M==null)return;const D=[];if(this.isLabelEnabled()&&u!=null&&u!==o){const k=i.resolveColumnById(this,"labelValue",s)[e],C=a.format(this.callWithContext.bind(this),{type:"category",value:k,datum:x,seriesId:t,legendItemName:y,key:u,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});D.push({label:p,fallbackLabel:u,value:C??k})}if(S!=null&&h!=null){const k=i.getDomain(this,"sizeValue","value",s).domain,C=a.format(this.callWithContext.bind(this),{type:"number",value:S,datum:x,seriesId:t,legendItemName:y,key:h,source:"tooltip",property:"size",domain:k,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});D.push({label:d,fallbackLabel:h,value:C??String(S)})}if(M!=null&&l!=null){const k=i.getDomain(this,"colorValue","value",s).domain,C=a.format(this.callWithContext.bind(this),{type:"number",value:M,datum:x,seriesId:t,legendItemName:y,key:l,source:"tooltip",property:"color",domain:k,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});D.push({label:c,fallbackLabel:l,value:C??String(M)})}const I=this.getItemStyle({datumIndex:e,datum:x,colorValue:M,sizeValue:S},!1);return this.formatTooltipWithContext(b,{heading:v[e],title:f??y,symbol:this.legendItemSymbol(e),data:D},{seriesId:t,datum:x,title:f,idKey:o,idName:r,colorKey:l,colorName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,...I})}computeFocusBounds(e){const t=NF(this,e);return t?Lse.toCanvas(this.contentGroup,t.getBBox()):void 0}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Uw.className="MapLineSeries",Uw.type="map-line";var{mapLineSeriesThemeableOptionsDef:Nse}=N,EF={...J(qe,["highlightStyle","highlight"]),...Nse,type:j(Ae("map-line")),idKey:j(L),sizeKey:L,colorKey:L,labelKey:L,idName:L,sizeName:L,colorName:L,labelName:L,topology:Ll,topologyIdKey:L,legendItemName:L,title:L};EF.colorRange=Q(Fe(me(te),rr(1)));var RF={type:"series",name:"map-line",chartType:"topology",enterprise:!0,version:ue,dependencies:[Sm],options:EF,themeTemplate:{...Mm,series:{stroke:Jo(yr),colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Jo(yo)]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Jo(Us)},tooltip:{range:"exact"}},create:e=>new Uw(e)};function zF(e,t,i){const s=Fp(e[0],void 0);if(s==null)return;const n=(s.lon0+s.lon1)/2,a=(s.lat0+s.lat1)/2,o=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=cse(e[0]),[c,h]=l,d=-vS(e,c,h);let u;const p=(D,I)=>{const C=Math.max(I-d,0);return D-.5*C},f=(D,I,k)=>{const{distance:C,maxDistance:A}=i(e,D,I,k),w=Math.hypot(c-D,h-I),T=Math.min(Math.max(c,D-k/2),D+k/2),O=Math.min(Math.max(h,I-k/2),I+k/2),z=Math.hypot(c-T,h-O),V=p(C,w),E=p(A,z);return{distance:C,maxDistance:A,value:V,maxValue:E,x:D,y:I,stride:k}},y=(D,I,k,C)=>{const A=f(I,k,C);A.maxDistance>=0&&D.push(A)},b=Math.min(o,r)/2;let x={value:f(n,a,b),next:null};for(;x!=null;){const D=x.value,{distance:I,value:k,maxValue:C,x:A,y:w,stride:T}=D;if(x=x.next,I>0&&(u==null||k>u.value)&&(u=D),u!=null&&C-u.value<=t)continue;const O=T/2,z=[];y(z,A-O,w-O,O),y(z,A+O,w-O,O),y(z,A-O,w+O,O),y(z,A+O,w+O,O),z.sort(VF),x=tx(x,z,VF)}if(u==null)return;const{distance:v,x:S,y:M}=u;return{x:S,y:M,distance:v}}var VF=(e,t)=>t.maxValue-e.maxValue;function Yw(e,t){const i=zF(e,t,(a,o,r,l)=>{const c=-vS(a,o,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:n}=i;return[s,n]}function BF(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(s=>BF(s,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const s=MS(e);i=s==null?void 0:Yw(s,t);break}case"Polygon":{const s=e.coordinates;i=s==null?void 0:Yw(s,t);break}case"MultiLineString":{const s=DS(e);i=s==null?void 0:bS(s)?.point;break}case"LineString":{const s=e.coordinates;i=bS(s)?.point;break}}return i==null?[]:[i]}var{BBox:Tse}=N;function FF(e){if(!e)return;const{range:t}=e,i=t[0][0],s=t[0][1],n=t[1][0]-i,a=t[1][1]-s,o=new Tse(i,s,n,a);return{series:o,axis:o}}var{SeriesProperties:Ose,makeSeriesTooltip:Pse,Label:Ese}=N,_F=class extends Ese{constructor(){super(...arguments),this.placement="bottom"}};g([m],_F.prototype,"placement",2);var ht=class extends Ose{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new _F,this.tooltip=Pse()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,opacity:1,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}};g([m],ht.prototype,"topology",2),g([m],ht.prototype,"title",2),g([m],ht.prototype,"legendItemName",2),g([m],ht.prototype,"idKey",2),g([m],ht.prototype,"topologyIdKey",2),g([m],ht.prototype,"idName",2),g([m],ht.prototype,"latitudeKey",2),g([m],ht.prototype,"latitudeName",2),g([m],ht.prototype,"longitudeKey",2),g([m],ht.prototype,"longitudeName",2),g([m],ht.prototype,"labelKey",2),g([m],ht.prototype,"labelName",2),g([m],ht.prototype,"sizeKey",2),g([m],ht.prototype,"sizeName",2),g([m],ht.prototype,"colorKey",2),g([m],ht.prototype,"colorName",2),g([m],ht.prototype,"colorRange",2),g([m],ht.prototype,"shape",2),g([m],ht.prototype,"size",2),g([m],ht.prototype,"maxSize",2),g([m],ht.prototype,"sizeDomain",2),g([m],ht.prototype,"fill",2),g([m],ht.prototype,"fillOpacity",2),g([m],ht.prototype,"stroke",2),g([m],ht.prototype,"strokeWidth",2),g([m],ht.prototype,"strokeOpacity",2),g([m],ht.prototype,"lineDash",2),g([m],ht.prototype,"lineDashOffset",2),g([m],ht.prototype,"itemStyler",2),g([m],ht.prototype,"label",2),g([m],ht.prototype,"tooltip",2);var{fromToMotion:Rse,getMissCount:zse,createDatumId:IS,SeriesNodePickMode:HF,valueProperty:id,computeMarkerFocusBounds:Vse,ColorScale:Bse,LinearScale:Fse,Group:_se,Selection:AS,Text:GF,Marker:Zw,getLabelStyles:Hse}=N,Xw=class extends km{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[HF.EXACT_SHAPE_MATCH,HF.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new ht,this._chartTopology=void 0,this.colorScale=new Bse,this.sizeScale=new Fse,this.markerGroup=this.contentGroup.appendChild(new _se({name:"markerGroup"})),this.labelSelection=AS.select(this.labelGroup,GF,!1),this.highlightLabelSelection=AS.select(this.highlightLabelGroup,GF,!1),this.markerSelection=AS.select(this.markerGroup,Zw,!1),this.highlightMarkerSelection=AS.select(this.highlightNodeGroup,Zw),this.placedLabelData=[],this.animationState=new de("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[2,e],this.highlightGroup.zIndex=[3,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,sizeScale:i,colorScale:s}=this,{topologyIdKey:n,idKey:a,latitudeKey:o,longitudeKey:r,sizeKey:l,colorKey:c,labelKey:h,sizeDomain:d,colorRange:u}=this.properties,p=this.buildFeatureMap(n),f=this.sizeScale.type,y=this.colorScale.type,b=this.scale?.type,x=o!=null&&r!=null,{dataModel:v,processedData:S}=await this.requestDataModel(e,t,{props:[...a==null?[]:[id(a,b,{id:"idValue",includeProperty:!1}),id(a,b,{id:"featureValue",includeProperty:!1,processor:()=>k=>p.get(k)})],...x?[id(o,b,{id:"latValue"}),id(r,b,{id:"lonValue"})]:[],...h?[id(h,"category",{id:"labelValue"})]:[],...l?[id(l,f,{id:"sizeValue"})]:[],...c?[id(c,y,{id:"colorValue"})]:[]]}),M=a==null?void 0:v.resolveColumnById(this,"featureValue",S),D=x?v.resolveColumnById(this,"latValue",S):void 0,I=x?v.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.data.reduce((k,C,A)=>{const T=M?.[A]?.geometry;if(T!=null&&(k=Hp(T,k)),D!=null&&I!=null){const O=I[A],z=D[A];k=Dm.extend(k,O,z,O,z)}return k},void 0),l!=null){const k=v.resolveProcessedDataIndexById(this,"sizeValue"),C=S.domain.values[k]??[];i.domain=d??C}if(u!=null&&this.isColorScaleValid()){const k=v.resolveProcessedDataIndexById(this,"colorValue");s.domain=S.domain.values[k],s.range=u,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=zse(this,i.defs.values[s].missing);return!(n===0||n===a)}getLabelDatum(e,t,i){if(t==null)return;const{idKey:s,idName:n,latitudeKey:a,latitudeName:o,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f,label:y,shape:b}=this.properties;if(p==null||!y.enabled)return;const{datum:x,datumIndex:v,index:S,idValue:M,lonValue:D,latValue:I,point:k}=e,{placement:C}=y,A=this.getLabelText(t,x,p,"label",[],y,{value:t,datum:x,idKey:s,idName:n,latitudeKey:a,latitudeName:o,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f});if(A==null)return;const{width:w,height:T}=i.measureLines(String(A)),O=Zw.anchor(b);return{point:{x:k.x,y:k.y,size:k.size},label:{width:w,height:T,text:A},anchor:O,placement:C,datumIndex:v,datumId:IS(S,M,D,I)}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveDataColumns(e){const{idKey:t,latitudeKey:i,longitudeKey:s,sizeKey:n,colorKey:a,labelKey:o}=this.properties,r=i!=null&&s!=null;return{idValues:this.resolveColumn(t,"idValue",e),featureValues:this.resolveColumn(t,"featureValue",e),latValues:r?this.resolveColumn(i,"latValue",e):void 0,lonValues:r?this.resolveColumn(s,"lonValue",e):void 0,labelValues:this.resolveColumn(o,"labelValue",e),sizeValues:this.resolveColumn(n,"sizeValue",e),colorValues:this.resolveColumn(a,"colorValue",e)}}prepareProjectedGeometries(e,t,i){if(e==null||t==null||this.scale==null)return;const s=new Map;for(const[n]of i.dataSources.get(this.id)?.data.entries()??[]){const a=e[n],o=t[n]?.geometry,r=o==null?void 0:td(o,this.scale);a!=null&&r!=null&&s.set(a,r)}return s}calculateMarkerSize(e){return e==null?this.properties.size:this.sizeScale.convert(e,{clamp:!0})}buildNodeDatum(e,t,i,s,n){return{series:this,datum:e,datumIndex:t,index:i,...n,point:s,midPoint:{x:s.x,y:s.y},legendItemName:this.properties.legendItemName,style:this.getMarkerItemStyle({datumIndex:t,datum:e,colorValue:n.colorValue,sizeValue:n.sizeValue},!1)}}createNodeFromLatLon(e,t,i,s,n,a,o){if(this.scale==null)throw new Error("Scale is required for createNodeFromLatLon");const[r,l]=this.scale.convert([i,s]),c={x:r,y:l,size:a},h=this.buildNodeDatum(e,t,-1,c,n),d=this.getLabelDatum(h,n.labelValue,o)??void 0;return{node:h,label:d}}createNodesFromGeometry(e,t,i,s,n,a){const o=[],r=[];for(const[l,[c,h]]of BF(i,1).entries()){const d={x:c,y:h,size:n},u=this.buildNodeDatum(e,t,l,d,s);o.push(u);const p=this.getLabelDatum(u,s.labelValue,a);p&&r.push(p)}return{nodes:o,labels:r}}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}K.warnOnce("some data items do not have matches in the provided topology",e)}buildFeatureMap(e){const t=new Map;for(const i of this.topology?.features.values()??[]){const s=i.properties?.[e];s!=null&&t.set(s,i)}return t}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n,scale:a}=this,{label:o}=n;if(t==null||i==null||a==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const r=this.resolveDataColumns(i),l=n.maxSize??n.size;s.range=[Math.min(n.size,l),l];const c=et(o),h=this.prepareProjectedGeometries(r.idValues,r.featureValues,i),d=[],u=[],p=[],f=i.dataSources.get(this.id)?.data??[];for(const[y,b]of f.entries()){const x={idValue:r.idValues?.[y],lonValue:r.lonValues?.[y],latValue:r.latValues?.[y],colorValue:r.colorValues?.[y],sizeValue:r.sizeValues?.[y],labelValue:r.labelValues?.[y]},v=this.calculateMarkerSize(x.sizeValue),S=x.idValue==null?void 0:h?.get(x.idValue);if(x.idValue!=null&&h!=null&&S==null&&p.push(x.idValue),x.lonValue!=null&&x.latValue!=null){const M=this.createNodeFromLatLon(b,y,x.lonValue,x.latValue,x,v,c);d.push(M.node),M.label&&u.push(M.label)}else if(S!=null){const M=this.createNodesFromGeometry(b,y,S,x,v,c);d.push(...M.nodes),u.push(...M.labels)}}return this.warnMissingGeometries(p),{itemId:e,nodeData:d,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:n}=this,a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const o=this.getHighlightedDatum(),r=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:r,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:o,drawingMode:"overlay"}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:o==null?[]:[o],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:o,drawingMode:a}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(o),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=N.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.ctx.highlightManager?.getActiveHighlight();t.each((n,a)=>{const{x:o,y:r,width:l,height:c,text:h,datum:d}=a,u=Hse(this,void 0,i,i.label,e,s),{color:p,fontStyle:f,fontWeight:y,fontSize:b,fontFamily:x}=u;n.visible=!0,n.x=o+l/2,n.y=r+c/2,n.text=h,n.fill=p,n.fontStyle=f,n.fontWeight=y,n.fontSize=b,n.fontFamily=x,n.textAlign="center",n.textBaseline="middle";const v=d?.datumIndex;n.fillOpacity=this.getHighlightStyle(e,v).opacity??1,n.setBoxing(u)})}getHighlightedLabelId(e=this.getHighlightedDatum()){if(e!=null)return IS(e.index,e.idValue,e.lonValue,e.latValue)}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=this.getHighlightedLabelId(e),i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(s=>s.datum.datumId===t);if(this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0){this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1;return}this.highlightLabelGroup.visible=!0,this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,s=>IS(s.index,s.idValue,s.lonValue,s.latValue))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:s},n){const{properties:a,colorScale:o,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,h=this.getHighlightStyle(n,e),d=re(h,a.getStyle());!n&&i!=null&&(d.fill=this.isColorScaleValid()?o.convert(i):l?.[0]??d.fill),s!=null&&(d.size=r.convert(s,{clamp:!0}));let u=d;if(c!=null&&e!=null){const p=this.cachedDatumCallback(IS(e,n?"highlight":"node"),()=>{const f=this.makeItemStylerParams(t,e,n,u);return this.callWithContext(c,f)});p&&(u=re(p,d))}return u}makeItemStylerParams(e,t,i,s){const{id:n}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,highlightState:o,...s,fill:r}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:s,drawingMode:n}=e,a=FF(this.scale);t.each((o,r)=>{const{datum:l,point:c}=r,h=this.getMarkerItemStyle(r,i);o.shape=h.shape,o.size=h.size,o.setStyleProperties(h,a),o.x=c.x,o.y=c.y,o.scalingCenterX=c.x,o.scalingCenterY=c.y,o.zIndex=!i&&s!=null&&l===s.datum?1:0,o.drawingMode=n})}isProcessedDataAnimatable(){return!0}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup(),this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1,this.placedLabelData=[]}animateMarkers(){const{animationManager:e}=this.ctx,t=Sse();Rse(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let s=1/0,n;for(const a of this.contextNodeData?.nodeData??[]){const{x:o,y:r,size:l}=a.point,c=Math.max(Math.abs(o-t)-l,0),h=Math.max(Math.abs(r-i)-l,0),d=c*c+h*h;d<s&&(s=d,n=a)}return n==null?void 0:{datum:n,distance:Math.sqrt(s)}}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{shape:n,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s;let{fill:d}=s;if(e!=null&&this.isColorScaleValid()){const p=t.resolveColumnById(this,"colorValue",i)[e];d=this.colorScale.convert(p)}return{marker:{shape:n,fill:d,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:n}=this,{title:a,legendItemName:o,idName:r,idKey:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const u=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:u}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:o??a??r??l??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:a}}=this,{idKey:o,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:u,colorName:p,sizeKey:f,sizeName:y,labelKey:b,labelName:x,title:v,legendItemName:S,tooltip:M}=n;if(!i||!s)return;const D=s.dataSources.get(this.id)?.data[e],I=f==null?void 0:i.resolveColumnById(this,"sizeValue",s)[e],k=u==null?void 0:i.resolveColumnById(this,"colorValue",s)[e],C=[];if(this.isLabelEnabled()&&b!=null&&b!==o){const T=i.resolveColumnById(this,"labelValue",s)[e],O=a.format(this.callWithContext.bind(this),{type:"category",value:T,datum:D,seriesId:t,legendItemName:S,key:b,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});C.push({label:x,fallbackLabel:b,value:O??T})}if(f!=null&&I!=null){const T=i.getDomain(this,"sizeValue","value",s).domain,O=a.format(this.callWithContext.bind(this),{type:"number",value:I,datum:D,seriesId:t,legendItemName:S,key:f,source:"tooltip",property:"size",domain:T,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});C.push({label:y,fallbackLabel:f,value:O??String(I)})}if(u!=null&&k!=null){const T=i.getDomain(this,"colorValue","value",s).domain,O=a.format(this.callWithContext.bind(this),{type:"number",value:k,datum:D,seriesId:t,legendItemName:S,key:u,source:"tooltip",property:"color",domain:T,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});C.push({label:p,fallbackLabel:u,value:O??String(k)})}let A;if(o!=null)A=i.resolveColumnById(this,"idValue",s)[e];else if(l!=null&&h!=null){const T=i.resolveColumnById(this,"latValue",s)[e],O=i.resolveColumnById(this,"lonValue",s)[e];A=`${Math.abs(T).toFixed(4)}\xB0 ${T>=0?"N":"S"}, ${Math.abs(O).toFixed(4)}\xB0 ${O>=0?"W":"E"}`}const w=this.getMarkerItemStyle({datumIndex:e,datum:D,colorValue:k,sizeValue:I},!1);return this.formatTooltipWithContext(M,{heading:A,title:v??S,symbol:this.legendItemSymbol(e),data:C},{seriesId:t,datum:D,title:v,idKey:o,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:u,colorName:p,sizeKey:f,sizeName:y,labelKey:b,labelName:x,...w})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return Vse(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Xw.className="MapMarkerSeries",Xw.type="map-marker";var{mapMarkerSeriesThemeableOptionsDef:Gse}=N,jse={...J(qe,["highlightStyle","highlight"]),...Gse,type:j(Ae("map-marker")),idKey:L,latitudeKey:L,longitudeKey:L,sizeKey:L,colorKey:L,labelKey:L,idName:L,latitudeName:L,longitudeName:L,sizeName:L,colorName:L,labelName:L,topology:Ll,topologyIdKey:L,legendItemName:L,title:L},jF={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,version:ue,dependencies:[Sm],options:jse,themeTemplate:{...Mm,series:{shape:"circle",maxSize:30,fill:Jo({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",Ba],["image",it],["pattern",tt]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Jo(yo)]},fillOpacity:.5,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Jo(Us)},tooltip:{range:"exact"}},create:e=>new Xw(e),validate(e,t,i){const s=Mi(e,t,i),{cleared:n,invalid:a}=s;if(n?.idKey==null&&(n?.latitudeKey==null||n?.longitudeKey==null)){const o=l=>i?`${i}.${l}`:l,r=`Either \`${o("idKey")}\` or both \`${o("latitudeKey")}\` and \`${o("longitudeKey")}\` are required.`;a.push(new go("required",r,null,i))}return s}},{SeriesProperties:Wse,makeSeriesTooltip:$se}=N,er=class extends Wse{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=$se()}};g([m],er.prototype,"topology",2),g([m],er.prototype,"fill",2),g([m],er.prototype,"fillOpacity",2),g([m],er.prototype,"stroke",2),g([m],er.prototype,"strokeOpacity",2),g([m],er.prototype,"strokeWidth",2),g([m],er.prototype,"lineDash",2),g([m],er.prototype,"lineDashOffset",2),g([m],er.prototype,"tooltip",2);var{createDatumId:Kse,Selection:Use,Group:Yse,PointerEvents:WF}=N,qw=class extends km{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new er,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Yse({name:"itemGroup"})),this.datumSelection=Use.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=WF.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new _p;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=WF.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:Hp(s,t)},void 0),e==null&&K.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{fill:n,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s,d=[],u=[];for(const[p,f]of t.features.entries()){const{geometry:y}=f,b=y!=null&&i!=null?td(y,i):void 0;b!=null&&d.push({series:this,datum:f,datumIndex:0,index:p,projectedGeometry:b,style:{fill:n,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}})}return{itemId:e,nodeData:d,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Kse(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:n}=s;if(n==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=n,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};qw.className="MapShapeBackgroundSeries",qw.type="map-shape-background";var{mapShapeBackgroundSeriesThemeableOptionsDef:Zse}=N,Xse={...Zse,...qe,type:j(Ae("map-shape-background")),topology:Ll},$F={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,version:ue,dependencies:[Sm],options:Xse,themeTemplate:{...Mm,series:{fill:Jo({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",j0],["image",it],["pattern",K0]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1}},create:e=>new qw(e)};function qse(e,{aspectRatio:t,precision:i}){const s=zF(e,i,(l,c,h,d)=>{const u=Jse(l,c,h,t),p=u+2*d*t,f=u*Math.SQRT2,y=p*Math.SQRT2;return{distance:f,maxDistance:y}});if(s==null)return;const{x:n,y:a,distance:o}=s,r=o/Math.SQRT2;return{x:n,y:a,maxWidth:r}}function Qse(e,t,i,s,n){const[a,o]=e,[r,l]=t,c=1/n,h=r-a,d=l-o,[u,p]=o<=l?e:t,[f,y]=a<=r?e:t,[b,x]=o<=l?t:e,[v,S]=a<=r?t:e;let M=1/0;if(h===0)for(let w=0;w<=1;w+=1){const O=(w===0?c:-c)*(a-i)+s;if(O>=p&&O<=x){const V=Math.abs(s-O)*2*n;M=Math.min(M,V)}}else{const w=d/h;for(let T=0;T<=1;T+=1){const O=T===0?c:-c,z=(w*a-o-O*i+s)/(w-O);if(z>=f&&z<=v){const V=Math.abs(i-z)*2;M=Math.min(M,V)}}}const D=n,I=Math.abs((u-i)/(p-s)),k=Math.abs((b-i)/(x-s));if(x<s&&k<D){const T=Math.abs(s-x)*2*n;M=Math.min(M,T)}else if(p>s&&I<D){const T=Math.abs(s-p)*2*n;M=Math.min(M,T)}const C=Math.abs((y-s)/(f-i)),A=Math.abs((S-s)/(v-i));if(v<i&&A<c){const w=Math.abs(i-v)*2;M=Math.min(M,w)}else if(f>i&&C<c){const w=Math.abs(i-f)*2;M=Math.min(M,w)}return M}function Jse(e,t,i,s){let n=!1,a=1/0;for(const o of e){let r=o.at(-1),[l,c]=r;for(const h of o){const[d,u]=h;u>i!=c>i&&t<(l-d)*(i-u)/(c-u)+d&&(n=!n);const p=Qse(r,h,t,i,s);a=Math.min(a,p),r=h,l=d,c=u}}return(n?1:-1)*a}function CS(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function ene(e,t,i,s,n,a){const o=n-a/2,r=n+a/2,[l,c]=t,[h,d]=i,u=h-l,p=d-c,[f,y]=l<=h?t:i,[b,x]=l<=h?i:t;if(u!==0){const v=p/u;for(let S=0;S<=1;S+=1){const D=((S===0?o:r)-c)/v+l;D>=f&&D<=b&&CS(e,s,D)}}else Math.max(o,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&CS(e,s,l);return b<s&&x>=o&&x<=r?CS(e,s,b):f>s&&y>=o&&y<=r&&CS(e,s,f),e}function tne(e,t,i,s){const n={minX:-1/0,maxX:1/0};for(const r of e){let l=r.at(-1);for(const c of r)ene(n,l,c,t,i,s),l=c}const{minX:a,maxX:o}=n;return Number.isFinite(a)&&Number.isFinite(o)?{x:t+(a+o)/2,width:o-a}:{x:t,width:0}}var{SeriesProperties:ine,makeSeriesTooltip:sne}=N,ai=class extends ine{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new sv,this.tooltip=sne()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,opacity:1}}};g([m],ai.prototype,"topology",2),g([m],ai.prototype,"title",2),g([m],ai.prototype,"legendItemName",2),g([m],ai.prototype,"idKey",2),g([m],ai.prototype,"idName",2),g([m],ai.prototype,"topologyIdKey",2),g([m],ai.prototype,"labelKey",2),g([m],ai.prototype,"labelName",2),g([m],ai.prototype,"colorKey",2),g([m],ai.prototype,"colorName",2),g([m],ai.prototype,"colorRange",2),g([m],ai.prototype,"fill",2),g([m],ai.prototype,"fillOpacity",2),g([m],ai.prototype,"stroke",2),g([m],ai.prototype,"strokeOpacity",2),g([m],ai.prototype,"strokeWidth",2),g([m],ai.prototype,"lineDash",2),g([m],ai.prototype,"lineDashOffset",2),g([m],ai.prototype,"padding",2),g([m],ai.prototype,"itemStyler",2),g([m],ai.prototype,"label",2),g([m],ai.prototype,"tooltip",2);var{getMissCount:nne,createDatumId:wS,SeriesNodePickMode:KF,valueProperty:LS,ColorScale:ane,Group:UF,Selection:NS,Text:YF,PointerEvents:one,getLabelStyles:rne}=N,ZF=N.MercatorScale.fixedScale(),Qw=class extends km{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[KF.EXACT_SHAPE_MATCH,KF.NEAREST_NODE]}),this.properties=new ai,this._chartTopology=void 0,this.colorScale=new ane,this.itemGroup=this.contentGroup.appendChild(new UF({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new UF({name:"itemLabelGroup"})),this.datumSelection=NS.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=NS.select(this.itemLabelGroup,YF),this.highlightDatumSelection=NS.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=NS.select(this.highlightLabelGroup,YF),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=one.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new _p;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,colorScale:s}=this,{topologyIdKey:n,idKey:a,colorKey:o,labelKey:r,colorRange:l}=this.properties,c=new Map;for(const y of i?.features.values()??[]){const b=y.properties?.[n];b==null||!jw(y.geometry,1)||c.set(b,y)}const h=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:p}=await this.requestDataModel(e,t,{props:[LS(a,d,{id:"idValue",includeProperty:!1}),LS(a,d,{id:"featureValue",includeProperty:!1,processor:()=>y=>c.get(y)}),...r?[LS(r,"category",{id:"labelValue"})]:[],...o?[LS(o,h,{id:"colorValue"})]:[]]}),f=u.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=f.reduce((y,b)=>{const x=b?.geometry;return x==null?y:Hp(x,y)},void 0),l!=null&&this.isColorScaleValid()){const y=u.resolveProcessedDataIndexById(this,"colorValue");s.domain=p.domain.values[y],s.range=l,s.update()}i==null&&K.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=nne(this,i.defs.values[s].missing);return!(n===0||n===a)}getLabelLayout(e,t,i,s,n){if(t==null||s==null)return;const{idKey:a,idName:o,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties;if(c==null||!u.enabled)return;const p=this.getLabelText(t,e,c,"label",[],u,{value:t,datum:e,idKey:a,idName:o,colorKey:r,colorName:l,labelKey:c,labelName:h});if(p==null)return;const f=De(p)?Js(p,u):i.measureLines(String(p)),y=(f.width+2*d)/(f.height+2*d);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===y)return n;const b=td(s,ZF),x=MS(b);if(x==null)return;const v=qse(x,{aspectRatio:y,precision:.001});if(v==null)return;const{x:S,y:M,maxWidth:D}=v;return{geometry:s,labelText:p,aspectRatio:y,x:S,y:M,maxWidth:D,fixedPolygon:x}}getLabelDatum(e,t,i,s){const{scale:n}=this;if(n==null)return;const{padding:a,label:o}=this.properties,{labelText:r,aspectRatio:l,x:c,y:h,maxWidth:d,fixedPolygon:u}=e,p={width:Math.ceil(d*t),height:Math.ceil(d*t/l),meta:c},f=Wf(Ne(r),o,{padding:a},(I,k)=>{if(!k)return p;const C=tne(u,c,h,I/t);return{width:C.width*t,height:I,meta:C.x}});if(f==null)return;const[{text:y,fontSize:b,lineHeight:x,width:v},S]=f,M=v<p.width?c:S,D=this.scale.convert(ZF.invert([M,h]));return{x:D[0],y:D[1],text:y,fontSize:b,lineHeight:x,datumIndex:i,idValue:s,datumId:wS(s)}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveShapeDataColumns(e){const{colorKey:t,labelKey:i}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e),labelValues:this.resolveColumn(i,"labelValue",e),colorValues:this.resolveColumn(t,"colorValue",e)}}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}K.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,scale:n,previousLabelLayouts:a}=this,{label:o,legendItemName:r,colorKey:l}=s;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const c=n==null?Number.NaN:(n.range[1][0]-n.range[0][0])/n.bounds.width,h=this.resolveShapeDataColumns(i),d=et(o),u=new Map;this.previousLabelLayouts=u;const p=[],f=[],y=[],b=i.dataSources.get(this.id)?.data??[];for(const[x,v]of b.entries()){const S={idValue:h.idValues[x],colorValue:h.colorValues?.[x],labelValue:h.labelValues?.[x]},M=h.featureValues[x]?.geometry??void 0;if(M==null&&y.push(S.idValue),l!=null&&S.colorValue==null)continue;const D=this.getLabelLayout(v,S.labelValue,d,M,a?.get(S.idValue));D!=null&&u.set(S.idValue,D);const I=D!=null&&n!=null?this.getLabelDatum(D,c,x,S.idValue):void 0;I!=null&&f.push(I);const k=M!=null&&n!=null?td(M,n):void 0;p.push({series:this,datum:v,datumIndex:x,...S,projectedGeometry:k,legendItemName:r,style:this.getItemStyle({datum:v,datumIndex:x,colorValue:S.colorValue},!1)})}return this.warnMissingGeometries(y),{itemId:e,nodeData:p,labelData:f}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const s=this.ctx.chartService.highlight?.drawingMode??"overlay",n=this.getHighlightedDatum(),a=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,drawingMode:"overlay"}),this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:t});const r=this.getHighlightLabelData(o,n);this.highlightLabelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.highlightLabelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:n==null?[]:[n],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i,drawingMode:s})}getHighlightLabelData(e,t){if(e.length===0)return[];const i=wS(t?.idValue);return e.filter(s=>s.datumId===i&&s.datumIndex===t?.datumIndex)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>wS(t.idValue))}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{properties:n,colorScale:a}=this,{colorRange:o,itemStyler:r}=n,l=n.getStyle();if(i!=null){const d=this.isColorScaleValid()?a.convert(i):o?.[0];d!=null&&(l.fill=d)}const c=this.getHighlightStyle(s,e);let h=re(c,l);if(r!=null&&e!=null){const d=this.cachedDatumCallback(wS(e,s?"highlight":"node"),()=>{const u=this.makeItemStylerParams(t,e,s,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,u))});d&&(h=re(d,h))}return h}makeItemStylerParams(e,t,i,s){const{id:n}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,highlightState:o,...s,fill:r}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){const i=FF(this.scale);e.each((s,n)=>{const{projectedGeometry:a}=n;if(a==null){s.visible=!1,s.projectedGeometry=void 0;return}s.visible=!0,s.projectedGeometry=a,s.setStyleProperties(n.style,i),s.drawingMode=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.ctx.highlightManager?.getActiveHighlight();t.each((n,a)=>{const{x:o,y:r,text:l,fontSize:c,lineHeight:h,datumIndex:d}=a,u=rne(this,void 0,i,i.label,e,s),{color:p,fontStyle:f,fontWeight:y,fontFamily:b}=u;n.visible=!0,n.x=o,n.y=r,n.text=l,n.fill=p,n.fontStyle=f,n.fontWeight=y,n.fontSize=c,n.lineHeight=h,n.fontFamily=b,n.textAlign="center",n.textBaseline="middle",n.fillOpacity=this.getHighlightStyle(e,d).opacity??1,n.setBoxing(u)})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(e,t);o<i&&(i=o,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=i==null?void 0:MS(i),n=s==null?void 0:Yw(s,2),a=n==null?void 0:{x:n[0],y:n[1]};return this._previousDatumMidPoint={datum:e,point:a},a}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{fillOpacity:n,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:c}=s;let{fill:h}=s;if(e!=null&&this.isColorScaleValid()){const u=t.resolveColumnById(this,"colorValue",i)[e];u!=null&&(h=this.colorScale.convert(u))}return{marker:{fill:h,fillOpacity:n,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:c}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:n}=this,{title:a,legendItemName:o,idKey:r,idName:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const u=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:u}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:o??a??l??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:a}}=this,{idKey:o,idName:r,colorKey:l,colorName:c,labelKey:h,labelName:d,legendItemName:u,title:p,tooltip:f}=n;if(!i||!s)return;const y=s.dataSources.get(this.id)?.data[e],b=i.resolveColumnById(this,"idValue",s)[e],x=l==null?void 0:i.resolveColumnById(this,"colorValue",s)[e];if(l!=null&&x==null)return;const v=[];if(this.isLabelEnabled()&&h!=null&&h!==o){const M=i.resolveColumnById(this,"labelValue",s)[e],D=a.format(this.callWithContext.bind(this),{type:"category",value:M,datum:y,seriesId:t,legendItemName:u,key:h,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});v.push({label:d,fallbackLabel:h,value:D??M})}if(x!=null){const M=i.getDomain(this,"colorValue","value",s).domain,D=a.format(this.callWithContext.bind(this),{type:"number",value:x,datum:y,seriesId:t,legendItemName:u,key:l,source:"tooltip",property:"color",domain:M,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});v.push({label:c,fallbackLabel:l,value:D??String(x)})}const S=this.getItemStyle({datum:y,datumIndex:e,colorValue:x},!1);return this.formatTooltipWithContext(f,{heading:b,title:p??u,symbol:this.legendItemSymbol(e),data:v},{seriesId:t,datum:y,title:p,idKey:o,idName:r,colorKey:l,colorName:c,labelKey:h,labelName:d,...S})}computeFocusBounds(e){return NF(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Qw.className="MapShapeSeries",Qw.type="map-shape";var{mapShapeSeriesThemeableOptionsDef:lne}=N,cne={...J(qe,["highlightStyle","highlight"]),...lne,type:j(Ae("map-shape")),idKey:j(L),colorKey:L,labelKey:L,idName:L,colorName:L,labelName:L,topology:Ll,topologyIdKey:L,legendItemName:L,title:L},XF={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,version:ue,dependencies:[Sm],options:cne,themeTemplate:{...Mm,series:{fill:Jo({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]}),stroke:{$ref:"chartBackgroundColor"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Jo(yo)]},fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{...Ye,enabled:!0,color:{$ref:"chartBackgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"},highlight:Jo(Us)},tooltip:{range:"exact"}},create:e=>new Qw(e)},qF=[RF,LF,jF,XF,$F],Jw=[UI,iB,DF,qF,GB,cB,yE,IE,TE,BE,jE].flat(),tr=class extends X{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=ye("img"),this.imageElement.onload=this.onImageLoad,this.node=new N.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=ix(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};g([m],tr.prototype,"top",2),g([m],tr.prototype,"right",2),g([m],tr.prototype,"bottom",2),g([m],tr.prototype,"left",2),g([m],tr.prototype,"width",2),g([m],tr.prototype,"height",2),g([m],tr.prototype,"opacity",2),g([Gt("imageElement.src"),Xt(e=>e.loadedSynchronously=e.complete)],tr.prototype,"url",2);var eL=class extends N.Background{constructor(){super(...arguments),this.image=new tr}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(9)}};g([m,_e({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],eL.prototype,"image",2);var Am=class extends N.Background{constructor(){super(...arguments),this.image=new tr,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new N.Group({name:"foreground",zIndex:18})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart,s=this.image.performLayout(t,i);this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(9)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const{width:i}=t.getBBox(),s=10;t.x=e.x+e.width/2-i/2,t.y=e.y+e.height+s}};g([m,_e({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],Am.prototype,"image",2),g([m,Dt("rectNode","fill")],Am.prototype,"fill",2),g([m,Dt("rectNode","fillOpacity")],Am.prototype,"fillOpacity",2);var hne=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],s=e[1],n=e[2],a=e[3];i=this.ff(i,s,n,a,t[0],7,-680876936),a=this.ff(a,i,s,n,t[1],12,-389564586),n=this.ff(n,a,i,s,t[2],17,606105819),s=this.ff(s,n,a,i,t[3],22,-1044525330),i=this.ff(i,s,n,a,t[4],7,-176418897),a=this.ff(a,i,s,n,t[5],12,1200080426),n=this.ff(n,a,i,s,t[6],17,-1473231341),s=this.ff(s,n,a,i,t[7],22,-45705983),i=this.ff(i,s,n,a,t[8],7,1770035416),a=this.ff(a,i,s,n,t[9],12,-1958414417),n=this.ff(n,a,i,s,t[10],17,-42063),s=this.ff(s,n,a,i,t[11],22,-1990404162),i=this.ff(i,s,n,a,t[12],7,1804603682),a=this.ff(a,i,s,n,t[13],12,-40341101),n=this.ff(n,a,i,s,t[14],17,-1502002290),s=this.ff(s,n,a,i,t[15],22,1236535329),i=this.gg(i,s,n,a,t[1],5,-165796510),a=this.gg(a,i,s,n,t[6],9,-1069501632),n=this.gg(n,a,i,s,t[11],14,643717713),s=this.gg(s,n,a,i,t[0],20,-373897302),i=this.gg(i,s,n,a,t[5],5,-701558691),a=this.gg(a,i,s,n,t[10],9,38016083),n=this.gg(n,a,i,s,t[15],14,-660478335),s=this.gg(s,n,a,i,t[4],20,-405537848),i=this.gg(i,s,n,a,t[9],5,568446438),a=this.gg(a,i,s,n,t[14],9,-1019803690),n=this.gg(n,a,i,s,t[3],14,-187363961),s=this.gg(s,n,a,i,t[8],20,1163531501),i=this.gg(i,s,n,a,t[13],5,-1444681467),a=this.gg(a,i,s,n,t[2],9,-51403784),n=this.gg(n,a,i,s,t[7],14,1735328473),s=this.gg(s,n,a,i,t[12],20,-1926607734),i=this.hh(i,s,n,a,t[5],4,-378558),a=this.hh(a,i,s,n,t[8],11,-2022574463),n=this.hh(n,a,i,s,t[11],16,1839030562),s=this.hh(s,n,a,i,t[14],23,-35309556),i=this.hh(i,s,n,a,t[1],4,-1530992060),a=this.hh(a,i,s,n,t[4],11,1272893353),n=this.hh(n,a,i,s,t[7],16,-155497632),s=this.hh(s,n,a,i,t[10],23,-1094730640),i=this.hh(i,s,n,a,t[13],4,681279174),a=this.hh(a,i,s,n,t[0],11,-358537222),n=this.hh(n,a,i,s,t[3],16,-722521979),s=this.hh(s,n,a,i,t[6],23,76029189),i=this.hh(i,s,n,a,t[9],4,-640364487),a=this.hh(a,i,s,n,t[12],11,-421815835),n=this.hh(n,a,i,s,t[15],16,530742520),s=this.hh(s,n,a,i,t[2],23,-995338651),i=this.ii(i,s,n,a,t[0],6,-198630844),a=this.ii(a,i,s,n,t[7],10,1126891415),n=this.ii(n,a,i,s,t[14],15,-1416354905),s=this.ii(s,n,a,i,t[5],21,-57434055),i=this.ii(i,s,n,a,t[12],6,1700485571),a=this.ii(a,i,s,n,t[3],10,-1894986606),n=this.ii(n,a,i,s,t[10],15,-1051523),s=this.ii(s,n,a,i,t[1],21,-2054922799),i=this.ii(i,s,n,a,t[8],6,1873313359),a=this.ii(a,i,s,n,t[15],10,-30611744),n=this.ii(n,a,i,s,t[6],15,-1560198380),s=this.ii(s,n,a,i,t[13],21,1309151649),i=this.ii(i,s,n,a,t[4],6,-145523070),a=this.ii(a,i,s,n,t[11],10,-1120210379),n=this.ii(n,a,i,s,t[2],15,718787259),s=this.ii(s,n,a,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(n,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,i,s,n,a){return t=this.add32(this.add32(t,e),this.add32(s,a)),this.add32(t<<n|t>>>32-n,i)}ff(e,t,i,s,n,a,o){return this.cmn(t&i|~t&s,e,t,n,a,o)}gg(e,t,i,s,n,a,o){return this.cmn(t&s|i&~s,e,t,n,a,o)}hh(e,t,i,s,n,a,o){return this.cmn(t^i^s,e,t,n,a,o)}ii(e,t,i,s,n,a,o){return this.cmn(i^(t|~s),e,t,n,a,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)n[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=t*8,this.md5cycle(i,n),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>s*8+4&15]+t[e>>s*8&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(i>>16)<<16|i&65535}};function tL(e){return e==null||e.length===0}var dne="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",TS={"01":"GRID","02":"CHARTS","0102":"BOTH"},QF="https://www.ag-grid.com/charts/licensing/",iL=class Ri{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new hne,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(Ri.licenseKey,Ri.gridContext),i=`AG ${t.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(t.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":t.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":t.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const n=Ri.getChartsReleaseDate(),a=Ri.formatDate(n);this.outputExpiredKey(t.expiry,a,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(Number.parseInt(Ri.decode(i),10))}static extractLicenseComponents(t){let i=t.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),a=i.substring(0,s),[o,r,l]=Ri.extractBracketedInformation(i);return{md5:n,license:a,version:o,isTrial:r,type:l}}getLicenseDetails(t,i=!1){const s="CHARTS";if(tL(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const n=Ri.getChartsReleaseDate(),{md5:a,license:o,version:r,isTrial:l,type:c}=Ri.extractLicenseComponents(t);let h=a===this.md5.md5(o)&&!t.includes("For_Trialing_ag-Grid_Only"),d,u,p=null,f=!1,y;function b(){d=p<new Date,u=void 0}if(h&&(p=Ri.extractExpiry(o),h=!Number.isNaN(p.getTime()),h))switch(u=n>p,r){case"legacy":case"2":{h=!1;break}case"3":tL(c)?h=!1:(y=c,c!==TS["02"]&&c!==TS["0102"]?(h=!1,f=!0):l&&b())}return h?{licenseKey:t,valid:h,expiry:Ri.formatDate(p),expired:u,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?y!=="BOTH":void 0,incorrectLicenseType:f,currentLicenseType:s,suppliedLicenseType:y}:{licenseKey:t,valid:h,incorrectLicenseType:f,currentLicenseType:s,suppliedLicenseType:y}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!tL(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getWatermarkForegroundConfig(){const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}getWatermarkForegroundConfigForBrowser(){if(!this.isDisplayWatermark())return;const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}buildWatermarkConfig(t){return{text:t,image:{url:dne,width:170,height:25,right:25,bottom:50,opacity:.7}}}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??globalThis;if(!t)return"localhost";try{return(t.location?.hostname??"")||"localhost"}catch{return"localhost"}}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!t)return!1;const i=t.location?.pathname;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null}isLocalhost(){const t=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(t)!==null}isE2ETest(){const t=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(t)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),n=t.getMonth(),a=t.getFullYear();return s+" "+i[n]+" "+a}static getChartsReleaseDate(){return new Date(Number.parseInt(Ri.decode(Ri.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,a,o,r,l,c,h,d=0;const u=t.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)r=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),h=i.indexOf(u.charAt(d++)),n=r<<2|l>>4,a=(l&15)<<4|c>>2,o=(c&3)<<6|h,s=s+String.fromCodePoint(n),c!=64&&(s=s+String.fromCodePoint(a)),h!=64&&(s=s+String.fromCodePoint(o));return s=Ri.utf8_decode(s),s}static utf8_decode(t){t=t.replaceAll("rn","n");let i="";for(let s=0;s<t.length;s++){const n=t.codePointAt(s);n<128?i+=String.fromCodePoint(n):n>127&&n<2048?(i+=String.fromCodePoint(n>>6|192),i+=String.fromCodePoint(n&63|128)):(i+=String.fromCodePoint(n>>12|224),i+=String.fromCodePoint(n>>6&63|128),i+=String.fromCodePoint(n&63|128))}return i}static setGridContext(t=!1){Ri.gridContext=t}static setLicenseKey(t){this.licenseKey&&this.licenseKey!==t&&console.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),Ri.licenseKey=t}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(r=>r==="TRIAL").length===1,n=i.find(r=>r.startsWith("v")),a=n?n.replace("v",""):"legacy",o=TS[i.find(r=>TS[r])];return[a,s,o]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){Ri.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${QF}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${QF}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){Ri.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){Ri.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s){Ri.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};iL.RELEASE_INFORMATION="MTc3MDgwNzY1NDM4MQ==",iL.gridContext=!1;var sd=iL;function JF(e,t){const i=e.addChild("canvas-overlay","watermark"),s=ye("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var e_=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-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-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-menu-border);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item: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-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-left-color:var(--ag-charts-border-color)}}
`;function une(){fe.registerModules(Jw),zi.styles=e_,zi.licenseManager=e=>new sd(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),zi.injectWatermark=JF,zi.createBackground=e=>new eL(e),zi.createForeground=e=>new Am(e)}var pne={setLicenseKey(e){sd.setLicenseKey(e)}},gne={VERSION:ue,_Scene:Ub,_Theme:Yb,_Util:Zb,create:Da.create.bind(Da),createSparkline:Da.__createSparkline.bind(Da),setup:()=>{fe.setRegistryMode(fe.RegistryMode.Integrated),une()},setGridContext:sd.setGridContext.bind(sd),setLicenseKey:sd.setLicenseKey.bind(sd),isEnterprise:!0};if(fe.setRegistryMode(fe.RegistryMode.Enterprise),zi.styles=e_,zi.licenseManager=e=>new sd(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),zi.injectWatermark=JF,zi.createBackground=e=>new eL(e),zi.createForeground=e=>new Am(e),fe.setRegistryMode(fe.RegistryMode.UMD),fe.registerModules(Jw),typeof ho.exports=="object"&&typeof jp=="object"){var fne=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,n)&&n!==i&&Object.defineProperty(e,n,{get:()=>t[n],enumerable:!(s=Object.getOwnPropertyDescriptor(t,n))||s.enumerable});return e};ho.exports=fne(ho.exports,jp)}return ho.exports});