(function(Al,$n){typeof exports=="object"&&typeof module=="object"?module.exports=$n():typeof define=="function"&&define.amd?define("agCharts",[],$n):typeof exports=="object"?exports.agCharts=$n():Al.agCharts=$n()})(this,()=>{var Al={},$n={exports:Al};if(typeof $F>"u")var $F=function(t){throw new Error("Unknown module: "+t)};var Sh=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,dA=Object.getOwnPropertyNames,pA=Object.prototype.hasOwnProperty,Mi=(e,t)=>{for(var i in t)Sh(e,i,{get:t[i],enumerable:!0})},gA=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of dA(t))!pA.call(e,s)&&s!==i&&Sh(e,s,{get:()=>t[s],enumerable:!(n=cb(t,s))||n.enumerable});return e},fA=e=>gA(Sh({},"__esModule",{value:!0}),e),v=(e,t,i,n)=>{for(var s=n>1?void 0:n?cb(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Sh(t,i,s),s},hb={};Mi(hb,{AG_CHARTS_LOCALE_EN_US:()=>DM,AgCharts:()=>Gr,AgChartsCommunityModule:()=>jF,AgTooltipAnchorToType:()=>Eb,AgTooltipPlacementType:()=>Rb,AllCartesianAxesModule:()=>lI,AllCartesianModule:()=>aD,AllCartesianSeriesModule:()=>rD,AllCommunityModule:()=>Ty,AllPolarModule:()=>xD,AreaSeriesModule:()=>BI,BarSeriesModule:()=>$I,BubbleSeriesModule:()=>XI,CartesianChartModule:()=>nn,CategoryAxisModule:()=>XM,DonutSeriesModule:()=>bD,GroupedCategoryAxisModule:()=>iI,HistogramSeriesModule:()=>QI,LegendModule:()=>Bf,LineSeriesModule:()=>tD,LocaleModule:()=>Gf,LogAxisModule:()=>nI,ModuleRegistry:()=>ee,NumberAxisModule:()=>sI,PieSeriesModule:()=>vD,PolarChartModule:()=>ip,ScatterSeriesModule:()=>sD,SparklinePresetModule:()=>p0,TimeAxisModule:()=>rI,UnitTimeAxisModule:()=>oI,VERSION:()=>qe,_ModuleSupport:()=>NC,_Scene:()=>eb,_Theme:()=>tb,_Util:()=>ib,_Widget:()=>$C,time:()=>zP}),$n.exports=fA(hb);var ub=(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))(ub||{});function wl(e){return e.domain}var db=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(db||{}),xs=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 n of i)n(t)}clear(e){e?this.events.delete(e):this.events.clear()}},Mh=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()}},he={};Mi(he,{Time:()=>IA,check:()=>Xa,create:()=>wb,inDevelopmentMode:()=>kb});function kl(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Sp(e){return Array.from(new Set(e))}function Ll(e,t){return e.reduce((i,n)=>{const s=t(n);return i[s]??(i[s]=[]),i[s].push(n),i},{})}function Un(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i{const r=i.get(n)??1/0,a=i.get(s)??1/0;return r-a})}function gb(e,t){let i=0;for(;i=0&&t(e[i]);)i-=1;const n=e.length-1-i;n!==0&&e.splice(e.length-n,n)}function mb(e,t,i){const n=[e],s=Math.round((t-e)/(i-1));if(s>0)for(let r=e+s;r=i-1);r+=s);return n.push(t),n}var Ii={};typeof globalThis.window<"u"&&(Ii.window=globalThis.window),typeof document<"u"?Ii.document=document:typeof globalThis.global<"u"&&(Ii.document=globalThis.document);function $r(e){return e?Ii.document?.[e]:Ii.document}function Wn(e){return e?Ii.window?.[e]:Ii.window}function yb(e){Ii.document=e}function bb(e){Ii.window=e}function Ih(){return Ii.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function Tl(){return Ii.window?.Path2D??globalThis.Path2D}function Mp(){return Ii.window?.DOMMatrix??globalThis.DOMMatrix}function vb(){return Ii.window?.Image??globalThis.Image}function xb(){return Ii.window?.ResizeObserver??globalThis.ResizeObserver}var Sb=1,mA=11;function Dh(e){return e!=null&&typeof e.nodeType=="number"}function Ip(e){return e!=null&&e.nodeType===Sb}function Mb(e){return e!=null&&e.nodeType===mA}function Nl(e){return e!=null&&e.nodeType===Sb&&"style"in e}var z={};Mi(z,{error:()=>Ib,errorOnce:()=>bA,log:()=>Ch,logGroup:()=>Cb,reset:()=>vA,table:()=>yA,warn:()=>Kn,warnOnce:()=>ji});var Dp=new Set;function Ch(...e){console.log(...e)}function Kn(e,...t){console.warn(`AG Charts - ${e}`,...t)}function Ib(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function yA(...e){console.table(...e)}function Db(e,t,i){let n;e instanceof Error?n=e.message:typeof e=="string"?n=e:typeof e=="object"?n=JSON.stringify(e):n=String(e);const s=`${t}: ${n}`;Dp.has(s)||(i(e),Dp.add(s))}function ji(e,...t){Db(e,"Logger.warn",i=>Kn(i,...t))}function bA(e,...t){Db(e,"Logger.error",i=>Ib(i,...t))}function vA(){Dp.clear()}function xA(e){return typeof e=="object"&&e!==null&&"then"in e}function Cb(e,t){console.groupCollapsed(e);let i=!0;try{const n=t();return xA(n)?(i=!1,n.finally(()=>{console.groupEnd()})):n}finally{i&&console.groupEnd()}}var SA=2e3,Ab=Date.now();function MA(){const e=Date.now()-Ab;if(e>SA){const t=(Math.floor(e/100)/10).toFixed(1);Ch(`**** ${t}s since last log message ****`)}Ab=Date.now()}function wb(...e){return Object.assign((...i)=>{Xa(...e)&&(typeof i[0]=="function"&&(i=kl(i[0]())),MA(),Ch(...i))},{check:()=>Xa(...e),group:(i,n)=>Xa(...e)?Cb(i,n):n()})}function Xa(...e){return e.length===0&&e.push(!0),kl(Wn("agChartsDebug")).some(i=>e.includes(i))}function kb(e){if(Xa("dev"))return e()}function IA(e,t={}){const{logResult:i=!0,logStack:n=!1,logArgs:s=!1,logData:r}=t;return function(a,o,l){const c=l.value;l.value=function(...h){const u=performance.now(),d=c.apply(this,h),g={duration:performance.now()-u};return i&&(g.result=d),s&&(g.args=h),n&&(g.stack=new Error("Stack trace for timing debug").stack),r&&(g.logData=r(this)),Ch(e,g),d}}}var Ks={};Mi(Ks,{flush:()=>Tb,record:()=>Lb});var Cp=new Map;function Lb(e,t){Xa("scene:stats:verbose")&&Cp.set(e,t)}function Tb(){const e=Object.fromEntries(Cp);return Cp.clear(),e}var Ys={},ee={};Mi(ee,{RegistryMode:()=>Nb,getAxisModule:()=>LA,getChartModule:()=>TA,getPresetModule:()=>NA,getSeriesModule:()=>OA,hasModule:()=>AA,isEnterprise:()=>RA,isIntegrated:()=>PA,isModuleType:()=>qa,isUmd:()=>FA,listModules:()=>wA,listModulesByType:()=>kA,register:()=>Ap,registerModules:()=>DA,reset:()=>CA,setRegistryMode:()=>EA});var Nb=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))(Nb||{}),Ol=new Set,Yn=new Map;function Ob(e){if(Yn.set(e.name,e),e.dependencies)for(const t of e.dependencies)Ap(t)}function Ap(e){const t=Yn.get(e.name);if(!t){Ob(e);return}if(t.version===e.version){!t.enterprise&&e.enterprise&&Ob(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 DA(e){for(const t of e.flat())Ap(t)}function CA(){Ol.clear(),Yn.clear()}function AA(e){return Yn.has(e)}function*wA(){for(const e of Yn.values())yield e}function*kA(e){for(const t of Yn.values())qa(e,t)&&(yield t)}function LA(e){const t=Yn.get(e);if(qa("axis",t))return t}function TA(e){const t=Yn.get(e);if(qa("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function NA(e){const t=Yn.get(e);if(qa("preset",t))return t}function OA(e){const t=Yn.get(e);if(qa("series",t))return t}function EA(e){Ol.add(e)}function RA(){return Ol.has("enterprise")}function PA(){return Ol.has("integrated")}function FA(){return Ol.has("umd")}function qa(e,t){return t?.type===e}var tt=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)}},Ah=class{constructor(){this.cleanup=new tt}destroy(){this.cleanup.flush()}},VA=void 0,_A=void 0;_A=VA;var BA=void 0,zA=void 0;zA=BA;var Eb=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(Eb||{}),Rb=(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))(Rb||{}),GA=void 0,jA=void 0;jA=GA;var HA=void 0,$A=void 0;$A=HA;var Ja="\u2026",Zs=/\r?\n/g,El="\u200B",Pb=/[\s.,;:-]{1,5}$/,Rl;function Fb(e){if(Rl==null){const i=Wn("Option");Rl=new i().style}Rl.color=e;const t=Rl.color||null;return Rl.color="",t}function Qa(e){return e?.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl"}function wh(e,t){if(!e)return;const{x:i,y:n,width:s,height:r}=WA(t);kh(e.style,"width",s),kh(e.style,"height",r),kh(e.style,"left",i),kh(e.style,"top",n)}function Vb(e){const t=Number.parseFloat(e.style.width),i=Number.parseFloat(e.style.height),n=Number.parseFloat(e.style.left),s=Number.parseFloat(e.style.top),r=Number.isFinite(t)?t:e.offsetWidth,a=Number.isFinite(i)?i:e.offsetHeight,o=Number.isFinite(n)?n:e.offsetLeft,l=Number.isFinite(s)?s:e.offsetTop;return{x:o,y:l,width:r,height:a}}function UA(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const{ownerDocument:t}=e,i=t.createRange();i.setStart(e.lastChild,e.lastChild.textContent.length),i.setEnd(e.lastChild,e.lastChild.textContent.length);const n=t.defaultView?.getSelection();n?.removeAllRanges(),n?.addRange(i)}function _b(){const e=Wn("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function Pl(e){return`ag-charts-icon ag-charts-icon-${e}`}function WA(e){let{x:t,y:i,width:n,height:s}=e;return(n==null||n>0)&&(s==null||s>0)?e:(t!=null&&n!=null&&n<0&&(n=-n,t=t-n),i!=null&&s!=null&&s<0&&(s=-s,i=i-s),{x:t,y:i,width:n,height:s})}function kh(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}function Zn(e){return e!=null}function le(e){return Array.isArray(e)}function Bb(e){return typeof e=="boolean"}function Sn(e){return e instanceof Date}function Fl(e){return Sn(e)&&!Number.isNaN(Number(e))}function zb(e){return e instanceof RegExp}function Xn(e){return typeof e=="function"}function oe(e){return typeof e=="object"&&e!==null&&!le(e)}function Vl(e){return le(e)||be(e)}function be(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function _l(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function rt(e){return typeof e=="string"}function Hi(e){return typeof e=="number"}function Pe(e){return Number.isFinite(e)}function wp(e){return e!=null&&e.nodeType===1&&"style"in e}function KA(e,t){return rt(t)&&Object.keys(e).includes(t)}function YA(e,t){return Object.values(e).includes(t)}function Bl(e){return typeof e=="symbol"}function Gb(e){return rt(e)&&(e==="none"||Fb(e)!=null)}function zl(e,t){return e in t}function kp({fontSize:e,fontStyle:t,fontWeight:i,fontFamily:n}){let s="";return t&&t!=="normal"&&(s+=`${t} `),i&&i!=="normal"&&i!==400&&(s+=`${i===700?"bold":i} `),s+=`${e}px`,s+=` ${n}`,s}function Lp(e,t=1.15){return Math.round(e*t)}function ft(e){return String(e??"")}function Tp(e){return Np(e.replace(Pb,""))+Ja}var ZA=new Set([1575,1577,1583,1584,1585,1586,1608]);function XA(e){return e>=1568&&e<=1610&&!ZA.has(e)}function Np(e){if(!e)return e;const t=e.codePointAt(e.length-1);return XA(t)?e+"\u200D":e}function jb(e){return El+e+El}function Hb(e){return e.replaceAll(El,"")}function $b(e){return le(e)?Lh(e.at(-1)):Xs(ft(e))}function Xs(e){return e.endsWith(Ja)}function Lh(e){return ft(e?.text).endsWith(Ja)}var Ub=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function Ss(e){return Ub?Array.from(Ub.segment(e),t=>t.segment):Array.from(e)}function qs(e,t="and",i=String,n=1/0){if(e.length===0)return"";if(e.length===1)return i(e[0]);e=e.map(i);const s=e.pop();if(e.length>=n){const r=e.length-(n-1);return`${e.slice(0,n-1).join(", ")}, and ${r} more ${t} ${s}`}return`${e.join(", ")} ${t} ${s}`}function Gl(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 Wb(e){let t=1;for(let i=0;ic),o=new Array(s+1);for(let l=1;l<=r;l++){o[0]=l;for(let c=1;c<=s;c++){const h=n[l-1]===i[c-1]?0:1;o[c]=Math.min(a[c]+1,o[c-1]+1,a[c-1]+h)}[a,o]=[o,a]}return a[s]}function Yb(e){return e.replaceAll(qA,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var qA=/[A-Z]+(?![a-z])|[A-Z]/g;function Xe(e,t=""){return e==null?t:le(e)?e.map(i=>ft(i.text)).join(""):rt(e)?e:String(e)}function JA(e,t=0,i){const{leading:n=!1,trailing:s=!0,maxWait:r=1/0}=i??{};let a,o;if(ro=null,t),e(...c);return}let h=t;if(r!==1/0&&o){const u=Date.now()-o;t>r-u&&(h=r-u)}clearTimeout(a),o??(o=Date.now()),a=setTimeout(()=>{o=null,s&&e(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),o=null}})}function Op(e,t,i){const{leading:n=!0,trailing:s=!0}=i??{};let r,a,o=!1;function l(){s&&a?(r=setTimeout(l,t),e(...a)):o=!1,a=null}function c(...h){o?a=h:(o=!0,r=setTimeout(l,t),n?e(...h):a=h)}return Object.assign(c,{cancel(){clearTimeout(r),o=!1,a=null}})}function Ep(e,t,i=""){try{return e(...t)}catch(n){const s=i?` \`${i}\``:"";ji(`Uncaught exception in user callback${s}`,n)}}var rn=Symbol("description"),Zb=Symbol("required"),Th=Symbol("marked"),Nh=Symbol("undocumented"),jl=Symbol("union"),QA=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"],["show","visible","enabled"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(n=>n!==i)));return e},new Map),Xb=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(Xb||{});function Hl(e,t){return Pe(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var Js=class{constructor(e,t,i,n,s){this.type=e,this.description=t,this.value=i,this.path=n,this.key=s}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?Hl(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 \`${Gl(i,50)}\`; expecting ${e}, ignoring.`}},Oh=class extends Js{constructor(e,t,i,n){super("unknown",void 0,t,i,n),this.suggestions=e,this.key=n}getPrefix(){return`Unknown option \`${Hl(this.altPath??this.path,this.key)}\``}getPostfix(){const e=qs(ew(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function Vt(e,t,i=""){if(!oe(e))return{cleared:null,invalid:[new Js("required","an object",e,i)]};const n={},s=[],r=new Set(Object.keys(e)),a=[];if(jl in t){const o=Object.keys(t),l=t[jl];if(e.type!=null&&o.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,u=Vt(h,t[c],i);Object.assign(n,{type:c},u.cleared);for(const d of u.invalid)d.setUnionType(c,i);s.push(...u.invalid)}else{const c=qs(o,"or",h=>`'${h}'`);s.push(new Js("required",`a keyword such as ${c}`,e.type,i,"type"))}return{cleared:n,invalid:s}}for(const o of Object.keys(t)){const l=t[o],c=l[Zb],h=e[o];if(r.delete(o),h===void 0&&(l[Nh]||a.push(o),!c))continue;const u=Hl(i,o);if(Xn(l)){const p=l(h,{options:e,path:u});if(typeof p=="object"){if(s.push(...p.invalid),p.valid){n[o]=p.cleared;continue}else if(Ur(p.invalid,u))continue}else if(p){n[o]=h;continue}s.push(new Js(c?"required":"invalid",l[rn],h,i,o))}else{const d=Vt(h,l,u);d.cleared!=null&&(n[o]=d.cleared),s.push(...d.invalid)}}for(const o of r){const l=e[o];l!==void 0&&s.push(new Oh(a,l,i,o))}return{cleared:n,invalid:s}}function ew(e,t,i=2){const n=e.toLowerCase(),s=QA.get(n);return t.filter(r=>{const a=r.toLowerCase();return s?.has(r)===!0||a.includes(n)||Kb(n,a)<=i})}function fe(e,t){if(Xn(e)){let n=function(s,r){return e(s,r)};var i=n;return n[rn]=t,n}else return{...e,[rn]:t}}function X(e){return Object.assign(Xn(e)?(t,i)=>e(t,i):it(e),{[Zb]:!0,[rn]:e[rn]})}function J(e){return Object.assign(Xn(e)?(t,i)=>e(t,i):it(e),{[Nh]:!0,[rn]:e[rn]})}var it=(e,t="an object",i=!1)=>fe((n,s)=>{const r=Vt(n,e,s.path),a=!Ur(r.invalid,s.path);return{valid:a,cleared:a||!i?r.cleared:null,invalid:r.invalid}},t),$l=(e,t,i)=>({...e,[rn]:t,[jl]:i}),Ae=(...e)=>fe((t,i)=>{const n=[];for(const s of e){const r=s(t,i);if(typeof r=="object"){if(n.push(...r.invalid),!r.valid)return{valid:!1,cleared:t,invalid:n};t=r.cleared}else if(!r)return!1}return{valid:!0,cleared:t,invalid:n}},qs(e.filter(t=>!t[Nh]).map(t=>t[rn]).filter(Zn),"and")),ne=(...e)=>fe((t,i)=>{for(const n of e){const s=n(t,i);if(typeof s=="object"?s.valid:s)return s}return!1},qs(e.filter(t=>!t[Nh]).map(t=>t[rn]).filter(Zn),"or")),eo=e=>Pe(e)||Fl(e),tw=e=>Sn(e)||(Pe(e)||rt(e))&&Fl(new Date(e)),qn=fe(le,"an array"),L=fe(Bb,"a boolean"),Ve=fe(Xn,"a function"),H=fe(Gb,"a color string"),pi=fe(tw,"a date"),pe=fe(Zn,"a defined value"),P=fe(Pe,"a number"),Qs=fe(oe,"an object"),O=fe(rt,"a string"),Rp=fe(wp,"an html element"),to=(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`,fe(n=>le(n)&&n.length>=e&&n.length<=t,i)},Pp=(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`,fe(n=>rt(n)&&n.length>=e&&n.length<=t,i)},Fp=(e,t=!0)=>fe(i=>Pe(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),qb=(e,t)=>fe(i=>Pe(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),w=Fp(0),Jn=Fp(0,!1),Z=qb(0,1),gi=e=>fe((t,{options:i})=>!eo(t)||!eo(i[e])||tfe((t,{options:i})=>!eo(t)||!eo(i[e])||t<=i[e],`the value to be less than or equal to \`${e}\``),fi=e=>fe((t,{options:i})=>!eo(t)||!eo(i[e])||t>i[e],`the value to be greater than \`${e}\``);function F(...e){oe(e[0])&&(e=Object.values(e[0]));const t=qs(e,"or",i=>`'${i}'`);return fe(i=>e.includes(i),`a keyword such as ${t}`)}function Vp(){return F}var _e=e=>fe(t=>e===t,`the value ${JSON.stringify(e)}`),iw=(e,t)=>fe(i=>i instanceof e,t??`an instance of ${e.name}`),ie=(e,t,i=!0)=>fe((n,s)=>{if(!le(n))return!1;let r=i;const a=[],o=[],l=c=>{r=i?r&&c:r||c};if(n.length===0)return{valid:!0,cleared:a,invalid:o};for(let c=0;cfe((i,n)=>{if(!le(i))return!1;const s=[],r=[];for(let a=0;afe((i,n)=>{if(!Xn(i))return!1;if(Th in i)return!0;const s=t??e[rn];return{valid:!0,cleared:Object.assign((...a)=>{const o=Ep(i,a);if(o==null)return;const l=e(o,{options:o,path:""});if(typeof l=="object"){if(Qb(l,n,s,o),l.valid)return l.cleared}else{if(l)return o;ji(`Callback \`${n.path}\` returned an invalid value \`${Gl(o,50)}\`; expecting ${s}, ignoring.`)}},{[Th]:!0}),invalid:[]}},"a function"),De=(e,t="an object")=>fe((i,n)=>{if(!Xn(i))return!1;if(Th in i)return!0;const s=t;return{valid:!0,cleared:Object.assign((...a)=>{const o=Ep(i,a,n.path);if(o==null)return;const l=Vt(o,e);return Qb(l,n,s,o),l.cleared},{[Th]:!0}),invalid:[]}},"a function");function Ur(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function Qb(e,t,i,n){if(e.invalid.length!==0){if(le(n)){const s=i??e.invalid[0]?.description??"a valid value";return ji(`Callback \`${t.path}\` returned an invalid value \`${Gl(n,50)}\`; expecting ${s}, ignoring.`)}for(const s of e.invalid){if(s instanceof Oh)return ji(`Callback \`${t.path}\` returned an unknown property \`${Hl(s.path,s.key)}\`${s.getPostfix()}`);const r=Gl(s.value,50);ji(s.key?`Callback \`${t.path}\` returned an invalid property \`${Hl(s.path,s.key)}\`: \`${r}\`; expecting ${s.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${r}\`; expecting ${i??s.description}, ignoring.`)}}}function te(e,t,i){return Math.min(i,Math.max(e,t))}function ev(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function Di(e,t,i=1e-10){return e===t||Math.abs(e-t)=1e21){let s;[t,s]=t.split("e"),s!=null&&(i=Number(s))}const n=t.split(".")[1]?.length??0;return Math.max(n-i,0)}var nv=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,sv=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function rv(e){if(!rt(e))return!1;const t=sv.exec(e);return nv.test(t?t[2]:e)}function Ph(e){let t,i;const n=sv.exec(e);n&&([,t,e,i]=n);const s=nv.exec(e);if(!s){ji(`The number formatter is invalid: ${e}`);return}const[,r,a,o,l,c,h,u,d,p,g]=s;return{fill:r,align:a,sign:o,symbol:l,zero:c,width:Number.parseInt(h),comma:u,precision:Number.parseInt(d),trim:!!p,type:g,prefix:t,suffix:i}}function _p(e){const t=typeof e=="string"?Ph(e):e;if(t==null)return;const{fill:i,align:n,sign:s="-",symbol:r,zero:a,width:o,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=t;let{trim:p}=t;const g=d==null||Number.isNaN(d);let f;if(!c)f=an.g,p=!0;else if(c in an&&c in no)f=g?no[c]:an[c];else if(c in an)f=an[c];else if(c in no)f=no[c];else throw new Error(`The number formatter type is invalid: ${c}`);const m=c?6:12;let y;g||(y=d);let b=n,x=i;return a&&(x??(x="0"),b??(b="=")),(M,I)=>{let C;y!=null?C=y:c==="f"||c==="%"?C=I??m:c?C=m:C=I??m;let D=f(M,C);p&&(D=aw(D)),l&&(D=ow(D,l));const A=uw(r,c),k=A?.length??0;A&&(D=`${A}${D}`),c==="s"&&(D=`${D}${lw(M)}`),(c==="%"||c==="p")&&(D=`${D}%`);const{value:N,prefixLength:T}=cw(M,D,s),R=T+k;let B=N;return o!=null&&!Number.isNaN(o)&&(B=hw(B,o,x??" ",b,R)),B=`${h}${B}${u}`,B}}var no={b:e=>Fh(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Fh(e).toString(8),x:e=>Fh(e).toString(16),X:e=>no.x(e).toUpperCase(),n:e=>no.d(e),"%":e=>`${Fh(e*100).toFixed(0)}`},an={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>an.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>an.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i));return n>=-4&&nan.g(e,t).toUpperCase(),n:(e,t)=>an.g(e,t),p:(e,t)=>an.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i))-(t-1);if(s<=0)return i.toFixed(-s);const r=10**s;return(Math.round(i/r)*r).toFixed()},s:(e,t)=>{const i=lv(e);return an.r(e/10**i,t)},"%":(e,t)=>an.f(e*100,t)},av=-24,ov=24,sw={[av]:"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",[ov]:"Y"},rw="\u2212";function Fh(e){return Math.floor(Math.abs(e))}function aw(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 ow(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const n=e.substring(0,i).split(""),s=e.substring(i);for(let r=n.length-3;r>0;r-=3)n.splice(r,0,t);return`${n.join("")}${s}`}function lw(e){return sw[lv(e)]}function lv(e){return te(av,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,ov)}function cw(e,t,i=""){if(i==="(")return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let n="";return e<0?n=rw:i==="+"?n="+":i===" "&&(n=" "),{value:`${n}${t}`,prefixLength:n.length}}function hw(e,t,i=" ",n=">",s=0){const r=t-e.length;if(r<=0)return e;const a=i.repeat(r);if(n==="="){const o=Math.min(Math.max(s,0),e.length),l=e.slice(0,o),c=e.slice(o);return`${l}${a}${c}`}if(n===">"||!n)return a+e;if(n==="<")return`${e}${a}`;if(n==="^"){const o=Math.ceil(r/2),l=Math.floor(r/2);return`${i.repeat(o)}${e}${i.repeat(l)}`}return a+e}function uw(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 Ul=e=>{if(!oe(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},dw=it({color:H,stop:Z},""),Bp=fe(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop{let i;if(typeof e=="string")Hp.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Js("invalid",`a legend placement string: ["${Hp.join('", "')}"]`,e,t.path)));else{const{cleared:n,invalid:s}=Vt(e,mw);i={valid:s.length===0,cleared:n,invalid:s}}return i},"a legend position object or placement string"),tr=ne(F("circle","cross","diamond","heart","plus","pin","square","star","triangle"),Ve),mv=F("never","always","hyphenate","on-space"),Gh=F("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),jh=ne(w,F("exact","nearest","area")),yv=ne(w,F("exact","nearest")),ln=ne(O,P,pi,Et({text:X(O),...Ce},"text segments array")),Kl={enabled:L,text:ln,textAlign:F("left","center","right"),wrapping:F("never","always","hyphenate","on-space"),spacing:w,maxWidth:w,maxHeight:w,...Ce};Kl.padding=J(w),Kl.truncate=J(L);var Hh={enabled:L,text:ln,renderer:mi(ne(O,Rp))},$p=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],bv={type:F("action","separator"),showOn:F("always","series-area","series-node","legend-item"),label:X(O),enabled:L,action:Ve,items:(e,t)=>vv(e,t)};bv.iconUrl=J(O);var yw=it(bv),bw=fe((e,t)=>{let i;return typeof e=="string"?$p.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Js("invalid",`a context menu item string alias: ["${$p.join('", "')}"]`,e,t.path))):i=yw(e,t),i},`a context menu item object or string alias: [${$p.join(", ")}]`),vv=ie(bw,"a menu items array",!1),ro={label:O,ariaLabel:O,tooltip:O,iconPosition:F("before","after"),icon:F("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","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")},In=ne(O,mi(ln)),xv=it({x:In,y:In,angle:In,radius:In,size:In,color:In,label:In,secondaryLabel:In,sectorLabel:In,calloutLabel:In,legendItem:In}),Dn=fe(rv,"a valid number format string"),ao=F("millisecond","second","minute","hour","day","month","year"),Sv={unit:X(ao),step:Jn,epoch:pi,utc:L};Sv.every=Ve;var Yl=it(Sv,"a time interval object"),se={width:w,height:w,minWidth:w,minHeight:w,suppressFieldDotNotation:L,title:Kl,subtitle:Kl,footnote:Kl,padding:{top:w,right:w,bottom:w,left:w},seriesArea:{border:Wr,clip:L,cornerRadius:P,padding:Qn},legend:{enabled:L,position:zh,orientation:F("horizontal","vertical"),maxWidth:w,maxHeight:w,spacing:w,border:Wr,cornerRadius:P,padding:Qn,fill:Ci,fillOpacity:Z,preventHidingAll:L,reverseOrder:L,toggleSeries:L,item:{marker:{size:w,shape:tr,padding:w,strokeWidth:w},line:{length:w,strokeWidth:w},label:{maxLength:w,formatter:Ve,...Ce},maxWidth:w,paddingX:w,paddingY:w,showSeriesStroke:L},pagination:{marker:{size:w,shape:tr,padding:w},activeStyle:{...$,..._},inactiveStyle:{...$,..._},highlightStyle:{...$,..._},label:Ce},listeners:{legendItemClick:Ve,legendItemDoubleClick:Ve}},gradientLegend:{enabled:L,position:zh,spacing:w,reverseOrder:L,border:Wr,cornerRadius:P,padding:Qn,fill:Ci,fillOpacity:Z,gradient:{preferredLength:w,thickness:w},scale:{label:{...Ce,minSpacing:w,format:Dn,formatter:Ve},padding:w,interval:{step:P,values:qn,minSpacing:Ae(w,gi("maxSpacing")),maxSpacing:Ae(w,fi("minSpacing"))}}},listeners:{seriesNodeClick:Ve,seriesNodeDoubleClick:Ve,seriesVisibilityChange:Ve,activeChange:Ve,click:Ve,doubleClick:Ve,annotations:Ve,zoom:Ve},loadGoogleFonts:L,highlight:{drawingMode:F("overlay","cutout"),range:F("tooltip","node")},overlays:{loading:Hh,noData:Hh,noVisibleSeries:Hh,unsupportedBrowser:Hh},tooltip:{enabled:L,showArrow:L,pagination:L,delay:w,range:jh,wrapping:mv,mode:F("single","shared","compact"),position:{anchorTo:F("pointer","node","chart"),placement:ne(Gh,ie(Gh)),xOffset:P,yOffset:P}},animation:pe,flashOnUpdate:pe,contextMenu:pe,context:()=>!0,dataSource:{getData:Ve},keyboard:{enabled:L,tabIndex:P,initialFocus:Vp()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:F("none","drag","hover")},ranges:{enabled:L,enableOutOfRange:L,position:F("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:w,button:{...$i,..._,textColor:H,...Ce,cornerRadius:w,padding:Qn,active:{...$i,stroke:_.stroke,textColor:H},disabled:{...$i,stroke:_.stroke,textColor:H},hover:{...$i,stroke:_.stroke,textColor:H}},dropdown:{visible:F("auto","always","never"),...$i,..._,textColor:H,...Ce,cornerRadius:w,padding:Qn,active:{...$i,stroke:_.stroke,textColor:H},disabled:{...$i,stroke:_.stroke,textColor:H},hover:{...$i,stroke:_.stroke,textColor:H}},gap:w,...$i,..._,textColor:H,...Ce,cornerRadius:w,padding:Qn,active:{...$i,stroke:_.stroke,textColor:H},disabled:{...$i,stroke:_.stroke,textColor:H},hover:{...$i,stroke:_.stroke,textColor:H},buttons:Et({...ro,enabled:L,value:ne(P,Ae(ie(ne(P,pi)),to(2,2)),Yl,ao,Ve)},"range button options array")},locale:{localeText:Qs,getLocaleText:mi(O)},background:{visible:L,fill:H,image:{url:X(O),top:P,right:P,bottom:P,left:P,width:w,height:w,opacity:Z}},styleNonce:O,sync:pe,zoom:pe,scrollbar:pe,formatter:ne(mi(ln),xv),enableRtl:L};se.highlight.enabled=J(L),se.dataSource.requestThrottle=J(w),se.dataSource.updateThrottle=J(w),se.dataSource.updateDuringInteraction=J(L),se.statusBar=J(pe),se.ranges.minSize=J(w),se.foreground=J({visible:L,text:O,image:{url:O,top:P,right:P,bottom:P,left:P,width:w,height:w,opacity:Z},...$}),se.overrideDevicePixelRatio=J(P),se.sync.domainMode=J(F("direction","position","key")),se.displayNullData=J(L);var Ie={cursor:O,context:()=>!0,showInLegend:L,nodeClickRange:jh,listeners:{seriesNodeClick:Ve,seriesNodeDoubleClick:Ve},highlight:Gp(Ue)};Ie.allowNullKeys=J(L);var Cn={...Ie,id:O,visible:L,context:()=>!0,data:qn};Cn.seriesGrouping=J(pe);var ir={shape:tr,size:w,...$,..._,...W},An={enabled:L,itemStyler:De({...$,..._,...W,shape:tr,size:w}),...ir},Oe={enabled:L,formatter:mi(ln),format:Dn,itemStyler:De({enabled:L,...on,...Ce}),...on,...Ce},nr={...Oe,lineHeight:w,minimumFontSize:w,wrapping:mv,overflowStrategy:F("ellipsis","hide")},Zl={visible:L,cap:{visible:L,length:w,lengthRatio:Z,..._,...W},..._,...W},$h={...Zl,xLowerKey:O,xUpperKey:O,yLowerKey:O,yUpperKey:O,xLowerName:O,xUpperName:O,yLowerName:O,yUpperName:O,itemStyler:De({visible:L,..._,...W,cap:{visible:L,length:w,lengthRatio:Z,..._,...W}})},we={enabled:L,showArrow:L,range:yv,renderer:mi(ne(O,P,pi,it({heading:O,title:O,symbol:{marker:{enabled:L,shape:tr,...$,stroke:H,strokeOpacity:Z,strokeWidth:w,...W},line:{enabled:L,stroke:H,strokeWidth:w,strokeOpacity:Z,...W}},data:Et({label:X(O),value:X(ne(O,P,pi))})},"tooltip renderer result object"))),position:{anchorTo:F("node","pointer","chart"),placement:ne(Gh,ie(Gh)),xOffset:P,yOffset:P},interaction:{enabled:L}},Mv={...we,range:jh},es={enabled:L,xOffset:P,yOffset:P,blur:w,color:H},Uh=$l({linear:{},smooth:{tension:Z},step:{position:F("start","middle","end")}},"interpolation line options"),Wh=Symbol("BREAK"),Xl="__decorator_config",Kh="__decorator_accessors";function S(e,t){Up(e,t).optional=!0}function Up(e,t){if(Object.getOwnPropertyDescriptor(e,Xl)==null&&Object.defineProperty(e,Xl,{value:{}}),Object.getOwnPropertyDescriptor(e,Kh)==null){const h=Object.getPrototypeOf(e)?.[Kh]?.slice()??[];Object.defineProperty(e,Kh,{value:h})}const i=e[Xl],n=t.toString();if(i[n]!=null)return i[n];i[n]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(e,t);let r=s?.get,a=s?.set;if(r==null||a==null){const c=e[Kh];let h=c.indexOf(t);h===-1&&(h=c.push(t)-1),r??(r=function(){let u=this.__accessors;return u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[h]}),a??(a=function(u){let d=this.__accessors;d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[h]=u})}return Object.defineProperty(e,t,{set:function(c){const{setters:h,observers:u}=i[n];let d;h.some(p=>p.length>2)&&(d=r.call(this));for(const p of h)if(c=p(this,t,c,d),c===Wh)return;a.call(this,c);for(const p of u)p(this,c,d)},get:function(){let c=r.call(this);for(const h of i[n].getters)if(c=h(this,t,c),c===Wh)return;return c},enumerable:!0,configurable:!1}),i[n]}function sr(e,t,i){return(n,s)=>{const r=Up(n,s);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function Wp(e){return(t,i)=>{Up(t,i).observers.push(e)}}function Yh(e){return e!==void 0&&Xl in e}function rr(e){const t=new Set;for(;Yh(e);)t.add(e?.[Xl]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function Iv(e){return rr(e).reduce((t,i)=>(t[String(i)]=e[i]??null,t),{})}function*Kr(...e){for(const t of e)t!=null&&(t[Symbol.iterator]?yield*t:yield t)}function Dv(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function Ai(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*Dt(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function Ms(e){return Object.keys(e)}function yt(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,n)=>yt(i,t[n])):be(e)?be(t)?Kp(e,t,yt):!1:e===t}function Kp(e,t,i){if(Object.is(e,t))return!0;for(const n of Object.keys(t))if(!(n in e))return!1;for(const n of Object.keys(e))if(!(n in t)||!i(e[n],t[n]))return!1;return!0}function xe(...e){const t={};for(const i of e){if(!oe(i))continue;const n=Yh(i)?rr(i):Object.keys(i);for(const s of n)be(t[s])&&be(i[s])?t[s]=xe(t[s],i[s]):t[s]??(t[s]=i[s])}return t}function ql(...e){const t={};for(const i of e){if(!oe(i))continue;const n=Yh(i)?rr(i):Object.keys(i);for(const s of n)be(t[s])&&be(i[s])?t[s]=ql(t[s],i[s]):s in t||(t[s]??(t[s]=i[s]))}return t}function vw(e,...t){return t&&le(e)?e.map(i=>xe(i,...t)):e}function Yp(e,t){const i={};for(const[n,s]of Dt(e))i[n]=t(s,n,e);return i}function K(e,t){const i={...e};for(const n of t)delete i[n];return i}function Zh(e,t){if(e==null)return;const i={};for(const n of t)Object.hasOwn(e,n)&&(i[n]=e[n]);return i}function Cv(e,t){if(e==null)return!0;for(const[i,n]of Dt(e))if(!t(i,n))return!1;return!0}function Av(e){const t={};if(e==null)return t;for(const[i,n]of e)t[i]=n;return t}function Zp(e,t){return(le(t)?t:t.split(".")).reduce((n,s)=>n[s],e)}var Xp=new Set(["__proto__","constructor","prototype"]);function qp(e,t,i){const n=le(t)?t.slice():t.split("."),s=n.pop();if(n.some(a=>Xp.has(a)))return;const r=n.reduce((a,o)=>a[o],e);return r[s]=i,r[s]}function Jp(e,t,i){if(i===void 0)return t;for(const n of e){const s=i[n];s!==void 0&&(t[n]=s)}return t}function Qp(e,t,i){const n=i??Object.keys(t);for(let s=0,r=n.length;s(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))(kv||{}),ar=12,Zr={SMALLEST:8/ar,SMALLER:10/ar,SMALL:12/ar,MEDIUM:13/ar,LARGE:14/ar,LARGEST:17/ar},Lv=(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))(Lv||{}),Tv=(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))(Tv||{}),Nv=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Nv||{}),Ov=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Ov||{}),Xr=(e,t,i)=>e*(1-i)+t*i,eg=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},tg=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},Ev=class Le{constructor(t,i,n,s=1){this.r=te(0,t||0,1),this.g=te(0,i||0,1),this.b=te(0,n||0,1),this.a=te(0,s||0,1)}static validColorString(t){return t.includes("#")?!!Le.parseHex(t):t.includes("rgb")?!!Le.stringToRgba(t):Le.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.includes("#"))return Le.fromHexString(t);const i=Le.nameToHex.get(t.toLowerCase());if(i)return Le.fromHexString(i);if(t.includes("rgb"))return Le.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 n=0;nNumber.parseInt(n,16)).map(n=>n+n*16);break}if(i?.length>=3&&i.every(n=>n>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=Le.parseHex(t);if(i){const[n,s,r,a]=i;return new Le(n/255,s/255,r/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,n=-1;for(let o=0;o=0?p:p+360;return[g,f,m]}static OKLCHtoRGB(t,i,n){const s=t,r=i*Math.cos(n*Math.PI/180),a=i*Math.sin(n*Math.PI/180),o=(s+.3963377774*r+.2158037573*a)**3,l=(s-.1055613458*r-.0638541728*a)**3,c=(s-.0894841775*r-1.291485548*a)**3,h=4.0767416621*o-3.3077115913*l+.2309699292*c,u=-1.2684380046*o+2.6097574011*l-.3413193965*c,d=-.0041960863*o-.7034186147*l+1.707614701*c,p=tg(h),g=tg(u),f=tg(d);return[p,g,f]}static RGBtoHSL(t,i,n){const s=Math.min(t,i,n),r=Math.max(t,i,n),a=(r+s)/2;let o,l;if(r===s)o=0,l=0;else{const c=r-s;l=a>.5?c/(2-r-s):c/(r+s),r===t?o=(i-n)/c+(i1&&(h-=1),h<1/6?r+(s-r)*6*h:h<1/2?s:h<2/3?r+(s-r)*(2/3-h)*6:r}const o=a(t/360+1/3),l=a(t/360),c=a(t/360-1/3);return[o,l,c]}static RGBtoHSB(t,i,n){const s=Math.min(t,i,n),r=Math.max(t,i,n),a=r===0?0:(r-s)/r;let o=0;if(s!==r){const l=r-s,c=(r-t)/l,h=(r-i)/l,u=(r-n)/l;t===r?o=u-h:i===r?o=2+c-u:o=4+h-c,o/=6,o<0&&(o=o+1)}return[o*360,a,r]}static HSBtoRGB(t,i,n){t=(t%360+360)%360/360;let s=0,r=0,a=0;if(i===0)s=r=a=n;else{const o=(t-Math.floor(t))*6,l=o-Math.floor(o),c=n*(1-i),h=n*(1-i*l),u=n*(1-i*(1-l));switch(Math.trunc(o)){case 0:s=n,r=u,a=c;break;case 1:s=h,r=n,a=c;break;case 2:s=c,r=n,a=u;break;case 3:s=c,r=h,a=n;break;case 4:s=u,r=c,a=n;break;case 5:s=n,r=c,a=h;break}}return[s,r,a]}static mix(t,i,n){return new Le(Xr(t.r,i.r,n),Xr(t.g,i.g,n),Xr(t.b,i.b,n),Xr(t.a,i.a,n))}static lighten(t,i){const n=Le.RGBtoOKLCH(t.r,t.g,t.b);return Le.fromOKLCH(te(0,n[0]+i,1),n[1],n[2])}static darken(t,i){const n=Le.RGBtoOKLCH(t.r,t.g,t.b);return Le.fromOKLCH(te(0,n[0]-i,1),n[1],n[2])}static interpolate(t,i){const n=1/(t.length-1),s=t.map(r=>Le.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,a)=>{const o=a/(i-1),l=t.length<=2?0:Math.min(Math.floor(o*(t.length-1)),t.length-2),c=(o-l*n)/n,h=s[l],u=s[l+1];return Le.fromOKLCH(Xr(h[0],u[0],c),Xr(h[1],u[1],c),Xr(h[2],u[2],c))})}};Ev.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 Te=Ev,Rv={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"]}}},Sw={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},Mw={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},ig={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},Iw={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},Dw={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},or={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Cw={...or,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},Aw={...or,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},ww=e=>({...or,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]}}]]}}}),iu={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Jl={...iu,reverse:!0},kw={...iu,bounds:"series"},Pv={...iu,bounds:"series",reverse:!0},Lw={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},Ui={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:ig,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},Tw={...Ui,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"}]}]}]}},Nw={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},Ow={...Ui,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},Ew=e=>({...Ui,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),Is={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},Rw={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function Wi(e){return Yp(e,t=>{const i=Te.fromString(t);return[Te.darken(i,.15).toString(),t,Te.lighten(i,.15).toString()]})}var ts={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}}},nu={$isUserOption:["/highlight/enabled",{$path:"/highlight/enabled"},!0]},Ql={enabled:nu,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},ng={enabled:nu,unhighlightedSeries:{opacity:.2}},sg={enabled:nu,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},Pw={enabled:nu,unhighlightedItem:{opacity:.2}},Fv={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]}]}},su={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",or],["image",Is],["pattern",Ui]]},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"}}}},rg=class nb{constructor(t){this.version=t.split("-")[0]}save(...t){const i={version:this.version};for(const n of Object.values(t))i[n.mementoOriginatorKey]=this.encode(n,n.createMemento());return i}restore(t,...i){if(!oe(t)){ji(`Could not restore data of type [${t===null?"null":typeof t}], expecting an object, ignoring.`);return}if(!("version"in t)||typeof t.version!="string"){ji("Could not restore data, missing [version] string in object, ignoring.");return}for(const n of i){const s=this.decode(n,t[n.mementoOriginatorKey]),r=[];if(!n.guardMemento(s,r)){let a=`Could not restore [${n.mementoOriginatorKey}] data, value was invalid, ignoring.`;r.length>0&&(a+=` ${r.join(` `)} `),ji(a,s);return}n.restoreMemento(this.version,t.version,s)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,nb.encodeTypes))}catch(n){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${n}].`,{cause:n})}}decode(t,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),nb.decodeTypes)}catch(n){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${n}].`,{cause:n})}}static encodeTypes(t,i){return Sn(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return oe(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},ag=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(ag||{}),wn=(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))(wn||{}),Vv=(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))(Vv||{}),_v=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(_v||{}),Bv=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(Bv||{}),zv=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(zv||{});function ru(e){const{placement:t="bottom",floating:i=!1,xOffset:n=0,yOffset:s=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:i,xOffset:n,yOffset:s}}var ce=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 Kn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const n of rr(this))if(i.has(n)){const s=e[n],r=this;if(lo(r[n]))if(r[n]instanceof oo){const a=r[n].reset(s);a==null?Kn(`unable to set [${String(n)}] - expecting a properties array`):r[n]=a}else r[n].set(s);else be(s)?r[n]=ql(s,r[n]??{}):r[n]=s;i.delete(n)}this.handleUnknownProperties(i,e);for(const n of i)Kn(`unable to set [${String(n)}] in ${t} - property is unknown`);return this}clear(){for(const e of rr(this)){const t=this[e];lo(t)?t.clear():this[e]=void 0}return this}toJson(){return rr(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=lo(i)?i.toJson():i,e},{})}},oo=class UC extends Array{constructor(t,...i){super(i.length);const s=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(i)}set(t){if(le(t)){this.length=t.length;for(let i=0;it?.toJson?.()??t)}};function lo(e){return e instanceof ce||e instanceof oo}var co=class extends ce{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};v([S],co.prototype,"type",2),v([S],co.prototype,"tension",2),v([S],co.prototype,"position",2);function ho(e,t){const[i,n]=Ct(t);return te(i,e,n)}function Ct(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)it[1]&&(t[1]=i);return t}function qr(e){const[t,i]=Ct(e);return i-t}function uo(e){return e=Math.trunc(e),e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function og(e){return e=Math.trunc(e),e<=0?0:e===1?1:1<<31-Math.clz32(e)}var cn=0,kn=1,Ln=2,Tn=3,lr=4,Ds=1e3,Fw=10,cr=64,ec=4294967295,Vw=3,_w=20,lg=100;function cg(e,t,i,n,s,r,a,o){let l=0;for(;ln;)s-=1,l+=1;if(l>=lg||n>=s)return r;const c=Number.isFinite(t)?un(e[s],t,i,o)-un(e[n],t,i,o):po(s,e.length)-po(n,e.length);if(c===0||!Number.isFinite(c))return r;const h=Math.abs(c)/(s-n);let u;if(a_w?u=!1:u=h<=r,r=Math.min(r,h),!u)return r;const d=Math.floor((n+s)/2),p=cg(e,t,i,n,d,r,a+1,o),g=cg(e,t,i,d+1,s,r,a+1,o);return Math.min(p,g,r)}function Bw(e,t,i,n){return cg(e,t,i,0,e.length-1,1/(e.length-1),0,n)}function Cs(e,t,i,n){if(Number.isFinite(t)){const s=n?.smallestKeyInterval,r=n?.xNeedsValueOf??!0,a=s==null?Bw(e,t,i,r):s/(i-t);return uo(Math.trunc(1/a))>>3}else{let s=Math.ceil(Math.log2(e.length))-1;return s=Math.min(Math.max(s,0),24),Math.trunc(2**s)}}function hn(e,t){const{domain:i,sortMetadata:n}=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(n?.sortOrder===1)return[Number(i[0]),Number(i.at(-1))];if(n?.sortOrder===-1)return[Number(i.at(-1)),Number(i[0])];let s=1/0,r=-1/0;for(const a of i){const o=Number(a);s=Math.min(s,o),r=Math.max(r,o)}return[s,r]}case"color":case"log":case"mercator":return[0,0]}}function po(e,t){return e/t}function un(e,t,i,n){return n?(e.valueOf()-t)/(i-t):(e-t)/(i-t)}function au(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*lr)}function zw(e,t,i,n,s,{xNeedsValueOf:r=!0,xValuesLength:a}={}){const o=e[s];if(o==null)return-1;const l=a??e.length,c=Number.isFinite(t)?un(o,t,i,r):po(s,l);return au(c,n)}function Gw(e,t,i,n){for(const s of n)if(i===e[t+s])return!0;return!1}function As(e,t,i,n,s,r,{positive:a,split:o=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:h,reuseValueData:u,reuseNegativeIndexData:d,reuseNegativeValueData:p}={}){const g=Number.NaN,f=r*lr,m=h?.length===f?h:new Uint32Array(f),y=u?.length===f?u:new Float64Array(f);let b,x;o&&(d?.length===f?b=d:b=new Uint32Array(f),p?.length===f?x=p:x=new Float64Array(f));const M=Number.isFinite(n)&&Number.isFinite(s),I=e.length;M&&(y.fill(g),m.fill(ec),o&&(x.fill(g),b.fill(ec)));const C=M?r/(s-n):r*(1/I);let D=-1,A=-1,k=g,N=-1,T=g,R=-1,B=g,E=-1,V=g,G=-1,q=-1,j=g,Q=-1,ue=g,re=-1,He=g,Ze=-1,ve=g;const pt=e.length,di=t===i;for(let Me=0;Me=0;else if(a!=null&>>=0!==a)continue;let ye;M?l?ye=(Hn.valueOf()-n)*C:ye=(Hn-n)*C:ye=Me*C;const vs=Math.floor(ye),bn=(vsT&&(N=Me,T=ye),fh&&deV&&(E=Me,V=gt))}else{bn!==G&&(G!==-1&&(b[G]=q,b[G+1]=Q,b[G+2]=re,b[G+3]=Ze,x[G]=j,x[G+1]=ue,x[G+2]=He,x[G+3]=ve),G=bn,q=-1,j=g,Q=-1,ue=g,re=-1,He=g,Ze=-1,ve=g);const fh=de===de,mh=gt===gt;q===-1?(q=Me,j=ye,Q=Me,ue=ye,fh&&(re=Me,He=de),mh&&(Ze=Me,ve=gt)):(yeue&&(Q=Me,ue=ye),fh&&deve&&(Ze=Me,ve=gt))}}return D!==-1&&(m[D]=A,m[D+1]=N,m[D+2]=R,m[D+3]=E,y[D]=k,y[D+1]=T,y[D+2]=B,y[D+3]=V),o&&G!==-1&&(b[G]=q,b[G+1]=Q,b[G+2]=re,b[G+3]=Ze,x[G]=j,x[G+1]=ue,x[G+2]=He,x[G+3]=ve),{indexData:m,valueData:y,negativeIndexData:b,negativeValueData:x}}function Jr(e,t,i,{inPlace:n=!1,midpointData:s,reuseIndexData:r,reuseValueData:a}={}){const o=Math.trunc(i/2),l=o*lr;let c;n?c=e:r?.length===l?c=r:c=new Uint32Array(l);let h;n?h=t:a?.length===l?h=a:h=new Float64Array(l);const u=s??new Uint32Array(o);for(let d=0;dt[f+kn]?g:f,M=e[x+kn];c[p+kn]=M,h[p+kn]=t[x+kn],u[d]=b+M>>1;const I=m||t[g+Ln]t[f+Tn]?g:f;c[p+Tn]=e[C+Tn],h[p+Tn]=t[C+Tn]}return{maxRange:o,indexData:c,valueData:h,midpointData:u}}function is(e,t,i,n=cn,s=kn,r=-1){const a=i?.length===e?i:new Uint32Array(e);for(let o=0,l=0;o>1}return a}function jw(e,{collectLevel:t,shouldContinue:i,minRange:n=cr,compactInPlace:s=!1}){let r=e,a=t(r);const o=[a];for(;r.maxRange>n&&i(a,r);){const l=Jr(r.indexData,r.valueData,r.maxRange,{inPlace:s});r={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},a=t(r),o.push(a)}return o.reverse(),o}function Gv(e,t,i,n,s){if(t.lengthy.maxRange===u);let{indexData:p,valueData:g}=As(t,i,n,r,a,u,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),f=is(u,p,d?.midpointIndices);const m=[{maxRange:u,indexData:p,valueData:g,midpointIndices:f}];for(;u>cr;){const y=u,b=Math.trunc(y/2),x=h?.find(I=>I.maxRange===b),M=Jr(p,g,y,{reuseIndexData:x?.indexData,reuseValueData:x?.valueData});u=M.maxRange,p=M.indexData,g=M.valueData,f=M.midpointData??is(u,p,x?.midpointIndices),m.push({maxRange:u,indexData:p,valueData:g,midpointIndices:f})}return m.reverse(),m}function Hw(e,t,i,n,s){if(t.lengthM.maxRange===p),{indexData:f,valueData:m}=As(t,i,n,r,a,p,{xNeedsValueOf:c,yNeedsValueOf:h,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),y=is(p,f,g?.midpointIndices),b={maxRange:p,indexData:f,valueData:m,midpointIndices:y};function x(){return Gv([r,a],t,i,n,{smallestKeyInterval:o,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u})?.filter(I=>I.maxRange!==p)??[]}return{immediate:[b],computeRemaining:x}}var go=Symbol("is-dark-theme"),Qr=Symbol("default-shadow-colour"),hr=Symbol("default-caption-layout-style"),ur=Symbol("default-caption-alignment"),hg=Symbol("palette-up-stroke"),ug=Symbol("palette-down-stroke"),dg=Symbol("palette-up-fill"),pg=Symbol("palette-down-fill"),gg=Symbol("palette-neutral-stroke"),fg=Symbol("palette-neutral-fill"),mg=Symbol("palette-alt-up-stroke"),yg=Symbol("palette-alt-down-stroke"),bg=Symbol("palette-alt-up-fill"),vg=Symbol("palette-alt-down-fill"),xg=Symbol("palette-gray-fill"),Sg=Symbol("palette-gray-stroke"),ou=Symbol("default-polar-series-stroke"),lu=Symbol("default-sparkline-crosshair-stroke"),ki=Symbol("default-financial-charts-annotation-stroke"),Mg=Symbol("default-hierarchy-strokes"),cu=Symbol("default-text-annotation-color"),Li=Symbol("default-financial-charts-annotation-background-fill"),hu=Symbol("default-annotation-handle-fill"),uu=Symbol("default-annotation-statistics-fill"),du=Symbol("default-annotation-statistics-stroke"),pu=Symbol("default-annotation-statistics-color"),gu=Symbol("default-annotation-statistics-divider-stroke"),Ig=Symbol("default-annotation-statistics-fill"),Dg=Symbol("default-annotation-statistics-stroke"),fu=Symbol("default-textbox-fill"),mu=Symbol("default-textbox-stroke"),yu=Symbol("default-textbox-color"),tc=Symbol("default-toolbar-position");function $w(e,t){return"context"in e}function jv(e,t){return e!=null&&$w(e,t)&&t!=null&&typeof t=="object"&&t.context===void 0?(t.context=e.context,!0):!1}function Nn(e,t,i){if(Array.isArray(e)){for(const n of e)if(jv(n,i))break}else jv(e,i);return t(i)}var Hv=class{constructor(){this.cache=new WeakMap}call(e,t,i){let n,s=this.cache.get(t);try{n=JSON.stringify(i)}catch{return this.invoke(e,t,s,void 0,i)}return s==null&&(s=new Map,this.cache.set(t,s)),s.has(n)?s.get(n):this.invoke(e,t,s,n,i)}invoke(e,t,i,n,s){try{const r=Nn(e,t,s);return i&&n!=null&&i.set(n,r),r}catch(r){ji("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}},$v=class{constructor(e,t=e.defaultView){this.fallbackDocument=e,this.fallbackWindow=t,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(e){if(this.container=e,e==null)return;const t=e.ownerDocument,i=t.defaultView??void 0,n=t!==this.document;n&&this.removeWindowEvents(),this.cachedDocument=t,this.cachedWindow=i,n&&this.reattachWindowEvents()}removeWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:i,options:n}of t)this.window.removeEventListener(e,i,n)}reattachWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:i,options:n}of t)this.window.addEventListener(e,i,n)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(e,t){return this.window.getComputedStyle(e,t)}matchMedia(e){return this.window.matchMedia?.(e)}getSelection(){return this.window.getSelection()}requestAnimationFrame(e){return this.window.requestAnimationFrame(e)}cancelAnimationFrame(e){this.window.cancelAnimationFrame(e)}shimIdleCallback(e,t){return setTimeout(()=>e(null),t?.timeout)}requestIdleCallback(e,t){return typeof this.window.requestIdleCallback=="function"?this.window.requestIdleCallback(e,t):this.shimIdleCallback(e,t)}cancelIdleCallback(e){return typeof this.window.cancelIdleCallback=="function"?this.window.cancelIdleCallback(e):clearTimeout(e)}attachListener(e,t,i){let n=this.windowEvents.get(e);n==null&&(n=new Set,this.windowEvents.set(e,n));const s=()=>{n?.delete(a),n?.size===0&&this.windowEvents.delete(e)},r=oe(i)&&i.once?o=>{s(),t(o)}:t,a={listener:r,options:i};return n.add(a),this.window.addEventListener(e,r,i),()=>{s(),this.window.removeEventListener(e,r,i)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return this.document.readyState==="complete"}createElement(e,t,i){const n=this.document.createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const s of t.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}createSvgElement(e){return this.document.createElementNS("http://www.w3.org/2000/svg",e)}createResizeObserver(e){const t=this.window.ResizeObserver;if(t!=null)return new t(e)}createIntersectionObserver(e,t){const i=this.window.IntersectionObserver;if(i!=null)return new i(e,t)}};function Cg(e,t,i=1/0){const n=t,s=i,r=e%180*(Math.PI/180),a=Math.abs(Math.sin(r)),o=Math.abs(Math.cos(r));if(a===0)return{width:n,height:s};if(o===0)return{width:s,height:n};if(!Number.isFinite(s)){const c=o/a,h=n/(o+c*a);return{width:h,height:c*h}}const l=o*o-a*a;if(l===0){const c=Math.min(n,s)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((n*o-s*a)/l),height:Math.abs((s*o-n*a)/l)}}function Uw(e,t,i=1/0){const n=t,s=i,r=e%180*(Math.PI/180),a=Math.abs(Math.sin(r)),o=Math.abs(Math.cos(r));return a===0?{width:n,height:s}:o===0?{width:s,height:n}:{width:n*o+s*a,height:n*a+s*o}}function Ag(e,t,i,n=0,s=0){const r=Math.cos(i),a=Math.sin(i),o=e-n,l=t-s;return{x:n+o*r-l*a,y:s+o*a+l*r}}var dn=Math.PI*2,ic=Math.PI/2;function yi(e){return e%=dn,e+=dn,e%=dn,e}function Ww(e){return e%=dn,e+=dn,e!==dn&&(e%=dn),e}function bu(e){return e%=dn,e<-Math.PI?e+=dn:e>=Math.PI&&(e-=dn),e}function dr(e,t,i){const n=yi(e),s=yi(t),r=yi(i);return sr?s<=n||n<=r:t!==i}function $t(e){return e/180*Math.PI}function Kw(e){return e/Math.PI*180}function vu(e,t){return e=yi(e),t=yi(t),t-e+(e>t?dn:0)}function Uv(e){const t=yi(e);return t<=ic?t/ic:t<=Math.PI?(Math.PI-t)/ic:t<=1.5*Math.PI?(t-Math.PI)/ic:(dn-t)/ic}function wg(e,t,i){const n=Uv(i);return e*n+t*Math.abs(1-n)}function ws(e){return e?yi($t(e)):0}var kg=class{constructor(){this.queue=[]}waitForCompletion(e=50){const t=this.queue;function i(n){function s(){clearTimeout(a),n(!0)}function r(){const o=t.indexOf(s);o<0||(t.splice(o,1),n(!1))}const a=setTimeout(r,e);t.push(s)}return new Promise(i)}notify(){for(const e of this.queue.splice(0))e()}};function Lg(e=0){function t(i){setTimeout(i,e)}return new Promise(t)}async function Yw(e,t,i=`Timeout after ${t}ms`){let n;const s=new Promise((r,a)=>{n=setTimeout(()=>a(new Error(i)),t)});try{return await Promise.race([e,s])}finally{clearTimeout(n)}}function pr(e){return e==="true"}function Zw(e){return Number(e)}function Ki(e){return e}var Xw={role:Ki,"aria-checked":pr,"aria-controls":Ki,"aria-describedby":Ki,"aria-disabled":pr,"aria-expanded":pr,"aria-haspopup":Ki,"aria-hidden":pr,"aria-label":Ki,"aria-labelledby":Ki,"aria-live":Ki,"aria-orientation":Ki,"aria-selected":pr,"data-focus-override":pr,"data-focus-visible-override":pr,"data-preventdefault":pr,class:Ki,for:Ki,id:Ki,tabindex:Zw,title:Ki,placeholder:Ki};function Se(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function ea(e,t){if(t!=null)for(const[i,n]of Dt(t))i!=="class"&&Se(e,i,n)}function ta(e,t,i){if(!Nl(e))return;const n=e.getAttribute(t);return n===null?i:Xw[t]?.(n)??void 0}function On(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function Wv(e,t){for(const[i,n]of Dt(t))On(e,i,n)}function si(e,t){const i=Array.isArray(e)?e:e.split(".");if(i.length===1){const[n]=i;return sr((s,r,a)=>s[n]=a,s=>s[n],t)}return sr((n,s,r)=>qp(n,i,r),n=>Zp(n,i),t)}function qw(e){return sr((t,i,n)=>t[e]=n)}function ot(e,t){return sr((i,n,s)=>i[e][t??n]=s)}function _t(e){const{newValue:t,oldValue:i,changeValue:n}=e;return sr((s,r,a,o)=>(a!==o&&(o!==void 0&&i?.call(s,o),a!==void 0&&t?.call(s,a),n?.call(s,a,o)),a))}function ns(e){return Wp(e)}var ia=class extends ce{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};v([_t({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),S],ia.prototype,"enabled",2),v([ot("node","stroke"),S],ia.prototype,"stroke",2),v([ot("node","strokeOpacity"),S],ia.prototype,"strokeOpacity",2),v([_t({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),S],ia.prototype,"strokeWidth",2);function Tg(e,t,i,n,s){return te.x&&ie.y}function xu(e,t,i,n=0,s=0){return t>=e.x&&t+n<=e.x+e.width&&i>=e.y&&i+s<=e.y+e.height}function Jw(e){return e==null||e.height===0||e.width===0||Number.isNaN(e.height)||Number.isNaN(e.width)}function Su(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 En(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2);i(s)?(n=s,e=s+1):t=s-1}return n}function fo(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2);i(s)?(n=s,t=s-1):e=s+1}return n}function Qw(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2),r=i(s);r==null?t=s-1:(n=r,e=s+1)}return n}function ek(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2),r=i(s);r==null?e=s+1:(n=r,t=s-1)}return n}function Kv(e=0,t=0){const i=Ih();return new i(e,t).getContext("2d")}var tk=800,ik=600,nk={quality:1};function sk(e){const t=class extends e{constructor(...n){super(...n),this.gpu=!1}toBuffer(n,s){return super.toBuffer(n,{...s,msaa:!1})}transferToImageBitmap(){const{width:n,height:s}=this,r=new t(Math.max(1,n),Math.max(1,s));return n>0&&s>0&&r.getContext("2d").drawCanvas(this,0,0,n,s),Object.defineProperty(r,"close",{value:()=>{}}),r}};return t}var Yv=!1;function rk(e,t){Yv||(Yv=!0,Object.defineProperty(e.prototype,"fillText",{value:function(i,n,s){let r=this.outlineText(i);r=r.transform(new t([1,0,0,1,n,s])),this.fill(r)},writable:!0,configurable:!0}))}var ak=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},Zv=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 Ng(e,t){return e.valueOf()-t.valueOf()}function ok(e){let t=Number.NaN;const i=[];for(const n of e){const s=n.valueOf();t!==s&&i.push(n),t=s}return i}function Og(e){const t=e.slice().sort(Ng);return Eg(t)==null?ok(t):t}function Eg(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 n of e){const s=n.valueOf();if(Math.sign(s-i)!==t)return;i=s}return t}function Rg(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");ji(i)}}function lk(e,t){const i=Rg(),n=t?.default;return sr((s,r,a)=>(a!==n&&i(r.toString(),e),a))}function ck(e,t){const i=Rg();return sr((n,s,r)=>(r!==n[e]&&(i(s.toString(),`Use [${e}] instead.`),qp(n,e,t?t(r):r)),Wh),(n,s)=>(i(s.toString(),`Use [${e}] instead.`),Zp(n,e)))}function Xv(e,t){const i=Math.max(e.length,t.length),n=new Set,s=new Set;for(let r=0;r0||s.size>0,added:n,removed:s}}function nc(e,t,i,n){const s=e-i,r=t-n;return s*s+r*r}function Mu(e,t,i,n,s,r,a){if(i===s&&n===r)return Math.min(a,nc(e,t,i,n));const o=s-i,l=r-n,c=Math.max(0,Math.min(1,((e-i)*o+(t-n)*l)/(o*o+l*l))),h=i+c*o,u=n+c*l;return Math.min(a,nc(e,t,h,u))}function hk(e,t,i,n,s,r,a,o,l){o&&([a,r]=[r,a]);const c=Math.atan2(t-n,e-i);if(!dr(c,r,a)){const u=i+Math.cos(r)*s,d=n+Math.sin(r)*s,p=i+Math.cos(r)*s,g=n+Math.sin(r)*s;return Math.min(l,nc(e,t,u,d),nc(e,t,p,g))}const h=s-Math.sqrt(nc(e,t,i,n));return Math.min(l,h*h)}function na(e,t){if(e.length===0)return null;if(t!==void 0){const r=e.at(0),a=e.at(-1),o=r instanceof Date?r.getTime():r,l=a instanceof Date?a.getTime():a;if(typeof o=="number"&&typeof l=="number")return t===1?[o,l]:[l,o]}let i=1/0,n=-1/0;for(const r of e){const a=r instanceof Date?r.getTime():r;typeof a=="number"&&(an&&(n=a))}const s=[i,n];return s.every(Number.isFinite)?s:null}function Iu(e,t,i,n,s,r,a){let o=!1;const l=na(e,a),c=l&&r?[r(l[0]),r(l[1])]:l;if(c==null){let d;return t!=null&&i!=null&&t<=i?d=[t,i]:n!=null&&s!=null&&n<=s&&(d=[n,s]),{extent:d??[],clipped:!1}}let[h,u]=c;return t!=null?(o||(o=t>h),h=t):n!=null&&nu&&(u=s),h>u?{extent:[],clipped:!1}:{extent:[h,u],clipped:o}}function Du(e,t,i,n,s){const{extent:r,clipped:a}=Iu(e.domain,Hi(t)?new Date(t):t,Hi(i)?new Date(i):i,Hi(n)?new Date(n):n,Hi(s)?new Date(s):s,o=>new Date(o),e.sortMetadata?.sortOrder);return{extent:r.map(o=>new Date(o)),clipped:a}}var uk=new Intl.NumberFormat("en-US",{style:"percent"});function mo(e,t=2){return typeof e=="number"?Qv(e,t):typeof e=="string"?e:String(e??"")}function qv(e){return uk.format(e)}var Jv=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Qv(e,t){let i=Jv.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),Jv.set(t,i)),i.format(e)}function ex(e){return Array.isArray(e)&&e.length>=2&&e.every(Pe)}function Cu(e){return Array.isArray(e)&&e.length>=2&&e.every(ex)}function dk(e){const t=e[0],i=e.at(-1);return i===void 0?!1:Di(t[0],i[0],.001)&&Di(t[1],i[1],.001)}function tx(e){return Array.isArray(e)&&e.every(Cu)&&e.every(dk)}function ix(e){if(e===null)return!0;if(!oe(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(ix);case"MultiPolygon":return Array.isArray(i)&&i.every(tx);case"Polygon":return tx(i);case"MultiLineString":return Array.isArray(i)&&i.every(Cu);case"LineString":return Cu(i);case"MultiPoint":return Cu(i);case"Point":return ex(i);default:return!1}}function pk(e){return oe(e)&&e.type==="Feature"&&ix(e.geometry)}function gk(e){return oe(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(pk)}var nx=fe(gk,"a GeoJSON object"),sx=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 rx(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:n}=e,s=n.get(i);s?s.includes(t)||(this.singleValueEdges?.has(i)?n.set(i,[t]):(s.push(t),this._edgeCount++)):(n.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 n=e.edges.get(i);if(!n)return;const s=n.indexOf(t);s!==-1&&(n.splice(s,1),n.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 n of i)yield[n,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 n=i==null?this.neighbours(e):this.neighboursWithEdgeValue(e,i);if(n){for(const s of n)if(this.getVertexValue(s)===t)return s}}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let s;for(const r of t)if(s=(s??e).readCachedNeighbours()?.get(r),!s)return;return s}if(t.length===0)return;let n=e;for(const s of t){const r=n?this.neighboursWithEdgeValue(n,i):void 0;if(!r)return;n=r.find(a=>a.value===s)}return n}adjacent(e,t){for(const[,i]of e.edges)if(i.includes(t))return!0;return!1}},rx=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()}},Pg="class-instance";function ss(e,t,i){if(le(t)){if(!le(e)||e.length!==t.length||t.some((n,s)=>ss(e[s],n,i)!=null))return t}else if(be(t)){if(!be(e))return t;const n={},s=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of s)if(e[r]!==t[r])if(i?.has(r))n[r]=t[r];else if(typeof e[r]==typeof t[r]){const a=ss(e[r],t[r],i);a!==null&&(n[r]=a)}else n[r]=t[r];return Object.keys(n).length?n:null}else if(e!==t)return t;return null}function ax(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Ee(e,t){return le(e)?fk(e,t):be(e)?mk(e,t):e instanceof Map?new Map(Ee(Array.from(e))):sa(e)}function fk(e,t){const i=[],n=t?.seen;for(const s of e){if(typeof s=="object"&&n?.includes(s)){Kn("cycle detected in array",s);continue}n?.push(s),i.push(Ee(s,t)),n?.pop()}return i}function mk(e,t){const i={};for(const n of Object.keys(e))t?.assign?.has(n)?i[n]=e[n]:t?.shallow?.has(n)?i[n]=sa(e[n]):i[n]=Ee(e[n],t);return i}function sa(e){return le(e)?e.slice(0):be(e)?{...e}:Sn(e)?new Date(e):zb(e)?new RegExp(e.source,e.flags):e}function gr(e,t,i,n,s,r){if(le(e)){r=t(e,n,s,r);let a=0;for(const o of e)r=gr(o,t,i,n?.[a],s,r),a++}else if(be(e)){r=t(e,n,s,r);for(const a of Object.keys(e)){if(i?.has(a))continue;const o=e[a];r=gr(o,t,i,n?.[a],s,r)}}return r}function sc(e,t,i={}){const{path:n,matcherPath:s=n?.replace(/(\[[0-9+]+])/i,"[]"),skip:r=[]}=i;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${n??""}`);if(t==null)return e;if(lo(e))return e.set(t);const a=e,o=Fg(e);for(const l of Object.keys(t)){if(Xp.has(l))continue;const c=`${s?s+".":""}${l}`;if(r.includes(c))continue;const h=t[l],u=`${n?n+".":""}${l}`,d=a.constructor,p=a[l];try{const g=Fg(p),f=Fg(h);if(o===Pg&&!(l in e||l==="context")){if(h===void 0)continue;Kn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(g!=null&&f!=null&&f!==g&&(g!==Pg||f!=="object")){Kn(`unable to set [${u}] in ${d?.name} - can't apply type of [${f}], allowed types are: [${g}]`);continue}if(lo(p))h===void 0?p.clear():p.set(h);else if(f==="object"&&l!=="context"){if(!(l in a)){Kn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}p==null?a[l]=h:sc(p,h,{...i,path:u,matcherPath:c})}else a[l]=h}catch(g){Kn(`unable to set [${u}] in [${d?.name}]; nested error is: ${g.message}`)}}return e}function Fg(e){return e==null?null:wp(e)||Sn(e)?"primitive":le(e)?"array":oe(e)?be(e)?"object":Pg:Xn(e)?"function":"primitive"}function Fe(e,t,i,n){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)}function Vg(e,t,i){return Fe(e,"keydown",n=>{const s=i?.()??["Escape"];Au(n,...s)&&t(n)})}function ox(e,t){const i=e.ownerDocument.defaultView,n=Fe(i,"mousedown",s=>{[0,2].includes(s.button)&&!cx(e,s)&&(t(),n())});return n}function lx(e,t){const i=e.ownerDocument.defaultView,n=Fe(i,"touchstart",s=>{Array.from(s.targetTouches).some(a=>!cx(e,a))&&(t(),n())});return n}function cx(e,t){return Ip(t.target)&&t.target.shadowRoot!=null?!0:Dh(t.target)&&e.contains(t.target)}function hx(e,t,i){const n=s=>{for(const r of t)Se(r,"data-focus-visible-override",s)};return n(i),Fe(e,"keydown",()=>n(!0),{once:!0})}function rc(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function Au(e,...t){return rc(e)&&t.includes(e.key)}function ux(e,t,i){return Fe(e,"keydown",n=>{Au(n,i)&&t.focus()})}var yk={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},bk={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function ac(e,t){return t&&e==="horizontal"?bk:yk[e]}function vk(e){const{orientation:t,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:r,onBlur:a}=e,{nextKey:o,prevKey:l}=ac(t,Qa(i[0])),c=p=>{if(p.target&&"tabIndex"in p.target){for(const g of i)g.tabIndex=-1;p.target.tabIndex=0}},[h,u]=n?[i.length,i.length]:[0,1/0],d=new tt;for(let p=0;p{Au(y,o,l)&&y.preventDefault()})),f.tabIndex=p===0?0:-1}return d}function xk(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function _g(e){return"button"in e?e.button===0:rc(e)&&(e.code==="Space"||e.key==="Enter")}function Bg(e){const t=e?.target;if(Ip(t)&&"tabindex"in t.attributes)return t}function dx(e){return Fe(e,"keydown",t=>{if(t.defaultPrevented)return;ta(t.target,"data-preventdefault",!0)&&Au(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var zg=new Map,px=1;function Sk(){zg.clear(),px=1}function Rn(e){const t=e.constructor;let i=Object.hasOwn(t,"className")?t.className:t.name;kb(()=>{if(!i)throw new Error(`The ${String(t)} is missing the 'className' property.`)}),i??(i="Unknown");const n=(zg.get(i)??0)+1;return zg.set(i,n),`${i}-${n}`}function oc(){return`ag-charts-${px++}`}function wu(){return crypto.randomUUID?.()??Mk()}function Mk(){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;i0)n={value:r,next:n},s=n;else{for(s=s;s.next!=null&&i(s.next.value,r)<=0;)s=s.next;s.next={value:r,next:s.next}}return n}var lc=new WeakMap;function yo(e,t){const i=JSON.stringify(e,null,0);return lc.has(t)||lc.set(t,new Map),lc.get(t)?.has(i)||lc.get(t)?.set(i,t(e)),lc.get(t)?.get(i)}var Gg=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function cc(e,t){let i=new Gg;const n=(...s)=>{let r=i;for(const a of s){const o=typeof a=="object"||typeof a=="symbol"?r.weak:r.strong;let l=o.get(a);l==null&&(l=new Gg,o.set(a,l)),r=l}if(r.set)return t?.("hit",e,s),r.value;{const a=e(...s);return r.set=!0,r.value=a,t?.("miss",e,s),a}};return n.reset=()=>{i=new Gg},n}function Ut(e,t){const i=new Map,n=(...a)=>a.map(o=>typeof o=="object"||typeof o=="symbol"?o:(i.has(o)||i.set(o,{v:o}),i.get(o))),s={},r=new WeakMap;return(...a)=>{const o=a.length===0?[s]:n(...a);let l=r;for(const u of o.slice(0,-1))l.has(u)||l.set(u,new WeakMap),l=l.get(u);const c=o.at(-1);let h=l.get(c);return h?t?.("hit",e,a):(h=e(...a),l.set(c,h),t?.("miss",e,a)),h}}function ku(e,t,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const r of i){const a=r.distanceSquared(e,t);if(a===0)return{nearest:r,distanceSquared:0};a{})}function $g(e,t){const i=rr(t);if(i.length===0)return;const n=Iv(e);for(const s of i)s in n&&(t[s]=n[s])}var mx=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},Ug=class zi extends mx{constructor(t,i,n){super(),this.defaultState=t,this.states=i,this.enterEach=n,this.debug=wb(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,jg)}transition(t,i){if(!this.transitionChild(t,i)||this.state===zi.child||this.state===zi.parent)return;const s=this.state,r=this.states[this.state];let a=r[t];const o=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(a))a=a.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${o} (guarded)`,h.target,Hg),u});else if(typeof a=="object"&&!(a instanceof zi)&&a.guard&&!a.guard(i)){this.debug(`${o} (guarded)`,a.target,Hg);return}if(!a){this.debug(`${o} ${this.state}`,Hg);return}const l=this.getDestinationState(a),c=l===this.state?void 0:r.onExit;this.debug(`${o} ${l}`,jg),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof zi)&&a.action?.(i),c?.(),this.enterEach?.(s,l),l!==s&&l!==zi.child&&l!==zi.parent&&this.states[l].onEnter?.(s,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===zi.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!==zi.child||!this.childState||($g(this,this.childState),this.childState.transition(t,i),!this.childState.is(zi.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,jg),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 zi?(this.childState=t,this.childState.parent=this,i=zi.child):typeof t=="object"&&(t.target instanceof zi?(this.childState=t.target,this.childState.parent=this,i=zi.child):t.target!=null&&(i=t.target)),i}};Ug.child="__child",Ug.parent="__parent";var hc=Ug,Ck=class extends mx{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)$g(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)$g(this,i),i.transitionAsync(e,t)}},Wg=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:n=t.emHeightAscent,fontBoundingBoxDescent:s=t.emHeightDescent}=t,r=n+s;return{width:i,height:r,ascent:n,descent:s}}measureLines(e){const t=typeof e=="string"?e.split(Zs):e;let i=0,n=0;const s=t.map(r=>{const a=this.measureText(r);return i1?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}},Kg=new Mh(50);function bi(e){typeof e=="object"&&(e=kp(e));let t=Kg.get(e);if(t)return t;const i=new Mh(1e4),n=Kv();return n.font=e,t=new Wg(n,s=>{let r=i.get(s);return r||(r=n.measureText(s),i.set(s,r),r)}),Kg.set(e,t),t}bi.clear=()=>Kg.clear();function ks(e,t){let i={segments:[],width:0,height:0,ascent:0,descent:0};const n=[i];for(const a of e){const{text:o,fontSize:l=t.fontSize,fontStyle:c=t.fontStyle,fontWeight:h=t.fontWeight,fontFamily:u=t.fontFamily,...d}=a,p={fontSize:l,fontStyle:c,fontWeight:h,fontFamily:u},g=bi(p),f=ft(o).split(Zs);for(let m=0;m0&&(i={segments:[],width:0,height:0,ascent:0,descent:0},n.push(i)),y&&(i.width+=b.width,i.ascent=Math.max(i.ascent,b.ascent),i.descent=Math.max(i.descent,b.descent),i.height=Math.max(i.height,i.ascent+i.descent),i.segments.push({...p,...d,text:y,textMetrics:b}))}}let s=0,r=0;for(const a of n)s=Math.max(s,a.width),r+=a.height;return{width:s,height:r,lineMetrics:n}}function me(e,t,i){const n=$r().createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const s of t.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}function lt(e){return $r().createElementNS("http://www.w3.org/2000/svg",e)}function yx(e,t){const i=$r("body"),n=me("a",{display:"none"});n.href=e,n.download=t,i.appendChild(n),n.click(),setTimeout(()=>n.remove())}function bx(e,t){return t.overflow==="hide"&&e.some(Xs)}function Lu(e,t){return le(e)?Zg(e,t):Yg(ft(e),t).join(` `)}function vx(e,t){return Yg(e,t).join(` `)}function Yg(e,t){return Tu(e,t)}function aa(e,t,i,n){const s=t.textWidth(Ja),r=Ss(e);let a=0,o=0;for(const c of r){const h=t.textWidth(c);if(a+h>i)break;a+=h,o+=c.length}if(o===e.length&&(!n||a+s<=i))return n?Tp(e):e;e=e.slice(0,o).trimEnd();const l=Ss(e);for(;l.length&&t.textWidth(e)+s>i;){for(l.pop();l.length&&l.at(-1).trim()==="";)l.pop();e=l.join("")}return Tp(e)}function Tu(e,t,i=0){const n=e.split(Zs),s=bi(t.font),r=[];if(t.textWrap==="never"){for(const c of n){const h=aa(c.trimEnd(),s,Math.max(0,t.maxWidth-i));if(!h)break;r.push(h),i=0}return bx(r,t)?[]:r}const a=t.textWrap==="hyphenate",o=t.textWrap==null||t.textWrap==="on-space";for(const c of n){let h=c.trimEnd();if(h===""){r.push(h);continue}let u=Ss(h),d=0,p=0,g=0,f=0;for(r.length||(g=i);dt.maxWidth){if(d===0){h="";break}let y=s.textWidth(h.slice(0,p+m.length));if(r.length||(y+=i),y<=t.maxWidth){g=y,p+=m.length,d++;continue}if(f){const I=Ak(h,f+1),C=s.textWidth(I);if(C<=t.maxWidth){r.push(h.slice(0,f).trimEnd()),h=h.slice(f).trimStart(),u=Ss(h),d=0,p=0,g=0,f=0;continue}else o&&C>t.maxWidth&&r.push(h.slice(0,f).trimEnd(),aa(h.slice(f).trimStart(),s,t.maxWidth,!0))}else if(o){const I=aa(h,s,t.maxWidth,!0);I&&r.push(I)}if(o){h="";break}const b=a?"-":"";let x=h.slice(0,p).trim();const M=Ss(x);for(;M.length&&s.textWidth(x+b)>t.maxWidth;){for(M.pop();M.length&&M.at(-1).trim()==="";)M.pop();x=M.join("")}if(x&&x!==El)r.push(Np(x)+b);else{h="";break}h=h.slice(x.length).trimStart(),u=Ss(h),d=0,p=0,g=0,f=0;continue}p+=m.length,d++}h&&r.push(h)}wk(r,s,t);const l=xx(r,s,t);return bx(l,t)?[]:l}function Ak(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}function xx(e,t,i){if(!Pe(i.maxHeight))return e;const{height:n,lineMetrics:s}=t.measureLines(e);if(n<=i.maxHeight)return e;for(let r=0,a=0;ri.maxHeight){if(i.overflow==="hide"||r===0)return[];const o=e.slice(0,r),l=o.pop();return o.concat(Xs(l)?l:aa(l,t,i.maxWidth,!0))}return e}function wk(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:n}=e,s=e[n-1],r=e[n-2];if(Ss(r).lengthi){n.length&&a();break}if(s+o<=t.maxWidth){s+=o,r+=l,n.push(...c);continue}for(const h of c){if(s+h.textMetrics.width<=t.maxWidth){s+=h.textMetrics.width,n.push(h);continue}const u=bi(h),d=jb(h.text),p={...t,font:h,maxHeight:i-r};let g=Tu(d,{...p,overflow:"hide"},s);if(g.length===0)if(t.textWrap==="never")g=Tu(d,p,s);else{g=Tu(d,p);const y=n.at(-1);y&&(y.text+=` `,s=0)}if(g.length===0){a();break}const f=g.findIndex(Xs);f!==-1&&(g=g.slice(0,f+1));const m=g.at(-1);for(const y of g){const b=Hb(y),x=u.measureText(b),M={...h,text:b,textMetrics:x};y===m?s+=x.width:(M.text+=` `,s=0),r+=x.height,n.push(M)}if(f!==-1)break}}return n}function Nu(e,[t,i],[n,s]){const r=s-n,a=i-t,o=t+a*e[0],l=t+a*e[1];return[(o-n)/r,(l-n)/r]}var bo=1e3,fr=bo*60,oa=fr*60,la=oa*24,Sx=la*7,Xg=la*30,uc=la*365,vo=new Date().getTimezoneOffset()*fr,xo={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:bo,hierarchy:"day",encode(e,t){const i=t?0:vo;return Math.floor((e.getTime()-i)/bo)},decode(e,t){const i=t?0:vo;return new Date(i+e*bo)}},minute:{milliseconds:fr,hierarchy:"day",encode(e,t){const i=t?0:vo;return Math.floor((e.getTime()-i)/fr)},decode(e,t){const i=t?0:vo;return new Date(i+e*fr)}},hour:{milliseconds:oa,hierarchy:"day",encode(e,t){const i=t?0:vo;return Math.floor((e.getTime()-i)/oa)},decode(e,t){const i=t?0:vo;return new Date(i+e*oa)}},day:{milliseconds:la,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*fr;return Math.floor((e.getTime()-i)/la)},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:Xg,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),n=e-i*12;return new Date(Date.UTC(i,n,1))}else{const i=Math.floor(e/12),n=e-i*12;return new Date(i,n,1)}}},year:{milliseconds:uc,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 So(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 dc(e,t,i,n){if(i==null)return 0;const s=xo[e];return Math.floor(s.encode(new Date(i),n))%t}function Mo(e,t,i,n,s){const r=xo[t];return Math.floor((r.encode(new Date(e),n)-s)/i)}function Io(e,t,i,n,s){return xo[t].decode(e*i+s,n)}function Ou(e,t,i,n,s){const r=new Date(e),a=Mo(r,t,i,n,s);return Io(a,t,i,n,s)}function Eu(e,t,i,n,s){const r=new Date(Number(e)-1),a=Mo(r,t,i,n,s);return Io(a+1,t,i,n,s)}function Ti(e,t){const{unit:i,step:n,epoch:s,utc:r}=So(e),a=dc(i,n,s,r);return Ou(t,i,n,r,a)}function Mx(e,t){const{unit:i,step:n,epoch:s,utc:r}=So(e),a=dc(i,n,s,r);return Eu(t,i,n,r,a)}function Ix(e,t){const{unit:i,step:n,epoch:s,utc:r}=So(e),a=dc(i,n,s,r);return Io(Mo(Eu(t,i,n,r,a),i,n,r,a)-1,i,n,r,a)}function qg(e,t){const{unit:i,step:n,epoch:s,utc:r}=So(e),a=dc(i,n,s,r);return Io(Mo(Ou(t,i,n,r,a),i,n,r,a)+1,i,n,r,a)}function Jg(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const n=t.valueOf()-e.valueOf(),s=e.valueOf();e=new Date(s+i[0]*n),t=new Date(s+i[1]*n)}return[new Date(e),new Date(t)]}function pc(e,t,i,{extend:n=!1,visibleRange:s=[0,1],limit:r,defaultAlignment:a="start"}={}){const o=So(e),{unit:l,step:c,utc:h}=o;let u;o.epoch!=null?u=o.epoch:a==="interval"?u=void 0:t.valueOf()>i.valueOf()?u=i:u=t;const d=dc(o.unit,o.step,u,o.utc);let[p,g]=Jg(t,i,s);p=n?Ou(p,l,c,h,d):Eu(p,l,c,h,d),g=n?Eu(g,l,c,h,d):Ou(g,l,c,h,d);const f=Mo(p,l,c,h,d);let m=Mo(g,l,c,h,d);return r!=null&&m-f>r&&(m=f+r),{range:[f,m],unit:l,step:c,utc:h,offset:d}}function Ru(e,t,i,n){const{range:[s,r]}=pc(e,t,i,n);return Math.abs(r-s)}function Yi(e,t,i,n){const{range:[s,r],unit:a,step:o,utc:l,offset:c}=pc(e,t,i,n),h=[];for(let u=s;u<=r;u+=1){const d=Io(u,a,o,l,c);h.push(d)}return h}function Dx(e,t,i,n){const{range:[s,r],unit:a,step:o,utc:l,offset:c}=pc(e,t,i,n),h=Math.max(0,r-s+1),u=new Array(h);for(let d=0;d0?1:-1))}else if(n.setMonth(e.getMonth()+t),t!==0)for(;n.getMonth()===e.getMonth();)n.setDate(n.getDate()+(t>0?1:-1));return n}},year:{adjust(e,t,i){const n=new Date(e.getTime());return i?n.setUTCFullYear(e.getUTCFullYear()+t):n.setFullYear(e.getFullYear()+t),n}}};function Ok(e,t){const{unit:i,step:n,utc:s}=So(e);return Nk[i].adjust(t,-n,s)}function Ls(e){return typeof e=="string"?e:e.unit}function yr(e){return typeof e=="string"?1:e.step??1}function gc(e){return typeof e=="string"?void 0:e.epoch}function fc(e){return xo[Ls(e)].hierarchy}function vi(e){return yr(e)*xo[Ls(e)].milliseconds}var Ax=["millisecond","second","minute","hour","day","month","year"];function Ek(e){return be(e)?"unit"in e&&Ax.includes(e.unit):!1}function Rk(e){return rt(e)&&Ax.includes(e)}var ct=(e,t)=>({duration:vi(e)*t,timeInterval:e,step:t}),Pu=[ct({unit:"second"},1),ct({unit:"second"},5),ct({unit:"second"},15),ct({unit:"second"},30),ct({unit:"minute"},1),ct({unit:"minute"},5),ct({unit:"minute"},15),ct({unit:"minute"},30),ct({unit:"hour"},1),ct({unit:"hour"},3),ct({unit:"hour"},6),ct({unit:"hour"},12),ct({unit:"day"},1),ct({unit:"day"},2),ct({unit:"day",step:7},1),ct({unit:"day",step:7},2),ct({unit:"day",step:7},3),ct({unit:"month"},1),ct({unit:"month"},2),ct({unit:"month"},3),ct({unit:"month"},4),ct({unit:"month"},6),ct({unit:"year"},1)],wx=[1,2,5,10];function kx(e,t){return Math.abs(Math.round(e)-e)=i?Math.abs(t-e)/i+1:1}function Do(e,t,i,n,s,r){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(i<2)return{ticks:[e,t],count:2,firstTickIndex:0};const a=Co(e,t,i,n,s);if(!Number.isFinite(a))return{ticks:[],count:0,firstTickIndex:void 0};let o=e,l=t;kx(o/a,1e-12)||(o=Math.ceil(o/a)*a),kx(l/a,1e-12)||(l=Math.floor(l/a)*a),r!=null&&(r=Nu(r,[e,t],[o,l]));const{ticks:c}=Fu(o,l,a,r),h=c.at(0);return{ticks:c,count:Lx(o,l,a),firstTickIndex:h==null?void 0:Math.round((h-o)/a)}}var Pk=Math.floor(2*Sx/Xg*10)/10;function Tx({timeInterval:e,step:t}){const i=vi(e)*t,n=fc(e),s=n?vi(n):void 0;return i<=(s??1/0)*Pk}function tf(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function mc(e,t,i,n,s,{weekStart:r,primaryOnly:a=!1,targetInterval:o}){if(i<=0)return;const l=o??Math.abs(t-e)/Math.max(i,1),c=Pu.findLast(p=>(!a||Tx(p))&&l>p.duration),h=Pu.find(p=>(!a||Tx(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max(Co(e,t,i,n,s),1)};if(h==null)return{unit:"year",step:o==null?Co(e/uc,t/uc,i,n,s):1};const{timeInterval:u,step:d}=l-c.duration=n&&u<=s;if(c&&!d)continue;const p=Math.abs(u-i);(l>p||c!==d)&&(c||(c=d),l=p,o=h)}return o*a}function Nx(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function Fk(e,t){const i=Ph(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(s=>{if(!Number.isFinite(s))return 0;const[r,a]=s.toExponential((i.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+Nx(a)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const r=Math.floor(Math.log10(Math.abs(s))),a=i.type?6:12,o=s.toExponential(a-1).split(/[.e]/g)[1],l=Nx(o);return Math.max(0,l-r)}))));const n=_p(i);return s=>n(Number(s))}function Fu(e,t,i,n){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const s=10**Rh(i),r=Math.min(e,t),a=Math.max(e,t);let o,l;if(n!=null&&(n[0]!==0||n[1]!==1)){const u=t-e,d=e+u*n[0],p=t-u*(1-n[1]);o=Math.min(d,p),l=Math.max(d,p)}else o=r,l=a;o=Math.floor(o*s)/s,l=Math.ceil(l*s)/s;const c=[];for(let u=0;;u+=1){const d=Math.round((r+i*u)*s)/s;if(d>a)break;d>=o&&d<=l&&c.push(d)}const h=c.at(0);return{ticks:c,count:Lx(r,a,i),firstTickIndex:h==null?void 0:Math.round((h-r)/i)}}function Ao(e,t){return e>=t?(ji("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function nf(e,t){const i=Math.abs(t-e),n=10**Math.floor(Math.log10(i));let s=1/0,r=[e,t];for(const a of wx){const o=a*n,l=Math.floor(e/o)*o,c=Math.ceil(t/o)*o,h=1-i/Math.abs(c-l);s>h&&(s=h,r=[l,c])}return r}function Ox(e,t,i,n,s,r){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};r=Math.max(r,e/(s+1)),i??(i=r),n??(n=e),i>n&&(i===r?i=n:n=i),i=Math.max(i,1);const a=Math.max(1,Math.floor(e/(t*i))),o=Math.min(a,Math.ceil(e/(t*n))),l=te(o,Math.floor(s/t),a);return{minTickCount:o,maxTickCount:a,tickCount:l}}function Wt(e){return e instanceof Date?e.getTime():e}function yc(e){return e{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}function of(e){return e!=null&&Object.hasOwn(e,"toString")&&rt(e.toString())}function Ex(e){return e!=null&&Object.hasOwn(e,"valueOf")&&Pe(e.valueOf())}function _u(e){return Pe(e)||Fl(e)||Ex(e)}function Rx(e,t){return e!=null&&(!t||_u(e))}function Bu(e){return of(e)&&Object.hasOwn(e,"id")?e.id:e}function lf(e){return of(e)&&Object.hasOwn(e,"value")?e.value:e}var ca={};Mi(ca,{add:()=>Vk,angle:()=>jk,apply:()=>qk,distance:()=>Bk,distanceSquared:()=>zk,equal:()=>Zk,from:()=>Xk,gradient:()=>$k,intercept:()=>Uk,intersectAtX:()=>Kk,intersectAtY:()=>Wk,length:()=>zu,lengthSquared:()=>Px,multiply:()=>_k,normalized:()=>Gk,origin:()=>Fx,required:()=>Jk,rotate:()=>Hk,round:()=>Yk,sub:()=>cf});function Vk(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 cf(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 _k(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 zu(e){return Math.hypot(e.x,e.y)}function Px(e){return e.x*e.x+e.y*e.y}function Bk(e,t){return zu(cf(e,t))}function zk(e,t){return Px(cf(e,t))}function Gk(e){const t=zu(e);return{x:e.x/t,y:e.y/t}}function jk(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function Hk(e,t,i=Fx()){const n=zu(e);return{x:i.x+n*Math.cos(t),y:i.y+n*Math.sin(t)}}function $k(e,t,i){const n=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/n}function Uk(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function Wk(e,t,i=0,n){return{x:e===1/0?1/0:(i-t)/e,y:n==null?i:n-i}}function Kk(e,t,i=0,n){const s=e===1/0?1/0:e*i+t;return{x:i,y:n==null?s:n-s}}function Yk(e,t=2){return{x:Eh(e.x,t),y:Eh(e.y,t)}}function Zk(e,t){return e.x===t.x&&e.y===t.y}function Xk(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 qk(e,t){return e.x=t.x,e.y=t.y,e}function Jk(e){return{x:e?.x??0,y:e?.y??0}}function Fx(){return{x:0,y:0}}var ha={};Mi(ha,{bottomCenter:()=>nL,center:()=>iL,clone:()=>oL,collides:()=>lL,end:()=>eL,from:()=>cL,height:()=>rL,normalise:()=>Gu,origin:()=>hL,round:()=>aL,start:()=>Qk,topCenter:()=>tL,width:()=>sL});function Qk(e){return{x:e.x1,y:e.y1}}function eL(e){return{x:e.x2,y:e.y2}}function tL(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function iL(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function nL(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function sL(e){return Math.abs(e.x2-e.x1)}function rL(e){return Math.abs(e.y2-e.y1)}function aL(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function oL(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function lL(e,t){const i=Gu(e),n=Gu(t);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1}function Gu(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 cL(e,t,i,n){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:n};if("width"in e)return Gu({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}] [${n}]`)}function hL(){return{x1:0,y1:0,x2:0,y2:0}}function Zi(e){return oe(e)&&e.type=="gradient"}function uL(e){return le(e)&&e.every(Zi)}function Vx(e){return le(e)&&e.every(t=>typeof t=="string")}function Ts(e){return e!==null&&oe(e)&&e.type=="pattern"}function ua(e){return e!==null&&oe(e)&&e.type=="image"}function dL(e){return Zi(e)||Ts(e)}function wo(e,t,i,n,s){return(1-s)**3*e+3*(1-s)**2*s*t+3*(1-s)*s**2*i+s**3*n}function ju(e,t,i,n,s){if(s<=Math.min(e,n))return e=Math.max(e,n))return e0&&l<1)return[l]}return[]}const o=r*r-4*s*a;if(o>=0){const l=Math.sqrt(o),c=(-r+l)/(2*s),h=(-r-l)/(2*s);return[c,h].filter(u=>u>0&&u<1)}return[]}function Bx(e,t,i,n,s,r,a,o){const l=_x(e,i,s,a),c=_x(t,n,r,o);return[...l,...c]}function hf(e,t,i){const n=wo(e[0].x,e[1].x,e[2].x,e[3].x,.5),s=wo(e[0].y,e[1].y,e[2].y,e[3].y,.5),r=Math.hypot(n-t,s-i),a=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:r,minDistance:a}}function zx(e,t,i,n,s,r,a,o,l,c,h=1){let d={value:hf([{x:e,y:t},{x:i,y:n},{x:s,y:r},{x:a,y:o}],l,c),next:null},p;for(;d!=null;){const{points:g,distance:f,minDistance:m}=d.value;if(d=d.next,(p==null||ft.minDistance-e.minDistance;function pL({point:e,anchor:t},i,n,s,r){if(e.size===0)return!1;let a=e.x,o=e.y;t!=null&&(a-=(t.x-.5)*e.size,o-=(t.y-.5)*e.size);let l=a;ai+s&&(l=i+s);let c=o;on+r&&(c=n+r);const h=a-l,u=o-c;return Math.hypot(h,u)<=e.size/2}function jx(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var gL={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 Hx(e,t,i=5){const n=new Map,s=[],r=new Map(Array.from(e.entries(),([o,l])=>[o,l.toSorted((c,h)=>h.point.size-c.point.size)])),a=[...r.values()].flat();for(const[o,l]of r.entries()){const c=[];if(l[0]?.label){for(let h=0,u=l.length;h0&&d.placement!=null){const A=gL[d.placement];M=(y/2+x+i)*A.x,I=(b/2+x+i)*A.y}let C=p.x-y/2+M,D=p.y-b/2+I;if(f&&(C-=(f.x-.5)*p.size,D-=(f.y-.5)*p.size),xu(t,C,D,y,b)&&!a.some(A=>pL(A,C,D,y,b))&&!s.some(A=>Tg(A,C,D,y,b))){const A={index:h,text:m,x:C,y:D,width:y,height:b,datum:d};c.push(A),s.push(A)}}n.set(o,c)}}return n}function $x(e){return e.type==="continuous"||e.type==="log"}function Ux(e){return e.type==="category"}function br(e){return"variant"in e&&e.variant==="unit-time"}function Wx(e){return!("variant"in e)}function da(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:$x(e)&&$x(t)?e.type===t.type&&Un(e.domain,t.domain)&&Un(e.range,t.range):Ux(e)&&Ux(t)?br(e)&&br(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:Wx(e)&&Wx(t)?e.inset===t.inset&&e.step===t.step&&Un(e.domain,t.domain):!1:!1}function vc(e){return e==null?!1:e.type==="category"?br(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 xi(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 fL(e){const t=xi(e);return t[0].x>t[1].x&&t.reverse(),t}function Hu(e,t){const{x:i,y:n}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:n,cp1x:i,cp1y:n,cp2x:i,cp2y:n,cp3x:i,cp3y:n};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n,midPoints:e.midPoints.map(()=>({x:i,y:n}))}}}function ko(e,t,i){const[n,s]=xi(e),r=s.x===n.x?0:(i.x-t.x)/(s.x-n.x),a=s.y===n.y?0:(i.y-t.y)/(s.y-n.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-n.x)*r,cp1y:i.y-(e.cp2y-n.y)*a,cp2x:i.x-(e.cp1x-n.x)*r,cp2y:i.y-(e.cp1y-n.y)*a,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-n.x)*r};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(o=>({x:t.x+(o.x-n.x)*r,y:t.y+(o.y-n.y)*a}))}}}function uf(e,t,i){const{moveTo:n}=e,[s,r]=fL(e),{x:a,y:o}=s,{x:l,y:c}=r;if(il)return ko(e,r,r);switch(e.type){case"linear":{const h=o===c?void 0:(c-o)/(l-a),u=h==null?o:h*(t-a)+o,d=h==null?o:h*(i-a)+o;return{type:"linear",moveTo:n,x0:t,y0:u,x1:i,y1:d}}case"step":if(i<=e.stepX){const h=e.y0;return{type:"step",moveTo:n,x0:t,y0:h,x1:i,y1:h,stepX:i}}else if(t>=e.stepX){const h=e.y1;return{type:"step",moveTo:n,x0:t,y0:h,x1:i,y1:h,stepX:t}}else{const{y0:h,y1:u,stepX:d}=e;return{type:"step",moveTo:n,x0:t,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=ju(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[u,d]=bc(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=ju(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=bc(d[0].x,d[0].y,d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y,p),{type:"cubic",moveTo:n,cp0x:d[0].x,cp0y:d[0].y,cp1x:d[1].x,cp1y:d[1].y,cp2x:d[2].x,cp2y:d[2].y,cp3x:d[3].x,cp3y:d[3].y}}case"multi-line":{const{midPoints:h}=e,u=h.findLastIndex(C=>C.x<=t);let d=h.findIndex(C=>C.x>=i);d===-1&&(d=h.length);const p=u>=0?h[u]:void 0,g=p?.x??a,f=p?.y??o,m=d(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(Kx||{});function Yx(e){const t=[];let i=0,n=Number.NaN,s=Number.NaN;for(const{x:r,y:a}of e){if(i>0){const o=i===1;t.push({type:"linear",moveTo:o,x0:n,y0:s,x1:r,y1:a})}i+=1,n=r,s=a}return t}var mL={start:0,middle:.5,end:1};function Zx(e,t){const i=[];let n=0,s=Number.NaN,r=Number.NaN;const a=typeof t=="number"?t:mL[t];for(const{x:o,y:l}of e){if(n>0){const c=n===1,h=s+(o-s)*a;i.push({type:"step",moveTo:c,x0:s,y0:r,x1:o,y1:l,stepX:h})}n+=1,s=o,r=l}return i}function Xx(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const n=.05,s=i.map((a,o)=>{const l=o===0?a:i[o-1],c=o===i.length-1?a:i[o+1],h=o===0||o===i.length-1;if(Math.sign(l.y-a.y)===Math.sign(c.y-a.y))return 0;if(!h){const u=Math.abs(l.y-c.y),d=Math.abs(a.y-l.y)/u,p=Math.abs(a.y-c.y)/u;if(d<=n||1-d<=n||p<=n||1-p<=n)return 0}return(c.y-l.y)/(c.x-l.x)});s[1]===0&&(s[0]*=2),s.at(-2)===0&&(s[s.length-1]*=2);const r=[];for(let a=1;aMath.abs(d)&&(p*=Math.abs(d/g),g=Math.sign(g)*Math.abs(d)),l===0&&Math.abs(m)>Math.abs(d)&&(f*=Math.abs(d/m),m=Math.sign(m)*Math.abs(d)),r.push({type:"cubic",moveTo:a===1,cp0x:o.x,cp0y:o.y,cp1x:o.x+p,cp1y:o.y+g,cp2x:c.x-f,cp2y:c.y-m,cp3x:c.x,cp3y:c.y})}return r}var df=0,pf=1;function xc(e){return{x:{min:e?.x?.min??df,max:e?.x?.max??pf},y:{min:e?.y?.min??df,max:e?.y?.max??pf}}}var gf=class extends ce{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},$u={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 ff(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),n=e.getTime()-t.getTime()+i*6e4,s=36e5*24;return Math.floor(n/s)}function qx(e,t){const n=new Date(e.getFullYear(),0,1).getDay(),s=(t-n+7)%7,r=new Date(e.getFullYear(),0,s+1);return r<=e?Math.floor(ff(e,r)/7)+1:0}var yL=0,Jx=1,Qx=4;function e0(e,t=e.getFullYear()){const n=new Date(t,0,1).getDay(),s=(Qx-n+7)%7,r=new Date(t,0,s-(Qx-Jx)+1);return r<=e?Math.floor(ff(e,r)/7)+1:e0(e,t-1)}function bL(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${Kt(Math.floor(i/60),2,"0")}${Kt(Math.floor(i%60),2,"0")}`}var vL={a:e=>$u.shortDays[e.getDay()],A:e=>$u.days[e.getDay()],b:e=>$u.shortMonths[e.getMonth()],B:e=>$u.months[e.getMonth()],c:"%x, %X",d:(e,t)=>Kt(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>Kt(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>Kt(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":Kt(i,2,t??"0")},j:(e,t)=>Kt(ff(e)+1,3,t??"0"),m:(e,t)=>Kt(e.getMonth()+1,2,t??"0"),M:(e,t)=>Kt(e.getMinutes(),2,t??"0"),L:(e,t)=>Kt(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)=>Kt(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>Kt(qx(e,yL),2,t??"0"),V:(e,t)=>Kt(e0(e),2,t??"0"),w:(e,t)=>Kt(e.getDay(),2,t??"0"),W:(e,t)=>Kt(qx(e,Jx),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>Kt(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>Kt(e.getFullYear(),4,t??"0"),Z:e=>bL(e),"%":()=>"%"},xL={_:" ",0:"0","-":""};function Kt(e,t,i){const n=String(Math.floor(e));return n.length>=t?n:`${i.repeat(t-n.length)}${n}`}function Lo(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const o=i>0?e.substring(0,i):e;t.push(o)}if(i<0)break;const n=e[i+1],s=xL[n];s!=null&&i++;const r=e[i+1],a=vL[r];if(typeof a=="function")t.push([a,s]);else if(typeof a=="string"){const o=Lo(a);t.push([o,s])}else t.push(`${s??""}${r}`);e=e.substring(i+2)}return i=>{const n=typeof i=="number"?new Date(i):i;return t.map(s=>typeof s=="string"?s:s[0](n,s[1])).join("")}}function SL(e,t){const i=me("button",Uu("ag-charts-input ag-charts-button",t));return e.label===void 0?(i.append(t0(e.icon)),i.ariaLabel=e.altText):i.append(e.label),i.addEventListener("click",e.onPress),ea(i,t),i}function ML(e,t){const i=me("input",Uu("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",n=>e.onChange(i.checked,n)),i.addEventListener("keydown",n=>{_g(n)&&(n.preventDefault(),i.click())}),ea(i,t),i}function IL(e,t){const i=me("select",Uu("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(n=>{const s=me("option");return s.value=n.value,s.textContent=n.label,s})),Se(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",n=>e.onChange(i.value,n)),ea(i,t),i}function DL(e,t){const i=me("textarea",Uu("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",n=>e.onChange(i.value,n)),ea(i,t),Se(i,"data-preventdefault",!1),i}function t0(e){const t=me("span",`ag-charts-icon ag-charts-icon-${e}`);return Se(t,"aria-hidden",!0),t}function Uu(e,t){return t==null?e:`${e} ${t.class}`}var i0=e=>e,CL=e=>1-Math.cos(e*Math.PI/2),Sc=e=>Math.sin(e*Math.PI/2),AL=e=>-(Math.cos(e*Math.PI)-1)/2,wL=e=>e*e,kL=e=>1-(1-e)**2,LL=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,n0=e=>2*Math.asin(e)/Math.PI,To=(e,t)=>e===t;function Y(e){return function(t,i){const n=`__${i}`;t[i]||yf(t,i,n,e)}}function Wu(e){return Y(e)}function pa(e){return Y(e)}function mf(e){const t=e??{};return t.equals=Un,Y(e)}function ze(e){return function(t,i){const n=`__${i}`;t[i]||yf(t,i,n,e)}}function Mc(e){return function(t,i){const n=`__${i}`;t[i]||yf(t,i,n,e)}}function yf(e,t,i,n){const{changeCb:s,convertor:r,checkDirtyOnAssignment:a=!1}=n??{},o={changeCb:s,checkDirtyOnAssignment:a,convertor:r},l=OL(i,NL(TL(EL(i,o),o),o),o);function c(){return this[i]}Object.defineProperty(e,t,{set:l,get:c,enumerable:!0,configurable:!0})}function TL(e,t){const{convertor:i}=t;if(i){let s=function(a){e.call(this,r(a))};var n=s;const r=i;return s}return e}var s0=Symbol("no-change");function NL(e,t){const{changeCb:i}=t;if(i){let s=function(a){const o=e.call(this,a);return o!==s0&&r.call(this,this),o};var n=s;const r=i;return s}return e}function OL(e,t,i){const{checkDirtyOnAssignment:n}=i;if(n){let r=function(a){const o=t.call(this,a);return a?._dirty===!0&&this.markDirty(e),o};var s=r;return r}return t}function EL(e,t){const{equals:i=To}=t;function n(s){const r=this[e];return i(s,r)?s0:(this[e]=s,this.onChangeDetection(e),s)}return n}var r0=at(Ue,Ue),RL=De({..._,...$,...W,marker:ir}),a0={showInMiniChart:L,connectMissingData:L,interpolation:Uh,label:Oe,styler:RL,marker:An,tooltip:Mv,shadow:es,...Ie,...$,..._,...W,highlight:r0,segmentation:so},bf={...a0,...Cn,highlight:r0,type:X(_e("area")),xKey:X(O),yKey:X(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,legendItemName:O,stacked:L,stackGroup:O,normalizedTo:P};bf.selectedKey=J(O);var o0=at(Mn,Mn),l0=De({...$,..._,...W,cornerRadius:w}),vf={direction:F("horizontal","vertical"),showInMiniChart:L,cornerRadius:w,styler:l0,itemStyler:l0,crisp:L,label:{...Oe,placement:F("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:w},errorBar:Zl,shadow:es,tooltip:we,...Ie,highlight:o0,...$,..._,...W,segmentation:so,width:Jn,widthRatio:Z};vf.sparklineMode=J(L);var No={...vf,...Cn,highlight:o0,type:X(_e("bar")),xKey:X(O),yKey:X(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,direction:F("horizontal","vertical"),grouped:L,stacked:L,stackGroup:O,normalizedTo:P,legendItemName:O,errorBar:$h};No.yFilterKey=J(O),No.pickOutsideVisibleMinorAxis=J(L),No.focusPriority=J(P),No.simpleItemStyler=J(Ve);var c0=at(Ue,er),PL=De({..._,...W,marker:ir}),xf={title:O,showInMiniChart:L,connectMissingData:L,interpolation:Uh,label:Oe,styler:PL,marker:An,tooltip:we,errorBar:Zl,...Ie,..._,...W,highlight:c0,segmentation:gv};xf.sparklineMode=J(L);var Ic={...xf,...Cn,highlight:c0,type:X(_e("line")),xKey:X(O),yKey:X(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,stacked:L,stackGroup:O,normalizedTo:P,legendItemName:O,errorBar:$h};Ic.selectedKey=J(O),Ic.pickOutsideVisibleMinorAxis=J(L),Ic.focusPriority=J(P);var qe="13.2.1",h0={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:lu,lineDash:[0],label:{enabled:!1}}},Sf={...h0,nice:!1},Ku={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Mf={style:[{stroke:{$ref:"gridLineColor"}}],width:2},FL={number:{gridLine:Mf},time:{gridLine:Mf},category:{gridLine:Mf}},VL={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:{...Sf,interval:{values:[0]}},log:{...Sf},time:{...Sf},category:{...h0}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Ku,position:{...Ku.position,anchorTo:"pointer"},range:"nearest"},axes:FL},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Ku},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Ku}}},u0=Ut(_L);function _L(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:u0(e.baseTheme,t)}:t}function d0(e){if(Array.isArray(e)&&e.length!==0){const t=e.find(i=>i!=null);if(typeof t=="number")return{data:e.map((n,s)=>({x:s,y:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(n=>({x:n?.[0],y:n?.[1],datum:n})),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 BL(e){switch(e?.type){case"number":{const{reverse:t,min:i,max:n}=e??{};return{type:"number",reverse:t,min:i,max:n}}case"time":{const{reverse:t,min:i,max:n}=e??{};return{type:"time",reverse:t,min:i,max:n}}case"category":default:{if(e==null)return{type:"category"};const{reverse:t,paddingInner:i,paddingOuter:n}=e;return{type:"category",reverse:t,paddingInner:i,paddingOuter:n}}}}function zL(e,t,i){const n={};return e?.stroke!=null&&(n.style=[{stroke:e?.stroke}],n.enabled??(n.enabled=!0)),e?.strokeWidth!=null&&(n.width=e?.strokeWidth,n.enabled??(n.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(n.enabled??(n.enabled=!0)),e?.visible!=null&&(n.enabled=e.visible),n.enabled??(n.enabled=t),n}var GL=Ut((e,t,i)=>n=>{const s=n.datum[n.xKey],r=n.datum[n.yKey],a=i==null?n.datum:n.datum[i],o=t?.renderer?.({context:e,datum:a,xValue:s,yValue:r});if(rt(o)||Hi(o)||Sn(o))return ft(o);const l=o?.content??r.toFixed(2);return o?.title?{heading:void 0,title:void 0,data:[{label:o.title,value:l}]}:{heading:void 0,title:l,data:[]}});function jL(e){const{background:t,container:i,foreground:n,height:s,listeners:r,locale:a,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:u,theme:d,data:p,crosshair:g,axis:f,min:m,max:y,tooltip:b,context:x,styleNonce:M,...I}=e,C={background:t,container:i,foreground:n,height:s,listeners:r,locale:a,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:u,styleNonce:M},{data:D,series:[A]=[],datumKey:k}=d0(p),N=I;A!=null&&Object.assign(N,A),N.tooltip={...b,renderer:GL(x,b,k)},C.theme=u0(d,VL),C.data=D,C.series=[N];const T=N.type==="bar"&&N.direction==="horizontal",[R,B]=T?["left","bottom"]:["bottom","left"],E={...BL(f),position:R,...g==null?{}:{crosshair:g}},V={type:"number",gridLine:zL(f,!1,e),position:B,...m==null?{}:{min:m},...y==null?{}:{max:y}};return C.axes=T?{x:V,y:E}:{x:E,y:V},C}var If=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Df={visible:L,reverse:L,stroke:H,strokeWidth:w},Dc={context:()=>!0,tooltip:pe,theme:pe,background:pe,container:pe,width:pe,height:pe,minWidth:pe,minHeight:pe,padding:pe,listeners:pe,locale:pe,data:pe,styleNonce:O,axis:$l({number:{...Df,min:Ae(P,gi("max")),max:Ae(P,fi("min"))},category:{...Df,paddingInner:Z,paddingOuter:Z},time:{...Df,min:Ae(ne(P,pi),gi("max")),max:Ae(ne(P,pi),fi("min"))}},"axis options","category"),min:Ae(P,gi("max")),max:Ae(P,fi("min")),crosshair:{enabled:L,snap:L,..._,...W},xKey:O,yKey:O};Dc.overrideDevicePixelRatio=J(P),Dc.foreground=J(pe);var p0={type:"preset",name:"sparkline",version:qe,options:$l({area:{...Dc,...K(bf,If)},bar:{...Dc,...K(No,If)},line:{...Dc,...K(Ic,If)}},"sparkline options"),create:jL,processData:d0},Yu=Symbol("interpolate"),Zu=e=>e[Yu]!=null,Cc=class Dl{constructor(t,i,n,s){this.x=t,this.y=i,this.width=n,this.height=s}static fromObject({x:t,y:i,width:n,height:s}){return new Dl(t,i,n,s)}static merge(t){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(const a of t)a.xs&&(s=ri(a.x,a.width)),ri(a.y,a.height)>r&&(r=ri(a.y,a.height));return new Dl(i,n,s-i,r-n)}static nearestBox(t,i,n){return ku(t,i,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:ri(this.x,this.width),bottom:ri(this.y,this.height),toJSON(){return{}}}}clone(){const{x:t,y:i,width:n,height:s}=this;return new Dl(t,i,n,s)}equals(t){return Su(this,t)}containsPoint(t,i){return xu(this,t,i)}intersectsWith(t){return!(this.x+this.width<=t.x||t.x+t.width<=this.x||this.y+this.height<=t.y||t.y+t.height<=this.y)}intersection(t){const i=Math.max(this.x,t.x),n=Math.max(this.y,t.y),s=Math.min(ri(this.x,this.width),ri(t.x,t.width)),r=Math.min(ri(this.y,this.height),ri(t.y,t.height));if(!(i>s||n>r))return new Dl(i,n,s-i,r-n)}collidesBBox(t){return this.xt.x&&this.yt.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 n=t-te(this.x,t,ri(this.x,this.width)),s=i-te(this.y,i,ri(this.y,this.height));return n*n+s*s}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const n of Object.keys(t)){const s=t[n];typeof s=="number"&&this.applyMargin(s,n)}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 n of Object.keys(t)){const s=t[n];typeof s=="number"&&this.applyMargin(-s,n)}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}[Yu](t,i){return new Dl(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)}};Cc.zero=Object.freeze(new Cc(0,0,0,0)),Cc.NaN=Object.freeze(new Cc(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var U=Cc;function ri(e,t){return e===-1/0&&t===1/0?1/0:e+t}function g0({context:e,pixelRatio:t,width:i,height:n}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(n*t))}finally{e.restore()}}function f0(e){if(he.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let n=0;Object.assign(e,{save(){t(),n++},restore(){if(n===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(n!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}function m0(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var Cf;function HL(){const e=Ih();return Cf??(Cf=new e(1,1)),Cf}var Af=class{constructor(e){const{width:t,height:i,pixelRatio:n,willReadFrequently:s=!1}=e;this.width=t,this.height=i,this.pixelRatio=n;const[r,a]=m0(t,i,n),o=Ih();this.canvas=new o(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(n,0,0,n,0,0),f0(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?HL().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:n,context:s}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[r,a]=m0(e,t,i);n.width=r,n.height=a}s.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){g0(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)}},wf=(e,t)=>Math.sign(e-t);function y0(e,t){if(typeof e=="number"&&typeof t=="number")return wf(e,t);const i=typeof e=="number"?[e]:e,n=typeof t=="number"?[t]:t,s=Math.min(i.length,n.length);for(let r=0;r(e[e.All=0]="All",e[e.None=1]="None",e))(b0||{}),$L=5,ga=class sb{constructor(t){this.serialNumber=sb._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=Rn(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??sb._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,n){const s=t?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const r=lt("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(n)),r.setAttribute("viewBox",`0 0 ${i} ${n}`),r.setAttribute("overflow","visible"),s.defs?.length){const a=lt("defs");a.append(...s.defs),r.append(a)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(t,i){for(const n of t)if(!i||n.visible&&!n.transitionOut){const s=n.getBBox();s&&(yield s)}}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 n=i.errorCount??1;if(n>=$L)throw i.errorCount=n,i;z.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const n=this.name??this.id;t.debugNodeSearch.some(s=>typeof s=="string"?s===n:s.test(n))&&(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{Qp(this,t)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(t,i){this.batchLevel++;try{Qp(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,n=[]){return this.containsPoint(t,i)&&n.push(this),n}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)??[],n=new Error("Stack trace for property change tracking").stack?.split(` `).filter(s=>s!=="Error"&&!s.includes(".markDebugProperties")&&!s.includes(".markDirty")&&!s.includes("Object.assign ")&&!s.includes(`${this.constructor.name}.`))??"unknown";i.push(n[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&&z.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${t} (${i.length}x)`,()=>{for(const n of i)z.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(t){t.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};ga.className="AbstractNode",ga._nextSerialNumber=0,ga._debugEnabled=!1,v([ze()],ga.prototype,"visible",2),v([ze({equals:yt,changeCb:ga.handleNodeZIndexChange})],ga.prototype,"zIndex",2);var Ns=ga,Xu=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},qu=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(n){this[i]!==n&&(this[i]=n,this.invalid=!0)},enumerable:!0,configurable:!1})};function v0(e,t,i){if(i==null||i[0]===0&&i[1]===1)return;const n=te(0,Math.floor(i[0]*e.length),e.length),s=te(0,Math.ceil(i[1]*e.length),e.length),r=t?e.length-s:n,a=t?e.length-n:s;return[r,a]}function x0(e,t,i){return v0(e,t,i)??[0,e.length]}function S0(e,t,i){const n=v0(e,t,i);if(n==null)return{ticks:e,count:e.length,firstTickIndex:0};const[s,r]=n;return{ticks:e.slice(s,r),count:e.length,firstTickIndex:s}}function Ju(e){const t=lf(e.at(0)),i=lf(e.at(-1));return t!=null&&i!=null?[t,i]:[void 0,void 0]}var M0=e=>{const t=Te.fromString(e),[i,n,s]=Te.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:n,h:s,a:t.a}},kf=1e-6,I0=e=>e.c1-kf,UL=(e,t,i)=>{i=te(0,i,1);let n;if(I0(e))n=t.h;else if(I0(t))n=e.h;else{const o=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),n=o*(1-i)+l*i}const s=e.c*(1-i)+t.c*i,r=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return Te.fromOKLCH(r,s,n,a)},Oo=class extends Xu{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(M0)}update(){const{domain:e,range:t}=this;e.length<2&&(z.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;is){z.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,a)=>r-a);break}}if(t.length0?t[0]:"black");this.parsedRange=this.range.map(M0)}normalizeDomains(...e){return{domain:e.map(t=>t.domain).flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:n}=this,s=t[0],r=t.at(-1),a=i[0],o=i.at(-1);if(e<=s)return a;if(e>=r)return o;let l,c;if(t.length===2){const d=(e-s)/(r-s),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(d*(i.length-1)),i.length-2),c=(d-l*p)/p}else{for(l=0;l{const{stop:n}=t,s=e.at(i+1)?.color;return s==null?[t]:[t,{stop:n,color:s}]})}function XL(e,t){const i=t==="discrete"?1:0,n=e.map((s,r,{length:a})=>({stop:(r+i)/(a-1+i),color:s}));return t==="discrete"?D0(n):n}function C0(e,t,i,n="continuous"){const s=e.map(g=>typeof g=="string"?{color:g}:g);if(s.length===0)return XL(t,n);if(!ZL(s))return z.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...i),a=Math.max(...i),o=n==="discrete",l=new Float64Array(s.length);let c=0,h=-1;for(let g=0;g=h){h=s.length-1;for(let y=g+1;yg.color!=null)?.color,d;const p=s.map((g,f)=>{let m=g?.color;const y=l[f];return m!=null?u=m:u==null?(d==null&&(d=new Oo,d.domain=[0,1],d.range=t),m=d.convert(y)):m=u,{stop:y,color:m}});return n==="discrete"?D0(p):p}var qL=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,n){if(!t)return null;const[s,r]=this.getSize(t.width,t.height,i,n);return s<1||r<1?(z.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,n){const{fit:s}=this;let r=e,a=t,o=1;const l=i/n,c=e/t;return s==="stretch"||e===0||t===0?(r=i,a=n):s==="contain"?o=c>l?i/e:n/t:s==="cover"&&(o=c>l?n/t:i/e),[Math.max(1,r*o),Math.max(1,a*o)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:n,width:s,height:r}=this,a=this.imageLoader?.loadImage(i);if(!a)return;const o=ws(n),l=Math.cos(o),c=Math.sin(o),[h,u]=this.getSize(a.width,a.height,s??t.width,r??t.height),d=h/a.width,p=u/a.height,g=t.x+t.width/2,f=t.y+t.height/2,m=l*h-c*u,y=c*h+l*u,b=m/2,x=y/2,M=Mp();e?.setTransform(new M([l*d,c*p,-c*d,l*p,g-b,f-x]))}createPattern(e,t,i,n){const s=this.width??t,r=this.height??i,a=this._cache;if(a?.ctx===e&&a.width===s&&a.height===r)return a.pattern;const o=this.imageLoader?.loadImage(this.url,n),l=this.createCanvasImage(e,o,s,r);if(l!=null)return this._cache={ctx:e,pattern:l,width:s,height:r},l}toSvg(e,t){const{url:i,rotation:n,backgroundFill:s,backgroundFillOpacity:r}=this,{x:a,y:o,width:l,height:c}=e,h=lt("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(a)),h.setAttribute("y",String(o)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const u=lt("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("fill",s),u.setAttribute("fill-opacity",String(r)),h.appendChild(u);const d=lt("image");return d.setAttribute("href",i),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("transform",`scale(${1/t}) rotate(${n}, ${l/2}, ${c/2})`),h.appendChild(d),h}},JL=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,Ge=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,QL=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,A0=/^[01]/,eT={z:[],h:[Ge],v:[Ge],m:[Ge,Ge],l:[Ge,Ge],t:[Ge,Ge],s:[Ge,Ge,Ge,Ge],q:[Ge,Ge,Ge,Ge],c:[Ge,Ge,Ge,Ge,Ge,Ge],a:[Ge,Ge,Ge,A0,A0,Ge,Ge]};function tT(e){if(!e)return;const t=[];let i=0,n;for(;i=0&&i<=1?[i]:[]}function sT(e,t,i,n=1e-6){if(Math.abs(e)=0&&a<=1&&r.push(a)}else if(s>0){const a=Math.sqrt(s),o=(-t-a)/(2*e),l=(-t+a)/(2*e);o>=0&&o<=1&&r.push(o),l>=0&&l<=1&&r.push(l)}return r}function rT(e,t,i,n,s=1e-6){if(Math.abs(e)=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),u),f=Math.sign(c-p)*Math.pow(Math.abs(c-p),u),m=Math.abs(Math.sqrt(3)*(g-f)/2),y=-u*r+(g+f);if(y>=0&&y<=1&&d.push(y),Math.abs(m)=0&&b<=1&&d.push(b)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=u*r,f=2*Math.sqrt(-l),m=f*Math.cos(u*p)-g,y=f*Math.cos(u*(p+2*Math.PI))-g,b=f*Math.cos(u*(p+4*Math.PI))-g;m>=0&&m<=1&&d.push(m),y>=0&&y<=1&&d.push(y),b>=0&&b<=1&&d.push(b)}return d}function Ac(e,t,i,n,s,r,a,o){const l=(i-e)*(o-r)-(n-t)*(a-s);if(l===0)return 0;const c=((a-s)*(t-r)-(e-s)*(o-r))/l,h=((i-e)*(t-r)-(n-t)*(e-s))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function aT(e,t,i,n,s,r,a,o,l,c,h,u){let d=0;const p=c-u,g=h-l,f=l*(u-c)-c*(h-l),m=w0(e,i,s,a),y=w0(t,n,r,o),b=p*m[0]+g*y[0],x=p*m[1]+g*y[1],M=p*m[2]+g*y[2],I=p*m[3]+g*y[3]+f,C=rT(b,x,M,I);for(const D of C){const A=D*D,k=D*A,N=m[0]*k+m[1]*A+m[2]*D+m[3],T=y[0]*k+y[1]*A+y[2]*D+y[3];let R;l===h?R=(T-c)/(u-c):R=(N-l)/(h-l),R>=0&&R<=1&&d++}return d}function w0(e,t,i,n){return[-e+3*t-3*i+n,3*e-6*t+3*i,-3*e+3*t,e]}var Eo=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=Tl();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,n,s,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,n,s,r),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=r}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,n){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath()}roundRect(e,t,i,n,s){s=Math.min(s,i/2,n/2),this.moveTo(e,t+s),this.arc(e+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(e+s,t),this.lineTo(e+i-s,t),this.arc(e+i-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+s),this.lineTo(e+i,t+n-s),this.arc(e+i-s,t+n-s,s,0,Math.PI/2),this.lineTo(e+i-s,t+n),this.lineTo(e+s,t+n),this.arc(e+ +s,t+n-s,s,Math.PI/2,Math.PI),this.lineTo(e,t+n-s),this.closePath()}ellipse(e,t,i,n,s,r,a,o=!1){const l=i,c=n/i,h=Math.cos(s),u=Math.sin(s),d=-c*u,p=c*h,g=l*Math.cos(r),f=l*Math.sin(r),m=e+h*g+d*f,y=t+u*g+p*f,b=(m-this.cx)**2+(y-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(m,y):this.moveTo(m,y);let x=o?-yi(r-a):yi(a-r);Math.abs(Math.abs(a-r)-2*Math.PI)<1e-6&&x<2*Math.PI&&(x+=2*Math.PI*(o?-1:1));const M=Math.max(Math.ceil(Math.abs(x)/(Math.PI/2)),1),I=x/M,C=4/3*Math.tan(I/4);for(let D=0;D=1?(y=Math.sqrt(y),i*=y,n*=y):(y=Math.sqrt(1/y-1),r===a&&(y=-y),M=y*i*m,I=-y*n*f,b+=d*M-u*I,x+=u*M+d*I);const C=Math.atan2((g-I)/n,(p-M)/i),D=Math.atan2((-g-I)/n,(-p-M)/i)-C,A=C+D,k=!!(1-a);this.ellipse(b,x,i,n,s,C,A,k)}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=Tl();this.path2d=new t,this.openedPath=!1,this.closedPath=!1}isPointInPath(e,t){const i=this.commands,n=this.params,s=this.commandsLength,r=-1e4,a=-1e4;let o=Number.NaN,l=Number.NaN,c=0,h=0,u=0;for(let d=0,p=0;d({x:t,y:i})){const t=[],{commands:i,params:n}=this,s=(a,o)=>{t.push(a);for(let l=0;l{i=Math.min(p,i),n=Math.min(d,n),s=Math.max(d,s),r=Math.max(p,r),a=d,o=p};let u=0;for(let d=0;ds!==0)){const s=i.length%2===1?[...i,...i]:i;e.setAttribute("stroke-dasharray",s.join(" ")),n!=null&&e.setAttribute("stroke-dashoffset",String(n))}}var Bt=class extends Ns{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(Zi(t))return this.createGradient(t)}createGradient(t){const{colorSpace:i="rgb",gradient:n="linear",colorStops:s,rotation:r=0,reverse:a=!1}=t;if(s==null)return;let o=C0(s,["black"],[0,1]);switch(a&&(o=o.map(l=>({color:l.color,stop:1-l.stop})).reverse()),n){case"linear":return new KL(i,o,r);case"radial":return new YL(i,o);case"conic":return new WL(i,o,r)}}getPattern(t){if(Ts(t))return this.createPattern(t)}createPattern(t){return new lT(t)}getImage(t){if(ua(t))return this.createImage(t)}createImage(t){return new qL(this.imageLoader,t)}onFillChange(){typeof this.fill=="object"&&yt(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 Rt(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:n,__fillOpacity:s=1,fillImage:r}=this;if(n!=null&&n!=="none"&&s>0){const a=t.globalAlpha;r&&(t.globalAlpha=r.backgroundFillOpacity,t.fillStyle=r.backgroundFill,this.executeFill(t,i),t.globalAlpha=a),this.applyFillAndAlpha(t),this.applyShadow(t),this.executeFill(t,i),t.globalAlpha=a,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:n,fillPattern:s,fillImage:r,__fillOpacity:a=1,__opacity:o=1}=this,l=o*a;if(l!==1&&(t.globalAlpha*=l),n){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;t.fillStyle=n.createGradient(t,c,h)??"black"}else if(s){const{x:c,y:h}=this.getBBox(),u=this.layerManager?.canvas?.pixelRatio??1,d=s.createPattern(t,u);s.setPatternTransform(d,u,c,h),d?t.fillStyle=d:(t.fillStyle=s.fill,t.globalAlpha*=s.fillOpacity)}else if(r){const c=this.getBBox(),h=r.createPattern(t,c.width,c.height,this);r.setImageTransform(h,c),t.fillStyle=h??"transparent"}else t.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(t){const{__stroke:i,__strokeOpacity:n=1,strokeGradient:s,__opacity:r=1}=this;t.strokeStyle=s?.createGradient(t,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const a=r*n;a!==1&&(t.globalAlpha*=a)}applyShadow(t){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:n}=this;n?.enabled&&(t.shadowColor=n.color,t.shadowOffsetX=n.xOffset*i,t.shadowOffsetY=n.yOffset*i,t.shadowBlur=n.blur*i)}renderStroke(t,i){const{__stroke:n,__strokeWidth:s=0,__strokeOpacity:r=1,__lineDash:a,__lineDashOffset:o,__lineCap:l,__lineJoin:c,__miterLimit:h}=this;if(n!=null&&n!=="none"&&s>0&&r>0){const{globalAlpha:u}=t;this.applyStrokeAndAlpha(t),t.lineWidth=s,a&&t.setLineDash(a),o&&(t.lineDashOffset=o),l&&(t.lineCap=l),c&&(t.lineJoin=c),h!=null&&(t.miterLimit=h),this.executeStroke(t,i),t.globalAlpha=u}}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:n,fillOpacity:s}=this;if(typeof n=="string")t.setAttribute("fill",n);else if(Zi(n)&&this.fillGradient){i??(i=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=wu();r.setAttribute("id",a),i.push(r),t.setAttribute("fill",`url(#${a})`)}else if(Ts(n)&&this.fillPattern){i??(i=[]);const r=this.fillPattern.toSvg(),a=wu();r.setAttribute("id",a),i.push(r),t.setAttribute("fill",`url(#${a})`)}else if(ua(n)&&this.fillImage){i??(i=[]);const r=this.layerManager?.canvas?.pixelRatio??1,a=this.fillImage.toSvg(this.getBBox(),r),o=wu();a.setAttribute("id",o),i.push(a),t.setAttribute("fill",`url(#${o})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(s)),i}applySvgStrokeAttributes(t){const{stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:a}=this;cT(t,{stroke:rt(i)?i:void 0,strokeOpacity:n,strokeWidth:s}),hT(t,{lineDash:r,lineDashOffset:a})}static handleFillChange(t){t.onFillChange()}static handleStrokeChange(t){t.onStrokeChange()}setStyleProperties(t,i,n){const s=t?.opacity??1,r=t?.fill,a=(t?.fillOpacity??1)*s,o=(t?.strokeOpacity??1)*s,l=t?.strokeWidth??0,c=t?.lineDashOffset??0;let h=!1;this.__fillOpacity!==a&&(this.__fillOpacity=a,h=!0),this.__strokeOpacity!==o&&(this.__strokeOpacity=o,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==t?.lineDash&&(this.__lineDash=t?.lineDash,h=!0),this.setFillProperties(r,i,n),r!==this.fill&&(this.fill=r),t?.stroke!==this.stroke&&(this.stroke=t?.stroke),h&&this.markDirty()}setFillProperties(t,i,n){const s=i==null||!Zi(t)||t.bounds==null||t.bounds==="item"?void 0:i[t.bounds];let r=!1;this.__fillBBox!==s&&(this.__fillBBox=s,r=!0),this.__fillParams!==n&&(this.__fillParams=n,r=!0),r&&(this.onFillChange(),this.markDirty())}};v([ze()],Bt.prototype,"drawingMode",2),v([ze()],Bt.prototype,"fillOpacity",2),v([ze()],Bt.prototype,"strokeOpacity",2),v([Mc({equals:yt,changeCb:Bt.handleFillChange})],Bt.prototype,"fill",2),v([pa({equals:yt,changeCb:Bt.handleStrokeChange})],Bt.prototype,"stroke",2),v([ze()],Bt.prototype,"strokeWidth",2),v([mf()],Bt.prototype,"lineDash",2),v([ze()],Bt.prototype,"lineDashOffset",2),v([ze()],Bt.prototype,"lineCap",2),v([ze()],Bt.prototype,"lineJoin",2),v([ze()],Bt.prototype,"miterLimit",2),v([ze({convertor:e=>te(0,e??1,1)})],Bt.prototype,"opacity",2),v([pa({equals:To,checkDirtyOnAssignment:!0})],Bt.prototype,"fillShadow",2),v([Mc({equals:Su,changeCb:e=>e.onFillChange()})],Bt.prototype,"fillBBox",2),v([Mc({equals:yt,changeCb:e=>e.onFillChange()})],Bt.prototype,"fillParams",2);var fa=Bt,E0=[1,0,0,1,0,0],ma=class mp{get e(){return[...this.elements]}constructor(t=E0){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 Di(t[0],1)&&Di(t[1],0)&&Di(t[2],0)&&Di(t[3],1)&&Di(t[4],0)&&Di(t[5],0)}AxB(t,i,n){const s=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=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];n=n??t,n[0]=s,n[1]=r,n[2]=a,n[3]=o,n[4]=l,n[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 mp?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 mp(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],n=t[1],s=t[2],r=t[3];const a=t[4],o=t[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,new mp([r,-n,-s,i,s*o-r*a,n*a-i*o])}invertSelf(){const t=this.elements;let i=t[0],n=t[1],s=t[2],r=t[3];const a=t[4],o=t[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,t[0]=r,t[1]=-n,t[2]=-s,t[3]=i,t[4]=s*o-r*a,t[5]=n*a-i*o,this}transformPoint(t,i){const n=this.elements;return{x:t*n[0]+i*n[2]+n[4],y:t*n[1]+i*n[3]+n[5]}}transformBBox(t,i){const n=this.elements,s=n[0],r=n[1],a=n[2],o=n[3],l=t.width*.5,c=t.height*.5,h=t.x+l,u=t.y+c,d=Math.abs(l*s)+Math.abs(c*a),p=Math.abs(l*r)+Math.abs(c*o);return i??(i=new U(0,0,0,0)),i.x=h*s+u*a+n[4]-d,i.y=h*r+u*o+n[5]-p,i.width=d+d,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,n,s,r,a,o){const l=i,c=n;let h,u;l===1&&c===1?(h=0,u=0):(h=o?.scalingCenterX??0,u=o?.scalingCenterY??0);const d=s,p=Math.cos(d),g=Math.sin(d);let f,m;d===0?(f=0,m=0):(f=o?.rotationCenterX??0,m=o?.rotationCenterY??0);const y=r,b=a,x=h*(1-l)-f,M=u*(1-c)-m;return t.setElements([p*l,g*l,-g*c,p*c,p*x-g*M+f+y,g*x+p*M+m+b]),t}};function vr(e){return P0(e.constructor)}var R0=Symbol("isMatrixTransform");function P0(e){return e[R0]===!0}function Of(e){var t,i;const n=e;if(P0(e))return e;const s=Symbol("matrix_combined_transform");class r extends n{constructor(){super(...arguments),this[i]=new ma,this._dirtyTransform=!0}onChangeDetection(o){super.onChangeDetection(o),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(o){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(E0),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(o){return this.computeTransformMatrix(),this[s].identity?o.clone():this[s].transformBBox(o)}toParentPoint(o,l){return this.computeTransformMatrix(),this[s].identity?{x:o,y:l}:this[s].transformPoint(o,l)}fromParent(o){return this.computeTransformMatrix(),this[s].identity?o.clone():this[s].inverse().transformBBox(o)}fromParentPoint(o,l){return this.computeTransformMatrix(),this[s].identity?{x:o,y:l}:this[s].inverse().transformPoint(o,l)}computeBBox(){const o=super.computeBBox();return o&&this.toParent(o)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(o,l){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNode(o,l)}pickNodes(o,l,c){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNodes(o,l,c)}render(o){this.computeTransformMatrix();const{ctx:l}=o,c=this[s];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(o)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const o=super.toSVG(),l=this[s];if(l.identity||o==null)return o;const c=lt("g");c.append(...o.elements);const[h,u,d,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${g} ${f})`),{elements:[c],defs:o.defs}}}return t=R0,i=s,r[t]=!0,r}function Ro(e){var t;const i=e,n=Symbol("matrix_rotation");class s extends Of(i){constructor(){super(...arguments),this[t]=new ma,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:o,rotationCenterX:l,rotationCenterY:c}=this;o!==0&&(ma.updateTransformMatrix(this[n],1,1,o,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[n]))}}return t=n,v([Y()],s.prototype,"rotationCenterX",2),v([Y()],s.prototype,"rotationCenterY",2),v([Y()],s.prototype,"rotation",2),s}function uT(e){return"scalingX"in e&&"scalingY"in e&&"scalingCenterX"in e&&"scalingCenterY"in e}function Qu(e){var t;const i=e,n=Symbol("matrix_scale");class s extends Of(i){constructor(){super(...arguments),this[t]=new ma,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(a){super.updateMatrix(a);const{scalingX:o,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;o===1&&l===1||(ma.updateTransformMatrix(this[n],o,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),a.multiplySelf(this[n]))}resetScalingProperties(a,o,l,c){this.__scalingX=a,this.__scalingY=o,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return t=n,v([Y()],s.prototype,"scalingX",2),v([Y()],s.prototype,"scalingY",2),v([Y()],s.prototype,"scalingCenterX",2),v([Y()],s.prototype,"scalingCenterY",2),s}function Po(e){var t;const i=e,n=Symbol("matrix_translation");class s extends Of(i){constructor(){super(...arguments),this[t]=new ma,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:o,translationY:l}=this;o===0&&l===0||(ma.updateTransformMatrix(this[n],1,1,0,o,l),a.multiplySelf(this[n]))}}return t=n,v([Y()],s.prototype,"translationX",2),v([Y()],s.prototype,"translationY",2),s}var Je=class{static fromCanvas(e,t){const i=[];for(const n of e.traverseUp())vr(n)&&i.unshift(n);for(const n of i)t=n.fromParent(t);return vr(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():vr(e)&&(t=e.toParent(t));for(const i of e.traverseUp())vr(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const n=[];for(const s of e.traverseUp())vr(s)&&n.unshift(s);for(const s of n)({x:t,y:i}=s.fromParentPoint(t,i));return vr(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){vr(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const n of e.traverseUp())vr(n)&&({x:t,y:i}=n.toParentPoint(t,i));return{x:t,y:i}}},ed,Ef=class yh extends Ns{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,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 yh}static computeChildrenBBox(t,i=!0){return U.merge(Ns.extractBBoxes(t,i))}static compareChildren(t,i){return y0(t.__zIndex,i.__zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return yh.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let n=0;const s=4;for(const d of this.descendants())d instanceof fa&&(n=Math.max(n,d.strokeWidth));const r=Math.max(1,n/2*s),{x:a,y:o}=Je.toCanvasPoint(this,0,0),l=T0(t,a+i.x-r)-a,c=T0(t,o+i.y-r)-o,h=Math.ceil(i.x+i.width-l+r),u=Math.ceil(i.y+i.height-c+r);return new U(l,c,h,u)}prepareSharedCanvas(t,i,n){return ed?.pixelRatio===n?ed.resize(t,i,n):ed=new Af({width:t,height:i,pixelRatio:n}),ed}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 n of this.children())n.setScene(t)}resolveFont(){if(!this.renderToOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const t of this.children()){const i=t.resolveFont();if(i!=null){this._cachedChildFont=i;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(t){this.dirty=!0,this._childFontDirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of Dv(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 n=[...this.children()];for(let s=n.length-1;s>=0;s--){const a=n[s].pickNode(t,i);if(a!=null)return a}}else if(!this.isContainerNode)return this}}pickNodes(t,i,n=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return n;this.isContainerNode||n.push(this);for(const s of this.children())s.pickNodes(t,i,n);return n}isDirty(t){const{width:i,height:n,devicePixelRatio:s}=t,{dirty:r,layer:a}=this,o=a!=null&&(this._lastWidth!==i||this._lastHeight!==n),l=this._lastDevicePixelRatio!==s;return this._lastWidth=i,this._lastHeight=n,this._lastDevicePixelRatio=s,r||o||l}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const n of this.children()){const s=n.preRender(t);i.groups+=s.groups,i.nonGroups+=s.nonGroups,i.complexity+=s.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:n}=this,s={...t},r=this.isDirty(t);if(this.dirty=!1,!n){this.renderInContext(s),super.render(s);return}const{ctx:a,stats:o,devicePixelRatio:l}=t;let{image:c}=this;if(r){c?.bitmap.close(),c=void 0;const u=i?void 0:this.computeSafeClippingBBox(l),d=(p,...g)=>{const f=p.context;f.direction=s.direction,s.ctx=f,p.clear(),f.save();try{f.setTransform(...g),f.globalAlpha=1,this.renderInContext(s)}finally{f.restore(),f.verifyDepthZero?.()}};if(i)d(i,a.getTransform());else if(u){const{x:p,y:g,width:f,height:m}=u,y=Math.floor(f*l),b=Math.floor(m*l);if(y>0&&b>0){const x=this.prepareSharedCanvas(f,m,l);d(x,l,0,0,l,-p*l,-g*l),c={bitmap:x.transferToImageBitmap(),x:p,y:g,width:f,height:m}}}this.image=c,o&&o.layersRendered++}else o&&o.layersSkipped++;const{globalAlpha:h}=a;if(a.globalAlpha=h*this.opacity,i){a.save();try{a.resetTransform(),i.drawImage(a)}finally{a.restore()}}else if(c){const{bitmap:u,x:d,y:p,width:g,height:f}=c;a.drawImage(u,0,0,g*l,f*l,d,p,g,f)}a.globalAlpha=h,super.render(s)}applyClip(t,i){const{x:n,y:s,width:r,height:a}=i;t.beginPath(),t.rect(n,s,r,a),t.clip()}renderInContext(t){const{ctx:i,stats:n}=t;this.dirtyZIndex&&(this.sortChildren(yh.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const s=this.resolveChildFont();s!=null&&i.font!==s&&(i.font=s),this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=Je.toCanvas(this,this.clipRect));for(const r of this.children()){if(!r.visible){n&&(n.nodesSkipped+=r.childNodeCounts.nonGroups+r.childNodeCounts.groups,n.opsSkipped+=r.childNodeCounts.complexity);continue}r.isolatedRender(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const n of i)this.childNodes.add(n)}*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 yh&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?Je.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 n of this.children()){const s=n.toSVG();s!=null&&(i.push(...s.elements),s.defs!=null&&t.push(...s.defs))}return{elements:i,defs:t}}};Ef.className="Group",v([Y({convertor:e=>te(0,e,1)})],Ef.prototype,"opacity",2);var ae=Ef,dT=class extends Qu(ae){},UF=class extends Ro(ae){},Yt=class extends Po(ae){},Fo=class extends Ro(Po(ae)){},bt=class Ya{constructor(t,i,n=!0){this.parentNode=t,this.autoCleanup=n,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=he.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Ns,i)?()=>new i:i}static select(t,i,n=!0){return new Ya(t,i,n)}static selectAll(t,i){const n=[],s=r=>{if(i(r)&&n.push(r),r instanceof ae)for(const a of r.children())s(a)};return s(t),n}static selectByClass(t,...i){return Ya.selectAll(t,n=>i.some(s=>n instanceof s))}static selectByTag(t,i){return Ya.selectAll(t,n=>n.tag===i)}createNode(t,i,n){const s=this.nodeFactory(t);return s.datum=t,i?.(s),n==null?this._nodes.push(s):this._nodes.splice(n,0,s),this.parentNode.appendChild(s),s}update(t,i,n){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),n&&this._nodesMap.size===0&&this._nodes.length>0)for(const s of this._nodes)this.garbageBin.add(s);if(!n&&this._nodesMap.size>0&&this._nodesMap.clear(),n){const s=new Map,r=new Map;for(let a=0;a=t.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(t[r],i):(this._nodes[r].datum=t[r],this.garbageBin.delete(this._nodes[r]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const t=this;function i(n){return t.garbageBin.has(n)?(t._nodesMap.delete(n),t.garbageBin.delete(n),n.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 s of i.entries())t(s[1],s[1].datum,s[0])}),this}*[Symbol.iterator](){for(let t=0;t{if(l&&e.moveTo(t,i),t!==n||i!==s){const c=Math.atan2(i-a,t-r),h=Math.atan2(s-a,n-r);e.arc(r,a,o,c,h)}else e.lineTo(t,i)},At=class extends fa{constructor(){super(...arguments),this.path=new Eo,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 Eo),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=lt("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};At.className="Path",v([Y()],At.prototype,"clip",2),v([Y()],At.prototype,"clipX",1),v([Y()],At.prototype,"clipY",1);function td(e,t,i,n,s){let r=!1,a=!1,o=n-Math.sqrt(Math.max(s**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(s**2-n**2,0));return o>e?(r=!0,o=e,l=i-Math.sqrt(Math.max(s**2-(n-e)**2))):Di(o,0)&&(o=0),h>t?(a=!0,c=n-Math.sqrt(Math.max(s**2-(i-t)**2)),h=t):Di(h,0)&&(h=0),{leading0:o,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:a}}function id(e,t,i,n,s,r,a){let{topLeft:o,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(o+h,l+c),d=Math.max(o+l,h+c);if(u<=0&&d<=0){if(a==null)e.rect(t,i,n,s);else{const D=Math.max(t,a.x),A=Math.min(t+n,a.x+a.width),k=Math.max(i,a.y),N=Math.min(i+s,a.y+a.height);e.rect(D,k,A-D,N-k)}return}else if(a==null&&o===l&&o===c&&o===h){e.roundRect(t,i,n,s,o);return}if(n<0&&(t+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(a==null)a=new U(t,i,n,s);else{const D=Math.max(t,a.x),A=Math.min(t+n,a.x+a.width),k=Math.max(i,a.y),N=Math.min(i+s,a.y+a.height);a=new U(D,k,A-D,N-k)}const p=Math.max(u/s,d/n,1);p>1&&(o/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,m=!0,y=!0,b,x,M,I;if(g){const D=td(a.height,a.width,Math.max(t+o-a.x,0),Math.max(i+o-a.y,0),o);D.leadingClipped&&(y=!1),D.trailingClipped&&(f=!1);const A=Math.max(a.x+D.leading1,a.x),k=Math.max(a.y+D.leading0,a.y),N=Math.max(a.x+D.trailing1,a.x),T=Math.max(a.y+D.trailing0,a.y),R=t+o,B=i+o;b={x0:A,y0:k,x1:N,y1:T,cx:R,cy:B}}if(f){const D=td(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(t+n-l),0),l);D.leadingClipped&&(g=!1),D.trailingClipped&&(m=!1);const A=Math.min(a.x+a.width-D.leading0,a.x+a.width),k=Math.max(a.y+D.leading1,a.y),N=Math.min(a.x+a.width-D.trailing0,a.x+a.width),T=Math.max(a.y+D.trailing1,a.y),R=t+n-l,B=i+l;x={x0:A,y0:k,x1:N,y1:T,cx:R,cy:B}}if(m){const D=td(a.height,a.width,Math.max(a.x+a.width-(t+n-c),0),Math.max(a.y+a.height-(i+s-c),0),c);D.leadingClipped&&(f=!1),D.trailingClipped&&(y=!1);const A=Math.min(a.x+a.width-D.leading1,a.x+a.width),k=Math.min(a.y+a.height-D.leading0,a.y+a.height),N=Math.min(a.x+a.width-D.trailing1,a.x+a.width),T=Math.min(a.y+a.height-D.trailing0,a.y+a.height),R=t+n-c,B=i+s-c;M={x0:A,y0:k,x1:N,y1:T,cx:R,cy:B}}if(y){const D=td(a.width,a.height,Math.max(a.y+a.height-(i+s-h),0),Math.max(t+h-a.x,0),h);D.leadingClipped&&(m=!1),D.trailingClipped&&(g=!1);const A=Math.max(a.x+D.leading0,a.x),k=Math.min(a.y+a.height-D.leading1,a.y+a.height),N=Math.max(a.x+D.trailing0,a.x),T=Math.min(a.y+a.height-D.trailing1,a.y+a.height),R=t+h,B=i+s-h;I={x0:A,y0:k,x1:N,y1:T,cx:R,cy:B}}let C=!1;g&&b!=null&&(wc(e,b,o,!C),C||(C=!0)),f&&x!=null&&(wc(e,x,l,!C),C||(C=!0)),m&&M!=null&&(wc(e,M,c,!C),C||(C=!0)),y&&I!=null&&wc(e,I,h,!C),e.closePath()}var wt=class extends At{constructor(){super(...arguments),this.borderPath=new Eo,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:n,__topRightCornerRadius:s,__bottomRightCornerRadius:r,__bottomLeftCornerRadius:a}=this;let{__x:o,__y:l,__width:c,__height:h,__strokeWidth:u,__clipBBox:d}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(e.clear(),t.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(o,c),h=this.align(l,h),o=this.align(o),l=this.align(l),d=d==null?void 0:new U(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height))),u)if(c0?n-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:a>0?a-u:0};this.borderClipPath=void 0,c>0&&h>0&&(b==null||b?.width>0&&b?.height>0)&&(id(e,o,l,c,h,x,b),id(t,o,l,c,h,x,b))}else this.borderClipPath=this.borderClipPath??new Eo,this.borderClipPath.clear(),this.borderClipPath.rect(o,l,c,h),t.rect(o,l,c,h);else{const y={topLeft:n,topRight:s,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,id(e,o,l,c,h,y,d)}if([n,s,r,a].every(pT)){let y=function(M,I){return x.getBBox().distanceSquared(M,I)};var m=y;const b=this.getBBox();this.hittester=b.containsPoint.bind(b);const x=this;this.distanceSquared=y}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=f}computeBBox(){const{__x:e,__y:t,__width:i,__height:n,__clipBBox:s}=this;return s?.clone()??new U(e,t,i,n)}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,n,s,r,a,o){this.__drawingMode=e,this.__topLeftCornerRadius=t,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=n,this.__bottomLeftCornerRadius=s,this.__visible=r,this.__crisp=a,this.__fillShadow=o,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(e,t,i,n,s,r){this.__x=e,this.__y=t,this.__width=i,this.__height=n,this.__opacity=s,this.__clipBBox=r,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:n}=e,{lineDash:s,lineDashOffset:r,lineCap:a,lineJoin:o,borderPath:l,borderClipPath:c}=this;c&&e.clip(c.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,s&&e.setLineDash(s),r&&(e.lineDashOffset=r),a&&(e.lineCap=a),o&&(e.lineJoin=o),e.stroke(l.getPath2D()),e.globalAlpha=n}}};wt.className="Rect",v([ze()],wt.prototype,"x",2),v([ze()],wt.prototype,"y",2),v([ze()],wt.prototype,"width",2),v([ze()],wt.prototype,"height",2),v([ze()],wt.prototype,"topLeftCornerRadius",2),v([ze()],wt.prototype,"topRightCornerRadius",2),v([ze()],wt.prototype,"bottomRightCornerRadius",2),v([ze()],wt.prototype,"bottomLeftCornerRadius",2),v([ze({equals:Su})],wt.prototype,"clipBBox",2),v([ze()],wt.prototype,"crisp",2);function pT(e){return e===0}function gT({orientation:e,bboxes:t,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:r=0,forceResult:a=!1}){const o=e==="horizontal",l={max:o?n:i,fn:o?d=>d.width:d=>d.height,padding:o?r:s},c={max:o?i:n,fn:o?d=>d.height:d=>d.width,padding:o?s:r};let h=0;const u=[];for(;h=1;){const l=mT(e,t,o,i,n,s);if(l==null&&o<=1)return;if(l==null){o--;continue}if(typeof l=="number"){if(l<=1)return;o=l1?l:o,o--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function mT(e,t,i,n,s,r){const a=[];let o=0,l=0,c=[];const h=[];for(let u=0;u0&&a.push(c),c=[]);const p=n.fn(e[u])+n.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,s.fn(e[u])+s.padding);const g=o+l,f=!r||a.length>0;if(g>s.max&&f){c=[];break}if(h.reduce((y,b)=>y+b,0)>n.max&&!r)return h.length0&&a.push(c),a.length>0?a:void 0}function yT(e,t,i,n,s){let r=0,a=0;return{pages:e.map(l=>{t==="horizontal"&&(l=bT(l));let c=0;const h=l.map(p=>{const g=p.map(y=>(c=Math.max(y,c),i[y]));let f=0,m=0;for(const y of g)f+=y.height+n,m=Math.max(m,y.width+s);return{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(m)}});let u=0,d=0;for(const p of h)u+=p.columnWidth,d=Math.max(d,p.columnHeight);return r=Math.max(u,r),a=Math.max(d,a),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:r,maxPageHeight:a}}function bT(e){const t=[];for(const i of e[0])t.push([]);for(const[i,n]of e.entries())for(const[s,r]of n.entries())t[s][i]=r;return t}function vT(e,t){const i=e.length;let n=0;for(let s=0;st.max)return i/s<2?Math.ceil(i/2):s;return i}var F0=(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.Hoverable=82]="Hoverable",e[e.Clickable=83]="Clickable",e[e.Focusable=69]="Focusable",e[e.Keyable=87]="Keyable",e[e.ContextMenuable=72]="ContextMenuable",e[e.AnnotationsMoveable=18]="AnnotationsMoveable",e[e.AnnotationsDraggable=114]="AnnotationsDraggable",e[e.ZoomDraggable=101]="ZoomDraggable",e[e.ZoomClickable=69]="ZoomClickable",e[e.ZoomWheelable=119]="ZoomWheelable",e[e.All=126]="All",e))(F0||{}),V0=class{constructor(){this.stateQueue=68}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}},Rf=(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))(Rf||{}),xT=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 U(0,0,e,t),scrollbars:{}};for(const n of Object.values(Rf)){if(typeof n!="number")continue;const s=this.elements.get(n);if(s)for(const r of s)r(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,layoutBox:i.layoutBox})}};function kc(e,t){const{path:i,size:n}=e,{x:s,y:r}=e;i.clear();let a=!1;for(const[o,l]of t){const c=s+(o-.5)*n,h=r+(l-.5)*n;a?i.lineTo(c,h):i.moveTo(c,h),a=!0}i.closePath()}var ST={circle({path:e,x:t,y:i,size:n}){const s=n/2;e.arc(t,i,s,0,Math.PI*2),e.closePath()},cross(e){kc(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){kc(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:n}){const s=n/4;i=i+s/2,e.arc(t-s,i-s,s,$t(130),$t(330)),e.arc(t+s,i-s,s,$t(220),$t(50)),e.lineTo(t,i+s),e.closePath()},pin({path:e,x:t,y:i,size:n}){e.moveTo(t+(.891-.5)*n,i+(.391-.5)*n),e.cubicCurveTo(t+(.891-.5)*n,i+(.606-.5)*n,t+(.5-.5)*n,i+(1-.5)*n,t+(.5-.5)*n,i+(1-.5)*n),e.cubicCurveTo(t+(.5-.5)*n,i+(1-.5)*n,t+(.109-.5)*n,i+(.606-.5)*n,t+(.109-.5)*n,i+(.391-.5)*n),e.cubicCurveTo(t+(.109-.5)*n,i+(.175-.5)*n,t+(.284-.5)*n,i+(0-.5)*n,t+(.5-.5)*n,i+(0-.5)*n),e.cubicCurveTo(t+(.716-.5)*n,i+(0-.5)*n,t+(.891-.5)*n,i+(.175-.5)*n,t+(.891-.5)*n,i+(.391-.5)*n),e.closePath()},plus(e){kc(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:n,pixelRatio:s}){const r=n/2;e.moveTo(Rt(s,t-r),Rt(s,i-r)),e.lineTo(Rt(s,t+r),Rt(s,i-r)),e.lineTo(Rt(s,t+r),Rt(s,i+r)),e.lineTo(Rt(s,t-r),Rt(s,i+r)),e.closePath()},star({path:e,x:t,y:i,size:n}){const r=n/2,a=r/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:a,h=l*Math.PI/5-o,u=t+Math.cos(h)*c,d=i+Math.sin(h)*c;e.lineTo(u,d)}e.closePath()},triangle(e){kc(e,[[.5,0],[1,.87],[0,.87]])}},Lc=class extends At{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=kt.anchor(this.shape),n=e-this.x+(i.x-.5)*this.size,s=t-this.y+(i.y-.5)*this.size,r=this.size/2;return Math.max(n*n+s*s-r*r,0)}updatePath(){const{path:e,shape:t,x:i,y:n,size:s}=this,r=this.layerManager?.canvas?.pixelRatio??1,a=kt.anchor(t),o={path:e,x:i-(a.x-.5)*s,y:n-(a.y-.5)*s,size:s,pixelRatio:r};e.clear(),typeof t=="string"?ST[t](o):typeof t=="function"&&t(o)}computeBBox(){const{x:e,y:t,size:i}=this,n=kt.anchor(this.shape);return new U(e-i*n.x,t-i*n.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};v([Mc({equals:To})],Lc.prototype,"shape",2),v([ze()],Lc.prototype,"x",2),v([ze()],Lc.prototype,"y",2),v([ze({convertor:Math.abs})],Lc.prototype,"size",2);var kt=class extends Ro(Qu(Po(Lc))){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,n,s,r){this.__x=e,this.__y=t,this.__size=i,this.__opacity=n,this.resetScalingProperties(s,r,e,t),this.dirtyPath=!0,this.markDirty()}},MT=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){he.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((r,a)=>r==="\u23F1\uFE0F"?-1:a==="\u23F1\uFE0F"?1:r.localeCompare(a)),i=[];for(const r of t){const a=this.stats.get(r),o=a.sum/a.count;i.push(`${r}[${a.min.toFixed(1)}/${o.toFixed(1)}/${a.max.toFixed(1)}]ms`)}const s=this.stats.get("\u23F1\uFE0F")?.count??0;z.log(`\u{1F4CA} Stats (${e.toFixed(0)}s, ${s} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},Vo,ya=0;function IT(){return Vo??(Vo=new MT),Vo}function DT(){ya++;let e=!1;return()=>{e||ya===0||(e=!0,ya--,ya===0&&G0())}}function CT(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 AT(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,n=[];for(const s of[t,e,i])typeof s=="number"&&n.push(CT(s));return`Heap ${n.join(" / ")}`}function _0(e,t,i,n,s={},r=U.zero,a){if(!he.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:u=0,opsSkipped:d=0}=n??{},p=performance.now(),{start:g,...f}=t,m=p-g,y=IT();y.recordTimings(f),y.recordTiming("\u23F1\uFE0F",m);const b=Object.entries(f).map(([j,Q])=>z0(j,Q)).filter(j=>j!=null).join(" + "),x=Object.entries(s).map(([j,Q])=>`${j}: ${JSON.stringify(Q)}`).join(" ; "),M=he.check("scene:stats:verbose"),I=M?AT():null,C=M?Ks.flush():{},D=Object.entries(C),A=[],k=[];for(const[j,Q]of D)j.endsWith(":aggregation")&&Array.isArray(Q)?A.push(`${j.replace(":aggregation","")}(${Q.join(",")})`):j.endsWith(":nodeData")&&typeof Q=="number"&&k.push(`${j.replace(":nodeData","")}(${Q})`);const N=A.length>0?`Aggregation: ${A.join(", ")}`:null,T=k.length>0?`NodeData: ${k.join(", ")}`:null,R=[`${z0("\u23F1\uFE0F",g,p)} (${b})`,`${x}`,N,T,`Layers: ${M?Pf(o,l):e.size}`,M?`Nodes: ${Pf(c,h)}`:null,M?`Ops: ${Pf(u,d)}`:null,I].filter(rt),B=new Wg(i),E=new Map(R.map(j=>[j,B.measureText(j)])),V=Math.max(...Array.from(E.values(),j=>j.width)),G=OT(E.values(),j=>j.height),q=2+r.x;i.save();try{i.fillStyle=a?.background??"white",i.fillRect(q,0,V,G),i.fillStyle=a?.foreground??"black";let j=0;for(const[Q,ue]of E.entries())j+=ue.height,i.fillText(Q,q,j)}catch(j){z.warnOnce("Error during debug stats rendering",j)}finally{i.restore()}}function wT(e){const t=kl(Wn("agChartsSceneDebug")),i=[];for(const n of t)n==="layout"?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(n);e.debugNodeSearch=i}function kT(e,t){e.save();try{for(const[i,n]of Object.entries(t)){const s=Je.toCanvas(n);if(!s){z.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(s.x,s.y,s.width,s.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,s.x,s.y,s.width),e.fillText(i,s.x,s.y,s.width)}}catch(i){z.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var LT=new Set,TT=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function NT(e){const{...t}=e;for(const i of Object.keys(t))TT.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(LT.add(i),delete t[i]);return t}function nd(e,t){if(!he.check(!0,"scene"))return{};let i=0;return{node:t==="json"?NT(e):e,name:e.name??e.id,dirty:e instanceof ae?e.dirty:void 0,...Array.from(e instanceof ae?e.children():[],n=>nd(n,t)).reduce((n,s)=>{let{name:r}=s;const{node:{visible:a,opacity:o,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:p},node:g}=s;(!a||o<=0)&&(r=`(${r})`),ae.is(g)&&g.renderToOffscreenCanvas&&(r=`*${r}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,m=[`${(i++).toString().padStart(3,"0")}|`,`${r??""}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,p!=null&&p!==1&&`sy: ${p}`].filter(x=>!!x).join(" ");let y=m,b=1;for(;n[y]!=null&&b<100;)y=`${m} (${b++})`;return n[y]=s,n},{})}}function B0(e){const t=e instanceof ae?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof ae?e.children():[],r=>B0(r)).filter(r=>r.paths.length>0),n=ae.is(e)?e.name??e.id:e.id,s=i.length?i.flatMap(r=>r.paths).map(r=>`${n}.${r}`):[n];return{dirtyTree:{name:n,node:e,dirty:t,...i.map(r=>r.dirtyTree).filter(r=>r.dirty!=null).reduce((r,a)=>(r[a.name??""]=a,r),{})},paths:s}}function Pf(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function z0(e,t,i){const n=i==null?t:i-t;return`${e}: ${Math.round(n*100)/100}ms`}function OT(e,t){let i=0;for(const n of e)i+=t(n);return i}function G0(e=!1){if(!Vo){e&&(ya=0);return}!e&&ya>0||(Vo.destroy(),Vo=void 0,e&&(ya=0))}var Ni=class Gi extends fa{constructor(t){super(t),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=Gi.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(),le(this.text))this.lines=[],this.richText??(this.richText=new ae),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(t=>ft(t.text).split(Zs)).filter(Boolean).map(()=>new Gi({trimText:!1})));else{const t=ft(this.text).split(Zs);this.lines=this.trimText?t.map(i=>i.trim()):t}}get font(){return this.fontCache??(this.fontCache=kp(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(t,i,n,s){if(le(t)){const{font:r,lineHeight:a,textAlign:o,textBaseline:l}=s,{width:c,height:h,lineMetrics:u}=ks(t,r),d=a?a*u.length:h,p=Gi.calcTopOffset(d,u[0],l),g=Gi.calcLeftOffset(c,o);return new U(i-g,n-p,c,d)}else return Gi.computeBBox(ft(t).split(Zs),i,n,s)}static computeBBox(t,i,n,s){const{font:r,lineHeight:a,textAlign:o,textBaseline:l,isRtl:c}=s,{width:h,height:u,lineMetrics:d}=bi(r).measureLines(t),p=a?a*d.length:u,g=Gi.calcTopOffset(p,d[0],l),f=Gi.calcLeftOffset(h,o,c);return new U(i-f,n-g,h,p)}static calcTopOffset(t,i,n){switch(n){case"alphabetic":return i?.ascent??0;case"middle":return t/2;case"bottom":return t;default:return 0}}static calcSegmentedTopOffset(t,i,n){switch(n){case"alphabetic":return i[0]?.ascent??0;case"middle":return i.length===1?i[0].ascent+i[0].segments.reduce((s,r)=>Math.min(s,bi(r).baselineDistance("middle")),0):t/2;case"bottom":return t;default:return 0}}static calcLeftOffset(t,i,n){let s=0;switch(i){case"center":s=.5;break;case"right":case(n?"start":"end"):s=1}return t*s}getBBox(){const t=super.getBBox();if(!this.textMap?.size||!le(this.text))return t;const{height:i,lineMetrics:n}=ks(this.text,this),s=Gi.calcSegmentedTopOffset(i,n,this.textBaseline),r=this.y-s;return t.y===r?t:new U(t.x,r,t.width,t.height)}computeBBox(){if(!this.hasRenderableText())return new U(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size){const l=U.merge(this.textMap.values());return l.x=this.x-Gi.calcLeftOffset(l.width,this.textAlign),l.y=this.y,l}const t=this.scene?.isRtl,{x:i,y:n,lines:s,textBaseline:r,textAlign:a}=this,o=Gi.computeBBox(s,i,n,{font:this,textBaseline:r,textAlign:a,isRtl:t});return this.boxing!=null&&o.grow(this.boxPadding),o}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return Xe(this.text)}isPointInPath(t,i){return this.getBBox()?.containsPoint(t,i)??!1}setScene(t){this.richText?.setScene(t),super.setScene(t)}generateTextMap(){if(!le(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let t=0;const i=this.richText.children();for(const{width:n,height:s,ascent:r,segments:a}of ks(this.text,this).lineMetrics){let o=0;for(const{color:l,textMetrics:c,...h}of a){const u=i.next().value;u.x=this.x-n/2+o,u.y=r+t,u.setProperties({...h,fill:l??this.fill});const d=u.getBBox();this.textMap.set(u,d),o+=c.width}t+=s}}render(t){const{ctx:i,stats:n}=t;if(!this.layerManager||!this.hasRenderableText()){n&&(n.nodesSkipped+=1);return}if(le(this.text)&&this.richText){this.generateTextMap();const s=this.richText.getBBox(),{width:r,height:a,lineMetrics:o}=ks(this.text,this);let l=0;switch(this.textAlign){case"left":case"start":l=r/2;break;case"right":case"end":l=r/-2}const c=this.y-Gi.calcSegmentedTopOffset(a,o,this.textBaseline);this.renderBoxing(t,s.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(Gi.debug.check()){const s=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(s.x,s.y,s.width,s.height)}super.render(t)}markDirty(t){return this.textMap?.clear(),super.markDirty(t)}renderText(t){const{fill:i,stroke:n,strokeWidth:s,font:r,textAlign:a}=this;if(!i&&!(n&&s)||!this.layerManager)return super.render(t);const{ctx:o}=t;o.font!==r&&(o.font=r),o.textAlign=a,this.renderBoxing(t),this.fillStroke(o)}renderBoxing(t,i){if(!this.boxing)return;const n=i??Gi.computeBBox(this.lines,this.x,this.y,this);if(n.width===0||n.height===0)return;const{x:s,y:r,width:a,height:o}=n.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=s,this.boxing.y=r,this.boxing.width=a,this.boxing.height=o,this.boxing.preRender(t),this.boxing.render(t)}executeFill(t){this.renderLines((i,n,s)=>t.fillText(i,n,s))}executeStroke(t){this.renderLines((i,n,s)=>t.strokeText(i,n,s))}renderLines(t){const{x:i,y:n,lines:s}=this;if(!Number.isFinite(i)||!Number.isFinite(n))return;const r=bi(this),{lineMetrics:a}=r.measureLines(s),{textBaseline:o,lineHeight:l=r.lineHeight()}=this;let c=0;o==="top"?c=a[0].ascent:(o==="middle"||o==="bottom")&&(c=l*(1-s.length),o==="middle"?(c/=2,c-=r.baselineDistance(o)):c-=a[0].descent);for(const h of a)t(h.text,i,n+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 wt({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)}hasBoxing(){return this.boxing!=null}getBoxingProperties(){const{fill:t,fillOpacity:i,cornerRadius:n,stroke:s,strokeWidth:r,strokeOpacity:a}=this.boxing??{};return{border:{enabled:s!=null,stroke:s,strokeWidth:r,strokeOpacity:a},cornerRadius:n,fill:t,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const t=this.text;if(t==null)return;const i=lt("text");if(le(t))for(const n of t){const s=lt("tspan");O0(s,{fontSize:n.fontSize??this.fontSize,fontFamily:n.fontFamily??this.fontFamily,fontWeight:n.fontWeight??this.fontWeight,fontStyle:n.fontStyle??this.fontStyle}),this.applySvgFillAttributes(s),s.textContent=ft(n.text),i.append(s)}else this.applySvgFillAttributes(i),O0(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=ft(t);return{elements:[i]}}hasRenderableText(){const{text:t}=this;return t==null?!1:le(t)?!0:ft(t)!==""}};Ni.className="Text",Ni.debug=he.create(!0,"scene:text"),Ni.defaultFontSize=10,v([Y()],Ni.prototype,"x",2),v([Y()],Ni.prototype,"y",2),v([Wu({changeCb:e=>e.onTextChange()})],Ni.prototype,"text",2),v([Y({changeCb:e=>{e.fontCache=void 0}})],Ni.prototype,"fontStyle",2),v([Y({changeCb:e=>{e.fontCache=void 0}})],Ni.prototype,"fontWeight",2),v([Y({changeCb:e=>{e.fontCache=void 0}})],Ni.prototype,"fontSize",2),v([Y({changeCb:e=>{e.fontCache=void 0}})],Ni.prototype,"fontFamily",2),v([Y()],Ni.prototype,"textAlign",2),v([Y()],Ni.prototype,"textBaseline",2),v([Y()],Ni.prototype,"lineHeight",2);var Oi=Ni,j0=class extends Ro(Oi){},_o=class extends Ro(Po(Oi)){},Bo=class extends ce{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};v([S],Bo.prototype,"color",2),v([S],Bo.prototype,"fontStyle",2),v([S],Bo.prototype,"fontWeight",2),v([S],Bo.prototype,"fontSize",2),v([S],Bo.prototype,"fontFamily",2);var Os=class extends ce{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};v([S],Os.prototype,"size",2),v([S],Os.prototype,"fill",2),v([S],Os.prototype,"fillOpacity",2),v([S],Os.prototype,"stroke",2),v([S],Os.prototype,"strokeWidth",2),v([S],Os.prototype,"strokeOpacity",2);var sd=class extends ce{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};v([_t({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],sd.prototype,"shape",2),v([S],sd.prototype,"size",2),v([S],sd.prototype,"padding",2);var Es=class extends ce{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=Rn(this),this.marker=new sd(this),this.activeStyle=new Os,this.inactiveStyle=new Os,this.highlightStyle=new Os,this.label=new Bo,this.group=new Yt({name:"pagination"}),this.labelNode=new Oi,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.nextButton=new kt,this.previousButton=new kt,this.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",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}applyRotations(){const{isRtl:e}=this;switch(this.orientation){case"horizontal":{this.previousButton.rotation=e?Math.PI/2:-Math.PI/2,this.nextButton.rotation=e?-Math.PI/2:Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateButtonPositions()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateButtonPositions(){const t=this.labelNode.getBBox().width+(this.marker.size/2+this.marker.padding)*2;this.isRtl&&this.orientation==="horizontal"?(this.nextButton.translationX=0,this.previousButton.translationX=t):(this.previousButton.translationX=0,this.nextButton.translationX=t)}updateLabel(){const{isRtl:e,labelNode:t,currentPage:i,totalPages:n,label:{color:s,fontStyle:r,fontWeight:a,fontSize:o,fontFamily:l}}=this,c=[i+1,n];e&&c.reverse(),t.text=c.join(" / "),t.fill=s,t.fontStyle=r,t.fontWeight=a,t.fontSize=o,t.fontFamily=l}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:n,activeStyle:s,inactiveStyle:r,highlightStyle:a,highlightActive:o}=this,l=(c,h)=>h?r:c===o?a:s;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",n))}updateMarker(e,t){const{shape:i,size:n}=this.marker;e.shape=i,e.size=n,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,n=e===t-1,s=e===0;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}setPage(e){e=te(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()}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()}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=Je.toCanvas(this.previousButton),t=Je.toCanvas(this.nextButton);return{prev:e,next:t}}};Es.className="Pagination",v([S],Es.prototype,"marker",2),v([S],Es.prototype,"activeStyle",2),v([S],Es.prototype,"inactiveStyle",2),v([S],Es.prototype,"highlightStyle",2),v([S],Es.prototype,"label",2),v([ns(e=>{e.applyRotations(),e.updatePositions()})],Es.prototype,"isRtl",2),v([ns(e=>e.applyRotations())],Es.prototype,"orientation",2);function H0(e,t,i,n){if(Zi(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(Ts(e)){const s=e.pattern??i.pattern;let r=e.strokeWidth;s==="backward-slanted-lines"||s==="forward-slanted-lines"||s==="horizontal-lines"||s==="vertical-lines"?r??(r=i.strokeWidth):r??(r=0);const a=e.width??e.height??i.width,o=e.height??e.width??i.height;return{type:"pattern",pattern:s,width:a,height:o,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:r,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return ua(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??n.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??n.backgroundFillOpacity,rotation:e.rotation??n.rotation,repeat:e.repeat??n.repeat,fit:e.fit??n.fit}:e}function Ff(e,t,i,n){return!Zi(e?.fill)&&!Ts(e?.fill)&&!ua(e?.fill)?e:{...e,fill:H0(e.fill,t,i,n)}}var $0=.1,U0=200,W0=12,ET=.5,RT=class{constructor(e){this.agDocument=e,this.events=new xs,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&&(this.agDocument.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&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,n=Date.now(),s=n-i;this.t0=n;const r=.001,a=Math.trunc(Math.ceil(s/(r*1e3)));let{x:o,y:l,vx:c,vy:h}=this;for(let u=0;u"))}var Xi=class extends fa{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 U(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:n,x2:s,y2:r}=this;return Mu(e,t,i,n,s,r,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:n,y1:s,x2:r,y2:a}=this;if(n===r){const{strokeWidth:o}=this,l=Math.round(n*i)/i+Math.trunc(o*i)%2/(i*2);n=l,r=l}else if(s===a){const{strokeWidth:o}=this,l=Math.round(s*i)/i+Math.trunc(o*i)%2/(i*2);s=l,a=l}t.beginPath(),t.moveTo(n,s),t.lineTo(r,a),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=lt("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]}}};Xi.className="Line",v([Y()],Xi.prototype,"x1",2),v([Y()],Xi.prototype,"y1",2),v([Y()],Xi.prototype,"x2",2),v([Y()],Xi.prototype,"y2",2);function PT(e,t,i=t*(5/3)){const n=new ae,s=Math.min(e.marker.strokeWidth??1,2),r=e.line?.enabled?Math.min(e.line.strokeWidth,2):0,a=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),o=Math.max(e.marker.enabled===!1?0:t,r);if(e.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=e.line,u=new Xi;u.x1=0,u.y1=o/2,u.x2=a,u.y2=o/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=r,u.lineDash=h,n.append(u)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:p,lineDashOffset:g}=e.marker,f=new kt;f.shape=l??"square",f.size=t,f.fill=c,f.fillOpacity=h??1,f.stroke=u,f.strokeOpacity=d??1,f.strokeWidth=s,f.lineDash=p,f.lineDashOffset=g??0;const m=kt.anchor(l),y=a/2+(m.x-.5)*t,b=o/2+(m.y-.5)*t,x=t/(t+s);f.x=y,f.y=b,f.scalingCenterX=y,f.scalingCenterY=b,f.scalingX=x,f.scalingY=x,n.append(f)}return ae.toSVG(n,a,o)}var zt="ag-charts-tooltip",FT="ag-charts-tooltip--dark";function Rs(e){return e==null?!1:Array.isArray(e)?e.some(t=>Rs(t.text)):ft(e).trim()!==""}function ba(e,t=!1){return e==null?!t:typeof e=="number"&&!Number.isFinite(e)}function VT(e){return e.type==="raw"||!e.data||e.data.length===0?!1:e.data.every(t=>t.missing===!0)}function K0(e){const t=[],i=new Map;for(const n of e)if(!VT(n))if(n.type==="structured"){const{heading:s}=n,r=Rs(s)?i.get(s):void 0,a={type:"structured",heading:s,items:[n]};r==null?(i.set(s,a),t.push(a)):r.items.push(n)}else t.push(n);return t}function _T(e){const t=$r().createElement("div");t.innerHTML=e;const i=t.textContent?.trim();return i??(z.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),"")}function BT(e){const t=K0(e),i=[];for(const n of t){if(n.type==="raw"){i.push(_T(n.rawHtmlString));continue}Rs(n.heading)&&i.push(Xe(n.heading));for(const s of n.items)if(Rs(s.title)&&i.push(Xe(s.title)),s.data)for(const r of s.data)r.missing!==!0&&i.push(r.label??r.fallbackLabel,Xe(r.value))}return i.filter(n=>n!=="").join("; ")}function Y0(e,t,i){let n="";Rs(e)?(n+=`${zo(e)}`,n+=" ",n+=`${zo(t)}`):n+=`${zo(t)}`;const s=[`${zt}-row`];return i&&s.push(`${zt}-row--inline`),n=`
${n}
`,n}function zT(e){let t="";if(e.data?.length&&e.data.every(r=>r.missing===!0))return t;const i=Rs(e.title),n=!i&&e.data?.length===1,s=e.symbol==null?void 0:PT(e.symbol,12);if(s!=null&&(i||e.data?.length)&&(t+=`${s}`),i&&(t+=`${zo(e.title)}`,t+=" "),e.data)for(const r of e.data)r.missing!==!0&&(t+=Y0(r.label??r.fallbackLabel,Xe(r.value),n),t+=" ");return t}function Z0(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return``}function X0(e,t,i,n){const s=t.items.length===1?t.items[0]:void 0;let r,a,o;switch(i){case"compact":r=!0,a=Xe(s?.title);break;case"single":const h=Rs(t.heading);r=s!=null&&(!h||s.title==null)&&s.data?.length===1&&s.data[0].label==null&&s.data[0].value!=null,o=Xe(h?t.heading:s?.title);break;case"shared":r=!1}let l="";if(r&&s!=null){if(Rs(a)&&(l+=`${zo(a)}`),s.data)for(const h of s.data)h.missing!==!0&&(l+=Y0(h.label??o,Xe(h.value),!1),l+=" ")}else{Rs(t.heading)&&(l+=`${zo(Xe(t.heading))}`,l+=" ");for(const h of t.items)l+=zT(h)}if(l.length===0)return;const c=i!=="compact"&&n!=null?Z0(e,n):void 0;return c+null&&(l+=c),l=`
${l.trimEnd()}
`,l}function GT(e,t){const i=t==null?void 0:Z0(e,t);return i==null?"":`
${i}
`}function jT(e,t,i,n){const s=K0(t);if(s.length!==0){if(s.length===1&&s[0].type==="structured")return X0(e,s[0],i,n);{const r=s.map(a=>a.type==="structured"?X0(e,a,i):a.rawHtmlString);return n!=null&&r.push(GT(e,n)??""),r.join("")}}}var HT={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},$T={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},UT={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},q0={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},WT={pointer:"top",node:"top",chart:"top-left"},Go=class extends ce{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};v([S],Go.prototype,"xOffset",2),v([S],Go.prototype,"yOffset",2),v([S],Go.prototype,"anchorTo",2),v([S],Go.prototype,"placement",2);var Pn=class extends ce{constructor(e){super(),this.agDocument=e,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Go,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new tt,this.springAnimation=new RT(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],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()}))}get interactive(){return this.enableInteraction}setup(e,t){this.elementProxy=t.addDeferredProxyChild("tooltip-container",zt),this.elementProxy.toggleClass(zt,!0),this.elementProxy.setProperty("position-anchor",t.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener(n=>{this._elementSize=n,this.updateTooltipPosition()});return this.localeManager=e,()=>{t.removeChild("tooltip-container",zt),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(e){return this.elementProxy?.contains(e)??!1}updateTooltipPosition(){const{elementProxy:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:n,relativeRect:s,meta:r}=i,{x:a,y:o}=this.springAnimation,l=r.position?.anchorTo??"pointer";let c=r.position?.placement??WT[l];Array.isArray(c)||(c=[c]);const h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=s.x,p=s.y,g=s.width-t.width-1+d,f=s.height-t.height+p;let m=0,y,b,x=!1;do{y=c[m],m+=1;const A=this.getTooltipBounds({elementSize:t,placement:y,anchorTo:l,canvasX:a,canvasY:o,yOffset:u,xOffset:h,canvasRect:n});b=fx(t.width,t.height,s,A),x=!1,q0[y]&1&&(x||(x=b.xg)),q0[y]&2&&(x||(x=b.yf))}while(m{(o.relatedTarget==null||Dh(o.relatedTarget)&&!this.contains(o.relatedTarget))&&this.popInteractiveLeaveCallback()}},r.addEventListener("focusout",this.interactiveLeave.listener),r.addEventListener("mouseout",this.interactiveLeave.listener)),a}popInteractiveLeaveCallback(){const{interactiveLeave:e,elementProxy: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.elementProxy?.isConnected&&this._visible!==e&&(this._visible=e,this.elementProxy.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:e}=this,{enableInteraction:t,arrowPosition:i,mode:n,darkTheme:s,wrapping:r}=this,a=(o,l)=>e.toggleClass(`${zt}--${o}`,l);a("no-interaction",!t),a("arrow-top",i===1),a("arrow-right",i===3),a("arrow-bottom",i===2),a("arrow-left",i===0),a("compact",n==="compact"),e.toggleClass(FT,s);for(const o of this.wrapTypes)e.toggleClass(`${zt}--wrap-${o}`,o===r)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:n,canvasX:s,canvasY:r,yOffset:a,xOffset:o,canvasRect:l}=e,{width:c,height:h}=t,u={width:c,height:h};if(i==="node"||i==="pointer"){const d=HT[n],p=$T[n];return u.top=r+a+h*(p-1)/2+8*p,u.left=s+o+c*(d-1)/2+8*d,u}switch(n){case"top":return u.top=a,u.left=l.width/2-c/2+o,u;case"right":return u.top=l.height/2-h/2+a,u.left=l.width-c+o,u;case"left":return u.top=l.height/2-h/2+a,u.left=o,u;case"bottom":return u.top=l.height-h+a,u.left=l.width/2-c/2+o,u;case"top-left":return u.top=a,u.left=o,u;case"top-right":return u.top=a,u.left=l.width-c+o,u;case"bottom-right":return u.top=l.height-h+a,u.left=l.width-c+o,u;case"bottom-left":return u.top=l.height-h+a,u.left=o,u}return u}};v([S],Pn.prototype,"enabled",2),v([S],Pn.prototype,"mode",2),v([S],Pn.prototype,"showArrow",2),v([S],Pn.prototype,"delay",2),v([S],Pn.prototype,"range",2),v([S],Pn.prototype,"wrapping",2),v([S],Pn.prototype,"position",2),v([S],Pn.prototype,"pagination",2),v([S],Pn.prototype,"darkTheme",2),v([S],Pn.prototype,"bounds",2);var KT=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=e.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=oc(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(e){const t=e.getElement();return[":hover",":focus-visible"].some(i=>t.matches(i))}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:n,itemListener:s}=e,r=t.localeManager,a=i.length;i.each((o,l,c)=>{o.proxyButton?.destroy(),o.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(r,Xe(n.getItemLabel(l)),c,a),ariaChecked:!!o.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=o.proxyButton;h.addListener("click",u=>s.onClick(u.sourceEvent,o.datum,h)),h.addListener("dblclick",u=>s.onDoubleClick(u.sourceEvent,o.datum)),h.addListener("mouseenter",u=>s.onHover(u.sourceEvent,o)),h.addListener("mouseleave",()=>s.onLeave()),h.addListener("contextmenu",u=>s.onContextClick(u,o)),h.addListener("blur",()=>s.onLeave()),h.addListener("focus",u=>this.shouldApplyHoverOnFocus(h)?s.onHover(u.sourceEvent,o):s.onLeave()),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:n}){const s=Je.toCanvas(t);this.itemList.setBounds(s);const r=Math.max(...e.nodes().map(a=>a.getTextMeasureBBox().height));e.each((a,o)=>{if(a.proxyButton){const l=a.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=Je.toCanvas(a,a.getTextMeasureBBox()),p=(r-u)/2,g={x:c-s.x,y:h-p-s.y,height:r,width:d},f=n&&l;a.proxyButton.setCursor("pointer"),a.proxyButton.setEnabled(f),a.proxyButton.setPointerEvents(f?void 0:"none"),a.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{oldPages:n,newPages:s}=e,r=(n?.length??s.length)>1,a=s.length>1;r!==a&&(a?this.createPaginationButtons(e):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(a?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:n,next:s}=i.computeCSSBounds(),r=U.merge([n,s]);n.x-=r.x,n.y-=r.y,s.x-=r.x,s.y-=r.y,this.paginationGroup.setBounds(r),this.prevButton.setBounds(n),this.nextButton.setBounds(s),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",n=>this.onPageButton(e,n,"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",n=>this.onPageButton(e,n,"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,n,s)=>{const[r,a]=[t[n],e[n]];return r.id!==a.id})}onLocaleChanged(e,t,i){const n=t.length;t.each(({proxyButton:s},r,a)=>{const o=s?.getElement();if(o!=null){const l=Xe(i.getItemLabel(r));o.textContent=this.getItemAriaText(e,l,a,n)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,n){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:n})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function J0(e,{itemId:t,seriesId:i,label:{text:n}},s){const r={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:s,text:Xe(n),preventDefault:()=>r.defaultPrevented=!0}};return r}var pn=class extends Yt{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new ae({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Oi),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new kt({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Xi({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(),U.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:n}=this;let s=0,r=0;if(e.visible){const{size:a}=e,o=kt.anchor(e.shape);s=(o.x-.5)*a+i/2,r=(o.y-.5)*a,n?(e.x=0,e.y=0,e.translationX=s,e.translationY=r):(e.x=s,e.y=r,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,isRtl:i}=this;this.label.x=i?-t:e+t,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};pn.className="MarkerLabel",v([ot("label")],pn.prototype,"text",2),v([ot("label")],pn.prototype,"fontStyle",2),v([ot("label")],pn.prototype,"fontWeight",2),v([ot("label")],pn.prototype,"fontSize",2),v([ot("label")],pn.prototype,"fontFamily",2),v([ot("label","fill")],pn.prototype,"color",2),v([ns(e=>e.layoutLabel())],pn.prototype,"spacing",2),v([ns(e=>e.layoutLabel())],pn.prototype,"length",2),v([Y()],pn.prototype,"isCustomMarker",2),v([ns(e=>e.layoutLabel())],pn.prototype,"isRtl",2);function YT(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 xr=class extends ce{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"}};v([S],xr.prototype,"maxLength",2),v([S],xr.prototype,"color",2),v([S],xr.prototype,"fontStyle",2),v([S],xr.prototype,"fontWeight",2),v([S],xr.prototype,"fontSize",2),v([S],xr.prototype,"fontFamily",2),v([S],xr.prototype,"formatter",2);var jo=class extends ce{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};v([S],jo.prototype,"shape",2),v([S],jo.prototype,"size",2),v([S],jo.prototype,"padding",2),v([S],jo.prototype,"strokeWidth",2),v([S],jo.prototype,"enabled",2);var Vf=class extends ce{};v([S],Vf.prototype,"strokeWidth",2),v([S],Vf.prototype,"length",2);var Sr=class extends ce{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new jo,this.label=new xr,this.line=new Vf}};v([S],Sr.prototype,"maxWidth",2),v([S],Sr.prototype,"paddingX",2),v([S],Sr.prototype,"paddingY",2),v([S],Sr.prototype,"showSeriesStroke",2),v([S],Sr.prototype,"marker",2),v([S],Sr.prototype,"label",2),v([S],Sr.prototype,"line",2);var _f=class extends ce{};v([S],_f.prototype,"legendItemClick",2),v([S],_f.prototype,"legendItemDoubleClick",2);var Q0={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},eS={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},tS={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},vt=class extends ce{constructor(e){super(),this.ctx=e,this.id=Rn(this),this.group=new Yt({name:"legend",zIndex:16}),this.itemSelection=bt.select(this.group,pn),this.containerNode=this.group.appendChild(new wt({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new Sr,this.listeners=new _f,this.enabled=!1,this.position="bottom",this.border=new ia(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new tt,this.size=[0,0],this._visible=!0,this.pagination=new Es(()=>e.eventsHub.emit("chart:request-update",{type:9}),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 KT(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){yt(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.data=e.filter(t=>!t.hideInLegend)}onLegendDataChangePartial(e){this.itemSelection.each(({proxyButton:t},{itemId:i})=>{if(t!=null)for(const n of e.legendData)n.itemId===i&&t.setChecked(n.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:n,label:s,maxWidth:r,label:{maxLength:a=1/0,fontStyle:o,fontWeight:l,fontSize:c,fontFamily:h}}=this.item;this.updateItemSelection();const u=[],d=bi(s),g=r??e*.8,{markerWidth:f,anyLineEnabled:m}=this.calculateMarkerWidth(),{isRtl:y}=this.ctx.domManager;if(this.itemSelection.each((N,T)=>{N.fontStyle=o,N.fontWeight=l,N.fontSize=c,N.fontFamily=h,N.isRtl=y;const R=this.updateMarkerLabel(N,T,f,m),B=T.itemId??T.id,E=this.getItemLabel(T),V=Xe(E,"").replace(Zs," ");N.text=this.truncate(V,a,g,R,d,B),u.push(N.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!Number.isFinite(e))return{};[e,t]=this.updateContainer(e,t);const b=this.size,x=this.oldSize;b[0]=e,b[1]=t,(b[0]!==x[0]||b[1]!==x[1])&&(x[0]=b[0],x[1]=b[1]);const{pages:M,maxPageHeight:I,maxPageWidth:C}=this.updatePagination(u,e,t),D=this.pages;this.pages=M,this.maxPageSize=[C-i,I-n];const A=this.pagination.currentPage,k=this.pages[A];return this.pages.length<1||!k?(this.visible=!1,{oldPages:D}):(this.visible=!0,this.updatePositions(A),this.update(),{oldPages:D})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,n=!!i.enabled||!t||(e.marker.enabled??!0),s=!!(e.line&&t),r=this.isCustomMarker(n,e.marker.shape);return{markerEnabled:n,lineEnabled:s,isCustomMarker:r}}calcSymbolsLengths(e,t,i){const{marker:n,line:s}=this.item;let r;const{shape:a}=e.marker;if(this.isCustomMarker(t,a)){const c=new kt;c.shape=a,c.updatePath();const h=c.getBBox();r=Math.max(h.width,h.height)}const o=t?n.size:0,l=i?s.length??25:0;return{markerLength:o,lineLength:l,customMarkerSize:r}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,n)=>{const{symbol:s}=n,{lineEnabled:r,markerEnabled:a}=this.calcSymbolsEnabled(s),{markerLength:o,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(s,a,r);e=Math.max(e,l,c,o),t||(t=r)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,n){const{marker:s,paddingX:r}=this.item,{symbol:a}=t;let o=r;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(a),h=s.padding;(l||n)&&(o+=h+i);const{marker:u,line:d}=e;return u.visible=l,u.visible&&(u.shape=s.shape??a.marker.shape??"square",u.size=s.size,u.setStyleProperties(this.getMarkerStyles(Ee(a)))),d.visible=n,d.visible&&d.setStyleProperties(this.getLineStyles(a)),e.length=i,e.spacing=h,e.isCustomMarker=c,o}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,n,s,r){let a=!1;e.length>t&&(e=e.substring(0,t),a=!0);const o=aa(e,s,i-n,a);return Xs(o)?this.truncatedItems.add(r):this.truncatedItems.delete(r),o}updatePagination(e,t,i){const n=this.getOrientation(),s=Math.min(this.paginationTrackingIndex,e.length),{isRtl:r}=this.ctx.domManager;this.pagination.orientation=n,this.pagination.isRtl=r,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:o,maxPageWidth:l,paginationBBox:c,paginationVertical:h}=this.calculatePagination(e,t,i),u=a.findIndex(M=>M.endIndex>=s);this.pagination.currentPage=te(0,u,Math.max(0,a.length-1));const{paddingX:d,paddingY:p}=this.item,g=8,f=l-d,m=o-p;let y=0,b=-c.y-this.item.marker.size/2;h?(r&&(y=t-c.width+c.x),b+=m+g):r?(y=-c.x,b+=(m-c.height)/2):(y+=-c.x+f+g,b+=(m-c.height)/2),this.paginationItemsOffsetX=r&&!h&&this.pagination.visible?c.width+g:0,this.pagination.translationX=y,this.pagination.translationY=b,this.pagination.update(),this.pagination.updateMarkers();let x=0;return this.itemSelection.each((M,I,C)=>{C>(a[x]?.endIndex??1/0)&&x++,M.pageIndex=x}),{maxPageHeight:o,maxPageWidth:l,pages:a}}calculatePagination(e,t,i){const{paddingX:n,paddingY:s}=this.item,r=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:a}=ru(this.position),o=this.getOrientation(),l=r.includes(a);let c=this.pagination.getBBox(),h=new U(0,0,0,0),u=[],d=0,p=0,g=0;const f=y=>y.width===c.width&&y.height===c.height,m=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(g++>10){z.warn("unable to find stable legend layout.");break}c=h;const y=t-(l?0:c.width),b=i-(l?c.height:0),x=gT({orientation:o,bboxes:e,maxHeight:b,maxWidth:y,itemPaddingY:s,itemPaddingX:n,forceResult:m});u=x?.pages??[],d=x?.maxPageWidth??0,p=x?.maxPageHeight??0;const M=u.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(!f(h));return{maxPageWidth:d,maxPageHeight:p,pages:u,paginationBBox:h,paginationVertical:l}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:n}=this;if(n.length<1||!n[e])return;const{columns:s,startIndex:r,endIndex:a}=n[e];let o=0,l=0;const c=s.length,h=s[0].indices.length,u=this.getOrientation()==="horizontal",d=s[0].bboxes[0].height+t,{isRtl:p}=this.ctx.domManager,g=[],f=s.reduce((m,y)=>m+y.columnWidth,0);i.each((m,y,b)=>{if(ba){m.visible=!1;return}const x=b-r;let M,I;u?(M=x%c,I=Math.floor(x/c)):(M=Math.floor(x/h),I=x%h),m.visible=!0;const C=s[M];C&&(l=Math.floor(d*I),p?o=Math.floor(f-(g[I]??0)):o=Math.floor(g[I]??0),g[I]=(g[I]??0)+C.columnWidth,m.translationX=o+this.paginationItemsOffsetX,m.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:n,pages:s}=this,r=s[e];if(!r)return;const{startIndex:a,endIndex:o}=r;a===0?this.paginationTrackingIndex=0:e===s.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:n,interactive:this.isInteractive()}),this.ctx.eventsHub.emit("chart:request-update",{type: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:n,lineDash:s}=e.line??{},r=Math.min(2,n??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??r,lineDash:s}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:n=1,fillOpacity:s=1,strokeWidth:r,lineDash:a,lineDashOffset:o}=e,l=Math.min(2,r??1);return Ts(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),ua(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),Ff({fill:t,stroke:i,strokeOpacity:n,fillOpacity:s,strokeWidth:this.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:o},Q0,eS,tS)}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:n,fill:s,fillOpacity:r,padding:a}=this,o=typeof a=="number";return Ff({cornerRadius:n,fill:s,fillOpacity:r,padding:{top:o?a:a.top??0,right:o?a:a.right??0,bottom:o?a:a.bottom??0,left:o?a:a.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0},Q0,eS,tS)}computePagedBBox(){const e=ae.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[n,s]=this.maxPageSize;e.height=Math.max(s,e.height),e.width=Math.max(n,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(n=>n.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,n=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 r=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",r);const{offsetX:a,offsetY:o}=i,{x:l,y:c}=Je.toCanvasPoint(t,a,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:l,canvasY:c},{legendItem:n})}onClick(e,t,i){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:n},ctx:{chartService:s},preventHidingAll:r,toggleSeries:a}=this;if(!t)return!1;const{legendType:o,seriesId:l,itemId:c,enabled:h,legendItemName:u}=t,d=s.series.find(f=>f.id===l);if(!d)return!1;let p=h;const g=J0("click",t,e);return n&&Nn([d.properties,this.ctx.chartService],n,g.apiEvent),g.defaultPrevented||(a&&(p=!h,r&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.eventsHub.emit("legend:item-click",{legendType:o,series:d,itemId:c,enabled:p,legendItemName:u})),this.updateHighlight(p,t,d),this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1}})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:n},toggleSeries:s}=this;if(!t)return!1;const{legendType:r,id:a,itemId:o,seriesId:l}=t,c=n.series.find(u=>u.id===a);if(!c)return!1;const h=J0("dblclick",t,e);if(i&&Nn([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(s){const u=n.series.flatMap(f=>f.getLegendData("category"));let d=0;const p=new Set;for(const f of u)f.enabled&&(d+=1,f.legendItemName!=null&&p.add(f.legendItemName));p.size>0&&(d=p.size);const g=u.find(f=>f.itemId===o&&f.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:r,series:c,itemId:o,numVisibleItems:d,enabled:g?.enabled??!1,legendItemName:g?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=Je.toCanvas(t).computeCenter():(e.preventDefault(),i=Je.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,n=i?this.ctx.chartService.series.find(s=>s.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const s=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,s,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(i?.enabled,i,n)}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,n){if(this.checkInteractionState())return;const s=o=>{if(o===void 0)return this.ctx.activeManager.clear();{const l=o.nodeDatum.series.id,c=o.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:l,itemId:c},void 0)}},r=o=>{s(o)||this.ctx.highlightManager.updateHighlight(this.id,o?.nodeDatum)},a=o=>{this.ctx.interactionManager.isState(64)||n?.initialState?r(o):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{r(o)}):o===void 0&&r(o)};if(e===!0&&i!==void 0&&t!==void 0){const o=t.itemId,l=YT(i,t);a({itemId:o,nodeDatum:l})}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(s=>s.seriesId===t.seriesId&&s.itemId===t.itemId),n=this.ctx.chartService.series.find(s=>s.id===t.seriesId);if(n===void 0)z.warn(`Cannot find seriesId: "${t.seriesId}"`),e.reject();else if(i===void 0){const s=JSON.stringify({seriesId:t.seriesId,itemId:t.itemId});z.warn(`cannot find legend item: ${s}`),e.reject()}else this.updateHighlight(i.enabled,i,n,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:n,yOffset:s}=ru(this.position),r=i?new U(0,0,e.width,e.height):e.layoutBox,{x:a,y:o,width:l,height:c}=r,[h,u]=this.calculateLegendDimensions(r),{oldPages:d}=this.calcLayout(h,u),p=this.computePagedBBox();if(this.visible){let f=function(x){};var g=f;const m=this.spacing;let y,b;switch(t){case"top":y=(l-p.width)/2,b=0;break;case"bottom":y=(l-p.width)/2,b=c-p.height;break;case"right":y=l-p.width,b=(c-p.height)/2;break;case"left":y=0,b=(c-p.height)/2;break;case"top-right":case"right-top":y=l-p.width,b=0;break;case"top-left":case"left-top":y=0,b=0;break;case"bottom-right":case"right-bottom":y=l-p.width,b=c-p.height;break;case"bottom-left":case"left-bottom":y=0,b=c-p.height;break;default:f(t)}if(!i){let x,M;switch(t){case"top":case"top-right":case"top-left":x=p.height+m,M="top";break;case"bottom":case"bottom-right":case"bottom-left":x=p.height+m,M="bottom";break;case"left":case"left-top":case"left-bottom":x=p.width+m,M="left";break;case"right":case"right-top":case"right-bottom":x=p.width+m,M="right";break;default:f(t)}r.shrink(x,M)}y+=n,b+=s,this.group.translationX=Math.floor(a+y-p.x),this.group.translationY=Math.floor(o+b-p.y),this.containerNode.x=p.x,this.containerNode.y=p.y,this.containerNode.width=p.width,this.containerNode.height=p.height}return d}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:n,pages:s,group:r}=this,a=this.visible&&this.enabled,o=this.isInteractive();this.domProxy.update({visible:a,interactive:o,ctx:t,itemSelection:i,group:r,pagination:n,oldPages:e,newPages:s,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,{placement:n}=ru(this.position),s=t/i,r=.5,a=.2,o=.25;let l,c;function h(u){}switch(n){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const u=s<1?Math.min(r,a*(1/s)):a;l=this.maxWidth?Math.min(this.maxWidth,t):t,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*u);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const u=s>1?Math.min(r,o*s):o;l=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*u),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(e,t){const{callbackCache:i,chartService:n}=this.ctx;return i.call([this,n],e,t)}};vt.className="Legend",v([S],vt.prototype,"toggleSeries",2),v([S],vt.prototype,"pagination",2),v([S],vt.prototype,"item",2),v([S],vt.prototype,"listeners",2),v([ns((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:n,stateManager:s}}=e;i===!1&&t===!0&&s.restoreState(n)}),S],vt.prototype,"enabled",2),v([S],vt.prototype,"position",2),v([S],vt.prototype,"maxWidth",2),v([S],vt.prototype,"maxHeight",2),v([S],vt.prototype,"reverseOrder",2),v([S],vt.prototype,"orientation",2),v([S],vt.prototype,"preventHidingAll",2),v([S],vt.prototype,"border",2),v([S],vt.prototype,"cornerRadius",2),v([S],vt.prototype,"fill",2),v([S],vt.prototype,"fillOpacity",2),v([S],vt.prototype,"padding",2),v([S],vt.prototype,"spacing",2),v([S],vt.prototype,"xOffset",2),v([S],vt.prototype,"yOffset",2);var Bf={type:"plugin",name:"legend",version:qe,options:{enabled:L,position:zh,orientation:F("horizontal","vertical"),maxWidth:w,maxHeight:w,spacing:w,border:Wr,cornerRadius:P,padding:Qn,fill:Ci,fillOpacity:Z,preventHidingAll:L,reverseOrder:L,toggleSeries:L,item:{marker:{size:w,shape:tr,padding:w,strokeWidth:w},line:{length:w,strokeWidth:w},label:{maxLength:w,formatter:Ve,...Ce},maxWidth:w,paddingX:w,paddingY:w,showSeriesStroke:L},pagination:{marker:{size:w,shape:tr,padding:w},activeStyle:{...$,..._},inactiveStyle:{...$,..._},highlightStyle:{...$,..._},label:Ce},listeners:{legendItemClick:Ve,legendItemDoubleClick:Ve}},themeTemplate:{...Fv,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:Zr.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 vt(e);return t.attachLegend(e.scene),t}},zf=class extends Ah{constructor(e){super(),this.ctx=e,this.localeText=void 0}};v([ns(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),S],zf.prototype,"localeText",2),v([ns(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),S],zf.prototype,"getLocaleText",2);var Gf={type:"plugin",name:"locale",version:qe,options:{localeText:Qs,getLocaleText:mi(O)},create:e=>new zf(e)},Ho={enabled:L,text:O,padding:Qn,border:Wr,cornerRadius:P,...Ce,...$},Ps=fe({enabled:L,type:X(F("line","range")),range:Ae(fe((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),ie(pe),to(2,2)),value:Ae(fe((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),pe),label:Ho,fill:H,fillOpacity:Z,..._,...W},"cross-line options"),iS={...Ps,label:{...Ho,position:F("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:P}},Mr={enabled:L,rotation:P,avoidCollisions:L,minSpacing:w,spacing:w,formatter:mi(ln),itemStyler:De({...Ce,...on,spacing:P}),...Ce,...on},ad={autoRotate:L,autoRotateAngle:P,wrapping:F("never","always","hyphenate","on-space"),truncate:L,...Mr},nS={format:Dn,...ad},od={format:ne(O,Qs),...ad},sS={enabled:L,width:w,size:w,stroke:H},jf={enabled:L,label:od,tick:sS},rS={values:ie(pe),minSpacing:w},$o={reverse:L,gridLine:{enabled:L,width:w,style:Et({fill:H,fillOpacity:w,stroke:ne(H,Ul),strokeWidth:w,lineDash:ie(w)},"a grid-line style object array")},interval:rS,label:Mr,line:{enabled:L,width:w,stroke:H},tick:sS,context:()=>!0};$o.layoutConstraints=J({stacked:X(L),align:X(F("start","end")),unit:X(F("percent","px")),width:X(w)});var Hf={enabled:L,text:ln,spacing:w,maxWidth:w,maxHeight:w,wrapping:F("never","always","hyphenate","on-space"),truncate:L,formatter:mi(ln),...Ce},Ir={...$o,title:Hf,crossAt:{value:X(ne(P,pi,O,ie(O))),sticky:L},crossLines:Et(iS,"a cross-line options array"),position:F("top","right","bottom","left"),thickness:w,maxThicknessRatio:Z};Ir.title._enabledFromTheme=J(L);var ld={enabled:L,...$,..._,...W};function va(e,t){const i={enabled:L,xOffset:P,yOffset:P,formatter:mi(O),renderer:mi(ne(O,it({text:O,color:H,backgroundColor:H,opacity:Z},"crosshair label renderer result object")))};let n;return e&&(n={...i,format:t?ne(O,it({millisecond:O,second:O,hour:O,day:O,month:O,year:O})):O}),{enabled:L,snap:L,label:n??i,..._,...W}}function Tc(e,t){return{min:Ae(e,gi("max")),max:Ae(e,fi("min")),preferredMin:Ae(e,gi("preferredMax"),gi("max")),preferredMax:Ae(e,fi("preferredMin"),fi("min")),nice:L,interval:{step:t?ne(Jn,ao,Yl):Jn,values:ie(e),minSpacing:Ae(w,gi("maxSpacing")),maxSpacing:Ae(w,fi("minSpacing"))}}}var aS={step:ne(Jn,ao,Yl),values:ie(ne(P,pi)),minSpacing:Ae(w,gi("maxSpacing")),maxSpacing:Ae(w,fi("minSpacing")),placement:F("on","between")},Uo={...Ir,type:_e("category"),label:ad,paddingInner:Z,paddingOuter:Z,groupPaddingInner:Z,crosshair:va(),bandAlignment:F("justify","start","center","end"),bandHighlight:ld,interval:{...rS,placement:F("on","between")},skipNullBars:L},Wo={...Ir,type:_e("grouped-category"),label:ad,crosshair:va(),bandHighlight:ld,paddingInner:Z,groupPaddingInner:Z,depthOptions:Et({label:{enabled:L,avoidCollisions:L,wrapping:F("never","always","hyphenate","on-space"),truncate:L,rotation:P,spacing:P,...Ce,...on},tick:{enabled:L,stroke:H,width:w}},"depth options objects array")},Ko={...Ir,...Tc(P),type:_e("number"),label:nS,crosshair:va(!0)},Yo={...Ir,...Tc(P),type:_e("log"),base:Ae(Jn,fe(e=>e!==1,"not equal to 1")),label:nS,crosshair:va(!0)},Zo={...Ir,...Tc(ne(P,pi),!0),type:_e("time"),label:od,parentLevel:jf,crosshair:va(!0,!0)},Xo={...Ir,type:_e("unit-time"),unit:ne(Yl,ao),label:od,parentLevel:jf,paddingInner:Z,paddingOuter:Z,groupPaddingInner:Z,crosshair:va(!0,!0),bandAlignment:F("justify","start","center","end"),bandHighlight:ld,skipNullBars:L,min:Ae(ne(P,pi),gi("max")),max:Ae(ne(P,pi),fi("min")),preferredMin:Ae(ne(P,pi),gi("preferredMax"),gi("max")),preferredMax:Ae(ne(P,pi),fi("preferredMin"),fi("min")),interval:aS},$f=class WC extends Xu{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 WC}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=te(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=te(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=te(0,t,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&z.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const n=this.findIndex(t,i?.alignment,i?.alignmentExclusive);return n==null||n<0||n>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(n)}getDomainMinMax(){return Ju(this.domain)}invertNearestIndex(t){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let n=0,s=i-1,r=1/0,a=0;for(;n<=s;){const o=Math.trunc((s+n)/2),l=this.ordinalRange(o),c=Math.abs(l-t);if(c===0)return o;c0,c=l?Math.floor(o):o;let h=t+(a-c*(r-n))/2,u=c*(1-n);l&&(h=Math.round(h),u=Math.round(u)),this._step=c,this._inset=h,this._bandwidth=u,this._rawBandwidth=o*(1-n)}ordinalRange(t){const{_inset:i,_step:n,range:s}=this,r=Math.min(s[0],s[1]),a=Math.max(s[0],s[1]);return te(r,i+n*t,a)}};v([qu],$f.prototype,"range",2),v([qu],$f.prototype,"round",2);var Fn=$f,qo=class KC extends Fn{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof KC}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 n=new Set;let s=!0;for(const r of t){const a=r.domain;n.has(a)||(n.add(a),i==null?i=oS(a):(s&&(s=ZT(a,i)),i=oS([...i,...a])))}return i??(i=[]),{domain:i,animatable:s}}toDomain(t){}invert(t,i=!1){this.refresh();const n=i?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,t-n));return i||t===this.ordinalRange(s)?this.domain[s]:void 0}ticks(t,i=this.domain,n){const{bands:s}=this;let{tickCount:r}=t;if(r===0){const f=s.length>1?1:0;return{ticks:s[f]?[s[f]]:[],count:void 0,firstTickIndex:f}}let a=r!=null&&r!==0?Math.trunc(s.length/r):1;if(a=og(a),a<=1)return S0(i,!1,n);r=Math.trunc(s.length/a);const o=a*r,l=og(Math.trunc((s.length-o)/2)),c=te(0,Math.floor((n?.[0]??0)*s.length),s.length),h=te(0,Math.ceil((n?.[1]??1)*s.length),s.length),u=Math.floor((c-l)/a)*a+l,d=Math.ceil((h-l)/a)*a+l,p=[];for(let f=u;f=0&&f0?this.findIndex(p[0]):void 0;return g!=null&&(g=Math.floor((g-l)/a)),{ticks:p,count:void 0,firstTickIndex:g}}findIndex(t){const{index:i,indexInitialized:n}=this;if(!n){const{domain:s}=this;for(let r=0;rVn,fromToMotion:()=>xt,staticFromToMotion:()=>Fs});function XT(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function cS(e,t){if(typeof e=="string")try{e=Te.fromString(e)}catch{e=Te.fromArray([0,0,0])}if(typeof t=="string")try{t=Te.fromString(t)}catch{t=Te.fromArray([0,0,0])}return i=>Te.mix(e,t,i).toRgbaString()}var Uf=.2,Nc=["initial","remove","update","add","trailing","end","none"],Oc={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:Uf,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+Uf,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function qT(e){return e.every(t=>t instanceof Ns)}function Wf(e){return qT(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function Kf(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,n)=>Kf(i,t[n])):Zu(e)&&Zu(t)?e.equals(t):be(e)&&be(t)?Kp(e,t,Kf):!1}var JT=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??i0,this.phase=e.phase;const t=e.duration??Oc[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 Kf(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 n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(n-t)):0}get delta(){return this.ease(te(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||Zu(t))return this.interpolateValue(e,t);if(Array.isArray(t)){const n=[];for(let s=0;s{const r=[];for(const a of n)r.push(a(s));return r}}const i=[];for(const n of Object.keys(t)){const s=this.createInterpolator(e[n],t[n]);s!=null&&i.push([n,s])}return n=>{const s={};for(const[r,a]of i)s[r]=a(n);return s}}interpolateValue(e,t){if(!(e==null||t==null)){if(Zu(e))return i=>e[Yu](t,i);try{switch(typeof e){case"number":return XT(e,t);case"string":return cS(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}`)}}},Vn={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function xt(e,t,i,n,s,r,a){const{fromFn:o,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=s,{nodes:h,selections:u}=Wf(n),d=(g,f)=>{let m,y=0,b=0;for(const x of f){const M=g[y]===x,I={last:b>=f.length-1,lastLive:y>=g.length-1,prev:f[b-1],prevFromProps:m,prevLive:g[y-1],next:f[b+1],nextLive:g[y+(M?1:0)]},C=`${e}_${t}_${x.id}`;i.stopByAnimationId(C);let D="unknown";M?r&&a&&(D=QT(x,x.datum,r,a)):D="removed",x.transitionOut=D==="removed";const{phase:A,start:k,finish:N,delay:T,duration:R,...B}=o(x,x.datum,D,I),{phase:E,start:V,finish:G,delay:q,duration:j,...Q}=l(x,x.datum,D,I),ue=N==null;i.animate({id:C,groupId:e,phase:A??E??"update",duration:R??j,delay:T??q,from:B,to:Q,ease:Sc,collapsable:ue,onPlay:()=>{const re={...k,...V,...B};c(x,re,"start")},onUpdate(re){c(x,re,"update")},onStop:()=>{const re={...k,...V,...B,...Q,...N,...G};c(x,re,"end")}}),M&&y++,b++,m=B}};let p=0;for(const g of u){const f=g.nodes(),m=f.filter(y=>!g.isGarbage(y));d(m,f),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:Sc,onStop(){g.cleanup()}}),p++}d(h,h)}function Fs(e,t,i,n,s,r,a){const{nodes:o,selections:l}=Wf(n),{start:c,finish:h,phase:u}=a;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:s,to:r,ease:Sc,onPlay:()=>{if(c){for(const d of o)d.setProperties(c);for(const d of l){const p=d.nodes();d.batchedUpdate(function(){for(const f of p)f.setProperties(c)})}}},onUpdate(d){for(const p of o)p.setProperties(d);for(const p of l){const g=p.nodes();p.batchedUpdate(function(){for(const m of g)m.setProperties(d)})}},onStop:()=>{for(const d of o)d.setProperties({...r,...h});for(const d of l){const p=d.nodes();d.batchedUpdate(function(){for(const f of p)f.setProperties({...r,...h});d.cleanup()})}}})}function QT(e,t,i,n){const s=i(e,t);return n.added.has(s)?"added":n.removed.has(s)?"removed":e.previousDatum==null&&e.datum!=null?"added":e.previousDatum!=null&&e.datum==null?"removed":"updated"}var hS={};Mi(hS,{resetMotion:()=>Gt});function Gt(e,t){const{nodes:i,selections:n}=Wf(e);for(const s of n){const r=s.nodes();s.batchedUpdate(function(){for(const o of r){const l=t(o,o.datum);o.setProperties(l)}s.cleanup()})}for(const s of i){const r=t(s,s.datum);s.setProperties(r)}}var uS=class rb extends Xu{constructor(t=[],i=[]){super(),this.range=i,this.defaultTickCount=rb.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 rb}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 dS(...t)}calcBandwidth(t=1,i=1){const{domain:n}=this,s=this.getPixelRange();if(n.length===0)return s;let a=Math.abs(this.d1Cache-this.d0Cache)/t+1;if(i!==0){const o=Math.floor(s);a=Math.min(a,o)}return s/Math.max(1,a)}convert(t,i){const{domain:n}=this;if(!n||n.length<2||t==null)return Number.NaN;const{range:s}=this,r=i?.clamp??this.defaultClamp;let a=this.d0Cache,o=this.d1Cache,l=typeof t=="number"?t:t.valueOf();if(this.transform&&(a=this.transform(a),o=this.transform(o),l=this.transform(l)),r){const[h,u]=Ct([a,o]);if(lu)return s[1]}if(a===o)return(s[0]+s[1])/2;if(l===a)return s[0];if(l===o)return s[1];const c=s[0];return c+(l-a)/(o-a)*(s[1]-c)}invert(t,i){const{domain:n}=this;if(n.length<2)return;let s=this.d0Cache,r=this.d1Cache;this.transform&&(s=this.transform(s),r=this.transform(r));const{range:a}=this,[o,l]=a;let c;return o===l?c=this.toDomain((s+r)/2):c=this.toDomain(s+(t-o)/(l-o)*(r-s)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return Ju(this.domain)}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};uS.defaultTickCount=5;var Re=uS;function dS(...e){let t,i=1/0,n,s=-1/0;for(const r of e){const a=r.domain;for(const o of a){const l=o.valueOf();ls&&(s=l,n=o)}}return t!=null&&n!=null?{domain:[t,n],animatable:!0}:{domain:[],animatable:!1}}var e1=1e3,pS=20;function gS(e,t=0,i=e.length-1){const n=i-t+1;if(n<2)return{isUniform:!1};if(t<0||i>=e.length)return{isUniform:!1};const s=Array.from({length:pS},(l,c)=>t+Math.floor(c*(n-1)/(pS-1))),r=s.map(l=>e[l].valueOf()),a=(r.at(-1)-r[0])/(n-1);if(!Number.isFinite(a)||a===0)return{isUniform:!1};const o=Math.abs(a*.01);for(let l=1;lo)return{isUniform:!1}}return{isUniform:!0,interval:a}}var Vs=class YC extends Fn{static is(t){return t instanceof YC}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:n,reversed:s}=this,r=this.numericBands,a=r.length;if(n.length<=0)return Number.NaN;const o=this.ordinalRange(0),l=this.ordinalRange(a-1);if(a===0)return o;if(i?.clamp===!0){const{range:x}=this;if(t.valueOf()r.at(-1))return x[1]}if((i?.alignment??0)!==2){const x=super.convert(t,i);return s?l-(x-o):x}const h=t.valueOf();let u=this.findIndex(t)??0,d;s?(u=Math.min(Math.max(u,1),a-1),d=-1):(u=Math.min(Math.max(u,0),a-2),d=1);const p=r[u],g=r[u+d],f=this.ordinalRange(u),m=this.ordinalRange(u+d),b=(h-p)/(g-p)*(m-f)+f;return s?l-(b-o):b}invert(t,i=!1){this.refresh();const{domain:n}=this;if(n.length<=0)return;const s=this.bands,r=this.getBandCountForUpdate(),a=n[0].valueOf()>n.at(-1).valueOf();let o;return i?o=this.invertNearestIndex(t-this.bandwidth/2):o=fo(0,r-1,c=>this.ordinalRange(c)>=t)??r-1,s[a?r-1-o:o]}getUniformityCache(t){}findIndex(t,i=0,n=!1){if(t==null)return;const s=this.numericBands,r=s.length;if(r===0)return;if(r===1)return 0;const a=t.valueOf();return i===1!==n?fo(0,r-1,l=>s[l]>=a):En(0,r-1,l=>s[l]<=a)}},nt=class extends ce{constructor(){super(...arguments),this.id=Rn(this),this.node=new j0({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,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:n,wrapping:s,truncate:r}=this,a=r?e:1/0,o=r?t:1/0,l=Math.min(this.maxWidth??1/0,a)-n*2,c=this.maxHeight??o-n*2,h={maxWidth:l,maxHeight:c,font:this,textWrap:s};if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=i;return}let u;le(i)?(u=Zg(i,h),this.truncated=u.some(Lh)):(u=vx(ft(i),h),this.truncated=Xs(u)),this.node.text=u}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(!this.enabled||!this.text){this.destroyProxyText();return}const n=Je.toCanvas(this.node);if(!n)return;const{id:s}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:s,where:t}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",o=>this.handleMouseMove(e,o)),this.proxyText.addListener("mouseleave",o=>this.handleMouseLeave(e,o))]);const r=Xe(this.text);r!==this.lastProxyTextContent&&(this.proxyText.textContent=r,this.lastProxyTextContent=r);const{lastProxyBBox:a}=this;(a==null||n.x!==a.x||n.y!==a.y||n.width!==a.width||n.height!==a.height)&&(this.proxyText.setBounds(n),this.lastProxyBBox={x:n.x,y:n.y,width:n.width,height:n.height})}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.truncated){const{x:i,y:n}=Je.toCanvas(this.node),s=t.sourceEvent.offsetX+i,r=t.sourceEvent.offsetY+n;e.tooltipManager.updateTooltip(this.id,{canvasX:s,canvasY:r,showArrow:!1},[{type:"structured",title:Xe(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}}};nt.className="Caption",v([S,ot("node","visible")],nt.prototype,"enabled",2),v([S,ot("node")],nt.prototype,"text",2),v([S,ot("node")],nt.prototype,"textAlign",2),v([S,ot("node")],nt.prototype,"fontStyle",2),v([S,ot("node")],nt.prototype,"fontWeight",2),v([S,ot("node")],nt.prototype,"fontSize",2),v([S,ot("node")],nt.prototype,"fontFamily",2),v([S,ot("node","fill")],nt.prototype,"color",2),v([S],nt.prototype,"spacing",2),v([S],nt.prototype,"maxWidth",2),v([S],nt.prototype,"maxHeight",2),v([S],nt.prototype,"wrapping",2),v([S],nt.prototype,"truncate",2),v([S],nt.prototype,"padding",2),v([S],nt.prototype,"layoutStyle",2);var fS=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 n=i.findIndex(s=>s.symbol===e);if(n>=0){i.splice(n,1),i.length===0&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(n){z.errorOnce(n)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},rs={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},t1={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"},ai={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},i1=/%[-_0]?L/,n1=/%[-_0]?S/,s1=/%[-_0]?M/,r1=/%[-_0]?[HI]/,a1=/^%[-_0]?[de]$/,o1=/^%[-_0]?[Bbm]$/,l1=/^%[-_0]?[Yy]$/;function c1(e,t,i){if(typeof e=="string")return e;e??(e=rs);const{millisecond:n=rs.millisecond,second:s=rs.second,minute:r=rs.minute,hour:a=rs.hour,day:o=rs.day,month:l=rs.month,year:c=rs.year}=e,h=ai[t],u=t1[t],d=i?ai[i]:-1;if(d=ai.year&&!l1.test(c)||d=ai.month&&!o1.test(l)||d=ai.day&&!a1.test(o))return u;let p;switch(t){case"year":return c;case"month":return d=ai.hour&&!r1.test(p)||h>=ai.minute&&!s1.test(p)||h>=ai.second&&!n1.test(p)||h>=ai.millisecond&&!i1.test(p))return u;let g;return d{const a=yp.mergeSpecifiers(t,i)??rs;return yp.getFormatter("date",a,n,s,{truncateDate:r})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const n of t)be(n)&&be(i)?i={...i,...n}:i=n;return i}static getFormatter(t,i,n,s="long",{truncateDate:r}={}){if(be(i)){if(t!=="date"){z.warn("Date formatter configuration is not supported for non-date types.");return}n??(n="millisecond");const a=s==="component"?i?.[n]??rs[n]:c1(i,n,r);return Lo(a)}switch(t){case"number":{const a=Ph(i);return a==null?void 0:_p(a)}case"date":return Lo(i);case"category":return a=>i.replace("%s",String(a))}}setFormatter(t){this.formatter!==t&&(this.formatter=t,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:n,truncateDate:s,allowNull:r}={}){if(i.value==null&&!r)return;const{formatter:a}=this;if(a==null)return;if(typeof a=="function"){const h=t(a,i);return h==null?void 0:String(h)}const o=a[i.property];if(o==null)return;if(typeof o=="function"){const h=t(o,i);return h==null?h:ft(h)}else if(i.type==="date"){const{unit:h,style:u}=i;return this.dateFormatter(o,n,h,u,s)?.(i.value)}const l=n??o;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=yp.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(t,{specifier:i,truncateDate:n}={}){const{formatter:s}=this,r=typeof s=="function"?void 0:s?.[t.property];switch(t.type){case"date":{const{unit:a,style:o}=t,l=r!=null&&typeof r!="function"?r:void 0;return this.dateFormatter(l,i,a,o,n)?.(t.value)??String(t.value)}case"number":return mo(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"?mo(t.value):String(t.value)}}},xa=class{constructor(){this.enabled=!0}};v([S],xa.prototype,"enabled",2),v([S],xa.prototype,"stroke",2),v([S],xa.prototype,"strokeWidth",2),v([S],xa.prototype,"strokeOpacity",2);var qi=class extends ce{constructor(){super(...arguments),this.border=new xa}};v([S],qi.prototype,"border",2),v([S],qi.prototype,"color",2),v([S],qi.prototype,"cornerRadius",2),v([S],qi.prototype,"fill",2),v([S],qi.prototype,"fillOpacity",2),v([S],qi.prototype,"fontStyle",2),v([S],qi.prototype,"fontWeight",2),v([S],qi.prototype,"fontSize",2),v([S],qi.prototype,"fontFamily",2),v([S],qi.prototype,"padding",2);var Ji=class extends qi{constructor(){super(...arguments),this.enabled=!1,this._cachedFormatter=void 0}formatValue(e,t,i,n){const{formatter:s,format:r}=this;let a;if(s!=null&&(a??(a=e(s,n))),r!=null){let o=this._cachedFormatter;(o?.type!==t||o?.format!==r)&&(o={type:t,format:r,formatter:Jo.getFormatter(t,r)},this._cachedFormatter=o),a??(a=o.formatter?.(i))}return a==null||le(a)?a:String(a)}};v([S],Ji.prototype,"enabled",2),v([S],Ji.prototype,"formatter",2),v([S],Ji.prototype,"format",2),v([S],Ji.prototype,"itemStyler",2);function Qo(e){const{enabled:t=!1,stroke:i}=e?.border??{},s=e?.fill!=null||t&&i!=null?e?.padding:null;if(s==null)return{bottom:0,left:0,right:0,top:0};if(typeof s=="number")return{bottom:s,left:s,right:s,top:s};{const{bottom:r=0,left:a=0,right:o=0,top:l=0}=s;return{bottom:r,left:a,right:o,top:l}}}var Yf=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()}},as=class extends fa{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 U(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:n,x2:s,y2:r}=this;i=this.align(i),n=this.align(n),s=this.align(s),r=this.align(r);const{fill:a,horizontal:o}=this,{globalAlpha:l}=t;a!=null&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,n),t.lineTo(s,n),t.lineTo(s,r),t.lineTo(i,r),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:u,endLine:d}=this;if(!!((u||d)&&c&&h)){const{lineDash:g,lineDashOffset:f,lineCap:m,lineJoin:y}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,g&&t.setLineDash([...g]),f&&(t.lineDashOffset=f),m&&(t.lineCap=m),y&&(t.lineJoin=y),t.beginPath(),u&&(t.moveTo(i,n),o?t.lineTo(i,r):t.lineTo(s,n)),d&&(t.moveTo(s,r),o?t.lineTo(s,n):t.lineTo(i,r)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};as.className="Range",v([Y()],as.prototype,"x1",2),v([Y()],as.prototype,"y1",2),v([Y()],as.prototype,"x2",2),v([Y()],as.prototype,"y2",2),v([Y()],as.prototype,"startLine",2),v([Y()],as.prototype,"endLine",2),v([Y()],as.prototype,"horizontal",2);function mS(e,t){const i=e?.valueOf(),n=t?.valueOf();return typeof i!="number"||typeof n!="number"?[void 0,void 0]:iRx(r,n)&&!Number.isNaN(t.convert(r,{clamp:!0}));if(e.type==="range"){const[r,a]=i;return s(r)&&s(a)}else return s(i)}var h1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},u1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},d1={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}},p1={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}},Sa=class extends qi{constructor(){super(...arguments),this.padding=5}};v([S],Sa.prototype,"enabled",2),v([S],Sa.prototype,"padding",2),v([S],Sa.prototype,"text",2),v([S],Sa.prototype,"position",2),v([S],Sa.prototype,"rotation",2),v([S],Sa.prototype,"parallel",2);var oi=class extends ce{constructor(){super(),this.id=Rn(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Sa,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.position="top",this.rangeGroup=new ae({name:this.id}),this.lineGroup=new ae({name:this.id}),this.labelGroup=new ae({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new as),this.crossLineLabel=this.labelGroup.appendChild(new _o),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:n,scale:s}=this;if(!s||!t||!e||!bS(this,s)||n==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 r=i==="range";r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(e){if(this.data=void 0,!e)return;const{type:t,range:i,value:n,scale:s,clippedRange:r,strokeWidth:a=0}=this;if(!s)return;const o=s.bandwidth??0,l=s.step??0,c=s instanceof Fn?(l-o)/2:0;let[h,u]=Ct(r);h-=o,u+=o;let d,p,g,f;if(t==="line"){const m=o/2;if(d=s.convert(n)+m,p=Number.NaN,g=s.convert(n,{clamp:!0})+m,f=Number.NaN,g>=u||g<=h)return}else if(i){const[m,y]=i,[b,x]=mS(m,y);if(d=s.convert(m,{alignment:b}),p=s.convert(y,{alignment:x}),g=s.convert(m,{clamp:!0,alignment:b}),f=s.convert(y,{clamp:!0,alignment:x}),g>f&&([g,f]=[f,g],[d,p]=[p,d]),g>=u||f<=h)return;Number.isFinite(d)&&(g-=c),Number.isFinite(p)&&(p+=o,f+=o+c)}else return;g=ho(g,r),f=ho(f,r),d-c>=g&&(d-=c),p+c<=f&&(p+=c),this.startLine=a>0&&d>=g&&d<=g+c,this.endLine=a>0&&p>=f-o-c&&p<=f,this.data=[g,f],this.label.enabled===!1||this.label.text}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:n,gridPadding:s}=this,r=Number.isFinite(i)?i-t:0,a=e==="bottom"||e==="right"?-1:1,o=Math.min(a*s,a*(n+s));let l;switch(e){case"top":case"bottom":l=new U(t,o,r,n);break;case"left":case"right":l=new U(o,t,n,r)}this.updateRangeNode(l);const{label:c}=this;c.enabled!==!1&&c.text&&(this.updateLabel(),this.positionLabel(l))}updateRangeNode(e){const{type:t,position:i,crossLineRange:n,startLine:s,endLine:r,fill:a,fillOpacity:o,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u}=this;n.x1=e.x,n.x2=e.x+e.width,n.y1=e.y,n.y2=e.y+e.height,n.horizontal=i==="top"||i==="bottom",n.startLine=s,n.endLine=r,n.fill=t==="range"?a:void 0,n.fillOpacity=o??1,n.stroke=l,n.strokeWidth=c??1,n.strokeOpacity=h??1,n.lineDash=u}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?d1:p1)[i]:(e?h1:u1)[i]}positionLabel(e){const{crossLineLabel:t,label:{padding:i,rotation:n},anchor:s}=this;t.rotation=$t(n??0);const r=t.getBBox();if(!r)return;const{width:a,height:o}=r,l=typeof i=="number"?0:(i.right??0)-(i.left??0),c=typeof i=="number"?0:(i.bottom??0)-(i.top??0);let h=a/2,u=o/2;typeof i=="number"&&!t.hasBoxing()&&(h+=i,u+=i);const d=e.x+e.width*(s.rangeH+1)/2-h*s.labelH-l/2,p=e.y+e.height*(s.rangeV+1)/2-u*s.labelV-c/2;t.x=d,t.y=p,t.rotationCenterX=d,t.rotationCenterY=p}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new _o;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=$t(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:n,height:s}=i;return{width:n,height:s}}calculatePadding(e){const{label:{padding:t},anchor:i}=this,n=this.computeLabelSize();if(!n)return;const{width:s,height:r}=n,a=typeof t=="number"?t*2:(t.left??0)+(t.right??0),o=typeof t=="number"?t*2:(t.top??0)+(t.bottom??0),l=a+s,c=o+r,h=this.position==="left"||this.position==="right";h&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,l):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,l))),h||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,c):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,c)))}};oi.className="CrossLine",v([S],oi.prototype,"enabled",2),v([S],oi.prototype,"type",2),v([S],oi.prototype,"range",2),v([S],oi.prototype,"value",2),v([S],oi.prototype,"defaultColorRange",2),v([S],oi.prototype,"fill",2),v([S],oi.prototype,"fillOpacity",2),v([S],oi.prototype,"stroke",2),v([S],oi.prototype,"strokeWidth",2),v([S],oi.prototype,"strokeOpacity",2),v([S],oi.prototype,"lineDash",2),v([S],oi.prototype,"label",2);var cd=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};v([S],cd.prototype,"enabled",2),v([S],cd.prototype,"width",2),v([S],cd.prototype,"style",2);var Ma=class extends ce{};v([S],Ma.prototype,"placement",2),v([S],Ma.prototype,"step",2),v([S],Ma.prototype,"values",2),v([S],Ma.prototype,"minSpacing",2),v([S],Ma.prototype,"maxSpacing",2);var We=class extends ce{constructor(){super(...arguments),this.enabled=!0,this.border=new xa,this.wrapping="never",this.truncate=!1,this.spacing=5,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,n){const{formatter:s,format:r}=this,{type:a,value:o,domain:l,boundSeries:c}=t,h=t.type==="number"?t.fractionDigits:void 0,u=t.type==="date"?t.unit:void 0;let d;if(s!=null){const p=t.type==="date"?t.step:void 0,g=t.type==="number"?t.visibleDomain:void 0;d=e(s,{value:o,index:i,domain:l,fractionDigits:h,unit:u,step:p,boundSeries:c,visibleDomain:g})}if(r!=null&&d==null){const{specifier:p,dateStyle:g="long",truncateDate:f}=n??{},m=`${g}:${f??"none"}`;let y=this._formatters[m];const b=Jo.mergeSpecifiers(p,r);(y?.type!==a||y?.unit!==u||!yt(y?.mergedFormat,b))&&(y={type:a,mergedFormat:b,unit:u,formatter:Jo.getFormatter(a,b,u,g,{truncateDate:f})},this._formatters[m]=y),d=y.formatter?.(o,h)}return d==null||le(d)?d:String(d)}};v([S],We.prototype,"enabled",2),v([S],We.prototype,"border",2),v([S],We.prototype,"cornerRadius",2),v([S],We.prototype,"fill",2),v([S],We.prototype,"fillOpacity",2),v([S],We.prototype,"fontStyle",2),v([S],We.prototype,"fontWeight",2),v([S],We.prototype,"fontSize",2),v([S],We.prototype,"fontFamily",2),v([S],We.prototype,"wrapping",2),v([S],We.prototype,"truncate",2),v([S],We.prototype,"spacing",2),v([S],We.prototype,"minSpacing",2),v([S],We.prototype,"color",2),v([S],We.prototype,"rotation",2),v([S],We.prototype,"avoidCollisions",2),v([S],We.prototype,"mirrored",2),v([S],We.prototype,"padding",2),v([S],We.prototype,"parallel",2),v([S],We.prototype,"itemStyler",2),v([S],We.prototype,"formatter",2),v([S],We.prototype,"format",2);var hd=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};v([S],hd.prototype,"enabled",2),v([S],hd.prototype,"width",2),v([S],hd.prototype,"stroke",2);var Ia=class extends ce{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};v([S],Ia.prototype,"enabled",2),v([S],Ia.prototype,"width",2),v([S],Ia.prototype,"size",2),v([S],Ia.prototype,"stroke",2);var Ei=class extends ce{constructor(){super(...arguments),this.caption=new nt,this.enabled=!1,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0}};v([S],Ei.prototype,"enabled",2),v([S],Ei.prototype,"text",2),v([S],Ei.prototype,"spacing",2),v([S],Ei.prototype,"fontStyle",2),v([S],Ei.prototype,"fontWeight",2),v([S],Ei.prototype,"fontSize",2),v([S],Ei.prototype,"fontFamily",2),v([S],Ei.prototype,"color",2),v([S],Ei.prototype,"maxWidth",2),v([S],Ei.prototype,"maxHeight",2),v([S],Ei.prototype,"wrapping",2),v([S],Ei.prototype,"truncate",2),v([S],Ei.prototype,"formatter",2);var vS=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(vS||{});function g1(e){const[t,i]=Ct(e.range),n=Math.floor(t),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}var Zf=Math.PI*2,f1=Zf/2;function m1(e,t){return Math.abs(t-e)t?t+Zf:t-Zf}function y1(e){const{min:t,max:i}=e,n=l=>li;return{tick:{fromFn(l,c,h){let{x1:u,x2:d,y1:p,y2:g}=l,f=l.opacity;return(h==="added"||n(c.offset))&&({x1:u,x2:d,y1:p,y2:g}=c,f=0),{x1:u,x2:d,y1:p,y2:g,opacity:f,phase:Vn[h]}},toFn(l,c,h){const{x1:u,x2:d,y1:p,y2:g}=c;let f=1;return h==="removed"&&(f=0),{x1:u,x2:d,y1:p,y2:g,opacity:f}},applyFn(l,c){l.setProperties(c),l.visible=!n(l.y)}},line:{fromFn(l,c){const{x1:h,x2:u,y1:d,y2:p}=l.previousDatum??c;return{x1:h,x2:u,y1:d,y2:p,phase:Vn.updated}},toFn(l,c){const{x1:h,x2:u,y1:d,y2:p}=c;return{x1:h,x2:u,y1:d,y2:p}}},label:{fromFn(l,c,h){const u=l.previousDatum??c;let{x:d,y:p,rotationCenterX:g,rotationCenterY:f,rotation:m}=u,y=l.opacity;return h==="removed"||n(u.y)?m=c.rotation:(h==="added"||n(l.datum.y))&&({x:d,y:p,rotationCenterX:g,rotationCenterY:f,rotation:m}=c,y=0),{x:d,y:p,rotationCenterX:g,rotationCenterY:f,rotation:m,opacity:y,phase:Vn[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:p,rotationCenterY:g}=c;let f=0,m=1;return h==="added"?f=c.rotation:h==="removed"?(m=0,f=c.rotation):f=m1(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:p,rotationCenterY:g,rotation:f,opacity:m,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:Vn.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function b1(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function ud(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function xS(){return(e,t)=>{const{x1:i,x2:n,y1:s,y2:r}=t;return{x1:i,x2:n,y1:s,y2:r}}}function v1(){return(e,t)=>{const{x1:i,x2:n,y1:s,y2:r}=t;return{x:i,y:s,width:n-i,height:r-s}}}var SS=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(SS||{});function MS(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 IS(e,t,i){const n=e.bandwidth??0,r=((e.step??0)-n)/2,a=e.convert(i),o=a-r,l=a+n+r;return[a,ho(o,t),ho(l,t)]}var Dr=class ZC{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new Ma,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new Ei,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 ae({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Fo({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Fo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new ae({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new Yt({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new ae({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new ae({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Fo({name:`${this.id}-CrossLines-Range`,zIndex:6}),this.crossLineLineGroup=new Fo({name:`${this.id}-CrossLines-Line`,zIndex:10}),this.crossLineLabelGroup=new Fo({name:`${this.id}-CrossLines-Label`,zIndex:15}),this.tickLabelGroupSelection=bt.select(this.tickLabelGroup,_o,!1),this.line=new hd,this.tick=new Ia,this.gridLine=new cd,this.label=this.createLabel(),this.defaultTickMinSpacing=ZC.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 tt,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new Zv(()=>{const{direction:n,boundSeries:s}=this;return wi(s.flatMap(r=>r.getFormatterContext(n)))}),this.moduleMap=new Yf,this.range=this.scale.range.slice();for(const n of this.crossLines)this.initCrossLine(n);this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",n=>this.onMouseMove(n)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}set crossLines(t){const{CrossLineConstructor:i}=this.constructor;for(const n of this._crossLines)this.detachCrossLine(n);this._crossLines=t.map(n=>{const s=new i;return s.set(n),s});for(const n of this._crossLines)this.attachCrossLine(n),this.initCrossLine(n)}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(t){}onMouseMove(t){const n=this.tickLabelGroup.pickNode(t.currentX,t.currentY)?.datum,{textUntruncated:s=void 0}=n??{};s?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:t.currentX,canvasY:t.currentY,showArrow:!1},[{type:"structured",title:s}]),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:n}=this,s=(i[1]-i[0])/(t[1]-t[0]),r=s*t[0],a=i[0]-r;n.range=[a,a+s]}updateScale(){const{range:[t,i]}=this;this.setScaleRange(this.visibleRange);for(const n of this.crossLines)n.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[n,s]=Ct(this.range);return t>=n-i&&t<=s+i}getRangeOverflow(t){const{range:i,visibleRange:n}=this,s=(i[1]-i[0])/(n[1]-n[0]),[r,a]=Ct([i[0]-s*n[0],i[0]-s*n[0]+s]);return ta?t-a:0}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange();for(const n of this.crossLines)this.initCrossLine(n)}onGridVisibilityChange(){}createLabel(){return new We}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.gridLine.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(t,i,n=this.label){const s={border:n.border,color:n.color,cornerRadius:n.cornerRadius,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,padding:n.padding,spacing:n.spacing};let r;n.itemStyler&&(r=this.cachedCallWithContext(n.itemStyler,{...t,...s}));const a=xe(r,i,s);return{border:a.border,color:a.color,cornerRadius:a.cornerRadius,fill:a.fill,fillOpacity:a.fillOpacity,fontFamily:a.fontFamily,fontSize:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight,padding:a.padding,spacing:a.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:n}=this,r=(t?i:i.filter(a=>a.isEnabled())).map(a=>a.getDomain(n));this.setDomains(...r)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...t){let i,n;if(t.length>0){const s=this.scale.normalizeDomains(...t);i={domain:s.domain,sortMetadata:{sortOrder:1}},n=s.animatable}else i={domain:[]},n=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(s){return s==null}),this.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=n}calculateDomain(t,i="none"){const{dataDomain:{domain:n},range:s,scale:r,gridLength:a}=this,o=qr(s),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let u;if(h==null||!MS(h,{domain:n,rangeExtent:o,nice:c,gridLength:a,visibleRange:l,initialPrimaryTickCount:t,scrollbarKey:i})){const d=r.range;this.setScaleRange([0,1]);const p=c.map(g=>g?0:2);u=this.calculateTickLayout(n,p,[0,1],t),r.range=d,this.unzoomedTickLayoutCache={domain:n,rangeExtent:o,nice:c,gridLength:a,visibleRange:l,initialPrimaryTickCount:t,scrollbarKey:i,tickLayout:u}}else u=h.tickLayout;return this.updateScale(),r.domain=u.niceDomain,{unzoomedTickLayout:u,domain:r.domain}}calculateLayout(t,i){this.chartLayout=i;const n=this.getScrollbarLayoutCacheKey(i),{visibleRange:s}=this,r=s[0]===0&&s[1]===1,{unzoomedTickLayout:a,domain:o}=this.calculateDomain(t,n),l=this.getDomainExtentsNice();let c;if(r)c=a;else{const{range:f,gridLength:m}=this,y=qr(f),b=l.map(M=>M?1:2),{tickLayoutCache:x}=this;x==null||!MS(x,{domain:o,rangeExtent:y,nice:l,gridLength:m,visibleRange:s,initialPrimaryTickCount:t,scrollbarKey:n})?(c=this.calculateTickLayout(o,b,s,t),this.tickLayoutCache={domain:o,rangeExtent:y,nice:l,gridLength:m,visibleRange:s,initialPrimaryTickCount:t,scrollbarKey:n,tickLayout:c}):c=x.tickLayout}const{rawTickCount:h=0,fractionDigits:u,bbox:d}=c,p=a.rawTickCount??0,g=h!==0&&p!==0?{zoomed:h,unzoomed:p}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:u,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:g,bbox:d}}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.gridPadding=this.gridPadding,i.update(t)}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:i,crossLineLabelGroup:n,gridGroup:s,translation:r}=this,a=Math.floor(r.x),o=Math.floor(r.y);s.setProperties({translationX:a,translationY:o}),t.setProperties({translationX:a,translationY:o}),i.setProperties({translationX:a,translationY:o}),n.setProperties({translationX:a,translationY:o})}tickFormatter(t,i,n,s,r,a="long"){const{moduleCtx:o,label:l}=this,{formatManager:c}=o,h=n?this.primaryLabel:void 0,u=this.tickFormatParams(t,i,s,r),d=this.formatterBoundSeries.get();let p,g,f;if(u.type==="number")p=u.fractionDigits;else if(u.type==="date"){const{unit:C,step:D,epoch:A}=u;g={unit:C,step:D,epoch:A},f=u.truncateDate}const m=this.uncachedCallWithContext.bind(this),y={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:t,boundSeries:d},b=h??l,x=n?l.format:void 0,{allowNull:M}=this,I={specifier:Jo.mergeSpecifiers(h?.format,l.format),truncateDate:f,allowNull:M};return(C,D)=>{const A=this.datumFormatParams(C,y,p,g,a);return A.value=C,b.formatValue(m,A,D,{specifier:x,dateStyle:a,truncateDate:f})??c.format(m,A,I)??c.defaultFormat(A,I)}}formatDatum(t,i,n,s,r,a,o,l,c,h,u){if(i==null&&!u)return"";const{moduleCtx:d,dataDomain:p}=this;l??(l=p.domain);const{formatManager:g}=d,f=this.formatterBoundSeries.get();let m;switch(n){case"crosshair":case"annotation-label":m=this.layout.label.fractionDigits+1;break;case"series-label":m=2;break;case"tooltip":m=3;break;case"legend-label":m=void 0;break}const y=this.datumFormatParams(i,{source:n,datum:a,seriesId:s,legendItemName:r,key:o,property:this.getFormatterProperty(),domain:l,boundSeries:f},m,void 0,"long"),{type:b,value:x}=y,M=this.createCallWithContext(t),I=c?.formatValue(M,b,x,h??y)??g.format(M,y,{allowNull:u})??this.label.formatValue(M,y,Number.NaN)??g.defaultFormat(y);return le(I)?I:String(I)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength,t.gridPadding=this.gridPadding}hasVisibleSeries(){return this.boundSeries.some(t=>t.isEnabled())}clipTickLines(t,i,n,s){this.tickLineGroup.setClipRect(new U(t,i,n,s))}clipGrid(t,i,n,s){this.gridGroup.setClipRect(new U(t,i,n,s))}getFormatterProperty(){const{direction:t,boundSeries:i}=this;let n=t;for(const s of i){const r=s.resolveKeyDirection(t);if(r!==t){n=r;break}}return n}getTitleFormatterParams(t){const{direction:i}=this,n=this.formatterBoundSeries.get();return{domain:t,direction:i,boundSeries:n,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:Re.is(t)||Vs.is(t),getCanvasBounds:()=>Je.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,n)=>{const s=n.getKeyProperties(this.direction);for(const r of s)i.add(r);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,n,s)=>{const{allowNull:r}=this;return this.formatDatum(void 0,i,n,void 0,void 0,void 0,void 0,void 0,s,void 0,r)},attachLabel:i=>this.attachLabel(i),inRange:(i,n)=>this.inRange(i,n),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i),measureBand:i=>this.measureBand(i)}}pickBand(t){if(!Fn.is(this.scale))return;const{scale:i,range:n,id:s}=this,r=i.invert(this.isVertical()?t.y:t.x,!0),[a,o,l]=IS(i,n,r);return{id:s,value:r,band:[o,l],position:a}}measureBand(t){if(!Fn.is(this.scale))return;const[,i,n]=IS(this.scale,this.range,t);return{band:[i,n]}}isVertical(){return this.direction==="y"}isReversed(){return this.reverse}cachedCallWithContext(t,i){const{callbackCache:n,chartService:s}=this.moduleCtx;return n.call([this,s],t,i)}uncachedCallWithContext(t,i){const{chartService:n}=this.moduleCtx;return Nn([this,n],t,i)}createCallWithContext(t){const{chartService:i}=this.moduleCtx;return(n,s)=>Nn([t,this,i],n,s)}};Dr.defaultTickMinSpacing=50,Dr.CrossLineConstructor=oi,v([S],Dr.prototype,"nice",2),v([S],Dr.prototype,"reverse",2),v([S],Dr.prototype,"interval",2),v([S],Dr.prototype,"title",2),v([ns((e,t,i)=>e.onGridLengthChange(t,i))],Dr.prototype,"gridLength",2);var Xf=Dr,qf=class extends We{constructor(){super(...arguments),this.autoRotateAngle=335}};v([S],qf.prototype,"autoRotate",2),v([S],qf.prototype,"autoRotateAngle",2);var dd=new Date(1970,0,4),el=class XC extends Re{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof XC}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[n,s]=i;const r=4,a=this.getPixelRange();for(let o=0;oa%u.duration===0);if(o){const{timeInterval:u,step:d,duration:p}=o,g={...u,step:d*yr(u)*Math.round(a/p),epoch:tf(u,{weekStart:dd})};return Yi(g,new Date(e),new Date(t),{visibleRange:s,extend:r})}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()+a);return h}function S1(e,t,i,n){const{interval:s}=i,r=Math.min(Wt(e),Wt(t)),a=Math.max(Wt(e),Wt(t));let o;if(be(s)||typeof s=="string")o=s;else{let u;typeof s=="number"&&(u=(a-r)/Math.max(s,1),Ao(u,n)&&(u=void 0)),u??(u=i.tickCount??Re.defaultTickCount),o=mc(r,a,u,i.minTickCount,i.maxTickCount,{weekStart:dd})}if(o==null)return[e,t];const l=Yi(o,new Date(r),new Date(a),{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 M1=1e3,Cr=class qC extends Vs{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Re.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof qC}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=CS(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,n=i.length;if(!t||t[0]===0&&t[1]===1)return n>M1&&this._uniformityCache===void 0&&(this._uniformityCache=gS(i)),this._uniformityCache;const s=Math.floor(t[0]*n),r=Math.min(Math.ceil(t[1]*n),n-1);return gS(i,s,r)}normalizeDomains(...t){const i=t.filter(r=>r.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const n=i[0].domain,s=i.every(r=>r.domain===n);if(i.length===1||s){const r=i[0];let a=r.domain,o,l=!1;return r.sortMetadata?.sortOrder===void 0?o=Eg(a):(o=r.sortMetadata.sortOrder,l=r.sortMetadata.isUnique??!1),o===-1?a=a.slice().reverse():o==null&&(a=l?a.slice().sort((c,h)=>c.valueOf()-h.valueOf()):Og(a.slice())),{domain:a,animatable:!0}}return{domain:Og(i.map(r=>r.domain).flat()),animatable:!0}}ticks(t,i,n=[0,1],{extend:s=!1,dropInitial:r=!1}={}){const{interval:a,maxTickCount:o,tickCount:l=o}=t,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(n=[1-n[1],1-n[0]]),this.refresh(),a==null){const{ticks:x,tickOffset:M,tickEvery:I}=this.getDefaultTicks(i,l,n,s);let C=x.length>0?this.findIndex(x[0]):void 0;return C=C==null?void 0:Math.floor((C-M)/I),{ticks:x,count:void 0,firstTickIndex:C}}let u,d;i&&i.length>=2?(u=i[0].valueOf(),d=i.at(-1).valueOf()):(u=c[0].valueOf(),d=c.at(-1).valueOf());const[p,g]=this.range,f=Math.abs(g-p),m=DS({start:u,stop:d,interval:a,availableRange:f,visibleRange:n,extend:s})??this.getDefaultTicks(i,l,n,s).ticks,y=[];let b=-1;for(const x of m){const M=this.findIndex(x,1)??-1,I=M===b;b=M,!(r&&M===0)&&M!==-1&&!I&&y.push(c[M])}return{ticks:y,count:void 0,firstTickIndex:void 0}}stepTicks(t,i,n=[0,1],s=!0){const r=i?this.bandDomainIndices(i):void 0,a=this.ticksEvery(r,n,t,0,!1),o=a.at(-1),l=s&&t>1?r?.[1]:void 0,c=l!=null&&o!=null?this.findIndex(o):void 0;return c!=null&&l!=null&&l-c0&&e[0]>e.at(-1)}var I1=1e3,Jf=5e7,Ar=class JC extends Vs{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(t){return t instanceof JC}static supportsInterval(t,i){return AS(t,i)}set domain(t){if(t!==this._domain){if(t.length===this._domain.length&&t.length>=2&&t[0].valueOf()===this._domain[0].valueOf()&&t[1].valueOf()===this._domain[1].valueOf()){this._domain=t;return}this._domain=t,this.invalidateCaches()}}get domain(){return this._domain}get interval(){return this._interval}set interval(t){this._interval!==t&&(this._interval=t,this.invalidateCaches())}invalidateCaches(){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=>Cx(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=>mr(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 n=this.getCachedBandRange();if(n==null){this._encodedBands=[];return}const[s,r]=n,a={visibleRange:[0,1],extend:!1};if(Ru(i,s,r,a)>Jf){z.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:o,encodingParams:l}=Dx(i,s,r,a);this._encodedBands=o,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>I1&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=mr(this._encodedBands[0],this._encodingParams),s=mr(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:s-n}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=mr(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:mr(this._encodedBands[1],this._encodingParams)-n}}return{isUniform:!1}}normalizeDomains(...t){return dS(...t)}getCachedBandRange(){const{domain:t,interval:i}=this;if(!(t.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:Ti(i,t[0]),stop:Ti(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[n,s]=i,r=Math.min(n.valueOf(),s.valueOf()),a=Math.max(n.valueOf(),s.valueOf()),o=qg(t,new Date(a)).valueOf();this._domainBoundaries={d0:r,dNext:o}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const t=mr(this._encodedBands[0],this._encodingParams),i=mr(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 n=this.getBandCountForUpdate();if(n===0)return;if(n===1)return 0;const s=this.getLinearParams();if(s==null||s.intervalMs===0)return super.findIndex(t,i);const{firstBandTime:r,intervalMs:a}=s,o=t.valueOf(),l=(o-r)/a;let c=i===1?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,n-1)),this.isLinearUnit()){if(i===1){if(r+c*ao&&c===0)return;return c}const h=this.numericBands;if(i===1){for(;c>0&&h[c-1]>=o;)c--;for(;c0&&h[c]>o;)c--;if(h[c]>o)return}return c}convert(t,i){this.refresh(),t instanceof Date||(t=new Date(t));const{domain:n,interval:s}=this;if(n.length<2)return Number.NaN;if(i?.clamp!==!0&&s!=null){const r=this.getDomainBoundaries();if(r!=null){const a=t.valueOf();if(a=r.dNext)return Number.NaN}}return super.convert(t,i)}calculateBands(t,i,n=!1){const s=t===this.domain&&i[0]===0&&i[1]===1&&!n;if(s&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(t.length<2)return{bands:[],firstBandIndex:void 0};const{interval:r}=this;if(r==null)return{bands:[],firstBandIndex:void 0};const a={visibleRange:i,extend:n};if(!AS(t,r,a))return{bands:[],firstBandIndex:void 0};const o=t===this.domain?this.getCachedBandRange():Qf(t,r);if(o==null)return{bands:[],firstBandIndex:void 0};const[l,c]=o;if(Ru(r,l,c,a)>Jf)return z.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const h=Yi(r,l,c,a),u=ef(r,l,c,a);return s&&(this._bands=h),{bands:h,firstBandIndex:u}}ticks({interval:t},i=this.domain,n=[0,1],{extend:s=!1}={}){if(i.length<2)return;const r=i===this.domain&&!s;if(r&&t!=null)return this.ticksFromNumericBands(t,i,n);let a,o,l;return r?({bands:a}=this.calculateBands(i,[0,1],!1),l=x0(a,!1,n),o=l[0]):{bands:a,firstBandIndex:o}=this.calculateBands(i,n,s),t==null?{ticks:a,count:void 0,firstTickIndex:o}:this.ticksFromBands(t,a,i,n,s,l,o)}ticksFromNumericBands(t,i,n){const s=this.numericBands,r=s.length;if(r===0)return{ticks:[],count:0,firstTickIndex:void 0};const a=x0(s,!1,n),o=a[0],l=this.interval?vi(this.interval):1/0,c=Math.min(i[0].valueOf(),i[1].valueOf()),h=Math.max(i[0].valueOf(),i[1].valueOf());let u,d,p;if(be(t)||typeof t=="string")u=Yi(t,i[0],i[1],{extend:!0,visibleRange:n}).map(x=>x.valueOf()),d=0,p=u.length-1;else{const b=a[0],x=a[1]-1;u=s,d=En(b,x,M=>s[M]<=c)??b,p=En(b,x,M=>s[M]<=h)??x}const g=[];let f;for(let b=d;b<=p;b++){const x=u[b],M=En(0,r-1,I=>s[I]<=x);M!=null&&M!==f&&x-s[M]<=l&&g.push(s[M]),f=M}const[m,y]=this.sliceTickWindow(g,c,h,!1);return{ticks:g.slice(m,y+1).map(b=>new Date(b)),count:g.length,firstTickIndex:o}}ticksFromBands(t,i,n,s,r,a,o){const l=this.interval?vi(this.interval):1/0,c=Math.min(n[0].valueOf(),n[1].valueOf()),h=Math.max(n[0].valueOf(),n[1].valueOf());let u,d,p;if(be(t)||typeof t=="string")u=Yi(t,n[0],n[1],{extend:!0,visibleRange:s}),d=0,p=u.length-1;else{const x=a?a[0]:0,M=a?a[1]-1:i.length-1;u=i,d=En(x,M,I=>i[I].valueOf()<=c)??x,p=En(x,M,I=>i[I].valueOf()<=h)??M}const g=[];let f;for(let x=d;x<=p;x++){const M=u[x].valueOf(),I=En(0,i.length-1,D=>i[D].valueOf()<=M),C=I!=null&&I!=f?i[I]:void 0;f=I,C!=null&&M-C.getTime()<=l&&g.push(C)}const m=g.map(x=>x.valueOf()),[y,b]=this.sliceTickWindow(m,c,h,r);return{ticks:g.slice(y,b+1),count:g.length,firstTickIndex:o}}sliceTickWindow(t,i,n,s){let r,a;if(this.interval){const c=Qf([new Date(i),new Date(n)],this.interval);r=c[0].valueOf(),a=c[1].valueOf()}else r=i,a=n;let o=fo(0,t.length-1,c=>t[c]>=r)??0,l=En(0,t.length-1,c=>t[c]<=a)??t.length-1;return s&&(o=Math.max(o-1,0),l=Math.min(l+1,t.length-1)),[o,l]}};function AS(e,t,i){const[n,s]=Qf(e,t);return Ru(t,n,s,i)<=Jf}function Qf(e,t){const i=Ti(t,e[0]),n=Ti(t,e[1]);return[i,n]}function D1(e,t,i,n,s){let[r,a]=Ct(t.map(Number));const o=Math.floor(i.unzoomed);if(o<=1){const[y,b]=C1(r,a),x=5*Math.pow(2,-Math.ceil(Math.log2(s[1]-s[0]))),{ticks:M}=Do(y,b,x,void 0,void 0,s),I=[e.toDomain(y),e.toDomain(b)];return n&&I.reverse(),{domain:I,ticks:M}}if(r===a){const y=Math.floor(Math.log10(r)),b=Math.pow(10,y),x=Math.min(b,1),M=o-1;r-=x*Math.floor(M/2),a=r+x*M}let l=r,c=a;l=A1(l,c,o);const h=k1(l,c,o),u=o-1;c=l+u*h;const d=Math.floor(l/h)*h,p=Math.floor(c/h)*h;d<=r&&p>=a&&(l=d,c=p);const g=[e.toDomain(l),e.toDomain(c)];n&&g.reverse();const f=h*((i.unzoomed-1)/(i.zoomed-1)),m=w1(l,f,Math.floor(i.zoomed));return{domain:g,ticks:m}}function C1(e,t){let i=e,n=t,s=0;do{[i,n]=nf(i,n);const{ticks:r}=Do(i,n,5);if(r.length%2===1)return[i,n];i-=1,n+=1}while(s++<10);return[e,t]}function A1(e,t,i){e=Math.floor(e);const n=Math.abs(t-e)/(i-1),s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return Math.floor(e/r)*r}function w1(e,t,i){const n=Rh(t),s=Math.pow(10,n),r=[];for(let a=0;a0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:e}var T1=18,N1=[1,2,3,4,6,8,9,10,12];function wS(e,t=0){const i=[];for(const n of e){const{x:s,y:r,width:a,height:o}=n;if(i.some(l=>Tg(l,s,r,a+t,o+t)))return!0;i.push(n)}return!1}function O1(e,t,i,n){if(e==null)return t;if(typeof e!="number"){const o=t[0],l=typeof e=="string"?{unit:e,epoch:o}:{...e,epoch:o};return Yi(l,t[0],t[1],{visibleRange:i,extend:n})}const s=[],r=t[0].valueOf(),a=t[1].valueOf();for(let o=r;o<=a;o+=e)s.push(new Date(o));return s}function kS(e,t){if(e.length!==t.length)return!1;for(let i=0;i{const x=Fn.is(c)&&c.bandwidth||1/0,M=(c.bandwidth??0)/2,I=P1(h.enabled,s,t,i,o,l,u);let C=p?g:x,D=p?x:g;if(h.rotation){const k=Cg(h.rotation,C,D);C=k.width,D=k.height}const A={font:h,maxWidth:C,maxHeight:D,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping};for(let k=0;k(u?c:h)?.(d,p)??String(d)}function F1(e,t,i,n,s,r,a,o){if(!el.is(e)&&!Vs.is(e))return;const l=fc(r);if(l==null)return;a&&(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[u,d]=Jg(new Date(c),new Date(h),t);u=Ti(l,u),u.valueOf()>=c&&(u=Ix(l,u)),d=Mx(l,d),d.valueOf()<=h&&(d=qg(l,d));const p=Yi(l,u,d),g=vi(r),f=Cr.is(e),m={...s,interval:r},y=[];let b,x,M,I=0;if(Cr.is(e)){const C=Ls(r);x=o!=null&&vi(o)>=vi(C)?2:3,M=1;const D=i/n,A=e.bandCount(t)/(D*T1);I=N1.findLast(k=>A>=k)??1}else Ar.is(e)&&(e.interval==null||vi(e.interval)>=g)?x=1:(x=0,M=2);for(let C=0;Cq.valueOf(){switch(x){case 0:case 3:return q.valueOf()+g>A.valueOf();case 1:case 2:return q.valueOf()>=A.valueOf()}}),B.length===0)continue;const E=B[0],V=Ng(E,D);(x===0?V===0:V<=g)&&(!f||!k)&&(b??(b=new Set),b.add(y.length)),y.push(...B)}return b?.size===1&&b.has(0)&&(b=void 0),{ticks:y,primaryTicksIndices:b,alignment:M}}function V1(e,t,i,n,s){const r=TS(e.format,n);if(r==null)return{width:0,height:0};const a=Lo(r),o=n?fc(n):void 0,l=TS(t?.format,o),c=l?Lo(l):a,h=new Date(i[0]),u=new Date(i.at(-1)),d=o?Yi(o,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let p=0,g=0;if(a!=null){const f=Qo(e),m=f.left+f.right,y=f.top+f.bottom;let b,x;d!=null&&d.length>1?(b=d[0],x=d[1]):(b=h,x=u);const M=Yi(n,b,x,{limit:50});for(const I of M){const C=a(I),{width:D,height:A}=s.measureLines(C);p=Math.max(p,D+m),g=Math.max(g,A+y)}}if(c!=null&&d!=null){const f=Qo(t),m=f.left+f.right,y=f.top+f.bottom;for(const b of d){const x=c(b),{width:M,height:I}=s.measureLines(x);p=Math.max(p,M+m),g=Math.max(g,I+y)}}return{width:Math.ceil(p),height:Math.ceil(g)}}function _1(e,t,i,n){return e&&!t?i*n===-1?"top":"bottom":"middle"}function B1(e,t,i,n,s){const r=t>0&&t<=Math.PI,a=i>0&&i<=Math.PI,o=r||a?-1:1;if(e)if(t||i){if(n*o===-1)return"right"}else return"center";else if(n*s===-1)return"right";return"left"}function TS(e,t){if(e!=null){if(typeof e=="string")return e;if(be(e)&&t!=null)return e[Ls(t)]}}function z1(e,t,i=0){const n=ws(e),s=!n&&i>=0&&i<=Math.PI?-1:1,r=!n&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,a=t?s*(Math.PI/2):0;return{configuredRotation:n,defaultRotation:a,parallelFlipFlag:s,regularFlipFlag:r}}var G1=new Date(1970,0,4);function NS(e){const{label:t,domain:i,axisRotation:n,labelOffset:s,sideFlag:r}=e,{defaultRotation:a,configuredRotation:o,parallelFlipFlag:l,regularFlipFlag:c}=z1(t.rotation,t.parallel,n),h=o+a,u=(A,k=0)=>{const N=t.minSpacing??(o===0&&k===0?10:0),T=h+k,R=Qo(t);return wS($1(e,A,T),N)||wS(U1(A.ticks,s,T,R),N)},{maxTickCount:d}=OS(e),p=j1(e),g=t.enabled&&t.avoidCollisions,f=Number.isFinite(d)?d:10,m=g&&t.autoRotate&&t.rotation==null;let y=0,b=0,x=!0,M={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;x&&y<=f;)({tickData:M,index:y}=H1(e,p,M,y)),b=m&&u(M,0)?ws(t.autoRotateAngle):0,x=g&&u(M,b);const I=B1(t.parallel,o,b,r,c),C=_1(t.parallel,o,r,l),D=o+b;return{tickData:M,textAlign:I,textBaseline:C,rotation:D}}function j1(e){return e.interval?.values?2:e.primaryTickCount!=null?1:0}function OS({scale:e,domain:t,range:i,visibleRange:n,label:s,defaultTickMinSpacing:r,interval:{minSpacing:a,maxSpacing:o}}){const{defaultTickCount:l}=e,c=qr(i),h=qr(n);if(qo.is(e)||Cr.is(e)&&t.length<1e3){const u=qo.is(e)?t.length:Math.min(t.length,Math.max(1,Math.floor(c/(h*r)))),d=Math.ceil(c/(h*s.fontSize));return{tickCount:Math.min(d,u),minTickCount:0,maxTickCount:u}}return Ox(c,h,a,o,l,r)}function H1(e,t,i,n){const{step:s,values:r}=e.interval,{maxTickCount:a,minTickCount:o,tickCount:l}=OS(e),c=k=>Math.max(l-k,o),h=s==null&&r==null&&c(n)>o,u=i.rawTicks,d=l-o,p={minTickCount:o,maxTickCount:a,tickCount:c(n)};let g=ES(e,t,p);if(h&&kS(g.rawTicks,u)){let k=n,N=d;for(;k<=N;){n=Math.trunc((k+N)/2),p.tickCount=c(n);const T=ES(e,t,p);kS(T.rawTicks,u)?k=n+1:(g=T,N=n-1)}}const{tickDomain:f,niceDomain:m,rawTicks:y,rawTickCount:b,rawFirstTickIndex:x,generatePrimaryTicks:M,primaryTicksIndices:I,alignment:C,fractionDigits:D,timeInterval:A}=g;return{tickData:{tickDomain:f,niceDomain:m,rawTicks:y,rawTickCount:b,fractionDigits:D,timeInterval:A,ticks:R1(e,{niceDomain:m,rawTicks:y,rawFirstTickIndex:x,generatePrimaryTicks:M,primaryTicksIndices:I,alignment:C,fractionDigits:D,timeInterval:A})},index:n+1}}function ES(e,t,i){const{domain:n,reverse:s,visibleRange:r,scale:a,interval:o,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:u}=e,d={nice:c.map(k=>k===0),interval:o.step,...i},p={...d,nice:c.map(k=>k===0||k===1)};let g;t===1&&h!=null&&Re.is(a)&&(g=D1(a,n,h,s,r));const f=c.includes(0)?g?.domain??a.niceDomain(d,n):n;let m=f,y,b,x,M,I,C;const D=l?.enabled===!0&&p.interval==null;LS(a,f,()=>{switch(t){case 2:if(m=o.values,y=o.values,b=y.length,Cr.is(a)?C=1:Ar.is(a)&&(C=2),Re.is(a)){const[k,N]=Ct(f.map(Number));y=y.filter(T=>Number(T)>=k&&Number(T)<=N).sort((T,R)=>Number(T)-Number(R))}break;case 1:if(g)y=g.ticks,b=g.ticks.length;else{const k=a.ticks(p,f,r);y=k?.ticks,b=k?.count}break;default:{const{tickCount:k,minTickCount:N,maxTickCount:T}=i;if(f.length>0&&p.interval==null&&(Ar.is(a)||D&&(el.is(a)||Cr.is(a)))){const E=f,V=Math.min(E[0].valueOf(),E.at(-1).valueOf()),G=Math.max(E[0].valueOf(),E.at(-1).valueOf());M=mc(V,G,k,N,T,{weekStart:l==null?G1:void 0,primaryOnly:!0})}let R;Cr.is(a)?R=u:Ar.is(a)&&(R=a.interval),R!=null&&M!=null&&vi(R)>=vi(M)&&(M=R);const B=M?F1(a,r,k,T,p,M,s,u):void 0;if(B)({ticks:y,primaryTicksIndices:I,alignment:C}=B);else{const E=Ar.is(a)&&p.interval==null&&M!=null?{...p,interval:M}:p,V=a.ticks(E,f,r);if(y=V?.ticks,b=V?.count,x=V?.firstTickIndex,el.is(a)||Vs.is(a)){const G=typeof p.interval=="number"?yc(p.interval):p.interval;M??(M=G??V?.timeInterval)}}}}}),y??(y=[]);let A=0;for(const k of y){if(typeof k!="number")continue;const N=Rh(k);N>A&&(A=N)}return D||(I=void 0),{tickDomain:m,niceDomain:f,rawTicks:y,rawTickCount:b,rawFirstTickIndex:x,generatePrimaryTicks:D,primaryTicksIndices:I,alignment:C,fractionDigits:A,timeInterval:M}}function $1(e,t,i){const{niceDomain:n,ticks:s,timeInterval:r}=t;if(r==null)return[];const a=E1(s),{label:o,labelOffset:l,primaryLabel:c,domain:h}=e,{width:u,height:d}=V1(o,c,n??h,r,bi(o)),p=[];for(const g of[0,a]){const{x:f,y:m}=Ag(l,g,i);p.push({x:f,y:m,width:u,height:d})}return p}function U1(e,t,i,n){const s=[],r=n.left+n.right,a=n.top+n.bottom;for(const{tickLabel:o,textMetrics:l,translation:c}of e){if(!o)continue;const{x:h,y:u}=Ag(t,c,i),d=l.width+r,p=l.height+a;s.push({x:h,y:u,width:d,height:p})}return s}var Ec=class QC extends Xf{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 Yt({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Yt({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Xi({zIndex:1})),this.tickLineGroupSelection=bt.select(this.tickLineGroup,Xi,!1),this.gridLineGroupSelection=bt.select(this.gridLineGroup,Xi,!1),this.gridFillGroupSelection=bt.select(this.gridFillGroup,wt,!1),this.tempText=new _o({debugDirty:!1}),this.tempCaption=new nt,this.animationManager=t.animationManager,this.animationState=new hc("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:s=>this.animateReadyUpdate(s),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let n;this.cleanup.register(t.eventsHub.on("layout:complete",s=>{const r=[s.chart.width,s.chart.height];n!=null&&!Un(r,n)&&this.animationState.transition("resize"),n=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof QC}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 qf}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,n,s){const r=this.label.getSideFlag(),a=r*(this.getTickSize()+this.getTickSpacing()+this.label.spacing+this.seriesAreaPadding),o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o);if(i[0]===2&&i[1]===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:ve,spacing:pt}=this.measureAxisLayout(t,[],[],o,l);return{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:ve,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:pt}}}const{label:c,primaryLabel:h,scale:u,range:d,interval:p,reverse:g,defaultTickMinSpacing:f,minimumTimeGranularity:m}=this,y=NS({label:c,scale:u,interval:p,primaryLabel:h,domain:t,range:d,reverse:g,niceMode:i,visibleRange:n,defaultTickMinSpacing:f,minimumTimeGranularity:m,sideFlag:r,labelOffset:a,primaryTickCount:s,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction==="y",sizeLimit:this.chartLayout?.sizeLimit,inRange:ve=>this.inRange(ve,.001),tickFormatter:(...ve)=>this.tickFormatter(...ve)}),{tickData:b}=y;if(this.label.avoidCollisions&&this.horizontal&&b.ticks.length>2&&(Re.is(this.scale)||Vs.is(this.scale))){const ve=this.chartLayout?.padding.right??0,pt=b.ticks.at(-1);pt?.tickLabel!=null&&pt.translation+pt.textMetrics.width/2>d[1]+ve&&(pt.tickLabel=void 0,n[0]===0&&n[1]===1&&(b.ticks[0].tickLabel=void 0))}const{ticks:M,tickDomain:I,rawTicks:C,rawTickCount:D,fractionDigits:A,timeInterval:k,niceDomain:N}=b,T=M.map(ve=>this.getTickLabelProps(ve,y,l)),{position:R,gridPadding:B,gridLength:E}=this,V=R==="bottom"||R==="right"?-1:1,G=V*B,q=V*(E+B),j=this.calculateGridLines(M,G,q),Q=this.calculateGridFills(M,G,q),ue=this.calculateTickLines(M,V,l),{bbox:re,spacing:He}=this.measureAxisLayout(I,M,T,o,l);return{ticks:C,rawTickCount:D,tickDomain:I,niceDomain:N,fractionDigits:A,timeInterval:k,bbox:re,layout:{ticks:M,gridLines:j,gridFills:Q,tickLines:ue,labels:T,spacing:He}}}calculateGridLines(t,i,n){return t.map((s,r)=>this.calculateGridLine(s,r,i,n,t))}calculateGridLine({index:t,tickId:i,translation:n},s,r,a,o){const{gridLine:l,horizontal:c}=this,[h,u,d,p]=c?[n,r,n,a]:[r,n,a,n],{style:g}=l,{stroke:f,strokeWidth:m=0,lineDash:y}=g[t%g.length]??{};return{tickId:i,offset:n,x1:h,y1:u,x2:d,y2:p,stroke:f,strokeWidth:m,lineDash:y}}calculateGridFills(t,i,n){const{horizontal:s,range:r,type:a}=this,o=[];if(t.length==0)return o;let l=0;const c=!s&&a==="unit-time";if(c&&t[0].translationr[0]){const u={tickId:`before:${t[0].tickId}`,translation:r[0]};o.push(this.calculateGridFill(u,-1,t[0].index,i,n,t)),l=1}return o.push(...t.map((u,d)=>this.calculateGridFill(u,d,u.index+l,i,n,t))),o}calculateGridFill({tickId:t,translation:i},n,s,r,a,o){const{gridLine:l,horizontal:c,range:h}=this,u=o[n+1],d=i,p=u?u.translation:h[1],[g,f,m,y]=c?[d,Math.max(r,a),p,Math.min(r,a)]:[Math.min(r,a),Math.min(d,p),Math.max(r,a),Math.max(d,p)],{fill:b,fillOpacity:x}=l.style[s%l.style.length]??{};return{tickId:t,x1:g,y1:f,x2:m,y2:y,fill:b,fillOpacity:x}}calculateTickLines(t,i,n=0){return t.map(s=>this.calculateTickLine(s,s.index,i,t,n))}calculateTickLine({isPrimary:t,tickId:i,translation:n},s,r,a,o=0){const{horizontal:l,tick:c,primaryTick:h}=this,u=t&&h?h:c,d=this.getTickSize(u),p=this.getTickSpacing(u),g=-r*(o+p),f=-r*d,[m,y,b,x]=l?[n,g,n,g+f]:[g,n,g+f,n],{stroke:M,width:I}=u;return{tickId:i,offset:n,x1:m,y1:y,x2:b,y2:x,stroke:M,strokeWidth:I,lineDash:void 0}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),a=>a.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:a}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=a.map(c=>c.tickId),l=Xv(t,o);this.animationState.transition("update",l)}}const{enabled:n,stroke:s,width:r}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:n?r: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,n]=Ct(this.lineRange??this.range);return t?{x1:i,x2:n,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:n}}getTickLineBBox(t,i){const{translation:n}=t,{position:s,primaryTick:r}=this;let a=this.getTickSize();r?.enabled&&(a=Math.max(a,this.getTickSize(r)));const o=s==="bottom"||s==="right"?-1:1,l=this.getTickSpacing(this.tick),c=-o*(i+l),h=c,u=c-o*(a+l),d=Math.min(h,u),p=Math.max(h,u);switch(s){case"top":return new U(n,d,0,p-d);case"bottom":return new U(n,d,0,p-d);case"left":return new U(d,n,p-d,0);case"right":return new U(d,n,p-d,0)}}lineNodeBBox(){const{position:t,seriesAreaPadding:i}=this,{y1:n,y2:s}=this.getAxisLineCoordinates(),r=s-n;switch(t){case"top":return new U(n,-i,r,i);case"bottom":return new U(n,0,r,i);case"left":return new U(-i,n,i,r);case"right":return new U(0,n,i,r)}}titleBBox(t,i){const{tempCaption:n}=this,s=Math.abs(this.range[1]-this.range[0])||1/0;return n.node.setProperties(this.titleProps(n,t,i)),n.computeTextWrap(s,this.thickness??1/0),n.node.getBBox()}getScrollbarThickness(t){return t?.enabled&&t.placement==="inner"?t.spacing+t.thickness:0}resolveScrollbarLayout(t,i){if(!t)return;const{position:n}=this,s=n==="top"||n==="left"?-1:1;if(t.placement==="inner"){const a=s===1?t.spacing:-t.spacing-t.thickness;return{...t,offset:a}}const r=s===1?i+t.spacing:-i-t.spacing-t.thickness;return{...t,offset:r}}applyScrollbarLayout(t,i,n){const s=this.resolveScrollbarLayout(n,i);let r=i;if(s){const{offset:a,thickness:o,placement:l}=s;l==="outer"&&(r+=s.spacing+o),this.horizontal?t.push(new U(0,a,0,o)):t.push(new U(a,0,o,0))}return{spacing:r,scrollbarLayout:s}}measureAxisLayout(t,i,n,s,r){const{tick:a,primaryTick:o,label:l,primaryLabel:c,title:h,position:u,horizontal:d,seriesAreaPadding:p}=this,g=[];if(g.push(this.lineNodeBBox()),a.enabled||o?.enabled)for(const I of i)g.push(this.getTickLineBBox(I,r));const{tempText:f}=this;if(l.enabled)for(const I of n){if(!I.visible)continue;f.setProperties(I);const C=f.getBBox();C&&g.push(C)}if(c?.enabled&&u==="bottom"&&(g.push(new U(0,Lp(l.fontSize)+2,1,this.getTickSize(a)+this.getTickSpacing(a)+l.spacing+p)),c.format!=null)){const{format:C}=c,A=(be(C)?Object.values(C):[C]).reduce((k,N)=>Math.max(k,Wb(N)),0);g.push(new U(0,this.getTickSize(o??a)+this.getTickSpacing(o??a)+c.spacing+p,1,A*Lp(c.fontSize)+2))}const m=U.merge(g),y=d?m.height:m.width,{spacing:b,scrollbarLayout:x}=this.applyScrollbarLayout(g,y,s);return this.layout.labelThickness=y,this.layout.scrollbar=x,h.enabled&&g.push(this.titleBBox(t,b)),{bbox:U.merge(g),spacing:b}}titleProps(t,i,n){const{title:s}=this;if(!s.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=s.color,t.fontFamily=s.fontFamily,t.fontSize=s.fontSize,t.fontStyle=s.fontStyle,t.fontWeight=s.fontWeight,t.wrapping=s.wrapping,t.truncate=s.truncate,t.maxWidth=s.maxWidth,t.maxHeight=s.maxHeight;const{range:r}=this,a=(r[0]+r[1])/2,o=s.spacing+n;let l,c,h,u;switch(this.position){case"top":l=a,c=-o,h=0,u="bottom";break;case"bottom":l=a,c=o,h=0,u="top";break;case"left":l=-o,c=a,h=Math.PI/-2,u="bottom";break;case"right":l=o,c=a,h=Math.PI/2,u="bottom";break}const{formatter:d=g=>g.defaultValue}=s,p=this.cachedCallWithContext(d,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:u,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(t,i,n){const{horizontal:s,primaryLabel:r,primaryTick:a,seriesAreaPadding:o,scale:l}=this,{tickId:c,tickLabel:h="",translation:u,isPrimary:d,textUntruncated:p}=t,g=d&&r?.enabled?r:this.label,f=d&&a?.enabled?a:this.tick,{rotation:m,textBaseline:y,textAlign:b}=i,{range:x}=l,M=this.label.getSideFlag(),I=Qo(g)[this.position];let C=M*(this.getTickSize(f)+this.getTickSpacing(f)+g.spacing+o)-I;n&&(C+=M*n);const D=h!=="",A=s?u:C,k=s?-C:u;return{...this.getLabelStyles({value:t.tick,formattedValue:h},void 0,g),tickId:c,rotation:m,text:h,textAlign:b,textBaseline:y,textUntruncated:p,visible:D,x:A,y:k,rotationCenterX:A,rotationCenterY:k,range:x}}updateSelections(){if(!this.tickLayout)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:n,gridFills:s,labels:r}=this.tickLayout,a=o=>o.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?n:[],void 0,a),this.gridFillGroupSelection.update(this.gridLine.enabled?s:[],void 0,a),this.tickLineGroupSelection.update(i,void 0,a),this.tickLabelGroupSelection.update(r,void 0,a)}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:n}=this.title,s=this.titleProps(n,t,i);if(n.node.visible=s.visible,n.node.text=s.text,n.node.textBaseline=s.textBaseline,n.node.datum=s,s.visible){const r=Math.abs(this.range[1]-this.range[0])||1/0;n.computeTextWrap(r,this.thickness??1/0)}}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,n=g1(this),s=y1(n);xt(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],s.group),xt(this.id,"line",i,[this.lineNode],s.line),xt(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],s.tick,(r,a)=>a.tickId,t),xt(this.id,"tick-labels",i,[this.tickLabelGroupSelection],s.label,(r,a)=>a.tickId,t),xt(this.id,"title",i,[this.title.caption.node],s.label,(r,a)=>a.tickId,t)}resetSelectionNodes(){Gt([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],b1()),Gt([this.gridLineGroupSelection,this.tickLineGroupSelection],xS()),Gt([this.gridFillGroupSelection],v1()),Gt([this.tickLabelGroupSelection],ud()),Gt([this.title.caption.node],ud()),Gt([this.lineNode],xS())}};v([S],Ec.prototype,"thickness",2),v([S],Ec.prototype,"maxThicknessRatio",2),v([S],Ec.prototype,"position",2),v([S],Ec.prototype,"crossAt",2);var Rc=Ec,_s=class eA extends Rc{constructor(t,i=new qo,n=!0){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=n,this.nice=!1}static is(t){return t instanceof eA}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(!Pe(t)||!Pe(i)){const n=this.reduceBandScalePadding();t??(t=n.inner),i??(i=n.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}calculateGridLines(t,i,n){const s=super.calculateGridLines(t,i,n);return this.interval.placement==="between"&&t.length>0&&s.push(super.calculateGridLine({index:t.at(-1).index+1,tickId:`after:${t.at(-1).tickId}`,translation:this.range[1]},t.length,i,n,t)),s}calculateGridLine({index:t,tickId:i,translation:n},s,r,a,o){const{gridLine:l,horizontal:c,interval:h,scale:u}=this;if(h.placement!=="between")return super.calculateGridLine({index:t,tickId:i,translation:n},s,r,a,o);const d=nr[0]+a.step/2,h=t.at(-1),u=s&&h.translationthis.calculateGridFill(d,p,d.index,i,n,t))),u){const d={tickId:`after:${h.tickId}`,translation:h.translation+a.step};o.push(this.calculateGridFill(d,t.length,h.index+1,i,n,t))}return o}calculateGridFill({tickId:t,translation:i},n,s,r,a,o){const{gridLine:l,horizontal:c,interval:h,scale:u}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:t,translation:i},n,s,r,a,o);const d=i-u.step/2,p=i+u.step/2,[g,f,m,y]=c?[d,Math.max(r,a),p,Math.min(r,a)]:[Math.min(r,a),d,Math.max(r,a),p],{fill:b,fillOpacity:x}=l.style[s%l.style.length]??{};return{tickId:t,x1:g,y1:f,x2:m,y2:y,fill:b,fillOpacity:x}}calculateTickLines(t,i,n=0){const s=super.calculateTickLines(t,i,n);return this.interval.placement==="between"&&t.length>0&&s.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${t.at(-1)?.tickId}`,translation:this.range[1]},t.length,i,t,n)),s}calculateTickLine({isPrimary:t,tickId:i,translation:n},s,r,a,o=0){const{horizontal:l,interval:c,primaryTick:h,scale:u,tick:d}=this;if(c.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:i,translation:n},s,r,a,o);const p=t&&h?.enabled?h:d,g=-r*this.getTickSize(p),f=n{const n=i.getBandScalePadding?.();return n&&(t.inner>n.inner&&(t.inner=n.inner),t.outertypeof g!="string")&&(t=t.map(String)),{type:"category",value:t,datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}}};_s.className="CategoryAxis",_s.type="category",v([S],_s.prototype,"groupPaddingInner",2),v([S],_s.prototype,"paddingInner",2),v([S],_s.prototype,"paddingOuter",2),v([ot("layoutConstraints","align")],_s.prototype,"bandAlignment",2),v([S],_s.prototype,"skipNullBars",2),v([_t({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())}})],_s.prototype,"requiredRange",2);var Pc=_s,Da=class ab extends Re{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof ab}static getTickStep(t,i,n){const{interval:s,tickCount:r=Re.defaultTickCount,minTickCount:a,maxTickCount:o}=n;return s??Co(t,i,r,a,o)}toDomain(t){return t}ticks({interval:t,tickCount:i=Re.defaultTickCount,minTickCount:n,maxTickCount:s},r=this.domain,a){if(!r||r.length<2||i<1||!r.every(Number.isFinite))return{ticks:[],count:0,firstTickIndex:0};const[o,l]=r;if(t){const c=Math.abs(t);if(!Ao((l-o)/c,this.getPixelRange()))return Fu(o,l,c,a)}return Do(o,l,i,n,s,a)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:n=Re.defaultTickCount}=t;let[s,r]=i;if(n===1)[s,r]=nf(s,r);else if(n>1){const a=s>r?Math.ceil:Math.floor,o=s>r?Math.floor:Math.ceil,l=4;for(let c=0;cMath.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},K1=(e,t)=>Math.log(t)/Math.log(e);function em(e,t,i){const n=Math.min(...t),s=W1[e]??K1;return n>=0?s(e,i):-s(e,-i)}var Y1={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},Z1=(e,t)=>e**t;function tm(e,t,i){const n=Math.min(...t),s=Y1[e]??Z1;return n>=0?s(e,i):-s(e,-i)}var im=class tA extends Re{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=n=>em(this.base,this.domain,n),this.pow=n=>tm(this.base,this.domain,n)}static is(t){return t instanceof tA}transform(t){const[i,n]=Ct(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,n]=Ct(this.domain);return i>=0!=n>=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:n}=this,[s,r]=i,a=s>r?Math.ceil:Math.floor,o=s>r?Math.floor:Math.ceil,l=tm(n,i,a(em(n,i,s))),c=tm(n,i,o(em(n,i,r)));return[t.nice[0]?l:i[0],t.nice[1]?c:i[1]]}ticks({interval:t,tickCount:i=Re.defaultTickCount},n=this.domain,s){if(!n||n.length<2||i<1)return;const r=this.base,[a,o]=n,l=Math.min(a,o),c=Math.max(a,o);let h=this.log(l),u=this.log(c);if(t){const m=C=>C>=l&&C<=c,y=Math.min(Math.abs(t),Math.abs(u-h)),{ticks:b,count:x,firstTickIndex:M}=Fu(h,u,y,s),I=b.map(this.pow).filter(m);if(!Ao(I.length,this.getPixelRange()))return{ticks:I,count:x,firstTickIndex:M}}if(!tv(r)||u-h>=i){const m=Math.min(u-h,i),{ticks:y,count:b,firstTickIndex:x}=Do(h,u,m,void 0,void 0,s);return{ticks:y.map(this.pow),count:b,firstTickIndex:x}}const d=[],p=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const g=qr(this.range)/i;let f=1/0;for(let m=h;m<=u;m++){const y=this.convert(this.pow(m+1));for(let b=1;b=g&&D>=g;M>=l&&M<=c&&(b===1||A||d.length===0)&&(d.push(M),f=I)}}return S0(d,p,s)}},nm=class extends At{constructor(){super(...arguments),this.segmentPath=new At}drawPath(e){if(!this.segments||this.segments.length===0){super.drawPath(e);return}e.save();const t=Tl(),i=new t;tl(i,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const s of this.segments)tl(i,s.clipRect);e.clip(i),super.drawPath(e),e.restore();const{segmentPath:n}=this;n.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:s,fill:r,stroke:a,...o}of this.segments){e.save(),n.path=this.path,n.setProperties(o),n.fill=this.fill==null?"none":r,n.stroke=this.stroke==null?"none":a;const l=new t;tl(l,s),e.clip(l),n.drawPath(e),e.restore()}}};v([Wu()],nm.prototype,"segments",2);function tl(e,{x0:t,y0:i,x1:n,y1:s},r=!0){const a=Math.min(t,n),o=Math.min(i,s),l=Math.max(t,n),c=Math.max(i,s);e.moveTo(a,o),r?(e.lineTo(l,o),e.lineTo(l,c),e.lineTo(a,c)):(e.lineTo(a,c),e.lineTo(l,c),e.lineTo(l,o)),e.closePath()}var RS=class extends Yt{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(Qu(At))}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=Tl(),n=new i;tl(n,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const r of this.segments)tl(n,r.clipRect);t.clip(n);for(const r of this.children())r.visible&&r.render(e);t.restore();const{scalablePath:s}=this;for(const{clipRect:r,...a}of this.segments){t.save();const o=new i;tl(o,r),t.clip(o),s.setProperties(a);for(const l of this.children())!l.visible||!(l instanceof At)||(s.path=l.path,s.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...uT(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),s.render(e));t.restore()}}};v([Wu()],RS.prototype,"segments",2);var PS=class{constructor(e,t,i){this.root=new J1(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(n,s)=>e.distanceSquared(n,s)};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}},X1=class{constructor(e,t,i,n){this.nw=e,this.ne=t,this.sw=i,this.se=n}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)}},q1=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??U.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.lengthMath.min(a.minTimeInterval()??1/0,r),1/0);return Number.isFinite(s)?yc(s):VS(e,t,i,n)?.unit}function VS(e,t,i,n){let s=1/0,r=-1/0,a,o=0;const l=[];for(const d of e){if(!d.visible)continue;const{extent:p}=Du(d.getDomain(t));if(p.length===0)continue;const g=p[0].valueOf(),f=p.at(-1).valueOf();l.push(g,f),s=Math.min(s??1/0,g,f),r=Math.max(r??-1/0,g,f);const m=Math.abs(f-g);if(m===0)continue;const y=d.dataCount();if(o=Math.max(o,y),y<=1)continue;const b=m/(y-1);a=Math.min(a??1/0,b)}if(s=Math.min(s,i?.valueOf()??1/0,n?.valueOf()??1/0),r=Math.max(r,i?.valueOf()??-1/0,n?.valueOf()??-1/0),!Number.isFinite(s)||!Number.isFinite(r))return;a??(a=Math.abs(r-s)),a=Math.min(a,Q1(l));const c=yc(a);let h=a/vi(c);o<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const u=h===1?void 0:Ti(c,s);return{unit:c,step:h,epoch:u}}function Q1(e){e.sort((i,n)=>i-n);let t=1/0;for(let i=1;i0&&(t=Math.min(t,Math.abs(s-n)))}return t}function eN(e,t,i,n){return t=e.endIndex)return!1;if(t<=e.startIndex&&n>=e.endIndex)e.startIndex=t,e.endIndex=t;else if(t<=e.startIndex){const s=n-e.startIndex,r=e.endIndex-e.startIndex;e.startIndex=t,e.endIndex=e.startIndex+Math.max(0,r-s)}else n>=e.endIndex?e.endIndex=Math.max(e.startIndex,t):e.endIndex=Math.max(e.startIndex,e.endIndex-i);return!0}function _S(e,t){const i=Math.ceil(e/1e3);return Math.max(t,i)}function BS(e,t){return Math.max(1,Math.ceil(e/t))}function iN(e){return e.filter(t=>t.endIndex>t.startIndex)}function nN(e,t,i){if(!t.enableBanding||e0&&e.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&e.handleRemoval(i.index,i.deleteCount)}function rN(e,t){for(const i of t)e.handleInsertion(i,0)}function aN(e,t){sN(e,t.spliceOps),t.updatedIndices.size>0&&rN(e,t.updatedIndices)}var oN=1e3,lN=10,zS=class{constructor(e={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:e.minDataSizeForBanding??oN,targetBandCount:e.targetBandCount??lN,maxBandSize:e.maxBandSize??1/0,enableBanding:e.enableBanding??!0}}applyIndexMap(e){aN(this,e)}initializeBands(e){this.dataSize=Math.max(0,e),this.bands=nN(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=_S(this.dataSize,this.config.targetBandCount),n=BS(this.dataSize,i),s=Math.ceil(n*1.1);for(let r=0;r0){a.endIndex-a.startIndex>=n?this.bands.push(this.createBand(e,e+t)):(a.endIndex+=t,a.isDirty=!0);break}eN(a,e,t,o)&&(a.isDirty=!0,t>0&&es&&this.splitBand(r,n))}}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 n of this.bands)tN(n,e,i)&&(n.isDirty=!0);this.bands=iN(this.bands)}}splitBand(e,t){const i=this.bands[e],n=i.endIndex-i.startIndex,s=Math.min(t,Math.floor(n/2)),r=i.startIndex+s,a=this.createBand(i.startIndex,r),o=this.createBand(r,i.endIndex);this.bands.splice(e,1,a,o)}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)ei.startIndex&&(i.isDirty=!0)}},en=class nA{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 nA}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}}},tn=class sA{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof sA}static extendDomain(t,i=[1/0,-1/0]){for(const n of t)typeof n=="number"&&(i[0]>n&&(i[0]=n),i[1]t&&(this.domain[0]=t),this.domain[1]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 n of this.bands){if(!n.isDirty)continue;const s=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&en.is(s)&&s.setSortedUniqueMode(this.sortOrder,this.isUnique),n.subDomain=s;const{startIndex:r,endIndex:a}=n;for(let o=r;oe.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(!en.is(e.subDomain)||!e.subDomain.isSortedUniqueMode()||e.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const e=new en;e.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const t of this.bands)en.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(en.is(e))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const t=new en;for(const i of this.bands)en.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 n of i.subDomain.getDomain())t.add(n);this.fullDomainCache=Array.from(t)}}else{let e,t;for(const i of this.bands){const n=i.subDomain.getDomain();if(n.length===2){const[s,r]=n;(e===void 0||s!=null&&e!=null&&st)&&(t=r)}}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,n)=>i+(n.endIndex-n.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:e,averageBandSize:this.bands.length>0?t/this.bands.length:0,dataSize:this.dataSize}}};function GS(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 cN(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,aggregateFunction:n=>GS(n),groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function hN(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:n=>tn.extendDomain(n)}}function jS(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function uN(e,t){const i=t?.visible??!0;return{id:e,matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:s=>GS(s),groupAggregateFunction:(s,r=[0,0,-1])=>(i&&(r[0]+=s?.[0]??0,r[2]++,r[1]+=s?.[1]??0),r),finalFunction:(s=[0,0,0])=>{const r=s[0]+s[1];return r>=0?[0,r/s[2]]:[r/s[2],0]}}}function HS(e,t,i){const n={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(s,r=[])=>{const a=r[1]-r[0];return t.aggregateFunction(s).map(o=>o/a)}};return t.groupAggregateFunction&&(n.groupAggregateFunction=t.groupAggregateFunction),n}function dN(e){return()=>{let t=0;return i=>Pe(i)?(t+=e?Math.max(0,i):i,t):i}}function pN(){return()=>{let e=0;return t=>{if(!Pe(t))return t;const i=e;return e+=t,i}}}var sm="\0__AG_NULL__\0",rm="\0__AG_UNDEFINED__\0";function $S(e){return e===null?sm:e===void 0?rm:Array.isArray(e)?"["+e.map($S).join(",")+"]":oe(e)?JSON.stringify(e):String(e)}function am(e){return e.map($S).join("-")}function Ri(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function US(e,t){return t?.get(e.id)??0}function om(e){return"scopes"in e&&Array.isArray(e.scopes)}function ls(e,t){const i=[];for(let n=0;n{let i=t;for(const n of e)i=i[n];return i}}var mN=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:n}=e,s=Ai(n.keys()),r=e.keys.map(l=>l.get(s)),a=n.get(s)?.data??[],o=this.ctx.keys.some(l=>l.allowNullKey===!0);e.aggregation=a?.map((l,c)=>{const h=[];for(const[u,d]of this.ctx.aggregates.entries()){const p=this.valueGroupIdxLookup(d);let g=d.groupAggregateFunction?.()??[1/0,-1/0];const f=p.map(x=>i[x][c]),m=lm(r,c,o),y=m==null?void 0:d.aggregateFunction(f,m);y&&(g=d.groupAggregateFunction?.(y,g)??tn.extendDomain(y,g));const b=d.finalFunction?.(g)??g;h[u]=b,tn.extendDomain(b,t[u])}return h})}aggregateGroupedData(e){const t=this.ctx.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[n,s]of this.ctx.aggregates.entries()){const r=this.valueGroupIdxLookup(s);for(let a=0;ao.datumIndices[d]?.length??0));for(let d=0;d{const m=o.datumIndices[f]?.[d];if(m==null)return;const y=this.resolvers.resolveAbsoluteIndex(a,m);return i[f][y]}),g=s.aggregateFunction(p,l);g&&(c=s.groupAggregateFunction?.(g,c)??tn.extendDomain(g,c))}const u=s.finalFunction?.(c)??c;o.aggregation[n]=u,tn.extendDomain(u,t[n])}}}postProcessGroups(e){const{groupProcessors:t}=this.ctx,{columnScopes:i,columns:n,invalidData:s}=e;for(const r of t){const a=this.valueGroupIdxLookup(r),o=r.adjust()();for(let l=0;lnew en:()=>new tn,this.ctx.bandingConfig,n),t.set(e,s)),s&&n&&s.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),s||(n?new en:new tn)}extendDomainFromData(e,t,i){if(e instanceof Fc)e.extendBandsFromData(t,i);else for(let n=0;nt.includes(i))}function KS(e,t){if(e.valueType==="category"){for(const i of t)if(i.property===e.property&&i.valueType===e.valueType&&vN(i.scopes,e.scopes)&&i.validation===e.validation)return i}}var xN=class{constructor(e,t,i){this.ctx=e,this.initializer=t,this.scopeCacheManager=i,this.processValueFactory=new bN(e)}recomputeDomains(e){const t=this.ctx.debug.check()?performance.now():0,i=e[Vc];let n;const s=e[wr],r=this.setupDefinitionDomains(this.ctx.keys,i,s),a=new Map;for(const h of this.ctx.values){const u=KS(h,this.ctx.keys);u&&a.set(h,u)}const o=this.setupValueDomainsWithSharing(this.ctx.values,i,r,a),l=new Set;for(const[,h]of a){const u=r.get(h);u&&l.add(u)}this.initializeDomainBands(this.ctx.keys,r,h=>{const u=e.keys[h];return Math.max(...Array.from(u.values()).map(d=>d.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,o,h=>e.columns[h].length,h=>String(h.property));const c=new Map;if(i.size>0){n={totalBands:0,dirtyBands:0,totalData:0};for(const h of i.values())if(h instanceof Fc){const u=h.getStats();c.set(h,u),n.totalBands+=u.bandCount,n.dirtyBands+=u.dirtyBandCount,n.totalData=Math.max(n.totalData,u.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,r,(h,u)=>e.keys[h]?.get(u),h=>h.scopes??[],h=>e.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,o,(h,u)=>e.columns[h],h=>[Ai(h.scopes)],h=>e.invalidKeys?.get(h),l),e.domain.keys=this.ctx.keys.map(function(u){const d=r.get(u),p=d.getDomain();return tn.is(d)&&p[0]>p[1]?[]:p}),e.domain.values=this.ctx.values.map(function(u){const d=o.get(u),p=d.getDomain();return tn.is(d)&&p[0]>p[1]?[]:p}),e.type==="grouped"&&(e.domain.groups=e.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(e,r,o,i,c),this.ctx.debug.check()&&t>0){const u=performance.now()-t;if(n&&n.totalBands>0){const d=n.dirtyBands/n.totalBands,p=Math.round(d*n.totalData);this.ctx.debug(`recomputeDomains with banding: ${u.toFixed(2)}ms, bands: ${n.dirtyBands}/${n.totalBands} dirty, data scanned: ~${p}/${n.totalData} (${(d*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${u.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(e,t,i){const n=new Map;for(const[s,r]of e.entries()){const a=i?.get(s);n.set(r,this.initializer.setupDomainForDefinition(r,t,a))}return n}initializeDomainBands(e,t,i,n){for(const[s,r]of e.entries()){const a=t.get(r);if(!a)continue;const o=i(s);this.initializer.initializeBandedDomain(a,o,n(r))}}extendDomainsFromData(e,t,i,n,s,r){for(const[a,o]of e.entries()){const l=t.get(o);if(l&&!r?.has(l))for(const c of n(o)){if(!c)continue;const h=i(a,c);if(!h)continue;const u=s(c);this.initializer.extendDomainFromData(l,h,u)}}}setupValueDomainsWithSharing(e,t,i,n){const s=new Map;for(const r of e){const a=n.get(r);if(a){const o=i.get(a);if(o){s.set(r,o);continue}}s.set(r,this.initializer.setupDomainForDefinition(r,t))}return s}initDataDomainProcessor(e){const{keys:t,values:i}=this.ctx,n=new Set;for(const d of i)if(d.scopes)for(const p of d.scopes)n.add(p);const s=new Map,r=new Map;let a=!0;const o=()=>{for(const d of t)d.valueType==="category"?s.set(d,new en):s.set(d,new tn);for(const d of i){const p=KS(d,t);if(p){const g=s.get(p);if(g){s.set(d,g),a&&(a=(d.scopes?.length??0)===n.size);continue}}d.valueType==="category"?s.set(d,new en):(s.set(d,new tn),a&&(a=(d.scopes?.length??0)===n.size))}};o();const l=this.scopeCacheManager.buildAccessors(Kr(t,i)),c=new WeakMap;for(const d of Kr(t,i)){const p=l.get(d.property),g=s.get(d),f={value:void 0,missing:!1,valid:!1},m=this.processValueFactory.createProcessValueFn(d,p,g,f,r,e);c.set(d,m)}function h(d){const p=c.get(d);if(!p)throw new Error("AG Charts - missing processValue function for definition");return p}function u(d,p,g,f){return h(d)(p,g,f)}return{dataDomain:s,processValue:u,getProcessValue:h,initDataDomain:o,scopes:n,allScopesHaveSameDefs:a}}collectDomainBandingMetadata(e,t,i,n,s){e.optimizations??(e.optimizations={});const r=(l,c)=>l.map(h=>{const u=c.get(h),d=n.get(h),p=u instanceof Fc;let g;p||(g=h.valueType==="category"?"discrete domain":"not configured");let f;if(p&&d){const m=s.get(d)??d.getStats(),y=m.bandCount>0?m.dirtyBandCount/m.bandCount:0;f={totalBands:m.bandCount,dirtyBands:m.dirtyBandCount,dataSize:m.dataSize,scanRatio:y}}return{property:String(h.property),applied:p,reason:g,stats:f}}),a=r(this.ctx.keys,t),o=r(this.ctx.values,i);e.optimizations.domainBanding={keyDefs:a,valueDefs:o}}};function SN(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function MN(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 n=i-e.lastValue;if(n===0)e.isUnique=!1;else if(e.isOrdered){const s=n>0?1:-1;e.sortOrder===0?e.sortOrder=s:e.sortOrder!==s&&(e.isOrdered=!1)}e.lastValue=i}function IN(e){return{sortOrder:e.isOrdered&&e.sortOrder!==0?e.sortOrder:void 0,isUnique:e.isUnique,isDirty:!1}}var DN=class{constructor(e,t){this.ctx=e,this.domainManager=t}extractData(e){const{dataDomain:t,getProcessValue:i,allScopesHaveSameDefs:n}=this.domainManager.initDataDomainProcessor("extend"),{keys:s,values:r}=this.ctx,{invalidData:a,invalidKeys:o,invalidKeyCount:l,invalidDataCount:c,missingData:h,allKeyMappings:u,keySortOrders:d}=this.extractKeys(s,e,i),{columns:p,columnScopes:g,columnNeedValueOf:f,partialValidDataCount:m,maxDataLength:y}=this.extractValues(a,c,h,r,e,o,i),b=x=>{const M=t.get(x),I=M.getDomain();return tn.is(M)&&I[0]>I[1]?[]:I};return{type:"ungrouped",input:{count:y},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...u.values()],columns:p,columnScopes:g,columnNeedValueOf:f,invalidKeys:o,invalidKeyCount:l,invalidData:a,invalidDataCount:c,missingData:h,domain:{keys:s.map(b),values:r.map(b)},defs:{allScopesHaveSameDefs:n,keys:s,values:r},partialValidDataCount:m,time:0,version:0,[hm]:new Map,[wr]:d,[cm]:new Map,[Vc]:new Map,[Ca]:new Map}}extractKeys(e,t,i){const n=new Map,s=new Map,r=new Map,a=new Map,o=new Map,l=new Map,c=new Map;let h,u;const d=e.map(g=>i(g)),p=(g,f)=>{const m=u.get(g);h.set(f,h.get(m)),n.has(m)&&(n.set(f,n.get(m)),s.set(f,s.get(m)),a.set(f,a.get(m)))};for(const[g,f]of e.entries()){const{invalidValue:m,scopes:y}=f,b=d[g];h=new Map,u=new Map,l.set(f,h);const x=SN();for(const M of y??[]){const I=t.get(M)?.data??[];if(u.has(I)){p(I,M);continue}const C=[];h.set(M,C),u.set(I,M);let D,A,k=0,N;for(let T=0;Ta(p));for(const[p,g]of n.entries()){const{invalidValue:f}=g,m=d[p];if(new Set(g.scopes.map(A=>s.get(A))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(g)}`);const b=new Set(g.scopes),x=Ai(g.scopes),M=s.get(x)?.data??[],I=new Array,C=r.get(x);let D=!1;for(let A=0;A0?1-m/g:0;e.optimizations.batchMerging={originalBatchCount:g,mergedBatchCount:m,mergeRatio:x}}const y=f.length===1,b=Object.freeze(ls(f[0][1].length,WS));for(const[x,M,I,C,D,A]of f){const k=s[Ai(M)];for(let N=0;Nj[N]);if(T==null||T.length===0)throw new Error("AG Charts - no keys found for scope(s): "+x.join(", "));const R=t?.(T)??T,B=u==null?void 0:am(R);let E=u?.get(B),V,G,q=!1;if(E==null?(V={keys:R,datumIndices:[],aggregation:[],validScopes:l},G=p++,E=[G,V],q=!0,u?.set(B,E),c.push(V.keys),h.push(V)):([G,V]=E,d=!1),D?.[N]===!0){V.validScopes===l&&(V.validScopes=new Set(l.values()));for(const j of C)V.validScopes.delete(j)}if(q&&N===G&&y)V.datumIndices=b;else{!q&&V.datumIndices===b&&(V.datumIndices=b.map(j=>[...j]));for(const j of M)(i=V.datumIndices)[j]??(i[j]=[]),V.datumIndices[j].push(N-G)}}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:h,groupsUnique:d,optimizations:e.optimizations,[Vc]:e[Vc],[Ca]:e[Ca]}}groupBatches(e,t,i,n,s,r){const a=[],o=new Set;for(const l of e){const c=t.map((g,f)=>f).filter(g=>!o.has(g)&&i[g].has(l));if(c.length===0)continue;for(const g of c)o.add(g);const h=new Set;for(const g of c)for(const f of i[g])h.add(f);const u=n.map(g=>g.get(l)).filter(g=>g!=null),d=s?.get(l),p=r?.get(l);a.push([l,c,u,h,d,p])}return this.mergeCompatibleBatches(a)}areBatchesCompatible(e,t){const[,,i,,n,s]=e,[,,r,,a,o]=t;return i.every((l,c)=>l===r[c])&&s===o&&n===a}mergeCompatibleBatches(e){const t=[],i=new Set;for(let n=0;n0}function AN(e){return e.removedIndices.size===0&&e.totalAppendCount===0&&e.totalPrependCount>0}function wN(e){return e.removedIndices.size===0}function kN(e){return e.removedIndices.size===0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0&&t.deleteCount===0)}function LN(e){return e.removedIndices.size>0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0)}function TN(e){return dm(e.removedIndices)>0}function dm(e){if(e.size===0)return 0;const t=Array.from(e).sort((i,n)=>i-n);if(t[0]!==0)return 0;for(let i=0;i0&&e.totalPrependCount===0}var ON=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:n}=this.indexMap;let s=0;const r=Array.from(i).sort((o,l)=>o-l);let a=0;for(let o=0;o0?Array.from({length:a.insertCount},function(h,u){return t(a.index+u)}):[],l=e.splice(a.index,a.deleteCount,...o);i&&l.length>0&&i(l,a)}e.length!==s&&(e.length=s)}}},EN=class extends zS{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 n=e.reducer();for(const s of this.bands){if(i&&!s.isDirty)continue;const r=e.needsOverlap&&s.startIndex>0?Math.max(0,s.startIndex-1):s.startIndex,a=this.evaluateRange(e,n,t,r,s.endIndex);s.cachedResult=a,s.isDirty=!1}}getResult(e){const t=this.bands.map(i=>i.cachedResult);return e.combineResults(t)}evaluateRange(e,t,i,n,s){let r=e.initialValue;const{keyColumns:a,keysParam:o,rawData:l}=i,c=Math.min(s,l.length);for(let h=n;hi.isDirty),t=e.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);this.lastDirtyBandCount=e.length,this.lastScanRatio=this.dataSize>0?t/this.dataSize:0,this.statsCaptured=!0}getStats(){const e=this.bands.filter(n=>!n.isDirty&&n.cachedResult!==void 0);let t,i;if(this.statsCaptured)t=this.lastDirtyBandCount,i=this.lastScanRatio;else{const n=this.bands.filter(r=>r.isDirty),s=n.reduce((r,a)=>r+(a.endIndex-a.startIndex),0);t=n.length,i=this.dataSize>0?s/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:t,dataSize:this.dataSize,scanRatio:i,cacheHits:e.length}}},ZS=class{constructor(e={}){this.bandingConfig=e}static evaluateRange(e,t,i,n,s){let r=e.initialValue;const{keyColumns:a,keysParam:o,rawData:l}=i,c=Math.min(s,l.length);for(let h=n;ha.get(i)).filter(a=>a!=null),r=s.map(()=>{});return{scopeId:i,rawData:n,keyColumns:s,keysParam:r}}},RN=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 s=Ai(e.scopes);if(e.invalidKeys?.get(s)?.some(a=>a))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(n=>n.supportsBanding!==!0||typeof n.combineResults!="function")||this.ctx.processors.some(n=>n.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(n=>n.supportsReprocessing??!1)}reprocessData(e,t,i,n,s,r){const a=performance.now(),o=this.collectScopeChanges(e,t);if(o.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,o,l,c);this.processAllUpdates(e,o,l,c,h),this.updateBandsForChanges(e,o);const u=this.transformKeysArrays(e,o,h);this.transformColumnsArrays(e,o,h),this.transformInvalidityArrays(e,o,h),this.reprocessBandedReducers(e,o),e.type==="grouped"&&(this.transformGroupsArray(e,o,h),this.ctx.groupProcessors.length>0&&n(e,o)),this.invalidateSortOrdersForChanges(e,o),s(e),this.reprocessProcessors(e),e.reduced?.diff!=null&&o.size>0&&this.generateDiffMetadata(e,o,u),this.updateProcessedDataMetadata(e);const d=performance.now();e.time=d-a,e.version+=1,r(e,"reprocess");const p=pd(o);return e.changeDescription=p.size===1?p.values().next().value:void 0,e}updateBandsForChanges(e,t){const i=e[Vc];if(i.size===0)return;const n=pd(t);for(const s of n){const{indexMap:r}=s;for(const a of i.values())a.applyIndexMap(r)}}reprocessBandedReducers(e,t){if(e.type!=="ungrouped")return;const i=this.ctx.reducers.filter(n=>n.supportsBanding&&typeof n.combineResults=="function");if(i.length!==0){e.reduced??(e.reduced={});for(const n of i){const s=this.reducerManager.evaluate(n,e,{reuseCleanBands:!0,beforeEvaluate:(r,a)=>{if(!a.scopeId)return;const o=t.get(a.scopeId);o&&r.applyIndexMap(o.indexMap)}});s!==void 0&&(e.reduced[n.property]=s)}}}collectScopeChanges(e,t){const i=new Map;for(const[n,s]of e.dataSources){const r=t?.get(s)??s.getChangeDescription();r&&i.set(n,r)}return i}commitPendingTransactions(e){const t=this.getUniqueDataSets(e);for(const i of t)i.commitPendingTransactions()}buildDefinitionProcessors(e,t){return e.map((i,n)=>({def:i,index:n,processValue:t(i)}))}processAllInsertions(e,t,i,n){const s=new Map;for(const[r,a]of t){const o=e.dataSources.get(r);if(!o)continue;const l=this.processInsertionsOnce(r,a,o,i,n);s.set(r,l)}return s}processAllUpdates(e,t,i,n,s){for(const[r,a]of t){const o=e.dataSources.get(r);if(!o)continue;const l=a.getUpdatedIndices();if(l.length===0)continue;let c=s.get(r);c||(c=new Map,s.set(r,c));for(const h of l){if(h<0||h>=o.data.length)continue;const u=this.processDatum(o,h,r,i,n);u&&c.set(h,u)}}}processInsertionsOnce(e,t,i,n,s){const r=new Map,{finalLength:a}=t.indexMap;for(const o of t.indexMap.spliceOps)if(!(o.insertCount<=0))for(let l=0;l=a)continue;const h=this.processDatum(i,c,e,n,s);h&&r.set(c,h)}return r}processDatum(e,t,i,n,s){const r=e.data[t],a=new Map,o=new Map;let l=!1,c=!1,h=!1;if(r==null||typeof r!="object")l=!0,c=!0;else{for(const{index:u,def:d,processValue:p}of n){if(!d.scopes?.includes(i))continue;const g=p(r,t,i);a.set(u,{value:g.value,valid:g.valid}),g.valid||(l=!0)}for(const{index:u,def:d,processValue:p}of s){if(!d.scopes?.includes(i))continue;const g=p(r,t,d.scopes);o.set(u,{value:g.value,valid:g.valid}),g.valid||(c=!0),g.missing&&(h=!0)}}return{keys:a,values:o,hasInvalidKey:l,hasInvalidValue:c,hasMissingValue:h}}transformArraysWithCache(e,t,i,n,s,r){for(const[a,o]of e.entries())for(const l of s(o)){const c=t.get(l);if(!c)continue;const h=n(a,l);if(!h)continue;const u=i.get(l);this.applyChangeDescWithCache(c,h,u,(d,p)=>r(d,o,a))}}transformKeysArrays(e,t,i){const n=new Map,s=o=>{let l=n.get(o);return l||(l={tuples:[]},n.set(o,l)),l},r=new WeakSet;for(const[o,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=t.get(c);if(!h)continue;const u=e.keys[o]?.get(c);if(!u)continue;if(r.has(u)){const f=Array.from(e.keys[o].entries()).find(([m,y])=>y===u)?.[0];f&&f!==c&&n.has(f)&&n.set(c,n.get(f));continue}r.add(u);const d=i.get(c),p=s(c);let g=0;this.applyChangeDescWithCache(h,u,d,f=>{const m=f?.keys.get(o);return m?.valid?m.value:l.invalidValue},f=>{for(const m of f)p.tuples[g]||(p.tuples[g]=new Array(this.ctx.keys.length)),p.tuples[g][o]=m,g+=1})}const a=new Map;for(const[o,{tuples:l}]of n){if(l.length===0)continue;const c=new Set;for(const h of l){const u=[];for(const[d,p]of h.entries())this.ctx.keys[d].scopes?.includes(o)&&u.push(p);u.length>0&&c.add(am(u))}a.set(o,c)}return a}transformColumnsArrays(e,t,i){this.transformArraysWithCache(this.ctx.values,t,i,n=>e.columns[n],n=>[Ai(n.scopes)],(n,s,r)=>{if(n){if(n.hasInvalidKey)return s.invalidValue;const a=n.values.get(r);return a?.valid?a.value:s.invalidValue}return s.invalidValue})}transformInvalidityMap(e,t,i,n){const s=new Set;for(const[r,a]of t){let o=e.get(r);if(!o){const c=i.get(r);if(c&&Array.from(c.values()).some(n))o=ls(a.indexMap.originalLength,!1),e.set(r,o);else continue}if(s.has(o))continue;s.add(o);const l=i.get(r);this.applyChangeDescWithCache(a,o,l,(c,h)=>n(c))}}transformInvalidityArrays(e,t,i){e.invalidKeys&&this.transformInvalidityMap(e.invalidKeys,t,i,n=>n?.hasInvalidKey??!1),e.invalidData&&this.transformInvalidityMap(e.invalidData,t,i,n=>n?n.hasInvalidKey||n.hasInvalidValue:!1),e.missingData&&this.transformInvalidityMap(e.missingData,t,i,n=>n?.hasMissingValue??!1)}applyChangeDescWithCache(e,t,i,n,s){e.applyToArray(t,a=>{const o=i?.get(a);return n(o,a)},s);const r=e.getUpdatedIndices();if(r.length!==0)for(const a of r){if(a<0||a>=t.length)continue;const o=i?.get(a);t[a]=n(o,a)}}transformGroupsArray(e,t,i){const n=Ai(e.scopes),s=t.get(n);if(!s)return;const r=i.get(n);for(const[,o]of r??[])if(o.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");s.applyToArray(e.groups,o=>this.createDataGroupForInsertion(o,e,n,r));const a=s.getUpdatedIndices();if(a.length>0)for(const o of a)o<0||o>=e.groups.length||(e.groups[o]=this.createDataGroupForInsertion(o,e,n,r))}createDataGroupForInsertion(e,t,i,n){const s=[];for(const u of t.keys){const d=u.get(i);d&&s.push(d[e])}const r=t.groups[0],a=()=>Object.freeze(ls(t.columnScopes.length,WS)),o=r?.datumIndices??a(),c=n?.get(e)?.hasInvalidValue??!1;let h;return c?(h=new Set(t.scopes),h.delete(i)):h=t.scopes,{keys:s,datumIndices:o,aggregation:[],validScopes:h}}generateDiffMetadata(e,t,i){const n=(s,r)=>{const a=[];for(const o of e.keys){const l=o.get(s);if(!l)return;a.push(l[r])}return a.length>0?am(a):void 0};for(const[s,r]of t){const a={changed:!0,added:new Set,removed:i.get(s)??new Set,updated:new Set,moved:new Set};for(const c of r.indexMap.spliceOps)if(c.insertCount>0)for(let h=0;h0)for(let c=l;c0)for(let c=0;c{if(c!==h){const u=n(s,h);u&&a.moved.add(u)}});e.reduced.diff[s]=a}}updateProcessedDataMetadata(e){let t=0;for(const n of e.dataSources.values())t=Math.max(t,n.data.length);e.input.count=t;let i=0;for(const[n,s]of e.invalidData??new Map){const r=e.invalidKeys?.get(n);for(let a=0;a{if(typeof a=="number")return a;if(a instanceof Date)return a.valueOf()};let s=n(t);const r=e.sortOrder;for(const a of i){const o=n(a);if(o===void 0)continue;if(s===void 0){s=o;continue}const l=o-s;if(l===0&&(e.isUnique=!1),e.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==r&&(e.sortOrder=void 0)}s=o}}updateKeySortOrdersForAppend(e,t){for(const[i,n]of e.keys.entries()){const s=e[wr].get(i);if(!s)continue;const r=Ai(n.values());if(!r||r.length<=t)continue;const a=t>0?r[t-1]:void 0,o=r.slice(t);this.updateSortOrderForAppend(s,a,o)}}invalidateSortOrdersForChanges(e,t){const i=pd(t);let n=!0,s=!1,r=!1,a,o;for(const l of i){const{indexMap:c}=l;kN(c)||(YS(c)?(s=!0,a=c.originalLength):LN(c)||(NN(c)?(r=!0,o={originalLength:c.originalLength,removedCount:c.removedIndices.size}):n=!1))}n?s&&a!==void 0?this.updateKeySortOrdersForAppend(e,a):r&&o&&this.updateKeySortOrdersForRollingWindow(e,o):(e[wr].clear(),e[cm].clear())}updateKeySortOrdersForRollingWindow(e,t){const{originalLength:i,removedCount:n}=t;for(const[s,r]of e.keys.entries()){const a=e[wr].get(s);if(!a)continue;const o=Ai(r.values());if(!o||o.length===0)continue;const l=i-n,c=l>0?o[l-1]:void 0,h=o.slice(l);this.updateSortOrderForAppend(a,c,h)}}invalidateCachesForChanges(e){this.markDomainRangesDirty(e[hm])}markDomainRangesDirty(e){for(const t of e.values())t.isDirty=!0}recountInvalid(e,t){if(!(!e||!t))for(const[i,n]of e){const s=n.filter(Boolean).length;s===0?(e.delete(i),t.delete(i)):t.set(i,s)}}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],n=t.incrementalCalculate?.(e,i)??t.calculate(e,i);e.reduced[t.property]=n}}}getUniqueDataSets(e){return new Set(e.dataSources.values())}},Aa=0,wa=1,cs=2,PN=class bh{constructor(t){this.isDirty=!1;const i=t.reduce((r,a)=>Math.max(r,a.length),0),{maxLevelSize:n,buffer:s}=bh.createBuffer(i);this.maxLevelSize=n,this.buffer=s,this.dataLength=i,this.populateBuffer(t)}static computeMaxLevelSize(t){let n=1<<32-Math.clz32(t);return t===n/2&&(n=n>>>1),n}static createBuffer(t){const i=bh.computeMaxLevelSize(t),n=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:n}}populateBuffer(t){const{maxLevelSize:i,buffer:n}=this,s=i-1;for(const r of t){const a=r.length;for(let o=0;ou)&&(n[c+1]=l)}}for(let r=i>>>1;r>=1;r>>>=1){const a=r-1,o=a+r<<1;let l=a<<1,c=o;for(let h=0;hf?g:f,l+=2,c+=4}}}rebuild(t){const i=t.reduce((s,r)=>Math.max(s,r.length),0);if(bh.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:s,buffer:r}=bh.createBuffer(i);this.maxLevelSize=s,this.buffer=r}this.dataLength=i,this.populateBuffer(t)}updateValue(t,i){const{maxLevelSize:n,buffer:s}=this,r=n+t-1,a=Math.trunc(r*cs)+Aa,o=Math.trunc(r*cs)+wa;s[a]=Number.NaN,s[o]=Number.NaN;for(const l of i){const c=Number(l),h=s[a],u=s[o];(!Number.isFinite(h)||cu)&&(s[o]=c)}this.propagateUp(r)}updateValues(t){for(const{index:i,values:n}of t)this.updateValue(i,n)}propagateUp(t){const{buffer:i}=this;for(;t>0;){const n=Math.trunc((t-1)/2),s=2*n+1,r=2*n+2,a=i[Math.trunc(s*cs)+Aa],o=i[Math.trunc(s*cs)+wa],l=i[Math.trunc(r*cs)+Aa],c=i[Math.trunc(r*cs)+wa];i[Math.trunc(n*cs)+Aa]=!Number.isFinite(l)||ac?o:c,t=n}}computeRangeInto(t,i,n,s,r,a,o){const l=r+a-1;if(l=n)return o;if(r>=i&&l1&&(s=Math.trunc(s*2),a=Math.trunc(a/2),this.computeRangeInto(t,i,n,Math.trunc(s+1),r,a,o),this.computeRangeInto(t,i,n,Math.trunc(s+2),r+a,a,o));return o}rangeBetween(t,i,n){const s=n??[0,0];if(t>i)return s[0]=Number.NaN,s[1]=Number.NaN,s;const{maxLevelSize:r,buffer:a}=this;return s[0]=1/0,s[1]=-1/0,this.computeRangeInto(a,t,i,0,0,r,s),s}getRange(t){const{buffer:i}=this,n=t??[0,0];return n[0]=i[Aa],n[1]=i[wa],n}get range(){const{buffer:t}=this;return[t[Aa],t[wa]]}get length(){return this.dataLength}};function FN(e,t){const i=e.length;if(e.length<=1)return 1;let n=0,s=e[0];for(let r=1;rthis.resolveProcessedDataIndexById(e,u)),a=s.input.count;if(i<=0&&n>=a){const u=s.domain.values;let d=1/0,p=-1/0;for(const g of r){const f=u[g];f!=null&&(f[0]p&&(p=f[1]))}return this.rangeBetweenBuffer[0]=d,this.rangeBetweenBuffer[1]=p,this.rangeBetweenBuffer}const o=r.join(":"),l=s[hm],c=r.map(u=>s.columns[u]);let h=l.get(o);return h==null?(h=new PN(c),l.set(o,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,n,this.rangeBetweenBuffer)}getSortOrder(e,t,i,n){const s=i.get(t);if(s==null||s.isDirty){const r={sortOrder:FN(e,n)};return i.set(t,r),r.sortOrder}return s.sortOrder}getKeySortOrder(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.keys[n]?.get(e.id);return s?this.getSortOrder(s,n,i[wr],!0):void 0}getKeySortEntry(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i[wr].get(n);return s?.isDirty?void 0:s}getColumnSortOrder(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.columnNeedValueOf?.[n]??!0;return this.getSortOrder(i.columns[n],n,i[cm],s)}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}}},_N=class{constructor(e){this.ctx=e}processScopeCache(){this.ctx.scopeCache.clear();for(const e of Kr(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const n of i)if(!this.ctx.scopeCache.has(t))this.ctx.scopeCache.set(t,new Map([[n,e]]));else{if(this.ctx.scopeCache.get(t)?.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(t).set(n,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,n]of this.ctx.values.entries())(!e||n.groupId&&e.includes(n.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,n=typeof t=="string"?t:t.id,s=a=>{if(a.idsMap){for(const[o,l]of a.idsMap)if(e?.includes(o)&&l.has(n))return!0}return!1},r=this.ctx.values.reduce((a,o,l)=>((o.scopes==null||i&&!o.scopes.length||o.scopes.some(h=>e?.includes(h)))&&(o.property===n||o.id===n||s(o))&&a.push(l),a),[]);if(r.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return r}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 s=gN(i.property);if(s==null){z.warnOnce("Invalid property path [%s]",i.property);continue}const r=fN(s);t.set(i.property,r)}return t}},pm=class{constructor(e,t="standalone",i=!1,n){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=he.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let s=!0;for(const c of e.props){if(c.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&s&&(s=!1)}const r=({matchGroupIds:c=[]})=>{for(const h of c)if(this.values.every(u=>u.groupId!==h))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${h}).`)},a=new Set,o=new Set;for(const c of e.props){const h=c.type==="key"?a:o;if(om(c)&&c.scopes)for(const u of c.scopes)h.add(u);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":r(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":r(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(o.values());for(const h of a)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 VN(l),this.scopeCacheManager=new _N(l),this.domainInitializer=new yN(l),this.domainManager=new xN(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new ZS(this.opts.domainBandingConfig),this.dataExtractor=new DN(l,this.domainManager),this.dataGrouper=new CN(l),this.aggregator=new mN(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new RN(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,n){const s=t.columnScopes.findIndex(r=>r.has(e.id));for(const r of i.datumIndices[s]??[]){const a=this.resolvers.resolveAbsoluteIndex(n,r);yield t.columns[s][a]}}getUniqueDataSets(e){return new Set(e.dataSources.values())}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(r=>r.has(e.id)),n={groupIndex:0,columnIndex:i},s=[];for(const r of t.groups){n.group=r;for(const a of r.datumIndices[i]??s)n.datumIndex=this.resolvers.resolveAbsoluteIndex(n.groupIndex,a),yield n;n.groupIndex++}}getDomain(e,t,i,n){const s=this.resolvers.getDomain(e,t,i,n);if(i==="key"&&s.length>0){const r=this.getKeySortMetadata(e,t,n);return{domain:s,sortMetadata:r}}return{domain:s}}getDomainBetweenRange(e,t,[i,n],s){return this.resolvers.getDomainBetweenRange(e,t,[i,n],s)}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 n=this.resolvers.getKeySortEntry(e,t,i);if(n?.sortOrder!=null)return{sortOrder:n.sortOrder,isUnique:n.isUnique}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:n,groupProcessors:s,reducers:r,processors:a,propertyProcessors:o}=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))),s.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),n.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):n.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),o.length>0&&this.postProcessProperties(c),r.length>0&&this.reduceData(c),a.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()&&BN(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 r=this.getUniqueDataSets(e);for(const a of r)a.commitPendingTransactions();return this.processData(e.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip"),n=this.incrementalProcessor.reprocessData(e,t,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this)),{diff:s}=n.reduced??{};return s&&this.eventsHub?.emit("datamodel:diff",{diff:s}),n}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:n}=e;for(const r of i)if(!r.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 s=pd(t);for(const r of i){const a=this.valueGroupIdxLookup(r),o=r.adjust()();for(const l of s){const{indexMap:c}=l;for(const h of c.spliceOps)if(h.insertCount>0)for(let u=0;uo.get(n)).filter(o=>o!=null),a=r.map(()=>{});return ZS.evaluateRange(e,i,{rawData:s,keyColumns:r,keysParam:a},0,s.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,n=e[Ca];this.reducers.length>0&&n&&this.collectReducerBandingMetadata(e,n);const s=e.optimizations?.reducerBanding;e.optimizations={performance:{processingTime:e.time,pathTaken:t},...i&&{domainBanding:i},...s&&{reducerBanding:s}};const r=this.isReprocessingSupported(e),a=t==="reprocess";let o;if(!r){const l=[];if(e.type==="grouped"){e.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(e).size!==1&&l.push("multiple data sources");const h=Ai(e.scopes);e.invalidKeys?.get(h)?.some(d=>d)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),o=l.length>0?l.join(", "):void 0}if(e.optimizations.reprocessing={applied:a,reason:o},e.type==="grouped"){let l=0;const c=e.groups[0];if(c){const h=c.datumIndices;for(const u of e.groups)u.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 n of this.reducers){const s=t.get(n.property),r=this.shouldUseReducerBanding(n,e)&&s!=null;let a;r||(n.supportsBanding!==!0?a="reducer does not support banding":e.type!=="ungrouped"?a="grouped data not supported":n.combineResults===void 0?a="missing combineResults function":a="banding not applied");let o;r&&s&&(o=s.getStats()),i.push({property:String(n.property),applied:r,reason:a,stats:o})}e.optimizations.reducerBanding={reducers:i}}buildAccessors(e){return this.scopeCacheManager.buildAccessors(e)}};function BN(e){const t=(i,n)=>{n.length>0&&(z.log(`DataModel.processData() - ${i}`),z.table(n))};if(z.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){z.log("DataModel.processData() - Optimization Summary");const i=e.optimizations;if(i.performance&&z.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const n=i.reprocessing.applied?"\u2713":"\u2717",s=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";z.log(` Reprocessing: ${n}${s}`)}if(i.domainBanding){const n=i.domainBanding.keyDefs.filter(o=>o.applied),s=i.domainBanding.valueDefs.filter(o=>o.applied),r=n.length+s.length,a=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(r>0){z.log(` Domain Banding: \u2713 (${r}/${a} definitions)`);for(const o of[...n,...s])if(o.stats){const l=(o.stats.scanRatio*100).toFixed(1);z.log(` ${o.property}: scanned ${o.stats.dirtyBands}/${o.stats.totalBands} bands (${l}%)`)}}else{const o=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(o)].join(", ");z.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const n=i.sharedDatumIndices.applied?"\u2713":"\u2717",s=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;z.log(` Shared DatumIndices: ${n} (${s} groups)`)}if(i.batchMerging){const n=(i.batchMerging.mergeRatio*100).toFixed(0),s=`${i.batchMerging.originalBatchCount} \u2192 ${i.batchMerging.mergedBatchCount}`;z.log(` Batch Merging: ${s} (${n}% reduction)`)}}}var XS=1e3;function qS(e,t,i){const n=e.filter(s=>typeof s=="number"&&Number.isFinite(s));return n.length>0?i(n):t}function gn(e){return e.input.count<=XS}function JS(e){return e!=null&&_u(e)}function zN(e){return e!=null}function GN(e){return!0}function QS(e,t){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return JS;default:return t?GN:zN}}function eM(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function kr(e,t,i={}){const n=i.allowNullKey??!1;return{property:e,type:"key",valueType:eM(t),validation:i.validation??QS(t,n),...i}}function Qe(e,t,i={}){const n=i.allowNullKey??!1;return{property:e,type:"value",valueType:eM(t),validation:i.validation??QS(t,n),...i}}function jN(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...t}}var HN=function(e){return e};function tM(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>HN:t.length===1?t[0]:function(){const n=t.map(s=>s());return function(r,a){return n.reduce((o,l)=>l(o,a),r)}}}function $N(e,t={}){const{min:i=-1/0,max:n=1/0,processor:s,...r}=t;return{type:"value",property:e,valueType:"range",validation:JS,processor:tM(s,function(){return function(l){return Pe(l)?te(i,l,n):l}}),...r}}function gm(e,t,i={}){const{onlyPositive:n,processor:s,...r}=i;return{...Qe(e,t,r),processor:tM(s,dN(n))}}function UN(e,t,i={}){return{...Qe(e,t,i),processor:pN()}}function ka(e,t,i,n){return[Qe(e,n,i),iO(i.groupId,t,i.separateNegative),...i.rangeId==null?[]:[hN(i.rangeId,i.groupId)]]}var iM={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let e=Number.NaN;return function(i,n){const s=n[0],r=typeof s=="number"?s:Number(s);if(!Number.isFinite(r))return i;const a=e;if(e=r,!Number.isFinite(e))return i;const o=Math.abs(r-a),l=i??1/0;return o>0&&oMath.min(...t))},needsOverlap:!0},nM={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let e=Number.NaN;return function(i,n){const s=n[0],r=typeof s=="number"?s:Number(s);if(!Number.isFinite(r))return i;const a=e;if(e=r,!Number.isFinite(e))return i;const o=Math.abs(r-a),l=i??-1/0;return o>0&&o>l?o:l}},supportsBanding:!0,combineResults(e){return qS(e,-1/0,t=>Math.max(...t))},needsOverlap:!0},WN={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:t}}){return t?.slice().sort((i,n)=>{for(let s=0;s{if(n===0)return 0;const s=(i??0)*e/n;return s>=0?Math.min(e,s):Math.max(-e,s)};return()=>()=>(i,n,s,r)=>{const a=YN(i,n,s,r);for(const o of n){const l=s.datumIndices[o];if(l!=null)for(const c of l){const h=r+c,u=i[o],d=u[h];if(d==null){u[h]=void 0;continue}u[h]=t(d,a)}}}}function YN(e,t,i,n){const s=[0,0];for(const r of t){const a=e[r],o=i.datumIndices[r];if(o!=null)for(const l of o){const c=n+l,h=a[c];if(h==null)continue;const u=typeof h=="number"?h:Math.max(...h.map(p=>p??0)),d=u<0?0:1;d===0?s[d]=Math.min(s[d],u):s[d]=Math.max(s[d],u)}}return Math.max(Math.abs(s[0]),s[1])}function md(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:yo({normaliseTo:t},KN)}}function ZN({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:n}){const s=e[1]-e[0],r=function(o,l,c){const h=e[0]+(o-l)/c*s;return c===0?t:h>=e[1]?e[1]:hh.scopes.includes(e)&&h.id===t),o=s.defs.values.findIndex(h=>h.scopes.includes(e)&&h.id===i),l=s.columns[a],c=s.columns[o];if(l.length!==c.length)return!0;for(let h=0;hMath.abs(l[h]))return!0;return!1}}function qN(e,t,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:yo([e,t,i],XN)}}var zc=1,yd=2;function JN(e,t,i){let n=zc|yd;if(e.valueType==="category")return t.lengtha)&&(n&=~yd),Number.isFinite(a)&&s===a&&(n&=~zc),s=a}return n}function QN(e){return function(i,n){if(!gn(i))return;const{keys:s,values:r}=i.defs,{input:a,domain:{values:o},columns:l}=i;let c=!0,h=!0;if(a.count!==0){const u=i[wr];for(let d=0;(c||h)&&d0){let d=zc|yd;for(let p=0;d!==0&&pb.get(e)),h=n.keys.map(b=>b.get(e)),u=t.columns,d=n.columns,p=nO(e,t,n);if(p==null)return s;const g=Math.max(t.input.count,n.input.count),f=n.defs.keys.some(b=>b.allowNullKey===!0);for(let b=0;b0||o.size>0||l.size>0,added:new Set(a.keys()),updated:new Set(o.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...s,[e]:y}}}}function Zt(...e){if(e.length===1){const t=Bu(e[0]);if(t===null)return sm;if(t===void 0)return rm;if(typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t}return e.map(t=>{const i=Bu(t);return i===null?sm:i===void 0?rm:i}).join("___")}var rM=(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))(rM||{}),ym=[0,1,2,3,4];function sO(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 nl(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 Lr=class extends ce{};v([S],Lr.prototype,"fill",2),v([S],Lr.prototype,"fillOpacity",2),v([S],Lr.prototype,"stroke",2),v([S],Lr.prototype,"strokeWidth",2),v([S],Lr.prototype,"strokeOpacity",2),v([S],Lr.prototype,"lineDash",2),v([S],Lr.prototype,"lineDashOffset",2);var Bs=class extends ce{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(e){const t=sO(e);return t.length===0?{}:xe(...t.map(i=>this[i]))}};v([S],Bs.prototype,"enabled",2),v([S],Bs.prototype,"range",2),v([S],Bs.prototype,"bringToFront",2),v([S],Bs.prototype,"highlightedItem",2),v([S],Bs.prototype,"unhighlightedItem",2),v([S],Bs.prototype,"highlightedSeries",2),v([S],Bs.prototype,"unhighlightedSeries",2);var hs=class extends ce{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};v([S],hs.prototype,"start",2),v([S],hs.prototype,"stop",2),v([S],hs.prototype,"fill",2),v([S],hs.prototype,"fillOpacity",2),v([S],hs.prototype,"stroke",2),v([S],hs.prototype,"strokeWidth",2),v([S],hs.prototype,"strokeOpacity",2),v([S],hs.prototype,"lineDash",2),v([S],hs.prototype,"lineDashOffset",2);var vd=class{constructor(){this.key="x",this.segments=new oo(hs)}};v([S],vd.prototype,"enabled",2),v([S],vd.prototype,"key",2),v([S],vd.prototype,"segments",2);var Tr=class extends ce{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};v([S],Tr.prototype,"type",2),v([S],Tr.prototype,"colorStops",2),v([S],Tr.prototype,"bounds",2),v([S],Tr.prototype,"gradient",2),v([S],Tr.prototype,"rotation",2),v([S],Tr.prototype,"reverse",2),v([S],Tr.prototype,"colorSpace",2);var Lt=class extends ce{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}};v([S],Lt.prototype,"type",2),v([S],Lt.prototype,"colorStops",2),v([S],Lt.prototype,"bounds",2),v([S],Lt.prototype,"gradient",2),v([S],Lt.prototype,"rotation",2),v([S],Lt.prototype,"scale",2),v([S],Lt.prototype,"reverse",2),v([S],Lt.prototype,"path",2),v([S],Lt.prototype,"pattern",2),v([S],Lt.prototype,"width",2),v([S],Lt.prototype,"height",2),v([S],Lt.prototype,"padding",2),v([S],Lt.prototype,"fill",2),v([S],Lt.prototype,"fillOpacity",2),v([S],Lt.prototype,"backgroundFill",2),v([S],Lt.prototype,"backgroundFillOpacity",2),v([S],Lt.prototype,"stroke",2),v([S],Lt.prototype,"strokeOpacity",2),v([S],Lt.prototype,"strokeWidth",2);var zs=class extends ce{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"}};v([S],zs.prototype,"type",2),v([S],zs.prototype,"url",2),v([S],zs.prototype,"rotation",2),v([S],zs.prototype,"scale",2),v([S],zs.prototype,"backgroundFill",2),v([S],zs.prototype,"backgroundFillOpacity",2),v([S],zs.prototype,"repeat",2),v([S],zs.prototype,"fit",2);var _n=class extends ce{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Bs}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context")),"allowNullKeys"in t&&(this.allowNullKeys=t.allowNullKeys,e.delete("allowNullKeys"))}};v([S],_n.prototype,"id",2),v([S],_n.prototype,"visible",2),v([S],_n.prototype,"focusPriority",2),v([S],_n.prototype,"showInLegend",2),v([S],_n.prototype,"cursor",2),v([S],_n.prototype,"nodeClickRange",2),v([S],_n.prototype,"highlight",2);function aM(e,t){if(t.length===0)return[!1,!1];const i=t[0],n=t.at(-1);if(typeof i=="string"||i===null||i===void 0)return[e===i,e===n];if(e==null)return[!1,!1];const s=e.valueOf();if(i==null||n==null)return[!1,!1];let r=i.valueOf(),a=n.valueOf();return r>a&&([r,a]=[a,r]),[s===r,s===a]}function bm(e,t,i,n,s,r){const[a,o]=aM(t,r),[l,c]=aM(e,s);return{xKey:i,yKey:n,xValue:e,yValue:t,first:l,last:c,min:a,max:o}}function jc(e,t,[i,n],s){let r=fo(0,t-1,o=>{const l=e===1?o:t-o,c=s(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,a=En(0,t-1,o=>{const l=e===1?o:t-o,c=s(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=n})??t-1;return e===-1&&([r,a]=[t-a,t-r]),r=Math.max(r,0),a=Math.min(a+1,t),[r,a]}function vm(e,t,i){if(i){const{x:s,y:r,width:a,height:o}=i;return{canvasX:s+a/2,canvasY:r+o/2}}const n=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(n){const{x:s,y:r}=Je.toCanvasPoint(e.contentGroup,n.x,n.y);return{canvasX:Math.round(s),canvasY:Math.round(r)}}}function rO(e,t,i,n,s){let r=-1,a=0,o=0,l=!1;for(;a=0&&(o+=1),l&&o<0&&(o-=1),ct){l=!0;continue}s(c)&&(a+=1)}return a}function xm(e){const t={};for(const i of ym)t[i]=e(void 0,!1,i);return t}function aO(e,...t){const i={};for(const n of t??["default"])for(const s of ym){const r=i[n]??(i[n]={});r[s]=e(void 0,!1,s,n)}return i}function Sm(e){return(e?.opacity??1)<1||(e?.fillOpacity??1)<1||(e?.strokeOpacity??1)<1}var oM=new Map;function oO(e){if(e==null)return!1;const t=e.fill;if(!rt(t))return!1;const i=t.trim(),n=i.toLowerCase();if(n==="transparent"||n==="none")return!1;let s=oM.get(i);if(s==null){try{s=Te.fromString(i).a===1}catch{s=!1}oM.set(i,s)}return s}function lO(e,t){return e!=="cutout"?e:oO(t)?"cutout":"overlay"}function lM(e,t,i){for(const n of t??[])switch(typeof e){case"string":if(n.itemId===e)return n;if(n.itemId===void 0&&i!==void 0){const s=n.datum?.[i];if(s!=null&&String(s)===e)return n}break;case"number":if(n.datumIndex===e||n.itemId===void 0&&i!==void 0&&n.datum?.[i]===e)return n;break;default:return e}}function cO(e,t,i){const n=vm(e,i.datum,i.movedBounds);if(n!=null)return{x:n.canvasX,y:n.canvasY};const s=i.bounds;if(s!=null){if(s instanceof U){const{x:r,y:a}=s.computeCenter();return{x:t.x+r,y:t.y+a}}return Je.toCanvas(s).computeCenter()}}function Mm({bounds:e}){return e instanceof U?e:e!=null?Je.toCanvas(e):U.NaN}function hO(e,t,i){const{x:n,y:s}=cO(e,t,i)??{};if(n!==void 0&&s!==void 0)return{type:"keyboard",canvasX:n,canvasY:s}}var Hc=class bp{constructor(t,i){this.data=t,this.dataIdKey=i,this.pendingTransactions=[]}static empty(t){return new bp([],t)}static wrap(t,i){return new bp(t,i)}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 bp([...this.data],this.dataIdKey)}normalizeTransaction(t){const{add:i,addIndex:n,prepend:s,append:r,remove:a,update:o}=t;if(i===void 0)return t;const l={remove:a,update:o};if(s&&(l.prepend=s),r&&(l.append=r),i&&i.length>0){const c=this.netSize();n===void 0||n>=c?l.append=r?[...r,...i]:i:n===0?l.prepend=s?[...i,...s]:i:l.insertions=[{index:n,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(){if(this.dataIdKey!=null&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const t=this.getChangeDescription();if(!t)return!1;const i=t.getPrependedValues(),n=t.getInsertionValues(),s=t.getAppendedValues(),r=[...i,...n,...s];let a=0;if(t.applyToArray(this.data,function(l){if(a>=r.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return r[a++]}),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:o}=t.indexMap;for(const l of o){const c=this.getIdValue(this.data[l]);c!==void 0&&this.cachedPendingReplacements.has(c)&&(this.data[l]=this.cachedPendingReplacements.get(c))}}return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(t,s,i,n),this.updateIdToIndexCache(t,s,i,n),!0}updateItemToIndexCache(t,i,n,s){if(!this.itemToIndexCache)return;if(this.dataIdKey){this.itemToIndexCache=void 0;return}const{indexMap:r}=t,{totalPrependCount:a,totalAppendCount:o,removedIndices:l}=r,c=l.size>0,h=s.length>0;if(!c&&a===0&&o===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}const u=dm(l);if(c&&u===0){this.itemToIndexCache=void 0;return}const d=this.itemToIndexCache,p=a-u;if(p!==0)for(const[f,m]of d)l.has(m)?d.delete(f):d.set(f,m+p);else if(c)for(const[f,m]of d)l.has(m)&&d.delete(f);for(let f=0;f0,h=s.length>0;if(!c&&a===0&&o===0&&!h)return;if(h){this.idToIndexCache=void 0;return}const u=dm(l);if(c&&u===0){this.idToIndexCache=void 0;return}const d=this.idToIndexCache,p=a-u;if(p!==0)for(const[f,m]of d)l.has(m)?d.delete(f):d.set(f,m+p);else if(c)for(const[f,m]of d)l.has(m)&&d.delete(f);for(let f=n.length-1;f>=0;f--){const m=this.getIdValue(n[f]);m!==void 0&&d.set(m,f)}const g=r.finalLength-o;for(let f=0;f0;)i.has(n[s])?(i.delete(n[s]),n.splice(s,1)):s++;if(i.size===0)break}}buildIndexMap(){const t=this.data.length,i=this.collectTransactionEffects(),n=i.prependsList.flat(),s=i.appendsList.flat(),r=i.insertionsList.flat(),a=n.length,o=s.length,l=r.length,c=t-i.removedOriginalIndices.size,h=a+c+l+o,u=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,d=this.buildSpliceOperations(a,l,o,c,i.trackedInsertions,u?.desc,u?.asc),p=this.resolveUpdatedIndices(a,l,c,i.updateTracking,u?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:t,finalLength:h,spliceOps:d,removedIndices:i.removedOriginalIndices,updatedIndices:p,totalPrependCount:a,totalAppendCount:o},prependValues:n,appendValues:s,insertionValues:r,pendingReplacements:i.pendingReplacements}}getSortedRemovedIndices(t){const i=Array.from(t).sort((n,s)=>n-s);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:n,append:s,insertions:r,remove:a,update:o}=i;this.applyPrepends(n,t),this.applyInsertions(r,t),this.applyAppends(s,t),this.applyRemovals(a,t),this.applyUpdates(o,t)}return{prependsList:t.prependsList,appendsList:t.appendsList,insertionsList:t.insertionsList,trackedInsertions:t.trackedInsertions,removedOriginalIndices:t.removedOriginalIndices,updatedOriginalIndices:t.updatedOriginalIndices,updateTracking:t.updateTracking,pendingReplacements:t.pendingReplacements}}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:n,items:s}of t)n>=0&&n<=i.virtualLength&&s.length>0&&(i.trackedInsertions.push({virtualIndex:n,items:[...s]}),i.insertionsList.push([...s]),i.virtualLength+=s.length)}applyAppends(t,i){!Array.isArray(t)||t.length===0||(i.appendsList.push([...t]),i.virtualLength+=t.length)}applyRemovals(t,i){!Array.isArray(t)||t.length===0||(this.dataIdKey?this.applyRemovalsById(t,i):this.applyRemovalsByRef(t,i))}applyRemovalsByRef(t,i){const n=new Set(t);if(this.removeFromGroups(i.prependsList,n),n.size>0&&this.removeFromGroups(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(t,i),n.size>0&&this.removeFromGroups(i.appendsList,n),n.size>0)for(let s=0;s0;s++){const r=this.data[s];n.has(r)&&(i.removedOriginalIndices.add(s),n.delete(r),i.virtualLength--)}n.size>0&&z.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyRemovalsById(t,i){const n=new Set;for(const s of t){const r=this.getIdValue(s);r===void 0?z.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):n.add(r)}if(n.size!==0){if(this.removeFromGroupsById(i.prependsList,n),n.size>0&&this.removeFromGroupsById(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(t,i),n.size>0&&this.removeFromGroupsById(i.appendsList,n),n.size>0){const s=this.getIdToIndexMap();for(const r of n){const a=s.get(r);a!==void 0&&(i.removedOriginalIndices.add(a),i.virtualLength--,n.delete(r))}}n.size>0&&z.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(t,i){!Array.isArray(t)||t.length===0||(this.dataIdKey?this.applyUpdatesById(t,i):this.applyUpdatesByRef(t,i))}applyUpdatesByRef(t,i){const n=new Set(t),s=this.collectUpdatedIndicesFromGroups(i.prependsList,n),r=n.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,n):[],a=n.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndices(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:a,updatedInsertionsIndices:r},n.size>0&&z.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}applyUpdatesById(t,i){const n=new Map;for(const o of t){const l=this.getIdValue(o);l===void 0?z.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):n.set(l,o)}if(n.size===0)return;const s=this.collectUpdatedIndicesFromGroupsById(i.prependsList,n),r=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.insertionsList,n):[],a=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndicesById(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:a,updatedInsertionsIndices:r},n.size>0&&z.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 n=[];let s=0;for(const r of t){for(const a of r)i.has(a)&&(n.push(s),i.delete(a)),s++;if(i.size===0)break}return n}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let t=0;t0&&z.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(t,i){for(const n of t){let s=0;for(;s0;){const r=this.getIdValue(n[s]);r!==void 0&&i.has(r)?(i.delete(r),n.splice(s,1)):s++}if(i.size===0)break}}collectUpdatedIndicesFromGroupsById(t,i){if(i.size===0||t.length===0)return[];const n=[];let s=0;for(const r of t){for(let a=0;a0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,s,r,a)}}removeFromTrackedInsertionsById(t,i){const n=new Set;for(const s of t){const r=this.getIdValue(s);r!==void 0&&n.add(r)}if(n.size!==0)for(let s=0;s0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,r,a,o),n.size===0)break}}adjustLaterInsertionsAfterRemoval(t,i,n,s,r){const a=r.length;for(let o=i+1;o0&&(l.virtualIndex-=h)}}buildSpliceOperations(t,i,n,s,r,a,o){const l=[];if(t>0&&l.push({index:0,deleteCount:0,insertCount:t}),a&&a.length>0){let c=a[0],h=1;for(let u=1;u0)for(const c of r){const h=this.countRemovalsBeforeIndex(o,t,c.virtualIndex),u=c.virtualIndex-h;l.push({index:u,deleteCount:0,insertCount:c.items.length})}return n>0&&l.push({index:t+s+i,deleteCount:0,insertCount:n}),l}countRemovalsBeforeIndex(t,i,n){if(!t||t.length===0)return 0;let s=0;for(const r of t)if(r+i0){const c=Array.from(a).sort((u,d)=>u-d);let h=0;for(const u of c){if(r)for(;h0&&o.length>0){let h=0;for(const u of o){const d=this.countRemovalsBeforeIndex(r,t,u.virtualIndex),p=u.virtualIndex-d;for(let g=0;gIm(i,t))}var dO=class{constructor(e,t){this.activeManager=e,this.tooltipProperties=t,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const e=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,e}getActivationArgs(e){if(e===void 0)return[void 0,void 0];{const t=e.series.id,i=xd(e,e.series.data?.dataIdKey);return[{type:"series-node",seriesId:t,itemId:i},e]}}maybeActivate(e,t,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[n,s]=this.getActivationArgs(e);this.activeManager.update(n,s)?this.activationPrevented=!0:(this.active=e,t(i?.defaultCbArg))}finally{this.blockEntrance=!1}}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(e){if(e!==void 0){const i=this.active;if(this.tooltipProperties.pagination&&i!==void 0){const n=e.matches.find(s=>Im(s,i));if(n)return n}}return e?.matches[0]}onPickedNodesTooltip(e){if(e!==void 0&&this.tooltipProperties.pagination){const i=this.active,n=e.matches;this.candidates=n;let s=uO(n,i);s===-1&&(s=0);const r=n[s],a={index:s,length:n.length};return{active:r,paginationState:a}}return{active:e?.matches[0]}}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.active,i=t==null?-1:e.findIndex(a=>Im(a,t));if(i===-1)return{active:void 0,paginationState:void 0};let n=i+1;n>=e.length&&(n=0);const s=e[n],r={index:n,length:this.candidates.length};return{active:s,paginationState:r}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}},hM=(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))(hM||{}),pO=.25,gO=.125,Sd=class{constructor(e,t,i,n){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=n.id,this.dataIdKey=n.data?.dataIdKey,this.itemId=xd(i,this.dataIdKey)}preventDefault(){this.defaultPrevented=!0}},Dm=class{constructor(e,t){this.series=e,this.seriesGrouping=t,this.type="groupingChanged"}};function uM(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function Cm(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius";default:return"x"}}var $c=class extends cM{constructor(e){super(),this.cleanup=new tt,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=Sd,this.internalId=Rn(this),this.contentGroup=new Yt({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Yt({name:`${this.internalId}-highlight`,zIndex:1}),this.highlightNodeGroup=this.highlightGroup.appendChild(new ae({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new ae({name:`${this.internalId}-highlight-label`,zIndex:2})),this.annotationGroup=new Yt({name:`${this.internalId}-annotation`}),this.labelGroup=new Yt({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new Yf,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new xs,this._pickNodeCache=new Mh(5),this.fireEventWrapper=l=>super.fireEvent(l);const{moduleCtx:t,pickModes:i,propertyKeys:n={},propertyNames:s={},canHaveAxes:r=!1,usesPlacedLabels:a=!1,alwaysClip:o=!1}=e;this.ctx=t,this.propertyKeys=n,this.propertyNames=s,this.canHaveAxes=r,this.usesPlacedLabels=a,this.pickModes=i,this.alwaysClip=o,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",l=>this.setChartData(l)),this.ctx.eventsHub.on("highlight:change",l=>this.onChangeHighlight(l)))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(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:n,visible:s}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:n,visible:s,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new Dm(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 Dm(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)return!1;const e=this.ctx.highlightManager.getActiveHighlight();if(e==null||e.series?.isHighlightEnabled()===!1)return!1;const{unhighlightedItem:t,unhighlightedSeries:i}=this.properties.highlight;return Sm(t)||Sm(i)}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=uM(e),n=i==null?e:Cm(this.resolveKeyDirection(i)),s=t?.[n],r=[];if(!s)return r;const a=(...o)=>{for(const l of o)Array.isArray(l)?a(...l):typeof l=="object"?a(...Object.values(l)):r.push(l)};return a(...s.map(o=>this.properties[o])),r}getKeyAxis(e){}getKeys(e){return this.getPropertyValues(Cm(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(Cm(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),n=this.getPropertyValues(e,this.propertyNames),s=[];for(let r=0;rn.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 Je.toCanvasPoint(this.contentGroup,t,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:e,seriesGrouping:t,type:i,visible:n}=this;this.ctx.seriesStateManager.updateSeries({internalId:e,type:i,visible:n,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,n){return this.properties.highlight.enabled?t?1:e?.series==null||e.series.isHighlightEnabled()===!1?0:this.isSeriesHighlighted(e,n)?this.isItemHighlighted(e,i)==null?2:4:3:0}getHighlightStateString(e,t,i,n){return nl(this.getHighlightState(e,t,i,n))}onChangeHighlight(e){const t=e.previousHighlight,i=e.currentHighlight,n=this.getHighlightState(i),s=this.getHighlightState(t);this.setSeriesIndex(this.declarationOrder);const r=this.hasItemStylers();if(!r&&n===s){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:a,unhighlightedItem:o,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=r||!_l(a)||!_l(o)||!_l(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,n){const s=this.ctx.highlightManager?.getActiveHighlight();return i??(i=this.getHighlightState(s,e,t,n)),this.properties.highlight.getStyle(i)}resolveMarkerDrawingModeForState(e,t){return lO(e,t)}filterItemStylerFillParams(e){return Zi(e)?K(e,["bounds","colorSpace","gradient","reverse"]):Ts(e)?K(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:n,pickModeAxis:s,visible:r,contentGroup:a}=this;if(!r||!a.visible)return;let o=1/0;if(t==="tooltip"||t==="highlight-tooltip"){const{tooltip:d}=this.properties;o=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(t==="event"||t==="context-menu"){const{nodeClickRange:d}=this.properties;o=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=n.filter(d=>!i||d===0),{x:c,y:h}=e,u=JSON.stringify({x:c,y:h,maxDistance:o,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let p;switch(d){case 0:{const g=this.pickNodesExactShape(e);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(e),f=g?.distance===0?this.pickNodesExactShape(e):void 0;f!=null&&f.length!==0?p={datums:f,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=s==null?void 0:this.pickNodeMainAxisFirst(e,s==="main-category");p=g==null?void 0:{datums:[g.datum],distance:g.distance};break}}if(p&&p.distance<=o)return this._pickNodeCache.set(u,{pickMode:d,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const n=i.closestDatum();typeof n=="object"&&n!=null&&n.missing!==!0&&t.push(n)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=ku(e.x,e.y,t),n=i.nearest?.closestDatum();if(typeof n=="object"&&n!=null&&n.missing!==!0)return{datum:n,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireEvent(e){Nn([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:n,legendItemName:s}=t??{};this.toggleSeriesItem(i,e,n,s)}onLegendItemClick(e){const{enabled:t,itemId:i,series:n,legendType:s}=e,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,o=r!=null&&r===e.legendItemName;(n.id===this.id||o||a!=null)&&this.toggleSeriesItem(t,s,i,r,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:n,numVisibleItems:s,legendType:r}=e,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=a!=null&&a===e.legendItemName;n.id===this.id||l||o!=null?this.toggleSeriesItem(!0,r,i,a,e):t&&s===1?this.toggleSeriesItem(!0,r,void 0,a):this.toggleSeriesItem(!1,r,void 0,a)}toggleSeriesItem(e,t,i,n,s){const r=this.id;(e||t!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:s?.legendItemName??n,visible:e};this.fireEvent(a),this.ctx.legendManager.toggleItem(e,r,i,n)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(e,t,i,n,s,r,a){const{id:o,properties:l}=this;return e.formatDatum(l,i,t,o,r,n,s,void 0,void 0,void 0,a)}getLabelText(e,t,i,n,s,r,a,o=!1){if(e==null&&!o)return"";const{axes:l,canHaveAxes:c,ctx:h,id:u,properties:d}=this,p="series-label",g="legendItemName"in d?d.legendItemName:void 0,f={seriesId:this.id,...a},m=c?uM(n):void 0,y=m==null?void 0:l[this.resolveKeyDirection(m)];if(y!=null)return y.formatDatum(d,e,p,u,g,t,i,s,r,f,o);const{formatManager:b}=h,x=this.callWithContext.bind(this),M=C=>r.formatValue(x,C.type,C.value,f)??b.format(x,C)??(e==null?"":String(e)),I=this.getFormatterContext(n);switch(n){case"y":case"color":case"size":return M({type:"number",value:e,datum:t,seriesId:u,legendItemName:g,key:i,source:p,property:n,domain:s,boundSeries:I,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return M({type:"category",value:e,datum:t,seriesId:u,legendItemName:g,key:i,source:p,property:n,domain:s,boundSeries:I})}}getMarkerStyle(e,{datumIndex:t,datum:i,point:n},s,r,a={size:n?.size??e.size??0},o){const{itemStyler:l}=e,{highlightState:c,isHighlight:h=!1,checkForHighlight:u=!0,resolveMarkerSubPath:d=["marker"],resolveStyler:p=!1}=r??{},g=["series",`${this.declarationOrder}`,...d];if(p){const b={permissivePath:!0},x=this.ctx.optionsGraphService.resolvePartial(g,a,b);x&&(a={...x,size:x.size??a.size})}const f=u?this.getHighlightStyle(h,t,c):void 0;let y=xe(f,a,e.getStyle(),o);if(l&&s){const b=this.ctx.highlightManager?.getActiveHighlight(),x=this.getHighlightStateString(b,h,t),M=this.filterItemStylerFillParams(y.fill),I=this.cachedCallWithContext(l,{seriesId:this.id,...y,fill:M,...s,highlightState:x,datum:i}),C=this.ctx.optionsGraphService.resolvePartial(g,I);y=xe(C,y)}return y}applyMarkerStyle(e,t,i,n,{applyTranslation:s=!0,selected:r=!0}={}){const{shape:a,size:o=0}=e,l=this.visible&&o>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y);if(t.setStyleProperties(e,n),s?t.setProperties({visible:l,shape:a,size:o,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):t.setProperties({visible:l,shape:a,size:o}),r||(t.fillOpacity*=pO,t.strokeOpacity*=gO),typeof a=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[u,d]=["x","y"].map(p=>(e.strokeWidth??0)+Math.abs(h[p]-i[p]));i.focusSize=Math.max(c.width+u,c.height+d)}}}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},n=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,s=ss(this.nodeDataDependencies,n)!=null;return s&&(this._nodeDataDependencies=n,this.markNodeDataDirty()),s}pickFocus(e){}pickViewportFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,n=i.get(e);if(n!=null)return n;try{const s=t();return i.set(e,s),s}catch(s){z.error(String(s))}}cachedCallWithContext(e,t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,t)}callWithContext(e,t){return Nn([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}};$c.className="Series",v([_t({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],$c.prototype,"seriesGrouping",2);var Am=class extends $c{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=Re.is(e),n=Re.is(t);return{isContinuousX:i,isContinuousY:n,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:n,processedData:s}=await e.request(this.id,t??Hc.empty(),i);return this.dataModel=n,this.processedData=s,this.events.emit("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}}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 n=e.reduced?.animationValidation;if(!n)return!0;const{orderedKeys:s,uniqueKeys:r}=n;return s&&r}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return lM(e,this.getNodeData(),this.data?.dataIdKey)}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:n}=this,s=t[i],r={...e,datumIndex:i},a=this.computeFocusBounds(r);if(a!==void 0)return{bounds:a,clipFocusBox:n,datum:s,datumIndex:i}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,n)=>i.datumIndex-n.datumIndex),t}isDatumEnabled(e,t){const{missing:i=!1,enabled:n=!0,focusable:s=!0}=e[t];return!i&&n&&s}computeFocusDatumIndex(e,t){const i=(a,o)=>{for(;a>=0&&!this.isDatumEnabled(t,a);)a+=o;return a===-1?void 0:a},n=(a,o)=>{for(;a0?s=n(r,e.datumIndexDelta):s=n(r,1)??i(r,-1),s===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:s}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,n=this.getCategoryKey();return!t||!i||!n||(t.invalidData?.get(this.id)?.[e]??!1)?void 0:this.keysOrValues(n)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,n=this.getCategoryKey();if(!t||!i||!n)return;e=e.valueOf();const s=t.invalidData?.get(this.id),r=this.keysOrValues(n);for(let a=0;athis.nodeFactory()),this.highlightLabelSelection=bt.select(this.highlightLabelGroup,Oi),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=he.create(),!o||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,pathsZIndexSubOrderOffset:t,propertyKeys:o,propertyNames:l,animationResetFns:a,animationAlwaysUpdateSelections:n,animationAlwaysPopulateNodeData:s,datumSelectionGarbageCollection:i,segmentedDataNodes:r},this.paths=e.map(h=>new nm({name:`${this.id}-${h}`})),this.datumSelection=bt.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new hc("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>km}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:n}=this.properties;return t===this||n!=null&&n===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),n=this.updateHighlightSelection(),s=this;this.contentGroup.batchedUpdate(function(){const o=s.updateSelections(),l=s.contextNodeData?.segments;s.opts.segmentedDataNodes?s.dataNodeGroup.segments=l??s.dataNodeGroup.segments:s.dataNodeGroup.segments=void 0,s.updateNodes(n,i||o)});const r=this.getAnimationData(e,t);r&&(i&&this.animationState.transition("resize",r),this.animationState.transition("update",r),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(e=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!gn(i)||e:!1}trimIncrementalNodeArray(e,t){t{this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:t})??t})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[n,s]=Ct(t?.range??[0,1]),[r,a]=Ct(i?.range??[0,1]),o=wl(this.getSeriesDomain("x")),l=[t?.scale.convert(o.at(0)),t?.scale.convert(o.at(-1))],c=wl(this.getSeriesDomain("y")),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=Ct(l),[p,g]=Ct(h);return{axis:new U(n,r,s-n,a-r),series:new U(u,p,d-u,g-p)}}updateNodes(e,t){const{highlightSelection:i,datumSelection:n}=this,s=!this.ctx.animationManager.isSkipped(),r=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=s||r,this.annotationGroup.visible=s||r,this.highlightGroup.visible=(s||r)&&e,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:a}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:o,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:u}=this.contextNodeData??{};if(this.updatePathNodes({itemId:u,paths:c,visible:r,animationEnabled:s}),o.visible=s||r,h.visible=r,!o.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:n,isHighlight:!1});const d=this.strokewidthChange()||this.hasChangesOnHighlight;(t||d)&&(this.updateDatumNodes({datumSelection:n,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(n=>n.datum===t.datum&&n.itemId===t.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:e,highlightLabelSelection:t,_contextNodeData:i}=this;if(!i)return!1;const n=this.ctx.highlightManager?.getActiveHighlight(),r=this.isSeriesHighlighted(n)&&n?.datum?n:void 0;if(r==null)return!1;const{nodeData:a,labelData:o}=i,l=this.getHighlightData(a,r);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:e});const c=this.getHighlightLabelData(o,r)??[];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 U(0,0,e.width,e.height);this.quadtree=new PS(100,10,t),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickViewportFocus(e){if(this.contextNodeData?.nodeData===void 0)return;const{otherIndex:t,where:i,hoverRect:n}=e;if(i==="data-start")return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0});if(i==="data-end"){const b=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:b,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0})}let s,r=0,a,o=this.contextNodeData.nodeData.length-1;const l=this.axes.x?.reverse??!1;function c(b){const x=n.x+n.width;return b.x+b.width<=x}function h(b){return b.x>=n.x}function u(b,x){const M=Mm(x);b(M)?(s=x,o=a-1):r=a+1}function d(b,x){const M=Mm(x);b(M)?(s=x,r=a+1):o=a-1}const p={"viewport-start + true":{predicate:c,iterator:u},"viewport-start + false":{predicate:h,iterator:u},"viewport-end + true":{predicate:h,iterator:d},"viewport-end + false":{predicate:c,iterator:d}},{predicate:g,iterator:f}=p[`${i} + ${l}`];let m=0;const y=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;r<=o&&m<=y;){a=Math.floor((r+o)/2);const b=this.pickFocus({datumIndex:a,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0});if(b===void 0){z.error(`pickFocus (datumIndex: ${a}) failed`);return}f(g,b),m++}return s}pickNodeDataExactShape(e){const{x:t,y:i}=e,{dataNodeGroup:n}=this,s=n.pickNodes(t,i).filter(r=>r.datum.missing!==!0);if(s.length!==0)return s.map(a=>a.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:n,_contextNodeData:s}=this;if(!s)return;const r=n.x,a=n.y,o={x:t,y:i};let l=1/0,c;for(const h of s.nodeData){const{point:{x:u=Number.NaN,y:d=Number.NaN}={}}=h;if(Number.isNaN(u)||Number.isNaN(d)||!(r?.inRange(u)&&a?.inRange(d)))continue;const g=Math.max((o.x-u)**2+(o.y-d)**2,0);gg.isCategoryLike()).map(g=>g.direction);if(t&&c.length===0)return;const[h="x"]=c,u=[i,n];h!=="x"&&u.reverse();const d=[1/0,1/0];let p;for(const g of r.nodeData){const{x:f=Number.NaN,y:m=Number.NaN}=g.point??g.midPoint??{};if(Number.isNaN(f)||Number.isNaN(m)||g.missing===!0)continue;const y=[o?.inRange(f,1),l?.inRange(m,1)];if(h!=="x"&&y.reverse(),!y[0]||!a&&!y[1])continue;const b=[f,m];h!=="x"&&b.reverse();let x=!0;for(let M=0;Md[M]){x=!1;break}else I{const h=i?.[c]??c;return this.xCoordinateRange(r[h],a,h)});return othis.keysOrValues(g));let d=1/0,p=-1/0;for(const[g,f]of c.entries()){const[m,y]=this.xCoordinateRange(f,0,g);if(!(yl))for(let b=0;bp?[Number.NaN,Number.NaN]:[d,p]}domainForClippedRange(e,t,i){const{processedData:n,dataModel:s,axes:r}=this,o=fO(r[e==="x"?"y":"x"]);if(!o)return t.flatMap(f=>s.getDomain(this,f,"value",n).domain);const l=this.keysOrValues(i),c=this.sortOrder(i);if(c!=null){const f=mO(c,l.length,o,m=>l[m]);return s.getDomainBetweenRange(this,t,f,n)}const h=t.map(f=>this.keysOrValues(f)),u=o[0].valueOf(),d=o[1].valueOf();let p=1/0,g=-1/0;for(const[f,m]of l.entries()){const y=m.valueOf();if(!(yd))for(let b=0;bg?[Number.NaN,Number.NaN]:[p,g]}zoomFittingVisibleItems(e,t,i,n,s){const{dataModel:r,processedData:a}=this;if(!r||!a)return;const o=this.axes.x;if(n!=null)return;const l=this.sortOrder(e);if(l==null)return;const c=this.keysOrValues(e);if(s>c.length)return{x:[0,1],y:void 0};const h=o.scale,u=h.range;h.range=[0,1];let[d,p]=this.visibleRangeIndices(e,i,void 0,{sortOrder:l});p-=1;const g=0;this.xCoordinateRange(c[d],g,d)[0]i[1]&&(p-=1);let f;if(Math.abs(p-d)>=s-1)f=i;else{const m=(i[0]+i[1])/2;for(;Math.abs(p-d)0||pr.resolveColumnById(this,D,a)),c=this.shouldFlipXY(),h=c?this.axes.y:this.axes.x,u=c?this.axes.x:this.axes.y,d=c?n??[0,1]:i,p=c?i:n??[0,1];if(n==null){const D=this.sortOrder(e);if(D!=null){const A=h.scale,k=A.range;A.range=[0,1];const N=this.keysOrValues(e);let[T,R]=this.visibleRangeIndices(e,d,void 0,{sortOrder:D});if(R-=1,Rd[1]&&(R-=1);const E=Math.abs(R-T)+1;return A.range=k,E}}const g=(D,A,k)=>D[0]+(k-A[0])/(A[1]-A[0])*(D[1]-D[0]),f=h.range.toSorted(),m=u.range.toSorted(),y=g(f,h.visibleRange,d[0]),b=g(f,h.visibleRange,d[1]),x=g(m,u.visibleRange,Math.min(...p)),M=g(m,u.visibleRange,Math.max(...p)),I=Math.round((d[0]+(d[1]-d[0])/2)*o.length),C=0;return rO(0,o.length-1,I,s,D=>{const[A,k]=this.xCoordinateRange(o[D],C,D),[N,T]=this.yCoordinateRange(l.map(R=>R[D]),C,D);return!Pe(A)||!Pe(k)||!Pe(N)||!Pe(T)?!1:A>=y&&k<=b&&N>=x&&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],n;for(let s=1;se.convert(n),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Re){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Fn){if(e instanceof Ar){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(ag)){const i=this.axes[t];if(!i)continue;const n=this.getScaling(i.scale);n!=null&&(e[t]=n)}return e}};function fO(e){let t,i;if((e instanceof Qi||e instanceof os)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function mO(e,t,i,n){const s=i[0].valueOf(),r=i[1].valueOf();let a=fo(0,t-1,l=>{const c=e===1?l:t-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h>=s}),o=En(0,t-1,l=>{const c=e===1?l:t-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h<=r});return a==null||o==null?[0,0]:(e===-1&&([a,o]=[t-o,t-a]),a=Math.max(a,0),o=Math.min(o+1,t),[a,o])}function dM(e){const t=new Map;for(const i of e){if(!(i instanceof Nr))continue;const s=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(s==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const r=`${i.type}-${s}`;let a=t.get(r);a==null&&(a=[],t.set(r,a)),a.push(i)}for(const i of t.values()){i.sort((s,r)=>(s.seriesGrouping?.stackIndex??0)-(r.seriesGrouping?.stackIndex??0));let n;for(const s of i)s.seriesBelowStackContext=n,n=s.createStackContext()}}var yO=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(n){i?.(n)}[e,t,i]=this.acquireQueue.shift()??[]}this.available=!0}};function bO(e,t){function i(s,r){return e.requestAnimationFrame(s)}function n(s){e.cancelAnimationFrame(s)}return pM(i,t,n)}function Lm(e){function t(n,s=0){if(s===0){queueMicrotask(n);return}return setTimeout(n,s)}function i(n){clearTimeout(n)}return pM(t,e,i)}function pM(e,t,i){let n=0,s=!1,r,a,o;function l(){return s}function c(){s=!1,o=void 0,a?.(),a=void 0,r=void 0,n>0&&(o=e(h))}function h(){const f=n;n=0,s=!0;const m=t({count:f});if(!m){c();return}m.then(c,c)}function u(f){n===0&&!l()&&(o=e(h,f)),n++}function d(){o!=null&&i&&(i(o),o=void 0,n=0)}async function p(){if(l())for(r??(r=new Promise(g));l();)await r}function g(f){a=f}return{schedule:u,cancel:d,waitForCompletion:p}}var al=class extends Ah{constructor(e){super(),this.ctx=e,this.rectNode=new wt,this.textNode=new Oi,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 ae({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};v([S,ot("node","visible")],al.prototype,"visible",2),v([S,ot("rectNode","fill")],al.prototype,"fill",2),v([S],al.prototype,"image",2),v([S,ot("textNode")],al.prototype,"text",2);var Md=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&&Cv(e,(t,i)=>oe(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}},vO=class extends Md{get x(){return this.getById("x")}get y(){return this.getById("y")}perpendicular(e){const t=e.direction==="x"?"y":"x";return this[t]}},xO=class extends Md{get angle(){return this.getById("angle")}get radius(){return this.getById("radius")}},Id=class{constructor(){this.title=new nt,this.subtitle=new nt,this.footnote=new nt}positionCaptions({layoutBox:e}){const{title:t,subtitle:i,footnote:n}=this,s=e.height/10;t.enabled&&(this.positionCaption("top",t,e,s),this.shrinkLayoutByCaption("top",t,e)),i.enabled&&(this.positionCaption("top",i,e,s),this.shrinkLayoutByCaption("top",i,e)),n.enabled&&(this.positionCaption("bottom",n,e,s),this.shrinkLayoutByCaption("bottom",n,e))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:n}=this,{rect:s}=e.series;for(const r of[t,i,n])if(r.layoutStyle==="overlay"){if(r.textAlign==="left")r.node.x=s.x+r.padding;else if(r.textAlign==="right"){const a=r.node.getBBox();r.node.x=s.x+s.width-a.width-r.padding}}}computeX(e,t){return e==="left"?t.x:e==="right"?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,n){if(!t.text)return;const{lineMetrics:s}=le(t.text)?ks(t.text,t):bi(t).measureLines(ft(t.text)),r=Math.max(s[0].height,n);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,r)}shrinkLayoutByCaption(e,t,i){if(t.layoutStyle==="block"){const n=t.node.getBBox().clone(),{spacing:s=0}=t;e==="bottom"&&le(t.text)&&(n.y-=n.height),i.shrink(Math.ceil(e==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),e)}}};v([S],Id.prototype,"title",2),v([S],Id.prototype,"subtitle",2),v([S],Id.prototype,"footnote",2);var SO=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],MO=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||SO.includes(e)}restoreMemento(e,t,i){if(i==null)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch(s=>z.error("error restoring state",s))}},gM=Symbol("previous-memento-not-found"),IO=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=he.create(!0,"history"),this.cleanup=new tt,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.historyIndexthis.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const n of t){if(!this.originators.has(n.mementoOriginatorKey))throw new Error(`Originator [${n.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(n.mementoOriginatorKey,n.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===gM)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):gM}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(qe,qe,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},DO=class{constructor(){this.caretaker=new rg(qe),this.state=new Map}setState(e,t){yt(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 n=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:n},e)}},CO=`.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{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{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.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-color: #e4f2fe;--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-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-width: 1px;--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-width: 1px;--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-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-width: 1px;--ag-charts-border: var(--ag-charts-border-width) 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-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-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.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-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-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-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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);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-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);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[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);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__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-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(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);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,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button:hover,.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:calc(-1 * var(--toolbar-button-border-width));&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button:hover+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-border-radius);border-end-end-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.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-toolbar__button:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--hover)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--active)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing} `,Tm=class{constructor(){this.cleanup=new tt,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},AO=class vp{constructor(t,i,n){this.element=t,this.topTabGuard=i,this.bottomTabGuard=n,this.cleanup=new tt,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",s=>this.onBlur(s),{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(Fe(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;Se(this.topTabGuard,"tabindex",i),Se(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:n}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==n&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let n;t.tabIndex===0?(n=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):n=this.findEnterTarget(i),n?.focus()}}static queryFocusable(t,i){const n=t.ownerDocument.defaultView;return Array.from(t.querySelectorAll(i)).filter(s=>{if(Nl(s)){const r=n.getComputedStyle(s);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(t){const i=vp.queryFocusable(this.element,'[tabindex="0"]'),n=t?i.length-1:0;return i[n]}findExitTarget(t){const i=vp.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter(r=>r.tabIndex>0).sort((r,a)=>r.tabIndex-a.tabIndex),{before:n,after:s}=vp.findBeforeAndAfter(i,this.guardTabIndex);return t?n:s}static findBeforeAndAfter(t,i){let n=0,s=t.length-1,r,a;for(;n<=s;){const o=Math.floor((n+s)/2),l=t[o].tabIndex;if(l===i){r=t[o-1]||void 0,a=t[o+1]||void 0;break}else l{i.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=e.devicePixelRatio}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=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},kO=class{constructor(e){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,n,s]of this.queuedObserveRequests)this.observe(i,n,s);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=e.createResizeObserver(i=>{for(const{target:n,contentRect:{width:s,height:r}}of i){const a=this.elements.get(n);this.checkSize(a,n,s,r)}});let t;this.pixelRatioObserver=new wO(e,()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=e.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=e.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,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:n,height:s}=i.size;i.size={width:n,height:s,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,n){if(e&&(i!==e.size?.width||n!==e.size?.height)){const s=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:n,pixelRatio:s},e.cb(e.size,t)}}observe(e,t,i){if(!this.documentReady){this.queuedObserveRequests.push([e,t,i]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const n={cb:t};if(this.elements.set(e,n),!i?.skipInitialRead){const s=e.ownerDocument.defaultView?.getComputedStyle(e),r=e.clientWidth-(Number.parseFloat(s?.paddingLeft??"0")+Number.parseFloat(s?.paddingRight??"0")),a=e.clientHeight-(Number.parseFloat(s?.paddingTop??"0")+Number.parseFloat(s?.paddingBottom??"0"));(r>0||a>0)&&this.checkSize(n,e,r,a)}}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)}},Dd=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}},LO=["translate"],Cd=class{constructor(e,t){this.element=e,this.cache={},this.pendingWrites=new Map,this.deferredMode=t?.deferredMode,this.sizeMonitor=t?.sizeMonitor,this.skipInitialRead=t?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(e){return this.element.contains(e)}addEventListener(e,t,i){this.element.addEventListener(e,t,i)}removeEventListener(e,t,i){this.element.removeEventListener(e,t,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(e,t){return this.cache[e]===t?!1:(this.cache[e]=t,!0)}invalidate(e){delete this.cache[e]}setProperty(e,t){const i=`p:${e}`;if(this.changed(i,t)){if(LO.includes(e)){this.element.style.setProperty(e,t);return}this.pendingWrites.set(i,()=>{this.element.style.setProperty(e,t)}),this.scheduleFlush()}}toggleClass(e,t){const i=`c:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,()=>{this.element.classList.toggle(e,t)}),this.scheduleFlush())}setAttr(e,t){const i=`a:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,()=>{t==null?this.element.removeAttribute(e):this.element.setAttribute(e,t)}),this.scheduleFlush())}setData(e,t){const i=`d:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,()=>{this.element.dataset[e]=t}),this.scheduleFlush())}getData(e){const t=`d:${e}`;return this.pendingWrites?this.cache[t]:this.element.dataset[e]}setInnerHTML(e){return this.changed("innerHTML",e)?(this.pendingWrites.set("innerHTML",()=>{this.element.innerHTML=e}),this.scheduleFlush(),this.invalidate("contentStyles"),!0):!1}setContentStyles(e){if(this.changed("contentStyles",JSON.stringify(e))){const t=()=>{const i=this.element.firstElementChild??this.element;Object.assign(i.style,e)};this.pendingWrites.set("contentStyles",t),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const e of this.pendingWrites.values())e();this.pendingWrites.clear()}}flushKey(e){const t=this.pendingWrites.get(e);t&&(t(),this.pendingWrites.delete(e))}togglePopover(e){e?this.changed("popover",!0)&&(this.pendingWrites.set("popover",()=>{this.element.togglePopover(!0)}),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}appendChild(e){this.element.appendChild(e)}set innerText(e){this.element.innerText=e,this.invalidate("innerHTML")}addResizeListener(e){const{sizeMonitor:t,element:i,skipInitialRead:n}=this;if(t==null)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return t.observe(i,s=>e(s),{skipInitialRead:n}),()=>t.unobserve(i)}reset(){this.cache={}}},TO='',NO=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],OO=new Set(["styles","canvas-container","canvas","tooltip-container"]),fM={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},EO=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 RO(e,t,i){const n=e.createIntersectionObserver(s=>{for(const r of s)r.target===t&&i(r.intersectionRatio)},{root:t});return n?.observe(t),n}var mM={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return mM}};function yM(e,t){const i=me("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var Ad=class Za extends Tm{constructor(t,i,n,s,r,a,o="normal"){super(),this.eventsHub=t,this.chart=i,this.agDocument=n,this.styleContainer=r,this.skipCss=a,this.mode=o,this.anchorName=`--${Rn(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.cursorState=new Dd("default"),this._lastCursor=void 0,this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this._isRtl=!1,this._deferring=!1,this.sizeMonitor=new kO(n),this.element=this.initDOM(),this.elementProxy=new Cd(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,()=>this.invalidateRectCaches(),{skipInitialRead:this.mode==="minimal"});let l=!1;if(this.observer=RO(n,this.element,c=>{c===0&&!l&&this.eventsHub.emit("dom:hidden",null),l=c===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",CO),this.setContainer(s),this.cleanup.register(dx(this.element)),this.setupGlobalListeners(),this.mode==="normal"){const c=this.rootElements["canvas-center"].element;if(c==null)throw new Error("Error initializing tab guards");const h=yM(c,"beforebegin"),u=yM(c,"afterend");this.tabGuards=new AO(c,h,u)}}initDOM(){if(this.mode==="normal"){const n=me("div");return n.innerHTML=TO,n.firstChild}const t=me("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=me("div");return t.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:i}=this,n={};for(const s of NO){const r=`ag-charts-${s}`;let a;if(t==="normal"?a=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:OO.has(s)?a=i:a=i.getElementsByClassName(r)[0]??me("div"),a==null)throw new Error(`AG Charts - unable to find DOM element ${r}`);n[s]={element:a,children:new Map,listeners:[]}}return n}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.sizeMonitor.unobserve(this.rootElements.canvas.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()}scheduleFlush(){this._deferring||this._pendingFlush==null&&(this._pendingFlush=setTimeout(()=>{this._pendingFlush=void 0,!this._deferring&&this.flushDeferredProxies()}))}flushDeferredProxies(){this._pendingFlush!=null&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const t of this.deferredProxies.values())t.flush();this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Za.batchedUpdateContainer.length===0&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Za.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of Za.batchedUpdateContainer)t.destroyed||t.updateContainer();Za.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,n,s){const{style:r}=this.element;this.minWidth=n??t,this.minHeight=s??i,r.minWidth=`${this.minWidth}px`,r.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const t=this.containerSize==null?"hidden":"",i=this.containerSize?`${this.containerSize.width??0}px`:"",n=this.containerSize?`${this.containerSize.height??0}px`:"",s=this._lastCenterSize;if(s==null||s.visibility!==t||s.width!==i||s.height!==n){this._lastCenterSize={visibility:t,width:i,height:n};const{style:r}=this.rootElements["canvas-center"].element;r.visibility=t,r.width=i,r.height=n}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.agDocument.setContainer(t),this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=t.isConnected;for(const[i,n]of this.styles)this.addStyles(i,n);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)},{skipInitialRead:this.mode==="minimal"}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(t){const i="ag-charts-theme-";for(const n of Array.from(this.element.classList))n.startsWith(i)&&n!==t&&this.element.classList.remove(n);this.element.classList.add(t)}setThemeParameters(t){this.setCSSVariables("--ag-charts",void 0,void 0,t)}setModuleCSSVariables(t,i,n,s,r){this.setCSSVariables(`--ag-charts-${t}`,i,n,s,r)}setCSSVariables(t,i,n,s,r){for(const[a,o]of Dt(s)){let l=a,c=`${o}`;a.endsWith("Size")||a.endsWith("Radius")||r?.includes(a)?c=`${o}px`:a.endsWith("Border")&&typeof o=="boolean"&&(l=`${a}Width`,c=o?"var(--ag-charts-border-width)":"0"),l=`${t}${i?"__":""}${i??""}-${Yb(l)}${n?"--":""}${n??""}`,this.element.style.setProperty(l,c)}}updateCanvasLabel(t){Se(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,n){const s=this.getEventElement(this.element,t);return Fe(s,t,i,n)}removeEventListener(t,i,n){this.getEventElement(this.element,t).removeEventListener(t,i,n)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getOverlayClientRect(){const{innerWidth:t,innerHeight:i}=this.agDocument,n=new U(0,0,t,i),s=this.getRawOverlayClientRect();return n.intersection(s)?.toDOMRect()??mM}findScrollableContainer(){if(this._cachedScrollableContainer!==void 0)return this._cachedScrollableContainer;let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let n;if(i!=null&&t===i)n=!0;else{const r=t.computedStyleMap?.()?.get("overflow-y")?.toString();n=r==="auto"||r==="scroll"}if(n)return this._cachedScrollableContainer=t,t;t=t.parentElement}return this._cachedScrollableContainer=null,null}getRawOverlayClientRect(){if(this._cachedRawOverlayRect!=null)return this._cachedRawOverlayRect;const t=this.findScrollableContainer();if(t!=null)return this._cachedRawOverlayRect=U.fromObject(t.getBoundingClientRect()),this._cachedRawOverlayRect;if(this.documentRoot!=null)return this._cachedRawOverlayRect=U.fromObject(this.documentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:i,innerHeight:n}=this.agDocument;return this._cachedRawOverlayRect=new U(0,0,i,n),this._cachedRawOverlayRect}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??this.agDocument.body;for(;t!=null;){if(t===i)return;if(Mb(t.parentNode))return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:i}=this.rootElements[t],n=[];for(const s of i.values())n.push(U.fromObject(s.getBoundingClientRect()));return U.merge(n)}isManagedChildDOMElement(t,i,n){const{children:s}=this.rootElements[i],r=s?.get(n);return r!=null&&t.contains(r)}contains(t,i){return i==null?this.element.contains(t):this.rootElements[i].element.contains(t)}addStyles(t,i){const n="data-ag-charts";if(this.styles.set(t,i),this.container==null||this.skipCss)return;const s=o=>o.getAttribute(n)===t,r=o=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const d of o.children){if(c&&l.has(d.tagName)){h=d;continue}if(c=!1,s(d))return;d.hasAttribute(n)&&(h=d)}const u=me("style");return this.chart.styleNonce!=null&&(u.nonce=this.chart.styleNonce),h==null?o.prepend(u):o.insertBefore(u,h.nextSibling),u};let a;this.styleContainer?a=r(this.styleContainer):this.initiallyConnected===!1?a=this.addChild("styles",t):this.documentRoot==null&&!Za.headStyles.has(t)?(a=r(this.agDocument.head),Za.headStyles.add(t)):this.documentRoot!=null&&(a=this.addChild("styles",t)),!(a==null||s(a))&&(a.setAttribute(n,t),a.innerHTML=i)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,i){this.cursorState.set(t,i);const n=this.cursorState.stateValue();n!==this._lastCursor&&(this._lastCursor=n,this.element.style.cursor=n)}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(t){this.enableRtl=t,this.updateRtl()}updateRtl(){const t=this.enableRtl??(this.mode==="minimal"?!1:Qa(this.container??this.pendingContainer));t!==this._isRtl&&(this._isRtl=t,this.element.dir=t?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(t,i,n,s){const{element:r,children:a,listeners:o}=this.rootElements[t];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(i))return a.get(i);const{childElementType:l="div"}=EO.get(t)??{};if(n&&n.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=n??me(l);for(const[h,u,d]of o)c.addEventListener(h,u,d);if(a.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),s){const h=r.querySelector(s.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);h.insertAdjacentElement(s.where,c)}else r?.appendChild(c);return c}addProxyChild(t,i){const n=this.addChild(t,i),s=this.mode==="minimal";return new Cd(n,{sizeMonitor:this.sizeMonitor,skipInitialRead:s})}addDeferredProxyChild(t,i){const n=this.addChild(t,i),s=this.mode==="minimal",r=new Cd(n,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:s});return this.deferredProxies.set(`${t}:${i}`,r),r}setDeferring(t){this.mode!=="minimal"&&(this._deferring=t,t||this.flushDeferredProxies())}removeChild(t,i){const{children:n}=this.rootElements[t];n&&(n.get(i)?.remove(),n.delete(i),this.deferredProxies.delete(`${t}:${i}`))}incrementDataCounter(t){const i=this.elementProxy.getData(t)??"0";this.elementProxy.setData(t,String(Number(i)+1))}setDataBoolean(t,i){this.elementProxy.setData(t,String(i))}setDataNumber(t,i){this.elementProxy.setData(t,String(i))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedRawOverlayRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const t=this.element.ownerDocument.defaultView;if(t==null)return;const i=()=>this.invalidateRectCaches(),n=()=>this.invalidateAllCaches();t.addEventListener("scroll",i,{capture:!0,passive:!0}),t.addEventListener("resize",i,{capture:!0,passive:!0}),this.element.ownerDocument.addEventListener("fullscreenchange",n),this.cleanup.register(()=>{t.removeEventListener("scroll",i,{capture:!0}),t.removeEventListener("resize",i,{capture:!0}),this.element.ownerDocument.removeEventListener("fullscreenchange",n)})}updateContainerClassName(){const{element:t,containerSize:i,minWidth:n,minHeight:s}=this;t.classList.toggle(fM.safeHorizontal,n>=(i?.width??1/0)),t.classList.toggle(fM.safeVertical,s>=(i?.height??1/0))}};Ad.className="DOMManager",Ad.batchedUpdateContainer=[],Ad.headStyles=new Set;var bM=Ad;function ol(e,t,i){const{offsetX:n,offsetY:s,clientX:r,clientY:a}=t,{currentX:o,currentY:l}=Or.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:t}}function wd(e,t,i){return{type:e,sourceEvent:t}}function WF(){}var vM={change:{isNative:!0,allocator(e,t){return{type:"change",sourceEvent:e}}},blur:{isNative:!0,allocator(e,t){return{type:"blur",sourceEvent:e}}},focus:{isNative:!0,allocator(e,t){return{type:"focus",sourceEvent:e}}},keydown:{isNative:!0,allocator(e){return{type:"keydown",sourceEvent:e}}},keyup:{isNative:!0,allocator(e){return{type:"keyup",sourceEvent:e}}},contextmenu:{isNative:!0,allocator(e,t){return ol("contextmenu",e,t)}},click:{isNative:!0,allocator(e,t){return ol("click",e,t)}},dblclick:{isNative:!0,allocator(e,t){return ol("dblclick",e,t)}},mouseenter:{isNative:!0,allocator(e,t){return ol("mouseenter",e,t)}},mousemove:{isNative:!0,allocator(e,t){return ol("mousemove",e,t)}},mouseleave:{isNative:!0,allocator(e,t){return ol("mouseleave",e,t)}},wheel:{isNative:!0,allocator(e,t){const{offsetX:i,offsetY:n,clientX:s,clientY:r}=e,a=e.deltaMode===0?.01:1;let o=e.deltaX*a,l=e.deltaY*a;return Math.abs(e.deltaX)===0&&e.shiftKey&&([o,l]=[l,o]),{type:"wheel",offsetX:i,offsetY:n,clientX:s,clientY:r,deltaX:o,deltaY:l,sourceEvent:e}}},touchstart:{isNative:!0,allocator(e,t){return wd("touchstart",e,t)}},touchmove:{isNative:!0,allocator(e,t){return wd("touchmove",e,t)}},touchend:{isNative:!0,allocator(e,t){return wd("touchend",e,t)}},touchcancel:{isNative:!0,allocator(e,t){return wd("touchcancel",e,t)}},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0},Or=class{static alloc(e,t,i){const n=vM[e].allocator;return n(t,i)}static isHTMLEvent(e){return vM[e]?.isNative===!0}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},PO=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 n=r=>{const a=Or.alloc(e,r,t.getElement());this.dispatch(e,t,a)},s={};(e.startsWith("touch")||e==="wheel")&&(s.passive=!1),this.initSourceHandler(e,n),t.getElement().addEventListener(e,n,s)}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 n=this.lazyGetWidgetListeners(e,t),s=n.indexOf(i);s>-1&&n.splice(s,1)}destroy(e){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of Dt(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const n of this.widgetListeners?.[e]??[])n(i,t)}},FO=class{constructor(e,t,i,n){this.glob=e,this.self=t,this.cleanup=new tt,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{mousegeneral:s,mousemove:r,mouseup:a}=this,o=n.view;this.cleanup.register(Fe(o,"mousedown",s,{capture:!0}),Fe(o,"mouseenter",s,{capture:!0}),Fe(o,"mouseleave",s,{capture:!0}),Fe(o,"mouseout",s,{capture:!0}),Fe(o,"mouseover",s,{capture:!0}),Fe(o,"mousemove",r,{capture:!0}),Fe(o,"mouseup",a,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(n),n.stopPropagation(),n.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function VO(e,t,i,n){if(e.globalMouseDragCallbacks==null)return new FO(e,t,i,n)}var _O=500,BO=100;function zO(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY;return i*i+n*n}var Nm=!1,GO=class{constructor(e,t,i,n,s){this.glob=e,this.self=t,this.initialTouch=n,this.target=s,this.cleanup=new tt,this.longTapInterrupted=!1,this.longtap=()=>{const{target:o,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new tt;o.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),Nm=!0;const h=f=>f.preventDefault(),u=f=>{Nm=!1,f.preventDefault(),c.flush()};c.register(Fe(o,"touchmove",h,{passive:!1}),Fe(o,"touchend",u,{passive:!1}),Fe(o,"touchcancel",u,{passive:!1}));const{clientX:d,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:o.ownerDocument.defaultView,clientX:d,clientY:p,pointerType:"touch"});o.dispatchEvent(g)}},this.touchmove=o=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(o.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||zO(h,u)>BO,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(o,u))},this.touchend=o=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(o.changedTouches,o.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(o,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,_O);const{touchmove:r,touchend:a}=this;this.cleanup.register(Fe(s,"touchmove",r,{passive:!1}),Fe(s,"touchstart",a,{passive:!1}),Fe(s,"touchend",a,{passive:!1}),Fe(s,"touchcancel",a,{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 jO(e,t,i,n,s){if(!(e.globalTouchDragCallbacks!=null||Nm))return new GO(e,t,i,n,s)}function Om(e,t,i,n){const{currentX:s,currentY:r}=Or.calcCurrentXY(e.getElement(),n),a=n.pageX-i.pageX,o=n.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+a,offsetY:i.offsetY+o,clientX:n.clientX,clientY:n.clientY,currentX:s,currentY:r,originDeltaX:a,originDeltaY:o,sourceEvent:n}}function HO(e,{pageX:t,pageY:i}){const{x:n,y:s}=e.getElement().getBoundingClientRect();return{offsetX:t-n,offsetY:i-s}}function Em(e,t,i,n,s){const{currentX:r,currentY:a}=Or.calcCurrentXY(e.getElement(),s),o=s.pageX-i.pageX,l=s.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+o,offsetY:i.offsetY+l,clientX:s.clientX,clientY:s.clientY,currentX:r,currentY:a,originDeltaX:o,originDeltaY:l,sourceEvent:n}}var xM={},SM=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 tt;i.register(Fe(t,"mousedown",n=>this.triggerMouseDrag(e,n)),Fe(t,"touchstart",n=>this.triggerTouchDrag(e,n),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){if(t.button===0){if(t.view==null){const i=e.getElement().ownerDocument.defaultView;t=new i.MouseEvent(t.type,{...t,view:i})}this.startMouseDrag(e,t)}}startMouseDrag(e,t){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};Jp(["pageX","pageY","offsetX","offsetY"],i,t);const n={mousedown:s=>{const r=Om(e,"drag-start",i,s);this.dispatch("drag-start",e,r)},mousemove:s=>{const r=Om(e,"drag-move",i,s);this.dispatch("drag-move",e,r)},mouseup:s=>{const r=Om(e,"drag-end",i,s);this.dispatch("drag-end",e,r),this.endDrag(e,r)}};this.mouseDragger=VO(xM,this,n,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:n}){const s=e.getElement(),r=s.getBoundingClientRect();xu(r,i,n)||(s.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 n={pageX:Number.NaN,pageY:Number.NaN,...HO(e,i)};Jp(["pageX","pageY"],n,i);const s={touchmove:(o,l)=>{const c=Em(e,"drag-move",n,o,l);this.dispatch("drag-move",e,c)},touchend:(o,l)=>{const c=Em(e,"drag-end",n,o,l);this.dispatch("drag-end",e,c)}},r=e.getElement();this.touchDragger=jO(xM,this,s,i,r);const a=Em(e,"drag-start",n,t,i);this.dispatch("drag-start",e,a)}dispatch(e,t,i){for(const n of this.getListenerSet(e))n(i,t);this.dispatchCallback(e,i)}},$O=class{constructor(e){this.elem=e}setBounds(e){wh(this.elemContainer??this.elem,e)}getBounds(){return Vb(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();wh(t,i),Wv(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Er=class extends $O{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(e){Se(this.elem,"id",e)}get id(){return ta(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){On(this.elem,"display",e?"none":void 0)}isHidden(){const{defaultView:e}=this.elem.ownerDocument;return e?.getComputedStyle(this.elem).display==="none"}setCursor(e){On(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){Se(this.elem,"aria-describedby",e)}setAriaHidden(e){Se(this.elem,"aria-hidden",e)}setAriaLabel(e){Se(this.elem,"aria-label",e)}setAriaExpanded(e){Se(this.elem,"aria-expanded",e)}setAriaControls(e){Se(this.elem,"aria-controls",e)}setAriaHasPopup(e){Se(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){On(this.elem,"pointer-events",e)}setCSSVariable(e,t){this.elem.style.setProperty(e,t)}isDisabled(){return ta(this.elem,"aria-disabled",!1)}hasPopup(){const e=ta(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){Se(this.elem,"data-focus-override",e)}setPreventsDefault(e){Se(this.elem,"data-preventdefault",e)}setTabIndex(e){Se(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.domIndexthis.removeListener(e,t)}removeListener(e,t){Or.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new SM(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:n}=i;if(n!=null){const s={...t,...Or.calcCurrentXY(i.getElement(),t)};n.dispatch(e,i,s)}i=i.parent}}},UO=class extends Er{constructor(){super(me("div")),this.textElement=lt("text"),this.textElement.role="presentation",this.svgElement=lt("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(){}},WO=class{constructor(e,t){this.getDispatcher=t,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const n={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,n)}},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})}},Rm=class extends Er{constructor(e,t){super(e),Se(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{_g(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new WO(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(e){Se(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,n)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,n)})}},kd=class extends Rm{constructor(){super(me("button"))}},MM=class extends Er{constructor(){super(me("div")),Se(this.elem,"role","group")}destructor(){}},Pm=class extends Er{constructor(e,t){super(me("div")),this.focusedChildIndex=0,this.onChildFocus=(i,n)=>{const s=this.children[this.focusedChildIndex];this.focusedChildIndex=n.index,s?.setTabIndex(-1),n.setTabIndex(0)},this.onChildKeyDown=(i,n)=>{const s=this.orientation,r=Qa(this.elem);let a,o;s==="both"?(a=ac("horizontal",r),o=ac("vertical")):(a=ac(s,r),o=void 0);let l=-1;if(rc(i.sourceEvent)){const c=i.sourceEvent.key;c===a.nextKey||c===o?.nextKey?l=n.index+1:(c===a.prevKey||c===o?.prevKey)&&(l=n.index-1)}this.children[l]?.focus()},Se(this.elem,"role",t),this.orientation=e}get orientation(){return ta(this.elem,"aria-orientation")??"both"}set orientation(e){Se(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,n=t===e.index;for(let s=0;sthis.getElement().step=t.attributeValue,n=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:i,onKeyUp:n,onBlur:n},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return ta(this.elem,"aria-orientation")??"both"}set orientation(t){Se(this.elem,"aria-orientation",t==="both"?void 0:t),vh.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const n=this.getValueRatio(),s=te(t,n,i);return s!==n&&this.setValueRatio(s),s}setValueRatio(t,i){const{divider:n}=this.step,s=Math.round(t*1e4)/n,{ariaValueText:r=qv(s/n)}=i??{},a=this.getElement();a.value=`${s}`,a.ariaValueText=r,a.ariaValueNow=`${s}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",vh.onKeyDown):t.addListener("keydown",vh.onKeyDown)}static onKeyDown(t,i){let n=[];const{orientation:s}=i;s==="horizontal"?n=["ArrowUp","ArrowDown"]:s==="vertical"&&(n=["ArrowLeft","ArrowRight"]),n.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};Fm.STEP_ONE={attributeValue:"1",divider:1},Fm.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Vm=Fm,YO=class extends kd{constructor(){super(),Se(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){Se(this.elem,"aria-checked",e)}},Ld=class extends Pm{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function cl(e,t){return t.params?.type===e}function ZO(e){if(e==="button")return new kd;if(e==="slider")return new Vm;if(e==="toolbar")return new Ld;if(e==="group")return new MM;if(e==="list")return new KO;if(e==="region")return new ll(me("div"));if(e==="text")return new UO;if(e==="listswitch")return new YO;throw new Error("AG Charts - error allocating meta")}function IM(e){const t={params:e,result:void 0};return t.result=ZO(t.params.type),t}var XO=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new tt}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=IM(e),{params:i,result:n}=t,s=n.getElement();this.domManager.addChild("canvas-proxy",i.domManagerId,s),s.classList.add(...i.classList,"ag-charts-proxy-container"),s.role=i.role??i.type,cl("toolbar",t)&&(t.result.orientation=t.params.orientation);const{ariaLabel:r}=i;return r&&this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(r.id,r.params)}),n}createProxyElement(e){const t=IM(e);if(cl("button",t)){const{params:i,result:n}=t,s=n.getElement();if(this.initInteract(i,n),typeof i.textContent=="string")s.textContent=i.textContent;else{const{textContent:r}=i;this.addLocalisation(()=>{s.textContent=this.localeManager.t(r.id,r.params)})}this.setParent(t.params,t.result)}if(cl("slider",t)){const{params:i,result:n}=t,s=n.getElement();this.initInteract(i,n),s.type="range",s.role=i.role??"presentation",s.style.margin="0px",this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(t.params,t.result)}if(cl("text",t)){const{params:i,result:n}=t;this.initElement(i,n),this.setParent(t.params,t.result)}if(cl("listswitch",t)){const{params:i,result:n}=t;this.initInteract(i,n),n.setTextContent(i.textContent),n.setChecked(i.ariaChecked),n.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(cl("region",t)){const{params:i,result:n}=t,s=n.getElement();this.initInteract(i,n),s.role=i.role??"region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return On(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:n}=e,s=this.initElement(e,t);i!==void 0&&(s.tabIndex=i),n!==void 0&&(t.domIndex=n)}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)}}}},DM={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",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",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]"},qO=/\$\{(\w+)}(?:\[(\w+)])?/gi,_m={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"})},JO=({defaultValue:e,variables:t})=>e?.replaceAll(qO,(i,n,s)=>{const r=t[n],a=s==null?null:_m[s];return s!=null&&a==null&&z.warnOnce(`Format style [${s}] is not supported`),a!=null?a.format(r):typeof r=="number"?_m.number.format(r):r instanceof Date?_m.datetime.format(r):String(r)}),QO=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=DM,getLocaleText:n}=this,s=i[e];return String(n?.({key:e,defaultValue:s,variables:t})??JO({key:e,defaultValue:s,variables:t})??e)}},eE=class{constructor(e){this.width=600,this.height=300,this.direction="ltr";const{width:t,height:i,willReadFrequently:n=!1}=e;this.element=e.canvasElement,this.pixelRatio=e.pixelRatio,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.context.direction=this.direction,this.resize(t??0,i??0,this.pixelRatio),f0(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:n,context:s}=this;n.width=Math.round(e*i),n.height=Math.round(t*i),s.setTransform(i,0,0,i,0,0),n.style.width=e+"px",n.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}setDirection(e){this.direction=e?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){g0(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?.(),this.context.direction=this.direction}},tE=class extends xs{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 n={image:void 0,nodes:new Set([t])},s=vb(),r=new s;return this.imageLoadingCount++,r.onload=()=>{n.image=r;for(const a of n.nodes)a.markDirty();n.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},r.onerror=()=>{this.imageLoadingCount--,n.nodes.clear(),this.emit("image-error",{uri:e})},r.src=e,this.cache.set(e,n),n.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const e of this.cache.values())e.nodes.clear();this.cache.clear()}},iE=class{constructor(e){this.canvas=e,this.debug=he.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:n}of this.layersMap.values())n.resize(e,t,i)}addLayer(e){const{width:t,height:i,pixelRatio:n}=this.canvas,{name:s}=e,r=new Af({width:t,height:i,pixelRatio:n});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}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()}},Td=class extends xs{constructor(e){super(),this.debug=he.create(!0,"scene"),this.id=Rn(this),this.imageLoader=new tE,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new tt,this.updateDebugFlags(),this.canvas=new eE(e),this.layersManager=new iE(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{z.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}get isRtl(){return this.direction==="rtl"}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(){he.inDevelopmentMode(()=>Ns._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){yx(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}setDirection(e){this.direction=e?"rtl":"ltr",this.canvas.setDirection(e)}updateBaseFont(){const e=this.root?.resolveFont();e!=null&&e!==this._baseFont&&(this._baseFont=e,this.canvas.context.font=e)}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._baseFont!=null&&(this.canvas.context.font=this._baseFont),!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:n,debugColors:s}=e??{},{canvas:r,canvas:{context:a}={},root:o,width:l,height:c,pixelRatio:h}=this;if(!a)return;const u=he.check("scene:stats","scene:stats:verbose");u&&this.ensureDebugStatsRegistration();const d=performance.now(),p=this.applyPendingResize();if(o&&!o.visible){this.isDirty=!1;return}let g;if(o instanceof ae&&(g=o.dirty),o!=null&&g===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:nd(o,"console")}),u&&_0(this.layersManager,t,a,void 0,i,n,s);return}const f={ctx:a,direction:this.direction,width:l,height:c,devicePixelRatio:h,debugNodes:{}};he.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),wT(f);let m=!1;if((g!==!1||p)&&(m=!0,r.clear()),o&&he.check("scene:dirtyTree")){const{dirtyTree:y,paths:b}=B0(o);he.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:y,paths:b})}if(o&&m){if(o.visible&&o.preRender(f),this.debug.check()){const y=nd(o,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:y})}if(o.visible)try{a.save(),o.render(f),a.restore()}catch(y){throw this.canvas.reset(),y}}t["\u270D\uFE0F"]=performance.now()-d,a.verifyDepthZero?.(),this.isDirty=!1,u&&_0(this.layersManager,t,a,f.stats,i,n,s),kT(a,f.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:nd(o,"console"),canvasCleared:m})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const e=DT(),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 Ns.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(),G0(),Object.assign(this,{canvas:void 0})}};Td.className="Scene";var nE=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||le(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(n=>{const s=this.getAnnotationTypeStyles(n.type);return xe(n,s)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Ee([...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}},sE=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new ae({name:"Axes-Grids",zIndex:2}),this.axisGroup=new ae({name:"Axes",zIndex:3}),this.axisLabelGroup=new ae({name:"Axes-Labels",zIndex:15}),this.axisCrosslineRangeGroup=new ae({name:"Axes-Crosslines-Range",zIndex:6}),this.axisCrosslineLineGroup=new ae({name:"Axes-Crosslines-Line",zIndex:10}),this.axisCrosslineLabelGroup=new ae({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 n of e)t.includes(n)||(n.detachAxis(i),n.destroy());for(const n of t)e?.includes(n)||n.attachAxis(i);this.axes.clear();for(const n of t){const s=n.createAxisContext();this.axes.has(s.direction)?this.axes.get(s.direction)?.push(s):this.axes.set(s.direction,[s])}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()}},Bm=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=he.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,n=await i;return{params:t,data:n}}restoreData(e){this.pendingData=e}createThrottledFetch(e){return Op(t=>this.fetch(t).catch(i=>z.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return Op((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(),n=this.requestCounter++;this.debug(`DataService - requesting | ${n}`);let s;try{s=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-i}ms | ${n}`)}catch(a){this.debug(`DataService - request failed | ${n}`),z.errorOnce(`DataService - request failed | [${a}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.indexOf(t);return r===-1||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${n}`),s):(this.freshRequests=this.freshRequests.slice(r+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(n,s):this.eventsHub.emit("data:error",null),s)});this.latestRequest={params:e,fetchRequest:t},this.freshRequests.push(t),await t}};v([_t({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],Bm.prototype,"dispatchThrottle",2),v([_t({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],Bm.prototype,"requestThrottle",2);var rE=class{constructor(e,t){this.domManager=e,this.eventsHub=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(r=>encodeURIComponent(r)),i=":wght@100;200;300;400;500;600;700;800;900",n=`${i}&family=`,s=`@import url('https://fonts.googleapis.com/css2?family=${t.join(n)}${i}&display=swap'); `;this.domManager.addStyles(`google-font-${t.join("-")}`,s)}observeFontStatus(e){const t=xb();if(t===void 0)return;const n=this.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:e,fontSize:"16px",whiteSpace:"nowrap"});n.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,n);const s=new t(r=>{const a=r?.at(0)?.contentBoxSize.at(0)?.inlineSize;a!=null&&a>0&&(bi.clear(),this.eventsHub.emit("font:load",null))});s.observe(n),this.observers.push(s)}},CM={activeItem:{type:X(Vp()("series-node","legend")),seriesId:O,itemId:X(ne(O,w))},frozen:L},Uc={mode:J(F("integrated","standalone")),withinStudio:J(L),container:Rp,context:()=>!0,theme:pe,series:qn,annotations:pe,navigator:pe,scrollbar:pe,initialState:{active:CM,chartType:O,annotations:pe,legend:Et({visible:L,seriesId:O,itemId:O,legendItemName:O},"legend state array"),zoom:pe}},aE={...se,...Uc,axes:Qs,data:qn,dataIdKey:O},oE={...se,...Uc,axes:Qs,data:qn,dataIdKey:O},lE={...se,...Uc,data:qn,dataIdKey:O,topology:nx},cE={...se,...Uc,data:qn,dataIdKey:O},hE=class{constructor(e,t,i,n,s){this.chartService=e,this.eventsHub=t,this.interactionManager=n,this.fireEvent=s,this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0;const r=i.addListener("pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:a}=this;a&&(this.restoreMemento(a.version,a.mementoVersion,a.memento),this.pendingMemento=void 0),r()})}isFrozen(){return this.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(e,t){return this.performUpdate("user-interaction",e,t,!1)}performUpdate(e,t,i,n){if(!this.updateable)return!1;const s=this.currentItem;let r=!1;if(n||!yt(s,t)){const{frozen:a,activeItem:o}=this.createMementoWithItem(t),{datum:l}=i??{};this.fireEvent({type:"activeChange",source:e,frozen:a,activeItem:o,datum:l,dataIdKey:i?.series.data?.dataIdKey,preventDefault:()=>{r=!0}})}return r||(this.currentItem=t,this.eventsHub.emit("active:update",t)),r}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(e){const t=this.isFrozen();switch(e?.type){case"series-node":case"legend":{const{type:i,seriesId:n,itemId:s}=e;return{frozen:t,activeItem:{type:i,seriesId:n,itemId:s}}}default:return e?.type,{frozen:t}}}guardMemento(e,t){if(e==null)return!0;const i=Vt(e,Uc.initialState.active);return t.push(...i.invalid.map(n=>n.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[n,s]=this.performRestoration(i?.activeItem);this.updateable=!0;const r=this.isFrozen(),a=i?.frozen,o=a===void 0?!1:r!==a;a===!0?this.interactionManager.pushState(1):a===!1&&this.interactionManager.popState(1),this.performUpdate("state-change",n,s,o)}performRestoration(e){let t=!1;const i=()=>t=!0;let n;const s=o=>n=o,r=this.pendingMemento!==void 0,a=this.chartService.id;return this.eventsHub.emit("active:load-memento",{initialState:r,chartId:a,activeItem:e,reject:i,setDatum:s}),t?[void 0,void 0]:[e,n]}},AM=class{constructor(e){this.maxAnimationTime=e,this.debug=he.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Nc.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(Nc[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(Nc.indexOf(e.phase)=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=Nc[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Oc[c]}};let{phase:n,phaseControllers:s,phaseMeta:r}=i();const a=()=>Nc[this.currentPhase]==null,o=()=>{for({phase:n,phaseControllers:s,phaseMeta:r}=i();!a()&&s.length===0;)this.currentPhase++,{phase:n,phaseControllers:s,phaseMeta:r}=i(),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:t},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${n} with ${s?.length} of ${l}`);do{const c=t,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of s)h?d.stop():t=Math.min(d.update(c),t),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${s.length} controllers; ${u} completed`,s),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),o()}while(t>0&&!a());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&&Oc[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){z.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,n]of this.phases)n.length!==0&&(e!=null&&e!==i||(t+=Math.max(...n.map(s=>s.isComplete?0:s.delay+s.duration-(s.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}};function wM(e){return e==null?!0:!Number.isNaN(e)&&e>=0&&e<=2}var uE=class{constructor(e,t,i){this.agDocument=e,this.interactionManager=t,this.chartUpdateMutex=i,this.defaultDuration=1e3,this.maxAnimatableItems=XS,this.batch=new AM(this.defaultDuration*1.5),this.debug=he.create(!0,"animation"),this.events=new xs,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(o){this.failsafeOnError(o);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const n=this.isSkipped()&&!e.forceAnimation||e.phase==="none";n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:r}=e;if(!wM(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);if(!wM(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const a=new JT({...e,id:i,skip:n,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(a,this.defaultDuration))return this.batch.addAnimation(a),a}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=this.agDocument.requestAnimationFrame(t=>{e(t).catch(i=>z.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 n=()=>{const s=i-(e??i);e=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:s}),this.interactionManager.pushState(4);try{this.batch.progress(s),this.cumulativeAnimationTime+=s}catch(r){this.failsafeOnError(r)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:s})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(n):await this.chartUpdateMutex.acquire(n),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&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){z.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 AM(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()}},dE=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}}},pE=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},gE=class{constructor(){this.items=new dE,this.lists=new pE}},kM=class{constructor(e){this.eventsHub=e,this.builtins=new gE,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,n){const{widgetEvent:s}=t;if(s.sourceEvent.defaultPrevented)return;const r=n?.x??t.canvasX,a=n?.y??t.canvasY,o={showOn:e,x:r,y:a,context:i,widgetEvent:s};this.eventsHub.emit("context-menu:setup",o),this.eventsHub.emit("context-menu:complete",o)}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}}},LM=class rA{constructor(t){this.eventsHub=t,this.highlightStates=new Dd,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(t,i,n=!1,s){const r=this.getActiveHighlight();if(i==null&&n&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(t)){const o=Lm(()=>{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,r,s)}maybeEmitChange(t,i,n){const s=n??!0,r=this.getActiveHighlight();if(!this.isEqual(r,i)||this.highlightInViewport!==s){const a=r?.series?.isHighlightEnabled()===!1;this.highlightInViewport=s,this.eventsHub.emit(rA.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:r,previousHighlight:i,highlightSuppressed:a,highlightInViewport:s})}}applyPendingUnhighlight(t){if(!this.pendingUnhighlights.has(t))return;this.pendingUnhighlights.delete(t);const i=this.getActiveHighlight();this.highlightStates.delete(t),this.maybeEmitChange(t,i,!0)}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?!0:t!=null&&i!=null&&t.series===i.series&&this.idsMatch(t,i)&&this.pointsMatch(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&&yt(t.datumIndex,i.datumIndex)}pointsMatch(t,i){return this.pointsAreEqual(t.point,i.point)&&this.pointsAreEqual(t.midPoint,i.midPoint)&&this.pointsAreEqual(t.xBar?.lowerPoint,i.xBar?.lowerPoint)&&this.pointsAreEqual(t.xBar?.upperPoint,i.xBar?.upperPoint)&&this.pointsAreEqual(t.yBar?.lowerPoint,i.yBar?.lowerPoint)&&this.pointsAreEqual(t.yBar?.upperPoint,i.yBar?.upperPoint)}pointsAreEqual(t,i){return t===i||t!==void 0&&i!==void 0&&t.x===i.x&&t.y===i.y}};LM.HIGHLIGHT_CHANGE_EVENT="highlight:change";var TM=LM,Nd=class{constructor(e,t,i,n){this.domManager=i,this.tooltip=n,this.stateTracker=new Dd,this.suppressState=new Dd(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new tt,this.cleanup.register(n.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,n){const s=this.pendingRemovals.get(e);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(e)),i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:n}),this.applyStates()}removeTooltip(e,t,i=!1){if(i&&this.removeDelay>0){const s=this.pendingRemovals.get(e);if(s){t&&(s.lastMeta=t);return}const r=Lm(()=>{this.applyPendingRemoval(e)});this.pendingRemovals.set(e,{scheduler:r,lastMeta:t}),r.schedule(this.removeDelay);return}const n=this.pendingRemovals.get(e);n&&(n.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(),n=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(yt(this.appliedState?.content,t?.content)&&yt(this.appliedState?.pagination,t?.pagination)){const s=this.tooltip.isVisible();this.tooltip.show(n,i,t?.meta,null,void 0,s)}else this.tooltip.show(n,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,n){const{canvasX:s,canvasY:r}=e,a=t.properties.tooltip,{placement:o,anchorTo:l,xOffset:c,yOffset:h}=a.position,u=vm(t,i,n);return{canvasX:s,canvasY:r,nodeCanvasX:u?.canvasX??s,nodeCanvasY:u?.canvasY??r,enableInteraction:a.interaction?.enabled??!1,showArrow:a.showArrow,position:{placement:o,anchorTo:l,xOffset:c,yOffset:h}}}},NM=3,fE=505,OM=30;function zm(e,t){const{device:i,offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:c}=t;return{type:e,device:i,offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:c}}function EM(e,t){const i=e*e+t*t,n=NM*NM;return i>=n}function mE(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY,s=i*i+n*n,r=OM*OM;return s(e[e.None=0]="None",e[e.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",e[e.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",e))(RM||{});function Rr(e,t,i,n,s){return t+(n-t)*((s-e)/(i-e))}function PM(e,t,i,n,s){return e+(s-t)*((i-e)/(n-t))}function FM(e,t,i){return[PM(e,i.min,t,i.max,0),PM(e,i.min,t,i.max,1)]}function vE(e,t,i){const[n,s]=FM(e.x1,e.x2,t),[r,a]=FM(e.y1,e.y2,i);return{x1:n,x2:s,y1:r,y2:a}}function VM(e,t){const i=t.width>e.width,n=t.height>e.height;return{x:i,y:n}}function _M(e,t,i,n,s,r){if(i<=s&&r<=n)return i;const a=s-i,o=r-n,l=Math.abs(a)fe((t,{options:i})=>!Re.is(e?.scale)&&!Vs.is(e?.scale)||t==null||i.end==null?!0:t1)&&(z.warnOnce(`Attempted to update axis (${t}) zoom to an invalid ratio of [{ min: ${n}, max: ${s} }], expecting a ratio of 0 to 1. Ignoring.`),delete e[t])}}function zM(e,t){const i={};for(const{id:n,direction:s}of e){const{min:r,max:a}=t[n]??{min:0,max:1};i[n]={min:r,max:a,direction:s}}return i}function GM(e,t){const i=Ms(e),n=Ms(t);if(i.length!==n.length)return!1;for(const s of i)if(!n.includes(s))return!1;for(const s of i){const r=e[s],a=t[s];if(r!==a&&(r==null||a==null||r.direction!==a.direction||r.min!==a.min||r.max!==a.max))return!1}return!0}function AE(e){return{source:"user-interaction",sourceDetail:e}}var jM=class extends Tm{constructor(e,t,i){super(),this.eventsHub=e,this.fireChartEvent=i,this.mementoOriginatorKey="zoom",this.state={},this.axes=[],this.didLayoutAxes=!1,this.lastRestoredState={},this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=he.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(e.on("zoom:change-request",n=>{this.constrainZoomToRequiredWidth(n)}),t.addListener("pre-series-update",({requiredRangeRatio:n,requiredRangeDirection:s,requiredRange:r})=>{this.didLayoutAxes=!0;const{pendingMemento:a}=this;a?this.restoreMemento(a.version,a.mementoVersion,a.memento):this.restoreRequiredRange(n,s,r),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),t.addListener("update-complete",({wasShortcut:n})=>{if(!n&&this.pendingZoomEventSource){const s=this.pendingZoomEventSource;this.fireChartEvent({type:"zoom",source:s,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}toCoreZoomState(e){const t={};let i;const{state:n}=this;if(this.independentAxes){const s=this.getPrimaryAxisId("x"),r=this.getPrimaryAxisId("y");i=[],s&&i.push(s),r&&i.push(r)}else i=Ms(n);for(const s of i){const{direction:r}=n[s]??{};if(r!=null){const a=e[r];if(a){const{min:o,max:l}=a;t[s]={min:o,max:l,direction:r}}}}return t}toZoomState(e){let t,i;for(const n of Ms(e)){const{min:s,max:r,direction:a}=e[n];a==="x"?t??(t={min:s,max:r}):a==="y"&&(i??(i={min:s,max:r}))}if(t||i)return{x:t,y:i}}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!oe(e))return!1;const i=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y"),s={rangeX:{start:BM(i),end:pe},rangeY:{start:BM(n),end:pe},ratioX:{start:pe,end:pe},ratioY:{start:pe,end:pe},autoScaledAxes:pe},{invalid:r}=Vt(e,s);return r.length>0?(t.push(...r.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 n=xc(this.getZoom());i?.rangeX?n.x=this.rangeToRatioDirection("x",i.rangeX)??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1};const{navigatorModule:s,zoomModule:r}=this;this.eventsHub.emit("zoom:load-memento",{zoom:n,memento:i,navigatorModule:s,zoomModule:r});const a=this.toCoreZoomState(n);this.lastRestoredState=wi(Ee(a)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:a,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 s of e)"range"in s&&t.push(s);const i=this.state,n=zM(e,i);this.state=n,this.lastRestoredState=zM(e,this.lastRestoredState),this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:n,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 n=this.toCoreZoomState(i??{});return this.updateChanges({source:e,sourceDetail:t,changes:n,isReset:!1})}computeChangedAxesIds(e){const t=[],i=this.state;for(const n of Ms(e)){const s=e[n]??{min:0,max:1},r=i[n];(r==null||r.min!==s.min||r.max!==s.max)&&t.push(n)}return t}updateChanges(e){const{source:t,sourceDetail:i,isReset:n,changes:s}=e;CE(s);const r=this.computeChangedAxesIds(s),a=Ee(this.state),o=Ee(this.state);for(const l of r){const c=o[l];c!=null&&(c.min=s[l]?.min??0,c.max=s[l]?.max??1)}return this.state=o,this.dispatch(t,i,r,n,a)}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;const{panToBBoxScalingMode:n}=this;if(!(e.width>0&&e.height>0&&(n!==0||Math.abs(t.width)<=Math.abs(e.width)&&Math.abs(t.height)<=Math.abs(e.height))))return z.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=SE(n,e,i,t),a=this.toCoreZoomState(r);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:a,isReset:!1})}fireZoomPanStartEvent(e){this.eventsHub.emit("zoom:pan-start",{callerId:e})}updateWith({source:e,sourceDetail:t},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const r=s.scale.getDomainMinMax();if(!r)return;const[a,o]=s.visibleRange,l=this.getRange(s.id,{min:a,max:o});if(!l)return;const[c,h]=r,{start:u,end:d}=l,p=n(c,h,u,d,e);if(!this.isValidUpdateWithResult(p)){this.resetZoom({source:e,sourceDetail:t});return}const[g,f]=p,m=this.rangeToRatioAxis(s,{start:g,end:f});m&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:m},isReset:!1})}isValidUpdateWith(e,t,i){const n=this.getPrimaryAxis(e);if(!n)return!0;const s=n.scale.getDomainMinMax();if(!s)return!0;const[r,a]=n.visibleRange,o=this.getRange(n.id,{min:r,max:a});if(!o)return!0;const[l,c]=s,{start:h,end:u}=o,d=t(l,c,h,u,i);if(!this.isValidUpdateWithResult(d))return!0;const[p,g]=d;let f=!0;return p!=null&&f&&(f=p>=l),g!=null&&f&&(f=g<=c),p!=null&&g!=null&&f&&(f=p<=g),f}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 n=new Set(e?.boundSeries??[]),s=new Set(t?.boundSeries??[]);i=new Set;for(const r of n)s.has(r)&&i.add(r)}else i=new Set([...e?.boundSeries??[],...t?.boundSeries??[]]);return i}constrainZoomToItemCount(e,t,i){let n=[e.x.min,e.x.max],s=i?void 0:[e.y.min,e.y.max];for(const o of this.getBoundSeries()){const l=o.getZoomRangeFittingItems(n,s,t);l!=null&&(n=l.x,s=l.y)}const r={min:n[0],max:n[1]},a=s?{min:s[0],max:s[1]}:void 0;return xc({x:r,y:a})}isVisibleItemsCountAtLeast(e,t,i){const n=this.getBoundSeries(),s=[e.x.min,e.x.max],r=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[e.y.min,e.y.max];let a=0;for(const o of n){const l=t-(a??0),c=o.getVisibleItems(s,r,l);if(a+=c,a>=t)return!0}return n.size===0}getMementoRanges(){const e=xc(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,i){const{lastRestoredRequiredRange:n,lastRestoredRequiredRangeDirection:s}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0),this.restoreRequiredRangeIterations+=1;const r=t!=="x"&&t!=="y",a=s===t&&n===e,o=e===0&&(n==null||n===0);if(r||a||o||this.restoreRequiredRangeIterations>1){this.restoreRequiredRangeIterations=0;return}const l=this.getPrimaryAxisId(t);if(!l)return;const c=this.getAxisZoom(l),h=Math.min(1,1/e);let u=0,d=1;t==="x"?(u=te(0,1-h,c.min),d=te(0,u+h,1)):(d=Math.min(1,c.max),u=d-h,u<0&&(d-=u,u=0),u=te(0,u,1),d=te(0,d,1)),this.lastRestoredRequiredRange=e,this.lastRestoredRequiredRangeDirection=t;const p={[t]:{min:u,max:d}},g=this.toCoreZoomState(p);this.lastRestoredState=wi(Ee(g)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:g,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 n=e.stateAsDefinedZoom(),s=e.oldState[i],r=n[t].max-n[t].min,a=1/this.lastRestoredRequiredRange;Math.abs(r-a)<1e-12||r<=a||e.constrainZoom({...n,[t]:{min:s.min,max:s.min+a}})}dispatch(e,t,i,n,s){const{x:r,y:a}=this.getZoom()??{},o=this.state;let l;const c=this.debug,h=this,u={source:e,sourceDetail:t,isReset:n,changedAxes:i,state:o,oldState:s,x:r,y:a,stateAsDefinedZoom(){return xc(h.toZoomState(u.state))},constrainZoom(p){this.constrainChanges(h.toCoreZoomState(p))},constrainChanges(p){c.check()&&c("ZoomManager.constrainChanges()",o,"->",p,new Error().stack),l??(l=Ee(o));for(const g of Ms(p)){const f=p[g],m=l[g];f&&m&&(m.min=f.min,m.max=f.max)}u.state=l}};this.eventsHub.emit("zoom:change-request",u),l&&!GM(o,l)&&(this.state=l);const d=!GM(s,this.state);if(d){const p=this.getZoom()??{};this.eventsHub.emit("zoom:change-complete",{source:e,sourceDetail:t,x:p.x}),this.pendingZoomEventSource=e}return d}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)return;const i=this.getDomainPixelExtents(e);if(!i)return;const[n,s]=i;let r,a;return n<=s?(r=e.scale.invert(0,!0),a=e.scale.invert(n+(s-n)*t.max,!0)):(r=e.scale.invert(n-(n-s)*t.min,!0),a=e.scale.invert(0,!0)),{start:r,end:a}}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[n,s]=i,{scale:r}=e,{start:a,end:o}=t,[l=0,c=1]=mS(a,o);let h=a==null?n:r.convert(a,{alignment:l,alignmentExclusive:!0}),u=o==null?s:r.convert(o,{alignment:c,alignmentExclusive:!0})+(r.bandwidth??0);if(!Pe(h)||!Pe(u))return;const[d,p]=[Math.min(n,s),Math.max(n,s)];h=te(d,h,p),u=te(d,u,p);const g=s-n;if(g===0)return;const f=Math.abs((h-n)/g),m=Math.abs((u-n)/g);if(!(f>=m))return{min:f,max:m}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainPixelExtents(e){const[t,i]=e.scale.range;if(!(!Pe(t)||!Pe(i)))return[t,i]}isValidUpdateWithResult(e){return e==null||!Array.isArray(e)||e.length<1?!1:e.every(t=>t==null||typeof t=="number"||Fl(t))}},wE=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=U.zero){const n={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},s=new Set(e.map(a=>a.id));for(const a of this.labelData.keys())s.has(a)||this.labelData.delete(a);for(const a of e){const o=a.getLabelData();o.every(jx)&&this.labelData.set(a.id,o)}const r=Hx(this.labelData,n,5);for(const a of e)a.updatePlacedLabelData?.(r.get(a.id)??[])}},kE=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:n})=>({visible:e,seriesId:t,itemId:i,legendItemName:n}))}guardMemento(e){return e==null||le(e)}restoreMemento(e,t,i){if(i)for(const n of i){const{seriesId:s,data:r}=this.getRestoredData(n)??{};!s||!r||this.updateData(s,r)}this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:n,visible:s}=e;if(t){const a=(this.legendDataMap.get(t)??[]).map(o=>{const l=o.seriesId===t&&(!i||o.itemId===i);return l&&o.isFixed&&this.warnFixed(o.seriesId,o.itemId),!o.isFixed&&l?{...o,enabled:s}:o});return{seriesId:t,data:a}}if(!(i==null&&n==null))for(const r of this.getData()){if(i!=null&&r.itemId!==i||n!=null&&r.legendItemName!==n)continue;if(r.isFixed){this.warnFixed(r.seriesId,i);return}const a=(this.legendDataMap.get(r.seriesId)??[]).map(o=>o.itemId===i||o.legendItemName===n?{...o,enabled:s}:o);return{seriesId:r.seriesId,data:a}}}warnFixed(e,t){z.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,n){if(n){for(const o of this.getData()){const l=(this.legendDataMap.get(o.seriesId)??[]).map(c=>c.legendItemName===n?{...c,enabled:e}:c);this.updateData(o.seriesId,l)}return}const s=this.getData(t),r=s.length===1,a=s.map(o=>i==null&&r||o.itemId===i?{...o,enabled:e}:o);this.updateData(t,a)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,n])=>t.concat(n),[])}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}},LE=class{updateCallback(e){this.resolvePartialCallback=e}resolvePartial(e,t,i){return this.resolvePartialCallback?.(e,t,i)}},TE=class extends Fn{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}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}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:n,_paddingInnerWidth:s}=this;let r=n;const a=e.split("-"),o=Number(a[0]);if(!this._hasFixedWidth)return super.convert(o);for(let l=0;l0&&h>=0?h/r:o/n,p=d;a===n&&h>0&&(u+=h/2),this.round&&Math.floor(p)>0&&(u=Math.round(u),p=Math.round(p)),h<0&&(d=0,p=0),this._inset=u,this._bandwidth=p,this._rawBandwidth=d,this._paddingInnerWidth=l}normalizeDomains(...e){return{domain:[],animatable:!1}}toDomain(e){}},NE=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,width:n,type:s}){if(!t)return;let r=this.groups.get(s);r==null&&(r=new Map,this.groups.set(s,r)),r.set(e,{grouping:t,visible:i,width:n})}updateSeries({internalId:e,seriesGrouping:t,visible:i,width:n,type:s}){if(!t)return;const r=this.groups.get(s)?.get(e);r&&(r.grouping=t,r.width=n,r.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 n=new Set,s=new Set,r=this.groups.get(e);for(const o of r?.values()??[])o.visible&&(n.add(o.grouping.groupIndex),o.grouping.groupIndex===t.groupIndex&&s.add(o.grouping.stackIndex));const a=Array.from(n);return a.sort((o,l)=>o-l),{visibleGroupCount:a.length,visibleSameStackCount:s.size,index:a.indexOf(t.groupIndex)}}updateGroupScale({type:e},t,i){const n=this.groupScales.get(e)??new TE;this.groupScales.set(e,n),n.domain=[];const s=this.groups.get(e);for(const r of s?.values()??[])r.visible&&n.addBand(r.grouping.groupIndex,r.grouping.stackIndex,r.width);n.domain.length===0&&n.addBand(0,0,void 0),n.range=[0,t],i.type==="grouped-category"?n.paddingInner=i.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(n.paddingInner=i.groupPaddingInner,n.round=n.padding!==0):n.padding=0,n.update()}getGroupScale({type:e}){return this.groupScales.get(e)}getGroupBandWidth(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const n=this.groups.get(e.type);if(!n)return i.bandwidth;let s=0;for(const r of n.values())r.visible&&r.grouping.groupIndex===t.groupIndex&&(s=Math.max(s,r.width??i.bandwidth));return s||i.bandwidth}getGroupOffset(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const n=i.getDomainValue(t.groupIndex,t.stackIndex);return i.convert(n)}getStackOffset(e,t){const{seriesGrouping:i}=e;if(!i)return 0;const n=this.groups.get(e.type);if(!n)return 0;const s=this.getGroupScale(e);if(!s||(i.stackCount??0)<1)return 0;let a=0;for(const o of n.values())o.visible&&o.grouping.groupIndex===i.groupIndex&&(a=Math.max(a,o.width??s.bandwidth));return a===0?0:a/2-t/2}getDatumOffset(e,t,i,n){const s=this.groups.get(e.type);if(!e.visible||!e.seriesGrouping||!s||t.get(e.internalId)?.[n]||i.get(e.internalId)?.[n])return 0;const r=new Set;for(const[d,p]of s)p.visible&&!t.get(d)?.[n]&&!i.get(d)?.[n]&&r.add(p.grouping.groupIndex);if(r.size===e.seriesGrouping?.groupCount)return 0;const a=this.groupScales.get(e.type),o=new Map,l=new Map;for(const[d,p]of s)d!==e.internalId&&p.visible&&(r.has(p.grouping.groupIndex)||(e.seriesGrouping.groupIndexp.grouping.groupIndex&&o.set(p.grouping.groupIndex,Math.max(p.width??a?.bandwidth??0,o.get(p.grouping.groupIndex)??0))));let c=0;for(const[,d]of l)c+=d;for(const[,d]of o)c-=d;c/=2;const h=(a?.paddingInnerWidth??0)/2,u=(l.size-o.size)*h;return c+u}},OE=class{constructor(){this.events=new xs}addListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}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,i){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:e,requiredRangeDirection:t,requiredRange:i})}dispatchPreSceneRender(e){this.events.emit("pre-scene-render",{type:"pre-scene-render",apiUpdate:e})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},EE=class{constructor(e,t){this.eventsHub=new xs,this.callbackCache=new Hv,this.highlightManager=new TM(this.eventsHub),this.formatManager=new Jo,this.layoutManager=new xT(this.eventsHub),this.localeManager=new QO(this.eventsHub),this.seriesStateManager=new NE,this.stateManager=new DO,this.seriesLabelLayoutManager=new wE,this.cleanup=new tt;const{scene:i,root:n,syncManager:s,agDocument:r,container:a,fireEvent:o,updateMutex:l,styleContainer:c,skipCss:h,chartType:u,domMode:d,withDragInterpretation:p}=t;this.chartService=e,this.syncManager=s,this.agDocument=r,this.domManager=new bM(this.eventsHub,this.chartService,this.agDocument,a,c,h,d),this.widgets=new bE(this.domManager,{withDragInterpretation:p});const g=this.agDocument.window,f=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Td({canvasElement:f,pixelRatio:g.devicePixelRatio??1}),this.scene.setRoot(n),this.axisManager=new sE(this.eventsHub,n),this.legendManager=new kE(this.eventsHub),this.annotationManager=new nE(this.eventsHub,e.annotationRoot,o),this.chartTypeOriginator=new MO(e),this.interactionManager=new V0,this.contextMenuRegistry=new kM(this.eventsHub),this.optionsGraphService=new LE,this.updateService=new OE,this.activeManager=new hE(this.chartService,this.eventsHub,this.updateService,this.interactionManager,o),this.proxyInteractionService=new XO(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new rE(this.domManager,this.eventsHub),this.historyManager=new IO(this.eventsHub),this.animationManager=new uE(this.agDocument,this.interactionManager,l),this.dataService=new Bm(this.eventsHub,e,this.animationManager),this.tooltipManager=new Nd(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new jM(this.eventsHub,this.updateService,o);for(const m of ee.listModulesByType("plugin"))(!m.chartType||m.chartType===u)&&m.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()}},Ed=class extends ce{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.drawingMode="cutout"}};v([S],Ed.prototype,"enabled",2),v([S],Ed.prototype,"range",2),v([S],Ed.prototype,"drawingMode",2);function RE(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function PE(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,n]of e){const s=t.get(i);if(s==null||!RE(n,s))return!1}return!0}function FE(e,t){if(e.length!==t.length)return!1;for(let i=0;it.type==="key").map(t=>t.property).join(";")}var jm=class vn{constructor(t,i,n){this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=he.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,i,n){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,r)=>{this.requested.push({id:t,opts:n,dataSet:i,resolve:s,reject:r})})}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 o of this.requested)o.dataSet.hasPendingTransactions()&&i.set(o.dataSet,o.dataSet.getChangeDescription()),o.dataSet.commitPendingTransactions();this.debug("DataController.execute() - requested",this.requested);const n=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",n);const s=this.mergeRequested(n);this.debug("DataController.execute() - merged",s),this.debug.check()&&(Wn().processedData=[]);const r=[];for(const{dataSet:o,ids:l,opts:c,resolves:h,rejects:u}of s){let d=function(x){return _E(x,o,l,c)};var a=d;const p=t?.find(d),g=(x,M)=>{if(this.debug.check()&&Wn("processedData").push(M),M==null){for(const I of u)I(new Error("AG Charts - no processed data generated"));return}r.push({opts:c,dataSet:o,dataLength:o.data.length,ids:l,dataModel:x,processedData:M});for(const I of h)I({dataModel:x,processedData:M})},f=()=>{try{const x=new pm(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(n.map(C=>[C.id,C.dataSet])),I=x.processData(M);return g(x,I),x}catch(x){for(const M of u)M(x)}};if(p==null){f();continue}const{dataModel:m,processedData:y}=p,b=i.get(o);if(y&&b&&m.isReprocessingSupported(y)){if(this.debug("DataController.execute() - reprocessing data",y,o),m.reprocessData(y,i),he.check("data-model:reprocess-diff")){const x=new pm(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(n.map(k=>[k.id,k.dataSet])),I=x.processData(M),C=JSON.parse(JSON.stringify(y,vn.jsonReplacer)),D=JSON.parse(JSON.stringify(I,vn.jsonReplacer));delete C.time,delete C.optimizations,delete D.time,delete D.optimizations;const A=ss(D,C);A?(z.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),z.log("Difference between incremental update and full reprocess:"),z.log(""),z.log("BASELINE (full reprocess):"),z.log(JSON.stringify(D,null,2)),z.log(""),z.log("REPROCESSED (incremental update):"),z.log(JSON.stringify(C,null,2)),z.log(""),z.log("DIFF (what changed):"),z.log(JSON.stringify(A,null,2))):z.log("\u2705 Data-model reprocess matches baseline (no diff)")}g(m,y);continue}f()}return r}validateRequests(t){const i=[];for(const[n,s]of t.entries())n>0&&s.dataSet.data.length!==t[0].dataSet.data.length&&s.opts.groupByData===!1&&s.opts.groupByKeys===!1?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(s);return i}mergeRequested(t){const i=[];for(const n of t){const s=i.find(vn.groupMatch(n));s?s.push(n):i.push([n])}return i.map(vn.mergeRequests)}static groupMatch({dataSet:t,opts:i}){const{groupByData:n,groupByKeys:s=!1,groupByFn:r,props:a}=i,o=HM(a);return([l])=>(n===!1||l.dataSet===t)&&(l.opts.groupByKeys??!1)===s&&l.opts.groupByFn===r&&HM(l.opts.props)===o}static mergeRequests(t){const i={ids:[],rejects:[],resolves:[],dataSet:t[0].dataSet,opts:{...t[0].opts,props:[]}},n=new Map,s=new Map;let r=0;for(const a of t){const{id:o,dataSet:l,resolve:c,reject:h,opts:{props:u,...d}}=a;i.ids.push(o),i.rejects.push(h),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...d,props:[]});for(const p of u){const g={...p,scopes:[o],data:l.data};vn.createIdsMap(o,g);let f;vn.crossScopeMergableTypes.has(g.type)?f=-1:s.has(l.data)?f=s.get(l.data):(f=r++,s.set(l.data,f));const m=`${g.type}-${f}-${g.groupId}`,y=n.get(m),b=y?.find(x=>vn.deepEqual(x,g));if(y==null){i.opts.props.push(g),n.set(m,[g]);continue}else if(b==null){i.opts.props.push(g),y.push(g);continue}g.scopes!=null&&(b.scopes??(b.scopes=[]),b.scopes.push(...g.scopes)),(b.type==="key"||b.type==="value")&&g.idsMap?.size&&(b.idsMap??(b.idsMap=new Map),vn.mergeIdsMap(g.idsMap,b.idsMap))}}return i}static mergeIdsMap(t,i){for(const[n,s]of t){const r=i.get(n);if(r==null)i.set(n,new Set(s));else for(const a of s)r.add(a)}}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 n,s;if(Array.isArray(t)){if(s=t.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!vn.deepEqual(t[n],i[n]))return!1;return!0}const r=Object.keys(t);if(s=r.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const a=r[n];if(!vn.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!vn.deepEqual(t[a],i[a])))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}};jm.crossScopeMergableTypes=new Set(["key","group-value-processor"]),jm.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var $M=jm,Hm=class Ws{constructor(t){this.chart=t}subscribe(t=Ws.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},Ws.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=Ws.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=Ws.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=Ws.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=Ws.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=Ws.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return Ws.chartsGroups.get(t)}};Hm.chartsGroups=new Map,Hm.DEFAULT_GROUP=Symbol("sync-group-default");var BE=Hm,Rd=class extends ce{constructor(){super(...arguments),this.enabled=!1,this.initialFocus="data-start"}};v([S],Rd.prototype,"enabled",2),v([S],Rd.prototype,"tabIndex",2),v([S],Rd.prototype,"initialFocus",2);var UM=["right","top","left","bottom"];function zE(e){return typeof e=="string"&&UM.includes(e)}function GE(e){const t=[],i=[],n=[...UM];for(const s of e)s instanceof Rc&&(zE(s.position)?i.push(s.position):t.push(s));for(const s of t){let r;do r=n.pop();while(r&&i.includes(r));if(r==null)break;s.position=r}}var WM=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function jE(e,t,i){const n=new Map,s=u=>{if(u===void 0)return WM;if(n.has(u))return n.get(u);const d=ee.getSeriesModule(u)?.matchingKeys??WM;return n.set(u,d),d},r=(u,d,p)=>{const g=s(u),f=[u];for(const m of g)m in d&&d[m]!=null&&f.push(`${m}=${d[m]}`);return p?.seriesGrouping&&f.push(`seriesGrouping.groupId=${p?.seriesGrouping.groupId}`),f.join(";")},a=new Map;let o=0;for(const u of e){const d=r(u.type,u.properties,i?.[o]);a.has(d)||a.set(d,[]),a.get(d)?.push([u,o++])}const l=new Map;o=0;for(const u of t){const d=r(u.type,u,u);l.has(d)||l.set(d,[]),l.get(d)?.push([u,o++])}if(![...a.keys()].some(u=>l.has(u)))return{status:"no-overlap",oldKeys:a.keys(),newKeys:l.keys()};const h=[];for(const[u,d]of l.entries())for(const[p,g]of d){const f=a.get(u);if(f==null||f.length<1){h.push({opts:p,targetIdx:g,idx:g,status:"add"}),a.delete(u);continue}const[m,y]=f.shift(),b=i?.[y]??{},x=ss(b,p??{}),{groupIndex:M,stackIndex:I}=x?.seriesGrouping??{};M!=null||I!=null?h.push({opts:p,series:m,diff:x,targetIdx:g,idx:y,status:"series-grouping"}):x?h.push({opts:p,series:m,diff:x,targetIdx:g,idx:y,status:"update"}):h.push({opts:p,series:m,targetIdx:g,idx:y,status:"no-op"}),f.length===0&&a.delete(u)}for(const u of a.values())for(const[d,p]of u)h.push({series:d,idx:p,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}var Pr=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 HE(e){const t=Pr.get(e);return t?.type==="series"?t.chartType:void 0}function Wc(e){const t=e.series?.[0]?.type??"line";return ee.getSeriesModule(t)?.chartType??HE(t)??"unknown"}function $E(e){return Wc(e)==="cartesian"}var UE=class extends Yf{*legends(){for(const e of ee.listModulesByType("plugin"))(e.name==="legend"||e.name==="gradientLegend")&&(yield{legendType:e.name==="legend"?"category":"gradient",legend:this.getModule(e.name)})}},$m="ag-charts-overlay",WE="ag-charts-dark-overlay",La=class extends ce{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return le(this.text)?Xe(this.text):this.rendererAsText?this.rendererAsText:e.t(ft(this.text)||this.defaultMessageId)}getElement(e,t,i,n){if(this.content?.remove(),this.rendererAsText=void 0,this.focusBox=n,this.renderer){const s={},r=Nn(e,this.renderer,s);if(Nl(r))this.content=r;else{const a=me("div");a.innerHTML=r;const{firstElementChild:o}=a;Nl(o)&&a.childElementCount===1?this.content=o:this.content=a}this.rendererAsText=this.content?.textContent?.trim()}else{const s=me("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(le(this.text)){const r=me("div");for(const a of this.text){const o=me("span",{color:a.color,fontSize:`${a.fontSize}px`,fontFamily:a.fontFamily??"inherit",fontWeight:String(a.fontWeight),fontStyle:a.fontStyle});o.innerText=ft(a.text),r.appendChild(o)}s.appendChild(r)}else s.innerText=this.getText(i);this.content=s,this.content.classList.add(this.className),t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(r){s.style.opacity=String(r)},onStop(){s.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(n){i.style.opacity=String(n)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};v([S],La.prototype,"enabled",2),v([S],La.prototype,"text",2),v([S],La.prototype,"renderer",2);var hl=class extends ce{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new La("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new La("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new La("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new La("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()}};v([S],hl.prototype,"darkTheme",2),v([S],hl.prototype,"loading",2),v([S],hl.prototype,"noData",2),v([S],hl.prototype,"noVisibleSeries",2),v([S],hl.prototype,"unsupportedBrowser",2);function KE(e,t,i){const{animationDuration:n}=Oc.add,s=n*i,r=e.createElement("div",`${$m}--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=e.createElement("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=e.createElement("p",{marginTop:"1em"});o.innerText=t;const l=e.createElement("div",`${$m}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=e.createElement("style");return c.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(" "),r.replaceChildren(c,a,o,l),r}var Kc=class extends ce{constructor(e){super(),this.ctx=e,this.rectNode=new wt,this.border=new ia(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new tt,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 n=t+i;return{top:n,right:n,bottom:n,left:n}}return{top:(t.top??0)+i,right:(t.right??0)+i,bottom:(t.bottom??0)+i,left:(t.left??0)+i}}createNode(){return new ae({name:"series-area-container",zIndex:4})}onLayoutComplete(e){const{x:t,y:i,width:n,height:s}=e.series.paddedRect;this.rectNode.x=t,this.rectNode.y=i,this.rectNode.width=n,this.rectNode.height=s}};v([S],Kc.prototype,"border",2),v([S],Kc.prototype,"clip",2),v([ot("rectNode","cornerRadius"),S],Kc.prototype,"cornerRadius",2),v([S],Kc.prototype,"padding",2);var YE=class{constructor(e){this.swapChain=e,this.focusVisibleStyle=!1,this.div=me("div"),this.svg=lt("svg"),this.outerPath=lt("path"),this.innerPath=lt("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=me("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 At){const n=(r,a)=>{let{x:o,y:l}=Je.toCanvasPoint(e,r,a);return o-=t.x??0,l-=t.y??0,{x:o,y:l}},s=e.svgPathData(n);this.outerPath.setAttribute("d",s),this.innerPath.setAttribute("d",s),this.show(this.svg)}else{let n;if(i){const s=Math.max(e.x-t.x,0),r=Math.max(e.y-t.y,0),a=Math.min(e.x+e.width-t.x,t.width),o=Math.min(e.y+e.height-t.y,t.height);n=new U(s,r,a-s,o-r)}else n=new U(e.x-t.x,e.y-t.y,e.width,e.height);wh(this.div,n),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){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(){return this.focusVisible??this.focusVisibleStyle}onFocus(){this.overrideFocusVisible(void 0);const e=this.element.parentElement,t=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=e!=null&&t.getComputedStyle(e).opacity==="1",this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1}},ZE=class{constructor(e,t,i,n){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=s=>(On(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>(On(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),Se(this.label1,"id",oc()),Se(this.label2,"id",oc()),On(this.label1,"display","none"),On(this.label2,"display","none"),this.label1.textContent=n,this.label2.textContent=n,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Se(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(n)}createAnnouncer(e){const t=me("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],ea(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),ea(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},XE={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},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},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function qE(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 JE(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:n}]of Dt(XE))if(qE(e,n))return{name:t,activatesFocusIndicator:i}}function QE(e,t){for(const i of e)if(Je.toCanvas(i.node).intersectsWith(t))return!0;return!1}function eR(e){switch(e.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}var KM=class extends Tm{constructor(e){super(),this.chart=e,this.id=Rn(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,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new dO(e.ctx.activeManager,e.tooltip);const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),n=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new ZE(i,n,"img",t),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new YE(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:r,containerWidget:a}=e.ctx.widgets;r.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"),r.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),r.addListener("mousemove",o=>this.onHover(o,r)),r.addListener("wheel",o=>this.onWheel(o)),r.addListener("mouseleave",o=>this.onLeave(o)),r.addListener("keydown",o=>this.onKeyDown(o)),r.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),a.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),a.addListener("click",(o,l)=>this.onClick(o,l)),a.addListener("dblclick",(o,l)=>this.onClick(o,l)),e.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),e.ctx.eventsHub.on("active:load-memento",o=>this.onActiveLoadMemento(o)),e.ctx.eventsHub.on("active:update",o=>this.onActiveUpdate(o)),e.ctx.eventsHub.on("dom:resize",()=>this.onResize()),e.ctx.eventsHub.on("dom:container-change",()=>this.resetHoverScheduler()),e.ctx.eventsHub.on("highlight:change",o=>this.changeHighlightDatum(o)),e.ctx.eventsHub.on("highlight:selection-updated",o=>this.onHighlightSelectionUpdate(o)),e.ctx.eventsHub.on("layout:complete",o=>this.layoutComplete(o)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.eventsHub.on("zoom:change-complete",o=>this.onZoomChangeComplete(o)),e.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),s&&this.cleanup.register(s.events.on("drag-move",o=>this.onDragMove(o,r)),s.events.on("click",o=>this.onClick(o,r)),s.events.on("dblclick",o=>this.onClick(o,r)))}get bbox(){return(this.seriesRect??U.zero).clone()}setHoverDevice(e){(e==="setState"||!this.isState(1))&&(this._device=e)}getHoverDevice(){return this._device}initFocus(e){if(!this.focus.initialized)switch(this.focus.initialized=!0,e){case"data-end":{this.focus.datumIndex=Number.MAX_VALUE;break}case"viewport-start":case"viewport-end":{this.focus.pendingViewportFocus=e;break}default:}}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.getHoverDevice()!=="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.getHoverDevice()==="setState"&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:e}=this.focus;e&&this.focus.series!==void 0?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.refreshFocus())}update(e,t){this.chart.ctx.eventsHub.emit("chart:request-update",{type:e,opts:t})}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let n=t.properties.focusPriority??1/0,s=i.properties.focusPriority??1/0;return n===s&&([n,s]=[t.declarationOrder,i.declarationOrder]),ns?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.getHoverDevice()!=="setState"&&this.clearAll()}onResize(){const e=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&e!==void 0&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:xd(e),seriesId:e.series.id})}onZoomChangeComplete(e){this.clearAll(),this.focus.pendingViewportFocus=eR(e)}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 n,s;if(this.focusIndicator?.isFocusVisible())n=this.chart.ctx.highlightManager.getActiveHighlight(),n&&this.seriesRect&&n.midPoint&&(s=Je.toCanvasPoint(n.series.contentGroup,n.midPoint.x,n.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");c&&(this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id)}),n=c.matches[0])}const r=n?.series;this.clearAll();const a=e.currentX+t.cssLeft(),o=e.currentY+t.cssTop(),{datumIndex:l}=n??{};r&&n&&l!=null?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:a,canvasY:o},{pickedSeries:r,pickedNode:{...n,datumIndex:l}},s):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:a,canvasY:o},void 0,s)}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.getHoverDevice()!=="keyboard"&&this.clearAll(!0))}onWheel(e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(e,t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(83)&&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.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule();let i;if(this.isState(65)){const{currentX:s,currentY:r}=e;i=this.pickNodes({x:s,y:r},"event");const a=i?.matches,o=a?.[0];o?.series.hasEventListener("seriesNodeClick")||o?.series.hasEventListener("seriesNodeDoubleClick")||a!=null&&a.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const n=!!i?.matches.length;this.emitSeriesAreaHoverEvent(e,n)}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(83)))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(18)){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 n={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(n)}emitSeriesAreaHoverEvent(e,t){const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(e),s={canvasX:i,canvasY:n,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",s)}emitSeriesAreaClickEvent(e,t){if(!("currentX"in e))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(e),s={canvasX:i,canvasY:n,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:click",s)}toCanvasCoordinates(e){return{canvasX:e.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:e.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.keyboard.initialFocus);const e=this.focusIndicator.onFocus();this.setHoverDevice(e?"keyboard":"pointer");const{pendingViewportFocus:t}=this.focus;this.refreshFocus()===4&&t&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t))}onBlur(e){this.isState(69)&&(this.setHoverDevice("pointer"),!this.isState(1)&&!this.maybeEnterInteractiveTooltip(e)&&this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(e){if(!this.isState(87))return;const t=JE(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.getHoverDevice()==="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"panxleft":return this.onPage(-1,e);case"panxright":return this.onPage(1,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"home":return this.onHome(e);case"end":return this.onEnd(e);case"submit":return this.onSubmit(e);case"delete":return;default:t?.name}}onPage(e,t){if(!this.chart.hasPgUpPgDownSupport()||!this.onNav(t))return;const i=this.focus.series?.axes.x?.reverse??!1;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:e,reverse:i,widgetEvent:t})}onNav(e){return this.isState(69)?(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),e.sourceEvent.preventDefault(),!0):!1}onArrow(e,t,i){this.onNav(i)&&(this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocusFromUserInput({datumIndexDelta:t,otherIndexDelta:e}))}onHome(e){if(this.chart.hasViewportSupport())return this.onPage("home",e);this.onNav(e)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(e){if(this.chart.hasViewportSupport())return this.onPage("end",e);if(!this.onNav(e))return;const t=this.focus.series?.data?.data.length;t!==void 0&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:t-1})}onSubmit(e){if(!this.onNav(e))return;const{series:t,datum:i}=this.focus,n=e.sourceEvent;t!=null&&i!=null?t.fireNodeClickEvent(n,i):this.chart.fireEvent({type:"click",event:n})}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event"),n=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||n.active===void 0)return!1;const s=n.paginationState==null?i.distance:0;if(e.type==="click"){if(n.active.series.fireNodeClickEvent(e.sourceEvent,n.active)){const a=this.pickManager.nextCandidate();if(a.active!==void 0){const{active:o}=a,{canvasX:l,canvasY:c}=this.toCanvasCoordinates(e);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:o,defaultCb:()=>{this.showTooltip(o,l,c,a.paginationState)}})}}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=s===0,n.active.series.fireNodeDoubleClickEvent(e.sourceEvent,n.active),!0):!1}handleFocusFromUserInput(e){this.handleFocus(e),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(e){const t=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(t==null){const i=this.handleSeriesFocus(e);return i===0?this.announceMode="when-changed":this.announceMode="always",i}else return this.focusIndicator?.update(t.rect,this.seriesRect,!1),this.swapChain.update(t.text),this.announceMode="always",0}handleSeriesFocus(e){return"datumIndexDelta"in e?this.handleSeriesFocusDeltas(e):this.handleSeriesFocusIndices(e)}makeUpdateFocusParamsFromDeltas(e){const{otherIndexDelta:t,datumIndexDelta:i}=e;if(this.chart.chartType==="standalone"){this.focus.series=this.focus.sortedSeries[0];const c=this.focus.datumIndex,h=this.focus.seriesIndex,u=this.focus.datumIndex-i,d=this.focus.seriesIndex-t;return{datumIndex:c,datumIndexDelta:i,oldDatumIndex:u,otherIndex:h,otherIndexDelta:t,oldOtherIndex:d}}const{focus:n}=this,s=n.sortedSeries.filter(c=>c.visible&&c.focusable);if(s.length===0)return 1;const r=n.datumIndex-i,a=n.seriesIndex-t;n.seriesIndex=te(0,n.seriesIndex,s.length-1),n.series=s[n.seriesIndex];const o=this.focus.datumIndex,l=this.focus.seriesIndex;return{datumIndex:o,datumIndexDelta:i,oldDatumIndex:r,otherIndex:l,otherIndexDelta:t,oldOtherIndex:a}}handleSeriesFocusDeltas(e){const t=this.makeUpdateFocusParamsFromDeltas(e);return t===1?1:this.pickFocus(t)}handleSeriesFocusIndices(e){const{datumIndex:t,otherIndex:i}=e,n=this.focus.datumIndex,s=this.focus.seriesIndex;return this.pickFocus({datumIndex:t,datumIndexDelta:t-n,oldDatumIndex:n,otherIndex:i,otherIndexDelta:i-s,oldOtherIndex:s})}pickFocus(e){const{datumIndex:t,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s}=e,{focus:r,hoverRect:a,seriesRect:o}=this;if(r.series==null||a==null)return 1;const l={datumIndex:t,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s,seriesRect:o},c=r.series.pickFocus(l);return c?this.updatePickedFocus(e,c):2}pickViewportFocus(e){const{focus:t,hoverRect:i}=this;if(t.series==null||i==null)return 1;const n=t.series.pickViewportFocus({where:e,hoverRect:i,otherIndex:t.seriesIndex});if(!n)return 2;const s={datumIndex:n.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:n.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(s,n)}updatePickedFocus(e,t){const{datumIndexDelta:i,oldDatumIndex:n,otherIndexDelta:s,oldOtherIndex:r}=e,{focus:a,hoverRect:o}=this;if(a.series==null||o==null)return 1;if(a.pendingViewportFocus!==void 0)return 4;const{datum:l}=t;if(a.datum=l,a.datumIndex=t.datumIndex,t.otherIndex!=null&&(a.seriesIndex=t.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const u=Mm(t),{x:d,y:p}=u.computeCenter();if(!o.containsPoint(d,p)&&this.chart.ctx.zoomManager.panToBBox(o,u))return 3;const{x1:g,x2:f,y1:m,y2:y}=ha.from(u),b=o.containsPoint(g,m),x=o.containsPoint(f,m),M=o.containsPoint(g,y),I=o.containsPoint(f,y);if(!(b||x||M||I)){const C=ha.from(o);t.movedBounds=u.clone(),gC.x2&&f>C.x2&&(t.movedBounds.x=C.x2-2,t.movedBounds.width=4),mC.y2&&y>C.y2&&(t.movedBounds.y=C.y2-2,t.movedBounds.height=4)}}this.focusIndicator?.update(t.movedBounds??t.bounds,this.seriesRect,t.clipFocusBox);const c=this.getTooltipContent(l,"aria-label"),h=hO(a.series,o,t);if(h!=null&&this.getHoverDevice()==="keyboard"&&(this.clearCachedEvents(),!this.isState(1))){const u=Nd.makeTooltipMeta(h,a.series,l,t.movedBounds);this.pickManager.maybeActivate(l,({series:d})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l),this.isTooltipEnabled(d)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,u,c)},{defaultCbArg:{series:a.series}})}return this.maybeAnnouncePickedFocus(i,n,s,r,t,c),0}maybeAnnouncePickedFocus(e,t,i,n,s,r){const{focus:a}=this;let o;this.announceMode==="when-changed"?e===0&&i===0||t!==s.datumIndex||n!==(s.otherIndex??a.seriesIndex)?o="always":o="never":o=this.announceMode,o==="always"&&this.swapChain.update(this.getDatumAriaText(s.datum,r))}getDatumAriaText(e,t){const i=t==null?"":BT(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(e=!1){this.pickManager.maybeActivate(void 0,()=>{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.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(e),this.pickManager.wasActivationPrevented()||this.clearTooltip(e),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){this.getHoverDevice()==="setState"&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return bO(this.chart.ctx.domManager.getDocument(),()=>{if(this.getHoverDevice()==="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)}})}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:e,paginationState:t}=this.pickManager.onPickedNodesAPIDebounced();e!==void 0&&this.pickManager.maybeActivate(e,()=>{const i=vm(e.series,e,void 0);if(this.chart.tooltip.enabled){if(!e.series.visible)this.clearStaleHighlightTooltip();else if(i){const{canvasX:n,canvasY:s}=i,r=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,e,!1,r),r?this.showTooltip(e,n,s,t):this.clearTooltip()}}})}handleHoverHighlight(e,t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:n,canvasY:s}=this.toCanvasCoordinates(i);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,s)){this.clearHighlight();return}const{range:r}=this.chart.highlight,a=r==="tooltip"?"highlight-tooltip":"highlight",o=t?.active??this.pickManager.onPickedNodesHighlight(this.pickNodes({x:i.currentX,y:i.currentY},a));o===void 0?this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),t?.defaultCb()}):this.pickManager.maybeActivate(o,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,o,!1),t?.defaultCb()})}handleHoverTooltip(e,t){if(!this.isState(82))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(e),s=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,n)){this.getHoverDevice()=="pointer"&&this.clearTooltip();return}if(s&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(s,"canvas-overlay",zt))return;const r=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip"),{active:a,paginationState:o}=this.pickManager.onPickedNodesTooltip(r);this.pickManager.wasActivationPrevented()||(a===void 0?this.getHoverDevice()=="pointer"&&this.clearTooltip(!0):this.showTooltip(a,i,n,o))}showTooltip(e,t,i,n){const s=this.getTooltipContent(e,"tooltip");if(s!=null){const{series:a}=e,o=Nd.makeTooltipMeta({type:"pointermove",canvasX:t,canvasY:i},a,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,o,s,n)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.pickManager.maybeActivate(void 0,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),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);const n=t?.isHighlightEnabled()??!1;if(e.highlightSuppressed&&!n)return;const s=e.highlightSuppressed!==!n;this.getHoverDevice()==="setState"||i==null||t==null||s?this.update(7,{clearCallbackCache:!0}):this.update(7,{seriesToUpdate:new Set([t,i].filter(Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(e){if(!this.isState(1)||!this.seriesRect){this.activeState.highlightInViewport=!0;return}if(e.highlightSelection.length===0)return;const t=QE(e.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=t}pickNodes(e,t,i){const n=[...this.series].reverse(),s=t==="event"||t==="context-menu",r=t==="tooltip"||t==="highlight-tooltip",a=d=>{if(s)return d.properties.nodeClickRange;if(r)return d.properties.tooltip.range},{x:o,y:l}=e,c=new Set;for(const d of n)d.visible&&d.contentGroup.visible&&a(d)==="area"&&d.isPointInArea?.(o,l)&&c.add(d);const h=c.size>0;let u;for(const d of n){if(!d.visible||!d.contentGroup.visible||h&&!(a(d)==="area"&&c.has(d)))continue;const p=d.pickNodes(e,t,i);if(p==null||p.datums.length===0)continue;const{datums:g,distance:f}=p;if(p.datums.length!==0)if(f===0){u?.distance!==0&&(u={matches:[],distance:0});for(const m of g)u.matches.push(m)}else(u==null||u.distance>f)&&(u={matches:g,distance:f})}return u}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t){const{series:i,datumIndex:n}=e;let s;if(t==="aria-label"||this.isTooltipEnabled(i)){const{cachedTooltipContent:r}=this;if(r?.series===i&&r.datumIndex===n)s=r.content;else{const a=this.chart.getTooltipContent(i,n,e,t);this.cachedTooltipContent={series:i,datumIndex:n,content:a},s=a}}else this.cachedTooltipContent=void 0;return s}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.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if(this.activeState.lastActive!=="legend"){const{seriesId:e,itemId:t}=this.activeState.lastActive,i=this.findPickedNodes(e,t);i===void 0?this.clearUnpreventable():i==="series-hidden"?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0)}):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(e,t){const{seriesId:i,itemId:n}=e,s=this.findPickedNodes(i,n);if(s===void 0)t.reject(),this.onActiveClear();else{if(s!=="series-hidden"){const r=this.pickManager.onPickedNodesAPI(s);t.setDatum(r)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:n},t.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(e,t){const i=this.series.find(s=>s.id===e);if(i==null){z.warn(`Cannot find seriesId: "${e}"`);return}if(!i.visible)return"series-hidden";const n=i.findNodeDatum(t);if(n==null){z.warn(`Cannot find itemId: ${JSON.stringify(t)}`);return}return{matches:[n],distance:0}}};KM.className="SeriesAreaManager";var YM=30,tR=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,n=e.bringToFront(),s=this.getGroupType(e,n),r=this.getGroupIndex(e),a=this.series.get(t);if(a!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(a)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=YM?"aggressive-grouping":"normal");let o=this.groups.get(s);o==null&&(o=new Map,this.groups.set(s,o));const l=this.lookupIdx(r);let c=o.get(l);return c==null&&(c={type:s,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new ae({name:`${e.contentGroup.name??s}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},o.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e,bringToFront:n}),c.seriesIds.push(t),c.group.appendChild(i),c.group}changeGroup(e){const{internalId:t,contentGroup:i}=e,n=e.bringToFront(),s=this.getGroupType(e,n),r=this.series.get(t),a=r?this.getGroupType(r.seriesConfig,r.bringToFront):void 0,o=this.getGroupIndex(e),l=this.lookupIdx(o),c=this.groups.get(s)?.get(l);if(!(a===s&&c?.seriesIds.includes(t)===!0))return this.series.has(t)&&this._releaseGroup({internalId:t,contentGroup:i,type:a}),this.requestGroup(e)}releaseGroup(e){const{internalId:t,contentGroup:i}=e,n=this.getGroupType(e,e.bringToFront());this._releaseGroup({internalId:t,contentGroup:i,type:n})}_releaseGroup(e){const{internalId:t,contentGroup:i,type:n}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const s=this.series.get(t)?.layerState;s&&(s.seriesIds=s.seriesIds.filter(r=>r!==t),i.remove()),s?.seriesIds.length===0?(s.group.remove(),this.groups.get(s.type)?.delete(s.id),this.groups.get(n)?.delete(t)):s!=null&&s.seriesIds.length>0&&(s.group.zIndex=this.getLowestSeriesZIndex(s.seriesIds)),this.series.delete(t)}updateLayerCompositing(){for(const e of this.groups.values())for(const t of e.values()){const{group:i,seriesIds:n}=t;let s;n.length===0?s=!1:n.length>1?s=!0:s=this.series.get(n[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=s,i.zIndex=this.getLowestSeriesZIndex(n)}}lookupIdx(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!Number.isFinite(e))?0:Math.floor(te(0,e/this.expectedSeriesCount,1)*YM)}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 s=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(t==null||s==null){t=s;continue}t=y0(t,s)<=0?t:s}return t??1}},ZM=class extends ce{constructor(){super(...arguments),this.dragAction="drag"}};v([S],ZM.prototype,"dragAction",2);var iR=class{constructor(e,t,i,n,s,r){this.chart=e,this.eventsHub=t,this.dataService=i,this.updateService=n,this.zoomManager=s,this.animationManager=r,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new tt,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",a=>this.onUpdateComplete(a)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.eventsHub.emit("chart:request-update",{type:1})}onDataError(){this.eventsHub.emit("chart:request-update",{type: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,n=!0;if(t){const s=this.zoomManager.getAxisZoom(t.id);i=this.getAxisWindow(t,s),n=this.shouldRefresh(e,t,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,n&&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 n=this.lastAxisZooms.get(t.id);return n&&i.min===n.min&&i.max===n.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 n=Number(i[1])-Number(i[0]),s=new Date(Number(i[0])+n*t.min),r=new Date(Number(i[0])+n*t.max);return{min:s,max:r}}},nR=/^((?!chrome|android).)*safari/i,sR=/Version\/(\d+(\.\d+)?)/,rR=/Chrome/,aR=/Chrome\/(\d+)/,oR=/Edg/,lR=/OPR/;function cR(){const{userAgent:e}=Wn("navigator");if(nR.test(e)){const t=sR.exec(e);if(t==null)return!1;const i=Number.parseFloat(t[1]),n=Math.floor(i)>16;return n||z.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!n}else if(rR.test(e)&&!oR.test(e)&&!lR.test(e)){const t=aR.exec(e);if(t==null)return!1;const i=Number.parseInt(t[1],10),n=i>126;return n||z.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!n}return!1}var hR=new Set(["map-shape-background","map-line-background"]),uR=class{constructor(e,t,i,n,s,r,a){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=n,this.localeManager=s,this.animationManager=r,this.domManager=a,this.cleanup=new tt,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","false"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass($m,!0),this.cleanup.register(this.eventsHub.on("layout:complete",o=>this.onLayoutComplete(o)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),n=this.chartLike.series.some(c=>c.visible&&!hR.has(c.type));this.overlayElem.toggleClass(WE,this.overlays.darkTheme),this.overlayElem.setProperty("left",`${e.x}px`),this.overlayElem.setProperty("top",`${e.y}px`),this.overlayElem.setProperty("width",`${e.width}px`),this.overlayElem.setProperty("height",`${e.height}px`);const s=t,r=!t&&!i,a=i&&!n,o=this.overlays.unsupportedBrowser.enabled&&cR();s?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),r?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),o?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=s||r||a||o;this.overlayElem.setAttr("aria-hidden",String(!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)}},fn=he.create(!0,"opts"),Ke=class aA extends cM{constructor(t,i){var n;super(),this.id=Rn(this),this.seriesRoot=new Yt({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new Yt({name:`${this.id}-annotation-root`,zIndex:11}),this.titleGroup=new ae({name:"titles",zIndex:15,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.debug=he.create(!0,"chart"),this.extraDebugStats={},this.data=Hc.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new kg,this._requiredRange=0,this._requiredRangeDirection="x",this.chartCaptions=new Id,this.padding=new ra(20),this.keyboard=new Rd,this.touch=new ZM,this.mode="standalone",this.withinStudio=void 0,this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.dataIdKey=void 0,this.destroyed=!1,this.cleanup=new tt,this.chartAnimationPhase="initial",this.modulesManager=new UE,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 kg,this.performUpdateType=10,this.runningUpdateType=10,this.currentProcessingUpdateType=10,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new yO,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=Lm(({count:d})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,d)).catch(p=>z.errorOnce(p))}),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 Dm))return;const{series:p,seriesGrouping:g}=d;if(p.contentGroup.isRoot())return;const f=this.seriesLayerManager.changeGroup({internalId:p.internalId,type:p.type,contentGroup:p.contentGroup,bringToFront:()=>p.bringToFront(),renderToOffscreenCanvas:()=>p.renderToOffscreenCanvas(),seriesGrouping:g});f!=null&&p.attachSeries(f,this.seriesRoot,this.annotationRoot)},this.chartOptions=t;const s=i?.scene,r=i?.container??t.processedOptions.container??void 0,a=i?.styleContainer??t.specialOverrides.styleContainer,o=t.specialOverrides.skipCss;s&&(this._firstAutoSize=!1,this._lastAutoSize=[s.width,s.height,s.pixelRatio]);const l=new ae({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);const c=new $v(t.specialOverrides.document,t.specialOverrides.window);this.tooltip=new Pn(c),this.seriesLayerManager=new tR(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const h=this.ctx=new EE(this,{chartType:this.getChartType(),scene:s,root:l,container:r,styleContainer:a,skipCss:o,agDocument:c,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new BE(this),fireEvent:d=>this.fireEvent(d),updateMutex:this.updateMutex});t.optionMetadata.presetType==="sparkline"&&(h.highlightManager.unhighlightDelay=0,h.tooltipManager.removeDelay=0),this.cleanup.register(h.eventsHub.on("dom:resize",()=>this.parentResize(h.domManager.containerSize)),h.eventsHub.on("font:load",()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(5)}),h.eventsHub.on("rtl:change",()=>{h.scene.setDirection(h.domManager.isRtl),this.update(5)}),h.eventsHub.on("chart:request-update",d=>this.update(d.type,d.opts)),h.scene.on("scene-changed",()=>this.update(9))),h.scene.setDirection(h.domManager.isRtl),this.overlays=new hl,(n=this.overlays.loading).renderer??(n.renderer=()=>KE(h.agDocument,this.overlays.loading.getText(h.localeManager),h.animationManager.defaultDuration)),this.processors=[new iR(this,h.eventsHub,h.dataService,h.updateService,h.zoomManager,h.animationManager),new uR(this,this.overlays,h.eventsHub,h.dataService,h.localeManager,h.animationManager,h.domManager)],this.highlight=new Ed,this.container=r;const u=this.getModuleContext();this.background=Ys.createBackground?.(u)??new al(u),this.foreground=Ys.createForeground?.(u),this.seriesArea=new Kc(u),h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new KM(this.initSeriesAreaDependencies()),this.cleanup.register(h.layoutManager.registerElement(0,d=>{d.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(d)}),h.eventsHub.on("layout:complete",d=>this.chartCaptions.positionAbsoluteCaptions(d)),h.eventsHub.on("data:load",d=>{this.data=this.createDataSet(d.data)}),this.title.registerInteraction(u,"beforebegin"),this.subtitle.registerInteraction(u,"beforebegin"),this.footnote.registerInteraction(u,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),this.ctx.agDocument.attachListener("pagehide",d=>{d.persisted||this.destroy()}),h.animationManager.addListener("animation-frame",()=>{this.update(9),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.animationManager.addListener("animation-start",()=>h.domManager.setDataBoolean("animating",!0)),h.animationManager.addListener("animation-stop",()=>{h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.eventsHub.on("zoom:change-complete",()=>{const d=this.chartAnimationPhase==="initial";for(const p of this.series)p.animationState?.transition("updateData");if(d)for(const p of this.axes)p.resetAnimation(this.chartAnimationPhase);this.update(5,{forceNodeDataRefresh:!0,skipAnimations:!d})})),this.parentResize(h.domManager.containerSize)}static getInstance(t){return aA.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}createDataSet(t){return new Hc(t,this.dataIdKey)}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}fireEvent(t){Nn(this,this.fireEventWrapper,t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:n,keyboard:s,overlays:r,seriesRoot:a,mode:o}=this,l=this.getChartType(),c=()=>this.hasViewportSupport(),h=()=>this.hasPgUpPgDownSupport(),u=this.fireEvent.bind(this);return{hasViewportSupport:c,hasPgUpPgDownSupport:h,fireEvent:u,getUpdateType:()=>this.performUpdateType,getTooltipContent:(g,f,m,y)=>this.getTooltipContent(g,f,m,y),chartType:l,ctx:t,tooltip:i,highlight:n,keyboard:s,overlays:r,seriesRoot:a,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(t,i,n,s){const a=s==="aria-label"||t.properties.tooltip.enabled!==!1?t.getTooltipContent(i,n):void 0,o=a==null?[]:[a];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const l=t.getCategoryValue(i);return l==null?o:this.series.flatMap(c=>{if(c===t)return o;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const h=c.datumIndexForCategoryValue(l),u=h==null?void 0:c.getTooltipContent(h,void 0);return u==null?[]:[u]})}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 n=0;n{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>z.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:n=!1,skipAnimations:s,seriesToUpdate:r=this.series,newAnimationBatch:a,apiUpdate:o=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),n)for(const c of this.series)c.markNodeDataDirty();for(const c of r)this.seriesToUpdate.add(c);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&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??"";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=t,this.currentProcessingUpdateType!==10&&this.currentProcessingUpdateType>=t&&this.debug.group(`Chart.update() - \u26A0\uFE0F received update for earlier update stage ${wn[t]} \u26A0\uFE0F`,()=>{this.debug(`Current processing update type: ${wn[this.currentProcessingUpdateType]}`),this.debug("Update from: ",c)})}t0?"\u26A0\uFE0F redo #"+this.updateShortcutCount+" \u26A0\uFE0F ":""}`;await this.debug.group(`Chart.performUpdate() ${i}`,async()=>{await this.performUpdate(t)})}catch(i){z.error("update error",i,i.stack)}}async performUpdate(t){const{performUpdateType:i,extraDebugStats:n,_performUpdateSplits:s,ctx:r}=this,a=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=10,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.currentProcessingUpdateType=i,this.updateShortcutCount===0&&i<9&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",wn[i]),this._previousSplit=performance.now(),s.start??(s.start=this._previousSplit),r.domManager.setDeferring(!0),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(a),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case 8:if(this.checkUpdateShortcut(8))break;r.updateService.dispatchPreSceneRender(this.apiUpdate),r.scene.updateBaseFont(),this.updateSplits("\u2196");case 9:if(this.checkUpdateShortcut(9))break;r.animationManager.endBatch(),n.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:s,extraDebugStats:n,seriesRect:this.seriesRect,debugColors:he.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const l of Object.keys(s))delete s[l];this.ctx.domManager.incrementDataCounter("sceneRenders");case 10:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=10,this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.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(),r.domManager.setDeferring(!1);const o=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Eh(o-s.start),count:t,performUpdateType:wn[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}default-dark`];let n=i[0],s=!1,{theme:r}=this.chartOptions.processedOptions;for(;typeof r!="string"&&r!=null;)r=r.baseTheme;typeof r=="string"&&(n=r.replace("ag-",t),s=r.includes("-dark")),i.includes(n)||(n=s?i[1]:i[0]),this.ctx.domManager.setThemeClass(n)}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?(z.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: ",wn[t]," BY REQUEST FOR: ",wn[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",wn[t]),this.currentProcessingUpdateType=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 Md}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const n=i?.filter(s=>!t.includes(s))??[];this.destroySeries(n),this.seriesLayerManager?.setSeriesCount(t.length);for(const s of t){if(i?.includes(s))continue;const r=this.seriesLayerManager.requestGroup(s);s.attachSeries(r,this.seriesRoot,this.annotationRoot),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>this.mode}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(s)}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 n=function(s){return s.axes[i.direction]===i};var t=n;i.boundSeries=this.series.filter(n)}}assignAxesToSeries(){for(const t of this.series)for(const i of t.directions){const n=t.getKeyAxis(i)??i,s=this.axes.findById(n);if(!s){z.warnOnce(`no matching axis for direction [${i}] and id [${n}]; check series and axes configuration.`);return}t.axes[i]=s}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:n}=t;const{pixelRatio:s}=t;if(i=Math.floor(i),n=Math.floor(n),i===0&&n===0)return;const[r=0,a=0,o=1]=this._lastAutoSize??[];r===i&&a===n&&o===s||(this._lastAutoSize=[i,n,s],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:n,animationManager:s}=this.ctx,{inWidth:r,inHeight:a,inMinWidth:o,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(o??this.minWidth,l??this.minHeight,r??this.width,a??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=a??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:h,height:u,pixelRatio:d,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||u==null||!Pe(h)||!Pe(u))&&n.resize(h,u,d)){s.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1);let g=5;for(const f of this.axes){const m=f.getUpdateTypeOnResize();mn.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new $M(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const n of this.series)i.push(n.processData(t)??Promise.resolve());for(const n of this.modulesManager.modules())n?.processData&&i.push(n.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={},n={},s=new Map;this._requiredRangeDirection="x";for(const r of this.series)r.visible&&(i[t=r.type]??(i[t]=[]),r.getMinimumRangeSeries(i[r.type]),r.resolveKeyDirection("x")==="y"&&(this._requiredRangeDirection="y"),s.has(r.type)||s.set(r.type,r));for(const[r,a]of s)n[r]=a.getMinimumRangeChart(i[r]);Object.keys(n).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(n)));for(const r of this.axes)r.requiredRange=this._requiredRange}updateLegends(t){for(const i of ee.listModulesByType("plugin"))switch(i.name){case"legend":this.setCategoryLegendData(t);break;case"gradientLegend":const n=this.modulesManager.getModule("gradientLegend");n.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData("gradient"));break}}setCategoryLegendData(t){const{legendManager:i,stateManager:n}=this.ctx;if(t)for(const r of this.series){const a=t.find(o=>o.seriesId===r.id);r.onLegendInitialState("category",a)}const s=this.series.flatMap(r=>{const a=r.getLegendData("category");return i.updateData(r.id,a),a});if(t){n.setStateAndRestore(i,t);return}if(this.mode!=="integrated"){const r={},a=new Map(this.series.map(o=>[o.id,o]));for(const{seriesId:o,symbol:{marker:l},label:c}of s.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=a.get(o);if(!h?.hasData)continue;const u=h.type,d=r[u]??(r[u]=new Map);d.has(c.text)?d.get(c.text)!==l.fill&&z.warnOnce(`legend item '${Xe(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):d.set(c.text,l.fill)}}i.update()}async processLayout(){const t=this.animationRect,{width:i,height:n}=this.ctx.scene,s=this.ctx.layoutManager.createContext(i,n);await this.performLayout(s),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=Te.fromString(t),[n]=Te.RGBtoOKLCH(i.r,i.g,i.b);return{background:t,foreground:n>.5?"black":"white"}}catch{return{background:t}}}preSeriesUpdate(){const{_requiredRange:t,seriesRect:i}=this;if(i==null)return;const n=this._requiredRangeDirection==="x"?i.width:i.height,s=t/n||0;this.ctx.updateService.dispatchPreSeriesUpdate(s,this._requiredRangeDirection,t)}async updateSeries(t){const{seriesRect:i}=this;function n(s){return s.update({seriesRect:i})}await Promise.all(t.map(n).filter(s=>s!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t,i){const n=Wn("agChartsDebugTimeout");n==null?(t??(t=1e4),i??(i=!1)):(t=n,i??(i=!0));const s=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()-s>t){const r=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(r);z.warnOnce(r)}_b()&&await Lg(),this.ctx.scene.waitingForUpdate()&&await Lg(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){t.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,t.seriesWithUserVisibility);const i=5,n=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(n==null||Object.keys(n).length===0){fn("Chart.applyOptions() - no delta, forcing re-layout",n),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const s=this.firstApply?{}:this.chartOptions.processedOptions,r=t.processedOptions;fn("Chart.applyOptions() - applying delta",n);const a=this.applyModules(),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter","displayNullData","enableRtl"];"listeners"in n&&this.registerListeners(this,n.listeners),"enableRtl"in n&&this.ctx.domManager.setEnableRtl(n.enableRtl),sc(this,n,{skip:o});let l=!1,c="no-op";n.series!=null&&(c=this.applySeries(this,n.series,s?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,r,s,c,[])&&(l=!0);const{userDeltaKeys:h}=t,u=h===void 0||h.has("data");let d=!1;if(n.data&&u){const b=n.data,x=t.userOptions.data,I=Array.isArray(b)&&b!==x?b.slice():b;this.data=this.createDataSet(I),d=!0}if("dataIdKey"in n&&!(n.data&&u)&&this.data.dataIdKey!==this.dataIdKey&&(this.data=this.createDataSet(this.data.data),d=!0),c==="replaced"&&!d&&(this.data=this.createDataSet(this.data.data)),"legend"in n&&n.legend&&"listeners"in n.legend&&this.modulesManager.isEnabled("legend")){const b=n.legend.listeners;b?Object.assign(this.legend.listeners,b):this.legend.listeners.clear()}n.locale?.localeText&&(this.pendingLocaleText=n.locale?.localeText),this.chartOptions=t;const p=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const g=p?.miniChart,f=r.navigator?.miniChart?.series??r.series;g?.enabled===!0&&f!=null?this.applyMiniChartOptions(g,f,r,s):g?.enabled===!1&&(g.series=[],g.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(n,c));const y=l||a?0:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(r,s,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(r),this.ctx.formatManager.setFormatter(r.formatter),fn("Chart.applyOptions() - update type",wn[y],{seriesStatus:c,forceNodeDataRefresh:l}),t.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=t.optionsProcessingTime;const b=performance.now()-t.optionsProcessingTime;this._performUpdateSplits.start=b}this.update(y,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(t){const{activeManager:i,annotationManager:n,chartTypeOriginator:s,historyManager:r,stateManager:a,zoomManager:o}=this.ctx,{initialState:l}=t;if("annotations"in t&&t.annotations?.enabled&&l?.annotations!=null){const c=l.annotations.map(h=>{const u=n.getAnnotationTypeStyles(h.type);return xe(h,u)});a.setState(n,c)}l?.chartType!=null&&a.setState(s,l.chartType),this.needsViewportSupport(t)&&l?.zoom!=null&&a.setState(o,l.zoom),l?.active!=null&&a.setState(i,l.active),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&r.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(t,i){const n=!!t.data||i==="data-change"||i==="replaced",s=["legend","gradientLegend"].some(a=>t[a]!=null),r=t.title!=null&&t.subtitle!=null||t.formatter!=null;return n||s||r}shouldClearLegendData(t,i,n){const s=n==="replaced"||n==="series-count-changed"||n==="series-grouping-change"||n==="updated"&&(t.series?.length!==i.series?.length||!t.series?.every((a,o)=>a.type===i.series?.[o].type)),r=i.legend!=null&&i.legend.enabled!==!1&&(t.legend==null||t.legend.enabled===!1);return s||r}applyMiniChartOptions(t,i,n,s){const r=s?.navigator?.miniChart?.series??s?.series,a=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r));this.applyAxes(t,n,s,a,["tick","thickness","title","crosshair","gridLine","label"]);const o=t.series;for(const h of o)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=n.navigator?.miniChart,u=h?.label,d=h?.label?.interval;if(c.line.enabled=!1,c.label.set(K(u,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let g=1;gthis.createSeries(d));return this.initSeriesDeclarationOrder(u),t.series=u,"replaced"}fn("Chart.applySeries() - matchResult",s);const r=[];let a=!1,o=!1,l=!1,c=!1;const h=s.changes.toSorted((u,d)=>u.targetIdx-d.targetIdx);for(const u of h)switch(o||(o=u.status==="series-grouping"),a||(a=u.diff?.data!=null),l||(l=u.status!=="no-op"),c||(c=u.status==="add"||u.status==="remove"),u.status){case"add":{const d=this.createSeries(u.opts);r.push(d),fn("Chart.applySeries() - created new series",d);break}case"remove":fn(`Chart.applySeries() - removing series at previous idx ${u.idx}`,u.series);break;case"no-op":r.push(u.series),fn(`Chart.applySeries() - no change to series at previous idx ${u.idx}`,u.series);break;case"series-grouping":case"update":default:{const{series:d,diff:p,idx:g}=u;fn(`Chart.applySeries() - applying series diff previous idx ${g}`,p,d),this.applySeriesValues(d,p),d.markNodeDataDirty(),r.push(d)}}return this.initSeriesDeclarationOrder(r),fn("Chart.applySeries() - final series instances",r),t.series=r,o?"series-grouping-change":c?"series-count-changed":a?"data-change":l?"updated":"no-op"}applyAxes(t,i,n,s,r=[]){if(!("axes"in i)||!i.axes)return!1;r=["type",...r];const a=i.axes;if(!(s==="replaced")&&t.axes.matches(a)&&$E(n)){for(const c of t.axes){const h=n.axes?.[c.id]??{},u=ss(h,a[c.id]);fn(`Chart.applyAxes() - applying axis diff idx ${c.id}`,u),sc(c,u,{skip:r})}return!0}return fn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),t.axes=this.createAxes(a,r),!0}createSeries(t){const n=ee.getSeriesModule(t.type).create(this.getModuleContext());return this.applySeriesOptionModules(n,t),this.applySeriesValues(n,t),n}applySeriesOptionModules(t,i){const n=t.createModuleContext(),s=t.getModuleMap();for(const r of ee.listModulesByType("series:plugin"))r.name in i&&(r.seriesTypes?.includes(t.type)??!0)&&s.addModule(r.name,r.create(n))}applySeriesValues(t,i){const n=t.getModuleMap(),{type:s,data:r,listeners:a,seriesGrouping:o,showInMiniChart:l,...c}=i;for(const h of ee.listModulesByType("series:plugin"))if(h.name in c){const u=n.getModule(h.name);if(u){const d=c[h.name];u.properties.set(d),delete c[h.name]}}c.visible!=null&&(t.visible=c.visible),t.properties.set(c),"data"in i&&t.setOptionsData(r==null?void 0:Hc.wrap(r)),"listeners"in i&&(this.registerListeners(t,a),this.series.includes(t)&&this.addSeriesListeners(t)),"seriesGrouping"in i&&(o==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...o})}createAxes(t,i){const n=this.createChartAxes(),s=this.getModuleContext();for(const[r,a]of Dt(t)){const o=ee.getAxisModule(a.type).create(s);o.id=r,this.applyAxisModules(o,a),sc(o,a,{skip:i}),n.push(o)}return GE(n),n}applyAxisModules(t,i){const n=t.createModuleContext(),s=t.getModuleMap();for(const r of ee.listModulesByType("axis:plugin")){const a=i[r.name]!=null;a!==s.isEnabled(r.name)&&(a?(s.addModule(r.name,r.create(n)),t[r.name]=s.getModule(r.name)):(s.removeModule(r.name),delete t[r.name]))}}registerListeners(t,i){if(t.clearEventListeners(),i&&typeof i=="object")for(const[n,s]of Dt(i))s!=null&&t.addEventListener(n,s)}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()}needsViewportSupport(t){return!!t.navigator?.enabled||!!t.zoom?.enabled||!!t.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};Ke.className="Chart",Ke.chartsInstances=new WeakMap,v([_t({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),Ke.chartsInstances.set(e,this))},oldValue(e){Ke.chartsInstances.delete(e)}})],Ke.prototype,"container",2),v([_t({newValue(e){this.resize("width option",{inWidth:e})}})],Ke.prototype,"width",2),v([_t({newValue(e){this.resize("height option",{inHeight:e})}})],Ke.prototype,"height",2),v([_t({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],Ke.prototype,"minWidth",2),v([_t({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],Ke.prototype,"minHeight",2),v([_t({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],Ke.prototype,"overrideDevicePixelRatio",2),v([S],Ke.prototype,"padding",2),v([S],Ke.prototype,"keyboard",2),v([S],Ke.prototype,"touch",2),v([S],Ke.prototype,"mode",2),v([S],Ke.prototype,"withinStudio",2),v([S],Ke.prototype,"styleNonce",2),v([si("chartCaptions.title")],Ke.prototype,"title",2),v([si("chartCaptions.subtitle")],Ke.prototype,"subtitle",2),v([si("chartCaptions.footnote")],Ke.prototype,"footnote",2),v([S],Ke.prototype,"formatter",2),v([S],Ke.prototype,"suppressFieldDotNotation",2),v([S],Ke.prototype,"loadGoogleFonts",2),v([S],Ke.prototype,"dataIdKey",2),v([_t({changeValue(e,t){this.onAxisChange(e,t)}})],Ke.prototype,"axes",2),v([_t({changeValue(e,t){this.onSeriesChange(e,t)}})],Ke.prototype,"series",2);var Pd=Ke,dR=["top","right","bottom","left"],Yc=class oA extends Pd{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 vO}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:n}=this;i.setClipRect(t),n.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:n}=this,{clipSeries:s,seriesRect:r,visible:a}=this.updateAxes(t);this.seriesRoot.visible=a,this.seriesRect=r,this.animationRect=t.layoutBox;const{x:o,y:l}=r;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const g of[i,n])g.translationX=Math.floor(o),g.translationY=Math.floor(l);else{const{translationX:g,translationY:f}=i;Fs(this.id,"seriesRect",this.ctx.animationManager,[i,n],{translationX:g,translationY:f},{translationX:Math.floor(o),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=r.clone().grow(this.seriesArea.getPadding()),d=this.series.some(g=>g.alwaysClip)||(this.seriesArea.clip??!1)||s?c:void 0,{lastUpdateClipRect:p}=this;this.lastUpdateClipRect=d,this.ctx.animationManager.isActive()&&p!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:p,to:c,onUpdate:g=>this.setRootClipRects(g),onStop:()=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(d)}):this.setRootClipRects(d),this.ctx.layoutManager.emitLayoutComplete(t,{axes:Av(this.axes.map(g=>[g.id,g.getLayoutState()])),series:{visible:a,rect:r,paddedRect:c},clipSeries:s,layoutBox:t.layoutBox}),dM(this.series)}updateAxes(t){const{layoutBox:i,scrollbars:n}=t,{clipSeries:s,seriesRect:r,overflows:a}=this.resolveAxesLayout(i,n);for(const o of this.axes)o.update(),o.setCrossLinesVisible(!a),this.clipAxis(o,r,i);return{clipSeries:s,seriesRect:r,visible:!a}}resolveAxesLayout(t,i){let n,s,r=0;const a=10,o=this.axes.filter(l=>l.crossAt?.value!=null);do if(s=n??this.getDefaultState(),n=this.updateAxesPass(new Map(s.axisAreaWidths),t.clone(),o,i),r++>a){z.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(n,s));return this.lastAreaWidths=n.axisAreaWidths,n}updateAxesPass(t,i,n,s){const r=new Map,a={};let o=!1,l=!1;const c=this.seriesArea.getPadding();for(const I of dR){const C=c[I]??0,D=this.axes.findLast(A=>A.position===I);D?D.seriesAreaPadding=C:i.shrink(C,I)}const h=(t.get("left")??0)+(t.get("right")??0),u=(t.get("top")??0)+(t.get("bottom")??0),d=this.buildCrossLinePadding(t),p=d.left+d.right,g=d.top+d.bottom;i.width<=h+p||i.height<=u+g?o=!0:i.shrink(d);const{scene:f}=this.ctx,m=i.clone().shrink(Object.fromEntries(t));for(const I of this.axes){const{position:C="left",direction:D}=I,A=D==="y";let k;this.sizeAxis(I,m,C),I.thickness==null?k=Um(A,f)*(I.maxThicknessRatio??1):k=I.thickness;const N={sizeLimit:k-I.label.spacing,padding:this.padding,scrollbars:s},{primaryTickCount:T,bbox:R}=I.calculateLayout(I.nice?a[D]:void 0,N);a[D]??(a[D]=T),l||(l=I.dataDomain.clipped||I.visibleRange[0]>0||I.visibleRange[1]<1),I.thickness==null&&(k=Math.min(Um(A,R)??0,k)),r.set(I.id,Math.ceil(k))}let y;n.length>0&&(y=this.calculateAxesCrossPositions(r,m,n));const b=Ll(this.axes,I=>I.position??"left"),x=new Map,M=new Map;for(const[I,C]of Dt(b)){let D=Um(I!=="left"&&I!=="right",f)%f.pixelRatio,A=0;for(const k of C??[]){M.set(k.id,D);const N=r.get(k.id)??0;A=Math.max(A,D+N),k.layoutConstraints.stacked&&(D+=N+oA.AxesPadding)}x.set(I,Math.ceil(A))}for(const[I,C]of Dt(b))this.positionAxes({axes:C??[],position:I,axisWidths:r,axisOffsets:M,axisAreaWidths:x,axisBound:i,seriesRect:m});return y!=null&&this.applyAxisCrossing(m,y),{clipSeries:l,seriesRect:m,axisAreaWidths:x,overflows:o}}calculateAxesCrossPositions(t,i,n){const s=new Map;for(const r of n){const{crossPosition:a,visible:o}=this.calculateAxisCrossPosition(r);r.setAxisVisible(o),this.adjustAxisWidth(r,t,a,i,o),a!=null&&s.set(r.id,a)}return s}calculateAxisCrossPosition(t){const i=this.axes.perpendicular(t),{scale:{domain:n,bandwidth:s},range:r}=i,a=(s??0)/2,o=i.scale.convert(t.crossAt?.value,{clamp:!1})+a;return i.inRange(o)?{crossPosition:o,visible:!0}:t.crossAt?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(o)?r[n[0]]:ho(o,r),visible:!0}}adjustAxisWidth(t,i,n,s,r){if(t.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager.createMemento().some(u=>{switch(u.type){case"vertical-line":return t.direction==="x";case"horizontal-line":return t.direction==="y"}}))return;const c=i.get(t.id)??0,h=r?this.calculateAxisBleedingWidth(t,c,n,s):0;i.set(t.id,h)}calculateAxisBleedingWidth(t,i,n,s){if(n==null)return i;switch(t.position){case"left":case"top":return Math.max(0,i-n);case"right":return Math.max(0,n+i-s.width);case"bottom":return Math.max(0,n+i-s.height);default:return i}}applyAxisCrossing(t,i){for(const n of this.axes){const s=i.get(n.id);if(s==null){n.crossAxisTranslation.x=0,n.crossAxisTranslation.y=0;continue}const r=n.direction==="x";n.crossAxisTranslation.x=r?0:t.x+s-n.translation.x,n.crossAxisTranslation.y=r?t.y+s-n.translation.y:0}}buildCrossLinePadding(t){var i;const n={top:0,right:0,bottom:0,left:0};for(const s of this.axes){const{position:r,label:a}=s;if(s.crossLines)for(const o of s.crossLines)o instanceof oi&&(o.position=r??"top",(i=o.label).parallel??(i.parallel=a.parallel)),o.calculatePadding?.(n)}for(const[s,r=0]of Dt(n))n[s]=Math.max(r-(t.get(s)??0),0);return n}clampToOutsideSeriesRect(t,i,n,s){const r=n==="x"?t.x:t.y,a=n==="x"?t.width:t.height;return s===1?Math.min(i,r+a):Math.max(i,r)}async getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(t)}syncAxisChanges(t,i){const n=this.modulesManager.getModule("sync");if(!n?.enabled)return;const s=new Set(i??[]);for(const r of t)s.delete(r);for(const r of s)n.removeAxis(r)}sizeAxis(t,i,n){const s=t instanceof Qi,r=n==="left"||n==="right",{width:a,height:o}=i,l=r?o:a;let c=0,h=l,{min:u,max:d}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:g,align:f}=t.layoutConstraints;g==="px"?h=c+p:h=h*p/100;const m=h-c;if(f==="end")c=l-m,h=l;else if(f==="center"){const y=c+(l-c)/2;c=y-m/2,h=y+m/2}else f==="justify"&&(h=l);r&&(s?[c,h]=[h,c]:[u,d]=[1-d,1-u]),t.range=[c,h],t.visibleRange=[u,d],t.gridLength=r?a:o,t.lineRange=r?[o,0]:[0,a]}positionAxes(t){const{axes:i,axisBound:n,axisWidths:s,axisOffsets:r,axisAreaWidths:a,seriesRect:o,position:l}=t,c=a.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let p=n[h];(l==="right"||l==="bottom")&&(d=-1,p+=h==="x"?n.width:n.height);for(const g of i){const f=a.get(u==="x"?"left":"top")??0,m=s.get(g.id)??0,y=r.get(g.id)??0;g.gridPadding=c-y-m,g.translation[u]=n[u]+f,g.translation[h]=this.clampToOutsideSeriesRect(o,p+d*(y+m),h,d)}}shouldFlipXY(){return this.series.every(t=>t instanceof Nr&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const n=this.lastAreaWidths.get(i);n!=null&&t.set(i,n)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const n of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(n))return!1;for(const[n,s]of i.axisAreaWidths.entries()){const r=t.axisAreaWidths.get(n);if((s!=null||r!=null)&&s!==r)return!1}return!0}clipAxis(t,i,n){const s=Math.ceil(t.gridLine?.width??0),r=Math.ceil(t.line?.width??0);let{width:a,height:o}=i;switch(a+=t.direction==="x"?s:r,o+=t.direction==="y"?s:r,t.clipGrid(i.x,i.y,a,o),t.position){case"left":case"right":t.clipTickLines(n.x,i.y-s,n.width+s,i.height+s*2);break;case"top":case"bottom":t.clipTickLines(i.x-s,n.y,i.width+s*2,n.height+s);break}}};Yc.className="CartesianChart",Yc.type="cartesian",Yc.AxesPadding=15,v([_t({changeValue(e,t){this.onAxisChange(e,t)}})],Yc.prototype,"axes",2);var pR=Yc;function Um(e,t){return e?t?.width:t?.height}var gR=new Set(["number","log","time"]),fR=e=>oe(e)&&e.type!=null&&!gR.has(e.type),nn={type:"chart",name:"cartesian",version:qe,options:aE,create(e,t){return new pR(e,t)},validate(e,t,i){const n=[];e?.series?.[0]?.type==="histogram"&&Object.values(e?.axes??{}).some(fR)&&(n.push(new Js("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=K(e,["axes"]));const s=Vt(e,t,i);return s.invalid.push(...n),s}},XM={type:"axis",name:"category",chartType:"cartesian",version:qe,dependencies:[nn],options:Uo,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:e=>new Pc(e)},mR=1e3,qM=class lA extends qo{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(t){return t instanceof lA}set domain(t){if(t.length<=mR){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),n=this._domain.find(s=>JSON.stringify(s)===i);if(n!=null)return super.findIndex(n)}},yR=class cA{constructor(t="",i,n){this.label=t,this.parent=i,this.refId=n,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.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=i?i.depth+1:0}insertTick(t,i){let n=this,s;for(let r=0;rh.label===a);if(c&&o)n=c,s=c;else{const h=new cA(a,n,i);h.index=l.length,l.push(h),o&&(n=h),s=h}}return s}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 bR(e){const t=e.reduce((s,r)=>Math.max(s,r.length),0),i=new yR,n=new Map;for(let s=0;s=0;n--){const s=e[n];s.prelim+=t,s.mod+=t,i+=s.change,t+=s.shift+i}}function MR(e,t){const i=e.getLeftSibling();if(i){let n=e,s=e,r=i,a=s.getLeftmostSibling(),o=s.mod,l=n.mod,c=r.mod,h=a.mod;for(;r.nextRight()&&s.nextLeft();){r=r.nextRight(),s=s.nextLeft(),a=a.nextLeft(),n=n.nextRight(),n.ancestor=e;const u=r.prelim+c-(s.prelim+o)+1;u>0&&(vR(xR(r,e,t),e,u),o+=u,l+=u),c+=r.mod,o+=s.mod,h+=a.mod,l+=n.mod}r.nextRight()&&!n.nextRight()?n.mod+=c-l:(s.nextLeft()&&!a.nextLeft()&&(a.mod+=o-h),t=e)}return t}function JM(e){const{children:t}=e;if(t.length){let[i]=t;for(const r of t)JM(r),i=MR(r,i);SR(e);const n=(t[0].prelim+t.at(-1).prelim)/2,s=e.getLeftSibling();s?(e.prelim=s.prelim+1,e.mod=e.prelim-n):e.prelim=n}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function QM(e,t,i){e.position=e.prelim+t,e.separatorDepth=e.index===0?1+(e.parent?.separatorDepth??0):0,i.insertNode(e);for(const n of e.children)QM(n,t+e.mod,i)}function eI(e){const{children:t}=e;let i=0;for(const n of t)eI(n),n.children.length?i+=n.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.leftmostLeaf=t[0].leftmostLeaf):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function IR(e){const t=new DR,{root:i,tickNodes:n}=bR(e);return JM(i),QM(i,-i.prelim,t),eI(i),{layout:t,tickNodes:n}}var DR=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(e){this.depththis.maxPosition&&(this.maxPosition=e.position),this.nodes.push(e)}scaling(e,t){let i=1;return e>0&&this.maxPosition!==this.minPosition&&(i=e/(this.maxPosition-this.minPosition)),t&&(i*=-1),i}resize(e,t,i,n){const s=Math.abs(e[1]-e[0])-t,r=this.scaling(s,e[0]>e[1]),a=i+n/2;let o=0;for(const l of this.nodes){const c=l.position*r;o>c&&(o=c),l.screen=c+a}for(const l of this.nodes)l.screen-=o}},Ta=5,li=class extends ce{constructor(){super(...arguments),this.enabled=!0,this.border=new xa}};v([S],li.prototype,"enabled",2),v([S],li.prototype,"avoidCollisions",2),v([S],li.prototype,"border",2),v([S],li.prototype,"color",2),v([S],li.prototype,"cornerRadius",2),v([S],li.prototype,"spacing",2),v([S],li.prototype,"rotation",2),v([S],li.prototype,"wrapping",2),v([S],li.prototype,"truncate",2),v([S],li.prototype,"fill",2),v([S],li.prototype,"fontStyle",2),v([S],li.prototype,"fontWeight",2),v([S],li.prototype,"fontSize",2),v([S],li.prototype,"fontFamily",2),v([S],li.prototype,"padding",2);var Fd=class extends ce{constructor(){super(...arguments),this.enabled=!0}};v([S],Fd.prototype,"enabled",2),v([S],Fd.prototype,"width",2),v([S],Fd.prototype,"stroke",2);var Wm=class extends ce{constructor(){super(...arguments),this.label=new li,this.tick=new Fd}};v([S],Wm.prototype,"label",2),v([S],Wm.prototype,"tick",2);var Zc=class extends Pc{constructor(e){super(e,new qM),this.tickScale=new qM,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.depthOptions=new oo(Wm),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:n}=this,s=this.horizontal?0:-90;for(let r=0;r{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:n,depthOptions:s,horizontal:r,line:a}=this,o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o),c=this.getTickSpacing();if(this.lineNode.datum=r?{x1:n[0],x2:n[1],y1:0,y2:0}:{x1:0,x2:0,y1:n[0],y2:n[1]},this.lineNode.setProperties({stroke:a.stroke,strokeWidth:a.enabled?a.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return{bbox:U.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:h,nodes:u}=this.tickTreeLayout,d=r?-i.getSideFlag():i.getSideFlag(),p=[],g=new Map,f=new _o,m=this.getDepthOptionsMap(h),y=d*(m[0].spacing+l+c),b=this.tickFormatter(this.scale.domain,this.scale.domain,!1),x=new Map,M={};for(const[Q,ue]of u.entries()){const re=h-ue.depth;if(M[re]??(M[re]=0),!ue.children.length&&eye){g.delete(Q);continue}}const yn=f.getPlainText(),Bi=f.getBoxingProperties();p.push({text:yn,textUntruncated:re.truncatedText,visible:!0,tickId:N(yn),range:this.scale.range,border:Bi.border,color:f.fill,cornerRadius:Bi.cornerRadius,fill:Bi.fill,fontFamily:f.fontFamily,fontSize:f.fontSize,fontStyle:f.fontStyle,fontWeight:f.fontWeight,padding:Bi.padding,rotation:f.rotation,rotationCenterX:f.rotationCenterX,rotationCenterY:f.rotationCenterY,textAlign:f.textAlign,textBaseline:f.textBaseline,x:f.x,y:f.y}),g.set(Q,Je.toCanvas(f))}const R=(C[h-1]??0)+l+c,B=[this.lineNodeBBox(),U.merge(g.values()),new U(0,0,R*d,0)],E=U.merge(B),V=r?E.height:E.width,{spacing:G,scrollbarLayout:q}=this.applyScrollbarLayout(B,V,o);this.layout.labelThickness=V,this.layout.scrollbar=q,t.enabled&&B.push(this.titleBBox(this.scale.domain,G));const j=U.merge(B);return this.layoutCrossLines(),{bbox:j,spacing:G,tickSizeAtDepth:C,tickLabelLayout:p}}buildDepthsMap(e){const{tickNodes:t,tickScale:i,tickTreeLayout:n}=this;if(!n||!t)return new Map;const s=n.depth,r=new Map;for(const a of e){const o=t.get(a),l=o==null?s-1:Math.min(o.separatorDepth,s-1);r.set(a,l)}if(i.step1){const a=e.at(-1);if(a&&!t.has(a)){const o=e.at(-2),l=o?r.get(o):void 0;l!=null&&r.set(a,l)}}return r}filterTicksTopDown(e,t){const{tickScale:i,tickTreeLayout:n,tickNodes:s,leafNodeToKey:r}=this;if(!n||s==null||r==null)return{ticks:e,depthsMap:new Map};const a=i.range,o=i.step,l=i.inset,c=i.bandwidth,h=t?.[0]??0,u=t?.[1]??1,d=this.filterTickCache;if(d&&d.range0===a[0]&&d.range1===a[1]&&d.step===o&&d.inset===l&&d.bandwidth===c&&d.vr0===h&&d.vr1===u)return d.result;const p=E=>(this.filterTickCache={range0:a[0],range1:a[1],step:o,inset:l,bandwidth:c,vr0:h,vr1:u,result:E},E);if(i.step>=Ta)return p({ticks:e,depthsMap:this.buildDepthsMap(e)});const g=this.ftdPositions;g.clear();const f=this.ftdCandidates;f.clear();const m=this.ftdKept;m.clear();const y=this.ftdStack;y.length=0;const b=E=>(g.has(E)||g.set(E,i.convert(E)),g.get(E)),x=E=>{let V=0;for(const G of E)if(Number.isFinite(b(G))&&(V+=1,V>1))break;return V};let M=e;if(t!=null&&(t[0]!==0||t[1]!==1)){const E=i.domain,V=E.length;if(V>0){const G=Math.max(0,Math.floor(t[0]*V)-1),q=Math.min(V-1,Math.ceil(t[1]*V));if(e.length===0)M=E.slice(G,q+1);else{const j=E[G],Q=E[q],ue=e[0],re=e.at(-1),He=j!=null&&j!==ue,Ze=Q!=null&&Q!==re;if(He||Ze){const ve=He?[j]:[];ve.push(...e),Ze&&ve.push(Q),M=ve}}}}if(x(M)<=1)return p({ticks:M,positions:g,depthsMap:this.buildDepthsMap(M)});for(const E of M)f.add(E);for(const E of M){let G=s.get(E)?.parent;for(;G?.parent;){const q=r.get(G.leftmostLeaf);q!=null&&f.add(q),G=G.parent}}const I=Math.max(0,n.depth-1),C=E=>Math.min(I,n.depth-E.depth),D=n.nodes[0];if(!D?.children.length)return p({ticks:M,positions:g,depthsMap:this.buildDepthsMap(M)});const A=this.ftdByDepth;for(const E of A)E.positions.length=0,E.ticks.length=0;const k=(E,V)=>{const G=E.at(-1);return G!=null&&V-G{for(let G=V+1;G<=I;G++)if(k(A[G].positions,E))return!1;return!k(A[V].positions,E)},T=(E,V,G)=>{const q=A[G];q.positions.push(E),q.ticks.push(V)},R=(E,V)=>{if(V!==0)for(let G=0;G0&&E-q.positions.at(-1)=0;E--){const V=D.children[E],G=r.get(V.leftmostLeaf);G!=null&&f.has(G)&&y.push(V)}for(;y.length;){const E=y.pop(),V=r.get(E.leftmostLeaf);if(V==null||!f.has(V))continue;const G=b(V);if(G==null||!Number.isFinite(G))continue;if(m.has(V)){for(let j=E.children.length-1;j>=0;j--)y.push(E.children[j]);continue}const q=C(E);if(N(G,q)){m.add(V),T(G,V,q),R(G,q);for(let j=E.children.length-1;j>=0;j--)y.push(E.children[j])}}for(const E of M){if(s.has(E))continue;const V=b(E);if(V==null||!Number.isFinite(V)||m.has(E))continue;const G=0;N(V,G)&&(m.add(E),T(V,E,G),R(V,G))}const B=M.filter(E=>m.has(E));return p({ticks:B,positions:g,depthsMap:this.buildDepthsMap(B)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:n,visibleRange:s,tickTreeLayout:r}=this;if(!r)return;const{tickSizeAtDepth:a,spacing:o}=this.computedLayout,{depth:l}=r,c=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(c),u=this.getTickSpacing(),{position:d,horizontal:p,gridPadding:g}=this,f=d==="bottom"||d==="right"?-1:1,m=g,y=f*n-g,b={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:x}=e.ticks(b,void 0,s);const M=this.filterTicksTopDown(x,s);x=M.ticks;const{depthsMap:I}=M,C=A=>I.get(A)??l-1,D=x.map((A,k)=>({index:e.findIndex(A),tickId:Zt(k,...A),translation:Math.round(M.positions?.get(A)??e.convert(A))}));this.gridLineGroupSelection.update(i.enabled&&n?this.calculateGridLines(D,m,y):[]),this.gridFillGroupSelection.update(i.enabled&&n?this.calculateGridFills(D,m,y):[]),this.tickLineGroupSelection.update(t.enabled?x.map((A,k)=>{const{tickId:N,translation:T}=D[k],R=C(A),B=this.depthOptions[R]?.tick,E=a[R]??0,V=B?.stroke??t.stroke,G=B?.enabled===!1?0:B?.width??t.width,q=-f*E,j=-f*(h+u),[Q,ue,re,He]=p?[T,j,T,j+q]:[j,T,j+q,T];return{tickId:N,offset:T,x1:Q,y1:ue,x2:re,y2:He,stroke:V,strokeWidth:G,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,o),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(e,t){this.chartLayout=t;const{tickSizeAtDepth:i,tickLabelLayout:n,spacing:s,bbox:r}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:n,spacing:s},{bbox:r,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=>wl(l.getDomain(e)));this.dataDomain={domain:na(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(tI),{layout:n,tickNodes:s}=IR(i);this.tickTreeLayout=n,this.tickNodes=s,this.leafNodeToKey=new Map;for(const[l,c]of s)this.leafNodeToKey.set(c,l);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,n.depth-1)+1},()=>({positions:[],ticks:[]}));const r=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||r.push(this.dataDomain.domain[l.refId]);const a=pb(this.dataDomain.domain,r);this.scale.domain=a;const o=a.map(tI);o.push([""]),this.tickScale.domain=o}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const n=le(i)?JSON.stringify(i):i;return t.has(n)?!1:(t.add(n),!0)})}};Zc.className="GroupedCategoryAxis",Zc.type="grouped-category",v([S],Zc.prototype,"depthOptions",2);function tI(e){return kl(oe(e)&&"value"in e?e.value:e)}var iI={type:"axis",name:"grouped-category",chartType:"cartesian",version:qe,dependencies:[nn],options:Wo,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:e=>new Zc(e)},ul=class extends Qi{getVisibleDomain(e){const[t,i]=e,[n,s]=this.visibleRange;if(e.length<2)return[t,i];const r=Math.min(t,i),a=Math.max(t,i);if(r>=0){const o=Math.log(t),c=Math.log(i)-o;return[Math.exp(o+n*c),Math.exp(o+s*c)]}if(a<=0){const o=-Math.log(-t),c=-Math.log(-i)-o;return[-Math.exp(-(o+n*c)),-Math.exp(-(o+s*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(e){const{min:t,max:i,preferredMin:n,preferredMax:s}=this,{extent:r,clipped:a}=Iu(e.domain,t,i,n,s,void 0,e.sortMetadata?.sortOrder);return r[0]<0&&r[1]>0||e.domain[0]<0&&e.domain[1]>0?(z.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:a}):r[0]===0||r[1]===0||e.domain[0]===0||e.domain[1]===0?(z.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:a}):{domain:r,clipped:a}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new im)}};ul.className="LogAxis",ul.type="log";var nI={type:"axis",name:"log",chartType:"cartesian",version:qe,dependencies:[nn],options:Yo,themeTemplate:{base:10,line:{enabled:!1}},create:e=>new ul(e)},sI={type:"axis",name:"number",chartType:"cartesian",version:qe,dependencies:[nn],options:Ko,themeTemplate:{line:{enabled:!1}},create:e=>new Qi(e)},rI={type:"axis",name:"time",chartType:"cartesian",version:qe,dependencies:[nn],options:Zo,themeTemplate:{gridLine:{enabled:!1}},create:e=>new os(e)},aI=class extends Pc{calculateGridLine({index:e,tickId:t,translation:i},n,s,r,a){const{gridLine:o,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:e,tickId:t,translation:i},n,s,r,a);const u=a[n-1],d=u?i-(i-u.translation)/2:h[0],[p,g,f,m]=l?[d,Math.max(s,r),d,Math.min(s,r)]:[Math.min(s,r),d,Math.max(s,r),d],{style:y}=o,{stroke:b,strokeWidth:x=0,lineDash:M}=y[e%y.length]??{};return{tickId:t,offset:d,x1:p,y1:g,x2:f,y2:m,stroke:b,strokeWidth:x,lineDash:M}}calculateGridFills(e,t,i){return this.interval.placement!=="between"?super.calculateGridFills(e,t,i):e.map((n,s)=>this.calculateGridFill(n,s,n.index,t,i,e))}calculateGridFill({tickId:e,translation:t},i,n,s,r,a){const{gridLine:o,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:e,translation:t},i,n,s,r,a);const u=a[i-1],d=a[i+1],p=u?t-(t-u.translation)/2:h[0],g=d?t+(d.translation-t)/2:h[1],[f,m,y,b]=l?[p,Math.max(s,r),g,Math.min(s,r)]:[Math.min(s,r),p,Math.max(s,r),g],{fill:x,fillOpacity:M}=o.style[n%o.style.length]??{};return{tickId:e,x1:f,y1:m,x2:y,y2:b,fill:x,fillOpacity:M}}calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,r,a=0){const{horizontal:o,interval:l,primaryTick:c,range:h,tick:u}=this;if(l.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,r,a);const d=e&&c?.enabled?c:u,p=-s*this.getTickSize(d),g=r[n-1],f=g?i-(i-g.translation)/2:h[0],m=-s*(a+this.getTickSpacing(d)),[y,b,x,M]=o?[f,m,f,m+p]:[m,f,m+p,f],{stroke:I,width:C}=d;return{tickId:t,offset:f,x1:y,y1:b,x2:x,y2:M,stroke:I,strokeWidth:C,lineDash:void 0}}},Gs=class extends aI{constructor(e){super(e,new Ar,!1),this.defaultTickMinSpacing=20,this.parentLevel=new il,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&&enew Gs(e)},lI=[sI,nI,rI,XM,iI,oI];function Vd(e,t,i,n,s){const r=(u,d,p,g)=>{i.animate({id:`${e}_${t}_${d.id}_${u}`,groupId:e,from:p?1:0,to:1,ease:Sc,collapsable:p,onUpdate(f,m){m&&u!=="removed"||(d.path.clear(!0),g(f,d),d.checkPathDirty())},onStop(){u==="added"&&(d.path.clear(!0),g(1,d),d.checkPathDirty())},phase:Vn[u]})},a=new At,o=u=>(a.resetPathDirty(),u(0,a),a.resetPathDirty(),u(1,a),a.checkPathDirty(),a.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=s;for(const u of n)i.isSkipped()||(r("removed",u,!o(h),h),r("updated",u,!o(c),c)),r("added",u,!o(l),l)}function Na(e,t,i,n,s,r,a=["series",`${e.declarationOrder}`,"label"]){if(e.visible&&n.itemStyler){const o=e.getHighlightStateString(r,s||t!=null&&r?.series===t.series&&r?.datumIndex===t.datumIndex,t?.datumIndex),l=typeof t?.datumIndex=="number"?t.datumIndex:t?.itemId,c={border:n.border,color:n.color,cornerRadius:n.cornerRadius,datum:t?.datum,enabled:n.enabled,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,itemId:l,itemType:t?.itemType,seriesId:e.id,padding:n.padding,highlightState:o},h=e.ctx.optionsGraphService.resolvePartial(a,e.cachedCallWithContext(n.itemStyler,{...i,...c}),{pick:!1})??{};return xe(h,c)}return n}function cI(e,t,i,n,s,r,a){if(e.visible&&n.enabled&&s){const o=Na(e,t.datum,i,n,r,a);t.visible=!0,t.x=s.x,t.y=s.y,t.text=s.text,t.fill=o.color,t.setAlign(s),t.setFont(o),t.setBoxing(o)}else t.visible=!1}var CR={"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 hI({isUpward:e,isVertical:t,placement:i,spacing:n=0,rect:s}){let r=s.x+s.width/2,a=s.y+s.height/2,o="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:u}=CR[i],d=(h+1)*.5;if(t){const p=e?s.y+s.height:s.y,g=s.height*c;a=p+g*d+n*u*c,l=u===c?"top":"bottom"}else{const p=e?s.x:s.x+s.width,g=s.width*c;r=p+g*d+n*u*c,o=u===c?"left":"right"}}return{x:r,y:a,textAlign:o,textBaseline:l}}var AR=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=Math.max(0,this.timeout-this.minimumDelay);typeof requestIdleCallback=="function"?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:e}):this.idleCallbackId=setTimeout(()=>this.execute(),e)}cancelScheduled(){this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId!=null&&(typeof cancelIdleCallback=="function"?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:e}=this;if(!e)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const t=e.computation();return e.onComplete(t),t}},_d=class{constructor(){this._dataLength=0,this.executor=new AR}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:n}=t;return n&&this.executor.schedule(n,s=>{this.mergeFilters(s)}),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>=2||t<=.5||this._dataLength===0)this._filters=void 0;else if(this._filters)for(const i of this._filters)i.stale=!0;this._dataLength=e,this.executor.cancel()}mergeFilters(e){if(!this._filters||e.length===0)return;const t=[...this._filters,...e];t.sort((i,n)=>i.maxRange-n.maxRange),this._filters=t}};function ht({id:e},t,i,...n){for(const s of n)s.cleanup();Fs(e,t,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function Bd({id:e},t,i,...n){Fs(e,t,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Oa(e){return{opacity:1}}var wR=10;function zd(e,t,i,n,s,r,a){const o=e[r];if(o===void 0)return-1;const l=Number.isFinite(t)?un(o,t,i,a):po(r,e.length),c=au(l,s);return r===n[c+cn]||r===n[c+kn]||r===n[c+Ln]||r===n[c+Tn]?c:-1}function uI(e,t,i,n,s,r,a,o,l){let c=0,h=0,u=-1;for(let m=0;my.maxRange===h);let{indexData:d,valueData:p}=As(t,i,i,r,a,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),{indices:g,metaIndices:f}=uI(t,r,a,d,h,o,s,u?.indices,u?.metaIndices);const m=[{maxRange:h,metaIndices:f,indices:g,indexData:d,valueData:p}];for(;g.length>wR&&h>cr;){const y=h,b=Math.trunc(y/2),x=c?.find(B=>B.maxRange===b),M=Jr(d,p,y,{reuseIndexData:x?.indexData,reuseValueData:x?.valueData});h=M.maxRange,d=M.indexData,p=M.valueData;const I=g;let C=0,D=0,A=-1;for(const B of I){const E=zd(t,r,a,d,h,B,o);E!==-1&&(C++,E!==A&&(D++,A=E))}D++;const k=x?.indices?.length===C?x.indices:new Uint32Array(C),N=x?.metaIndices?.length===D?x.metaIndices:new Uint32Array(D);let T=0,R=0;A=-1;for(const B of I){const E=zd(t,r,a,d,h,B,o);E!==-1&&(E!==A&&(N[R++]=T,A=E),k[T++]=B)}N[R]=C-1,g=k,f=N,m.push({maxRange:h,metaIndices:f,indices:g,indexData:d,valueData:p})}return m.reverse(),m}function kR(e,t,i,n){const s=t.length;if(sM.maxRange===d),{indexData:g,valueData:f}=As(t,i,i,r,a,d,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),{indices:m,metaIndices:y}=uI(t,r,a,g,d,o,s,p?.indices,p?.metaIndices),b={maxRange:d,indices:m,metaIndices:y,indexData:g,valueData:f};function x(){return Km([r,a],t,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(I=>I.maxRange!==d)??[]}return{immediate:[b],computeRemaining:x}}function LR(e,t,i,n,s,r){const[a,o]=hn(e,n);return Km([a,o],t,i,{xNeedsValueOf:s,yNeedsValueOf:r})}var TR=cc(LR);function NR(e,t,i,n,s,r){const a=t.resolveKeysById(s,"xValue",i),o=t.resolveColumnById(s,n,i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,n,i);if(r){const[u,d]=hn(e,l);return Km([u,d],a,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:r})}return TR(e,a,o,l,c,h)}function OR(e,t,i,n,s,r,a){const o=t.resolveKeysById(s,"xValue",i),l=t.resolveColumnById(s,n,i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,n,i),[d,p]=hn(e,c);return kR([d,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:u,targetRange:r,existingFilters:a})}var us=class extends gf{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};v([S,Y()],us.prototype,"enabled",2),v([S,Y()],us.prototype,"color",2),v([S,Y()],us.prototype,"xOffset",2),v([S,Y()],us.prototype,"yOffset",2),v([S,Y()],us.prototype,"blur",2);var Si=class extends gf{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:n,stroke:s,strokeWidth:r,strokeOpacity:a,lineDash:o,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:a,lineDash:o,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};v([S,Y()],Si.prototype,"enabled",2),v([S,pa({equals:To})],Si.prototype,"shape",2),v([S,Y()],Si.prototype,"size",2),v([S,pa({equals:yt})],Si.prototype,"fill",2),v([S,Y()],Si.prototype,"fillOpacity",2),v([S,Y()],Si.prototype,"stroke",2),v([S,Y()],Si.prototype,"strokeWidth",2),v([S,Y()],Si.prototype,"strokeOpacity",2),v([S],Si.prototype,"lineDash",2),v([S],Si.prototype,"lineDashOffset",2),v([S,pa({equals:To})],Si.prototype,"itemStyler",2);function ER(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 dI=class extends ce{constructor(){super(...arguments),this.enabled=!1}};v([S],dI.prototype,"enabled",2);var js=class extends ce{constructor(){super(...arguments),this.interaction=new dI,this.position=new Go,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const n=this.renderer==null?void 0:Nn(e,this.renderer,i);if(rt(n)||Hi(n)||Sn(n))return{type:"raw",rawHtmlString:ft(n)};if(n!=null){const s=xe(n.symbol?.marker,t.symbol?.marker),r=n.symbol?.line??t.symbol?.line?xe(n.symbol?.line,t.symbol?.line):void 0,a=t.symbol||n.symbol?{marker:s,line:ER(r,s)}:void 0;return{type:"structured",...t,...n,symbol:a}}return{type:"structured",...t}}};v([S],js.prototype,"enabled",2),v([S],js.prototype,"showArrow",2),v([S],js.prototype,"renderer",2),v([S],js.prototype,"interaction",2),v([S],js.prototype,"position",2),v([S],js.prototype,"range",2),v([S],js.prototype,"class",2);function Ea(){return new js}var mt=class extends Bn{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 co,this.shadow=new us,this.marker=new Si,this.label=new Ji,this.tooltip=Ea(),this.connectMissingData=!1}};v([S],mt.prototype,"xKey",2),v([S],mt.prototype,"xName",2),v([S],mt.prototype,"yKey",2),v([S],mt.prototype,"yName",2),v([S],mt.prototype,"selectedKey",2),v([S],mt.prototype,"stackGroup",2),v([S],mt.prototype,"normalizedTo",2),v([S],mt.prototype,"fill",2),v([S],mt.prototype,"fillOpacity",2),v([S],mt.prototype,"stroke",2),v([S],mt.prototype,"strokeWidth",2),v([S],mt.prototype,"strokeOpacity",2),v([S],mt.prototype,"lineDash",2),v([S],mt.prototype,"lineDashOffset",2),v([S],mt.prototype,"interpolation",2),v([S],mt.prototype,"styler",2),v([S],mt.prototype,"shadow",2),v([S],mt.prototype,"marker",2),v([S],mt.prototype,"label",2),v([S],mt.prototype,"tooltip",2),v([S],mt.prototype,"connectMissingData",2);function Tt(e,t,i){return(t-e)*i+e}function pI(e,t){const{x0:i,y0:n,x1:s,y1:r}=e,o=(r-n)/(s-i)*(t-i)+n;return{leftCp1x:i,leftCp1y:n,leftCp2x:t,leftCp2y:o,stepX:t,stepY0:o,stepY1:o,rightCp1x:t,rightCp1y:o,rightCp2x:s,rightCp2y:r}}function RR(e,t){const{cp0x:i,cp0y:n,cp1x:s,cp1y:r,cp2x:a,cp2y:o,cp3x:l,cp3y:c}=e,h=ju(i,s,a,l,t),[u,d]=bc(i,n,s,r,a,o,l,c,h),p=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function PR(e){const{x0:t,y0:i,x1:n,y1:s,stepX:r}=e;return{leftCp1x:(t+r)/2,leftCp1y:i,leftCp2x:(t+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:s,rightCp1x:(r+n)/2,rightCp1y:s,rightCp2x:(r+n)/2,rightCp2y:s}}function gI(e,t){return e.type==="linear"?pI(e,t):e.type==="cubic"?RR(e,t):e.type==="step"?PR(e):pI(e,t)}function fI(e,t,i,n,s,r,a){switch(t){case 0:a?e.moveTo(s,r):e.moveTo(i,n);break;case 1:a?e.lineTo(s,r):e.lineTo(i,n);break;case 2:break}}function mI(e,t,i,n,s,r){r?e.lineTo(t,i):e.lineTo(n,s)}function yI(e,t,i,n,s,r,a,o,l,c){c?e.cubicCurveTo(r,a,n,s,t,i):e.cubicCurveTo(n,s,r,a,o,l)}function bI(e,t,i,n,s,r,a){a?(e.lineTo(r,s),e.lineTo(r,i),e.lineTo(t,i)):(e.lineTo(r,i),e.lineTo(r,s),e.lineTo(n,s))}function FR(e,t,i,n,s,r,a){if(a){for(let o=r.length-1;o>=0;o--){const{x:l,y:c}=r[o];e.lineTo(l,c)}e.lineTo(t,i)}else{for(const{x:o,y:l}of r)e.lineTo(o,l);e.lineTo(n,s)}}function Xc(e,t,i,n){const[s,r]=xi(t);switch(fI(e,i,s.x,s.y,r.x,r.y,n),t.type){case"linear":mI(e,t.x0,t.y0,t.x1,t.y1,n);break;case"cubic":yI(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,n);break;case"step":bI(e,t.x0,t.y0,t.x1,t.y1,t.stepX,n);break;case"multi-line":FR(e,t.x0,t.y0,t.x1,t.y1,t.midPoints,n);break}}function vI(e,t,i){const[n,s]=xi(e),[r,a]=xi(t),o=Tt(n.x,r.x,i),l=Tt(n.y,r.y,i),c=Tt(s.x,a.x,i),h=Tt(s.y,a.y,i);return[{x:o,y:l},{x:c,y:h}]}function Ym(e,t,i,n,s,r){const[{x:a,y:o},{x:l,y:c}]=vI(t,i,n);if(fI(e,s,a,o,l,c,r),t.type==="cubic"&&i.type==="cubic"){const h=Tt(t.cp1x,i.cp1x,n),u=Tt(t.cp1y,i.cp1y,n),d=Tt(t.cp2x,i.cp2x,n),p=Tt(t.cp2y,i.cp2y,n);yI(e,a,o,h,u,d,p,l,c,r)}else if(t.type==="step"&&i.type==="step"){const h=Tt(t.stepX,i.stepX,n);bI(e,a,o,l,c,h,r)}else if(t.type==="linear"&&i.type==="linear")mI(e,a,o,l,c,r);else{let h;t.type==="step"?h=t.stepX:i.type==="step"?h=i.stepX:h=(a+l)/2;const u=gI(t,h),d=gI(i,h),p=Tt(u.leftCp1x,d.leftCp1x,n),g=Tt(u.leftCp1y,d.leftCp1y,n),f=Tt(u.leftCp2x,d.leftCp2x,n),m=Tt(u.leftCp2y,d.leftCp2y,n),y=Tt(u.stepX,d.stepX,n),b=Tt(u.stepY0,d.stepY0,n),x=Tt(u.stepY1,d.stepY1,n),M=Tt(u.rightCp1x,d.rightCp1x,n),I=Tt(u.rightCp1y,d.rightCp1y,n),C=Tt(u.rightCp2x,d.rightCp2x,n),D=Tt(u.rightCp2y,d.rightCp2y,n);r?(e.cubicCurveTo(C,D,M,I,y,x),e.lineTo(y,b),e.cubicCurveTo(f,m,p,g,a,o)):(e.cubicCurveTo(p,g,f,m,y,b),e.lineTo(y,x),e.cubicCurveTo(M,I,C,D,l,c))}}var xI=1e3,SI=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(SI||{});function VR(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 ci(e){return Bu(e).valueOf()}function Xt(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(br(t)){if(typeof e=="number"){const{firstBandTime:s,intervalMs:r,bandCount:a,inset:o,step:l}=t,c=Math.round((e-s)/r);if(c>=0&&cci(s)===i);return n===-1&&(n=t.domain.findIndex(s=>VR(e,s))),n>=0?t.inset+t.step*n:Number.NaN}function MI({data:e},t){return e.map((i,n)=>({xValue0Index:t.indexOf(ci(i.xValue0)),xValue1Index:t.indexOf(ci(i.xValue1)),datumIndex:n}))}function II(e){return Object.values(e.scales).every(t=>t.type==="category"?br(t)?t.bandCount({axisValue:h,value:u}));n.sort((h,u)=>Xt(h.value,e.scales.x)-Xt(u.value,e.scales.x));const s=[];for(const{xValue0:h,xValue1:u}of t.data){const d=ci(h),p=ci(u);i.has(d)||(i.set(d,h),s.push({axisValue:d,value:h})),i.has(p)||(i.set(p,u),s.push({axisValue:p,value:u}))}s.sort((h,u)=>Xt(h.value,t.scales.x)-Xt(u.value,t.scales.x));const r=n;let a=0;for(const h of s){for(let u=r.length-1;u>=a;u-=1){const d=Xt(h.value,t.scales.x),p=Xt(r[u].value,t.scales.x);if(d>p){a=u+1;break}}r.splice(a,0,h),a+=1}if(!BR(r,t))return;const o=r.map(h=>h.axisValue),l=MI(t,o),c=MI(e,o);return{axisValues:o,oldDataAxisIndices:l,newDataAxisIndices:c}}function DI(e,t,i,n,s){if(s.xValue1Index===s.xValue0Index+1)return e;const r=xi(e);let a,o;if(t.scales.x?.type==="category"){const l=(r[1].x-r[0].x)/(s.xValue1Index-s.xValue0Index);a=r[0].x+(n-s.xValue0Index)*l,o=a+l}else{const l=i[n],c=i[n+1];a=Xt(l,t.scales.x),o=Xt(c,t.scales.x)}return uf(e,a,o)}function CI(e,t){const[i,n]=xi(e),s=Xt(0,t.scales.y);return ko(e,{x:i.x,y:s},{x:n.x,y:s})}function AI(e){const[t,i]=xi(e);return Hu(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function wI(e,t,i,n,s,r){let a,o;if(s.xValue0Index>=r.xValue1Index){const u=n.findLast(p=>p.xValue1Index<=r.xValue1Index)?.datumIndex,d=u==null?void 0:i.data[u];a=d?.xValue1,o=d?.yValue1}else if(s.xValue0Index<=r.xValue0Index){const u=n.find(p=>p.xValue0Index>=r.xValue0Index)?.datumIndex,d=u==null?void 0:i.data[u];a=d?.xValue0,o=d?.yValue0}if(a==null||o==null)switch(t){case 0:return CI(e,i);case 1:return AI(e)}const l=Xt(a,i.scales.x),c=Xt(o,i.scales.y),h={x:l,y:c};return ko(e,h,h)}function Zm(e,t){if(t==null)return;const i=ci(e.xValue0),n=ci(e.xValue1);return t.find(s=>ci(s.xValue0)===i&&ci(s.xValue1)===n)?.span}function kI(e,t,i,n,s,r,a){const o=e.data[n.datumIndex],l=o.span,c=Zm(o,s);if(c==null){const h=wI(l,t,e,i,n,r);a.added.push({from:h,to:l})}else a.removed.push({from:c,to:c}),a.moved.push({from:c,to:l}),a.added.push({from:l,to:l})}function LI(e,t,i,n,s,r,a){const o=e.data[n.datumIndex],l=o.span,c=Zm(o,s);if(c==null){const h=wI(l,t,e,i,n,r);a.removed.push({from:l,to:h})}else a.removed.push({from:l,to:l}),a.moved.push({from:l,to:c}),a.added.push({from:c,to:c})}function TI(e,t,i,n,s){const r=n.scales.x,a=t[s.xValue0Index],o=t[s.xValue1Index];let l,c;if(r?.type==="continuous"||r?.type==="log"?(l=i.data.findLast(y=>ci(y.xValue0)<=a),c=i.data.find(y=>ci(y.xValue1)>=o)):(l=i.data.find(y=>ci(y.xValue0)===a),c=i.data.find(y=>ci(y.xValue1)===o)),l==null||c==null)return;const[{x:h},{x:u}]=xi(e),d=Xt(l.xValue0,i.scales.x),p=Xt(l.yValue0,i.scales.y),g=Xt(c.xValue1,i.scales.x),f=Xt(c.yValue1,i.scales.y);let m=n.data[s.datumIndex].span;return m=ko(m,{x:d,y:p},{x:g,y:f}),m=uf(m,h,u),m}function GR(e,t,i,n,s,r,a,o,l){const c=s+1,h=a.find(x=>x.xValue0Index<=s&&x.xValue1Index>=c),u=r.find(x=>x.xValue0Index<=s&&x.xValue1Index>=c),d=t.zeroData,p=e.zeroData;if(h==null&&u!=null){kI(e,i,r,u,d,o,l);return}else if(h!=null&&u==null){LI(t,i,a,h,p,o,l);return}else if(h==null||u==null)return;let g;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?g=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?g=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?g=1:g=0;const f=t.data[h.datumIndex],m=DI(f.span,t,n,s,h),y=e.data[u.datumIndex],b=DI(y.span,e,n,s,u);if(g===1){const x=TI(m,n,t,e,u);x==null?LI(t,i,a,h,p,o,l):(l.removed.push({from:m,to:x}),l.moved.push({from:x,to:b}),l.added.push({from:b,to:b}))}else if(g===-1){const x=TI(b,n,e,t,h);x==null?kI(e,i,r,u,d,o,l):(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:x}),l.added.push({from:x,to:b}))}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:b}),l.added.push({from:b,to:b})}function jR(e,t,i,n){const s={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:a,newDataAxisIndices:o}=e,l={xValue0Index:Math.max(a.at(0)?.xValue0Index??-1/0,o.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(a.at(-1)?.xValue1Index??1/0,o.at(-1)?.xValue1Index??1/0)};for(let c=0;ce.data.length&&e.data.length>0){const a=e.data.at(-1).span,[,o]=xi(a),l=Hu(a,o);for(let c=r;ct.data.length&&t.data.length>0){const a=t.data.at(-1).span,[,o]=xi(a),l=Hu(a,o);for(let c=r;cs.point);let n=Yx(i);switch(t.type){case"linear":break;case"smooth":n=Xx(i,t.tension);break;case"step":n=Zx(i,t.position);break}return n.map(function(r,a){return{span:r,xValue0:e[a].xDatum,yValue0:e[a].yDatum,xValue1:e[a+1].xDatum,yValue1:e[a+1].yDatum}})}function Gd(e,t,i=.001){return Math.abs(e.x-t.x)jd(l,c,t.removed),r=(l,c)=>jd(l,c,t.moved),a=(l,c)=>jd(l,c,t.added),o=qm(e,i,n);return{status:e,path:{addPhaseFn:a,updatePhaseFn:r,removePhaseFn:s},pathProperties:o}}function qm(e,t,i=1){const n=t==="none"?"updated":e,s={fromFn(r,a){const o={phase:Vn[n]},l=r.previousDatum??a;return l!=null&&(o.segments=l),e==="removed"?o.finish={visible:!1}:e==="added"&&(o.start={visible:!0}),o},toFn(r,a){const o={phase:Vn[n]},l=a;return l!=null&&(o.segments=l),o}};return t==="fade"?{fromFn(r,a){const o=e==="added"?0:i,l=e==="removed"?r.previousDatum??a:a;return{...s.fromFn(r,a),opacity:o,segments:l}},toFn(r,a){const o=e==="removed"?0:i,l=e==="removed"?r.previousDatum??a:a;return{...s.toFn(r,a),opacity:o,segments:l}}}:s}function UR(e,t,i,n=1){const s=e.scales.x?.type==="category",r=t.scales.x?.type==="category";if(s!==r||!vc(e.scales.x)||!vc(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const o=qc({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(o==null)return;const l=OI(a,o,"fade",n),c=(i?.changed??!0)||!da(e.scales.x,t.scales.x)||!da(e.scales.y,t.scales.y)||a!=="updated";return{status:a,stroke:l,hasMotion:c}}function EI({path:e},{spans:t,phantomSpans:i}){let n=0,s={x:Number.NaN,y:Number.NaN},r={x:Number.NaN,y:Number.NaN};for(let a=0;a=n;p-=1)Xc(e,i[p].span,1,!0);e.closePath(),Xc(e,o,0,!1),n=a}s=h,r=d}for(let a=t.length-1;a>=n;a-=1)Xc(e,i[a].span,1,!0);e.closePath()}function Jm(e,{path:t},i,n){for(let s=0;sJm(l,c,t.removed,i.removed),r=(l,c)=>Jm(l,c,t.moved,i.moved),a=(l,c)=>Jm(l,c,t.added,i.added),o=qm(e,n);return{status:e,path:{addPhaseFn:a,updatePhaseFn:r,removePhaseFn:s},pathProperties:o}}function WR(e,t){const i=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(i!==n||!vc(e.scales.x)||!vc(t.scales.x))return;let s="updated";t.visible&&!e.visible?s="removed":!t.visible&&e.visible&&(s="added");const r=qc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(r==null)return;const a=qc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(a==null)return;const o=qc({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(o==null)return;const l="none",c=RI(s,r,a,l),h=OI(s,o,l);return{status:s,fill:c,stroke:h}}function Qc({id:e},t,i,n,...s){const r={...n,phase:n?.phase??(i?Vn[i]:"trailing")};Fs(e,"markers",t,s,{opacity:0},{opacity:1},r);for(const a of s)a.cleanup()}function KR({id:e},t,...i){Fs(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const n of i)n.cleanup()}function Qm({id:e,nodeDataDependencies:t},i,n,...s){const r=t.seriesRectWidth;xt(e,"markers",i,s,{fromFn:(l,c)=>{const h=c.midPoint?.x??r;let u=te(0,n0(h/r),1);return Number.isNaN(u)&&(u=0),{scalingX:0,scalingY:0,delay:n?.delay??u,duration:n?.duration??Uf,phase:n?.phase??"initial",start:n?.start,finish:n?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function Hd(e){return{opacity:1,scalingX:1,scalingY:1}}function $d(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const s of i){const r=s.datum;if(r?.point==null)continue;const{x:a,y:o}=r.point;!Number.isFinite(a)||!Number.isFinite(o)||s.resetAnimationProperties(a,o,s.size,1,1,1)}t.cleanup()})}}function eh(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 Ud(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const n=i[t],{point:s}=n??{};if(n==null||s==null)return;const r=e.getFormattedMarkerStyle(n),a=kt.anchor(r.shape),o=s.focusSize??r.size,l=4+o,c=l/2,h=(a.x-.5)*o,u=(a.y-.5)*o,d=n.point.x-c-h,p=n.point.y-c-u;return Je.toCanvas(e.contentGroup,new U(d,p,l,l))}function ey(e,t,i,n=i){if(!(n.enabled??i.enabled))return!1;const r=1;return(t.step??qr(t.range)/Math.max(1,e))>r}function Wd(e,t,i,n){return n??(n={stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}),ym.reduce((s,r)=>(s[r]=e.getMarkerStyle(i,{},void 0,{highlightState:r},void 0,n),s),{})}function ty({id:e,visible:t,nodeDataDependencies:i},n,...s){const{seriesRectWidth:r,seriesRectHeight:a}=i;Fs(e,"path_properties",n,s,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:a,visible:t},finish:{clip:!1,visible:t}})}function iy({id:e},t,i,n="add",...s){Fs(e,t,i,s,{opacity:0},{opacity:1},{phase:n})}function ny(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Kd({nodeDataDependencies:e},t){const i=n=>Number.isFinite(n)?n:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}function PI(e){return e.isReversed()!==e.range[1]PI(c?t:i)?c?n.width+d:n.height+p:c?-d:-p,f=()=>PI(c?t:i)?c?-d:-p:c?n.width+d:n.height+p;return(y=>{const b=[];let x=-1;for(let M=0;MV.start!=null)?.start;let T=o.convert(C??k)-u,R=o.convert(D??N)+2*u;const B=C!=null&&Number.isNaN(T),E=D!=null&&Number.isNaN(R);B||E||(Number.isNaN(T)&&(T=g()),Number.isNaN(R)&&(R=f()),D!=null&&(x=M),b.push({start:T,stop:R,...A}))}return b})(e.segments).map(({stop:y,start:b,...x})=>{const M=c?b:-d,I=c?-p:b,C=c?y+h:n.width+d,D=c?n.height+p:y+h;return{clipRect:{x0:M,y0:I,x1:C,y1:D},...x}})}var FI=new Set(["time","timestamp","date","datetime"]);function sy(e,t,i,{allowPrimitiveTypes:n=!0}={}){if(e!=="x"&&e!=="y"||!oe(t))return;const s=VI(e,i);if(s==null||!(s in t))return;const r=t[s],a=_I(e,i),o=ZR(r);if(o)return{type:o,position:a};const l=XR(s,r);if(l)return{type:l,position:a};if(n)return typeof r=="number"?{type:"number",position:a}:{type:"category",position:a}}function th(e,t,i){return sy(e,t,i,{allowPrimitiveTypes:!1})}function YR(e,t,i){if(e!=="x"||!oe(t))return;const n=VI(e,i);if(n==null||!(n in t))return;const s=t[n],r=_I(e,i),a=qR(n,s);if(a)return{type:a,position:r};if(rt(s))return{type:"category",position:r}}function ZR(e){if(le(e)&&e.every(t=>rt(t)||t===null))return"grouped-category"}function XR(e,t){if(Sn(t)||FI.has(e)&&Hi(t))return"time"}function qR(e,t){if(Sn(t)||FI.has(e)&&Hi(t))return"ordinal-time"}function VI(e,t){if(e==="x"&&"xKey"in t)return t.xKey;if(e==="y"&&"yKey"in t)return t.yKey}function _I(e,t){return"direction"in t&&t.direction==="horizontal"?e==="x"?"left":"bottom":e==="x"?"bottom":"left"}var ry=class extends Nr{constructor(e){super({moduleCtx:e,propertyKeys:sl,propertyNames:rl,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:ny({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Oa,datum:(t,i)=>({...Hd(t),...eh(t,i)})},clipFocusBox:!1}),this.properties=new mt,this.connectsToYAxis=!0,this.aggregationManager=new _d,this.backgroundGroup=new ae({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>km||this.contextNodeData.strokeData.spans.length>km)}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:n=this.id,stackCount:s=1}={}}=this,{xKey:r,yKey:a,selectedKey:o,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:u,yScale:d}),f=s>1||c!=null,m={value:`area-stack-${n}-yValue`,marker:`area-stack-${n}-yValues-marker`},y={invalidValue:null};(Zn(c)||l)&&s>1&&(y.invalidValue=0),i||(y.forceValue=0);const b=this.properties.allowNullKeys??!1,x=[kr(r,p,{id:"xValue",allowNullKey:b}),Qe(a,g,{id:"yValueRaw",...y}),...o==null?[]:[Qe(o,"category",{id:"selectedRaw"})]];f&&x.push(...ka(a,"normal",{id:"yValueCumulative",...y,groupId:m.marker},g)),Zn(c)&&x.push(Qe(a,g,{id:"yValue",...y,groupId:m.value}),md(Object.values(m),c)),h&&x.push(Gc());const{dataModel:M,processedData:I}=await this.requestDataModel(e,t,{props:x,groupByKeys:f,groupByData:!f});this.aggregateData(M,I),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.x.scale.convert(e),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}yCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.y.scale.convert(e[0]),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:n}=this;if(!t||!i)return{domain:[]};const s=n.y;if(e==="x"){const a=t.resolveProcessedDataDefById(this,"xValue"),o=t.getDomain(this,"xValue","key",i);return a?.def.type==="key"&&a.def.valueType==="category"?o:{domain:Ri(na(o.domain))}}const r=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(s instanceof Qi&&!(s instanceof ul)){const a=Number.isFinite(r[1]-r[0])?[Math.min(r[0],0),Math.max(r[1],0)]:[];return{domain:Ri(a)}}else return{domain:Ri(r)}}getSeriesRange(e,t){const[i,n]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t);return[Math.min(i,0),Math.max(n,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),gn(t))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>OR(i.scale.type,e,t,this.yCumulativeKey(t),this,n,r),computeFull:r=>NR(i.scale.type,e,t,this.yCumulativeKey(t),this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Ks.record(`${this.type}:aggregation`,s.map(r=>r.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:n,axes:s,dataModel:r,processedData:a,seriesBelowStackContext:o}=this,l=s.x,c=s.y;if(!n)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],o;if(l==null||c==null||r==null||a==null)return;const{scale:h}=l,{scale:u}=c,d=(h.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,g=a.invalidData?.get(this.id),f=r.resolveKeysById(this,"xValue",a),m=r.resolveColumnById(this,this.yCumulativeKey(a),a);let[y,b]=jc(1,i.length-1,l.range,D=>{const A=i[D],k=i[D+1],N=t[A],T=t[k],R=f[N],B=f[T],{0:E}=this.xCoordinateRange(R,0),{1:V}=this.xCoordinateRange(B,0);return[E,V]});y=Math.max(y-1,0),b=Math.min(b+1,i.length-1);let x=[];if(o?.fillSpans)x=o?.fillSpans;else for(let D=y;Due.point),Q={span:{type:"multi-line",moveTo:!1,x0:V.point.x,y0:V.point.y,x1:G.point.x,y1:G.point.y,midPoints:q},xValue0:V.xDatum,xValue1:G.xDatum,yValue0:V.yDatum,yValue1:G.yDatum};M.push(Q),I.push(Q)}return this.fillSpans=M,this.strokeSpans=I,{stack:[],fillSpans:M,strokeSpans:I}}hasInvalidDatumsInRange(e,t,i,n){const s=Math.min(i,n),r=Math.max(i,n);for(let a=s;a<=r;a++){if(e?.[a])return!0;const o=t[a];if(!Number.isFinite(o))return!0}return!1}stackYValueData(){const{visible:e,axes:t,dataModel:i,processedData:n,seriesBelowStackContext:s,properties:r}=this,a=t.x,o=t.y;if(a==null||o==null||i==null||n==null)return;const{interpolation:l}=r,{scale:c}=a,{scale:h}=o,u=(c.bandwidth??0)/2;let d=i.resolveKeysById(this,"xValue",n),p=i.resolveColumnById(this,this.yValueKey(),n);const g=!this.isStacked()&&this.properties.connectMissingData,f=n.invalidKeys?.get(this.id),y=(g?n.invalidData?.get(this.id):void 0)??f;y!=null&&(d=d.filter((T,R)=>y[R]===!1),p=p.filter((T,R)=>y[R]===!1));let[b,x]=jc(1,d.length,a.range,T=>this.xCoordinateRange(d[T],0));b=Math.max(b-2,0),x=Math.min(x+2,d.length);let M;if(s?.fillSpans)M=s?.fillSpans;else{const T=[];for(let R=b;R0,crossFiltering:this.properties.selectedKey!=null,styles:Wd(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){return t.segments=Yd(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:n,animationEnabled:s}=e,r=this.contextNodeData?.segments,a=xe(this.getHighlightStyle(),this.getStyle()),{strokeWidth:o,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:u,fill:d,fillOpacity:p,opacity:g}=a;i.setProperties({segments:r,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:l,strokeWidth:o,strokeOpacity:c,lineDash:h,lineDashOffset:u,opacity:g,visible:n||s}),i.datum=r,t.setStyleProperties({fill:d,stroke:void 0,fillOpacity:p},this.getShapeFillBBox()),t.setProperties({segments:r,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:g,visible:n||s}),t.datum=r,Kd(this,i),Kd(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(),EI(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,n]=e;n.path.clear(),Xm(n,i),n.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{contextNodeData:n,processedData:s,axes:r,properties:a}=this,{marker:o,styler:l}=a,c=l?this.getStyle().marker:void 0,h=n?.crossFiltering===!0||ey(s.input.count,r.x.scale,o,c);o.isDirty()&&(i.clear(),i.cleanup());const u=h?t:[];return gn(this.processedData)?i.update(u,void 0,d=>Zt(d.xValue)):i.update(u)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{marker:n}=this.properties,s=this.ctx.highlightManager.getActiveHighlight();t.each((r,a)=>{if(!t.isGarbage(r)){const o=this.getHighlightState(s,e.isHighlight,a.datumIndex),l=this.getStyle(o),{stroke:c,strokeWidth:h,strokeOpacity:u}=l,d=this.makeItemStylerParams(this.dataModel,this.processedData,a.datumIndex,l.marker);a.style=this.getMarkerStyle(n,a,d,{isHighlight:i,highlightState:o},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:u})}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:n}=e,s=this.getShapeFillBBox(),r=this.ctx.highlightManager.getActiveHighlight(),a=this.getDrawingMode(n,e.drawingMode);i.each((o,l)=>{const c=this.getHighlightState(r,n,l.datumIndex),h=l.style??t.styles[c];this.applyMarkerStyle(h,o,l.point,s,{selected:l.selected}),o.drawingMode=this.resolveMarkerDrawingModeForState(a,h)}),n||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(),n=this.makeLabelFormatterParams();e.labelSelection.each((s,r)=>{const a=Na(this,r,n,this.properties.label,t,i),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,color:d}=a;o&&r?.labelText?(s.fontStyle=l,s.fontWeight=c,s.fontSize=h,s.fontFamily=u,s.textAlign="center",s.textBaseline="bottom",s.text=r.labelText,s.x=r.x,s.y=r.y-10,s.fill=d,s.visible=!0,s.fillOpacity=this.getHighlightStyle(t,r.datumIndex).opacity??1,s.setBoxing(a)):s.visible=!1})}makeStylerParams(e){const{id:t}=this,{marker:i,fill:n,fillOpacity:s,lineDash:r,lineDashOffset:a,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:u}=this.properties,d=nl(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:d,fill:n,fillOpacity:s,lineDash:r,lineDashOffset:a,seriesId:t,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:u}}makeItemStylerParams(e,t,i,n){const{xKey:s,yKey:r}=this.properties,a=e.resolveKeysById(this,"xValue",t)[i],o=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(n.fill)??n.fill;return{...bm(a,o,s,r,l,c),xValue:a,yValue:o,...n,fill:h}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{xKey:a,xName:o,yKey:l,yName:c,tooltip:h,legendItemName:u}=r,d=r.allowNullKeys??!1,p=s.x,g=s.y;if(!i||!n||!p||!g)return;const f=n.dataSources.get(this.id)?.data?.[e],m=i.resolveKeysById(this,"xValue",n)[e],y=i.resolveColumnById(this,"yValueRaw",n)[e];if(m===void 0&&!d)return;const b=this.getStyle(),x=this.makeItemStylerParams(i,n,e,b.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:f},x,{isHighlight:!1},b.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",m,f,a,u,d),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",y,f,l,u),missing:ba(y)}]},{seriesId:t,datum:f,title:c,xKey:a,xName:o,yKey:l,yName:c,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:r,marker:a}=this.getStyle(),o=!a.enabled||a.fill==null,l=o?e:a.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:a.size,shape:a.shape,fill:l,fillOpacity:o?i:a.fillOpacity,stroke:a.stroke}),enabled:a.enabled||s<=0},line:{enabled:!0,stroke:t,strokeOpacity:n,strokeWidth:s,lineDash:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:r,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:e,id:t,itemId:s,legendItemName:a,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:a??r??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(e){$d([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(s,n),ty(this,r,...s),Gt([t],eh),Qm(this,r,{...this.getAnimationDrawingModes(),phase:"initial"},t),ht(this,"labels",r,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:n,contextData:s,paths:r,previousContextData:a}=e,[o,l]=r;if(s.visible===!1&&a?.visible===!1||o==null&&l==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(r,s)},h=()=>{t.skipCurrentBatch(),c()};if(s==null||a==null){c(),Qc(this,t,"added",this.getAnimationDrawingModes(),i),iy(this,"fill_path_properties",t,"add",o),iy(this,"stroke_path_properties",t,"add",l),ht(this,"labels",t,n);return}if(s.crossFiltering!==a.crossFiltering){h();return}const u=WR(s,a);if(u===void 0){h();return}else if(u.status==="no-op")return;Qc(this,t,void 0,this.getAnimationDrawingModes(),i),xt(this.id,"fill_path_properties",t,[o],u.fill.pathProperties),Vd(this.id,"fill_path_update",t,[o],u.fill.path),xt(this.id,"stroke_path_properties",t,[l],u.stroke.pathProperties),Vd(this.id,"stroke_path_update",t,[l],u.stroke.path),ht(this,"labels",t,n),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(r,s)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new kt}getStyle(e){const{styler:t,marker:i,fill:n,fillOpacity:s,lineDash:r,lineDashOffset:a,stroke:o,strokeOpacity:l,strokeWidth:c}=this.properties,{size:h,shape:u,fill:d="transparent",fillOpacity:p}=i;let g={};if(t){const f=this.makeStylerParams(e),m=this.cachedCallWithContext(t,f)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],m,{pick:!1})??{}}return g.marker??(g.marker={}),{fill:g.fill??n,fillOpacity:g.fillOpacity??s,lineDash:g.lineDash??r,lineDashOffset:g.lineDashOffset??a,stroke:g.stroke??o,strokeOpacity:g.strokeOpacity??l,strokeWidth:g.strokeWidth??c,marker:{enabled:g.marker.enabled??i.enabled,fill:g.marker.fill??d,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??u,size:g.marker.size??h,lineDash:g.marker.lineDash??i.lineDash??r,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??a,stroke:g.marker.stroke??i.stroke??o,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:g.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 n of this.backgroundGroup.children())if(n instanceof At){i=n;break}return i?.getBBox().containsPoint(e,t)?i.isPointInPath(e,t):!1}computeFocusBounds(e){return Ud(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};ry.className="AreaSeries",ry.type="area";var JR={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",or],["image",Is],["pattern",Ui]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Qr,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",Jl],["pattern",Ui]]},stroke:{$palette:"stroke"}},label:{...ts,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:ng,segmentation:su}},BI={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:qe,dependencies:[nn],options:bf,predictAxis:th,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:JR,create:e=>new ry(e)},QR=.001,ay=class extends wt{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(e,t,i,n,s,r,a,o,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(e,t,i,n,s,r,a,o)}get feathered(){return Math.abs(this.featherRatio)>QR}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:n,__x:s,__y:r,__width:a,__height:o}=this;if(e.clear(),t.clear(),i==="x"){const l=Math.abs(n)*a;n>0?(e.moveTo(s,r),e.lineTo(s+a-l,r),e.lineTo(s+a,r+o/2),e.lineTo(s+a-l,r+o),e.lineTo(s,r+o),e.closePath()):(e.moveTo(s+l,r),e.lineTo(s+a,r),e.lineTo(s+a,r+o),e.lineTo(s+l,r+o),e.lineTo(s,r+o/2),e.closePath())}else{const l=Math.abs(n)*o;n>0?(e.moveTo(s,r+l),e.lineTo(s+a/2,r),e.lineTo(s+a,r+l),e.lineTo(s+a,r+o),e.lineTo(s,r+o),e.closePath()):(e.moveTo(s,r),e.lineTo(s+a,r),e.lineTo(s+a,r+o-l),e.lineTo(s+a/2,r+o),e.lineTo(s,r+o-l),e.closePath())}}renderStroke(e){if(!this.feathered){super.renderStroke(e);return}const{__stroke:t,__strokeWidth:i,__lineDash:n,__lineDashOffset:s,__lineCap:r,__lineJoin:a,path:o}=this;if(t&&i){const{globalAlpha:l}=e;this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),s&&(e.lineDashOffset=s),r&&(e.lineCap=r),a&&(e.lineJoin=a),e.stroke(o.getPath2D()),e.globalAlpha=l}}};v([ze()],ay.prototype,"direction",2),v([ze()],ay.prototype,"featherRatio",2);function Zd(e,t){for(const i of t){const n=i.datum;n===void 0?z.error("undefined datum"):e.addValue(i,n)}}function Xd(e,t){const{x:i,y:n}=t,{nearest:s,distanceSquared:r}=e.getQuadTree().find(i,n);if(s!==void 0)return{datum:s.value,distance:Math.sqrt(r)}}var ih=class extends Bn{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};v([S],ih.prototype,"direction",2),v([S],ih.prototype,"width",2),v([S],ih.prototype,"widthRatio",2);var zI=class extends Nr{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,n=Pe(this.smallestDataInterval)?this.smallestDataInterval*i:0,s=na(e)??[Number.NaN,Number.NaN];return typeof t=="boolean"?s[t?0:1]-=(t?1:-1)*n:(s[0]-=n,s[1]+=n),Ri(s)}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:n}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);e[n]=Math.max(e[n]??0,t)}getMinimumRangeChart(e){if(e.length===0)return 0;const t=this.getCategoryAxis();if(!(t instanceof Zc||t instanceof Pc))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const n=this.getBandScalePadding(),{paddingInner:s=n.inner,paddingOuter:r=n.outer,groupPaddingInner:a}=t,o=e.reduce((d,p)=>d+p,0),l=o/e.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=o+a*l*(c-1),u=(i-s+r*2)/(1-s);return h*u}validateCreateNodeDataPreconditions(){const e=this.getCategoryAxis(),t=this.getValueAxis();if(!(!e||!t||!this.dataModel||!this.processedData))return{xAxis:e,yAxis:t}}getBandwidth(e,t){return Re.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth??0}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,n=this.getBandwidth(t,0),s=Re.is(i)?n*-.5:0,r=i.convert(e)+s;return[r,r+n]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,n=e.map(s=>i.convert(s));if(n.length===1){const s=i.convert(0);return[Math.min(n[0],s),Math.max(n[0],s)]}return Ct(n)}getBarDimensions(){const e=this.getCategoryAxis(),t=this.getBandwidth(e);this.ctx.seriesStateManager.updateGroupScale(this,t,e);const i=this.getBarWidth(),n=this.getBarOffset(i);let s=this.getGroupOffset();if(this.ctx.domManager.isRtl&&this.seriesGrouping!=null){const r=this.ctx.seriesStateManager.getGroupBandWidth(this);s=t-s-r}return{groupOffset:s,barOffset:n,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(e){const t=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let n=0;Re.is(i.scale)?n=-e/2:this.seriesGrouping==null&&t?n=(this.getGroupScaleRangeWidth(t)-e)/2:t&&this.properties.widthRatio!=null&&(n=(t.bandwidth-e)/2);const s=this.ctx.seriesStateManager.getStackOffset(this,e);return n+s}getBarWidth(){const{seriesGrouping:e}=this,{width:t}=this.properties;let{widthRatio:i}=this.properties;const n=this.ctx.seriesStateManager.getGroupScale(this),s=n?.bandwidth??0;if(e==null&&(i??(i=1)),i!=null){let r=t;return e==null&&r==null&&n&&(r=this.getGroupScaleRangeWidth(n)),r==null&&s<1&&n?n.rawBandwidth:(r??s)*i}return t??(s<1&&n?n.rawBandwidth:s)}getGroupScaleRangeWidth(e){let t=e.range[1]-e.range[0];return e.round&&t>0&&(t=Math.floor(t)),t}getDatumOffset(e){if(!this.processedData?.invalidData||!this.processedData?.missingData||!this.getCategoryAxis()?.skipNullBars)return 0;const t=this.ctx.seriesStateManager.getDatumOffset(this,this.processedData.invalidData,this.processedData.missingData,e);return this.ctx.domManager.isRtl?-t:t}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){Zd(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Xd(this,e)}};function oy(e,t,i,n,s){if(t.lengthM.maxRange===u);let{indexData:p,valueData:g,negativeIndexData:f,negativeValueData:m}=As(t,n,i??n,r,a,u,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.positiveIndexData,reuseValueData:d?.positiveValueData,reuseNegativeIndexData:d?.negativeIndexData,reuseNegativeValueData:d?.negativeValueData});if(!f||!m)throw new Error("Negative aggregation data missing in split mode");let y=is(u,p,d?.positiveIndices),b=is(u,f,d?.negativeIndices);const x=[{maxRange:u,positiveIndices:y,positiveIndexData:p,positiveValueData:g,negativeIndices:b,negativeIndexData:f,negativeValueData:m}];for(;u>64;){const M=u,I=Math.trunc(M/2),C=h?.find(k=>k.maxRange===I),D=Jr(p,g,M,{reuseIndexData:C?.positiveIndexData,reuseValueData:C?.positiveValueData}),A=Jr(f,m,M,{reuseIndexData:C?.negativeIndexData,reuseValueData:C?.negativeValueData});u=D.maxRange,p=D.indexData,g=D.valueData,y=D.midpointData??is(u,p,C?.positiveIndices),f=A.indexData,m=A.valueData,b=A.midpointData??is(u,f,C?.negativeIndices),x.push({maxRange:u,positiveIndices:y,positiveIndexData:p,positiveValueData:g,negativeIndices:b,negativeIndexData:f,negativeValueData:m})}return x.reverse(),x}function eP(e,t,i,n,s){if(t.lengthI.maxRange===p),{indexData:f,valueData:m,negativeIndexData:y,negativeValueData:b}=As(t,n,i??n,r,a,p,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:g?.positiveIndexData,reuseValueData:g?.positiveValueData,reuseNegativeIndexData:g?.negativeIndexData,reuseNegativeValueData:g?.negativeValueData});if(!y||!b)throw new Error("Negative aggregation data missing in split mode");const x={maxRange:p,positiveIndices:is(p,f,g?.positiveIndices),positiveIndexData:f,positiveValueData:m,negativeIndices:is(p,y,g?.negativeIndices),negativeIndexData:y,negativeValueData:b};function M(){return oy([r,a],t,i,n,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:u})?.filter(C=>C.maxRange!==p)??[]}return{immediate:[x],computeRemaining:M}}function tP(e,t,i,n,s,r,a,o){const[l,c]=hn(e,s);return oy([l,c],t,i,n,{smallestKeyInterval:r,xNeedsValueOf:a,yNeedsValueOf:o})}var iP=cc(tP);function nP(e,t,i,n,s){const r=t.resolveKeysById(n,"xValue",i),a=t.hasColumnById(n,"yValue-start"),o=a?t.resolveColumnById(n,"yValue-start",i):void 0,l=a?t.resolveColumnById(n,"yValue-end",i):t.resolveColumnById(n,"yValue-raw",i),c=t.getDomain(n,"xValue","key",i),h=t.resolveColumnNeedsValueOf(n,"xValue",i),u=t.resolveColumnNeedsValueOf(n,a?"yValue-end":"yValue-raw",i);if(s){const[d,p]=hn(e,c);return oy([d,p],r,o,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:u,existingFilters:s})}return iP(e,r,o,l,c,i.reduced?.smallestKeyInterval,h,u)}function sP(e,t,i,n,s,r){const a=t.resolveKeysById(n,"xValue",i),o=t.hasColumnById(n,"yValue-start"),l=o?t.resolveColumnById(n,"yValue-start",i):void 0,c=o?t.resolveColumnById(n,"yValue-end",i):t.resolveColumnById(n,"yValue-raw",i),h=t.getDomain(n,"xValue","key",i),u=t.resolveColumnNeedsValueOf(n,"xValue",i),d=t.resolveColumnNeedsValueOf(n,o?"yValue-end":"yValue-raw",i),[p,g]=hn(e,h);return eP([p,g],a,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:u,yNeedsValueOf:d,targetRange:s,existingFilters:r})}var ly=class extends Ji{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};v([S],ly.prototype,"placement",2),v([S],ly.prototype,"spacing",2);var st=class extends ih{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 us,this.label=new ly,this.tooltip=Ea(),this.sparklineMode=!1}};v([S],st.prototype,"xKey",2),v([S],st.prototype,"xName",2),v([S],st.prototype,"yKey",2),v([S],st.prototype,"yName",2),v([S],st.prototype,"yFilterKey",2),v([S],st.prototype,"stackGroup",2),v([S],st.prototype,"normalizedTo",2),v([S],st.prototype,"fill",2),v([S],st.prototype,"fillOpacity",2),v([S],st.prototype,"stroke",2),v([S],st.prototype,"strokeWidth",2),v([S],st.prototype,"strokeOpacity",2),v([S],st.prototype,"lineDash",2),v([S],st.prototype,"lineDashOffset",2),v([S],st.prototype,"cornerRadius",2),v([S],st.prototype,"crisp",2),v([S],st.prototype,"styler",2),v([S],st.prototype,"itemStyler",2),v([S],st.prototype,"simpleItemStyler",2),v([S],st.prototype,"shadow",2),v([S],st.prototype,"label",2),v([S],st.prototype,"tooltip",2),v([S],st.prototype,"sparklineMode",2);function GI(e,t,i,n){if(t!=null){const[s,r]=t;if(s!==0||r!==1)return!1}if(Re.is(e)){const s=e.calcBandwidth(n)-e.calcBandwidth(i);if(s>0&&s<1)return!1}if(Fn.is(e)){const{bandwidth:s,step:r}=e;if(s>0&&s<1)return!1;const a=r-s;if(a>0&&a<1)return!1}return!0}var cy=e=>io(e.yValue??0);function nh(e,t,i){const{startingX:n,startingY:s}=aP(e,t);return{isVertical:e,calculate:(a,o)=>{let l=e?a.x:n,c=e?s:a.y,h=e?a.width:0,u=e?0:a.height;const{opacity:d=1}=a;o&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=o,h=e?o.width:0,u=e?0:o.height,e&&!cy(o)?c+=o.height:!e&&cy(o)&&(l+=o.width));let p;return a.clipBBox==null?p=void 0:cy(a)?p=e?new U(l,c-u,h,u):new U(l-h,c,h,u):p=new U(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:p,opacity:d}},mode:i}}function rP(e,t){return{isVertical:e,calculate:(i,n)=>{let s=e?i.x:i.x+i.width/2,r=e?i.y+i.height/2:i.y,a=e?i.width:0,o=e?0:i.height;return n&&(Number.isNaN(s)||Number.isNaN(r))&&(s=e?n.x:n.x+n.width/2,r=e?n.y+n.height/2:n.y,a=e?n.width:0,o=e?0:n.height),{x:s,y:r,width:a,height:o,clipBBox:i.clipBBox,opacity:i.opacity??1}},mode:t}}function sh(e,t){const i=a=>a==null||Number.isNaN(a.x)||Number.isNaN(a.y);return{toFn:(a,o,l)=>l==="removed"&&a.datum==null&&e.mode==="fade"?{...rh(a,o),opacity:0}:l==="removed"||i(o)?e.calculate(o,a.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(a,o,l)=>{l==="updated"&&i(o)?l="removed":l==="updated"&&i(a.previousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(a.previousDatum==null&&e.mode==="fade"?c={...rh(a,o),opacity:0}:c=e.calculate(o,a.previousDatum),l==="unknown"&&(l=t)):c={x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1};const h=Vn[l];return{...c,phase:h}},applyFn:(a,o,l)=>{a.resetAnimationProperties(o.x,o.y,o.width,o.height,o.opacity??1,o.clipBBox),a.crisp=l==="end"&&(a.datum?.crisp??!1)}}}function aP(e,t){const i=t[e?"y":"x"];let n=1/0,s=0;return i?(e?s=i.scale.convert(Re.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(Re.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}function rh(e,{x:t,y:i,width:n,height:s,clipBBox:r,opacity:a=1}){return{x:t,y:i,width:n,height:s,clipBBox:r,opacity:a,crisp:e.datum?.crisp??!1}}function qd(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const s of i){const r=s.datum;r!=null&&(s.resetAnimationProperties(r.x,r.y,r.width,r.height,r.opacity??1,r.clipBBox),s.crisp=r.crisp??!1)}t.cleanup()})}}function hy(e,t){if(t===void 0)return;const{x:i,y:n,width:s,height:r}=t;return Je.toCanvas(e.contentGroup,new U(i,n,s,r))}function jI(e,t,i,n,s,r,a){let o=r?.reduced?.diff?.[e];if(o?.changed)return o;if(!a)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=oP(n,s);return o==null&&r?.reduced?.diff!=null?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?o.updated=new Set(Array.from(t,({datum:c})=>i(c))):o.added=new Set(Array.from(t,({datum:c})=>i(c)))):l&&(o={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:c})=>i(c))),removed:new Set,moved:new Set}),o}function HI(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function oP(e,t){if(!t)return!1;const i=e.scales,n=t.scales;if(!da(i.x,n.x)||!da(i.y,n.y))return!0;if(!HI(e)||!HI(t))return!1;const s=e.groupScale,r=t.groupScale;return!da(s,r)}var uy=class extends zI{constructor(e){super({moduleCtx:e,propertyKeys:sl,propertyNames:rl,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:rh,label:Oa}}),this.properties=new st,this.connectsToYAxis=!0,this.aggregationManager=new _d,this.phantomGroup=this.contentGroup.appendChild(new ae({name:"phantom",zIndex:-1})),this.phantomSelection=bt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ae({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=bt.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:n,normalizedTo:s}=this.properties,{seriesGrouping:{groupIndex:r=this.id}={},data:a}=this,l=(this.seriesGrouping?.stackCount??0)>1||s!=null,c=l,h=!this.ctx.animationManager.isSkipped(),u=this.getCategoryAxis()?.scale,d=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),m=this.visible?{}:{forceValue:0},y=this.properties.allowNullKeys??!1,b=[kr(t,g,{id:"xValue",allowNullKey:y}),Qe(i,f,{id:"yValue-raw",invalidValue:null,...m})],x=[];if(l){const C=`bar-stack-${r}-yValues`,D=`${C}-trailing`;x.push(C,D),b.push(...ka(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:C,separateNegative:!0,...m},f),...ka(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f))}if(n!=null&&(b.push(Qe(n,f,{id:"yFilterValue-raw",invalidValue:null,...m})),l)){const C=`bar-stack-${r}-yFilterValues`,D=`${C}-trailing`;x.push(C,D),b.push(...ka(n,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:C,separateNegative:!0,...m},f),...ka(n,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f),qN(this.id,"yValue-raw","yFilterValue-raw"))}p&&b.push(iM,nM),Pe(s)&&b.push(md(x,Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&b.push(bd(this.id,this.processedData)),(h||!c)&&b.push(Gc());const{dataModel:M,processedData:I}=await this.requestDataModel(e,a,{props:b,groupByKeys:c,groupByData:!c});this.aggregateData(M,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"),a=i.getDomain(this,"xValue","key",t);return r?.def.type==="key"&&r.def.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}let n;if(t.reduced?.filteredValueExceedUnfiltered===!0)n=this.domainForClippedRange(e,["yFilterValue-end"],"xValue");else{const r=this.yCumulativeKey(i);n=this.domainForClippedRange(e,[r],"xValue");const a=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",t).domain:void 0;a!=null&&(n=[Math.min(n[0],a[0]),Math.max(n[1],a[1])])}const s=this.getValueAxis();if(s instanceof Qi&&!(s instanceof ul)){const r=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return{domain:Ri(r)}}else return{domain:Ri(n)}}getSeriesRange(e,t){if((this.properties.direction==="horizontal"?"x":"y")!==e)return[];const n=this.yCumulativeKey(this.dataModel),[s,r]=this.domainForVisibleRange("y",[n],"xValue",t);return[Math.min(s,0),Math.max(r,0)]}getZoomRangeFittingItems(e,t,i){const n=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[n],e,t,i)}getVisibleItems(e,t,i){const n=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[n],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),gn(t))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>sP(i.scale.type,e,t,this,n,r),computeFull:r=>nP(i.scale.type,e,t,this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Ks.record(`${this.type}:aggregation`,s.map(r=>r.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:n}=this;if(!i||!n)return;const s=n.dataSources?.get(this.id);if(s==null)return;const r=e.scale,a=t.scale,o=Math.abs(r.range[1]-r.range[0]);this.aggregationManager.ensureLevelForRange(o);const l=this.aggregationManager.getFilterForRange(o),c=n.reduced?.filteredValueExceedUnfiltered??!1,h=i.hasColumnById(this,"yValue-start"),{label:u}=this.properties,d=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:p,barOffset:g,barWidth:f}=this.getBarDimensions();let m,y,b;if(c)m=i.resolveColumnById(this,"yFilterValue-start",n),y=i.resolveColumnById(this,"yFilterValue-end",n),b=void 0;else{const x=i.hasColumnById(this,"yFilterValue-raw");m=h?i.resolveColumnById(this,"yValue-start",n):void 0,y=h?i.resolveColumnById(this,"yValue-end",n):void 0,b=x?i.resolveColumnById(this,"yFilterValue-raw",n):void 0}return{dataSource:s,rawData:s.data,xValues:i.resolveKeysById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValue-raw",n),yStartValues:m,yEndValues:y,yFilterValues:b,xScale:r,yScale:a,xAxis:e,yAxis:t,groupOffset:p,barOffset:g,barWidth:f,range:o,yReversed:t.isReversed(),bboxBottom:a.convert(0),labelSpacing:u.spacing+(typeof u.padding=="number"?u.padding:0),crisp:l==null&&(this.properties.crisp??GI(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:h,filteredValueExceedUnfiltered: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:u,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+this.getDatumOffset(t):Number.NaN}prepareNodeDatumState(e,t,i,n,s){if(!Number.isFinite(s))return;const r=e.xValues[i];if(r===void 0&&!this.properties.allowNullKeys)return;const a=e.dataSource?.data[i],o=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&&o!=null?this.getLabelText(l??o,a,e.yKey,"y",e.yDomain,e.label,{datum:a,value:l??o,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0,h=o>=0&&!Object.is(o,-0);return t.datum=a,t.xValue=r,t.yRawValue=o,t.yFilterValue=l,t.labelText=c,t.inset=l!=null&&l>o,t.isPositive=h,t.precomputedBottomY=l==null?void 0:e.yScale.convert(n),t.precomputedIsUpward=l==null?void 0:h!==e.yReversed,t}createSkeletonNodeDatum(e,t,i){const n=t.nodeDatumScratch;return{series:this,datum:n.datum,datumIndex:t.datumIndex,cumulativeValue:0,phantom:i,xValue:n.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 n=this.createSkeletonNodeDatum(e,t,!1);this.updateNodeDatum(e,n,t,i);let s;return i.yFilterValue!=null&&(s=this.createSkeletonNodeDatum(e,t,!0),this.updateNodeDatum(e,s,t)),{nodeData:n,phantomNodeData:s}}updateNodeDatum(e,t,i,n){if(n??(n=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!n)return;const s=t,r=t.phantom,a=i.yStart,o=r?n.yFilterValue:n.yFilterValue??n.yRawValue,l=r?n.yFilterValue:n.yFilterValue??i.yEnd,c=r?void 0:n.labelText;let h;r||n.yFilterValue==null?h=i.yEnd:h=i.yStart+n.yFilterValue;let u;r?u=i.yRange:u=Math.max(i.yStart+(n.yFilterValue??-1/0),i.yRange);let d;r?d=void 0:n.inset?d=.6:d=void 0;const p=n.precomputedIsUpward??n.isPositive!==e.yReversed,g=e.yScale.convert(h),f=n.precomputedBottomY??e.yScale.convert(a),m=e.yScale.convert(u),y=i.width*.5*(1-(d??1)),b=e.barAlongX?Math.min(g,f):i.x+y,x=e.barAlongX?i.x+y:Math.min(g,f),M=e.barAlongX?Math.abs(f-g):i.width*(d??1),I=e.barAlongX?i.width*(d??1):Math.abs(f-g),C=e.barAlongX?Math.min(e.bboxBottom,m):i.x+y,D=e.barAlongX?i.x+y:Math.min(e.bboxBottom,m),A=e.barAlongX?Math.abs(e.bboxBottom-m):i.width*(d??1),k=e.barAlongX?i.width*(d??1):Math.abs(e.bboxBottom-m);s.datum=n.datum,s.datumIndex=i.datumIndex,s.cumulativeValue=l,s.xValue=n.xValue,s.yValue=o,s.x=C,s.y=D,s.width=A,s.height=k;const N=s.midPoint;N.x=b+M/2,N.y=x+I/2;const T=e.shouldFlipXY?I:M;s.capDefaults.lengthRatioMultiplier=T,s.capDefaults.lengthMax=T,s.opacity=i.opacity,s.featherRatio=i.featherRatio,s.topLeftCornerRadius=e.barAlongX!==p,s.topRightCornerRadius=p,s.bottomRightCornerRadius=e.barAlongX===p,s.bottomLeftCornerRadius=!p;const R=s.clipBBox;if(R?(R.x=b,R.y=x,R.width=M,R.height=I):s.clipBBox=new U(b,x,M,I),s.crisp=e.crisp,c==null)s.label=void 0;else{const B=hI({isUpward:p,isVertical:!e.barAlongX,placement:e.label.placement,spacing:e.labelSpacing,rect:{x:b,y:x,width:M,height:I}}),E=s.label;E?(E.text=c,E.x=B.x,E.y=B.y,E.textAlign=B.textAlign,E.textBaseline=B.textBaseline):s.label={text:c,...B}}s.missing=ba(o)}createNodeDataWithAggregation(e,t,i){const n=e.yReversed?-1:1;for(let s=0;s<2;s+=1){const r=s===0,a=r?e.dataAggregationFilter.positiveIndices:e.dataAggregationFilter.negativeIndices,o=r?e.dataAggregationFilter.positiveIndexData:e.dataAggregationFilter.negativeIndexData,l=r?Ln:Tn,c=r?Tn:Ln,h=this.visibleRangeIndices("xValue",e.xAxis.range,a),u=h[0],d=h[1];for(let p=u;pe.range)continue;const I=Math.abs(m-f)+1,C=Fn.is(e.xScale)?Math.min(e.xScale.bandwidth*Math.max(I-1,1)/(e.xScale.step*I),1):1;if(i.datumIndex=b,i.x=x,i.width=M,i.opacity=C,e.isStacked)i.yStart=Number(e.yStartValues[y]),i.yEnd=Number(e.yEndValues[b]),i.featherRatio=0;else{const D=Number(e.yRawValues[b]),A=Number(e.yRawValues[y]);i.yStart=0,i.yEnd=D,i.featherRatio=(r?1:-1)*n*(1-A/D)}i.yRange=i.yEnd,this.upsertNodeDatum(e,i)}}}createNodeDataGrouped(e,t,i){const n=this.processedData,s=n.invalidData?.get(this.id),r=e.barWidth;let a;e.filteredValueExceedUnfiltered?a=this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):e.isStacked?a=this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):a=-1;const o=n.columnScopes.findIndex(d=>d.has(this.id)),l=n.groups,c=jc(1,l.length,e.xAxis.range,d=>{const g=l[d].keys[0];return this.xCoordinateRange(g)}),h=c[0],u=c[1];for(let d=h;d=0&&!Object.is(x,-0),I=e.isStacked?Number(e.yStartValues?.[y]):0,C=e.isStacked?Number(e.yEndValues?.[y]):x;let D=C;e.isStacked&&(D=g[a][M?1:0]),i.datumIndex=y,i.x=b,i.width=r,i.yStart=I,i.yEnd=C,i.yRange=D,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(e,i)}}}createNodeDataSimple(e,t,i){const n=this.processedData.invalidData?.get(this.id),s=e.barWidth,r=this.visibleRangeIndices("xValue",e.xAxis.range);let a=r[0],o=r[1];this.processedData.input.count<1e3&&(a=0,o=this.processedData.input.count);for(let l=a;l=e.labels.length&&e.labels.push(r);else{const o=this.createNodeDatum(e,t);o.nodeData&&(e.nodes.push(o.nodeData),e.labels.push(o.nodeData)),a=o.phantomNodeData}if(e.nodeIndex++,!n)return{nodeData:e.nodes[e.nodeIndex]};if(s)a=e.phantomNodes[e.phantomIndex],this.updateNodeDatum(e,a,t);else if(a)e.phantomNodes.push(a);else{const o=this.createNodeDatum(e,t);o.phantomNodeData&&e.phantomNodes.push(o.phantomNodeData)}return e.phantomIndex++,{nodeData:r,phantomNodeData:a}}populateNodeData(e){const t=n=>this.computeXPosition(e,n),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:xm(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=Yd(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene),t}nodeFactory(){return new ay}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(),s=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:s?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],s)??[]:[],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(n=>n.datum===t.datum);return i==null?void 0:[{...i}]}updateDatumSelection(e){return gn(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:n,fillOpacity:s,lineDash:r,lineDashOffset:a,stackGroup:o,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:u,yKey:d}=this.properties,p=nl(e??0);return{cornerRadius:i,fill:n,fillOpacity:s,highlightState:p,lineDash:r,lineDashOffset:a,seriesId:t,stackGroup:o,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:u,yKey:d}}makeItemStylerParams(e,t,i,n,s,r){const{id:a}=this,{xKey:o,yKey:l,stackGroup:c}=this.properties,h=t.dataSources.get(a)?.data?.[i],u=e.resolveColumnById(this,"yValue-raw",t)[i],d=e.getDomain(this,"xValue","key",t).domain,p=e.getDomain(this,this.yCumulativeKey(e),"value",t).domain,g=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(g,s,i),m=this.filterItemStylerFillParams(r.fill)??r.fill;return{seriesId:a,...bm(n,u,o,l,d,p),datum:h,xValue:n,yValue:u,stackGroup:c,highlightState:f,...r,fill:m}}getStyle(e,t){const{cornerRadius:i,fill:n,fillOpacity:s,lineDash:r,lineDashOffset:a,stroke:o,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let u={};if(!e&&h){const d=this.makeStylerParams(t);u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,d)??{},{pick:!1})??{}}return{cornerRadius:u.cornerRadius??i,fill:u.fill??n,fillOpacity:u.fillOpacity??s,lineDash:u.lineDash??r,lineDashOffset:u.lineDashOffset??a,opacity:1,stroke:u.stroke??o,strokeOpacity:u.strokeOpacity??l,strokeWidth:u.strokeWidth??c}}getItemStyle(e,t,i){const{properties:n,dataModel:s,processedData:r}=this,{itemStyler:a,simpleItemStyler:o}=n,l=this.getHighlightStyle(t,e,i);if(o&&r!=null&&e!=null){const h=r.dataSources.get(this.id)?.data?.[e],u=o(h);return xe(u,l,this.getStyle(!1,i))}let c=xe(l,this.getStyle(e===void 0,i));if(a&&s!=null&&r!=null&&e!=null){const h=s.resolveKeysById(this,"xValue",r)[e],u=this.cachedDatumCallback(Zt(this.getDatumId({xValue:h,phantom:!1}),t?"highlight":"node"),()=>{const d=this.makeItemStylerParams(s,r,e,h,t,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(a,d))});u&&(c=xe(u,c))}return c}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight(),i=this;function n(s,r){if(!e.datumSelection.isGarbage(s)){const a=i.getHighlightState(t,e.isHighlight,r.datumIndex);r.style=i.getItemStyle(r.datumIndex,e.isHighlight,a)}}e.datumSelection.each(n)}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getCategoryDirection()==="x",r=this.getShapeFillBBox(),a=this.getBarDirection(),{drawingMode:o,isHighlight:l}=e,c=this,h=t.styles;function u(d,p){const g=p.style??h[c.getHighlightState(i,l,p.datumIndex)];d.setStyleProperties(g,r);const f=g.cornerRadius??0,m=s?(p.clipBBox?.width??p.width)>0:(p.clipBBox?.height??p.height)>0;d.setStaticProperties(o,p.topLeftCornerRadius?f:0,p.topRightCornerRadius?f:0,p.bottomRightCornerRadius?f:0,p.bottomLeftCornerRadius?f:0,m,p.crisp,n,a,p.featherRatio)}e.datumSelection.each(u)}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},n=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,r)=>{s.fillOpacity=this.getHighlightStyle(t,r?.datumIndex).opacity??1,cI(this,s,i,this.properties.label,r.label,t,n)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:a,yKey:o,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=s,d=s.allowNullKeys??!1,p=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!n||!p||!g)return;const f=n.dataSources.get(this.id)?.data?.[e],m=i.resolveKeysById(this,"xValue",n)[e],y=i.resolveColumnById(this,"yValue-raw",n)[e];if(m===void 0&&!d)return;const b=this.getItemStyle(e,!1);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",m,f,r,c,d),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:o,value:this.getAxisValueText(g,"tooltip",y,f,o,c),missing:ba(y)}]},{seriesId:t,datum:f,title:l,xKey:r,xName:a,yKey:o,yName:l,legendItemName:c,stackGroup:h,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:r,lineDashOffset:a}=this.getStyle(!1,0);return{marker:{fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:r,lineDashOffset:a}}}getLegendData(e){const{showInLegend:t}=this.properties;if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:a,legendItemName:o}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:s&&n.getItemEnabled({seriesId:i,itemId:r}),label:{text:o??a??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!t}]}resetDatumAnimation(e){qd([e.datumSelection,this.phantomSelection])}animateReadyHighlight(e){qd([e,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const{phantomSelection:n}=this,s=sh(nh(this.isVertical(),this.axes,"normal"),"unknown");xt(this.id,"nodes",this.ctx.animationManager,[e,n],s),ht(this,"labels",this.ctx.animationManager,t),ht(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{phantomSelection:t}=this,{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:r,previousContextData:a}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=jI(this.id,i,this.getDatumId.bind(this),e.contextData,a,this.processedData,this.processedDataUpdated),l=a==null?"fade":"normal",c=sh(nh(this.isVertical(),this.axes,l),"added");xt(this.id,"nodes",this.ctx.animationManager,[i,t],c,(h,u)=>this.getDatumId(u),o),(!o||o?.changed||!da(r.groupScale,a?.groupScale))&&(ht(this,"labels",this.ctx.animationManager,n),ht(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return Zt(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return hy(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};uy.className="BarSeries",uy.type="bar";var lP={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",or],["image",Is],["pattern",Ui]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...ts,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:Qr,xOffset:3,yOffset:3,blur:5},highlight:Ql,segmentation:su}},$I={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:qe,dependencies:[nn],options:No,predictAxis:th,defaultAxes:Rv,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:lP,create:e=>new uy(e)},Jd=3,cP=5,UI=.05;function hP(e,t,i){const{xValues:n,yValues:s,xDomain:r,yDomain:a,xNeedsValueOf:o,yNeedsValueOf:l}=e,{x0:c,y0:h,x1:u,y1:d}=i;let p=0,g=1/0;const f=(c+u)/2,m=(h+d)/2;for(const y of t){const b=n[y],x=s[y];if(b==null||x==null)continue;const M=un(b,r.min,r.max,o),I=un(x,a.min,a.max,l),C=(M-f)**2+(I-m)**2;C=c&&y<=u&&b>=h&&b<=d&&(p+=1)}return p}function dP(e,t,i){const{xValues:n,yValues:s,xDomain:r,yDomain:a,xNeedsValueOf:o,yNeedsValueOf:l}=e,{x0:c,y0:h,x1:u,y1:d}=i,p=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],g=(c+u)/2,f=(h+d)/2;for(const y of t){const b=n[y],x=s[y];if(b==null||x==null)continue;const M=un(b,r.min,r.max,o),I=un(x,a.min,a.max,l),C=(M>g?1:0)+(I>f?2:0),D=p[C];D.indices.push(y),D.x0=Math.min(D.x0,M),D.y0=Math.min(D.y0,I),D.x1=Math.max(D.x1,M),D.y1=Math.max(D.y1,I)}const m=[];for(const y of p){const{indices:b,x0:x,x1:M,y0:I,y1:C}=y;if(b.length===0)continue;const D=dy(e,b,{x0:x,y0:I,x1:M,y1:C});m.push(D)}return m}function dy(e,t,i){const{x0:n,y0:s,x1:r,y1:a}=i;let l=t.lengthu){const y=Array.from({length:Jd},()=>[]);for(let b=0;b=0&&IM),b=dy(f,y,{x0:0,y0:0,x1:1,y1:1});b!=null&&m.push({sizeRatio:0,node:b})}return m.length>0?{xValues:i,yValues:n,xd0:o,xd1:l,yd0:c,yd1:h,filters:m,xNeedsValueOf:p,yNeedsValueOf:g}:void 0}function gP(e,t,i,n,s,r,a,o,l,c){const[h,u]=hn(e,r),[d,p]=hn(t,a);return pP([h,u],[d,p],i,n,s,[o[0],o[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function fP(e,t,i,n,s,r,a){const o=i.resolveColumnById(a,"xValue",n),l=i.resolveColumnById(a,"yValue",n),c=r?i.resolveColumnById(a,"sizeValue",n):void 0,h=i.getDomain(a,"xValue","value",n),u=i.getDomain(a,"yValue","value",n),d=r?s.domain:[0,0],p=i.resolveColumnNeedsValueOf(a,"xValue",n),g=i.resolveColumnNeedsValueOf(a,"yValue",n);return gP(e,t,o,l,c,h,u,d,p,g)}function WI(e,t,i,n,s,r){const{xRange:a,yRange:o,xVisibleRange:[l,c],yVisibleRange:[h,u],minSize:d,maxSize:p}=i,{xValues:g,yValues:f,xd0:m,xd1:y,yd0:b,yd1:x,xNeedsValueOf:M,yNeedsValueOf:I}=t,C=1/Math.min(a/(c-l),o/(u-h)),D={xValues:g,yValues:f,xDomain:{min:m,max:y},yDomain:{min:b,max:x},xNeedsValueOf:M,yNeedsValueOf:I};for(const{sizeRatio:A,node:k}of t.filters){const N=.5*(d+A*(p-d)),T=N*C,R=e*T,B=l-N/a,E=c+N/a,V=h-N/o,G=u+N/o,q=[k];for(;q.length>0;){const j=q.pop();if(!(j.x1E||j.y1G))if(e!==1&&j.scale<=R)n!=null&&(n.count+=1),s?.push({datumIndex:j.primaryDatumIndex,count:j.indices.length,area:(j.x1-j.x0)*(j.y1-j.y0),dilation:te(1,j.scale/T,e)});else if(j.children==null){const{indices:Q}=j;if(n!=null){const re=j.x0>=l&&j.x1<=c&&j.y0>=h&&j.y1<=u?Q.length:uP(D,Q,{x0:l,y0:h,x1:c,y1:u});n.count+=re}r?.push(...Q)}else q.push(...j.children)}}}function Qd(e,t,i){const n={count:0};return WI(e,t,i,n,void 0,void 0),n.count}var mP=100,yP=12;function bP(e,t,i){if(Qd(1,e,t)<=i)return 1;let n=1,s=2;for(;Qd(s,e,t)>i&&si?n=a:s=a}return(n+s)/2}function vP(e,t,i){const n=[],s=[];return WI(e,t,i,void 0,n,s),{groupedAggregation:n,singleDatumIndices:s}}var py=class extends Si{constructor(){super(...arguments),this.maxSize=30}};v([S,Y()],py.prototype,"maxSize",2),v([S,mf()],py.prototype,"domain",2);var KI=class extends Ji{constructor(){super(...arguments),this.placement="top"}};v([S],KI.prototype,"placement",2);var je=class extends Bn{constructor(){super(...arguments),this.label=new KI,this.tooltip=Ea(),this.maxRenderedItems=1/0,this.marker=new py}};v([S],je.prototype,"xKey",2),v([S],je.prototype,"yKey",2),v([S],je.prototype,"sizeKey",2),v([S],je.prototype,"labelKey",2),v([S],je.prototype,"selectedKey",2),v([S],je.prototype,"xName",2),v([S],je.prototype,"yName",2),v([S],je.prototype,"sizeName",2),v([S],je.prototype,"labelName",2),v([S],je.prototype,"title",2),v([si("marker.shape")],je.prototype,"shape",2),v([si("marker.size")],je.prototype,"size",2),v([si("marker.maxSize")],je.prototype,"maxSize",2),v([si("marker.domain")],je.prototype,"domain",2),v([si("marker.fill")],je.prototype,"fill",2),v([si("marker.fillOpacity")],je.prototype,"fillOpacity",2),v([si("marker.stroke")],je.prototype,"stroke",2),v([si("marker.strokeWidth")],je.prototype,"strokeWidth",2),v([si("marker.strokeOpacity")],je.prototype,"strokeOpacity",2),v([si("marker.lineDash")],je.prototype,"lineDash",2),v([si("marker.lineDashOffset")],je.prototype,"lineDashOffset",2),v([si("marker.itemStyler")],je.prototype,"itemStyler",2),v([S],je.prototype,"styler",2),v([S],je.prototype,"label",2),v([S],je.prototype,"tooltip",2),v([S],je.prototype,"maxRenderedItems",2);function gy(e,t,i,n){const s=e.canIncrementallyUpdate&&e.nodeIndex{const r=this.createSkeletonNodeDatum(n,s.scratch,s.datumIndex);return this.updateNodeDatum(n,r,s.scratch,s.datumIndex),r},(n,s,r)=>this.updateNodeDatum(n,s,r.scratch,r.datumIndex))}createNodeDataSimple(e,t){const i=e.rawData.length;for(let n=0;nZt(r.xValue,r.yValue,r.sizeValue,Xe(r.label.text))),i.update(t,void 0,s)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,sizeKey:r,labelKey:a,marker:o}=this.properties,l={xKey:n,yKey:s,sizeKey:r,labelKey:a},c=this.ctx.highlightManager.getActiveHighlight();t.each((h,u)=>{if(!t.isGarbage(h)){const d=this.getHighlightState(c,e.isHighlight,u.datumIndex),p=this.getStyle(d);u.style=this.getMarkerStyle(o,u,l,{isHighlight:i,highlightState:d,resolveMarkerSubPath:[]},p)}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:n,drawingMode:s}=e;this.sizeScale.range=this.getSizeRange();const r=this.getShapeFillBBox(),a=this.dataAggregation!=null,o=this.ctx.highlightManager.getActiveHighlight();i.each((l,c,h)=>{const{point:{size:u},count:d,area:p,dilation:g}=c,f=this.getHighlightState(o,n,c.datumIndex),m={...c.style??t.styles[f]};if(m.size=u,g>1){const y=m.fillOpacity??0,b=.269669+683e-6*d+-37.534348*p+.004449*d*p+-0*d**2+44.428603*p**2;m.fillOpacity=te(y/g,y/.1*b,1)}this.applyMarkerStyle(m,l,c.point,r,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(s,m),l.zIndex=a?[-d,h]:0}),n||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(n=>n.datum.datumIndex===t.datumIndex).map(n=>({...n.datum,point:{x:n.x,y:n.y,size:n.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(),n=this.makeLabelFormatterParams();e.labelSelection.each((s,r)=>{const a=Na(this,r,n,this.properties.label,t,i);s.text=r.label.text,s.fill=a.color,s.x=r.point?.x??0,s.y=r.point?.y??0,s.fontStyle=a.fontStyle,s.fontWeight=a.fontWeight,s.fontSize=a.fontSize,s.fontFamily=a.fontFamily,s.textBaseline="top",s.fillOpacity=this.getHighlightStyle(t,r.datumIndex).opacity??1,s.setBoxing(a)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,n=>{n.pointerEvents=1})}makeStylerParams(e){const{id:t,properties:{size:i,maxSize:n,shape:s,fill:r,fillOpacity:a,lineDash:o,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:p,sizeKey:g,labelKey:f}}=this,m=nl(e??0);return this.type==="bubble"?{highlightState:m,size:i,maxSize:n,shape:s,fill:r,fillOpacity:a,lineDash:o,lineDashOffset:l,seriesId:t,sizeKey:g,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:p,labelKey:f}:this.type==="scatter"?{highlightState:m,size:i,shape:s,fill:r,fillOpacity:a,lineDash:o,lineDashOffset:l,seriesId:t,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:p,labelKey:f}:this.type}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,sizeKey:s,sizeName:r,labelKey:a,labelName:o,legendItemName:l}=this.properties;return{xKey:e,xName:t,yKey:i,yName:n,sizeKey:s,sizeName:r,labelKey:a,labelName:o,legendItemName:l}}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r,ctx:a}=this,{formatManager:o}=a,{xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:f,title:m,tooltip:y,marker:b,legendItemName:x}=r,M=s.x,I=s.y;if(!i||!n||!M||!I)return;const C=n.dataSources.get(this.id)?.data?.[e],D=i.resolveColumnById(this,"xValue",n)[e],A=i.resolveColumnById(this,"yValue",n)[e],k=this.properties.allowNullKeys??!1;if(D===void 0&&!k)return;const N=[];if(this.isLabelEnabled()&&g!=null){const R=i.resolveColumnById(this,"labelValue",n)[e],B=o.format(this.callWithContext.bind(this),{type:"category",value:R,datum:C,seriesId:t,legendItemName:x,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});N.push({label:f,fallbackLabel:g,value:B??mo(R)})}if(N.push({label:c,fallbackLabel:l,value:this.getAxisValueText(M,"tooltip",D,C,l,x,k),missing:ba(D,k)},{label:u,fallbackLabel:h,value:this.getAxisValueText(I,"tooltip",A,C,h,x,k),missing:ba(A,k)}),d!=null){const R=i.resolveColumnById(this,"sizeValue",n)[e];if(R!=null){const B=i.getDomain(this,"sizeValue","value",n).domain,E=o.format(this.callWithContext.bind(this),{type:"number",value:R,datum:C,seriesId:t,legendItemName:x,key:d,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:B,fractionDigits:void 0,visibleDomain:void 0});N.push({label:p,fallbackLabel:d,value:E??mo(R)})}}const T=this.getMarkerStyle(b,{datum:C,datumIndex:e},{xKey:l,yKey:h,sizeKey:d,labelKey:g},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(y,{title:m,symbol:this.legendItemSymbol(),data:N},{seriesId:t,datum:C,title:h,xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:f,legendItemName:x,...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:n,yName:s,legendItemName:r,title:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??a??s??n},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){KR(this,this.ctx.animationManager,e),ht(this,"labels",this.ctx.animationManager,t)}resetDatumAnimation(e){$d([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new kt}getStyle(e){const{properties:t}=this;let i={};if(t.styler){const n=this.makeStylerParams(e),s=this.cachedCallWithContext(t.styler,n)??{};i=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],s,{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:n,labelKey:s,marker:r}=this.properties;return this.getMarkerStyle(r,e,{xKey:t,yKey:i,sizeKey:n,labelKey:s},{resolveMarkerSubPath:[]})}computeFocusBounds(e){return Ud(this,e)}hasItemStylers(){const{styler:e,itemStyler:t,marker:i,label:n}=this.properties;return!!(e??t??i.itemStyler??n.itemStyler)}initQuadTree(e){Zd(e,this.datumNodesIter())}pickNodeDataClosestDatum(e){return Xd(this,e)}};ep.className="BubbleSeries",ep.type="bubble";var YI={title:O,domain:ie(P),maxSize:w,showInMiniChart:L,label:{placement:F("top","right","bottom","left"),...Oe},tooltip:we,styler:De({...An,maxSize:w}),maxRenderedItems:P,...Ie,...K(An,["enabled"]),highlight:at(Ue,Ue)},ZI={...YI,...Cn,type:X(_e("bubble")),xKey:X(O),yKey:X(O),sizeKey:X(O),labelKey:O,xName:O,yName:O,sizeName:O,labelName:O,legendItemName:O,xKeyAxis:O,yKeyAxis:O,highlight:at(Ue,Ue)};ZI.selectedKey=J(O);var SP={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Jl],["image",Is],["pattern",Ui]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...ts,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:Ql}},XI={type:"series",name:"bubble",chartType:"cartesian",version:qe,dependencies:[nn],options:ZI,predictAxis:sy,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:SP,create:e=>new ep(e)},Nt=class extends Bn{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 us,this.label=new Ji,this.tooltip=Ea()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:a,cornerRadius:o}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:a,cornerRadius:o,opacity:1}}};v([S],Nt.prototype,"xKey",2),v([S],Nt.prototype,"yKey",2),v([S],Nt.prototype,"xName",2),v([S],Nt.prototype,"yName",2),v([S],Nt.prototype,"fill",2),v([S],Nt.prototype,"fillOpacity",2),v([S],Nt.prototype,"stroke",2),v([S],Nt.prototype,"strokeWidth",2),v([S],Nt.prototype,"strokeOpacity",2),v([S],Nt.prototype,"lineDash",2),v([S],Nt.prototype,"lineDashOffset",2),v([S],Nt.prototype,"cornerRadius",2),v([S],Nt.prototype,"areaPlot",2),v([S],Nt.prototype,"bins",2),v([S],Nt.prototype,"aggregation",2),v([S],Nt.prototype,"binCount",2),v([S],Nt.prototype,"shadow",2),v([S],Nt.prototype,"label",2),v([S],Nt.prototype,"tooltip",2);var qI=10,fy=class extends Nr{constructor(e){super({moduleCtx:e,propertyKeys:sl,propertyNames:rl,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:rh,label:Oa}}),this.properties=new Nt,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(e){const t=Do(e[0],e[1],qI).ticks,i=Co(e[0],e[1],qI),[n]=t,s=r=>[r,r+i];return[[n-i,n],...t.map(s)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),n=e[1],s=t||1,{start:r,binSize:a}=this.calculateNiceStart(i,n,s);return this.getBins(r,n,a,s)}getBins(e,t,i,n){const s=[],r=this.calculatePrecision(i);for(let a=0;a0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const n=Math.abs(t-e)/i,s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return{start:Math.floor(e/r)*r,binSize:n}}async processData(e){const{visible:t}=this,{xKey:i,yKey:n,areaPlot:s,aggregation:r}=this.properties,a=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:o,xScale:a}),h=t?{}:{forceValue:0},u=[kr(i,l),WN];if(n){let b=jS("groupAgg",{visible:t});r==="count"||(r==="sum"?b=cN("groupAgg",{visible:t}):r==="mean"&&(b=uN("groupAgg",{visible:t}))),s&&(b=HS("groupAgg",b)),u.push(Qe(n,c,{invalidValue:void 0,...h}),b)}else{u.push(jN("count"));let b=jS("groupAgg",{visible:t});s&&(b=HS("groupAgg",b)),u.push(b)}let d=[];const p=b=>{const x=Ri(b.domain.keys[0]);if(x.length===0)return b.domain.groups=[],()=>[];const M=Hi(this.properties.binCount)?this.calculateNiceBins(x,this.properties.binCount):this.properties.bins??this.deriveBins(x),I=M.length;return d=[...M],C=>{let D=C[0];if(Sn(D)&&(D=D.getTime()),!Hi(D))return[];for(let A=0;A=k[0]&&D{const x=y.get(Zt(...b));if(x){const{group:M,groupIndex:I}=x,[[C,D]=[0,0]]=M.aggregation,A=[...g.forEachDatum(this,m,M,I)],k=this.frequency(M),N=C+D;return{domain:b,datum:A,groupIndex:I,frequency:k,total:N}}else return{domain:b,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 n=i.getDomain(this,"groupAgg","aggregate",t).domain,s=this.calculatedBins[0].domain[0],r=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return e==="x"?{domain:Ri([s,r])}:{domain:Ri(n)}}getSeriesRange(e,[t,i]){const{dataModel:n,processedData:s}=this;if(!n||s?.type!=="grouped")return[Number.NaN,Number.NaN];const r=this.axes.x.scale,a=0;let o=-1/0;for(const{keys:l,aggregation:c}of s.groups){const[[h,u]=[0,0]]=c,[d,p]=l,[g,f]=Ct([r.convert(d),r.convert(p)]);if(f>=t&&g<=i){const m=h+u;o=Math.max(o,m)}}return a>o?[Number.NaN,Number.NaN]:[a,o]}frequency(e){return e.datumIndices.reduce((t,i)=>t+i.length,0)}createNodeDatumContext(e,t){const{xKey:i,yKey:n,xName:s,yName:r,label:a}=this.properties,{contextNodeData:o,processedData:l}=this,c=o?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:e.scale,yScale:t.scale,yAxisReversed:t.isReversed(),rawData:[],xValues:[],xKey:i,yKey:n,xName:s,yName:r,label:a,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?o.nodeData:[],nodeIndex:0}}createLabelData(e,t,i,n,s,r){const{label:a,yKey:o,xKey:l,xName:c,yName:h}=e,{total:u,datum:d}=t;if(!(!a.enabled||u===0))return{x:i+s/2,y:n+r/2,text:this.getLabelText(u,d,o,"y",[],a,{value:u,datum:d,xKey:l,yKey:o,xName:c,yName:h})}}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:n}=e,{domain:s,datum:r,groupIndex:a,frequency:o,total:l}=t;return{series:this,datumIndex:a,datum:r,aggregatedValue:l,frequency:o,domain:s,yKey:n,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:n,yScale:s,yAxisReversed:r}=e,{domain:a,datum:o,groupIndex:l,frequency:c,total:h}=i,u=t,[d,p]=a,g=n.convert(d),f=n.convert(p),m=s.convert(0),y=s.convert(h),b=Math.abs(f-g),x=Math.abs(y-m),M=Math.min(g,f),I=Math.min(m,y);u.datumIndex=l,u.datum=o,u.aggregatedValue=h,u.frequency=c,u.domain=a,u.x=M,u.y=I,u.xValue=g,u.yValue=y,u.width=b,u.height=x,u.midPoint?(u.midPoint.x=M+b/2,u.midPoint.y=I+x/2):u.midPoint={x:M+b/2,y:I+x/2},u.topLeftCornerRadius=!r,u.topRightCornerRadius=!r,u.bottomRightCornerRadius=r,u.bottomLeftCornerRadius=r,u.label=this.createLabelData(e,i,M,I,b,x)}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)gy(e,i,(n,s)=>this.createNodeDatum(n,s),(n,s,r)=>this.updateNodeDatum(n,s,r))}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:xm(this.getItemStyle.bind(this))}}finalizeNodeData(e){super.finalizeNodeData(e),e.nodes.sort((t,i)=>t.x-i.x)}nodeFactory(){return new wt}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return gn(this.processedData)?i.update(t,void 0,n=>Zt(...n.domain)):i.update(t)}getItemStyle(e,t,i){const{properties:n}=this,s=this.getHighlightStyle(t,e,i);return xe(s,n.getStyle())}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e;t.each((n,s)=>{t.isGarbage(n)||(s.style=this.getItemStyle(s.datumIndex,i))})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getShapeFillBBox();e.datumSelection.each((r,a)=>{const o=a.style??t.styles[this.getHighlightState(i,e.isHighlight,a.datumIndex)],{cornerRadius:l=0}=o,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:u,bottomLeftCornerRadius:d}=a;r.setStyleProperties(o,s),r.topLeftCornerRadius=c?l:0,r.topRightCornerRadius=h?l:0,r.bottomRightCornerRadius=u?l:0,r.bottomLeftCornerRadius=d?l:0,r.crisp=a.crisp,r.fillShadow=n})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,n=>{n.pointerEvents=1,n.textAlign="center",n.textBaseline="middle"})}updateLabelNodes(e){const t=this.isLabelEnabled(),{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,r)=>{const a=Na(this,r,this.properties,this.properties.label,i,n),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,color:d}=a;o&&t&&r?.label?(s.text=r.label.text,s.x=r.label.x,s.y=r.label.y,s.fontStyle=l,s.fontWeight=c,s.fontFamily=u,s.fontSize=h,s.fill=d,s.visible=!0,s.fillOpacity=this.getHighlightStyle(i,r.datumIndex).opacity??1,s.setBoxing(a)):s.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof ae&&Zd(e,t.children())}pickNodeClosestDatum(e){return Xd(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r,ctx:{localeManager:a}}=this,{xKey:o,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=r,p=s.x,g=s.y;if(!i||n?.type!=="grouped"||!p||!g)return;const f=n.groups[e],{aggregation:m,keys:y}=f,[[b,x]=[0,0]]=m,M=this.frequency(f),I=y,[C,D]=I,A=b+x,k={data:[...i.forEachDatum(this,n,f,e)],aggregatedValue:A,frequency:M,domain:I},N=[{label:l,fallbackLabel:o,value:`${this.getAxisValueText(p,"tooltip",C,k,o,d)} - ${this.getAxisValueText(p,"tooltip",D,k,o,d)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(g,"tooltip",M,k,c,d)}];if(c!=null){let T;switch(r.aggregation){case"sum":T=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":T=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":T=a.t("seriesHistogramTooltipCount",{yName:h??c});break}N.push({label:T,value:this.getAxisValueText(g,"tooltip",A,k,c,d)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:N},{seriesId:t,datum:k,title:h,xKey:o,xName:l,yKey:c,yName:h,xRange:[C,D],frequency:M,...this.getItemStyle(e,!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:a}=this.properties;return{marker:{fill:Ee(e)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:r,showInLegend:a}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:r??s??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!a}]}resetDatumAnimation(e){qd([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=sh(nh(!0,this.axes,"normal"),"unknown");xt(this.id,"datums",this.ctx.animationManager,[e],i),ht(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=sh(nh(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};xt(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(n,s)=>Zt(...s.domain),i),i?.changed&&ht(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return hy(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.label.itemStyler!=null}};fy.className="HistogramSeries",fy.type="histogram";var JI={showInMiniChart:L,cornerRadius:w,label:Oe,tooltip:we,shadow:es,...Ie,...$,..._,...W,highlight:at(Ue,Ue),areaPlot:L,aggregation:F("count","sum","mean"),bins:ie(ie(P)),binCount:w},MP={...Cn,...JI,type:X(_e("histogram")),xKey:X(O),yKey:O,xKeyAxis:O,yKeyAxis:O,xName:O,yName:O},IP={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",or],["image",Is],["pattern",Ui]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...ts,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Qr,xOffset:3,yOffset:3,blur:5},highlight:Ql}},QI={type:"series",name:"histogram",chartType:"cartesian",version:qe,dependencies:[nn],options:MP,predictAxis:th,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:IP,create:e=>new fy(e)},DP=10;function tp(e,t,i,n,s,r,a,o){const l=e[r];if(l===void 0)return!1;const c=Number.isFinite(t)?un(l,t,i,a):po(r,o),h=au(c,s);return r===n[h+cn]||r===n[h+kn]||r===n[h+Ln]||r===n[h+Tn]}function eD(e,t,i,n,s,r,a,o){let l=0;for(let u=0;um.maxRange===h);let{indexData:d,valueData:p}=As(t,i,i,r,a,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),g=eD(t,r,a,d,h,o,s,u?.indices);const f=[{maxRange:h,indices:g,indexData:d,valueData:p}];for(;g.length>DP&&h>64;){const m=h,y=Math.trunc(m/2),b=c?.find(M=>M.maxRange===y),x=Jr(d,p,m,{reuseIndexData:b?.indexData,reuseValueData:b?.valueData});h=x.maxRange,d=x.indexData,p=x.valueData,g=CP(g,t,r,a,d,h,o,s,b?.indices),f.push({maxRange:h,indices:g,indexData:d,valueData:p})}return f.reverse(),f}function AP(e,t,i,n){const s=t.length;if(sx.maxRange===d),{indexData:g,valueData:f}=As(t,i,i,r,a,d,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),m=eD(t,r,a,g,d,o,s,p?.indices),y={maxRange:d,indices:m,indexData:g,valueData:f};function b(){return my([r,a],t,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(M=>M.maxRange!==d)??[]}return{immediate:[y],computeRemaining:b}}function wP(e,t,i,n,s,r){const[a,o]=hn(e,n);return my([a,o],t,i,{xNeedsValueOf:s,yNeedsValueOf:r})}var kP=cc(wP);function LP(e,t,i,n,s,r){const a=t.resolveColumnById(s,"xValue",i),o=t.resolveColumnById(s,n,i),l=t.getDomain(s,"xValue","value",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,n,i);if(r){const[u,d]=hn(e,l);return my([u,d],a,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:r})}return kP(e,a,o,l,c,h)}function TP(e,t,i,n,s,r,a){const o=t.resolveColumnById(s,"xValue",i),l=t.resolveColumnById(s,n,i),c=t.getDomain(s,"xValue","value",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,n,i),[d,p]=hn(e,c);return AP([d,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:u,targetRange:r,existingFilters:a})}var St=class extends Bn{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new co,this.marker=new Si,this.label=new Ji,this.tooltip=Ea(),this.connectMissingData=!1,this.sparklineMode=!1}};v([S],St.prototype,"xKey",2),v([S],St.prototype,"yKey",2),v([S],St.prototype,"xName",2),v([S],St.prototype,"yName",2),v([S],St.prototype,"selectedKey",2),v([S],St.prototype,"stackGroup",2),v([S],St.prototype,"normalizedTo",2),v([S],St.prototype,"title",2),v([S],St.prototype,"stroke",2),v([S],St.prototype,"strokeWidth",2),v([S],St.prototype,"strokeOpacity",2),v([S],St.prototype,"lineDash",2),v([S],St.prototype,"lineDashOffset",2),v([S],St.prototype,"interpolation",2),v([S],St.prototype,"styler",2),v([S],St.prototype,"marker",2),v([S],St.prototype,"label",2),v([S],St.prototype,"tooltip",2),v([S],St.prototype,"connectMissingData",2),v([S],St.prototype,"sparklineMode",2);var yy=class extends Nr{constructor(e){super({moduleCtx:e,propertyKeys:sl,propertyNames:rl,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:ny({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Oa,datum:(t,i)=>({...Hd(t),...eh(t,i)})},clipFocusBox:!1}),this.properties=new St,this.aggregationManager=new _d}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:n=this.id,stackCount:s=0}={}}=this,{xKey:r,yKey:a,selectedKey:o,connectMissingData:l,normalizedTo:c}=this.properties,h=this.axes.x?.scale,u=this.axes.y?.scale,{isContinuousX:d,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:u}),f=s>1||c!=null,m={invalidValue:null};l&&f&&(m.invalidValue=0),f&&!i&&(m.forceValue=0);const y={value:`area-stack-${n}-yValue`,marker:`area-stack-${n}-yValues-marker`},b=[],x=this.properties.allowNullKeys??!1;(!d||f)&&b.push(kr(r,p,{id:"xKey",allowNullKey:x})),b.push(Qe(r,p,{id:"xValue",allowNullKey:x}),Qe(a,g,{id:"yValueRaw",...m,invalidValue:void 0})),o!=null&&b.push(Qe(o,"category",{id:"selectedRaw"})),f&&b.push(...ka(a,"normal",{id:"yValueCumulative",...m,groupId:y.marker},g)),Zn(c)&&b.push(Qe(a,g,{id:"yValue",...m,groupId:y.value}),md(Object.values(y),c)),this.needsDataModelDiff()&&(b.push(Gc(d?["xValue"]:void 0)),this.processedData&&b.push(bd(this.id,this.processedData)));const{dataModel:M,processedData:I}=await this.requestDataModel(e,t,{props:b,groupByKeys:f,groupByData:!f});this.aggregateData(M,I),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,n=this.axes.x.scale.convert(e),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}yCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.y.scale.convert(e[0]),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:n}=this;if(!t||!i)return{domain:[]};const s=n.y;if(e==="x"){const a=t.resolveProcessedDataDefById(this,"xValue"),o=t.getDomain(this,"xValue","value",i);if(a?.def.type==="value"&&a.def.valueType==="category"){const l=t.getKeySortMetadata(this,"xValue",i);return{domain:o.domain,sortMetadata:l}}return{domain:Ri(na(o.domain))}}const r=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&s instanceof Qi&&!(s instanceof ul)){const a=Number.isFinite(r[1]-r[0])?[Math.min(r[0],0),Math.max(r[1],0)]:[];return{domain:Ri(a)}}else return{domain:Ri(r)}}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"||gn(t))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>TP(i.scale.type,e,t,this.yCumulativeKey(t),this,n,r),computeFull:r=>LP(i.scale.type,e,t,this.yCumulativeKey(t),this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Ks.record(`${this.type}:aggregation`,s.map(r=>r.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:n}=this;if(!i||!n)return;const s=e.scale,r=t.scale,a=n.dataSources.get(this.id)?.data??[],[o,l]=s.range,c=Math.abs(l-o);this.aggregationManager.ensureLevelForRange(c);const h=this.aggregationManager.getFilterForRange(c),u=this.canIncrementallyUpdateNodes(h!=null);return{xAxis:e,yAxis:t,rawData:a,xValues:i.resolveColumnById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValueRaw",n),yCumulativeValues:i.resolveColumnById(this,this.yCumulativeKey(n),n),selectionValues:this.properties.selectedKey?i.resolveColumnById(this,"selectedRaw",n):void 0,xScale:s,yScale:r,xOffset:(s.bandwidth??0)/2,yOffset:(r.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:u,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:u?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 n=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.nodeIndexArray.isArray(n)?Jc(n,this.properties.interpolation):[]);return t.strokeData={itemId:e.yKey,spans:i},t.crossFiltering=this.properties.selectedKey!=null,t.segments=Yd(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:n}=e,s=xe(this.getHighlightStyle(),this.getStyle()),{strokeWidth:r,stroke:a,strokeOpacity:o,lineDash:l,lineDashOffset:c,opacity:h}=s,u=this.contextNodeData?.segments;t.setProperties({segments:u,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:h,stroke:a,strokeWidth:r,strokeOpacity:o,lineDash:l,lineDashOffset:c}),t.datum=u,n||(t.visible=i),Kd(this,t)}updateDatumSelection(e){let{nodeData:t}=e;const{datumSelection:i}=e,{contextNodeData:n,processedData:s,axes:r,properties:a}=this,{marker:o}=a;return t=n?.crossFiltering===!0||ey(s.input.count,r.x.scale,o)?t:[],o.isDirty()&&(i.clear(),i.cleanup()),gn(this.processedData)?i.update(t,void 0,c=>Zt(c.xValue)):i.update(t)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{marker:n}=this.properties,s=this.ctx.highlightManager.getActiveHighlight();t.each((r,a)=>{if(!t.isGarbage(r)){const o=this.getHighlightState(s,e.isHighlight,a.datumIndex),l=this.getStyle(o),{stroke:c,strokeWidth:h,strokeOpacity:u}=l,d=this.makeItemStylerParams(this.dataModel,this.processedData,a.datumIndex,l.marker);a.style=this.getMarkerStyle(n,a,d,{isHighlight:i,highlightState:o},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:u})}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:n}=e,s=this.ctx.animationManager.isSkipped(),r=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(n,e.drawingMode);i.each((l,c)=>{const h=this.getHighlightState(a,n,c.datumIndex),u=c.style??t.styles[h];this.applyMarkerStyle(u,l,c.point,r,{applyTranslation:s,selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(o,u)}),n||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(),n=this.makeLabelFormatterParams();e.labelSelection.each((s,r)=>{const a=Na(this,r,n,this.properties.label,t,i),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,color:d}=a;o&&r?.labelText?(s.fontStyle=l,s.fontWeight=c,s.fontSize=h,s.fontFamily=u,s.textAlign="center",s.textBaseline="bottom",s.text=r.labelText,s.x=r.point.x,s.y=r.point.y-10,s.fill=d,s.visible=!0,s.fillOpacity=this.getHighlightStyle(t,r.datumIndex).opacity??1,s.setBoxing(a)):s.visible=!1})}makeStylerParams(e){const{id:t}=this,{marker:i,lineDash:n,lineDashOffset:s,stroke:r,strokeOpacity:a,strokeWidth:o,xKey:l,yKey:c}=this.properties,h=nl(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:n,lineDashOffset:s,seriesId:t,stroke:r,strokeOpacity:a,strokeWidth:o,xKey:l,yKey:c}}makeItemStylerParams(e,t,i,n){const{xKey:s,yKey:r}=this.properties,a=e.resolveColumnById(this,"xValue",t)[i],o=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(n.fill)??n.fill;return{...bm(a,o,s,r,l,c),xValue:a,yValue:o,...n,fill:h}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{xKey:a,xName:o,yKey:l,yName:c,tooltip:h,legendItemName:u}=r,d=r.allowNullKeys??!1,p=s.x,g=s.y;if(!i||!n||!p||!g)return;const f=n.dataSources.get(this.id)?.data?.[e],m=i.resolveColumnById(this,"xValue",n)[e],y=i.resolveColumnById(this,"yValueRaw",n)[e];if(m===void 0&&!d)return;const b=this.getStyle(),x=this.makeItemStylerParams(i,n,e,b.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:f},x,{isHighlight:!1},b.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",m,f,a,u,d),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",y,f,l,u),missing:ba(y)}]},{seriesId:t,datum:f,title:c,xKey:a,xName:o,yKey:l,yName:c,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:n,marker:s}=this.getStyle();return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:s.size,shape:s.shape,fill:s.fill,fillOpacity:s.fillOpacity,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:r,title:a,legendItemName:o,showInLegend:l}=this.properties;return[{legendType:e,id:t,itemId:s,legendItemName:o,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:o??a??r??s},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,t){const i=t.strokeData.spans,[n]=e;n.path.clear(),Xm(n,i),n.markDirty("LineSeries")}resetDatumAnimation(e){$d([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:n,contextData:s,paths:r}=e,{animationManager:a}=this.ctx;this.updateLinePaths(r,s),ty(this,a,...r),Gt([t],eh),Qm(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),ht(this,"labels",a,i),ht(this,"annotations",a,...n)}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:n,annotationSelections:s,contextData:r,paths:a,previousContextData:o}=e,[l]=a;if(r.visible===!1&&o?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(a,r)},h=()=>{t.skipCurrentBatch(),c()};if(r==null||o==null){c(),Qc(this,t,"added",this.getAnimationDrawingModes(),i),Fs(this.id,"path_properties",t,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),ht(this,"labels",t,n),ht(this,"annotations",t,...s);return}if(r.crossFiltering!==o.crossFiltering){h();return}const u=UR(r,o,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(u===void 0){h();return}else if(u.status==="no-op")return;xt(this.id,"path_properties",t,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(a,r):u.status==="removed"?this.updateLinePaths(a,o):Vd(this.id,"path_update",t,[l],u.stroke.path),u.hasMotion&&(Qc(this,t,void 0,this.getAnimationDrawingModes(),i),ht(this,"labels",t,n),ht(this,"annotations",t,...s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(a,r)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new kt}getStyle(e){const{styler:t,marker:i,lineDash:n,lineDashOffset:s,stroke:r,strokeOpacity:a,strokeWidth:o}=this.properties,{size:l,shape:c,fill:h="transparent",fillOpacity:u}=i;let d={};if(t){const p=this.makeStylerParams(e),g=this.cachedCallWithContext(t,p)??{};d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],g,{pick:!1})??{}}return d.marker??(d.marker={}),{lineDash:d.lineDash??n,lineDashOffset:d.lineDashOffset??s,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??a,strokeWidth:d.strokeWidth??o,marker:{fill:d.marker.fill??h,fillOpacity:d.marker.fillOpacity??u,shape:d.marker.shape??c,size:d.marker.size??l,lineDash:d.marker.lineDash??i.lineDash??n,lineDashOffset:d.marker.lineDashOffset??i.lineDashOffset??s,stroke:d.marker.stroke??i.stroke??r,strokeOpacity:d.marker.strokeOpacity??i.strokeOpacity??a,strokeWidth:d.marker.strokeWidth??i.strokeWidth??o}}}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 Ud(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};yy.className="LineSeries",yy.type="line";var NP={series:{stroke:ig,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",Jl],["image",Is],["pattern",Ui]]},stroke:{$palette:"stroke"}},label:{...ts,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:ng,segmentation:su}},tD={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:qe,dependencies:[nn],options:Ic,predictAxis:th,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:NP,create:e=>new yy(e)},by=class extends ep{};by.className="ScatterSeries",by.type="scatter";var iD={title:O,showInMiniChart:L,label:{placement:F("top","right","bottom","left"),...Oe},tooltip:we,errorBar:Zl,styler:De(An),maxRenderedItems:P,...Ie,...K(An,["enabled"]),highlight:at(Ue,Ue)},nD={...iD,...Cn,type:X(_e("scatter")),xKey:X(O),yKey:X(O),labelKey:O,xName:O,yName:O,labelName:O,legendItemName:O,xKeyAxis:O,yKeyAxis:O,errorBar:$h,highlight:at(Ue,Ue)};nD.selectedKey=J(O);var OP={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Jl],["image",Is],["pattern",Ui]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...ts,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:Ql}},sD={type:"series",name:"scatter",chartType:"cartesian",version:qe,dependencies:[nn],options:nD,predictAxis:sy,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:OP,create:e=>new by(e)},rD=[BI,$I,XI,QI,tD,sD],aD=[lI,rD,Bf,Gf].flat(),oD={angle:["angleKey"],radius:["radiusKey"]},lD={angle:["angleName"],radius:["radiusName"]},vy=class extends Am{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:n,...s}){super({...s,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new ae({name:"items"})),this.nodeData=[],this.itemSelection=bt.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=bt.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=bt.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=bt.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=n,this.animationState=new hc("empty",{empty:{update:{target:"ready",action:r=>this.animateEmptyUpdateReady(r)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:r=>this.animateReadyHighlight(r),highlightMarkers:r=>this.animateReadyHighlightMarkers(r),resize:r=>this.animateReadyResize(r),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:r=>this.animateWaitingUpdateReady(r)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:r=>this.animateClearingUpdateEmpty(r)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",r=>this.onLegendItemClick(r)),this.ctx.eventsHub.on("legend:item-double-click",r=>this.onLegendItemDoubleClick(r)))}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 Oi;return e.pointerEvents=1,e}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new U(-e,-e,e*2,e*2),axis:new U(-e,-e,e*2,e*2)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&Gt([this.itemSelection,this.highlightSelection],e),t&&Gt([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&&Gt([this.highlightSelection],t),i&&Gt([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 At&&i.datum===t)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(e,t){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:n,datumIndex:s}=e??{},r=typeof s=="number"?t?.[s]:void 0;return i===this||r!=null&&r===n}},xy=class extends Pd{constructor(e,t){super(e,t),this.axes=this.createChartAxes(),this.padding=new ra(40),this.ctx.axisManager.axisGroup.zIndex=8}createChartAxes(){return new xO}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 n of this.axes)n.update();let i=0;for(const n of this.series)i=Math.max(i,n.properties.marker?.size??0);for(const n of this.series.filter(cD))n.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:t,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}updateAxes(e,t,i,n){if(this.axes.length===0)return;const s=this.axes.angle,r=this.axes.radius,a=s.scale,o=r.innerRadiusRatio;s.innerRadiusRatio=o,s.computeRange(),s.gridLength=n,r.gridAngles=a.ticks({nice:[s.nice,s.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>a.convert(l)),r.gridRange=s.range,r.range=[n,n*o];for(const l of[s,r])l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()}async computeCircle(e){const t=this.series.filter(cD),i=(l,c,h)=>{this.updateAxes(e,l,c,h);for(const d of t)d.centerX=l,d.centerY=c,d.radius=h;const u=t.filter(d=>d.type==="donut"||d.type==="pie");if(u.length>1){const d=u.map(p=>{const g=p.getInnerRadius();return{series:p,innerRadius:g}}).sort((p,g)=>p.innerRadius-g.innerRadius);d.at(-1).series.surroundingRadius=void 0;for(let p=0;p{const c=[];for(const d of Kr(this.axes,t)){const p=await d.computeLabelsBBox({hideWhenNecessary:l},e);p&&c.push(p)}if(c.length===0){i(n,s,r);return}const h=U.merge(c),u=this.refineCircle(h,a,e);i(u.centerX,u.centerY,u.radius),a=u.radius};await o(),await o(),await o(),await o({hideWhenNecessary:!0}),await o({hideWhenNecessary:!0});for(const l of Kr(this.axes,t))await l.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:a,centerX:n,centerY:s}}refineCircle(e,t,i){const s=-t,r=-t,a=t,o=t;let l=Math.max(0,s-e.x),c=Math.max(0,r-e.y),h=Math.max(0,e.x+e.width-a),u=Math.max(0,e.y+e.height-o);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,p=i.height-c-u;let g=Math.min(d,p)/2;const f=.5*i.width/2,m=.5*i.height/2,y=Math.min(f,m);if(gi.height){const C=i.height-2*g;Math.min(c,u)*2>C?(c=C/2,u=C/2):c>u?c=C-u:u=C-c}if(2*g+M>i.width){const C=i.width-2*g;Math.min(l,h)*2>C?(l=C/2,h=C/2):l>h?l=C-h:h=C-l}}const b=l+2*g+h,x=c+2*g+u;return{centerX:(i.width-b)/2+l+g,centerY:(i.height-x)/2+c+g,radius:g}}};xy.className="PolarChart",xy.type="polar";function cD(e){return e instanceof vy}var ip={type:"chart",name:"polar",version:qe,options:oE,create(e,t){return new xy(e,t)},validate(e,t,i){const n=[],s=e?.series?.[0]?.type;(s==="pie"||s==="donut")&&e?.axes&&(n.push(new Oh([],e.axes,i,"axes")),e=K(e,["axes"]));const r=Vt(e,t,i);return r.invalid.push(...n),r}},hD=class ob{constructor(t,i,n,s){this.startAngle=t,this.endAngle=i,this.innerRadius=n,this.outerRadius=s}clone(){const{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}=this;return new ob(t,i,n,s)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[Yu](t,i){return new ob(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)}};function uD({startAngle:e,endAngle:t,innerRadius:i,outerRadius:n}){let s=1/0,r=1/0,a=-1/0,o=-1/0;const l=(c,h)=>{s=Math.min(c,s),r=Math.min(h,r),a=Math.max(c,a),o=Math.max(h,o)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(n*Math.cos(e),n*Math.sin(e)),l(n*Math.cos(t),n*Math.sin(t)),dr(0,e,t)&&l(n,0),dr(Math.PI*.5,e,t)&&l(0,n),dr(Math.PI,e,t)&&l(-n,0),dr(Math.PI*1.5,e,t)&&l(0,-n),new U(s,r,a-s,o-r)}function Sy(e,t,i){const n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:s,outerRadius:r}=i;if(i.startAngle===i.endAngle||nMath.max(s,r))return!1;const a=bu(i.startAngle),o=bu(i.endAngle),l=Math.atan2(t,e);return a=a:l<=o&&l>=-Math.PI||l>=a&&l<=Math.PI}function EP(e,t,i,n,s,r,a,o,l,c){if(Number.isNaN(e)||Number.isNaN(t))return 0;r&&([s,n]=[n,s]);const h=(c-o)/(l-a),u=o-h*a,d=Math.pow(h,2)+1,p=2*(h*(u-t)-e),g=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(i,2),f=Math.pow(p,2)-4*d*g;if(f<0)return 0;const m=(-p+Math.sqrt(f))/2/d,y=(-p-Math.sqrt(f))/2/d;let b=0;for(const x of[m,y]){if(!(x>=Math.min(a,l)&&x<=Math.max(a,l)))continue;const I=h*x+u,C=x-e,D=I-t,A=Math.atan2(D,C);dr(A,n,s)&&b++}return b}function dD(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=t,a={x:r*Math.cos(i),y:r*Math.sin(i)},o={x:r*Math.cos(n),y:r*Math.sin(n)},l=s===0?{x:0,y:0}:{x:s*Math.cos(i),y:s*Math.sin(i)},c=s===0?{x:0,y:0}:{x:s*Math.cos(n),y:s*Math.sin(n)};return Ac(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,l.x,l.y)||Ac(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,c.x,c.y)||EP(0,0,r,i,n,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function RP(e,t){const i={x:e.x,y:e.y},n={x:e.x+e.width,y:e.y},s={x:e.x,y:e.y+e.height},r={x:e.x+e.width,y:e.y+e.height};return dD({start:i,end:n},t)||dD({start:s,end:r},t)}function pD(e,t,i,n){if(i===0&&n===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*n)/(e+1*n))-t<0)return 1;let r=0,a=1;for(let o=0;o<8;o+=1){const l=(r+a)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*n)/(e+l*n))-t<0?r=l:a=l}return r}var PP=1e-6;function Fr(e,t){return vu(e,t)=2*Math.PI?2*Math.PI:yi(t-e);return e=Fr(e,i),t=e+s,{startAngle:e,endAngle:t}}function sp(e,t,i,n,s,r){const a=Math.sin(r),o=Math.cos(r),l=e**2+t**2-i**2;let c,h,u,d;if(o>.5){const x=a/o,M=1+x**2,I=-2*(e+t*x),C=I**2-4*M*l;if(C<0)return;const D=(-I+Math.sqrt(C))/(2*M),A=(-I-Math.sqrt(C))/(2*M);c=D,h=D*x,u=A,d=A*x}else{const x=o/a,M=1+x**2,I=-2*(t+e*x),C=I**2-4*M*l;if(C<0)return;const D=(-I+Math.sqrt(C))/(2*M),A=(-I-Math.sqrt(C))/(2*M);c=D*x,h=D,u=A*x,d=A}const p=o,g=a,f=c*p+h*g,m=u*p+d*g,y=f>0?Fr(Math.atan2(h-t,c-e),n):Number.NaN,b=m>0?Fr(Math.atan2(d-t,u-e),n):Number.NaN;if(y>=n&&y<=s)return y;if(b>=n&&b<=s)return b}function rp(e,t,i,n,s,r){const a=Math.hypot(e,t),o=(a**2-i**2+r**2)/(2*a),l=a-o,c=Math.atan2(t,e),h=Math.acos(-l/i),u=Fr(c+h,n),d=Fr(c-h,n);if(u>=n&&u<=s)return u;if(d>=n&&d<=s)return d}var My=class{constructor(e,t,i,n,s){this.cx=e,this.cy=t,this.r=i,this.a0=n,this.a1=s,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.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))}},qt=class extends At{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 uD(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}=np(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),r=np(e.startAngle,e.endAngle,t);return new hD(Math.max(t,r.startAngle),Math.min(i,r.endAngle),Math.max(n,e.innerRadius),Math.min(s,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,n,s,r,a,o){if(e<=0)return;const{startAngle:l,endAngle:c}=np(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(o&&h<=0)return;const p=o?this.getAngleOffset(h+e):this.getAngleOffset(u-e),g=a?l+p+t:c-p-t,f=o?h+e:u-e,m=f*Math.cos(g),y=f*Math.sin(g);if(d!=null&&(!a&&!(g>=l-1e-6&&g<=d.endAngle-1e-6)||a&&!(g>=d.startAngle+1e-6&&g<=c-1e-6)||o&&fd.outerRadius+1e-6))return;const b=new My(m,y,e,i,n);if(d!=null){o?(b.clipStart(sp(m,y,e,i,n,d.endAngle)),b.clipEnd(sp(m,y,e,i,n,d.startAngle))):(b.clipStart(sp(m,y,e,i,n,d.startAngle)),b.clipEnd(sp(m,y,e,i,n,d.endAngle)));let D,A;if(a?(D=rp(m,y,e,i,n,d.innerRadius),A=rp(m,y,e,i,n,d.outerRadius)):(D=rp(m,y,e,i,n,d.outerRadius),A=rp(m,y,e,i,n,d.innerRadius)),b.clipStart(D),b.clipEnd(A),D!=null){const{x:k,y:N}=b.pointAt(D),T=Fr(Math.atan2(N,k),l);a?r?.clipStart(T):s.clipEnd(T)}if(A!=null){const{x:k,y:N}=b.pointAt(A),T=Fr(Math.atan2(N,k),l);a?s.clipStart(T):r?.clipEnd(T)}}if(d!=null){const{x:D,y:A}=b.pointAt((b.a0+b.a1)/2);if(!Sy(D,A,d))return}const{x,y:M}=b.pointAt(a===o?b.a0:b.a1),I=Fr(Math.atan2(M,x),l),C=o?r:s;return a?C?.clipStart(I):C?.clipEnd(I),b}updatePath(){const{path:t,centerX:i,centerY:n,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:o,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=np(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=u-h,m=f>=2*Math.PI-1e-6;t.clear();const y=this.getAngleOffset(d),b=f-2*y,x=p-d,M=d>0&&b>0?2*d*Math.sin(b/2):0,I=p>0&&b>0?2*p*Math.sin(b/2):0;if(a=Math.floor(Math.max(0,Math.min(a,I/2,x/2))),o=Math.floor(Math.max(0,Math.min(o,I/2,x/2))),l=Math.floor(Math.max(0,Math.min(l,M/2,x/2))),c=Math.floor(Math.max(0,Math.min(c,M/2,x/2))),d===0&&p===0||d>p||M<0||I<=0)return;if((g?.startAngle??h)===(g?.endAngle??u))return;if(m&&this.clipSector==null&&a===0&&o===0&&l===0&&c===0){t.moveTo(i+p*Math.cos(h),n+p*Math.sin(h)),t.arc(i,n,p,h,u),d>s&&(t.moveTo(i+d*Math.cos(u),n+d*Math.sin(u)),t.arc(i,n,d,u,h,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(d-p)<1e-6){t.arc(i,n,p,h,u,!1),t.arc(i,n,p,u,h,!0),t.closePath();return}const D=this.getAngleOffset(p);if(f<2*D)return;const k=(g?.innerRadius??d)>s,N=d0?Math.min(x/T,1):1;a*=R,o*=R,l*=R,c*=R;const B=pD(p,f-2*D,-a,-o);if(a*=B,o*=B,!N&&k){const de=pD(d,f-2*y,l,c);l*=de,c*=de}else l=0,c=0;const E=Math.max(a+l,o+c),V=E>0?Math.min(x/E,1):1;a*=V,o*=V,l*=V,c*=V;let G=0,q=0;const j=a/(p-a),Q=o/(p-o);if(j>=0&&j<1-1e-6)G=Math.asin(j);else{G=f/2;const de=p/(1/Math.sin(G)+1);a=Math.min(de,a)}if(Q>=0&&Q<1-1e-6)q=Math.asin(Q);else{q=f/2;const de=p/(1/Math.sin(q)+1);o=Math.min(de,o)}const ue=Math.asin(l/(d+l)),re=Math.asin(c/(d+c)),He=g?.outerRadius??p,Ze=this.getAngleOffset(He),ve=new My(0,0,He,h+Ze,u-Ze),pt=g?.innerRadius??d,di=this.getAngleOffset(pt),Me=k?new My(0,0,pt,h+di,u-di):void 0;g!=null&&(ve.clipStart(g.startAngle),ve.clipEnd(g.endAngle),Me?.clipStart(g.startAngle),Me?.clipEnd(g.endAngle));const Hn=this.arc(a,G,h-Math.PI*.5,h+G,ve,Me,!0,!1),yn=this.arc(o,q,u-q,u+Math.PI*.5,ve,Me,!1,!1),Bi=this.arc(c,re,u+Math.PI*.5,u+Math.PI-re,ve,Me,!1,!0),gt=this.arc(l,ue,h+Math.PI+ue,h+Math.PI*1.5,ve,Me,!0,!0);if(!(N&&k)){if(N){const de=f0&&dee.equals(t)})],qt.prototype,"clipSector",2),v([Y()],qt.prototype,"concentricEdgeInset",2),v([Y()],qt.prototype,"radialEdgeInset",2),v([Y()],qt.prototype,"startOuterCornerRadius",2),v([Y()],qt.prototype,"endOuterCornerRadius",2),v([Y()],qt.prototype,"startInnerCornerRadius",2),v([Y()],qt.prototype,"endInnerCornerRadius",2);var Mt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Hs={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},gD=class extends nt{constructor(){super(...arguments),this.showInLegend=!1}};v([S],gD.prototype,"showInLegend",2);var Iy=class extends Ji{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};v([S],Iy.prototype,"text",2),v([S],Iy.prototype,"spacing",2);var Dy=class extends ce{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};v([S],Dy.prototype,"fill",2),v([S],Dy.prototype,"fillOpacity",2);var dl=class extends Ji{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};v([S],dl.prototype,"offset",2),v([S],dl.prototype,"minAngle",2),v([S],dl.prototype,"minSpacing",2),v([S],dl.prototype,"maxCollisionOffset",2),v([S],dl.prototype,"avoidCollisions",2);var Cy=class extends Ji{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};v([S],Cy.prototype,"positionOffset",2),v([S],Cy.prototype,"positionRatio",2);var ah=class extends ce{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};v([S],ah.prototype,"colors",2),v([S],ah.prototype,"length",2),v([S],ah.prototype,"strokeWidth",2),v([S],ah.prototype,"itemStyler",2);var ge=class extends _n{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Mt),this.strokes=Object.values(Hs),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 oo(Iy),this.title=new gD,this.innerCircle=new Dy,this.shadow=new us,this.calloutLabel=new dl,this.sectorLabel=new Cy,this.calloutLine=new ah,this.tooltip=Ea()}};v([S],ge.prototype,"angleKey",2),v([S],ge.prototype,"angleName",2),v([S],ge.prototype,"angleFilterKey",2),v([S],ge.prototype,"radiusKey",2),v([S],ge.prototype,"radiusName",2),v([S],ge.prototype,"radiusMin",2),v([S],ge.prototype,"radiusMax",2),v([S],ge.prototype,"calloutLabelKey",2),v([S],ge.prototype,"calloutLabelName",2),v([S],ge.prototype,"sectorLabelKey",2),v([S],ge.prototype,"sectorLabelName",2),v([S],ge.prototype,"legendItemKey",2),v([S],ge.prototype,"defaultColorRange",2),v([S],ge.prototype,"defaultPatternFills",2),v([S],ge.prototype,"fills",2),v([S],ge.prototype,"strokes",2),v([S],ge.prototype,"fillOpacity",2),v([S],ge.prototype,"strokeOpacity",2),v([S],ge.prototype,"lineDash",2),v([S],ge.prototype,"lineDashOffset",2),v([S],ge.prototype,"cornerRadius",2),v([S],ge.prototype,"itemStyler",2),v([S],ge.prototype,"rotation",2),v([S],ge.prototype,"outerRadiusOffset",2),v([S],ge.prototype,"outerRadiusRatio",2),v([S],ge.prototype,"innerRadiusOffset",2),v([S],ge.prototype,"innerRadiusRatio",2),v([S],ge.prototype,"strokeWidth",2),v([S],ge.prototype,"sectorSpacing",2),v([S],ge.prototype,"hideZeroValueSectorsInLegend",2),v([S],ge.prototype,"innerLabels",2),v([S],ge.prototype,"title",2),v([S],ge.prototype,"innerCircle",2),v([S],ge.prototype,"shadow",2),v([S],ge.prototype,"calloutLabel",2),v([S],ge.prototype,"sectorLabel",2),v([S],ge.prototype,"calloutLine",2),v([S],ge.prototype,"tooltip",2);function Ay(e,t,i,n){const s=[i.convert(0),i.convert(1)],r=[n.convert(0),n.convert(1)],a=Math.PI/-2+$t(t),o=e?"initial":"update",l=({radius:g})=>({innerRadius:s[0],outerRadius:s[0]+(s[1]-s[0])*g}),c=({radius:g})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*g});return{nodes:{toFn:(g,f,m,{prevLive:y})=>{let{startAngle:b,endAngle:x,innerRadius:M,outerRadius:I}=f;const{stroke:C,fill:D}=f.sectorFormat;if(m==="removed"&&y?(b=y.datum?.endAngle,x=y.datum?.endAngle):m==="removed"&&!y&&(b=a,x=a),m==="removed"){const k=l(f);M=k.innerRadius,I=k.outerRadius}return{startAngle:b,endAngle:x,outerRadius:I,innerRadius:M,stroke:C,...typeof D=="string"?{fill:D}:{}}},fromFn:(g,f,m,{prevFromProps:y})=>{let{startAngle:b,endAngle:x,innerRadius:M,outerRadius:I}=g,{fill:C,stroke:D}=f.sectorFormat;if(m==="updated"&&g.previousDatum==null&&(m="added"),m==="unknown"||m==="added"&&!y?(b=a,x=a,M=f.innerRadius,I=f.outerRadius):m==="added"&&y&&(b=y.endAngle??a,x=y.endAngle??a,M=y.innerRadius??f.innerRadius,I=y.outerRadius??f.outerRadius),m==="added"&&!e){const k=c(f);M=k.innerRadius,I=k.outerRadius}return m==="updated"&&(C=g.fill??C,D=(typeof g.stroke=="string"?g.stroke:void 0)??D),{startAngle:b,endAngle:x,innerRadius:M,outerRadius:I,stroke:D,phase:o,...typeof C=="string"?{fill:C}:{}}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:o}),toFn:(g,f)=>({size:f.radius??0})}}}function FP(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function VP(e,t){const i=t.y-e.centerY,n=t.x-e.centerX,s=Math.atan2(i,n),r=e.getItemNodes();for(const a of r)if(a.datum.missing!==!0&&dr(s,a.startAngle,a.endAngle)){const o=Math.hypot(n,i);let l=0;return oa.outerRadius&&(l=o-a.outerRadius),{datum:a.datum,distance:l}}}var _P=class extends Sd{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},ap=class extends vy{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...oD,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...lD,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:FP,label:Oa}}),this.properties=new ge,this.phantomNodeData=void 0,this.backgroundGroup=new Yt({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Da,this.radiusScale=new Da,this.phantomGroup=this.contentGroup.appendChild(new ae({name:"phantom",zIndex:-1})),this.phantomSelection=bt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ae({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=bt.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ae({name:"pieCalloutLabels"})),this.calloutLabelSelection=new bt(this.calloutLabelGroup,ae),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ae({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new kt({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new kt({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new ae({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new ae({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=bt.select(this.innerLabelsGroup,Oi),this.innerCircleSelection=bt.select(this.innerCircleGroup,()=>new kt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=_P,this.angleScale=new Da,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 qt;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:n}}=this,{angleKey:s,angleFilterKey:r,radiusKey:a,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(y,b)=>t&&n.getItemEnabled({seriesId:i,itemId:b})?y:0,u=!this.ctx.animationManager.isSkipped(),d=this.properties.allowNullKeys??!1,p=[],g=[];c?p.push(kr(c,"category",{id:"legendItemKey",allowNullKey:d})):o?p.push(kr(o,"category",{id:"calloutLabelKey",allowNullKey:d})):l&&p.push(kr(l,"category",{id:"sectorLabelKey",allowNullKey:d}));const f=this.radiusScale.type,m=this.angleScale.type;a&&g.push($N(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Qe(a,f,{id:"radiusRaw",processor:h}),fm("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&g.push(Qe(o,"category",{id:"calloutLabelValue",allowNullKey:d})),l&&g.push(Qe(l,"category",{id:"sectorLabelValue",allowNullKey:d})),c&&g.push(Qe(c,"category",{id:"legendItemValue",allowNullKey:d})),r&&g.push(gm(r,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Qe(r,m,{id:"angleFilterRaw"}),fm("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(bd(this.id,this.processedData)),g.push(Gc()),await this.requestDataModel(e,this.data,{props:[...p,gm(s,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Qe(s,m,{id:"angleRaw"}),fm("angleValue",[0,1],0,0),...g]});for(const y of this.processedData?.defs?.values??[]){const{id:b,missing:x,property:M}=y,I=US(this,x);b!=="angleRaw"&&I>0&&z.warnOnce(`no value was found for the key '${String(M)}' on ${I} data element${I>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&&Ks.record(`${this.type}:nodeData`,e.length),this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),n=e.resolveColumnById(this,"angleRaw",t),s=this.properties.angleFilterKey==null?void 0:e.resolveColumnById(this,"angleFilterValue",t),r=this.properties.angleFilterKey==null?void 0:e.resolveColumnById(this,"angleFilterRaw",t),a=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,o=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:n,angleFilterValues:s,angleFilterRawValues:r,radiusValues:a,radiusRawValues:o,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:n,ctx:{legendManager:s},visible:r}=this,{rotation:a,innerRadiusRatio:o}=this.properties;if(!i||t?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:h,angleFilterValues:u,angleFilterRawValues:d,radiusValues:p,radiusRawValues:g,legendItemValues:f}=l,m=d?.some((D,A)=>D>h[A])??!1;let y=0,b=0;const x=[],M=d==null?void 0:[],I=t.dataSources.get(this.id)?.data??[],C=t.invalidData?.get(this.id);for(const[D,A]of I.entries()){if(C?.[D]===!0)continue;const k=m?u[D]:c[D],N=d!=null&&!m?Math.sqrt(d[D]/h[D]):1,T=n.convert(y)+$t(a);y=k,b+=k;const R=n.convert(y)+$t(a),B=Math.abs(R-T),E=T+B/2,V=h[D],q=(p?.[D]??1)*N,j=g?.[D],Q=f?.[D],ue=this.getLabels(D,A,E,B,l),re=this.getItemStyle({datum:A,datumIndex:D},!1),He={series:this,datum:A,datumIndex:D,angleValue:V,midAngle:E,midCos:Math.cos(E),midSin:Math.sin(E),startAngle:T,endAngle:R,radius:q,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(q),0),sectorFormat:re,radiusValue:j,legendItemValue:Q,enabled:r&&s.getItemEnabled({seriesId:e,itemId:D}),focusable:!0,...ue};x.push(He),M?.push({...He,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=b===0,this.zerosumInnerRing.visible=b===0&&o!=null&&o!==1&&o>0,{itemId:e,nodeData:x,labelData:x,phantomNodeData:M}}getLabelContent(e,t,i){const{id:n,ctx:s,properties:r}=this,{formatManager:a}=s,{calloutLabel:o,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:u}=r,d=r.allowNullKeys??!1,p=i.calloutLabelValues?.[e],g=i.sectorLabelValues?.[e],f=i.legendItemValues?.[e],m={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},y={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(y.callout=this.getLabelText(p,t,c,"calloutLabel",[],o,{...m,value:p},d)),h&&(y.sector=this.getLabelText(g,t,h,"sectorLabel",[],l,{...m,value:g},d)),u!=null&&(f!=null||d)){const b=f??"";y.legendItem=a.format(this.callWithContext.bind(this),{type:"category",value:d?f:b,datum:t,seriesId:n,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??b}return y}getLabels(e,t,i,n,s){const{properties:r}=this,{calloutLabel:a,sectorLabel:o,legendItemKey:l}=r,c=this.getLabelContent(e,t,s),h={};return a.enabled&&c.callout&&n>=$t(a.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),o.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=bu(e),n=-.75*Math.PI,s=i-n,r=Math.floor(s/(Math.PI/2)),a=iv(r,t.length);return t[a]}getFillParams(e,t,i){if(!(!Zi(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getItemStyle({datum:e,datumIndex:t},i,n,s){const{fills:r,strokes:a,itemStyler:o}=this.properties,l=a[t],c=r[t],{fill:h,fillOpacity:u,stroke:d,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:m,cornerRadius:y,opacity:b}=xe(this.getHighlightStyle(i,t,n,s),{fill:c,stroke:l},this.properties);let x;return o&&(x=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>{const M=this.makeItemStylerParams(e,t,i,{fill:h,fillOpacity:u,stroke:d,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:m,cornerRadius:y});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,M),{proxyPaths:{fill:["fills",`${t}`],stroke:["strokes",`${t}`]}})})),{fill:x?.fill??h,fillOpacity:x?.fillOpacity??u,stroke:x?.stroke??d,strokeWidth:x?.strokeWidth??p,strokeOpacity:x?.strokeOpacity??g,lineDash:x?.lineDash??f,lineDashOffset:x?.lineDashOffset??m,cornerRadius:x?.cornerRadius??y,opacity:b}}makeItemStylerParams(e,t,i,n){const{angleKey:s,radiusKey:r,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(n.fill)??n.fill;return{datum:e,angleKey:s,radiusKey:r,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:l,...n,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,t),seriesId:this.id}}getCalloutLineStyle(e,t){const{properties:i}=this;let n={};if(i.calloutLine.itemStyler){const s=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),t,e.datumIndex),r={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:e.datum,highlightState:s,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};n=this.cachedCallWithContext(i.calloutLine.itemStyler,r)??{}}return{length:n.length??i.calloutLine.length,strokeWidth:n.strokeWidth??i.calloutLine.strokeWidth,color:n.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,n=e*t+i;return n===e||n<0?0:n}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=n=>({...n,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(n.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),n=Math.max(0,-e);return-e-i-n}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},n=ss(this.nodeDataDependencies,i)!=null;if(n&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),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 s=this.getTitleTranslationY();t.node.y=Number.isFinite(s)?s:0;const r=t.node.getBBox();t.node.visible=t.enabled&&Number.isFinite(s)&&!this.bboxIntersectsSurroundingSeries(r)}for(const s of[this.zerosumInnerRing,this.zerosumOuterRing])s.fillOpacity=0,s.stroke=this.properties.calloutLabel.color,s.strokeWidth=1,s.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:n,calloutLabelSelection:s,labelSelection:r,highlightLabelSelection:a,innerLabelsSelection:o}=this,l=this.nodeData.map(u=>({...u,sectorFormat:{...u.sectorFormat}})),c=this.phantomNodeData?.map(u=>({...u,sectorFormat:{...u.sectorFormat}})),h=(u,d)=>{u.update(d,void 0,p=>this.getDatumId(p.datumIndex)),this.ctx.animationManager.isSkipped()&&u.cleanup()};h(e,this.nodeData),h(t,l),h(i,this.phantomNodeData??[]),h(n,c??[]),s.update(this.calloutNodeData,u=>{const d=new Xi;d.tag=0,d.pointerEvents=1,u.appendChild(d);const p=new Oi;p.tag=1,p.pointerEvents=1,u.appendChild(p)}),r.update(this.nodeData),a.update(l),o.update(this.properties.innerLabels,u=>{u.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const s=Math.min(i,this.getOuterRadius()),r=1;t=Math.ceil(s*2+r)}const n=e?[{radius:t}]:[];this.innerCircleSelection.update(n)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:n,processedData:s}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!n||!s)return;const{legendItemValues:r}=this.getProcessedDataValues(n,s),a=this.isSeriesHighlighted(t,r),o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&a,this.labelGroup.visible=i,this.innerCircleSelection.each((p,{radius:g})=>{p.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:g})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),u=this.ctx.animationManager.isSkipped(),d=(p,g,f,m,y)=>{const b=this.getItemStyle(g,m,void 0,r);g.sectorFormat.fill=b.fill,g.sectorFormat.stroke=b.stroke,u&&(p.startAngle=g.startAngle,p.endAngle=g.endAngle,p.innerRadius=g.innerRadius,p.outerRadius=g.outerRadius),(m||u)&&(p.fill=b.fill,p.stroke=b.stroke);const x=this.getFillParams(b.fill,l,c);p.setStyleProperties(b,h,x),p.drawingMode=y,p.cornerRadius=b.cornerRadius,p.fillShadow=this.properties.shadow;const M=Math.max((this.properties.sectorSpacing+(b.stroke==null?0:b.strokeWidth))/2,0);p.inset=M,p.lineJoin=this.properties.sectorSpacing>=0||M>0?"miter":"round"};this.itemSelection.each((p,g,f)=>d(p,g,f,!1,"overlay")),this.phantomSelection.each((p,g,f)=>d(p,g,f,!1,"overlay")),this.highlightSelection.each((p,g,f)=>{d(p,g,f,!0,o),p.visible=g.datumIndex===t?.datumIndex}),this.phantomHighlightSelection.each((p,g,f)=>{d(p,g,f,!0,o),p.visible=g.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(),n=this.isSeriesHighlighted(i);for(const s of this.calloutLabelSelection.selectByTag(0)){const r=s.closestDatum(),a=n&&this.isItemHighlighted(i,r.datumIndex)===!0,{length:o,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(r,!1),u=l,d=Vx(h)?h:e,{calloutLabel:p,outerRadius:g,datumIndex:f}=r;if(p?.text&&!p.hidden&&g!==0){s.visible=!0,s.strokeWidth=u,s.stroke=c??d[f%d.length],s.strokeOpacity=this.getHighlightStyle(a,r.datumIndex).opacity??1,s.fill=void 0;const m=r.midCos*g,y=r.midSin*g;let b=r.midCos*(g+o),x=r.midSin*(g+o);if((p.collisionTextAlign??p.collisionOffsetY!==0)&&p.box!=null){const I=p.box;let C=b,D=x;bI.x+I.width&&(C=I.x+I.width),xI.y+I.height&&(D=I.y+I.height);const A=C-b,k=D-x,N=Math.sqrt(Math.pow(A,2)+Math.pow(k,2)),T=N-t;T>0&&(b=b+A*T/N,x=x+k*T/N)}s.x1=m,s.y1=y,s.x2=b,s.y2=x}else s.visible=!1}}getLabelOverflow(e,t){const i=-this.centerX,n=i+t.width,s=-this.centerY,r=s+t.height,a=1;let o=e.width;e.x+an&&(o=(n-e.x)/e.width);const l=e.y+ar,c=this.bboxIntersectsSurroundingSeries(e);return{maxWidth:o,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}],n=t**2;return i.some(s=>s.x**2+s.y**2>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t}=this.properties,{offset:i,minSpacing:n}=t,s=e.convert(0),r=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,o=a.filter(m=>!r(m));for(const m of o){const y=m.calloutLabel;y!=null&&(y.hidden=!1,y.collisionTextAlign=void 0,y.collisionOffsetY=0)}if(o.length<=1)return;const l=o.filter(m=>m.midCos<0).sort((m,y)=>m.midSin-y.midSin),c=o.filter(m=>m.midCos>=0).sort((m,y)=>m.midSin-y.midSin),h=o.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,y)=>m.midCos-y.midCos),u=o.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,y)=>m.midCos-y.midCos),d=m=>{const y=m.calloutLabel;if(y==null)return U.zero.clone();const b=this.getLabelStyle(m,t,"calloutLabel"),x=Qo(b),M=this.getCalloutLineStyle(m,!1).length,I=m.outerRadius+M+i,C=m.midCos*I,D=m.midSin*I+y.collisionOffsetY,A=y.collisionTextAlign??y.textAlign,k=y.textBaseline;return Oi.measureBBox(y.text,C,D,{font:this.properties.calloutLabel,textAlign:A,textBaseline:k}).grow(x)},p=(m,y,b)=>{const x=d(m).grow(n/2),M=d(y).grow(n/2);x.xM.x&&(b==="to-top"?x.yM.y)&&(y.calloutLabel.collisionOffsetY=b==="to-top"?x.y-M.y-M.height:x.y+x.height-M.y)},g=m=>{const y=m.slice().sort((x,M)=>Math.abs(x.midSin)-Math.abs(M.midSin))[0],b=m.indexOf(y);for(let x=b-1;x>=0;x--){const M=m[x+1],I=m[x];p(M,I,"to-top")}for(let x=b+1;x{const y=o.some(D=>D.calloutLabel.collisionOffsetY!==0),b=m.map(D=>d(D)),x=b.map(D=>D.clone().grow(n/2));let M=!1;for(let D=0;D{const{startAngle:A,endAngle:k,outerRadius:N}=D;return{startAngle:A,endAngle:k,innerRadius:s,outerRadius:N}}),C=b.some(D=>I.some(A=>RP(D,A)));if(!(!M&&!y&&!C))for(const D of m){if(D.calloutLabel.textAlign!=="center")continue;const A=D.calloutLabel;D.midCos<0?A.collisionTextAlign="right":D.midCos>0?A.collisionTextAlign="left":A.collisionTextAlign="center"}};g(l),g(c),f(h),f(u)}getLabelStyle(e,t,i,n=!1){const s=this.ctx.highlightManager?.getActiveHighlight();return Na(this,e,this.properties,t,n,s,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i}=this.properties,n=new Oi,s=this.ctx.highlightManager?.getActiveHighlight(),r=this.isSeriesHighlighted(s);for(const a of this.calloutLabelSelection.selectByTag(1)){const o=a.closestDatum(),l=o.calloutLabel,c=t.convert(o.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){a.visible=!1;continue}const u=r&&this.isItemHighlighted(s,o.datumIndex)===!0,d=this.getLabelStyle(o,i,"calloutLabel",u),p=this.getCalloutLineStyle(o,!1).length,g=h+p+i.offset,f=o.midCos*g,m=o.midSin*g+l.collisionOffsetY,y={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};n.text=l.text,n.x=f,n.y=m,n.setFont(d),n.setAlign(y),n.setBoxing(d);const b=n.getBBox();let x=l.text,M=!0;if(i.avoidCollisions){const{maxWidth:I,hasVerticalOverflow:C}=this.getLabelOverflow(b,e);if(b.width>I){const D={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:I};x=Lu(l.text,D)}M=!C}a.text=x,a.x=f,a.y=m,a.setFont(d),a.setAlign(y),a.setBoxing(d),a.fill=d.color,a.fillOpacity=this.getHighlightStyle(u,o.datumIndex).opacity??1,a.visible=M}}computeLabelsBBox(e,t){const{calloutLabel:i}=this.properties,{offset:n,maxCollisionOffset:s,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const a=[],o=new Oi;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(o.text=c.text,o.x=0,o.y=h,o.setFont(c),o.setAlign({textBaseline:"bottom",textAlign:"center"}),l=o.getBBox(),a.push(l))}for(const h of this.calloutNodeData){const u=h.calloutLabel;if(!u||h.outerRadius===0)continue;const d=this.getLabelStyle(h,i,"calloutLabel"),p=this.getCalloutLineStyle(h,!1).length,g=h.outerRadius+p+n,f=h.midCos*g,m=h.midSin*g+u.collisionOffsetY;o.text=u.text,o.x=f,o.y=m,o.setFont(d),o.setAlign({textAlign:u.collisionTextAlign??u.textAlign,textBaseline:u.textBaseline}),o.setBoxing(d);const y=o.getBBox();if(u.box=y,Math.abs(u.collisionOffsetY)>s){u.hidden=!0;continue}if(l){const b=-this.centerY,x=new U(l.x-r,b,l.width+2*r,l.y+l.height+r-b);if(y.collidesBBox(x)){u.hidden=!0;continue}}if(e.hideWhenNecessary){const{maxWidth:b,hasVerticalOverflow:x,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(y,t),I=y.width>b;if(x||I||M){u.hidden=!0;continue}}u.hidden=!1,a.push(y)}return a.length===0?null:U.merge(a)}updateSectorLabelNodes(){const{properties:e}=this,{positionOffset:t,positionRatio:i}=this.properties.sectorLabel,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(n),r=this.radiusScale.convert(0),a=r<=0&&this.ctx.legendManager.getData(this.id)?.filter(c=>c.enabled).length===1,o={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,u)=>{const{outerRadius:d,startAngle:p,endAngle:g}=u,f=s&&this.isItemHighlighted(n,u.datumIndex)===!0;let m=!1;if(u.sectorLabel&&d!==0){const y=this.getLabelStyle(u,e.sectorLabel,"sectorLabel",f),b=r*(1-i)+d*i+t;h.fill=y.color,h.fillOpacity=this.getHighlightStyle(f,u.datumIndex).opacity??1,h.text=u.sectorLabel.text,a?(h.x=0,h.y=0):(h.x=u.midCos*b,h.y=u.midSin*b),h.setFont(y),h.setAlign(o),h.setBoxing(y);const x=h.getBBox(),M=[[x.x,x.y],[x.x+x.width,x.y],[x.x+x.width,x.y+x.height],[x.x,x.y+x.height]],I={startAngle:p,endAngle:g,innerRadius:r,outerRadius:d};M.every(([C,D])=>Sy(C,D,I))&&(m=!0)}h.visible=m});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:g,fontFamily:f,color:m}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=u.text,h.x=0,h.y=0,h.fill=m,h.textAlign="center",e.push(h.getBBox()),t.push(u.spacing)});const i=h=>h===0?0:t[h],n=h=>h===t.length-1?0:t[h],s=e.reduce((h,u)=>Math.max(h,u.width),0),r=e.reduce((h,u,d)=>h+u.height+i(d)+n(d),0),a=this.getInnerRadius(),l=Math.sqrt(Math.pow(s/2,2)+Math.pow(r/2,2))<=(a>0?a:this.getOuterRadius()),c=[];for(let h=0,u=-r/2;h{h.visible=l,Array.isArray(h.text)?h.y=c[d]-e[d].height:h.y=c[d]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return VP(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s,ctx:{formatManager:r}}=this,{legendItemKey:a,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,tooltip:f}=s,m=this.properties.title.node.getPlainText();if(!i||!n)return;const y=n.dataSources.get(this.id)?.data?.[e],b=this.getProcessedDataValues(i,n),{angleRawValues:x}=b,M=x[e],I=this.getLabelContent(e,y,b),C=I.legendItem??I.callout??I.sector??d,D=wl(i.getDomain(this,"angleRaw","value",n)),A=r.format(this.callWithContext.bind(this),{type:"number",value:M,datum:y,seriesId:t,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:D,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??mo(M,3);return this.formatTooltipWithContext(f,{title:m,symbol:this.legendItemSymbol(e),data:[{label:Xe(C),fallbackLabel:u,value:A}]},{seriesId:t,datum:y,title:d,legendItemKey:a,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,...this.getItemStyle({datum:y,datumIndex:e},!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.data?.[e],i=this.getItemStyle({datum:t,datumIndex:e},!1),{fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:a,lineDashOffset:o}=this.properties;let{fill:l}=i;const{stroke:c}=i;return Zi(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:a,lineDashOffset:o}}}getLegendData(e){const{visible:t,processedData:i,dataModel:n,id:s,ctx:{legendManager:r}}=this;if(!n||!i||e!=="category")return[];const{angleKey:a,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!o||o===a)&&(!l||l===a))return[];const u=this.getProcessedDataValues(n,i),{angleRawValues:d}=u,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],f=this.properties.hideZeroValueSectorsInLegend,m=i.dataSources.get(this.id)?.data,y=i.invalidData?.get(this.id);for(let b=0;bXe(D)).join(" - ")},symbol:this.legendItemSymbol(b),legendItemName:c==null?void 0:x[c],hideInLegend:!h})}return g}setLegendState(e){const{id:t,ctx:{legendManager:i,eventsHub:n}}=this;for(const[s,r]of e.entries())i.toggleItem(r,t,s);i.update(),n.emit("chart:request-update",{type:7})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Ay(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);xt(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(n,s)=>this.getDatumId(s.datumIndex)),xt(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),ht(this,"callout",t,this.calloutLabelSelection),ht(this,"sector",t,this.labelSelection,this.highlightLabelSelection),ht(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:n,processedData:s,radiusScale:r,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,l=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,h=(s?.defs.keys.length??0)>0,u=s?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!h||!u)&&this.ctx.animationManager.skipCurrentBatch();const d=!this.nodeData.some(g=>g.enabled),p=Ay(!1,this.properties.rotation,r,a);xt(this.id,"nodes",o,[e,t,i,n],p.nodes,(g,f)=>this.getDatumId(f.datumIndex),l),xt(this.id,"innerCircle",o,[this.innerCircleSelection],p.innerCircle),ht(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ht(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,ht(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:n,radiusScale:s,previousRadiusScale:r}=this,{animationManager:a}=this.ctx,o=Ay(!1,this.properties.rotation,s,r);xt(this.id,"nodes",a,[e,t,i,n],o.nodes,(l,c)=>this.getDatumId(c.datumIndex)),xt(this.id,"innerCircle",a,[this.innerCircleSelection],o.innerCircle),Bd(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Bd(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),Bd(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:n,sectorLabelKey:s,legendItemKey:r}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${e}`;if(r){const a=t.resolveKeysById(this,"legendItemKey",i);return Zt(a[e])}else if(n){const a=t.resolveKeysById(this,"calloutLabelKey",i);return Zt(a[e])}else if(s){const a=t.resolveKeysById(this,"sectorLabelKey",i);return Zt(a[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))}};ap.className="DonutSeries",ap.type="donut";var fD=at(Ue,Ue),wy={...Ie,radiusMin:w,radiusMax:w,rotation:P,outerRadiusOffset:P,outerRadiusRatio:Z,hideZeroValueSectorsInLegend:L,sectorSpacing:w,cornerRadius:w,itemStyler:De({...$,..._,...W,cornerRadius:w}),title:{enabled:L,text:O,showInLegend:L,spacing:w,...Ce},calloutLabel:{enabled:L,offset:P,minAngle:w,avoidCollisions:L,formatter:mi(ln),format:O,itemStyler:De({enabled:L,...on,...Ce}),...on,...Ce},sectorLabel:{enabled:L,positionOffset:P,positionRatio:Z,formatter:mi(ln),format:O,itemStyler:De({enabled:L,...on,...Ce}),...on,...Ce},calloutLine:{colors:ie(H),length:w,strokeWidth:w,itemStyler:De({color:H,length:w,strokeWidth:w})},fills:ie(Ci),strokes:ie(H),tooltip:we,shadow:es,highlight:fD,...W,...K($,["fill"]),...K(_,["stroke"])},ds={...wy,...Cn,type:X(_e("pie")),angleKey:X(O),radiusKey:O,calloutLabelKey:O,sectorLabelKey:O,legendItemKey:O,angleName:O,radiusName:O,calloutLabelName:O,sectorLabelName:O,highlight:fD};ds.angleFilterKey=J(O),ds.defaultColorRange=J(ie(ie(H))),ds.defaultPatternFills=J(ie(H)),ds.title._enabledFromTheme=J(L),ds.calloutLabel._enabledFromTheme=J(L),ds.sectorLabel._enabledFromTheme=J(L),ds.angleKeyAxis=J(O),ds.radiusKeyAxis=J(O);var mD={...wy,innerRadiusOffset:P,innerRadiusRatio:Z,innerCircle:{fill:O,fillOpacity:Z},innerLabels:{spacing:w,...Ce,...on}},yD={...mD,...ds,type:X(_e("donut")),innerLabels:Et({text:X(O),spacing:w,...Ce,...on},"inner label options array")};yD.angleFilterKey=J(O);var ky={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Zr.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...ts,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...ts,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",Pv],["pattern",Ui],["image",Is]]}]},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:Qr,xOffset:3,yOffset:3,blur:5},highlight:sg},legend:{enabled:!0}},BP={...ky,series:{...ky.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...ts,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:sg}},bD={type:"series",name:"donut",chartType:"polar",version:qe,dependencies:[ip],options:yD,themeTemplate:BP,create:e=>new ap(e)},Ly=class extends ap{};Ly.className="PieSeries",Ly.type="pie";var vD={type:"series",name:"pie",chartType:"polar",version:qe,dependencies:[ip],options:ds,themeTemplate:ky,create:e=>new Ly(e)},xD=[ip,bD,vD,Bf,Gf],Ty=[aD,xD,p0].flat();function SD(e,t,i,n){return{unit:e,step:t,epoch:i,utc:n,every(s){return SD(this.unit,(this.step??1)*s,this.epoch,this.utc)}}}var MD={};function It(e,t=1,i,n=!1){z.warnOnce("time import is deprecated, use object notation instead");const s=`${e}:${t}:${i?.getTime()??0}:${n}`;let r=MD[s];return r==null&&(r=SD(e,t,i,n),MD[s]=r),r}var zP={get millisecond(){return It("millisecond")},get second(){return It("second")},get minute(){return It("minute")},get hour(){return It("hour")},get day(){return It("day")},get monday(){return It("day",7,new Date(1970,0,5))},get tuesday(){return It("day",7,new Date(1970,0,6))},get wednesday(){return It("day",7,new Date(1970,0,7))},get thursday(){return It("day",7,new Date(1970,0,1))},get friday(){return It("day",7,new Date(1970,0,2))},get saturday(){return It("day",7,new Date(1970,0,3))},get sunday(){return It("day",7,new Date(1970,0,4))},get month(){return It("month")},get year(){return It("year")},get utcMillisecond(){return It("millisecond",1,void 0,!0)},get utcSecond(){return It("second",1,void 0,!0)},get utcMinute(){return It("minute",1,void 0,!0)},get utcHour(){return It("hour",1,void 0,!0)},get utcDay(){return It("day",1,void 0,!0)},get utcMonth(){return It("month",1,void 0,!0)},get utcYear(){return It("year",1,void 0,!0)}};function ID(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var Ny="white",GP={"radial-gauge":!0,"linear-gauge":!0};function pl(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 jP(e){return GP[e]===!0}var sn=class Cl{static getDefaultColors(){return{fills:Mt,fillsFallback:Object.values(Mt),strokes:Hs,sequentialColors:Wi(Mt),divergingColors:[Mt.ORANGE,Mt.YELLOW,Mt.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Te.interpolate([Te.fromHexString(Mt.BLUE),Te.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[Mt.GREEN,Mt.YELLOW,Mt.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Mt.GREEN,stroke:Hs.GREEN},down:{fill:Mt.RED,stroke:Hs.RED},neutral:{fill:Mt.GRAY,stroke:Hs.GRAY},altUp:{fill:Mt.BLUE,stroke:Hs.BLUE},altDown:{fill:Mt.ORANGE,stroke:Hs.ORANGE},altNeutral:{fill:Mt.GRAY,stroke:Hs.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:Ny,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:ar,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"},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"},separationLinesColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}static getAxisDefaults({title:t,time:i},n){return xe(n,t&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Zr.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:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},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:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},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:[{$path:"./border/enabled"},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Zr.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:hr,textAlign:ur},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Zr.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:hr,textAlign:ur},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:Zr.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:hr,textAlign:ur},highlight:{enabled:!0,drawingMode:{$if:[{$or:[pl("highlight/highlightedItem/opacity"),pl("highlight/unhighlightedItem/opacity"),pl("highlight/highlightedSeries/opacity"),pl("highlight/unhighlightedSeries/opacity"),pl("fillOpacity"),pl("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:go,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:go},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:n,params:s}=Ee(t),r=this.createChartConfigPerChartType(this.getDefaults()),a={};i&&this.processOverrides(a,i);const{fills:o,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=wi(xe(n,{fills:Object.values(o),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=ID(n),this.params=xe(s,this.getThemeParameters()),this.config=wi(Ee(r)),this.overrides=wi(i),this.presets=wi(a)}processOverrides(t,i){for(const n of ee.listModulesByType("series")){const s=n.name,r=i[s];jP(s)&&(t[s]=r,delete i[s])}}createChartConfigPerChartType(t){var i;for(const n of ee.listModulesByType("chart"))for(const s of ee.listModulesByType("series"))s.chartType===n.name&&(t[i=s.name]??(t[i]=n.themeTemplate));return t}getDefaults(){const t=(s,r)=>{const a={},o=xe({axes:{}},...Array.from(ee.listModulesByType("plugin"),l=>({[l.name]:l.themeTemplate})),ee.getChartModule(s)?.themeTemplate,this.getChartDefaults());for(const l of r){a[l]=xe($P(l),a[l]??o);const{axes:c}=a[l];for(const h of ee.listModulesByType("axis"))c[h.name]=xe(c[h.name],!h.chartType||h.chartType===s?HP(h.name):null,Cl.axisDefault[h.name]);(l==="map-shape-background"||l==="map-line-background")&&delete a[l].series.tooltip}return a},i=[...ee.listModulesByType("series")],n=Ll(i,s=>s.chartType||"unknown");return xe(...Object.keys(n).map(s=>t(s,n[s]?.map(r=>r.name)??[])))}static applyTemplateTheme(t,i,n){if(le(t))for(let s=0;sa.enterprise?"enterprise":"community");if(n.length){const a=ee.isEnterprise()||r.enterprise?.length?"enterprise":"community";z.errorOnce(["required modules are not registered. Check if you have registered the modules:","",ee.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":ZP(n.map(KP),a),"",`See ${s} for more details.`].join(` `))}}function KP(e){return e.moduleId??e.name}function CD(e){return` ${e},`}function YP(e,t){return e.length?`import { ${e.map(CD).join(` `)} } from 'ag-charts-${t}';`:null}function ZP(e,t){const i=YP(["ModuleRegistry"].concat(e),t),n=e.map(CD).join(` `);return`${i} ModuleRegistry.registerModules([ ${n} ]);`}function XP(e,t){const i=new Map,n="axes"in t&&oe(t.axes)?t.axes:{},s=new Set(Object.values(n).map(o=>o?.type).filter(Zn)),r=new Set(t.series?.map(o=>o.type).filter(Zn));function a(o){i.set(o.name,o)}for(const o of Pr.values())if(!ee.hasModule(o.name)&&!UP.has(o.name)&&!(e&&o.chartType&&e!==o.chartType))switch(o.type){case"chart":break;case"axis":if(s.has(o.name)){for(const h of Object.keys(n))n?.[h].type===o.name&&delete n[h];a(o)}break;case"series":r.has(o.name)&&(t.series=t.series.filter(h=>h.type!==o.name),a(o));break;case"plugin":const l=o.name,c=t[l];oe(c)&&(c.enabled!==!1&&a(o),delete t[l]);break;case"axis:plugin":for(const h of Object.values(n)){const u=o.name;h?.[u]&&(h[u].enabled!==!1&&a(o),delete h[u])}break;case"series:plugin":for(const h of t.series??[])h[o.name]&&(delete h[o.name],a(o));break}for(const o of r){const l=Pr.get(o);l?.type==="series"&&!ee.hasModule(l.name)&&!i.has(l.name)&&(t.series=t.series.filter(c=>c.type!==l.name),a(l))}return Array.from(i.values())}function AD(e,t){const i="axes"in t&&oe(t.axes),n="series"in t&&le(t.series),s=a=>e==null||!a.chartType||a.chartType===e,r=[];for(const a of ee.listModules())if(ee.isModuleType("plugin",a))s(a)||(delete t[a.name],r.push(a.name));else if(ee.isModuleType("axis:plugin",a)){if(i&&!s(a)){for(const o of Object.values(t.axes))delete o[a.name];r.push(a.name)}}else if(ee.isModuleType("series:plugin",a)&&n&&!s(a)){for(const o of t.series)delete o[a.name];r.push(a.name)}return r}var Oy="#192232",Jt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Ra={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},gl=class extends zn{getDefaultColors(){return{fills:Jt,fillsFallback:Object.values(Jt),strokes:Ra,sequentialColors:Wi(Jt),divergingColors:[Jt.ORANGE,Jt.YELLOW,Jt.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Jt.GREEN,Jt.YELLOW,Jt.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:Jt.GREEN,stroke:Ra.GREEN},down:{fill:Jt.RED,stroke:Ra.RED},neutral:{fill:Jt.GRAY,stroke:Ra.GRAY},altUp:{fill:Jt.BLUE,stroke:Ra.BLUE},altDown:{fill:Jt.ORANGE,stroke:Ra.ORANGE},altNeutral:{fill:Jt.GRAY,stroke:Ra.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:Oy,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},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(go,!0),e.set(ou,Oy),e.set(ki,Jt.BLUE),e.set(cu,"#fff"),e.set(Li,Jt.BLUE),e.set(hu,Oy),e.set(uu,"#28313e"),e.set(du,"#4b525d"),e.set(pu,"#fff"),e.set(gu,"#fff"),e.set(fu,"#28313e"),e.set(mu,"#4b525d"),e.set(yu,"#fff"),e}constructor(e){super(e)}},Pi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Pa={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},qP=class extends gl{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Pi},fillsFallback:Object.values({...Pi}),strokes:{...Pa},sequentialColors:Wi(Pi),divergingColors:[Pi.GREEN,Pi.BLUE,Pi.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Pi.GREEN,stroke:Pa.GREEN},down:{fill:Pi.RED,stroke:Pa.RED},neutral:{fill:Pi.BLUE,stroke:Pa.BLUE},altUp:{fill:Pi.GREEN,stroke:Pa.GREEN},altDown:{fill:Pi.RED,stroke:Pa.RED},altNeutral:{fill:Pi.GRAY,stroke:Pa.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,Pi.BLUE),e.set(Li,Pi.BLUE),e.set(hr,"overlay"),e.set(ur,"left"),e.set(tc,"bottom"),e}},Fi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Fa={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},JP=class extends zn{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Fi},fillsFallback:Object.values({...Fi}),strokes:{...Fa},sequentialColors:Wi(Fi),divergingColors:[Fi.GREEN,Fi.BLUE,Fi.RED],up:{fill:Fi.GREEN,stroke:Fa.GREEN},down:{fill:Fi.RED,stroke:Fa.RED},neutral:{fill:Fi.BLUE,stroke:Fa.BLUE},altUp:{fill:Fi.GREEN,stroke:Fa.GREEN},altDown:{fill:Fi.RED,stroke:Fa.RED},altNeutral:{fill:Fi.GRAY,stroke:Fa.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,Fi.BLUE),e.set(Li,Fi.BLUE),e.set(hr,"overlay"),e.set(ur,"left"),e.set(tc,"bottom"),e}},Qt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Va={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},QP=class extends gl{getDefaultColors(){return{...super.getDefaultColors(),fills:Qt,fillsFallback:Object.values(Qt),strokes:Va,sequentialColors:Wi(Qt),divergingColors:[Qt.ORANGE,Qt.YELLOW,Qt.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[Qt.GREEN,Qt.YELLOW,Qt.RED],up:{fill:Qt.GREEN,stroke:Va.GREEN},down:{fill:Qt.RED,stroke:Va.RED},neutral:{fill:Qt.GRAY,stroke:Va.GRAY},altUp:{fill:Qt.BLUE,stroke:Va.BLUE},altDown:{fill:Qt.RED,stroke:Va.RED},altNeutral:{fill:Qt.GRAY,stroke:Va.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,Qt.BLUE),e.set(Li,Qt.BLUE),e}},ei={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},_a={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},e2=class extends zn{getDefaultColors(){return{...super.getDefaultColors(),fills:ei,fillsFallback:Object.values(ei),strokes:_a,sequentialColors:Wi(ei),divergingColors:[ei.ORANGE,ei.YELLOW,ei.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[ei.GREEN,ei.YELLOW,ei.RED],up:{fill:ei.GREEN,stroke:_a.GREEN},down:{fill:ei.RED,stroke:_a.RED},neutral:{fill:ei.GRAY,stroke:_a.GRAY},altUp:{fill:ei.BLUE,stroke:_a.BLUE},altDown:{fill:ei.RED,stroke:_a.RED},altNeutral:{fill:ei.GRAY,stroke:_a.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,ei.BLUE),e.set(Li,ei.BLUE),e}},ut={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ba={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},t2=class extends gl{getDefaultColors(){return{fills:ut,fillsFallback:Object.values(ut),strokes:Ba,sequentialColors:Wi(ut),divergingColors:[ut.BLUE,ut.RED],hierarchyColors:[],secondSequentialColors:[ut.BLUE,ut.PURPLE,ut.MAGENTA,ut.PINK,ut.RED,ut.ORANGE,ut.YELLOW,ut.GREEN],secondDivergingColors:[ut.BLUE,ut.RED],secondHierarchyColors:[],up:{fill:ut.GREEN,stroke:Ba.GREEN},down:{fill:ut.RED,stroke:Ba.RED},neutral:{fill:ut.GRAY,stroke:Ba.GRAY},altUp:{fill:ut.BLUE,stroke:Ba.BLUE},altDown:{fill:ut.RED,stroke:Ba.RED},altNeutral:{fill:ut.GRAY,stroke:Ba.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,ut.BLUE),e.set(Li,ut.BLUE),e}},dt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},za={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},i2=class extends zn{getDefaultColors(){return{...super.getDefaultColors(),fills:dt,fillsFallback:Object.values(dt),strokes:za,sequentialColors:Wi(dt),divergingColors:[dt.BLUE,dt.RED],hierarchyColors:[],secondSequentialColors:[dt.BLUE,dt.PURPLE,dt.MAGENTA,dt.PINK,dt.RED,dt.ORANGE,dt.YELLOW,dt.GREEN],secondDivergingColors:[dt.BLUE,dt.RED],secondHierarchyColors:[],up:{fill:dt.GREEN,stroke:za.GREEN},down:{fill:dt.RED,stroke:za.RED},neutral:{fill:dt.GRAY,stroke:za.GRAY},altUp:{fill:dt.BLUE,stroke:za.BLUE},altDown:{fill:dt.RED,stroke:za.RED},altNeutral:{fill:dt.GRAY,stroke:za.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,dt.BLUE),e.set(Li,dt.BLUE),e}},Ot={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"},Vr={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"},n2=class extends gl{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ot,RED:Ot.ORANGE},fillsFallback:Object.values({...Ot,RED:Ot.ORANGE}),strokes:{...Vr,RED:Vr.ORANGE},sequentialColors:Wi({...Ot,RED:Ot.ORANGE}),divergingColors:[Ot.ORANGE,Ot.YELLOW,Ot.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Ot.GREEN,Ot.YELLOW,Ot.ORANGE],up:{fill:Ot.GREEN,stroke:Vr.GREEN},down:{fill:Ot.ORANGE,stroke:Vr.ORANGE},neutral:{fill:Ot.GRAY,stroke:Vr.GRAY},altUp:{fill:Ot.BLUE,stroke:Vr.BLUE},altDown:{fill:Ot.ORANGE,stroke:Vr.ORANGE},altNeutral:{fill:Ot.GRAY,stroke:Vr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,Ot.BLUE),e.set(Li,Ot.BLUE),e}},Pt={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"},$s={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"},s2=class extends zn{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Pt,RED:Pt.ORANGE},fillsFallback:Object.values({...Pt,RED:Pt.ORANGE}),strokes:{...$s,RED:$s.ORANGE},sequentialColors:Wi({...Pt,RED:Pt.ORANGE}),divergingColors:[Pt.ORANGE,Pt.YELLOW,Pt.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Pt.GREEN,Pt.YELLOW,Pt.ORANGE],secondHierarchyColors:[],up:{fill:Pt.GREEN,stroke:$s.GREEN},down:{fill:Pt.ORANGE,stroke:$s.ORANGE},neutral:{fill:$s.GRAY,stroke:$s.GRAY},altUp:{fill:Pt.BLUE,stroke:$s.BLUE},altDown:{fill:Pt.ORANGE,stroke:$s.ORANGE},altNeutral:{fill:Pt.GRAY,stroke:$s.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,Pt.BLUE),e.set(Li,Pt.BLUE),e}},fl={...Ir,type:_e("ordinal-time"),paddingInner:Z,paddingOuter:Z,groupPaddingInner:Z,label:od,parentLevel:jf,interval:aS,crosshair:va(!0,!0),bandHighlight:ld,bandAlignment:F("justify","start","center","end"),skipNullBars:L},wD={...$o,...Tc(P),type:_e("angle-number"),crossLines:Et(Ps),startAngle:P,endAngle:P,label:{...Mr,orientation:F("fixed","parallel","perpendicular"),format:Dn}},Ey={...$o,type:_e("angle-category"),shape:F("polygon","circle"),crossLines:Et(Ps),startAngle:P,endAngle:P,paddingInner:Z,groupPaddingInner:Z,label:{...Mr,orientation:F("fixed","parallel","perpendicular")}};Ey.innerRadiusRatio=Z;var kD={...$o,...Tc(P),type:_e("radius-number"),shape:F("polygon","circle"),positionAngle:P,innerRadiusRatio:Z,title:Hf,crossLines:Et({...Ps,label:{...Ho,positionAngle:P}},"cross-line options"),label:{...Mr,format:Dn}},LD={...$o,type:_e("radius-category"),positionAngle:P,innerRadiusRatio:Z,paddingInner:Z,paddingOuter:Z,groupPaddingInner:Z,label:Mr,title:Hf,crossLines:Et({...Ps,label:{...Ho,positionAngle:P}},"cross-line options")},ml={lineStyle:F("solid","dashed","dotted"),...W},Ga={...$,..._,...W},oh={visible:L,locked:L,readOnly:L,handle:Ga,...Ce},op={position:F("top","center","bottom"),alignment:F("left","center","right"),...Ce},TD={position:F("top","inside","bottom"),alignment:F("left","center","right"),...Ce},r2={enabled:L,cornerRadius:w,...Ce,...$,..._,...W},a2={visible:L,...ml,..._},ND={divider:_,...$,..._,...Ce},OD={handle:Ga,statistics:ND,...ml,...$,..._},lp={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:Ga,text:op,...ml,..._},Ry={visible:L,locked:L,readOnly:L,axisLabel:r2,handle:Ga,text:op,...ml,..._},ED={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:Ga,text:TD,background:$,...ml,..._},RD={...ED},PD={...ED,middle:a2},Py={label:Ce,showFill:L,isMultiColor:L,strokes:ie(H),rangeStroke:H,bands:F(4,6,10),...lp},FD={...$,..._,...oh},VD={...$,..._,...oh},_D={...$,..._,...oh,background:{...$,..._}},Fy={visible:L,locked:L,readOnly:L,handle:Ga,...$},cp={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:Ga,text:op,background:$,statistics:ND,...ml,..._},BD={visible:L,up:OD,down:OD},yl={enabled:L,axesButtons:{enabled:L,axes:F("x","y","xy")},toolbar:{enabled:L,padding:w,buttons:Et({...ro,value:F("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:L,buttons:ie(ne(it({...ro,value:X(F("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),it({...ro,value:X(F("lock")),checkedOverrides:ro})))}};yl.data=J(qn),yl.xKey=J(O),yl.volumeKey=J(O),yl.snap=J(L);var ps={...$,..._,opacity:Z},zD={...$,..._,...W,cornerRadius:w,whisker:{..._,...W},cap:{lengthRatio:Z}},GD={...zD,opacity:Z},jD=De({...$,..._,...W,cornerRadius:w,whisker:{..._,...W},cap:{lengthRatio:Z}}),HD={direction:F("horizontal","vertical"),showInMiniChart:L,styler:jD,itemStyler:jD,tooltip:we,...Ie,...zD,highlight:at(GD,GD),segmentation:so,width:Jn,widthRatio:Z},Vy={cornerRadius:w,wick:{..._,...W},...$,..._,...W},$D={...Vy,opacity:Z},UD={item:{up:Vy,down:Vy},itemStyler:De({...$,..._,...W,cornerRadius:w,wick:{..._,...W}}),showInMiniChart:L,tooltip:we,...Ie,highlight:at($D,$D)},WD={fills:ie(Ci),strokes:ie(H),label:{spacing:w,maxWidth:w,...Oe},link:{tension:Z,itemStyler:De({...$,..._,...W,tension:Z}),...$,..._,...W},node:{width:w,spacing:w,itemStyler:De({...$,..._,...W}),...$,..._,...W},tooltip:we,...Ie},KD={direction:F("horizontal","vertical"),fills:ie(Ci),strokes:ie(H),label:{spacing:w,placement:F("before","middle","after"),...Oe},stageLabel:{placement:F("before","after"),format:Dn,...Mr},tooltip:we,...K(Ie,["showInLegend"]),...K($,["fill"]),...K(_,["stroke"]),...W,highlight:Gp(er)},YD={direction:F("horizontal","vertical"),fills:ie(Ci),strokes:ie(H),itemStyler:De({...$,..._,...W}),spacingRatio:Z,crisp:L,dropOff:{enabled:L,...$,..._,...W},stageLabel:{placement:F("before","after"),format:Dn,...Mr},label:Oe,tooltip:we,shadow:es,...K(Ie,["showInLegend"]),...K($,["fill"]),...K(_,["stroke"]),...W},ZD={title:O,textAlign:F("left","center","right"),verticalAlign:F("top","middle","bottom"),itemPadding:w,itemStyler:De({...$,..._}),showInMiniChart:L,label:nr,tooltip:we,...Ie,..._},XD={showInMiniChart:L,itemStyler:De({..._,...W}),item:{up:{..._,...W},down:{..._,...W}},tooltip:we,...Ie,highlight:at(er,er)},qD={maxStrokeWidth:w,itemStyler:De({..._,...W}),sizeDomain:ie(w),label:Oe,tooltip:we,...Ie,..._,...W,highlight:at(er,er)},JD={..._,...W},QD={colorRange:ie(H),maxSize:w,sizeDomain:ie(w),label:{placement:F("top","bottom","left","right"),...Oe},tooltip:we,...Ie,...K(An,["enabled"]),highlight:at(Ue,Ue)},eC={colorRange:ie(H),padding:w,itemStyler:De({...$,..._,...W}),label:nr,tooltip:we,...Ie,...$,..._,...W,highlight:at(Ue,Ue)},tC={...Ie,...$,..._,...W},bl=De({...$,..._,...W,cornerRadius:w}),iC={cornerRadius:w,styler:bl,itemStyler:bl,label:Oe,tooltip:we,...Ie,...$,..._,...W,highlight:at(Mn,Mn)},nC={direction:F("horizontal","vertical"),aspectRatio:w,spacing:w,reverse:L,itemStyler:De({...$,..._,...W}),fills:ie(Ci),strokes:ie(H),label:Oe,stageLabel:{spacing:w,placement:F("before","after"),...Oe},tooltip:we,shadow:es,...Ie,...K($,["fill"]),...K(_,["stroke"]),...W},sC={connectMissingData:L,marker:An,styler:De({marker:ir,...$,..._,...W}),label:Oe,tooltip:we,...Ie,...$,..._,...W,highlight:at(Ue,Ue)},rC={connectMissingData:L,marker:An,styler:De({marker:ir,..._,...W}),label:Oe,tooltip:we,...Ie,..._,...W,highlight:at(Ue,er)},aC={cornerRadius:w,styler:bl,itemStyler:bl,label:Oe,tooltip:we,...Ie,...$,..._,...W,highlight:at(Mn,Mn)},oC={cornerRadius:w,columnWidthRatio:Z,maxColumnWidthRatio:Z,styler:bl,itemStyler:bl,label:Oe,tooltip:we,...Ie,...$,..._,...W,highlight:at(Mn,Mn)},o2={marker:An,..._,...W},lC={marker:{enabled:L,...ir},..._,...W},cC={marker:ir,..._,...W},hC={showInMiniChart:L,connectMissingData:L,interpolation:Uh,label:{...Oe,placement:F("inside","outside"),spacing:w},tooltip:we,shadow:es,...Ie,...$,...o2,item:{low:{...lC},high:{...lC}},styler:De({...$,item:{low:{...cC},high:{...cC}}}),highlight:at(Ue,Ue),segmentation:so,invertedStyle:{enabled:L,...$}},uC=De({...$,..._,...W,cornerRadius:w}),dC={direction:F("horizontal","vertical"),grouped:L,showInMiniChart:L,cornerRadius:w,styler:uC,itemStyler:uC,label:{...Oe,placement:F("inside","outside"),spacing:w},tooltip:we,shadow:es,...Ie,...$,..._,...W,highlight:at(Mn,Mn),segmentation:so,width:Jn,widthRatio:Z},pC={fills:ie(Ci),strokes:ie(H),label:{...Oe,spacing:w,placement:F("left","right","center"),edgePlacement:F("inside","outside")},link:{itemStyler:De({...$,..._,...W}),...$,..._,...W},node:{width:w,spacing:w,minSpacing:Ae(w,Jb("spacing")),alignment:F("left","center","right","justify"),verticalAlignment:F("top","bottom","center"),sort:F("data","ascending","descending","auto"),itemStyler:De({...$,..._,...W}),...$,..._,...W},tooltip:we,...Ie},gC={fills:ie(Ci),strokes:ie(H),colorRange:ie(H),sectorSpacing:w,cornerRadius:w,padding:w,itemStyler:De({...$,..._}),label:{spacing:w,...nr},secondaryLabel:nr,tooltip:we,...K(Ie,["highlight","showInLegend"]),...K($,["fill"]),...K(_,["stroke"]),highlight:{highlightedItem:ps,highlightedBranch:ps,unhighlightedItem:ps,unhighlightedBranch:ps}},fC={fills:ie(Ci),strokes:ie(H),colorRange:ie(H),itemStyler:De({...$,..._}),group:{gap:w,padding:w,cornerRadius:w,textAlign:F("left","center","right"),interactive:L,highlight:{highlightedItem:ps,unhighlightedItem:ps},label:{...Oe,spacing:w},...$,..._},tile:{gap:w,padding:w,cornerRadius:w,textAlign:F("left","center","right"),verticalAlign:F("top","middle","bottom"),label:{...Oe,spacing:w,lineHeight:w,minimumFontSize:w,wrapping:F("never","always","hyphenate","on-space"),overflowStrategy:F("ellipsis","hide")},secondaryLabel:{...Oe,lineHeight:w,minimumFontSize:w,wrapping:F("never","always","hyphenate","on-space"),overflowStrategy:F("ellipsis","hide")},highlight:{highlightedItem:ps,highlightedBranch:ps,unhighlightedItem:ps,unhighlightedBranch:ps},...$,..._},tooltip:we,...K(Ie,["highlight","showInLegend"])},_y={name:O,cornerRadius:w,itemStyler:De({...$,..._,...W,cornerRadius:w}),label:{...Oe,placement:F("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:w},tooltip:we,shadow:es,...$,..._,...W},mC={direction:F("horizontal","vertical"),showInMiniChart:L,item:{positive:_y,negative:_y,total:_y},line:{enabled:L,..._,...W},tooltip:we,width:Jn,widthRatio:Z,...Ie},hp=it({__type:X(_e("date")),value:ne(O,P)},"a serializable date object"),yC={width:w,height:w,grip:L,fill:H,stroke:H,strokeWidth:w,cornerRadius:w},ke={enabled:L,height:w,spacing:w,cornerRadius:P,mask:{fill:H,fillOpacity:Z,stroke:H,strokeWidth:w},minHandle:yC,maxHandle:yC,miniChart:{enabled:L,padding:{top:w,bottom:w},label:{enabled:L,avoidCollisions:L,spacing:w,format:Dn,formatter:mi(ln),interval:{minSpacing:w,maxSpacing:w,values:qn,step:P},...Ce},series:pe}},By={...$,..._,...W,cornerRadius:w,opacity:Z},bC={...By,minSize:w,hoverStyle:{fill:$.fill,stroke:_.stroke}},vC={enabled:L,thickness:w,spacing:w,tickSpacing:w,visible:F("auto","always","never"),placement:F("outer","inner"),track:By,thumb:bC},l2={...vC,position:F("top","bottom")},c2={...vC,position:F("left","right")},hi={enabled:L,enableAxisScrolling:L,enableSeriesAreaScrolling:L,thickness:w,spacing:w,tickSpacing:w,visible:F("auto","always","never"),placement:F("outer","inner"),track:By,thumb:bC,horizontal:l2,vertical:c2},ja=K(iS,["type","value","range"]),ui={number:{...K(Ko,["type","crossLines"]),top:K(Ko,["type","crossLines","position"]),right:K(Ko,["type","crossLines","position"]),bottom:K(Ko,["type","crossLines","position"]),left:K(Ko,["type","crossLines","position"]),crossLines:ja},log:{...K(Yo,["type","crossLines"]),top:K(Yo,["type","crossLines","position"]),right:K(Yo,["type","crossLines","position"]),bottom:K(Yo,["type","crossLines","position"]),left:K(Yo,["type","crossLines","position"]),crossLines:ja},category:{...K(Uo,["type","crossLines"]),top:K(Uo,["type","crossLines","position"]),right:K(Uo,["type","crossLines","position"]),bottom:K(Uo,["type","crossLines","position"]),left:K(Uo,["type","crossLines","position"]),crossLines:ja},time:{...K(Zo,["type","crossLines"]),top:K(Zo,["type","crossLines","position"]),right:K(Zo,["type","crossLines","position"]),bottom:K(Zo,["type","crossLines","position"]),left:K(Zo,["type","crossLines","position"]),crossLines:ja},"unit-time":{...K(Xo,["type","crossLines"]),top:K(Xo,["type","crossLines","position"]),right:K(Xo,["type","crossLines","position"]),bottom:K(Xo,["type","crossLines","position"]),left:K(Xo,["type","crossLines","position"]),crossLines:ja},"grouped-category":{...K(Wo,["type"]),top:K(Wo,["type","position"]),right:K(Wo,["type","position"]),bottom:K(Wo,["type","position"]),left:K(Wo,["type","position"]),crossLines:ja},"ordinal-time":{...K(fl,["type","crossLines"]),top:K(fl,["type","crossLines","position"]),right:K(fl,["type","crossLines","position"]),bottom:K(fl,["type","crossLines","position"]),left:K(fl,["type","crossLines","position"]),crossLines:ja}},vl={"angle-category":{...K(Ey,["type","crossLines"]),crossLines:K(Ps,["type"])},"angle-number":{...K(wD,["type","crossLines"]),crossLines:K(Ps,["type"])},"radius-category":{...K(LD,["type","crossLines"]),crossLines:{...K(Ps,["type"]),label:{...Ho,positionAngle:P}}},"radius-number":{...K(kD,["type","crossLines"]),crossLines:{...K(Ps,["type"]),label:{...Ho,positionAngle:P}}}},Ne={visible:J(L)},h2={common:{...se,navigator:ke,scrollbar:hi,axes:{...ui,...vl},annotations:{...yl,line:lp,"horizontal-line":Ry,"vertical-line":Ry,"disjoint-channel":RD,"parallel-channel":PD,"fibonacci-retracement":Py,"fibonacci-retracement-trend-based":Py,callout:FD,comment:VD,note:_D,text:oh,arrow:lp,"arrow-up":Fy,"arrow-down":Fy,"date-range":cp,"price-range":cp,"date-price-range":cp,"quick-date-price-range":BD},chartToolbar:{enabled:L},initialState:{legend:Et({visible:L,seriesId:O,itemId:O,legendItemName:O},"legend state array"),zoom:{rangeX:{start:ne(P,hp),end:ne(P,hp)},rangeY:{start:ne(P,hp),end:ne(P,hp)},ratioX:{start:Z,end:Z},ratioY:{start:Z,end:Z},autoScaledAxes:ie(_e("y"))}}},line:{...se,axes:ui,series:xf,navigator:ke,scrollbar:hi,...Ne},scatter:{...se,axes:ui,series:iD,navigator:ke,scrollbar:hi,...Ne,paired:J(L)},bubble:{...se,axes:ui,series:YI,navigator:ke,scrollbar:hi,...Ne},area:{...se,axes:ui,series:a0,navigator:ke,scrollbar:hi,...Ne},bar:{...se,axes:ui,series:vf,navigator:ke,scrollbar:hi,...Ne},"box-plot":{...se,axes:ui,series:HD,navigator:ke,scrollbar:hi,...Ne},candlestick:{...se,axes:ui,series:UD,navigator:ke,scrollbar:hi,...Ne},"cone-funnel":{...se,axes:ui,series:KD,navigator:ke,scrollbar:hi,...Ne},funnel:{...se,axes:ui,series:YD,navigator:ke,scrollbar:hi,...Ne},ohlc:{...se,axes:ui,series:XD,navigator:ke,scrollbar:hi,...Ne},histogram:{...se,axes:K(ui,["category","grouped-category","unit-time","ordinal-time"]),series:JI,navigator:ke,scrollbar:hi,...Ne},heatmap:{...se,axes:ui,series:ZD,navigator:ke,scrollbar:hi,...Ne},waterfall:{...se,axes:ui,series:mC,navigator:ke,scrollbar:hi,...Ne},"range-bar":{...se,axes:ui,series:dC,navigator:ke,scrollbar:hi,...Ne},"range-area":{...se,axes:ui,series:hC,navigator:ke,scrollbar:hi,...Ne},donut:{...se,series:mD,navigator:ke,...Ne},pie:{...se,series:wy,navigator:ke,...Ne},"radar-line":{...se,axes:vl,series:rC,navigator:ke,...Ne},"radar-area":{...se,axes:vl,series:sC,navigator:ke,...Ne},"radial-bar":{...se,axes:vl,series:aC,navigator:ke,...Ne},"radial-column":{...se,axes:vl,series:oC,navigator:ke,...Ne},nightingale:{...se,axes:vl,series:iC,navigator:ke,...Ne},sunburst:{...se,series:gC,navigator:ke,...Ne},treemap:{...se,series:fC,navigator:ke,...Ne},"map-shape":{...se,series:eC,navigator:ke,...Ne},"map-line":{...se,series:qD,navigator:ke,...Ne},"map-marker":{...se,series:QD,navigator:ke,...Ne},"map-shape-background":{...se,series:tC,navigator:ke,...Ne},"map-line-background":{...se,series:JD,navigator:ke,...Ne},sankey:{...se,series:pC,navigator:ke,...Ne},chord:{...se,series:WD,navigator:ke,...Ne},pyramid:{...se,series:nC,navigator:ke,...Ne},"radial-gauge":{...se,...eu,targets:K(Jh,["value"]),tooltip:{...eu.tooltip,...se.tooltip}},"linear-gauge":{...se,...Qh,targets:K(qh,["value"]),tooltip:{...Qh.tooltip,...se.tooltip}}};function up(e,t){const i={};for(const n of Reflect.ownKeys(e))i[n]=t(e[n],n,e);return i}var u2=up(h2,function e(t,i){if(Bl(i))return t;if(Xn(t))return ne(t,Ul,Bl);if(oe(t))return ne(it(jl in t?up(t,n=>oe(n)?up(n,e):n):up(t,e)),Ul,Bl);throw new Error(`Invalid theme override value: ${String(t)}`)}),ti={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ha={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},d2=class extends gl{getDefaultColors(){return{fills:ti,fillsFallback:Object.values(ti),strokes:Ha,sequentialColors:Wi(ti),divergingColors:[ti.ORANGE,ti.YELLOW,ti.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ti.GREEN,ti.YELLOW,ti.RED],secondHierarchyColors:[],up:{fill:ti.GREEN,stroke:Ha.GREEN},down:{fill:ti.RED,stroke:Ha.RED},neutral:{fill:ti.GRAY,stroke:Ha.GRAY},altUp:{fill:ti.BLUE,stroke:Ha.BLUE},altDown:{fill:ti.ORANGE,stroke:Ha.ORANGE},altNeutral:{fill:ti.GRAY,stroke:Ha.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,ti.BLUE),e.set(Li,ti.BLUE),e}},ii={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},$a={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},p2=class extends zn{getDefaultColors(){return{...super.getDefaultColors(),fills:ii,fillsFallback:Object.values(ii),strokes:$a,sequentialColors:Wi(ii),divergingColors:[ii.ORANGE,ii.YELLOW,ii.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ii.GREEN,ii.YELLOW,ii.RED],secondHierarchyColors:[],up:{fill:ii.GREEN,stroke:$a.GREEN},down:{fill:ii.RED,stroke:$a.RED},neutral:{fill:ii.GRAY,stroke:$a.GRAY},altUp:{fill:ii.BLUE,stroke:$a.BLUE},altDown:{fill:ii.ORANGE,stroke:$a.ORANGE},altNeutral:{fill:ii.GRAY,stroke:$a.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ki,ii.BLUE),e.set(Li,ii.BLUE),e}},zy=Ut(()=>new zn),g2=he.create(!0,"perf"),Gn=(e,t,i)=>{g2("[CACHE] ChartTheme",e,t.name,i)},Gy={"ag-default-dark":Ut(()=>new gl),"ag-sheets-dark":Ut(()=>new n2,Gn),"ag-polychroma-dark":Ut(()=>new t2,Gn),"ag-vivid-dark":Ut(()=>new d2,Gn),"ag-material-dark":Ut(()=>new QP,Gn),"ag-financial-dark":Ut(()=>new qP,Gn),"ag-default":zy,"ag-sheets":Ut(()=>new s2,Gn),"ag-polychroma":Ut(()=>new i2,Gn),"ag-vivid":Ut(()=>new p2,Gn),"ag-material":Ut(()=>new e2,Gn),"ag-financial":Ut(()=>new JP,Gn)},dp=Ut(f2,Gn);function f2(e){if(e instanceof zn)return e;if(!v2(e))return zy();if(e==null||typeof e=="string"){const s=Gy[e??"ag-default"];if(s)return s();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=Vt(m2(e),y2,"theme");for(const s of i)z.warnOnce(String(s));const n=t?.baseTheme?dp(t.baseTheme):zy();return t?new n.constructor(t):n}function m2(e){if(!oe(e)||!oe(e.baseTheme))return e;let t=e,i,n;const s=[];for(;typeof t=="object";)i??(i=t.palette),n??(n=t.params),t.overrides&&s.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:xe(...s),params:n,palette:i}}var y2={baseTheme:ne(O,Qs),overrides:u2,params:{accentColor:H,axisColor:H,backgroundColor:H,borderColor:H,borderRadius:P,chartBackgroundColor:H,chartPadding:P,focusShadow:O,foregroundColor:H,fontFamily:Bh,fontSize:P,fontWeight:Wl,gridLineColor:H,popupShadow:O,subtleTextColor:H,textColor:H,separationLinesColor:H,chromeBackgroundColor:H,chromeFontFamily:Bh,chromeFontSize:P,chromeFontWeight:Wl,chromeSubtleTextColor:H,chromeTextColor:H,buttonBackgroundColor:H,buttonBorder:L,buttonFontWeight:Wl,buttonTextColor:H,inputBackgroundColor:H,inputBorder:L,inputTextColor:H,menuBackgroundColor:H,menuBorder:L,menuTextColor:H,panelBackgroundColor:H,panelSubtleTextColor:H,tooltipBackgroundColor:H,tooltipBorder:L,tooltipTextColor:H,tooltipSubtleTextColor:H,crosshairLabelBackgroundColor:H,crosshairLabelTextColor:H},palette:{fills:ie(Ci),strokes:ie(H),up:{fill:ne(H,_h),stroke:H},down:{fill:ne(H,_h),stroke:H},neutral:{fill:ne(H,_h),stroke:H}}},b2=F("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 v2(e){const{invalid:t}=Vt({theme:e},{theme:ne(b2,Qs)});for(const i of t)z.warnOnce(String(i));return t.length===0}var et="path",mn="pathArray",Ye="default",Vi="override",ni="user",_r="userPartial",gs="operation",fs="operationValue",xl="dependency",jy="autoEnable",xC="autoEnableValue",SC="prune",MC="childrenSource";function Hy(e){return Hi(e)&&e>=0&&e<=1}function lh(e,t){let i=e;for(const n of t){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return!1;i=i[n]}return!0}function jt(e,t){let i=e;for(const n of t){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return;i=i[n]}return i}function Sl(e,t,i){const n=t.length;if(n===0)return;let s=e;const r=n-1,a=t[r];for(let o=0;o=0;n--){const s=e[n];if(x2.test(s)&&(i++,i>t))return n}return-1}function Ml(e,t=0){const i=S2(e,t);return Number(e[i])}function Ua(e,t,i){const n=t.split("/");let s=[...e];t.startsWith("/")&&(s=[],n.shift());let r=!1;for(const a of n){if(a==="..")s.pop(),r||s.pop();else if(a===".")s.pop();else if(a==="$index"){const o=Ml(e);if(Number.isNaN(o))return ms;s.push(`${o}`)}else if(a==="$prevIndex"){const o=Ml(e);if(Number.isNaN(o)||Number(o)<=0)return ms;s.push(`${Number(o)-1}`)}else if(a.startsWith("$")){const o=i?.[a.slice(1)];if(o==null)return ms;s.push(o)}else a.length!==0&&s.push(a);r=a===".."}return s}var ms=Symbol("unresolvable-path"),_i=Symbol("resolved-to-branch");function ch(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(AC.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function M2(e,t,i){const n=ch(e.getVertexValue(i));switch(n?.operation){case"$path":{const[s]=n.values,r=e.getPathArray(t),a=Ua(r,s);return a===ms?void 0:e.findVertexAtPath(a)}case"$value":return t}}var I2={$cacheMax:D2};function D2(e,t,i){const[n]=i,s=e.getPathArray(t),r=e.getCachedValue(s,"$cacheMax"),a=e.resolveVertexValue(t,n);if(typeof a!="number")return r;if(typeof r!="number")return e.setCachedValue(s,"$cacheMax",a),a;const o=Math.max(r,a);return e.setCachedValue(s,"$cacheMax",o),o}var C2={$hasSeriesType:{dependencies:$y,resolve:A2},$isChartType:{dependencies:$y,resolve:k2},$isSeriesType:{dependencies:$y,resolve:w2}};function $y(e,t,i){const n=e.findVertexAtPath(["series","0","type"]);n&&e.addEdge(t,n,xl)}function A2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),r=e.getResolvedPath(["series"]);if(!Array.isArray(r))return!1;for(const a of r)if(a.type===s)return!0;return!1}function w2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return e.getResolvedPath(["series","0","type"])===s}function k2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),r=e.getResolvedPath(["series","0","type"]);if(typeof r!="string")return!1;const a=ee.getSeriesModule(r);if(a==null)return!1;switch(s){case"cartesian":return a.chartType==="cartesian";case"polar":return a.chartType==="polar";case"standalone":return a.chartType==="standalone"}return!1}var L2={$foregroundBackgroundMix:T2,$foregroundOpacity:N2,$interpolate:O2,$isGradient:E2,$isImage:R2,$isPattern:P2,$mix:F2};function T2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),r=e.getParamValue("foregroundColor"),a=e.getParamValue("backgroundColor");if(typeof r=="string"&&typeof a=="string"&&Hy(s))return Te.mix(Te.fromString(r),Te.fromString(a),1-s).toString();he.inDevelopmentMode(()=>z.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(s)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function N2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),r=e.getParamValue("foregroundColor");if(typeof r=="string"&&Hy(s)){const a=Te.fromString(r);return new Te(a.r,a.g,a.b,s).toString()}he.inDevelopmentMode(()=>z.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(s)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function O2(e,t,i){const[n,s]=i,r=e.resolveVertexValue(t,n),a=e.resolveVertexValue(t,s);if(!(!le(r)||!Hi(a)))return Te.interpolate(r.map(o=>Te.fromString(o)),a).map(o=>o.toString())}function E2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Zi(s)}function R2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return ua(s)}function P2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Ts(s)}function F2(e,t,i){const[n,s,r]=i,a=e.resolveVertexValue(t,n),o=e.resolveVertexValue(t,s),l=e.resolveVertexValue(t,r),c=e.getPathArray(t),h=`\`$mix\` json operation failed on [${String(a)}, ${String(o)}, ${String(l)}] at [${c.join(".")}], expecting`,u=`${h} two colors and a number between 0 and 1.`;if(typeof o!="string"||!Hy(l)){he.inDevelopmentMode(()=>z.warnOnce(u));return}if(typeof a=="string")try{return Te.mix(Te.fromString(a),Te.fromString(o),l).toString()}catch{he.inDevelopmentMode(()=>z.warnOnce(u));return}if(!Zi(a)){he.inDevelopmentMode(()=>z.warnOnce(u));return}let d=a.colorStops;try{d=d?.map(p=>{let g;return typeof p.color=="string"&&(g=Te.mix(Te.fromString(p.color),Te.fromString(o),l).toString()),{...p,color:g}})}catch{he.inDevelopmentMode(()=>z.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...a,colorStops:d}}var V2={$rem:_2};function _2(e,t,i){const[n,s]=i,r=e.getVertexValue(n),a=s?e.getVertexValue(s):"fontSize",o=e.getParamValue(a);if(typeof o=="number"&&typeof r=="number")return Math.round(r*o);he.inDevelopmentMode(()=>z.warnOnce(`\`$rem\` json operation failed on [${String(r)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var B2={$and:z2,$eq:G2,$every:j2,$greaterThan:H2,$if:$2,$lessThan:U2,$not:W2,$or:K2,$some:Y2,$switch:Z2};function z2(e,t,i){for(const n of i){const s=e.resolveVertexValue(t,n);if(i.length===1&&Array.isArray(s))return s.every(r=>!!r);if(!s)return!1}return!0}function G2(e,t,i){let n,s=!0;for(const r of i){const a=e.resolveVertexValue(t,r);if(s)n=a,s=!1;else if(a!==n)return!1}return!0}function j2(e,t,i){const[n,s]=i,r=e.getVertexValue(n),a=e.resolveVertexValue(t,s);if(!Array.isArray(a))return;let o=0;for(const l of a){if(!e.graftAndResolveOrphanValue(t,`${o}`,r,l))return!1;o++}return!0}function H2(e,t,i){const[n,s]=i;return e.resolveVertexValue(t,n)>e.resolveVertexValue(t,s)}function $2(e,t,i){const[n,s,r]=i,o=e.resolveVertexValue(t,n)?s:r,l=e.neighboursWithEdgeValue(o,et);if(l)for(const c of l)e.addEdge(t,c,et);return e.resolveVertexValue(t,o)}function U2(e,t,i){const[n,s]=i;return e.resolveVertexValue(t,n)!!r);if(s)return!0}return!1}function Y2(e,t,i){const[n,s]=i,r=e.getVertexValue(n),a=e.resolveVertexValue(t,s);if(!Array.isArray(a))return;let o=0;for(const l of a){if(e.graftAndResolveOrphanValue(t,`${o}`,r,l))return!0;o++}return!1}function Z2(e,t,i){const[n,s,...r]=i,a=e.resolveVertexValue(t,n);for(const o of r){const l=e.getVertexValue(o);if(!Array.isArray(l))continue;const[c,h]=l;if(a===c||Array.isArray(c)&&c.includes(a))return h}return e.resolveVertexValue(t,s)}var X2={$isUserOption:q2,$palette:J2,$mapPalette:Q2,$path:{dependencies:CC,resolve:eF},$pathString:{dependencies:CC,resolve:tF},$ref:iF};function q2(e,t,i){const[n,s,r]=i,a=e.neighboursWithEdgeValue(n,et);if(a)for(const o of a){const l=e.findNeighbour(o,Ye);if(l&&IC(e,t,l))return e.resolveVertexValue(t,s)}else if(IC(e,t,n))return e.resolveVertexValue(t,s);return e.resolveVertexValue(t,r)}function IC(e,t,i){const n=e.resolveVertexValue(t,i);if(!rt(n))throw new Error(`\`$isUserOption\` json operation failed on [${String(n)}], expecting a string.`);const s=e.getPathArray(t),r=Ua(s,n);return r===ms?!1:e.hasUserOption(r)}var DC=new Set(["fill","fillFallback","stroke","gradient","range2"]);function J2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);if(!rt(s))return;if(DC.has(s)){const a=e.getPathArray(t),o=Ml(a);if(Number.isNaN(o))return;switch(s){case"fill":return xn(e.palette.fills,1,o)[0];case"fillFallback":return xn(e.palette.fillsFallback,1,o)[0];case"stroke":return xn(e.palette.strokes,1,o)[0];case"gradient":return xn(e.palette.sequentialColors,1,o)[0];case"range2":return xn(e.palette.fills,2,o)}return}if(s==="gradients")return e.palette.sequentialColors;if(s==="type")return e.paletteType;const r=jt(e.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function Q2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);if(!rt(s))return;if(DC.has(s)){const a=e.getPathArray(t);let o=Ml(a),l=0;const c=["series","0","type"];for(let h=0;h1,s=i.length>2,[r,a,o]=i,l=e.resolveVertexValue(t,r),c=s?e.resolveVertexValue(t,o):null;if(!rt(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),u=Ua(h,l);if(u===ms)return;const d=c?jt(c,u):e.getResolvedPath(u);if(d!=null)return d;if(n)return e.resolveVertexValue(t,a)}function tF(e,t,i){const[n,s]=i,r=e.resolveVertexValue(t,n);if(!rt(r))throw new Error(`\`$path\` json operation failed on [${String(r)}], expecting a string.`);let a;s&&(a=e.graftAndResolveOrphan(t,s));const o=e.getPathArray(t),l=Ua(o,r,a);if(l===ms)throw new Error(`Unresolvable path [${r}] at [${o.join(".")}]`);return l}function iF(e,t,i){const[n]=i,s=e.getVertexValue(n);return e.getParamValue(s)}var nF={$apply:sF,$applyCycle:rF,$applySwitch:aF,$applyTheme:oF,$clone:lF,$findFirstSiblingNotOperation:cF,$map:hF,$merge:uF,$omit:dF,$size:pF,$shallow:fF,$shallowSimple:gF,$value:mF};function sF(e,t,i){const[n,s,r,a]=i,o=e.getVertexValue(n);if(!be(o))return;const l=s?e.getVertexValue(s):void 0,c=e.neighboursWithEdgeValue(t,et),h=c&&c.length>0;if(!h&&l==null)return _i;const u=r?e.resolveVertexValue(t,r):void 0,d=a?e.resolveVertexValue(t,a):void 0;if(!h&&l!=null)if(ch(l)){const p=e.resolveVertexValue(t,s);be(p)&&e.graftObject(t,p,[u,d])}else e.graftObject(t,l,[u,d]);if(!h)return _i;for(const p of c){const g=e.neighboursWithEdgeValue(p,et);if(!g||g.length===0){const f=e.addVertex({});e.addEdge(p,f,Ye)}else e.graftObject(p,o,[u,d])}return _i}function rF(e,t,i){const[n,s,r]=i,a=e.resolveVertexValue(t,n);if(typeof a!="number")return;const o=e.getPathArray(t),l=e.dangerouslyGetUserOption(o),c=e.hasThemeOverride(o),h=l==null?void 0:ni,u=l??e.resolveVertexValue(t,s);if(!Array.isArray(u))return;const d=r?e.getVertexValue(r):void 0;for(let p=0;p0)return;let l=0;for(const c of a)e.graftValue(t,`${l}`,r,c),l++;return _i}function uF(e,t,i){for(const n of i){const s=e.resolveVertexValue(t,n);be(s)&&e.graftObject(t,s)}return _i}function dF(e,t,i){const[n,s]=i;let r=e.getVertexValue(n);if(!Array.isArray(r)){const o=M2(e,t,s);if(!o)return;r=e.resolveVertexValue(o,n)}const a=e.resolveVertexValue(t,s);if(!(!Array.isArray(r)||!be(a)))return K(a,r)}function pF(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Vl(s)?"length"in s?s.length:Object.keys(s).length:0}function gF(e,t,i){const n=[];for(const s of i)n.push(e.getVertexValue(s));return n}function fF(e,t,i){const n=e.getPathArray(t),s=e.hasUserOption(n);if(!s&&i.length===1)return e.resolveVertexValue(t,i[0]);const r=[];for(const a of i)r.push(e.getVertexValue(a));return s?(e.prune(t,[Vi,Ye]),_i):(e.graftObject(t,r),_i)}function mF(e,t,i){const[n]=i,s=e.getVertexValue(n),r=e.getPathArray(t);if(s==="$index")return Ml(r);if(s==="$parentIndex")return Ml(r,1);if(s==="$1")return e.resolveValue$1(r)}var yF={$isEven:bF};function bF(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Number.isNaN(Number(s))?!1:Number(s)%2===0}var hh={...I2,...C2,...L2,...V2,...X2,...B2,...yF,...nF},AC=new Set(Object.keys(hh));function uh(e){return AC.has(e)}var Be=he.create("opts","options-graph"),vF=Ut(xF);function xF(e,t){return Be.group("OptionsGraph.constructor()",()=>{const i=new wC(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(n,s,r){return i.resolvePartial(n,s,r)},clearSafe(){return i.clearSafe()}}})}var Br=class Ht extends sx{constructor(t={},i={},n=void 0,s={},r=void 0,a=new Map){super(et,gs,new Set([_r,ni])),this.config=t,this.userOptions=i,this.palette=s,this.overrides=r,this.internalParams=a,this.edgePriority=[...Ht.EDGE_PRIORITY],this.graftEdge=Ht.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=oe(i?.theme)?ID(i.theme?.palette):"inbuilt";const o=i.series?.[0]?.type??"line";Be("build user"),this.buildGraphFromObject(this.root,ni,K(i,["theme"])),Be("build defaults"),this.buildGraphFromObject(this.root,Ye,K(t[o],Ht.COMPLEX_KEYS));const l=r?K(r[o],Ht.COMPLEX_KEYS):{};Object.keys(l).length>0&&(Be("build series overrides"),this.buildGraphFromObject(this.root,Vi,l));const c=r?K(r.common,Ht.COMPLEX_KEYS):{};Object.keys(c).length>0&&(Be("build common overrides"),this.buildGraphFromObject(this.root,Vi,ee.getSeriesModule(o)?.chartType==="cartesian"?c:K(c,["zoom","navigator"]))),n&&(Be("build params"),this.buildGraphFromObject(this.params,Ye,n));const h=this.findNeighbourWithValue(this.root,"axes",et),u=this.findNeighbourWithValue(this.root,"series",et);h&&(Be("build axes"),this.buildGraphFromObject(h,Ye,{$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"]]})),u&&(Be("build series"),this.buildGraphFromObject(u,Ye,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const d=K(t[o]?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(d).length>0&&(Be("build annotations type config"),this.buildGraphFromObject(this.annotations,Ye,d));const p=K(r?.common?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&(Be("build annotations type overrides"),this.buildGraphFromObject(this.annotations,Vi,p));const g=Zh(t[o]?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&(Be("build annotations config"),this.buildGraphFromObject(this.root,Ye,{annotations:g}));const f=Zh(r?.common?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(Be("build annotations overrides"),this.buildGraphFromObject(this.root,Vi,{annotations:f})),this.buildDependencyGraph()}static clearValueCache(){Ht.valueCache.clear()}clear(){Be.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,Be("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return Be.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},Be("resolve params"),this.resolveVertex(this.params,this.resolvedParams),Be("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),Be("resolve root"),this.resolveVertex(this.root),Be("resolved root",this.resolved),Be("vertex count",this.getVertexCount()),Be("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,n){const s=(this.neighboursWithEdgeValue(t,n)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!s&&(this.rollbackEdgesFrom.push(t),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(n)),super.addEdge(t,i,n)}resolvePartial(t,i,n){if(!i||!this.root)return;const{permissivePath:s,proxyPaths:r}=n??{},a=Object.keys(i);if(Be.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${t.join(".")} [${a}]`),a.length===0)return{};const o=this.findVertexAtPath(t);if(!o){if(s)return;throw new Error(`Could not find vertex in OptionsGraph at path [${t.join(".")}].`)}const l=this.findNeighbour(o,mn);if(this.userPartialOptions={},Sl(this.userPartialOptions,t,i),r)for(const p of Object.keys(r)){const g=r[p],f=jt(i,[p]);f!=null&&(Sl(i,g,f),Sl(this.userPartialOptions,[...t,...g],f),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=_r,this.edgePriority=[_r,...Ht.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(o,_r,i,l);for(const p of a){const g=r?.[p]?this.findVertexAtPath([...t,...r[p]]):this.findNeighbourWithValue(o,p,et);g&&this.refreshPendingProcessingEdges(g)}this.buildDependencyGraph();const c={};if(this.resolveVertex(o,c),this.rollback(),this.graftEdge=Ht.GRAFT_EDGE,this.edgePriority=Ht.EDGE_PRIORITY,this.userPartialOptions=void 0,r)for(const p of Object.keys(r)){const g=r[p],f=jt(c,[...t,...g]);Sl(c,[...t,p],f)}const h=jt(c,t),d=n?.pick??!0?Zh(jt(c,t),a):h;return Be("vertex count",this.getVertexCount()),Be("edge count",this.getEdgeCount()),Be("resolved partial",d),Be.check()&&console.groupEnd(),d}findVertexAtPath(t){const i=t.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const n=this.findVertexAlongEdge(this.root,t,et);if(n)return this.cachedPathVertices.set(i,n),n}hasUserOption(t){if(lh(this.userOptions,t))return!0;const n=this.findVertexAtPath(t);if(n){if(this.findNeighbour(n,ni)!=null||this.findNeighbour(n,_r)!=null)return!0;const s=this.findNeighbourValue(n,MC);return s===ni||s===_r}return!1}dangerouslyGetUserOption(t){if(this.userPartialOptions){const i=jt(this.userPartialOptions,t);if(i!=null)return i}return jt(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(lh(this.overrides,["common","axes",i,...t.slice(2)]))return!0;const n=this.getResolvedPath(["series","0","type"]);return lh(this.overrides,[n,"axes",i,...t.slice(2)])}if(t[0]==="series"&&t.length>1){const i=this.getResolvedPath(["series",t[1],"type"]);return lh(this.overrides,[i,"series",...t.slice(2)])}return lh(this.overrides,t)}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],et);if(!i)return;const n=this.findNeighbour(i,Ye);if(!n)return;const s=this.resolveVertexValue(i,n);return this.resolvedParams[t]=s,s}getPathArray(t){return this.findNeighbourValue(t,mn)??[]}getResolvedPath(t){return jt(this.resolved,t)}getCachedValue(t,i){const n=[...t,i].join(".");return Ht.valueCache.get(n)}setCachedValue(t,i,n){const s=[...t,i].join(".");Ht.valueCache.set(s,n)}prune(t,i){this.addEdge(t,this.addVertex(i),SC)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,gs);if(n&&uh(n)){const r=this.neighboursWithEdgeValue(i,fs),a=hh[n],l=(typeof a=="function"?a:a.resolve)?.(this,t,r??[]);return l===_i?void 0:l}let s=this.getVertexValue(i);if(Array.isArray(s)){const r={};this.resolveVertexChildren(i,r),s=jt(r,this.getPathArray(t))}return this.resolveValueOrSymbol(s)}resolveValue$1(t){for(let i=t.length;i>=0;i--){const n=t.slice(0,i).join("."),s=this.value$1.get(n);if(s!=null)return s}}graftConfig(t,i,n){const s=jt(this.config,i),r=this.findNeighbour(t,mn);if(oe(s)&&this.buildGraphFromObject(t,Ye,s,r,void 0,n),this.overrides){const a=jt(this.overrides,i);oe(a)&&this.buildGraphFromObject(t,Vi,a,r,void 0,n);const o=jt(this.overrides,["common",...i.slice(1)]);oe(o)&&this.buildGraphFromObject(t,Vi,o,r,void 0,n)}this.buildDependencyGraph()}graftObject(t,i,n,s=this.graftEdge){const r=this.findNeighbour(t,mn);if(this.buildGraphFromObject(t,s,i,r),this.overrides&&n)for(const a of n){if(a==null)continue;const o=jt(this.overrides,a);o&&this.buildGraphFromObject(t,Vi,o,r)}this.buildDependencyGraph()}graftValue(t,i,n,s,r=this.graftEdge){const a=[...this.getPathArray(t),i],o=this.findVertexAtPath(a)??this.addVertex(i);this.value$1.set(a.join("."),s),this.buildGraphFromValue(t,o,r,a,n),this.buildDependencyGraph()}graftAndResolveOrphan(t,i){const n={},s=this.addVertex(n),r=this.getPathArray(t);return this.graftAndResolveChildren(i,s,r,[]),this.resolveVertex(s,n),jt(n,r)}graftAndResolveOrphanValue(t,i,n,s,r=this.graftEdge){const a={},o=this.addVertex(a),c=[...this.getPathArray(t),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),s),this.buildGraphFromValue(o,h,r,c,n),this.resolveVertex(o,a),jt(a,c)}buildGraphFromObject(t,i,n,s,r=Ht.SHALLOW_KEYS,a){const o=Object.keys(n),l=ch(n,o);if(l){const g=this.addVertex(n);this.addEdge(t,g,i),this.buildGraphFromOperation(g,i,l,s);return}if(o.length===0){this.addEdge(t,this.addVertex(Array.isArray(n)?[]:{}),i),this.buildGraphAutoEnable(t,i,n,void 0);return}const c=this.getVertexChildrenByKey(t),h=s?this.getVertexValue(s):[];let u;Array.isArray(n)&&this.addEdge(t,this.addVertex(i),MC);const d=[...h],p=h.length;for(const g of o){if(a?.has(g))continue;const f=c?.get(g)??this.addVertex(g);d[p]=g,r?.has(g)?this.buildShallowGraphFromValue(t,f,i,d,n[g]):this.buildGraphFromValue(t,f,i,d,n[g],r),g==="enabled"&&(u=f)}this.buildGraphAutoEnable(t,i,n,u)}buildGraphAutoEnable(t,i,n,s){if(i===Ye&&!s||i===ni&&s||i!==Ye&&i!==ni&&i!==_r&&i!==Vi)return;let r=this.findNeighbour(t,jy);r||(r=this.addVertex(jy),this.addEdge(t,r,jy)),s&&this.addEdge(s,r,xC);const{enabled:a,_enabledFromTheme:o}=n;this.addEdge(r,this.addVertex({enabled:a,_enabledFromTheme:o,keys:Object.keys(n).length}),i)}getVertexChildrenByKey(t){const i=this.neighboursWithEdgeValue(t,et);if(!i)return;const n=new Map;for(const s of i)n.set(this.getVertexValue(s),s);return n}buildGraphFromValue(t,i,n,s,r,a){this.addEdge(t,i,et);let o=this.findNeighbour(i,mn);o||(o=this.addVertex([...s]),this.addEdge(i,o,mn));const l=ch(r);if(l){const c=this.addVertex(r);this.addEdge(i,c,n),this.addEdge(c,o,mn),this.buildGraphFromOperation(c,n,l,o)}else if(Vl(r))this.buildGraphFromObject(i,n,r,o,a);else{const c=this.findNeighbour(i,n);if(c&&this.getVertexValue(c)===r)return;const h=this.addVertex(r);this.addEdge(i,h,n)}}buildShallowGraphFromValue(t,i,n,s,r){this.addEdge(t,i,et);let a=this.findNeighbour(i,mn);a||(a=this.addVertex([...s]),this.addEdge(i,a,mn));const o=this.addVertex(r);this.addEdge(i,o,n)}buildGraphFromOperation(t,i,n,s){const r=this.addVertex(n.operation);this.addEdge(t,r,gs);for(const a of n.values)this.buildGraphFromOperationValue(t,a,i,s)}buildGraphFromOperationValue(t,i,n,s=this.EMPTY_PATH_ARRAY_VERTEX){const r=this.addVertex(i);this.addEdge(t,s,mn),this.addEdge(t,r,fs);const a=ch(i);a?this.buildGraphFromOperation(r,n,a,s):Vl(i)&&this.buildGraphFromObject(r,n,i,s)}buildDependencyGraph(){for(let t=0;t1&&!this.resolvedRootAncestorsPaths.has(r)){const a=this.findVertexAtPath([r]);if(a){this.resolveVertex(a,i,n);return}}if(this.userPartialOptions==null&&i===this.resolved&&s.length>0){const a=jt(i,s);if(a!=null&&!be(a))return}this.resolveVertexInEdgePriority(t,i,s,n),this.resolveVertexAutoEnable(t,i,s),this.resolveVertexChildren(t,i,n)}resolveVertexInEdgePriority(t,i,n,s){const r=this.neighboursWithEdgeValue(t,et),[a]=this.edgePriority;for(const o of this.edgePriority){const l=this.findNeighbour(t,o);if(l==null)continue;const c=this.resolveVertexValueInternal(t,l);if(!(c==null&&o!==a)&&!(r&&r.length>0&&o!==a)&&!(Array.isArray(s)&&s.includes(o))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&Ht.UNSAFE_CLEAR_KEYS.has(n.at(-1))),n.length===0){if(c==null)continue;this.resolved=c}else Sl(i,n,c);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,gs);if(n&&uh(n)){const s=this.neighboursWithEdgeValue(i,fs),r=hh[n],o=(typeof r=="function"?r:r.resolve)?.(this,t,s??[]);return o===_i?void 0:o}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,n){const s=this.neighboursWithEdgeValue(t,xC)?.[0];if(!s)return;const r=this.findVertexAtPath(n),a=this.findNeighbourValue(s,Ye),o=this.findNeighbourValue(s,Vi),l=this.findNeighbourValue(s,ni),h=r&&this.findNeighbour(r,ni)!=null?void 0:this.findNeighbourValue(s,_r);(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!a?._enabledFromTheme&&!o?._enabledFromTheme&&Sl(i,n,!0)}resolveVertexChildren(t,i,n){const s=this.neighboursWithEdgeValue(t,et);if(s){n??(n=this.findNeighbourValue(t,SC));for(const r of s){const a=this.getVertexValue(r);s.length>1&&uh(a)||a!=="_enabledFromTheme"&&this.resolveVertex(r,i,n)}}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,xl);if(i)for(const n of i)this.resolveVertex(n)}graftAndResolveChildren(t,i,n,s){const r=this.neighboursWithEdgeValue(t,et);if(r)for(const a of r){const o=this.getVertexValue(a),l=[...n,o],c=[...s,o],h=this.addVertex(o),u=this.findNeighbourValue(a,Ye);this.addEdge(i,h,et);const d=this.addVertex(l);if(this.addEdge(h,d,mn),oe(u)){this.buildGraphFromObject(h,Ye,u,d);const p=this.findNeighbour(h,Ye);this.addEdge(p,this.addVertex(l),mn);const g=this.findNeighbourValue(p,gs);if(uh(g)){const f=this.neighboursWithEdgeValue(p,fs),m=hh[g];(typeof m=="function"?void 0:m.dependencies)?.(this,p,f??[])}}this.graftAndResolveChildren(a,h,l,c)}}resolveValueOrSymbol(t){return typeof t=="symbol"&&this.internalParams?.has(t)?this.internalParams.get(t):t}snapshot(){Be("snapshot"),this.isRollingBack=!0}rollback(){Be(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let t=0;t0?r.join("."):"root";this.diagramNeighbours(t,a,i,n+1,s);let o=this.diagramKeys.get(a);o||(o=this.diagramKey(a),t.push(` ${o}["${i.value}"]`))}diagramNeighbours(t,i,n,s,r){for(const p of this.neighboursWithEdgeValue(n,et)??[]){const g=this.getPathArray(p),f=g.length>0?g.join("."):"root";s${l} ${this.diagramLabel(r,a,i)}`)}diagramChildWithNeighbours(t,i,n,s,r,a,o,l){this.diagramChild(t,i,n,s,r,a),this.diagramNeighbours(t,r,a,o+1,l)}};Br.EDGE_PRIORITY=[ni,Vi,Ye],Br.GRAFT_EDGE=Ye,Br.SHALLOW_KEYS=new Set(["context","data","topology"]),Br.COMPLEX_KEYS=["annotations","axes","series"],Br.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],Br.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),Br.valueCache=new Map;var wC=Br,kC=e=>`'${e}'`,Uy="__AXIS_ID_",Wa={top:"x",bottom:"x",left:"y",right:"y"},Ka=class Ft{constructor(t,i,n,s,r,a,o=!1,l){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=n??{};let c=null;t instanceof Ft?(c=t,this.specialOverrides=c.specialOverrides,a&&(this.userDeltaKeys=new Set(Object.keys(a))),a??(a=ss(c.userOptions,i,Ft.JSON_DIFF_OPTS)),this.userOptions=Ee(ql(a,c.userOptions),{...Ft.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Ee(t??i,{...Ft.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...s})),this.findSeriesWithUserVisiblity(i,a),o&&this.removeLeftoverSymbols(this.userOptions);const h=t instanceof Ft&&a?.data!==void 0&&a?.data?.length!==t.userOptions.data?.length;let u,d,p,g,f,m,y;if(!o&&this.seriesWithUserVisibility==null&&a!==void 0&&Ft.isFastPathDelta(a)&&c!=null&&!h?({activeTheme:u,processedOptions:d,fastDelta:p}=this.fastSetup(a,c),g=c.themeParameters,f=c.annotationThemes):(Ft.perfDebug("ChartOptions.slowSetup()"),{activeTheme:u,processedOptions:d,themeParameters:g,annotationThemes:f,googleFonts:m,optionsGraph:y}=this.slowSetup(n,a,o)),this.activeTheme=u,this.processedOptions=d,this.fastDelta=p??void 0,this.themeParameters=g,this.annotationThemes=f,this.googleFonts=m,this.optionsGraph=y,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const b=performance.now();this.optionsProcessingTime=b-l}he.inDevelopmentMode(()=>wi(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return Ft.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return Ft.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(t,i){for(const n of[t,i]){const s=n?.series;if(Array.isArray(s))for(let r=0;rax(n,i.series?.[s]??{}))?delete t.series:t.series=t.series.map((n,s)=>ql(n,i.series?.[s]??{})))}slowSetup(t,i,n=!1){let s=Ee(this.userOptions,Ft.OPTIONS_CLONE_OPTS_FAST);i&&(s=xe(i,s),n&&this.removeLeftoverSymbols(s));let r=DD(dp(s.theme));const{presetType:a}=this.optionMetadata;if(a!=null){const m=ee.getPresetModule(a);if(m){const{validate:y=Vt}=m,b=s,x=s.type,M=x==null?void 0:r.presets[x],{cleared:I,invalid:C}=y(b,m.options,"");for(const D of C)z.warn(D);Ur(C,"")?s={}:(Ft.debug(">>> AgCharts.createOrUpdate() - applying preset",I),s=m.create(I,M,()=>this.activeTheme),r=DD(dp(s.theme)))}}this.soloSeriesIntegrity(s),a!=null&&r.templateTheme(s,!1),AD(void 0,s);const o=this.validateSeriesOptions(s),l=Wc(s);if(this.chartDef=ee.getChartModule(l),!this.chartDef.placeholder){const{validate:m=Vt}=this.chartDef,{cleared:y,invalid:b}=m(s,this.chartDef.options,"");for(const x of b)z.warn(x);s=y}this.validateAxesOptions(s),this.removeDisabledOptions(s);let c=this.processFonts(r.params);c=this.processFonts(s,c),this.processSeriesOptions(s);const h=this.processAxesOptions(s,l),u=vF(r,s),d=u.resolve(),p=u.resolveParams(),g=u.resolveAnnotationThemes();u.clearSafe();const f=xe(t,d);return AD(this.chartDef.name,f),WP(this.chartDef.name,f,o),this.validateSeriesOptions(f),this.validateAxesOptions(f,h),this.validatePluginOptions(f),this.processMiniChartSeriesOptions(f),f.loadGoogleFonts||c.clear(),Ft.debug(()=>["ChartOptions.slowSetup() - processed options",Ee(f)]),{activeTheme:r,processedOptions:f,themeParameters:p,annotationThemes:g,googleFonts:c,optionsGraph:u}}validatePluginOptions(t){for(const i of ee.listModulesByType("plugin")){const n=i.name;if(n in t&&i.options!=null&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:s,invalid:r}=Vt(t[n],i.options,i.name);for(const a of r)z.warn(a);t[n]=s}}}validateSeriesOptions(t){const i=this.chartDef?.name,n=[],s=t.series?.length??0,r=[];let a;for(let o=0;om.type==="series"&&(g||!m.enterprise)&&(!i||m.chartType===i)).map(m=>m.name),"or",kC));const f=Pr.get(c.type);if(c.type!=null&&f?.type==="series"){r.push(f);continue}z.warn(c.type==null?`Option \`${l}.type\` is required and has not been provided; expecting ${a}, ignoring.`:`Unknown type \`${c.type}\` at \`${l}.type\`; expecting ${a}, ignoring.`);continue}else if(i&&h.chartType!==i){z.warn(`Series type \`${h.name}\` at \`${l}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}if(h.options==null){n.push(c);continue}const{validate:u=Vt}=h,{cleared:d,invalid:p}=u(c,h.options,l);for(const g of p)z.warn(g);Ur(p,l)||n.push(d)}return t.series=n,r}validateAxesOptions(t,i){if(!("axes"in t)||!t.axes)return;const n=this.chartDef?.name,s={};let r;for(const[a,o]of Dt(t.axes)){if(!o)continue;if(o.type==null){s[a]=o;continue}const l=`axes.${i?.get(a)??a}`,c=ee.getAxisModule(o.type);if(c==null){const p=ee.isEnterprise();r??(r=qs(Array.from(Pr.values()).filter(f=>f.type==="axis"&&(p||!f.enterprise)&&f.chartType===n).map(f=>f.name),"or",kC)),Pr.get(o.type)?.type!=="axis"&&z.warn(`Unknown type \`${o.type}\` at \`${l}.type\`; expecting one of ${r}, ignoring.`);continue}else if(c.chartType!==n){z.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${n}\`, ignoring.`);break}const{validate:h=Vt}=c,{cleared:u,invalid:d}=h(o,c.options,l);for(const p of d)z.warn(p);Ur(d,l)||(s[a]=u)}t.axes=s}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??ss(t.processedOptions,this.processedOptions,Ft.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.displayNullData,n=t.series?.map(s=>{const a=!!ee.getSeriesModule(s.type)?.options?.visible,o={};return a&&(o.visible=!0),i!==void 0&&s.allowNullKeys===void 0&&(o.allowNullKeys=i),xe(this.getSeriesGroupingOptions(s),s,o)});t.series=this.setSeriesGroupingOptions(n??[])}processAxesOptions(t,i){const n=i==="polar"?["angle","radius"]:["x","y"],s="axes"in t&&Object.keys(t.axes??{}).length>0,r=this.countNonDefaultSeriesAxisKeys(t,n),a=r>0,o=a&&r<(t?.series?.length??0),l=t.series?.[0],c=this.optionsType(t),h=this.predictAxes(c,n,l,t.data)??this.cloneDefaultAxes(c),u=oe(l)&&"direction"in l&&l.direction==="horizontal"&&ee.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!s&&!a&&!u){t.axes=h;return}const d="axes"in t?new Set(Object.keys(t.axes??{})):new Set,p=this.getPrimaryAxisKeys(t,n,d,a),g=this.getRemappedAxisKeys(d,p,n,o),f={},m=new Map;for(const[y,b]of g)f[b]="axes"in t?sa(t.axes?.[y]):void 0,m.set(b,y);return this.remapSeriesAxisKeys(t,n,f,g,h,o),this.predictAxesMissingTypesAndPositions(t,n,f,h),this.alternateSecondaryAxisPositions(t,f,m),t.axes=f,m}getSeriesDirectionAxisKey(t,i){const n=ee.getSeriesModule(t.type);return n?"direction"in t&&t.direction==="horizontal"&&n.axisKeysFlipped?n.axisKeysFlipped[i]:n.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(t,i){let n=0;for(const s of t.series??[])for(const r of i){const a=this.getSeriesDirectionAxisKey(s,r);!a||!zl(a,s)||s[a]!==r&&n++}return n}getPrimaryAxisKeys(t,i,n,s){const r=new Map;for(const a of i){let o=!1;if("axes"in t&&t.axes&&!(a in t.axes&&oe(t.axes[a])&&!("position"in t.axes[a]))){for(const[l,c]of Dt(t.axes))if("position"in c&&c.position&&a===Wa[c.position]){r.set(a,l),o=!0;break}}if(!o&&s)for(const l of t.series??[]){const c=this.getSeriesDirectionAxisKey(l,a);if(!c)continue;const h=l[c];if(!n.has(h)){if(!h){r.set(a,a);break}r.set(a,h);break}}}if(n.size===0||!("axes"in t)||!t.axes)return r;if(r.size===0)for(const a of i)a in t.axes&&r.set(a,a);if(r.size===0){for(const a of i)for(const[o,l]of Dt(t.axes))if(l.type?.startsWith(a)){r.set(a,o);break}}if(r.size===0&&(t.series?.length??0)>0)for(const a of i)for(const o of t.series){const l=this.getSeriesDirectionAxisKey(o,a);if(!l)continue;const c=o[l];if(n.has(c)){r.set(a,c);break}}if(r.size<2){const a=new Set(r.values());for(const[o,l]of Dt(t.axes))if(!(a.has(o)||"position"in l)){for(const c of i)if(!r.has(c)){r.set(c,o),a.add(o);break}if(r.size===2)break}}return r}getRemappedAxisKeys(t,i,n,s){const r=new Map;for(const[a,o]of i)r.set(o,a);for(const a of t)r.has(a)||r.set(a,`${Uy}${r.size}`);if(s)for(const a of n)r.has(a)||r.set(a,`${Uy}${r.size}`);return r}remapSeriesAxisKeys(t,i,n,s,r,a){for(const o of t.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(o,l);if(!c)continue;n[l]??(n[l]=sa(r[l]));let h=l;if(c in o){const u=o[c];s.has(u)?h=s.get(u):(h=`${Uy}${s.size}`,s.set(u,h),n[h]=sa(r[l]))}else s.has(l)&&a&&(h=s.get(l),n[h]??(n[h]=sa(r[l])));o[c]=h}}predictAxes(t,i,n,s){if(!n)return;const r=n?.data??s;if(!r?.length)return;const a=ee.getSeriesModule(t)?.predictAxis;if(!a)return;const o=new Map,l=mb(0,r.length-1,5);for(const c of l){const h=r[c];for(const u of i){const d=a(u,h,n);if(!o.has(u)){o.set(u,d);continue}const p=o.get(u);if(!(!d&&!p)){if(!d||!p)return;for(const g of Object.keys(p))if(p[g]!==d[g])return}}}for(const[c,h]of o)h||o.delete(c);if(o.size!==0){if(o.size===1){const[c]=o.values(),h=this.cloneDefaultAxes(t);return"position"in c?Yp(h,u=>"position"in u&&u.position===c.position?c:u):void 0}return Object.fromEntries(o)}}cloneDefaultAxes(t){const i=ee.getSeriesModule(t);return i?.defaultAxes?Ee(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(t,i,n,s){for(const[r,a]of Dt(n)){if(!be(a)||"type"in a&&"position"in a)continue;if(r in s){a.type??(a.type=s[r].type),a.position??(a.position=s[r].position);continue}this.predictAxisMissingTypeFromPosition(a,s)||(this.predictAxisMissingTypeAndPositionFromSeries(t,i,r,a,s),"type"in a||delete n[r])}}predictAxisMissingTypeFromPosition(t,i){if(!("position"in t)||!zl(t.position,Wa))return!1;for(const n of Object.values(i))if(zl(n.position,Wa)&&Wa[t.position]===Wa[n.position])return t.type=n.type,!0;for(const[n,s]of Dt(Wa))if(t.position!==n&&s===Wa[t.position])return t.type=i[s].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(t,i,n,s,r){for(const a of t.series??[])for(const o of i){const l=this.getSeriesDirectionAxisKey(a,o);if(!(!l||!zl(l,a))&&a[l]===n)return s.type??(s.type=r[o].type),s.position??(s.position=r[o].position),o==="y"}return!1}alternateSecondaryAxisPositions(t,i,n){let s=0,r=0;for(const[a,o]of Dt(i)){if(!be(o)||!("position"in o))continue;const l=n.get(a),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(o.position==="top"||o.position==="bottom"?(s+=1,s===2&&h==null&&(o.position="top")):(o.position==="left"||o.position==="right")&&(r+=1,r===2&&h==null&&(o.position="right")),s>1&&r>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:n,stackedByDefault:s=!1}=ee.getSeriesModule(t.type);t.grouped&&!i&&z.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!n&&z.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:r,stacked:a}=t;return a??(a=(s||t.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:n&&a,grouped:i&&r&&!(n&&a)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);Ft.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const n={},s=i.reduce((r,a)=>{var o;return a.groupType==="default"||(r[o=a.seriesType]??(r[o]=0),r[a.seriesType]+=a.groupType==="stack"?1:a.series.length),r},{});return i.flatMap(r=>{var a;switch(n[a=r.seriesType]??(n[a]=0),r.groupType){case"stack":{const o=n[r.seriesType]++;return r.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:r.groupId,groupIndex:o,groupCount:s[r.seriesType],stackIndex:c,stackCount:r.series.length}}))}case"group":return r.series.map(o=>Object.assign(o,{seriesGrouping:{groupId:r.groupId,groupIndex:n[r.seriesType]++,groupCount:s[r.seriesType],stackIndex:0,stackCount:0}}))}return r.series}).map(({stacked:r,grouped:a,...o})=>o)}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((n,s)=>{const r=s.type;if(!s.stacked&&!s.grouped)n.push({groupType:"default",seriesType:r,series:[s],groupId:"__default__"});else{const a=this.getSeriesGroupId(s);if(!i.has(a)){const l={groupType:s.stacked?"stack":"group",seriesType:r,series:[],groupId:a};i.set(a,l),n.push(l)}i.get(a).series.push(s)}return n},[])}soloSeriesIntegrity(t){if(!le(t.series))return;const i=s=>ee.getSeriesModule(s)?.solo??!1,n=t.series;if(n&&n.length>1&&n.some(s=>i(s.type))){const s=this.optionsType(t);if(i(s))z.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),t.series=n.slice(0,1);else{const{solo:r,nonSolo:a}=Ll(n,l=>i(l.type)?"solo":"nonSolo"),o=Sp(r.map(l=>l.type)).join(", ");z.warn(`Unable to mix these series types with the lead series type: ${o}`),t.series=a}}}static processFontOptions(t,i,n,s=new Set){if(typeof t=="object"&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const r=[];for(const a of t.fontFamily)typeof a=="object"&&"googleFont"in a?(r.push(a.googleFont),s?.add(a.googleFont)):r.push(a);t.fontFamily=r.join(", ")}else typeof t.fontFamily=="object"&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,s?.add(t.fontFamily));return s}processFonts(t,i=new Set){return gr(t,Ft.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){gr(t,Ft.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!oe(t)))for(const i of Object.keys(t)){const n=t[i];Bl(n)&&delete t[i]}}removeLeftoverSymbols(t){gr(t,Ft.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=Wn():bb(t.window),t.document==null?t.document=$r():yb(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}};Ka.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Ka.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},Ka.JSON_DIFF_OPTS=new Set(["data","localeText"]),Ka.perfDebug=he.create(!0,"perf"),Ka.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Ka.debug=he.create(!0,"opts");var dh=Ka,pp=he.create(!0,"opts"),zr="AG Charts - Chart was destroyed, cannot perform request.",ph=class{constructor(t,i,n){this.factoryApi=i,this.licenseManager=n,this.chart=t}async update(t){if(!this.chart)throw new Error(zr);return pp.group("AgChartInstance.update()",async()=>{const i=he.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(zr);return pp.group("AgChartInstance.updateDelta()",async()=>{const i=he.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(zr);const t=Ee(this.chart.getOptions(),dh.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(zr);return this.chart.waitForUpdate()}applyTransaction(t){const{chart:i}=this;if(!i)throw new Error(zr);if(t==null||typeof t!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:n,addIndex:s,remove:r,update:a}=t;if(n!=null&&!Array.isArray(n))throw new Error('AG Charts - transaction "add" must be an array.');if(s!=null){if(typeof s!="number"||!Number.isSafeInteger(s)||s<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(n==null||n.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(r!=null&&!Array.isArray(r))throw new Error('AG Charts - transaction "remove" must be an array.');if(a!=null&&!Array.isArray(a))throw new Error('AG Charts - transaction "update" must be an array.');return pp.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const o=i.data.deepClone();return o.addTransaction(t),o.commitPendingTransactions(),this.updateDelta({data:o.data})}return pp("transaction",t),this.chart?.applyTransaction(t)})}async download(t){if(!this.chart)throw new Error(zr);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(zr);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(zr);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){if(!this.chart)return;const{interactionManager:i,legendManager:n,zoomManager:s}=this.chart.ctx,r=this.getEnabledOriginators(),a=new Set(r);i.isState(2)||(a.has(n)&&a.has(s)?(a.delete(s),await this.setStateOriginators(t,Array.from(a)),await this.setStateOriginators(t,[s])):await this.setStateOriginators(t,r))}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,n={}){const s=n.width??i.width??i.ctx.scene.canvas.width,r=n.height??i.height??i.ctx.scene.canvas.height,a=t.getState(),o=i.chartOptions.specialOverrides.document??$r(),l={...i.chartOptions.processedOverrides,container:o.createElement("div"),width:s,height:r};n.width!=null&&n.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();if(ee.isEnterprise()){l.animation={enabled:!1};const m=this.licenseManager?.getWatermarkForegroundConfigForBrowser();m&&(l.foreground=m)}const h={...i.chartOptions.specialOverrides},u={...i.chartOptions.optionMetadata},d=await this.chart?.ctx.dataService.getData(),p=this.factoryApi.create(c,l,h,u,d);a.legend&&this.syncLegend(i,p,a),p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),await p.setState(a);const g={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};p.chart?.ctx.zoomManager.updateZoom(g,i.ctx.zoomManager.getZoom()),p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate();const f=[];for(const m of i.modulesManager.legends())f.push(m.legend.pagination?.currentPage??0);for(const m of p.chart.modulesManager.legends()){const y=f.shift()??0;m.legend.pagination&&m.legend.pagination.setPage(y)}return p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),p}syncLegend(t,i,n){const s=new Map;for(const[r,a]of t.series.entries()){const o=i.chart?.series[r];o&&s.set(a.id,o.id)}n.legend=n.legend?.map(r=>({...r,seriesId:s.get(r.seriesId??"")??r.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:n,chartTypeOriginator:s,zoomManager:r,legendManager:a},modulesManager:o}=this.chart,l=[];return"annotations"in t&&t.annotations?.enabled&&l.push(n),i.presetType==="price-volume"&&l.push(s),(t.navigator?.enabled||t.zoom?.enabled)&&l.push(r),o.isEnabled("legend")&&t.legend?.enabled!==!1&&l.push(a),l.push(this.chart.ctx.activeManager),l}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart?.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),await this.chart?.waitForUpdate()}};ph.chartInstances=new WeakMap,v([_t({oldValue(e){e.destroyed||(e.publicApi=void 0),ph.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,ph.chartInstances.set(e,this))}})],ph.prototype,"chart",2);var LC=ph,SF=1e3,Wy=class Hr{constructor(t,i,n,s,r,a=SF){this.name=t,this.buildItem=i,this.releaseItem=n,this.destroyItem=s,this.maxPoolSize=r,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(t,i,n,s,r){return this.pools.has(t)||this.pools.set(t,new Hr(t,i,n,s,r)),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),Hr.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):Hr.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 Hr.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.");Hr.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),Hr.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),n=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)[`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()}};Wy.pools=new Map,Wy.debug=he.create(!0,"pool");var MF=Wy,Us=he.create(!0,"opts"),Gr=class{static licenseCheck(e){if(e.withinStudio)return;let t=this.licenseManager;return this.licenseChecked||(t=Ys.licenseManager?.(e),this.licenseManager=t,t?.validateLicense(),this.licenseChecked=!0),t}static getLicenseDetails(e){return Ys.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return TC.getInstance(e)}static create(e,t){const i=he.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Us.group("AgCharts.create()",()=>{e=he.inDevelopmentMode(()=>wi(Ee(e)))??e,this.licenseCheck(e);const n=this.licenseCheck(e),s=TC.createOrUpdate({userOptions:e,licenseManager:n,optionsMetadata:t,apiStartTime:i});return n?.isDisplayWatermark()&&Ys.injectWatermark?.(s.chart.ctx.domManager,n.getWatermarkMessage()),s})}static createFinancialChart(e){return Us.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return Us.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return Us.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};Gr.licenseChecked=!1;var ys=class xh{static getInstance(t){const i=Pd.getInstance(t);return i?LC.chartInstances.get(i):void 0}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:n,licenseManager:s,processedOverrides:r=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:o=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:u}=t,d=Ys.styles==null?[]:[["ag-charts-enterprise",Ys.styles]];if(ee.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(` `));Us(()=>[">>> AgCharts.createOrUpdate() user options",Ee(n)]);const{presetType:p}=o;let g=n;Gr.optionsMutationFn&&g&&(g=Gr.optionsMutationFn(Ee(g,dh.OPTIONS_CLONE_OPTS_FAST),p),Us(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ee(g)]));const f=this.getPool(o);let m=!1,y,b=i?.chart;b==null&&f?.hasFree()&&(y=f.obtainFree(),b=y.item);const{document:x,window:M,styleContainer:I,skipCss:C,...D}=g??{},A=b?.getChartOptions(),k=new dh(A,D,r,{...a,document:x,window:M,styleContainer:I,skipCss:C},o,l,h,u);(b==null||Wc(k.processedOptions)!==Wc(b.chartOptions.processedOptions))&&(y?.release(),y=this.getPool(k.optionMetadata)?.obtain(k),y?b=y.item:(m=!0,b=xh.createChartInstance(k,b))),k.optionsGraph&&b.ctx.optionsGraphService.updateCallback((N,T,R)=>k.optionsGraph?.resolvePartial(N,T,R));for(const[N,T]of d)b.ctx.domManager.addStyles(N,T);return b.ctx.fontManager.updateFonts(k.googleFonts),c!=null&&b.ctx.dataService.restoreData(c),i==null?(i=new LC(b,xh.callbackApi,s),i.releaseChart=y?.release):(y||m)&&(i.releaseChart?.(),i.chart=b,i.releaseChart=y?.release),Us.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[b.id]=b),b.queuedUserOptions.push(k.userOptions),b.queuedChartOptions.push(k),b.requestFactoryUpdate(N=>{Us.group(">>>> Chart.applyOptions()",()=>{N.applyOptions(k);const T=N.queuedUserOptions.indexOf(k.userOptions)+1;N.queuedUserOptions.splice(0,T),N.queuedChartOptions.splice(0,T)})}),i}static updateUserDelta(t,i,n){i=Ee(i,dh.OPTIONS_CLONE_OPTS_FAST);const s=gr(i,xh.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Us(()=>[">>> AgCharts.updateUserDelta() user delta",Ee(i)]),xh.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:s,apiStartTime:n})}static createChartInstance(t,i){const n=i?.destroy({keepTransferableResources:!0}),s=Wc(t.processedOptions);return ee.getChartModule(s).create(t,n)}static getPool(t){if(t.pool===!0)return MF.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};ys.caretaker=new rg(qe),ys.callbackApi={caretaker:ys.caretaker,create(e,t,i,n,s){return ys.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:n,data:s})},update(e,t,i,n){return ys.createOrUpdate({userOptions:e,proxy:t,specialOverrides:i,apiStartTime:n})},updateUserDelta(e,t,i){return ys.updateUserDelta(e,t,i)}},ys.markRemovedProperties=(e,t,i,n)=>{let s=n??!1;if(typeof e!="object"||e==null)return s;for(const r of Ms(e))e[r]===void 0&&(Object.assign(e,{[r]:Symbol("UNSET")}),s||(s=!0));return s},ys.detachAndClear=e=>e.detachAndClear(),ys.destroy=e=>e.destroy();var TC=ys,NC={};Mi(NC,{APPROXIMATE_THRESHOLD:()=>e1,AbstractBarSeries:()=>zI,AbstractBarSeriesProperties:()=>ih,AggregationManager:()=>_d,AnchoredPopover:()=>zC,ApproximateOrdinalTimeScale:()=>TF,Arc:()=>bs,Axis:()=>Xf,AxisGroupZIndexMap:()=>SS,AxisInterval:()=>Ma,AxisLabel:()=>We,AxisTick:()=>Ia,BBox:()=>U,Background:()=>al,BandScale:()=>Fn,BaseToolbar:()=>Qy,Caption:()=>nt,CartesianAxis:()=>Rc,CartesianCrossLine:()=>oi,CartesianSeries:()=>Nr,CartesianSeriesNodeEvent:()=>wm,CartesianSeriesProperties:()=>Bn,CategoryAxis:()=>Pc,CategoryScale:()=>qo,Chart:()=>Pd,ChartAxes:()=>Md,ChartOptions:()=>dh,CollapseMode:()=>SI,ColorScale:()=>Oo,ContextMenuRegistry:()=>kM,ContinuousScale:()=>Re,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>sl,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>rl,DEFAULT_POLAR_DIRECTION_KEYS:()=>oD,DEFAULT_POLAR_DIRECTION_NAMES:()=>lD,DOMElementProxy:()=>Cd,DOMManager:()=>bM,DataController:()=>$M,DataModel:()=>pm,DataModelSeries:()=>Am,DataSet:()=>Hc,DiscreteTimeAxis:()=>aI,DraggablePopover:()=>GC,DropShadow:()=>us,ExtendedPath2D:()=>Eo,FillGradientDefaults:()=>Tr,FillImageDefaults:()=>zs,FillPatternDefaults:()=>Lt,FloatingToolbar:()=>FF,FormatManager:()=>Jo,Group:()=>ae,GroupWidget:()=>MM,HierarchyHighlightState:()=>OC,HierarchyNode:()=>IF,HierarchySeries:()=>DF,HierarchySeriesProperties:()=>jr,HighlightManager:()=>TM,HighlightProperties:()=>Bs,HighlightState:()=>rM,Image:()=>Il,InteractionManager:()=>V0,InteractionState:()=>F0,LARGEST_KEY_INTERVAL:()=>nM,Label:()=>Ji,LabelStyle:()=>qi,LayoutElement:()=>Rf,Line:()=>Xi,LinearScale:()=>Da,LogScale:()=>im,Marker:()=>kt,Menu:()=>NF,MercatorScale:()=>CF,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Vn,NativeWidget:()=>ll,NiceMode:()=>vS,Node:()=>Ns,OrdinalTimeScale:()=>Cr,PHASE_METADATA:()=>Oc,PanToBBoxScalingModeEnum:()=>RM,Path:()=>At,PointerEvents:()=>b0,PolarAxis:()=>qy,PolarSeries:()=>vy,QuadtreeNearest:()=>PS,RadialColumnShape:()=>jn,Range:()=>as,Rect:()=>wt,Rotatable:()=>Ro,RotatableText:()=>j0,SMALLEST_KEY_INTERVAL:()=>iM,Scalable:()=>Qu,ScalableGroup:()=>dT,Scene:()=>Td,Sector:()=>qt,SectorBox:()=>hD,SegmentedPath:()=>nm,Selection:()=>bt,Series:()=>$c,SeriesItemHighlightStyle:()=>Lr,SeriesMarker:()=>Si,SeriesNodeEvent:()=>Sd,SeriesNodePickMode:()=>hM,SeriesProperties:()=>_n,SeriesTooltip:()=>js,Shape:()=>fa,SliderWidget:()=>Vm,StopProperties:()=>Tf,SvgPath:()=>RC,Text:()=>Oi,TimeAxisParentLevel:()=>il,TimeScale:()=>el,Toolbar:()=>RF,ToolbarButtonWidget:()=>jC,ToolbarWidget:()=>Ld,TooltipManager:()=>Nd,Transformable:()=>Je,TransformableGroup:()=>Fo,TransformableText:()=>_o,Translatable:()=>Po,TranslatableGroup:()=>Yt,TranslatableSvgPath:()=>LF,UnitTimeScale:()=>Ar,ZoomManager:()=>jM,accumulativeValueProperty:()=>gm,addHitTestersToQuadtree:()=>Zd,adjustLabelPlacement:()=>hI,angleCategoryAxisOptionsDefs:()=>Ey,angleNumberAxisOptionsDefs:()=>wD,animationValidation:()=>Gc,annotationCalloutStylesDefs:()=>FD,annotationChannelTextDefs:()=>TD,annotationCommentStylesDefs:()=>VD,annotationCrossLineStyleDefs:()=>Ry,annotationDisjointChannelStyleDefs:()=>RD,annotationFibonacciStylesDefs:()=>Py,annotationLineStyleDefs:()=>lp,annotationLineTextDefs:()=>op,annotationMeasurerStylesDefs:()=>cp,annotationNoteStylesDefs:()=>_D,annotationOptionsDef:()=>yl,annotationParallelChannelStyleDefs:()=>PD,annotationQuickMeasurerStylesDefs:()=>BD,annotationShapeStylesDefs:()=>Fy,annotationTextStylesDef:()=>oh,boxPlotSeriesThemeableOptionsDef:()=>HD,buildResetPathFn:()=>ny,calculateDataDiff:()=>jI,calculateLabelTranslation:()=>kF,calculateSegments:()=>Yd,candlestickSeriesThemeableOptionsDef:()=>UD,checkCrisp:()=>GI,chordSeriesThemeableOptionsDef:()=>WD,clippedRoundRect:()=>id,collapsedStartingBarPosition:()=>nh,computeBarFocusBounds:()=>hy,computeMarkerFocusBounds:()=>Ud,coneFunnelSeriesThemeableOptionsDef:()=>KD,createDatumId:()=>Zt,diff:()=>bd,drawCorner:()=>wc,drawMarkerUnitPolygon:()=>kc,findNodeDatumInArray:()=>lM,findQuadtreeMatch:()=>Xd,fixNumericExtent:()=>Ri,fromToMotion:()=>xt,funnelSeriesThemeableOptionsDef:()=>YD,generateTicks:()=>NS,getColorStops:()=>C0,getCrossLineValue:()=>yS,getItemId:()=>xd,getItemStyles:()=>xm,getItemStylesPerItemId:()=>aO,getLabelStyles:()=>Na,getMarkerStyles:()=>Wd,getMissCount:()=>US,getRadialColumnWidth:()=>PC,getShapeFill:()=>H0,getShapeStyle:()=>Ff,groupAccumulativeValueProperty:()=>ka,hasDimmedOpacity:()=>Sm,heatmapSeriesThemeableOptionsDef:()=>ZD,initialStatePickedOptionsDef:()=>CM,interpolatePoints:()=>Jc,isTooltipValueMissing:()=>ba,keyProperty:()=>kr,makeSeriesTooltip:()=>Ea,mapLineBackgroundSeriesThemeableOptionsDef:()=>JD,mapLineSeriesThemeableOptionsDef:()=>qD,mapMarkerSeriesThemeableOptionsDef:()=>QD,mapShapeBackgroundSeriesThemeableOptionsDef:()=>tC,mapShapeSeriesThemeableOptionsDef:()=>eC,markerEnabled:()=>ey,markerFadeInAnimation:()=>Qc,markerSwipeScaleInAnimation:()=>Qm,midpointStartingBarPosition:()=>rP,minimumTimeAxisDatumGranularity:()=>FS,motion:()=>_F,nightingaleSeriesThemeableOptionsDef:()=>iC,normaliseGroupTo:()=>md,ohlcSeriesThemeableOptionsDef:()=>XD,ordinalTimeAxisOptionsDefs:()=>fl,pairUpSpans:()=>qc,pathFadeInAnimation:()=>iy,pathMotion:()=>Vd,pathSwipeInAnimation:()=>ty,plotAreaPathFill:()=>EI,plotInterpolatedLinePathStroke:()=>jd,plotLinePathStroke:()=>Xm,predictCartesianFinancialAxis:()=>YR,predictCartesianNonPrimitiveAxis:()=>th,prepareAreaFillAnimationFns:()=>RI,prepareBarAnimationFunctions:()=>sh,prepareLinePathPropertyAnimation:()=>qm,processedDataIsAnimatable:()=>gn,pyramidSeriesThemeableOptionsDef:()=>nC,radarAreaSeriesThemeableOptionsDef:()=>sC,radarLineSeriesThemeableOptionsDef:()=>rC,radialBarSeriesThemeableOptionsDef:()=>aC,radialColumnSeriesThemeableOptionsDef:()=>oC,radiusCategoryAxisOptionsDefs:()=>LD,radiusNumberAxisOptionsDefs:()=>kD,rangeAreaSeriesThemeableOptionsDef:()=>hC,rangeBarSeriesThemeableOptionsDef:()=>dC,resetAxisLabelSelectionFn:()=>ud,resetBarSelectionsDirect:()=>qd,resetBarSelectionsFn:()=>rh,resetLabelFn:()=>Oa,resetMarkerFn:()=>Hd,resetMarkerPositionFn:()=>eh,resetMarkerSelectionsDirect:()=>$d,resetMotion:()=>Gt,sankeySeriesThemeableOptionsDef:()=>pC,sectorBox:()=>uD,seriesLabelFadeInAnimation:()=>ht,seriesLabelFadeOutAnimation:()=>Bd,stackCartesianSeries:()=>dM,standaloneChartOptionsDefs:()=>cE,sunburstSeriesThemeableOptionsDef:()=>gC,toHierarchyHighlightString:()=>gh,toHighlightString:()=>nl,topologyChartOptionsDefs:()=>lE,trailingAccumulatedValueProperty:()=>UN,treemapSeriesThemeableOptionsDef:()=>fC,updateClipPath:()=>Kd,updateLabelNode:()=>cI,upsertNodeDatum:()=>gy,userInteraction:()=>AE,validateCrossLineValue:()=>bS,valueProperty:()=>Qe,visibleRangeIndices:()=>jc,waterfallSeriesThemeableOptionsDef:()=>mC});var OC=(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))(OC||{});function gh(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 jr=class extends _n{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Mt),this.strokes=Object.values(Hs)}};v([S],jr.prototype,"childrenKey",2),v([S],jr.prototype,"sizeKey",2),v([S],jr.prototype,"colorKey",2),v([S],jr.prototype,"colorName",2),v([S],jr.prototype,"fills",2),v([S],jr.prototype,"strokes",2),v([S],jr.prototype,"colorRange",2);var EC=class xp{constructor(t,i,n,s,r,a,o,l,c,h,u){this.series=t,this.itemId=i,this.datumIndex=n,this.datum=s,this.sizeValue=r,this.colorValue=a,this.sumSize=o,this.depth=l,this.parent=c,this.children=h,this.style=u,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=xp.Walk.PreOrder){i===xp.Walk.PreOrder&&t(this);for(const n of this.children)n.walk(t,i);i===xp.Walk.PostOrder&&t(this)}find(t){if(t(this))return this;for(const i of this.children){const n=i.find(t);if(n!=null)return n}}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};EC.Walk={PreOrder:0,PostOrder:1};var IF=EC,DF=class extends $c{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Oo,this.animationState=new hc("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(){this.data?.commitPendingTransactions();const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:n,colorRange:s}=this.properties;let r=0,a=1/0,o=-1/0;const l=(d,p,g)=>{const f=g.depth==null?0:g.depth+1,m=t==null?void 0:d[t],y=m==null||m.length===0;let b=i==null?void 0:d[i];Number.isFinite(b)?b=Math.max(b,0):b=y?1:0;const x=b;r=Math.max(r,f);const M=n==null?void 0:d[n];typeof M=="number"&&(a=Math.min(a,M),o=Math.max(o,M));const I=this.getItemStyle({datumIndex:p,datum:d,depth:f,colorValue:M},y,!1);return c(new e(this,Zt(p.join(";")),p,d,b,M,x,f,g,[],I),m)},c=(d,p)=>{const{datumIndex:g}=d;if(p)for(const[f,m]of p.entries()){const y=l(m,g.concat(f),d);d.children.push(y),d.sumSize+=y.sumSize}return d},h=c(new e(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),u=[a,o];this.colorScale.domain=at.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:n,ctx:{legendManager:s},visible:r}=this;return e==="gradient"&&t!=null&&i!=null?[{legendType:"gradient",enabled:r&&s.getItemEnabled({seriesId:n}),seriesId:n,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(Un(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=te(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:n}=e;let s=this.removeMeIndexPathForIndex(t);const r=s.reduce((l,c)=>l.children[c],this.rootNode);if(n>0&&r.hasChildren)s=[...s,0];else if(n<0&&s.length>1)s=s.slice(0,-1);else if(n===0&&i!==0){const l=r.parent.children.length-1;s=s.slice(),s[s.length-1]=te(0,s.at(-1)+i,l)}const a=s.reduce((l,c)=>l.children[c],this.rootNode),o=this.computeFocusBounds(this.datumSelection.at(t+1));if(o!=null)return{datum:a,datumIndex:this.removeMeIndexForIndexPath(s),otherIndex:a.depth,bounds:o,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){z.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 n=i.datumIndex?.[0],s=t.datumIndex?.[0];return n==null||s==null?0:n===s?3:4}getHierarchyHighlightStyles(e,t){switch(e){case 1:return xe(t.highlightedItem,t.highlightedBranch);case 3:return xe(t.unhighlightedItem,t.highlightedBranch);case 4:return t.unhighlightedBranch;default:return}}getHighlightStateString(e,t,i,n){if(!this.properties.highlight.enabled||i==null)return gh(0);const s=i.reduce((o,l)=>o?.children[l],this.rootNode),r=this.getActiveHighlightNode();if(s==null)return gh(0);const a=this.getHierarchyHighlightState(t??!1,r,s);return gh(a)}},gp=Math.PI/180,Ky=e=>e*gp,Yy=e=>-Math.log(Math.tan(Math.PI*.25+e*gp*.5)),Zy=e=>e/gp,Xy=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(gp*.5),CF=class lb extends Xu{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=lb.bounds(t)}static bounds(t){const[[i,n],[s,r]]=t,a=Ky(i),o=Yy(n),l=Ky(s),c=Yy(r);return new U(Math.min(a,l),Math.min(o,c),Math.abs(l-a),Math.abs(c-o))}static fixedScale(){return new lb([[Zy(0),Xy(0)],[Zy(1),Xy(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,n=1/0,s=-1/0,r=1/0;for(const a of t){const o=a.domain;for(const[l,c]of o)i=Math.min(l,i),n=Math.max(l,n),s=Math.min(c,s),r=Math.max(c,r)}return{domain:[[i,s],[n,r]],animatable:!0}}convert([t,i]){const[[n,s],[r,a]]=this.range,o=(r-n)/this.bounds.width,l=(a-s)/this.bounds.height;return[(Ky(t)-this.bounds.x)*o+n,(Yy(i)-this.bounds.y)*l+s]}invert([t,i]){const[[n,s],[r,a]]=this.range,o=(r-n)/this.bounds.width,l=(a-s)/this.bounds.height;return[Zy((t-n)/o+this.bounds.x),Xy((i-s)/l+this.bounds.y)]}getDomainMinMax(){return Ju(this.domain)}},qy=class extends Xf{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:n,regularFlipRotation:s}=this.calculateRotations();for(const r of this.crossLines)r.sideFlag=-e,r.direction=i===-Math.PI/2?"angle":"radius",r.parallelFlipRotation=n,r.regularFlipRotation=s,r.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(ud())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};v([S],qy.prototype,"shape",2),v([S],qy.prototype,"innerRadiusRatio",2);var AF={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}},wF={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 kF({yDirection:e,padding:t=0,position:i="top",bbox:n}){const s=e?AF:wF,{xTranslationDirection:r,yTranslationDirection:a}=s[i],o=r*(t+n.width/2),l=a*(t+n.height/2);return{xTranslation:o,yTranslation:l}}var RC=class extends At{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())}},LF=class extends Po(RC){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},TF=class hA extends Cr{static is(t){return t instanceof hA}setSourceScale(t){this._sourceScale=t;const i=s=>{Object.defineProperty(this,s,{get:()=>t[s],set:r=>{t[s]=r},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const n=s=>{Object.defineProperty(this,s,{get:()=>t[s],configurable:!0})};n("bandwidth"),n("step"),n("inset"),n("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 n=this.findIndex(t,i?.alignment);return n==null||n<0||n>=this.bands.length?Number.NaN:this.ordinalRange(n)}findIndex(t,i=0){if(t==null)return;const{bands:n,reversed:s}=this,r=n.length;if(r===0)return;if(r===1)return 0;const a=n[0],o=n[r-1];if(a==null||o==null)return this._sourceScale?.findIndex(t,i);const l=t.valueOf(),c=a.valueOf(),h=o.valueOf(),u=(l-c)/(h-c),d=s?(1-u)*(r-1):u*(r-1);return i===0?Math.max(0,Math.min(r-1,Math.floor(d))):Math.max(0,Math.min(r-1,Math.ceil(d)))}},Il=class extends Ns{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)}};v([Y()],Il.prototype,"x",2),v([Y()],Il.prototype,"y",2),v([Y()],Il.prototype,"width",2),v([Y()],Il.prototype,"height",2),v([Y()],Il.prototype,"opacity",2);var bs=class extends At{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 Di(yi(this.startAngle),yi(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 U(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)}};bs.className="Arc",v([Y()],bs.prototype,"centerX",2),v([Y()],bs.prototype,"centerY",2),v([Y()],bs.prototype,"radius",2),v([Y()],bs.prototype,"startAngle",2),v([Y()],bs.prototype,"endAngle",2),v([Y()],bs.prototype,"counterClockwise",2),v([Y()],bs.prototype,"type",2);function fp(e,t,i){const n=Math.hypot(e,t),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*n,y:Math.sin(r)*n}}var jn=class extends At{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),n=this.getRotation(),s=-e/2,r=e/2,a=-i,o=-t;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:p,y:g}=fp(d%2===0?s:r,d<2?a:o,n);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),u=Math.max(g,u)}return new U(l,c,h-l,u-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=vu(e,t);return yi(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,n]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=-e/2,r=e/2,a=-n,o=-i,l=this.getRotation(),c=[[s,o],[s,a],[r,a],[r,o]].map(([h,u])=>fp(h,u,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(tn||Math.hypot(o,l)>n;if(!u&&!d&&!p){this.updateRectangularPath();return}const g=u?this.calculateBothIntersections(a,o,s):null,f=d?this.calculateBothIntersections(a,o,r):null,m=p?this.calculateAxisOuterIntersections(a,o,n):null;if(u&&!g||d&&!f||p&&!m){this.updateRectangularPath();return}t.clear(!0);const y={left:a,right:o,top:l,bottom:c,rotation:h};g?this.moveToRotated(a,g.left.y,h):this.moveToRotated(a,c,h),g?t.arc(0,0,s,h+g.left.angle,h+g.right.angle,!1):this.lineToRotated(o,c,h),f?(this.lineToRotated(o,f.right.y,h),t.arc(0,0,r,h+f.right.angle,h+f.left.angle,!0)):m?this.renderTopWithCornerClipping(n,m,y):(this.lineToRotated(o,l,h),this.lineToRotated(a,l,h)),t.closePath()}};jn.className="RadialColumnShape",v([Y()],jn.prototype,"isBeveled",2),v([Y()],jn.prototype,"columnWidth",2),v([Y()],jn.prototype,"startAngle",2),v([Y()],jn.prototype,"endAngle",2),v([Y()],jn.prototype,"outerRadius",2),v([Y()],jn.prototype,"innerRadius",2),v([Y()],jn.prototype,"axisInnerRadius",2),v([Y()],jn.prototype,"axisOuterRadius",2);function PC(e,t,i,n,s){const r=vu(e,t),a=r*(1-n)/2;if(e+=a,t-=a,r<.001)return 2*i*s;if(r>=2*Math.PI){const p=e+r/2;e=p-Math.PI,t=p+Math.PI}const o=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),u=Math.floor(Math.hypot(o-c,l-h)),d=2*i*s;return Math.max(1,Math.min(d,u))}var Jy=class extends Rm{constructor(){super(me("div"),"menuitem")}},FC=class extends Rm{constructor(){super(me("div"),"menuitemradio")}setChecked(e){Se(this.elem,"aria-checked",e)}},VC=class uA extends Pm{constructor(t="vertical"){super(t,"menu"),this.handleMouseEnter=(i,n)=>{n.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,n)=>{n.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const t=this.elem.ownerDocument.createElement("div");return Se(t,"role","separator"),this.elem.appendChild(t),t}toggleChildEnabledByIndex(t,i){this.children.at(t)?.setEnabled(i)}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 Jy,i=new uA(this.orientation);i.id=oc();const n=()=>{this.collapseExpandedSubMenu(i),t.expandControlled()},s=r=>{const a=Qa(this.elem)?"ArrowLeft":"ArrowRight";rc(r.sourceEvent)&&r.sourceEvent.code===a&&(this.collapseExpandedSubMenu(i),t.expandControlled())};return t.setControlled(i),t.setAriaHasPopup("menu"),t.addListener("click",n),t.addListener("mouseenter",n),t.addListener("keydown",s),this.addChild(t),{subMenuButton:t,subMenu:i}}expandSubMenu(t,i){const{expansionScope:n}=this;n&&(this.collapseExpandedSubMenu(i),i?.expand(t))}collapseExpandedSubMenu(t){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=t)}getCloseKeys(){return Qa(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(t){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:Bg(t.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new tt};const i=this.expansionScope,n=this.children.map(s=>s.getElement());Se(i.lastFocus,"aria-expanded",!0),i.removers.register(ox(this.elem,i.abort),lx(this.elem,i.abort),...this.children.map(s=>Vg(s.getElement(),i.close,()=>this.getCloseKeys())),t?.overrideFocusVisible&&hx(this.elem,n,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:n,removers:s,expandedSubMenu:r}=this.expansionScope;this.expansionScope=void 0,r?.collapse({mode:"3"}),Se(n,"aria-expanded",!1),i==="0"&&n?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},_C="canvas-overlay",BC=class extends Ah{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.setOwnedWidget=(()=>{let n;return s=>{n?.destroy(),n=s}})(),this.moduleId=`popover-${t}`,i?.detached?this.element=me("div"):this.element=e.domManager.addChild(_C,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>e.domManager.removeChild(_C,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=me("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),t.minWidth!=null&&(e.style.minWidth=`${t.minWidth}px`),this.element.replaceChildren(e),e}showWidget(e,t,i){this.setOwnedWidget(t),this.initPopoverElement(t.getElement(),i),t.addListener("collapse-widget",()=>{this.hide(),e.setControlled(void 0),this.setOwnedWidget(void 0)}),e.setControlled(t),e.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}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 n=Bg(t.sourceEvent);n!==void 0&&(this.lastFocus=n,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",`${e.x}px`),e.y!=null&&t.style.setProperty("top",`${e.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},zC=class extends BC{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.updateAfterShow(i)}showWithChildren(e,t){const i=super.showWithChildren(e,t);return this.updateAfterShow(t),i}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,n=this.getPopoverElement();if(!e||!n)return;const s=t.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:a}=n,{isRtl:o}=t.domManager,l=o?e.x-r:e.x;let c=te(0,l,s.width-r),h=te(0,e.y,s.height-a);if(c!==l&&i?.x!=null){const u=o?i.x:i.x-r;c=te(0,u,s.width-r)}h!==e.y&&i?.y!=null&&(h=te(0,i.y-a,s.height-a)),this.updatePosition({x:c,y:h})}updateAfterShow(e){this.updateAnchor(e),this.ctx.agDocument.requestAnimationFrame(()=>{this.repositionWithinBounds()})}},NF=class extends zC{show(e,t){const i=new VC("vertical");for(const n of t.items)i.addChild(this.createRow(t,n,i));i.addClass("ag-charts-menu"),this.showWidget(e,i,t)}allocRow(e,t){if(e.menuItemRole==null||e.menuItemRole==="menuitem")return new Jy;{e.menuItemRole;const i=new FC;return i.setChecked(e.value===t.value),i}}createRow(e,t,i){const n=t.value===e.value,s=this.allocRow(e,t);if(t.enabled!=null&&s.setEnabled(t.enabled),s.addClass("ag-charts-menu__row"),s.toggleClass("ag-charts-menu__row--active",n),typeof t.value=="string"&&(s.getElement().dataset.popoverId=t.value),t.icon!=null){const a=me("span",`ag-charts-menu__icon ${Pl(t.icon)}`);s.getElement().appendChild(a)}const r=t.strokeWidth!=null;if(r&&(s.toggleClass("ag-charts-menu__row--stroke-width-visible",r),s.setCSSVariable("--strokeWidth",r?`${t.strokeWidth}px`:null)),t.label!=null){const a=me("span","ag-charts-menu__label");a.textContent=this.ctx.localeManager.t(t.label),s.getElement().appendChild(a)}return"altText"in t&&s.setAriaLabel(this.ctx.localeManager.t(t.altText)),s.addListener("click",({sourceEvent:a})=>{e.onPress?.(t),a.preventDefault(),a.stopPropagation(),i.collapse()}),s}},GC=class extends BC{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:ca.from(e.clientX,e.clientY),position:ca.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 n=ca.sub(ca.from(e.clientX,e.clientY),t.client),s=ca.add(t.position,n),r=this.ctx.domManager.getBoundingClientRect(),a={};s.x>=0&&s.x+i.offsetWidth<=r.width&&(a.x=s.x),s.y>=0&&s.y+i.offsetHeight<=r.height&&(a.y=s.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},OF={"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",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function EF(e){return typeof e!="string"?"false":OF[e]}var jC=class extends kd{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;if(e.tooltip){const s=t.t(e.tooltip);s!==this.lastTooltip&&(this.elem.title=s,this.lastTooltip=s)}let i="";if(e.icon!=null&&e.iconPosition!=="after"&&(i=``),e.label!=null){const s=t.t(e.label);i=`${i}${s}`}e.icon!=null&&e.iconPosition==="after"&&(i=`${i}`);const n=EF(e.value);n=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0)):(this.setAriaHasPopup(n),this.setAriaExpanded(!1)),i!==this.lastInnerHTML&&(this.elem.innerHTML=i,this.lastInnerHTML=i)}setChecked(e){Se(this.elem,"aria-checked",e)}},HC="ag-charts-toolbar__button--active",Qy=class extends Ld{constructor({eventsHub:e,localeManager:t},i,n){super(n),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new fS,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",n==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",n==="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,n]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,n)).update(n);for(let i=e.length;ithis.getButtonWidgetBounds(e))}getButtonWidget(e){return this.buttonWidgets.at(e)}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds(),n=e.getBoundingClientRect(),s=n.x-Math.floor(n.x),r=n.y-Math.floor(n.y);return new U(i.x+t.x+s,i.y+t.y+r,n.width,n.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,n,s;for(const[r,a]of e.entries())i=!t&&r===0||s!=a.section,n=r===e.length-1||a.section!=e.at(r+1)?.section,a.toggleClass("ag-charts-toolbar__button--first",i),a.toggleClass("ag-charts-toolbar__button--last",n),a.toggleClass("ag-charts-toolbar__button--group-first",r>0&&i),s=a.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",n=>{const s={index:e,...t instanceof ce?t.toJson():t},r=this.getButtonWidgetBounds(i),a={event:n,button:s,buttonBounds:r,buttonWidget:i};this.events.dispatch("button-pressed",a)}),i.addListener("focus",()=>{const n={button:{index:e}};this.events.dispatch("button-focused",n)}),i.addListener("expand-controlled-widget",n=>{this.expanded?.collapse({mode:"4"}),this.expanded=n.controlled;const s=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,s()})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},RF=class extends Qy{createButtonWidget(){return new jC(this.localeManager)}},PF=class extends GC{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 U(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const n=this.getPopoverElement();if(!n)return;const s=e.position??"above",{offsetWidth:r,offsetHeight:a}=n;let o=e.y-a-i,l=e.x-r/2;s==="below"?o=e.y+i:s==="right"?(o=e.y-a/2,l=e.x+t):s==="above-left"&&(l=e.x),this.updatePosition({x:l,y:o})}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(te(0,e.x,i.width-t.width)),e.y=Math.floor(te(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},FF=class extends Qy{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new PF(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new VF(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),n=this.dragHandle.getBounds();return new U(i.x+t.x-n.width,i.y+t.y,i.width,i.height)}},VF=class extends ll{constructor(e){super(me("div","ag-charts-floating-toolbar__drag-handle"));const t=new ll(me("span",`${Pl("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},_F={...lS,...hS},$C={};Mi($C,{ButtonWidget:()=>kd,MenuItemRadioWidget:()=>FC,MenuItemWidget:()=>Jy,MenuWidget:()=>VC,NativeWidget:()=>ll,SliderWidget:()=>Vm,ToolbarWidget:()=>Ld,Widget:()=>Er,WidgetEventUtil:()=>Or});var eb={};Mi(eb,{Arc:()=>bs,BBox:()=>U,Caption:()=>nt,CategoryScale:()=>qo,Group:()=>ae,Line:()=>Xi,LinearScale:()=>Da,Marker:()=>kt,Path:()=>At,RadialColumnShape:()=>jn,Rect:()=>wt,Scene:()=>Td,Sector:()=>qt,Shape:()=>fa,TranslatableGroup:()=>Yt,getRadialColumnWidth:()=>PC,toRadians:()=>$t});var tb={};Mi(tb,{AGGREGATION_INDEX_UNSET:()=>ec,AGGREGATION_INDEX_X_MAX:()=>kn,AGGREGATION_INDEX_X_MIN:()=>cn,AGGREGATION_INDEX_Y_MAX:()=>Tn,AGGREGATION_INDEX_Y_MIN:()=>Ln,AGGREGATION_MAX_POINTS:()=>Fw,AGGREGATION_MIN_RANGE:()=>cr,AGGREGATION_SPAN:()=>lr,AGGREGATION_THRESHOLD:()=>Ds,AbstractModuleInstance:()=>Ah,ActionOnSet:()=>_t,AdjacencyListGraph:()=>sx,AgDocument:()=>$v,AsyncAwaitQueue:()=>kg,BASE_FONT_SIZE:()=>ar,BREAK_TRANSFORM_CHAIN:()=>Wh,BaseProperties:()=>ce,Border:()=>ia,CANVAS_HEIGHT:()=>ik,CANVAS_TO_BUFFER_DEFAULTS:()=>nk,CANVAS_WIDTH:()=>tk,CARTESIAN_AXIS_TYPE:()=>Tv,CARTESIAN_POSITION:()=>Lv,CallbackCache:()=>Hv,ChangeDetectableProperties:()=>gf,ChartAxisDirection:()=>ag,ChartTheme:()=>zn,ChartUpdateType:()=>wn,CleanupRegistry:()=>tt,Color:()=>Te,ConfiguredCanvasMixin:()=>sk,DEFAULT_ANNOTATION_HANDLE_FILL:()=>hu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>pu,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>gu,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Ig,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Dg,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>uu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>du,DEFAULT_CAPTION_ALIGNMENT:()=>ur,DEFAULT_CAPTION_LAYOUT_STYLE:()=>hr,DEFAULT_FIBONACCI_STROKES:()=>Mg,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Li,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>ki,DEFAULT_POLAR_SERIES_STROKE:()=>ou,DEFAULT_SHADOW_COLOUR:()=>Qr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>lu,DEFAULT_TEXTBOX_COLOR:()=>yu,DEFAULT_TEXTBOX_FILL:()=>fu,DEFAULT_TEXTBOX_STROKE:()=>mu,DEFAULT_TEXT_ANNOTATION_COLOR:()=>cu,DEFAULT_TOOLBAR_POSITION:()=>tc,DIRECTION_SWAP_AXES:()=>Rv,Debug:()=>he,DebugMetrics:()=>Ks,DeclaredSceneChangeDetection:()=>ze,DeclaredSceneObjectChangeDetection:()=>Mc,Deprecated:()=>lk,DeprecatedAndRenamedTo:()=>ck,EllipsisChar:()=>Ja,ErrorType:()=>Xb,EventEmitter:()=>xs,FILL_GRADIENT_BLANK_DEFAULTS:()=>Dw,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>Lw,FILL_GRADIENT_LINEAR_DEFAULTS:()=>or,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>Cw,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>ww,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>Aw,FILL_GRADIENT_RADIAL_DEFAULTS:()=>iu,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Jl,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>Pv,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>kw,FILL_IMAGE_BLANK_DEFAULTS:()=>Rw,FILL_IMAGE_DEFAULTS:()=>Is,FILL_PATTERN_BLANK_DEFAULTS:()=>Nw,FILL_PATTERN_DEFAULTS:()=>Ui,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>Ow,FILL_PATTERN_KEYED_DEFAULTS:()=>Ew,FILL_PATTERN_SINGLE_DEFAULTS:()=>Tw,FONT_SIZE:()=>kv,FONT_SIZE_RATIO:()=>Zr,IS_DARK_THEME:()=>go,InterpolationProperties:()=>co,LABEL_BOXING_DEFAULTS:()=>ts,LEGEND_CONTAINER_THEME:()=>Fv,LRUCache:()=>Mh,LineSplitter:()=>Zs,Logger:()=>z,MARKER_SERIES_HIGHLIGHT_STYLE:()=>ng,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Ql,MementoCaretaker:()=>rg,ModuleRegistry:()=>ee,ModuleType:()=>ub,ObserveChanges:()=>ns,PALETTE_ALT_DOWN_FILL:()=>vg,PALETTE_ALT_DOWN_STROKE:()=>yg,PALETTE_ALT_NEUTRAL_FILL:()=>xg,PALETTE_ALT_NEUTRAL_STROKE:()=>Sg,PALETTE_ALT_UP_FILL:()=>bg,PALETTE_ALT_UP_STROKE:()=>mg,PALETTE_DOWN_FILL:()=>pg,PALETTE_DOWN_STROKE:()=>ug,PALETTE_NEUTRAL_FILL:()=>fg,PALETTE_NEUTRAL_STROKE:()=>gg,PALETTE_UP_FILL:()=>dg,PALETTE_UP_STROKE:()=>hg,PART_WHOLE_HIGHLIGHT_STYLE:()=>sg,POLAR_AXIS_SHAPE:()=>Ov,POLAR_AXIS_TYPE:()=>Nv,Padding:()=>ra,ParallelStateMachine:()=>Ck,PolarZIndexMap:()=>zv,PropertiesArray:()=>oo,Property:()=>S,ProxyOnWrite:()=>qw,ProxyProperty:()=>si,ProxyPropertyOnWrite:()=>ot,SAFE_FILLS_OPERATION:()=>Mw,SAFE_FILL_OPERATION:()=>Sw,SAFE_RANGE2_OPERATION:()=>Iw,SAFE_STROKE_FILL_OPERATION:()=>ig,SEGMENTATION_DEFAULTS:()=>su,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>Pw,SKIP_JS_BUILTINS:()=>Xp,ScaleAlignment:()=>db,SceneArrayChangeDetection:()=>mf,SceneChangeDetection:()=>Y,SceneObjectChangeDetection:()=>pa,SceneRefChangeDetection:()=>Wu,SeriesContentZIndexMap:()=>Bv,SeriesZIndexMap:()=>_v,SimpleCache:()=>ak,SpanJoin:()=>Kx,StateMachine:()=>hc,StateMachineProperty:()=>Dk,TRIPLE_EQ:()=>To,TextMeasurer:()=>Wg,TickIntervals:()=>Pu,TrimCharsRegex:()=>Pb,TrimEdgeGuard:()=>El,UNIT_MAX:()=>pf,UNIT_MIN:()=>df,UnknownError:()=>Oh,ValidationError:()=>Js,Vec2:()=>ca,Vec4:()=>ha,Vertex:()=>rx,WeakCache:()=>Zv,ZIndexMap:()=>Vv,addEscapeEventListener:()=>Vg,addFakeTransformToInstanceProperty:()=>S,addMouseCloseListener:()=>ox,addObserverToInstanceProperty:()=>Wp,addOverrideFocusVisibleEventListener:()=>hx,addTouchCloseListener:()=>lx,addTransformToInstanceProperty:()=>sr,aggregationBucketForDatum:()=>zw,aggregationDatumMatchesIndex:()=>Gw,aggregationDomain:()=>hn,aggregationIndexForXRatio:()=>au,aggregationRangeFittingPoints:()=>Cs,aggregationXRatioForDatumIndex:()=>po,aggregationXRatioForXValue:()=>un,and:()=>Ae,angleBetween:()=>vu,angularPadding:()=>wg,appendEllipsis:()=>Tp,applySkiaPatches:()=>rk,arcDistanceSquared:()=>hk,areScalingEqual:()=>da,array:()=>qn,arrayLength:()=>to,arrayOf:()=>ie,arrayOfDefs:()=>Et,arraysEqual:()=>Un,assignIfNotStrictlyEqual:()=>Qp,attachDescription:()=>fe,attachListener:()=>Fe,autoSizedLabelOptionsDefs:()=>nr,barHighlightOptionsDef:()=>Mn,bezier2DDistance:()=>zx,bezier2DExtrema:()=>Bx,boolean:()=>L,borderOptionsDef:()=>Wr,boxCollides:()=>Tg,boxContains:()=>xu,boxEmpty:()=>Jw,boxesEqual:()=>Su,buildDateFormatter:()=>Lo,cachedTextMeasurer:()=>bi,calcLineHeight:()=>Lp,calculatePlacement:()=>fx,callWithContext:()=>Nn,callback:()=>Ve,callbackDefs:()=>De,callbackOf:()=>mi,ceilTo:()=>nw,checkDatum:()=>Rx,circularSliceArray:()=>xn,clamp:()=>te,clampArray:()=>ho,clipLines:()=>xx,clipSpanX:()=>uf,collapseSpanToPoint:()=>Hu,collectAggregationLevels:()=>jw,color:()=>H,colorStopsOrderValidator:()=>Bp,colorUnion:()=>Ci,commonChartOptionsDefs:()=>se,commonSeriesOptionsDefs:()=>Cn,commonSeriesThemeableOptionsDefs:()=>Ie,compactAggregationIndices:()=>Jr,compareDates:()=>Ng,computeExtremesAggregation:()=>Gv,computeExtremesAggregationPartial:()=>Hw,constant:()=>_e,contextMenuItemsArray:()=>vv,countFractionDigits:()=>Rh,countLines:()=>Wb,createAggregationIndices:()=>As,createButton:()=>SL,createCanvasContext:()=>Kv,createCheckbox:()=>ML,createDeprecationWarning:()=>Rg,createElement:()=>me,createElementId:()=>oc,createIcon:()=>t0,createId:()=>Rn,createIdsGenerator:()=>af,createNumberFormatter:()=>_p,createSelect:()=>IL,createSvgElement:()=>lt,createTextArea:()=>DL,createTicks:()=>Do,date:()=>pi,dateToNumber:()=>Wt,dateTruncationForDomain:()=>rf,datesSortOrder:()=>Eg,debounce:()=>JA,decodeIntervalValue:()=>Cx,deepClone:()=>Ee,deepFreeze:()=>wi,defaultEpoch:()=>tf,defined:()=>pe,definedZoomState:()=>xc,diffArrays:()=>Xv,distribute:()=>mb,downloadUrl:()=>yx,dropFirstWhile:()=>gb,dropLastWhile:()=>fb,durationDay:()=>la,durationHour:()=>oa,durationMinute:()=>fr,durationMonth:()=>Xg,durationSecond:()=>bo,durationWeek:()=>Sx,durationYear:()=>uc,easeIn:()=>CL,easeInOut:()=>AL,easeInOutQuad:()=>LL,easeInQuad:()=>wL,easeOut:()=>Sc,easeOutQuad:()=>kL,encodedToTimestamp:()=>mr,enterpriseRegistry:()=>Ys,entries:()=>Dt,errorBarOptionsDefs:()=>$h,errorBarThemeableOptionsDefs:()=>Zl,estimateTickCount:()=>Ox,evaluateBezier:()=>wo,every:()=>Cv,expandLegendPosition:()=>ru,extent:()=>na,extractDecoratedProperties:()=>Iv,extractDomain:()=>wl,fillCssOptionsDef:()=>$i,fillGradientDefaults:()=>cv,fillImageDefaults:()=>uv,fillOptionsDef:()=>$,fillPatternDefaults:()=>hv,findMaxIndex:()=>En,findMaxValue:()=>Qw,findMinIndex:()=>fo,findMinMax:()=>Ct,findMinValue:()=>ek,findRangeExtent:()=>qr,first:()=>Ai,flush:()=>Tb,focusCursorAtEnd:()=>UA,fontFamilyFull:()=>Bh,fontOptionsDef:()=>Ce,fontWeight:()=>Wl,formatNumber:()=>Qv,formatObjectValidator:()=>xv,formatPercent:()=>qv,formatValue:()=>mo,fromPairs:()=>Av,generateUUID:()=>wu,geoJson:()=>nx,getAngleRatioRadians:()=>Uv,getAttribute:()=>ta,getChartTheme:()=>dp,getDOMMatrix:()=>Mp,getDocument:()=>$r,getElementBBox:()=>Vb,getIconClassNames:()=>Pl,getImage:()=>vb,getLastFocus:()=>Bg,getMaxInnerRectSize:()=>Cg,getMidpointsForIndices:()=>is,getMinOuterRectSize:()=>Uw,getOffscreenCanvas:()=>Ih,getPath:()=>Zp,getPath2D:()=>Tl,getPrevNextKeys:()=>ac,getResizeObserver:()=>xb,getSequentialColors:()=>Wi,getTickTimeInterval:()=>mc,getWindow:()=>Wn,googleFont:()=>jp,gradientColorStops:()=>Vh,gradientStrict:()=>_h,graphemeSegments:()=>Ss,greaterThan:()=>fi,groupBy:()=>Ll,guardTextEdges:()=>jb,hasNoModifiers:()=>rc,hasRequiredInPath:()=>Ur,highlightOptionsDef:()=>Gp,htmlElement:()=>Rp,inRange:()=>ev,initRovingTabIndex:()=>vk,insertListItemsSorted:()=>gx,instanceOf:()=>iw,interpolationOptionsDefs:()=>Uh,intervalAgo:()=>Ok,intervalCeil:()=>Mx,intervalEpoch:()=>gc,intervalExtent:()=>Jg,intervalFloor:()=>Ti,intervalHierarchy:()=>fc,intervalMilliseconds:()=>vi,intervalNext:()=>qg,intervalPrevious:()=>Ix,intervalRange:()=>Yi,intervalRangeCount:()=>Ru,intervalRangeNumeric:()=>Dx,intervalRangeStartIndex:()=>ef,intervalStep:()=>yr,intervalUnit:()=>Ls,inverseEaseOut:()=>n0,isArray:()=>le,isBetweenAngles:()=>dr,isBoolean:()=>Bb,isButtonClickEvent:()=>_g,isColor:()=>Gb,isContinuous:()=>_u,isDate:()=>Sn,isDecoratedObject:()=>Yh,isDefined:()=>Zn,isDenseInterval:()=>Ao,isDirectionRtl:()=>Qa,isDocumentFragment:()=>Mb,isElement:()=>Ip,isEmptyObject:()=>_l,isEnumKey:()=>KA,isEnumValue:()=>YA,isFiniteNumber:()=>Pe,isFunction:()=>Xn,isGradientFill:()=>Zi,isGradientFillArray:()=>uL,isGradientOrPatternFill:()=>dL,isHTMLElement:()=>Nl,isHtmlElement:()=>wp,isImageFill:()=>ua,isInputPending:()=>_b,isInteger:()=>tv,isKeyOf:()=>zl,isNegative:()=>io,isNode:()=>Dh,isNumber:()=>Hi,isNumberEqual:()=>Di,isNumberObject:()=>Ex,isObject:()=>oe,isObjectLike:()=>Vl,isObjectWithProperty:()=>wv,isObjectWithStringProperty:()=>xw,isPatternFill:()=>Ts,isPlainObject:()=>be,isPointLabelDatum:()=>jx,isProperties:()=>lo,isRegExp:()=>zb,isScaleValid:()=>vc,isSegmentTruncated:()=>Lh,isString:()=>rt,isStringFillArray:()=>Vx,isStringObject:()=>of,isSymbol:()=>Bl,isTextTruncated:()=>Xs,isTimeInterval:()=>Ek,isTimeIntervalUnit:()=>Rk,isTruncated:()=>$b,isUnitTimeCategoryScaling:()=>br,isValidDate:()=>Fl,isValidNumberFormat:()=>rv,iterate:()=>Kr,joinFormatted:()=>qs,jsonApply:()=>sc,jsonDiff:()=>ss,jsonPropertyCompare:()=>ax,jsonWalk:()=>gr,kebabCase:()=>Yb,labelBoxOptionsDef:()=>on,legendPositionValidator:()=>zh,lessThan:()=>gi,lessThanOrEqual:()=>Jb,levenshteinDistance:()=>Kb,lineDashOptionsDef:()=>W,lineDistanceSquared:()=>Mu,lineHighlightOptionsDef:()=>er,lineSegmentOptions:()=>pv,lineSegmentation:()=>gv,linear:()=>i0,linearGaugeSeriesOptionsDef:()=>Yr,linearGaugeSeriesThemeableOptionsDef:()=>Qh,linearGaugeTargetOptionsDef:()=>qh,linearPoints:()=>Yx,listDecoratedProperties:()=>rr,lowestGranularityForInterval:()=>yc,lowestGranularityUnitForTicks:()=>sf,lowestGranularityUnitForValue:()=>Vu,makeAccessibleClickListener:()=>xk,mapValues:()=>Yp,markerOptionsDefs:()=>An,markerStyleOptionsDefs:()=>ir,measureTextSegments:()=>ks,memo:()=>yo,merge:()=>ql,mergeArrayDefaults:()=>vw,mergeDefaults:()=>xe,modulus:()=>iv,multiSeriesHighlightOptionsDef:()=>at,nearestSquared:()=>ku,nearestSquaredInContainer:()=>Ik,nextPowerOf2:()=>uo,niceTicksDomain:()=>nf,normalisedExtentWithMetadata:()=>Iu,normalisedTimeExtentWithMetadata:()=>Du,normalizeAngle180:()=>bu,normalizeAngle360:()=>yi,normalizeAngle360FromDegrees:()=>ws,normalizeAngle360Inclusive:()=>Ww,number:()=>P,numberFormatValidator:()=>Dn,numberMin:()=>Fp,numberRange:()=>qb,object:()=>Qs,objectsEqual:()=>yt,objectsEqualWith:()=>Kp,optionsDefs:()=>it,or:()=>ne,padding:()=>Qn,paddingOptions:()=>fv,parseColor:()=>Fb,parseNumberFormat:()=>Ph,partialAssign:()=>Jp,pause:()=>Lg,pick:()=>Zh,placeLabels:()=>Hx,positiveNumber:()=>w,positiveNumberNonZero:()=>Jn,preserveArabicJoining:()=>Np,previousPowerOf2:()=>og,radialGaugeSeriesOptionsDef:()=>tu,radialGaugeSeriesThemeableOptionsDef:()=>eu,radialGaugeTargetOptionsDef:()=>Jh,range:()=>Fu,rangeValidator:()=>jh,ratio:()=>Z,readIntegratedWrappedValue:()=>lf,record:()=>Lb,required:()=>X,rescaleSpan:()=>ko,rescaleVisibleRange:()=>Nu,resetIds:()=>Sk,resolveOperation:()=>GF,rotatePoint:()=>Ag,roundTo:()=>Eh,safeCall:()=>Ep,seriesLabelOptionsDefs:()=>Oe,seriesTooltipRangeValidator:()=>yv,setAttribute:()=>Se,setAttributes:()=>ea,setDocument:()=>yb,setElementBBox:()=>wh,setElementStyle:()=>On,setElementStyles:()=>Wv,setPath:()=>qp,setWindow:()=>bb,shadowOptionsDefs:()=>es,shallowClone:()=>sa,shapeHighlightOptionsDef:()=>Ue,shapeSegmentOptions:()=>dv,shapeSegmentation:()=>so,shapeValidator:()=>tr,simpleMemorize:()=>Ut,simpleMemorize2:()=>cc,smoothPoints:()=>Xx,solveBezier:()=>ju,sortAndUniqueDates:()=>Og,sortBasedOnArray:()=>pb,spanRange:()=>xi,splitBezier2D:()=>bc,stepPoints:()=>Zx,stopPageScrolling:()=>dx,strictObjectKeys:()=>Ms,strictUnion:()=>Vp,string:()=>O,stringLength:()=>Pp,stringifyValue:()=>Gl,strokeOptionsDef:()=>_,textOrSegments:()=>ln,themeNames:()=>zF,themeOperator:()=>Ul,themeSymbols:()=>BF,themes:()=>Gy,throttle:()=>Op,tickFormat:()=>Fk,tickStep:()=>Co,timeInterval:()=>Yl,timeIntervalUnit:()=>ao,toArray:()=>kl,toDegrees:()=>Kw,toFontString:()=>kp,toIterable:()=>Dv,toPlainText:()=>Xe,toRadians:()=>$t,toTextString:()=>ft,toolbarButtonOptionsDefs:()=>ro,tooltipOptionsDefs:()=>we,tooltipOptionsDefsWithArea:()=>Mv,transformIntegratedCategoryValue:()=>Bu,truncateLine:()=>aa,typeUnion:()=>$l,undocumented:()=>J,unguardTextEdges:()=>Hb,union:()=>F,unionSymbol:()=>jl,unique:()=>Sp,validate:()=>Vt,withTimeout:()=>Yw,without:()=>K,wrapLines:()=>Yg,wrapText:()=>vx,wrapTextOrSegments:()=>Lu,wrapTextSegments:()=>Zg});var BF={DEFAULT_ANNOTATION_HANDLE_FILL:hu,DEFAULT_ANNOTATION_STATISTICS_COLOR:pu,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:gu,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:Ig,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:Dg,DEFAULT_ANNOTATION_STATISTICS_FILL:uu,DEFAULT_ANNOTATION_STATISTICS_STROKE:du,DEFAULT_CAPTION_ALIGNMENT:ur,DEFAULT_CAPTION_LAYOUT_STYLE:hr,DEFAULT_FIBONACCI_STROKES:Mg,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:Li,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:ki,DEFAULT_POLAR_SERIES_STROKE:ou,DEFAULT_SHADOW_COLOUR:Qr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:lu,DEFAULT_TEXTBOX_COLOR:yu,DEFAULT_TEXTBOX_FILL:fu,DEFAULT_TEXTBOX_STROKE:mu,DEFAULT_TEXT_ANNOTATION_COLOR:cu,DEFAULT_TOOLBAR_POSITION:tc,IS_DARK_THEME:go,PALETTE_ALT_DOWN_FILL:vg,PALETTE_ALT_DOWN_STROKE:yg,PALETTE_ALT_NEUTRAL_FILL:xg,PALETTE_ALT_NEUTRAL_STROKE:Sg,PALETTE_ALT_UP_FILL:bg,PALETTE_ALT_UP_STROKE:mg,PALETTE_DOWN_FILL:pg,PALETTE_DOWN_STROKE:ug,PALETTE_NEUTRAL_FILL:fg,PALETTE_NEUTRAL_STROKE:gg,PALETTE_UP_FILL:dg,PALETTE_UP_STROKE:hg},zF=Object.keys(Gy);function GF(e){const t=zn.getDefaultPublicParameters(),i=zn.getDefaultColors();return new wC({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var ib={};Mi(ib,{Color:()=>Te,interpolateColor:()=>cS});var jF={VERSION:qe,_Scene:eb,_Theme:tb,_Util:ib,create:Gr.create.bind(Gr),createSparkline:Gr.__createSparkline.bind(Gr),setup:()=>{ee.setRegistryMode(ee.RegistryMode.Integrated),ee.registerModules(Ty)},isEnterprise:!1};if(ee.registerModules(Ty),typeof $n.exports=="object"&&typeof Al=="object"){var HF=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,s)&&s!==i&&Object.defineProperty(e,s,{get:()=>t[s],enumerable:!(n=Object.getOwnPropertyDescriptor(t,s))||n.enumerable});return e};$n.exports=HF($n.exports,Al)}return $n.exports});