28 lines
1.1 MiB
Executable File
28 lines
1.1 MiB
Executable File
(function(ml,_n){typeof exports=="object"&&typeof module=="object"?module.exports=_n():typeof define=="function"&&define.amd?define("agCharts",[],_n):typeof exports=="object"?exports.agCharts=_n():ml.agCharts=_n()})(this,()=>{var ml={},_n={exports:ml};if(typeof vF>"u")var vF=function(t){throw new Error("Unknown module: "+t)};var dh=Object.defineProperty,tb=Object.getOwnPropertyDescriptor,YA=Object.getOwnPropertyNames,ZA=Object.prototype.hasOwnProperty,Si=(e,t)=>{for(var i in t)dh(e,i,{get:t[i],enumerable:!0})},XA=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of YA(t))!ZA.call(e,s)&&s!==i&&dh(e,s,{get:()=>t[s],enumerable:!(n=tb(t,s))||n.enumerable});return e},qA=e=>XA(dh({},"__esModule",{value:!0}),e),b=(e,t,i,n)=>{for(var s=n>1?void 0:n?tb(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&&dh(t,i,s),s},ib={};Si(ib,{AG_CHARTS_LOCALE_EN_US:()=>uM,AgCharts:()=>Rr,AgChartsCommunityModule:()=>yF,AgTooltipAnchorToType:()=>Db,AgTooltipPlacementType:()=>Ab,AllCartesianAxesModule:()=>KM,AllCartesianModule:()=>HI,AllCartesianSeriesModule:()=>jI,AllCommunityModule:()=>Sy,AllPolarModule:()=>nD,AreaSeriesModule:()=>DI,BarSeriesModule:()=>LI,BubbleSeriesModule:()=>RI,CartesianChartModule:()=>en,CategoryAxisModule:()=>PM,DonutSeriesModule:()=>tD,GroupedCategoryAxisModule:()=>GM,HistogramSeriesModule:()=>VI,LegendModule:()=>Tf,LineSeriesModule:()=>_I,LocaleModule:()=>Of,LogAxisModule:()=>jM,ModuleRegistry:()=>Q,NumberAxisModule:()=>HM,PieSeriesModule:()=>iD,PolarChartModule:()=>Yd,ScatterSeriesModule:()=>GI,SparklinePresetModule:()=>t0,TimeAxisModule:()=>$M,UnitTimeAxisModule:()=>WM,VERSION:()=>Xe,_ModuleSupport:()=>gA,_Scene:()=>Uy,_Theme:()=>Wy,_Util:()=>Ky,_Widget:()=>kA,time:()=>gP}),_n.exports=qA(ib);var nb=(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))(nb||{});function yl(e){return e.domain}var sb=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(sb||{}),ps=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()}},ph=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()}},ce={};Si(ce,{Time:()=>sC,check:()=>Ha,create:()=>bb,inDevelopmentMode:()=>vb});function bl(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function pp(e){return Array.from(new Set(e))}function vl(e,t){return e.reduce((i,n)=>{const s=t(n);return i[s]??(i[s]=[]),i[s].push(n),i},{})}function zn(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!zn(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function mn(e,t,i=0){if(e.length===0)return[];const n=[];for(let s=0;s<t;s++)n.push(e.at((s+i)%e.length));return n}function rb(e,t){const i=new Map;for(const[n,s]of t.entries())i.set(s,n);return e.sort((n,s)=>{const r=i.get(n)??1/0,a=i.get(s)??1/0;return r-a})}function ab(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const n=i;n!==0&&e.splice(0,n)}function ob(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const n=e.length-1-i;n!==0&&e.splice(e.length-n,n)}function lb(e,t,i){const n=[e],s=Math.round((t-e)/(i-1));if(s>0)for(let r=e+s;r<t&&!(n.push(r)>=i-1);r+=s);return n.push(t),n}var Mi={};typeof globalThis.window<"u"&&(Mi.window=globalThis.window),typeof document<"u"?Mi.document=document:typeof globalThis.global<"u"&&(Mi.document=globalThis.document);function Gi(e){return e?Mi.document?.[e]:Mi.document}function Me(e){return e?Mi.window?.[e]:Mi.window}function cb(e){Mi.document=e}function hb(e){Mi.window=e}function gh(){return Mi.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function xl(){return Mi.window?.Path2D??globalThis.Path2D}function gp(){return Mi.window?.DOMMatrix??globalThis.DOMMatrix}function ub(){return Mi.window?.Image??globalThis.Image}function fp(){return Mi.window?.ResizeObserver??globalThis.ResizeObserver}var db=1,JA=11;function fh(e){return e!=null&&typeof e.nodeType=="number"}function mp(e){return e!=null&&e.nodeType===db}function pb(e){return e!=null&&e.nodeType===JA}function Sl(e){return e!=null&&e.nodeType===db&&"style"in e}var _={};Si(_,{error:()=>gb,errorOnce:()=>eC,log:()=>mh,logGroup:()=>mb,reset:()=>tC,table:()=>QA,warn:()=>Gn,warnOnce:()=>Ii});var yp=new Set;function mh(...e){console.log(...e)}function Gn(e,...t){console.warn(`AG Charts - ${e}`,...t)}function gb(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function QA(...e){console.table(...e)}function fb(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}`;yp.has(s)||(i(e),yp.add(s))}function Ii(e,...t){fb(e,"Logger.warn",i=>Gn(i,...t))}function eC(e,...t){fb(e,"Logger.error",i=>gb(i,...t))}function tC(){yp.clear()}function mb(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var iC=2e3,yb=Date.now();function nC(){const e=Date.now()-yb;if(e>iC){const t=(Math.floor(e/100)/10).toFixed(1);mh(`**** ${t}s since last log message ****`)}yb=Date.now()}function bb(...e){return Object.assign((...i)=>{Ha(...e)&&(typeof i[0]=="function"&&(i=bl(i[0]())),nC(),mh(...i))},{check:()=>Ha(...e),group:(i,n)=>Ha(...e)?mb(i,n):n()})}function Ha(...e){return e.length===0&&e.push(!0),bl(Me("agChartsDebug")).some(i=>e.includes(i))}function vb(e){if(Ha("dev"))return e()}function sC(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)),mh(e,g),d}}}var Bs={};Si(Bs,{flush:()=>Sb,record:()=>xb});var bp=new Map;function xb(e,t){Ha("scene:stats:verbose")&&bp.set(e,t)}function Sb(){const e=Object.fromEntries(bp);return bp.clear(),e}var _s={},Q={};Si(Q,{RegistryMode:()=>Mb,getAxisModule:()=>hC,getChartModule:()=>uC,getPresetModule:()=>dC,getSeriesModule:()=>pC,hasModule:()=>oC,isEnterprise:()=>fC,isIntegrated:()=>mC,isModuleType:()=>$a,isUmd:()=>yC,listModules:()=>lC,listModulesByType:()=>cC,register:()=>vp,registerModules:()=>rC,reset:()=>aC,setRegistryMode:()=>gC});var Mb=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))(Mb||{}),Ml=new Set,jn=new Map;function Ib(e){if(jn.set(e.name,e),e.dependencies)for(const t of e.dependencies)vp(t)}function vp(e){const t=jn.get(e.name);if(!t){Ib(e);return}if(t.version===e.version){!t.enterprise&&e.enterprise&&Ib(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 rC(e){for(const t of e.flat())vp(t)}function aC(){Ml.clear(),jn.clear()}function oC(e){return jn.has(e)}function*lC(){for(const e of jn.values())yield e}function*cC(e){for(const t of jn.values())$a(e,t)&&(yield t)}function hC(e){const t=jn.get(e);if($a("axis",t))return t}function uC(e){const t=jn.get(e);if($a("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function dC(e){const t=jn.get(e);if($a("preset",t))return t}function pC(e){const t=jn.get(e);if($a("series",t))return t}function gC(e){Ml.add(e)}function fC(){return Ml.has("enterprise")}function mC(){return Ml.has("integrated")}function yC(){return Ml.has("umd")}function $a(e,t){return t?.type===e}var Qe=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)}},yh=class{constructor(){this.cleanup=new Qe}destroy(){this.cleanup.flush()}},bC=void 0,vC=void 0;vC=bC;var xC=void 0,SC=void 0;SC=xC;var Db=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(Db||{}),Ab=(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))(Ab||{}),MC=void 0,IC=void 0;IC=MC;var DC=void 0,AC=void 0;AC=DC;var Il="\u2026",zs=/\r?\n/g,Dl="\u200B",Cb=/[\s.,;:-]{1,5}$/,Al;function CC(e){if(Al==null){const i=Me("Option");Al=new i().style}Al.color=e;const t=Al.color||null;return Al.color="",t}function Hn(e){return e!=null}function ae(e){return Array.isArray(e)}function kb(e){return typeof e=="boolean"}function yn(e){return e instanceof Date}function bh(e){return yn(e)&&!Number.isNaN(Number(e))}function wb(e){return e instanceof RegExp}function $n(e){return typeof e=="function"}function le(e){return typeof e=="object"&&e!==null&&!ae(e)}function Cl(e){return ae(e)||xe(e)}function xe(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function kl(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function dt(e){return typeof e=="string"}function ji(e){return typeof e=="number"}function Be(e){return Number.isFinite(e)}function xp(e){return e!=null&&e.nodeType===1&&"style"in e}function kC(e,t){return dt(t)&&Object.keys(e).includes(t)}function wC(e,t){return Object.values(e).includes(t)}function wl(e){return typeof e=="symbol"}function Lb(e){return dt(e)&&(e==="none"||CC(e)!=null)}function Ll(e,t){return e in t}function Sp({fontSize:e,fontStyle:t,fontWeight:i,fontFamily:n}){let s="";return t&&t!=="normal"&&(s+=`${t} `),i&&i!=="normal"&&i!==400&&(s+=`${i} `),s+=`${e}px`,s+=` ${n}`,s}function Mp(e,t=1.15){return Math.round(e*t)}function pt(e){return String(e??"")}function Ip(e){return e.replace(Cb,"")+Il}function Tb(e){return Dl+e+Dl}function Nb(e){return e.replaceAll(Dl,"")}function Ob(e){return ae(e)?vh(e.at(-1)):Gs(pt(e))}function Gs(e){return e.endsWith(Il)}function vh(e){return pt(e?.text).endsWith(Il)}function js(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 Tl(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 Eb(e){let t=1;for(let i=0;i<e.length;i++)e.codePointAt(i)===10&&t++;return t}function Rb(e,t){if(e===t)return 0;const[i,n]=e.length<t.length?[e,t]:[t,e],s=i.length,r=n.length;let a=new Array(s+1).fill(0).map((l,c)=>c),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 Pb(e){return e.replaceAll(LC,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var LC=/[A-Z]+(?![a-z])|[A-Z]/g;function Ze(e,t=""){return e==null?t:ae(e)?e.map(i=>pt(i.text)).join(""):dt(e)?e:String(e)}function TC(e,t=0,i){const{leading:n=!1,trailing:s=!0,maxWait:r=1/0}=i??{};let a,o;if(r<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(n&&!o){o=Date.now(),a=setTimeout(()=>o=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 Dp(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 Ap(e,t,i=""){try{return e(...t)}catch(n){const s=i?` \`${i}\``:"";Ii(`Uncaught exception in user callback${s}`,n)}}var nn=Symbol("description"),Fb=Symbol("required"),xh=Symbol("marked"),Sh=Symbol("undocumented"),Nl=Symbol("union"),NC=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(n=>n!==i)));return e},new Map),Vb=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(Vb||{});function Ol(e,t){return Be(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var Hs=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?Ol(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 \`${Tl(i,50)}\`; expecting ${e}, ignoring.`}},Mh=class extends Hs{constructor(e,t,i,n){super("unknown",void 0,t,i,n),this.suggestions=e,this.key=n}getPrefix(){return`Unknown option \`${Ol(this.altPath??this.path,this.key)}\``}getPostfix(){const e=js(OC(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function Ft(e,t,i=""){if(!le(e))return{cleared:null,invalid:[new Hs("required","an object",e,i)]};const n={},s=[],r=new Set(Object.keys(e)),a=[];if(Nl in t){const o=Object.keys(t),l=t[Nl];if(e.type!=null&&o.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,u=Ft(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=js(o,"or",h=>`'${h}'`);s.push(new Hs("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[Fb],h=e[o];if(r.delete(o),h===void 0&&(l[Sh]||a.push(o),!c))continue;const u=Ol(i,o);if($n(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(_r(p.invalid,u))continue}else if(p){n[o]=h;continue}s.push(new Hs(c?"required":"invalid",l[nn],h,i,o))}else{const d=Ft(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 Mh(a,l,i,o))}return{cleared:n,invalid:s}}function OC(e,t,i=2){const n=e.toLowerCase(),s=NC.get(n);return t.filter(r=>{const a=r.toLowerCase();return s?.has(r)===!0||a.includes(n)||Rb(n,a)<=i})}function fe(e,t){if($n(e)){let n=function(s,r){return e(s,r)};var i=n;return n[nn]=t,n}else return{...e,[nn]:t}}function Z(e){return Object.assign($n(e)?(t,i)=>e(t,i):et(e),{[Fb]:!0,[nn]:e[nn]})}function J(e){return Object.assign($n(e)?(t,i)=>e(t,i):et(e),{[Sh]:!0,[nn]:e[nn]})}var et=(e,t="an object",i=!1)=>fe((n,s)=>{const r=Ft(n,e,s.path),a=!_r(r.invalid,s.path);return{valid:a,cleared:a||!i?r.cleared:null,invalid:r.invalid}},t),El=(e,t,i)=>({...e,[nn]:t,[Nl]: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}},js(e.filter(t=>!t[Sh]).map(t=>t[nn]).filter(Hn),"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},js(e.filter(t=>!t[Sh]).map(t=>t[nn]).filter(Hn),"or")),Ua=e=>Be(e)||bh(e),EC=e=>yn(e)||(Be(e)||dt(e))&&bh(new Date(e)),Un=fe(ae,"an array"),L=fe(kb,"a boolean"),ze=fe($n,"a function"),$=fe(Lb,"a color string"),fi=fe(EC,"a date"),ue=fe(Hn,"a defined value"),E=fe(Be,"a number"),$s=fe(le,"an object"),O=fe(dt,"a string"),Cp=fe(xp,"an html element"),Wa=(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=>ae(n)&&n.length>=e&&n.length<=t,i)},kp=(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=>dt(n)&&n.length>=e&&n.length<=t,i)},wp=(e,t=!0)=>fe(i=>Be(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),Bb=(e,t)=>fe(i=>Be(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),w=wp(0),Wn=wp(0,!1),X=Bb(0,1),mi=e=>fe((t,{options:i})=>!Ua(t)||!Ua(i[e])||t<i[e],`the value to be less than \`${e}\``),_b=e=>fe((t,{options:i})=>!Ua(t)||!Ua(i[e])||t<=i[e],`the value to be less than or equal to \`${e}\``),yi=e=>fe((t,{options:i})=>!Ua(t)||!Ua(i[e])||t>i[e],`the value to be greater than \`${e}\``);function P(...e){le(e[0])&&(e=Object.values(e[0]));const t=js(e,"or",i=>`'${i}'`);return fe(i=>e.includes(i),`a keyword such as ${t}`)}function zb(){return P}var Ge=e=>fe(t=>e===t,`the value ${JSON.stringify(e)}`),RC=(e,t)=>fe(i=>i instanceof e,t??`an instance of ${e.name}`),ee=(e,t,i=!0)=>fe((n,s)=>{if(!ae(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;c<n.length;c++){const h=n[c],u=e(h,{options:h,path:`${s.path}[${c}]`});typeof u=="object"?(l(u.valid),o.push(...u.invalid),u.cleared!=null&&a.push(u.cleared)):(l(u),u&&a.push(h))}return{valid:r,cleared:r||!i?a:null,invalid:o}},t??`${e[nn]} array`),Tt=(e,t="an object array")=>fe((i,n)=>{if(!ae(i))return!1;const s=[],r=[];for(let a=0;a<i.length;a++){const o=`${n.path}[${a}]`,l=Ft(i[a],e,o);_r(l.invalid,o)||s.push(l.cleared),r.push(...l.invalid)}return{valid:!0,cleared:s,invalid:r}},t),$t=(e,t)=>fe((i,n)=>{if(!$n(i))return!1;if(xh in i)return!0;const s=t??e[nn];return{valid:!0,cleared:Object.assign((...a)=>{const o=Ap(i,a);if(o==null)return;const l=e(o,{options:o,path:""});if(typeof l=="object"){if(Gb(l,n,s,o),l.valid)return l.cleared}else{if(l)return o;Ii(`Callback \`${n.path}\` returned an invalid value \`${Tl(o,50)}\`; expecting ${s}, ignoring.`)}},{[xh]:!0}),invalid:[]}},"a function"),Ie=(e,t="an object")=>fe((i,n)=>{if(!$n(i))return!1;if(xh in i)return!0;const s=t;return{valid:!0,cleared:Object.assign((...a)=>{const o=Ap(i,a,n.path);if(o==null)return;const l=Ft(o,e);return Gb(l,n,s,o),l.cleared},{[xh]:!0}),invalid:[]}},"a function");function _r(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function Gb(e,t,i,n){if(e.invalid.length!==0){if(ae(n)){const s=i??e.invalid[0]?.description??"a valid value";return Ii(`Callback \`${t.path}\` returned an invalid value \`${Tl(n,50)}\`; expecting ${s}, ignoring.`)}for(const s of e.invalid){if(s instanceof Mh)return Ii(`Callback \`${t.path}\` returned an unknown property \`${Ol(s.path,s.key)}\`${s.getPostfix()}`);const r=Tl(s.value,50);Ii(s.key?`Callback \`${t.path}\` returned an invalid property \`${Ol(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 jb(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)<i}function Ka(e){return Math.sign(e)===-1||Object.is(e,-0)}function Hb(e){return e%1===0}function Ih(e,t=2){const i=10**t;return Math.round(e*i)/i}function PC(e,t=2){const i=10**t;return Math.ceil(e*i)/i}function $b(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function Dh(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=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 Ub=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,Wb=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function Kb(e){if(!dt(e))return!1;const t=Wb.exec(e);return Ub.test(t?t[2]:e)}function Ah(e){let t,i;const n=Wb.exec(e);n&&([,t,e,i]=n);const s=Ub.exec(e);if(!s){Ii(`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 Lp(e){const t=typeof e=="string"?Ah(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=sn.g,p=!0;else if(c in sn&&c in Ya)f=g?Ya[c]:sn[c];else if(c in sn)f=sn[c];else if(c in Ya)f=Ya[c];else throw new Error(`The number formatter type is invalid: ${c}`);const y=c?6:12;let m;g||(m=d);let v=n,x=i;return a&&(x??(x="0"),v??(v="=")),(M,D)=>{let A;m!=null?A=m:c==="f"||c==="%"?A=D??y:c?A=y:A=D??y;let I=f(M,A);p&&(I=BC(I)),l&&(I=_C(I,l));const k=HC(r,c),C=k?.length??0;k&&(I=`${k}${I}`),c==="s"&&(I=`${I}${zC(M)}`),(c==="%"||c==="p")&&(I=`${I}%`);const{value:T,prefixLength:N}=GC(M,I,s),R=N+C;let F=T;return o!=null&&!Number.isNaN(o)&&(F=jC(F,o,x??" ",v,R)),F=`${h}${F}${u}`,F}}var Ya={b:e=>Ch(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Ch(e).toString(8),x:e=>Ch(e).toString(16),X:e=>Ya.x(e).toUpperCase(),n:e=>Ya.d(e),"%":e=>`${Ch(e*100).toFixed(0)}`},sn={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>sn.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>sn.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&&n<t?i.toFixed(t-1-n):i.toExponential(t-1)},G:(e,t)=>sn.g(e,t).toUpperCase(),n:(e,t)=>sn.g(e,t),p:(e,t)=>sn.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=Xb(e);return sn.r(e/10**i,t)},"%":(e,t)=>sn.f(e*100,t)},Yb=-24,Zb=24,FC={[Yb]:"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",[Zb]:"Y"},VC="\u2212";function Ch(e){return Math.floor(Math.abs(e))}function BC(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 _C(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 zC(e){return FC[Xb(e)]}function Xb(e){return te(Yb,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,Zb)}function GC(e,t,i=""){if(i==="(")return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let n="";return e<0?n=VC:i==="+"?n="+":i===" "&&(n=" "),{value:`${n}${t}`,prefixLength:n.length}}function jC(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 HC(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 Rl=e=>{if(!le(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},$C=et({color:$,stop:X},""),Tp=fe(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop<t)return!1;t=i.stop}return!0},"colour stops to be defined in ascending order"),kh=Ae(Wa(2),ee($C),Tp),Np=P("axis","item","series"),UC={type:Z(Ge("gradient")),colorStops:Z(kh),rotation:E,gradient:J(P("linear","radial","conic")),bounds:J(Np),reverse:J(L),colorSpace:J(P("rgb","oklch"))},wh=et(UC,"a gradient object with colour stops"),B={stroke:$,strokeWidth:w,strokeOpacity:X},qb=et({type:Z(Ge("gradient")),gradient:Z(P("linear","radial","conic")),bounds:Z(Np),colorStops:Z(ne(kh,Ae(Wa(2),ee($)))),rotation:Z(E),reverse:Z(L),colorSpace:Z(P("rgb","oklch"))}),Jb=et({type:Z(Ge("pattern")),pattern:Z(P("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:kp(2),width:Z(w),height:Z(w),fill:Z($),fillOpacity:Z(X),backgroundFill:Z($),backgroundFillOpacity:Z(X),padding:Z(w),rotation:Z(E),scale:Z(w),stroke:Z($),strokeWidth:Z(w),strokeOpacity:Z(X)}),Qb=et({type:Z(Ge("image")),url:O,width:w,height:w,rotation:Z(E),backgroundFill:Z($),backgroundFillOpacity:X,fit:Z(P("stretch","contain","cover")),repeat:Z(P("repeat","repeat-x","repeat-y","no-repeat"))}),WC={gradient:{colorStops:kh,rotation:E,gradient:J(P("linear","radial","conic")),bounds:J(Np),reverse:J(L),colorSpace:J(P("rgb","oklch"))},pattern:{pattern:P("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:kp(2),width:w,height:w,rotation:E,scale:w,fill:$,fillOpacity:X,backgroundFill:$,backgroundFillOpacity:X,...B,padding:J(w)},image:{url:Z(O),backgroundFill:$,backgroundFillOpacity:X,width:w,height:w,fit:P("stretch","contain","cover","none"),repeat:P("repeat","repeat-x","repeat-y","no-repeat"),rotation:E}},KC=El(WC,"a color object"),Ai=ne($,et(KC,"a color object")),j={fill:Ai,fillOpacity:X};j.fillGradientDefaults=J(qb),j.fillPatternDefaults=J(Jb),j.fillImageDefaults=J(Qb);var W={lineDash:ee(w),lineDashOffset:E},bn={...j,...B,...W,opacity:X,cornerRadius:w},Us={...B,...W,opacity:X},We={...j,...B,...W,opacity:X};function Op(e){return{enabled:L,range:P("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function st(e,t){return{enabled:L,range:P("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t,bringToFront:L}}var ev={start:ue,stop:ue,...B,...j,...W},tv={start:ue,stop:ue,...B,...W},Za=et({enabled:L,key:Z(P("x","y")),segments:Tt(ev,"path segments array")},"a segmentation object",!0),iv=et({enabled:L,key:Z(P("x","y")),segments:Tt(tv,"path segments array")},"a segmentation object",!0),Ep=et({googleFont:O},"google font"),Lh=ne(O,Rl,Ep,ee(ne(O,Ep))),Pl=ne(w,P("normal","bold","bolder","lighter")),Ce={color:$,fontFamily:Lh,fontSize:w,fontStyle:P("normal","italic","oblique"),fontWeight:Pl},nv=et({top:E,right:E,bottom:E,left:E},"padding object"),Xa=ne(E,nv),zr={enabled:L,stroke:$,strokeWidth:w,strokeOpacity:X},rn={border:zr,cornerRadius:E,padding:Xa,...j},Rp=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],YC={floating:L,placement:P(...Rp),xOffset:E,yOffset:E},Th=fe((e,t)=>{let i;if(typeof e=="string")Rp.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Hs("invalid",`a legend placement string: ["${Rp.join('", "')}"]`,e,t.path)));else{const{cleared:n,invalid:s}=Ft(e,YC);i={valid:s.length===0,cleared:n,invalid:s}}return i},"a legend position object or placement string"),Ws=ne(P("circle","cross","diamond","heart","plus","pin","square","star","triangle"),ze),sv=P("never","always","hyphenate","on-space"),Nh=P("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Oh=ne(w,P("exact","nearest","area")),rv=ne(w,P("exact","nearest")),ai=ne(O,E,fi,Tt({text:Z(O),...Ce},"text segments array")),Eh={enabled:L,text:ai,textAlign:P("left","center","right"),wrapping:P("never","always","hyphenate","on-space"),spacing:w,maxWidth:w,maxHeight:w,...Ce};Eh.padding=J(w);var Rh={enabled:L,text:ai,renderer:$t(ne(O,Cp))},Pp=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],av={type:P("action","separator"),showOn:P("always","series-area","series-node","legend-item"),label:Z(O),enabled:L,action:ze,items:(e,t)=>ov(e,t)};av.iconUrl=J(O);var ZC=et(av),XC=fe((e,t)=>{let i;return typeof e=="string"?Pp.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Hs("invalid",`a context menu item string alias: ["${Pp.join('", "')}"]`,e,t.path))):i=ZC(e,t),i},`a context menu item object or string alias: [${Pp.join(", ")}]`),ov=ee(XC,"a menu items array",!1),qa={label:O,ariaLabel:O,tooltip:O,icon:P("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},vn=ne(O,$t(ai)),lv=et({x:vn,y:vn,angle:vn,radius:vn,size:vn,color:vn,label:vn,secondaryLabel:vn,sectorLabel:vn,calloutLabel:vn,legendItem:vn}),xn=fe(Kb,"a valid number format string"),se={width:w,height:w,minWidth:w,minHeight:w,suppressFieldDotNotation:L,title:Eh,subtitle:Eh,footnote:Eh,padding:{top:w,right:w,bottom:w,left:w},seriesArea:{border:zr,clip:L,cornerRadius:E,padding:Xa},legend:{enabled:L,position:Th,orientation:P("horizontal","vertical"),maxWidth:w,maxHeight:w,spacing:w,border:zr,cornerRadius:E,padding:Xa,fill:Ai,fillOpacity:X,preventHidingAll:L,reverseOrder:L,toggleSeries:L,item:{marker:{size:w,shape:Ws,padding:w,strokeWidth:w},line:{length:w,strokeWidth:w},label:{maxLength:w,formatter:ze,...Ce},maxWidth:w,paddingX:w,paddingY:w,showSeriesStroke:L},pagination:{marker:{size:w,shape:Ws,padding:w},activeStyle:{...j,...B},inactiveStyle:{...j,...B},highlightStyle:{...j,...B},label:Ce},listeners:{legendItemClick:ze,legendItemDoubleClick:ze}},gradientLegend:{enabled:L,position:Th,spacing:w,reverseOrder:L,border:zr,cornerRadius:E,padding:Xa,fill:Ai,fillOpacity:X,gradient:{preferredLength:w,thickness:w},scale:{label:{...Ce,minSpacing:w,format:xn,formatter:ze},padding:w,interval:{step:E,values:Un,minSpacing:Ae(w,mi("maxSpacing")),maxSpacing:Ae(w,yi("minSpacing"))}}},listeners:{seriesNodeClick:ze,seriesNodeDoubleClick:ze,seriesVisibilityChange:ze,activeChange:ze,click:ze,doubleClick:ze,annotations:ze,zoom:ze},loadGoogleFonts:L,highlight:{drawingMode:P("overlay","cutout"),range:P("tooltip","node")},overlays:{loading:Rh,noData:Rh,noVisibleSeries:Rh,unsupportedBrowser:Rh},tooltip:{enabled:L,showArrow:L,pagination:L,delay:w,range:Oh,wrapping:sv,mode:P("single","shared","compact"),position:{anchorTo:P("pointer","node","chart"),placement:ne(Nh,ee(Nh)),xOffset:E,yOffset:E}},animation:ue,contextMenu:ue,context:()=>!0,dataSource:{getData:ze},keyboard:{enabled:L,tabIndex:E},touch:{dragAction:P("none","drag","hover")},ranges:{enabled:L,buttons:Tt({...qa,value:ne(E,Ae(ee(ne(E,fi)),Wa(2,2)),ze)},"range button options array")},locale:{localeText:$s,getLocaleText:$t(O)},background:{visible:L,fill:$,image:{url:Z(O),top:E,right:E,bottom:E,left:E,width:w,height:w,opacity:X}},styleNonce:O,sync:ue,zoom:ue,scrollbar:ue,formatter:ne($t(ai),lv)};se.flashOnUpdate=J(ue),se.dataSource.requestThrottle=J(w),se.dataSource.updateThrottle=J(w),se.dataSource.updateDuringInteraction=J(L),se.statusBar=J(ue),se.foreground=J({visible:L,text:O,image:{url:O,top:E,right:E,bottom:E,left:E,width:w,height:w,opacity:X},...j}),se.overrideDevicePixelRatio=J(E),se.sync.domainMode=J(P("direction","position","key")),se.displayNullData=J(L);var Se={cursor:O,context:()=>!0,showInLegend:L,nodeClickRange:Oh,listeners:{seriesNodeClick:ze,seriesNodeDoubleClick:ze},highlight:Op(We)};Se.allowNullKeys=J(L);var Sn={...Se,id:O,visible:L,context:()=>!0,data:Un};Sn.seriesGrouping=J(ue);var Ks={shape:Ws,size:w,...j,...B,...W},Mn={enabled:L,itemStyler:Ie({...j,...B,...W,shape:Ws,size:w}),...Ks},Pe={enabled:L,formatter:$t(ai),format:xn,itemStyler:Ie({enabled:L,...rn,...Ce}),...rn,...Ce},Ys={...Pe,lineHeight:w,minimumFontSize:w,wrapping:sv,overflowStrategy:P("ellipsis","hide")},Fl={visible:L,cap:{visible:L,length:w,lengthRatio:X,...B,...W},...B,...W},Ph={...Fl,xLowerKey:O,xUpperKey:O,yLowerKey:O,yUpperKey:O,xLowerName:O,xUpperName:O,yLowerName:O,yUpperName:O,itemStyler:Ie({visible:L,...B,...W,cap:{visible:L,length:w,lengthRatio:X,...B,...W}})},ke={enabled:L,showArrow:L,range:rv,renderer:$t(ne(O,E,fi,et({heading:O,title:O,symbol:{marker:{enabled:L,shape:Ws,...j,stroke:$,strokeOpacity:X,strokeWidth:w,...W},line:{enabled:L,stroke:$,strokeWidth:w,strokeOpacity:X,...W}},data:Tt({label:Z(O),value:Z(ne(O,E,fi))})},"tooltip renderer result object"))),position:{anchorTo:P("node","pointer","chart"),placement:ne(Nh,ee(Nh)),xOffset:E,yOffset:E},interaction:{enabled:L}},cv={...ke,range:Oh},Kn={enabled:L,xOffset:E,yOffset:E,blur:w,color:$},Fh=El({linear:{},smooth:{tension:X},step:{position:P("start","middle","end")}},"interpolation line options"),Vh=Symbol("BREAK"),Vl="__decorator_config",Bh="__decorator_accessors";function S(e,t){Fp(e,t).optional=!0}function Fp(e,t){if(Object.getOwnPropertyDescriptor(e,Vl)==null&&Object.defineProperty(e,Vl,{value:{}}),Object.getOwnPropertyDescriptor(e,Bh)==null){const h=Object.getPrototypeOf(e)?.[Bh]?.slice()??[];Object.defineProperty(e,Bh,{value:h})}const i=e[Vl],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[Bh];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===Vh)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===Vh)return;return c},enumerable:!0,configurable:!1}),i[n]}function Zs(e,t,i){return(n,s)=>{const r=Fp(n,s);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function Vp(e){return(t,i)=>{Fp(t,i).observers.push(e)}}function _h(e){return e!==void 0&&Vl in e}function Xs(e){const t=new Set;for(;_h(e);)t.add(e?.[Vl]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function hv(e){return Xs(e).reduce((t,i)=>(t[String(i)]=e[i]??null,t),{})}function*Gr(...e){for(const t of e)t!=null&&(t[Symbol.iterator]?yield*t:yield t)}function uv(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function Ci(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*Mt(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function gs(e){return Object.keys(e)}function ft(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,n)=>ft(i,t[n])):xe(e)?xe(t)?Bp(e,t,ft):!1:e===t}function Bp(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 be(...e){const t={};for(const i of e){if(!le(i))continue;const n=_h(i)?Xs(i):Object.keys(i);for(const s of n)xe(t[s])&&xe(i[s])?t[s]=be(t[s],i[s]):t[s]??(t[s]=i[s])}return t}function Bl(...e){const t={};for(const i of e){if(!le(i))continue;const n=_h(i)?Xs(i):Object.keys(i);for(const s of n)xe(t[s])&&xe(i[s])?t[s]=Bl(t[s],i[s]):s in t||(t[s]??(t[s]=i[s]))}return t}function qC(e,...t){return t&&ae(e)?e.map(i=>be(i,...t)):e}function _p(e,t){const i={};for(const[n,s]of Mt(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 dv(e,t){if(e==null)return!0;for(const[i,n]of Mt(e))if(!t(i,n))return!1;return!0}function pv(e){const t={};if(e==null)return t;for(const[i,n]of e)t[i]=n;return t}function zp(e,t){return(ae(t)?t:t.split(".")).reduce((n,s)=>n[s],e)}var Gp=new Set(["__proto__","constructor","prototype"]);function jp(e,t,i){const n=ae(t)?t.slice():t.split("."),s=n.pop();if(n.some(a=>Gp.has(a)))return;const r=n.reduce((a,o)=>a[o],e);return r[s]=i,r[s]}function Hp(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 $p(e,t,i){const n=i??Object.keys(t);for(let s=0,r=n.length;s<r;s++){const a=n[s],o=t[a];e[a]!==o&&(e[a]=o)}return e}function ki(e){if(e==null||typeof e!="object"||!xe(e))return e;Object.freeze(e);for(const t of Object.getOwnPropertyNames(e)){const i=e[t];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&ki(i)}return e}function gv(e,t){return xe(e)&&t in e}function JC(e,t){return gv(e,t)&&typeof e[t]=="string"}var Gh={fills:Ae(Wa(2),ee(et({color:$,stop:E},"")),Tp),fillMode:P("continuous","discrete")},jh={value:Z(E),text:O,shape:ne(P("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),ze),placement:P("before","after","middle"),spacing:w,size:w,rotation:E,...j,...B,...W},Hh={value:Z(E),text:O,shape:ne(P("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),ze),placement:P("inside","outside","middle"),spacing:w,size:w,rotation:E,label:{...Pe,spacing:w},...j,...B,...W},$h={...K(Se,["listeners"]),direction:P("horizontal","vertical"),cornerMode:P("container","item"),cornerRadius:w,thickness:w,segmentation:{enabled:L,spacing:w,interval:{values:ee(E),step:E,count:E}},bar:{enabled:L,thickness:w,thicknessRatio:X,...Gh,...j,...B,...W},label:{...Ys,text:O,spacing:w,avoidCollisions:L,placement:P("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:ke},jr={...K(Sn,["listeners"]),...$h,type:Z(Ge("linear-gauge")),value:Z(E),scale:{min:Ae(E,mi("max")),max:Ae(E,yi("min")),label:{enabled:L,formatter:ze,rotation:E,spacing:w,minSpacing:w,placement:P("before","after"),avoidCollisions:L,format:xn,...Ce},interval:{values:ee(E),step:E},...Gh,...j,...B,...W},targets:Tt(jh,"target options array")};jr.margin=J(E),jr.defaultColorRange=J(ee($)),jr.defaultTarget=J({...jh,value:E,label:{...Pe,spacing:E}}),jr.defaultScale=J(jr.scale),jr.scale.defaultFill=J($);var Uh={...K(Se,["listeners"]),outerRadius:w,innerRadius:w,outerRadiusRatio:X,innerRadiusRatio:X,startAngle:E,endAngle:E,spacing:w,cornerMode:P("container","item"),cornerRadius:w,scale:{min:Ae(E,mi("max")),max:Ae(E,yi("min")),label:{enabled:L,formatter:ze,rotation:E,spacing:w,minSpacing:w,avoidCollisions:L,format:xn,...Ce},interval:{values:ee(E),step:E},...Gh,...j,...B,...W},segmentation:{enabled:L,spacing:w,interval:{values:ee(E),step:E,count:E}},bar:{enabled:L,...Gh,...j,...B,...W},needle:{enabled:L,spacing:w,radiusRatio:X,...j,...B,...W},label:{text:O,spacing:w,...Ys},secondaryLabel:{text:O,...Ys},tooltip:ke},Wh={...K(Sn,["listeners"]),...Uh,type:Z(Ge("radial-gauge")),value:Z(E),targets:Tt(Hh,"target options array")};Wh.defaultColorRange=J(ee($)),Wh.defaultTarget=J({...Hh,value:E,label:{...Pe,spacing:E}}),Wh.scale.defaultFill=J($);var fv=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(fv||{}),qs=12,Hr={SMALLEST:8/qs,SMALLER:10/qs,SMALL:12/qs,MEDIUM:13/qs,LARGE:14/qs,LARGEST:17/qs},mv=(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))(mv||{}),yv=(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))(yv||{}),bv=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(bv||{}),vv=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(vv||{}),$r=(e,t,i)=>e*(1-i)+t*i,Up=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},Wp=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},xv=class Te{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("#")?!!Te.parseHex(t):t.includes("rgb")?!!Te.stringToRgba(t):Te.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.includes("#"))return Te.fromHexString(t);const i=Te.nameToHex.get(t.toLowerCase());if(i)return Te.fromHexString(i);if(t.includes("rgb"))return Te.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;n<t.length;n+=2)i.push(Number.parseInt(`${t[n]}${t[n+1]}`,16));break;case 3:case 4:i=t.split("").map(n=>Number.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=Te.parseHex(t);if(i){const[n,s,r,a]=i;return new Te(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<t.length;o++){const l=t[o];if(i===-1&&l==="(")i=o;else if(l===")"){n=o;break}}if(i===-1||n===-1)return;const r=t.substring(i+1,n).split(","),a=[];for(let o=0;o<r.length;o++){const l=r[o];let c=Number.parseFloat(l);if(!Number.isFinite(c))return;l.includes("%")?(c=te(0,c,100),c/=100):o===3?c=te(0,c,1):(c=te(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(t){const i=Te.stringToRgba(t);if(i){if(i.length===3)return new Te(i[0],i[1],i[2]);if(i.length===4)return new Te(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new Te(t[0],t[1],t[2],t[3]);if(t.length===3)return new Te(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,n,s=1){const r=Te.HSBtoRGB(t,i,n);return new Te(r[0],r[1],r[2],s)}static fromHSL(t,i,n,s=1){const r=Te.HSLtoRGB(t,i,n);return new Te(r[0],r[1],r[2],s)}static fromOKLCH(t,i,n,s=1){const r=Te.OKLCHtoRGB(t,i,n);return new Te(r[0],r[1],r[2],s)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+Te.padHex(Math.round(this.r*255).toString(16))+Te.padHex(Math.round(this.g*255).toString(16))+Te.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=Te.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],n=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*n)/n),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return Te.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,n){const s=Up(t),r=Up(i),a=Up(n),o=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*a),l=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*a),c=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*a),h=.2104542553*o+.793617785*l-.0040720468*c,u=1.9779984951*o-2.428592205*l+.4505937099*c,d=.0259040371*o+.7827717662*l-.808675766*c,p=Math.atan2(d,u)*180/Math.PI,g=h,f=Math.hypot(u,d),y=p>=0?p:p+360;return[g,f,y]}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=Wp(h),g=Wp(u),f=Wp(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+(i<n?6:0):r===i?o=(n-t)/c+2:o=(t-i)/c+4,o*=360/6}return[o,l,a]}static HSLtoRGB(t,i,n){if(t=(t%360+360)%360,i===0)return[n,n,n];const s=n<.5?n*(1+i):n+i-n*i,r=2*n-s;function a(h){return h<0&&(h+=1),h>1&&(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 Te($r(t.r,i.r,n),$r(t.g,i.g,n),$r(t.b,i.b,n),$r(t.a,i.a,n))}static lighten(t,i){const n=Te.RGBtoOKLCH(t.r,t.g,t.b);return Te.fromOKLCH(te(0,n[0]+i,1),n[1],n[2])}static darken(t,i){const n=Te.RGBtoOKLCH(t.r,t.g,t.b);return Te.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=>Te.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 Te.fromOKLCH($r(h[0],u[0],c),$r(h[1],u[1],c),$r(h[2],u[2],c))})}};xv.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 Ne=xv,Sv={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"]}}},QC={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},ek={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},Kp={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},tk={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},ik={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},Js={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},nk={...Js,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},sk={...Js,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},rk=e=>({...Js,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]}}]]}}}),Kh={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},_l={...Kh,reverse:!0},ak={...Kh,bounds:"series"},Mv={...Kh,bounds:"series",reverse:!0},ok={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},Hi={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:Kp,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},lk={...Hi,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"}]}]}]}},ck={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},hk={...Hi,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},uk=e=>({...Hi,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),fs={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},dk={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function $i(e){return _p(e,t=>{const i=Ne.fromString(t);return[Ne.darken(i,.15).toString(),t,Ne.lighten(i,.15).toString()]})}var Yn={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}}},zl={enabled:!0,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},Yp={enabled:!0,unhighlightedSeries:{opacity:.2}},Zp={enabled:!0,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},pk={enabled:!0,unhighlightedItem:{opacity:.2}},Iv={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]}]}},Yh={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",Js],["image",fs],["pattern",Hi]]},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"}}}},Xp=class Yy{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(typeof t!="object"){Ii(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){Ii("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){Ii("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)){const a=r.length>0?`
|
|
|
|
${r.join(`
|
|
|
|
`)}
|
|
|
|
`:"";Ii(`Could not restore [${n.mementoOriginatorKey}] data, value was invalid, ignoring.${a}`,s);return}n.restoreMemento(this.version,t.version,s)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,Yy.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),Yy.decodeTypes)}catch(n){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${n}].`,{cause:n})}}static encodeTypes(t,i){return yn(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return le(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},qp=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(qp||{}),Ur=(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))(Ur||{}),Dv=(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))(Dv||{}),Av=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(Av||{}),Cv=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(Cv||{}),kv=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(kv||{});function Zh(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 oe=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 Gn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const n of Xs(this))if(i.has(n)){const s=e[n],r=this;if(Qa(r[n]))if(r[n]instanceof Ja){const a=r[n].reset(s);a==null?Gn(`unable to set [${String(n)}] - expecting a properties array`):r[n]=a}else r[n].set(s);else xe(s)?r[n]=Bl(s,r[n]??{}):r[n]=s;i.delete(n)}this.handleUnknownProperties(i,e);for(const n of i)Gn(`unable to set [${String(n)}] in ${t} - property is unknown`);return this}clear(){for(const e of Xs(this)){const t=this[e];Qa(t)?t.clear():this[e]=void 0}return this}toJson(){return Xs(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=Qa(i)?i.toJson():i,e},{})}},Ja=class wA 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(ae(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new wA(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function Qa(e){return e instanceof oe||e instanceof Ja}var eo=class extends oe{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};b([S],eo.prototype,"type",2),b([S],eo.prototype,"tension",2),b([S],eo.prototype,"position",2);function to(e,t){const[i,n]=Nt(t);return te(i,e,n)}function Nt(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function Wr(e){const[t,i]=Nt(e);return i-t}function io(e){return e=Math.trunc(e),e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function Jp(e){return e=Math.trunc(e),e<=0?0:e===1?1:1<<31-Math.clz32(e)}var an=0,In=1,Dn=2,An=3,Qs=4,ms=1e3,gk=10,er=64,Gl=4294967295,fk=3,mk=20,Qp=100;function eg(e,t,i,n,s,r,a,o){let l=0;for(;l<Qp&&e[n]==null&&n<s;)n+=1,l+=1;for(;l<Qp&&e[s]==null&&s>n;)s-=1,l+=1;if(l>=Qp||n>=s)return r;const c=Number.isFinite(t)?ln(e[s],t,i,o)-ln(e[n],t,i,o):no(s,e.length)-no(n,e.length);if(c===0||!Number.isFinite(c))return r;const h=Math.abs(c)/(s-n);let u;if(a<fk?u=!0:a>mk?u=!1:u=h<=r,r=Math.min(r,h),!u)return r;const d=Math.floor((n+s)/2),p=eg(e,t,i,n,d,r,a+1,o),g=eg(e,t,i,d+1,s,r,a+1,o);return Math.min(p,g,r)}function yk(e,t,i,n){return eg(e,t,i,0,e.length-1,1/(e.length-1),0,n)}function ys(e,t,i,n){if(Number.isFinite(t)){const s=n?.smallestKeyInterval,r=n?.xNeedsValueOf??!0,a=s==null?yk(e,t,i,r):s/(i-t);return io(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 on(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 no(e,t){return e/t}function ln(e,t,i,n){return n?(e.valueOf()-t)/(i-t):(e-t)/(i-t)}function Xh(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*Qs)}function bk(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)?ln(o,t,i,r):no(s,l);return Xh(c,n)}function vk(e,t,i,n){for(const s of n)if(i===e[t+s])return!0;return!1}function bs(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*Qs,y=h?.length===f?h:new Uint32Array(f),m=u?.length===f?u:new Float64Array(f);let v,x;o&&(d?.length===f?v=d:v=new Uint32Array(f),p?.length===f?x=p:x=new Float64Array(f));const M=Number.isFinite(n)&&Number.isFinite(s),D=e.length;M&&(m.fill(g),y.fill(Gl),o&&(x.fill(g),v.fill(Gl)));const A=M?r/(s-n):r*(1/D);let I=-1,k=-1,C=g,T=-1,N=g,R=-1,F=g,G=-1,V=g,H=-1,q=-1,z=g,ie=-1,de=g,pe=-1,Re=g,Rt=-1,ve=g;const ri=e.length,us=t===i;for(let De=0;De<ri;De++){const Fr=e[De];if(Fr==null)continue;const Fs=t[De],Vr=us?Fs:i[De];let jt,me;c?(jt=Fs==null?g:Fs.valueOf(),me=Vr==null?g:Vr.valueOf()):(jt=Fs??g,me=Vr??g);let ut=!0;if(o)ut=jt>=0;else if(a!=null&&jt>=0!==a)continue;let Le;M?l?Le=(Fr.valueOf()-n)*A:Le=(Fr-n)*A:Le=De*A;const ds=Math.floor(Le),gn=(ds<r?ds:r-1)<<2;if(ut){gn!==I&&(I!==-1&&(y[I]=k,y[I+1]=T,y[I+2]=R,y[I+3]=G,m[I]=C,m[I+1]=N,m[I+2]=F,m[I+3]=V),I=gn,k=-1,C=g,T=-1,N=g,R=-1,F=g,G=-1,V=g);const rh=me===me,ah=jt===jt;k===-1?(k=De,C=Le,T=De,N=Le,rh&&(R=De,F=me),ah&&(G=De,V=jt)):(Le<C&&(k=De,C=Le),Le>N&&(T=De,N=Le),rh&&me<F&&(R=De,F=me),ah&&jt>V&&(G=De,V=jt))}else{gn!==H&&(H!==-1&&(v[H]=q,v[H+1]=ie,v[H+2]=pe,v[H+3]=Rt,x[H]=z,x[H+1]=de,x[H+2]=Re,x[H+3]=ve),H=gn,q=-1,z=g,ie=-1,de=g,pe=-1,Re=g,Rt=-1,ve=g);const rh=me===me,ah=jt===jt;q===-1?(q=De,z=Le,ie=De,de=Le,rh&&(pe=De,Re=me),ah&&(Rt=De,ve=jt)):(Le<z&&(q=De,z=Le),Le>de&&(ie=De,de=Le),rh&&me<Re&&(pe=De,Re=me),ah&&jt>ve&&(Rt=De,ve=jt))}}return I!==-1&&(y[I]=k,y[I+1]=T,y[I+2]=R,y[I+3]=G,m[I]=C,m[I+1]=N,m[I+2]=F,m[I+3]=V),o&&H!==-1&&(v[H]=q,v[H+1]=ie,v[H+2]=pe,v[H+3]=Rt,x[H]=z,x[H+1]=de,x[H+2]=Re,x[H+3]=ve),{indexData:y,valueData:m,negativeIndexData:v,negativeValueData:x}}function Kr(e,t,i,{inPlace:n=!1,midpointData:s,reuseIndexData:r,reuseValueData:a}={}){const o=Math.trunc(i/2),l=o*Qs;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;d<o;d+=1){const p=Math.trunc(d*Qs),g=Math.trunc(p*2),f=Math.trunc(g+Qs),y=e[f+an]===Gl,m=y||t[g+an]<t[f+an]?g:f,v=e[m+an];c[p+an]=v,h[p+an]=t[m+an];const x=y||t[g+In]>t[f+In]?g:f,M=e[x+In];c[p+In]=M,h[p+In]=t[x+In],u[d]=v+M>>1;const D=y||t[g+Dn]<t[f+Dn]?g:f;c[p+Dn]=e[D+Dn],h[p+Dn]=t[D+Dn];const A=y||t[g+An]>t[f+An]?g:f;c[p+An]=e[A+An],h[p+An]=t[A+An]}return{maxRange:o,indexData:c,valueData:h,midpointData:u}}function Zn(e,t,i,n=an,s=In,r=-1){const a=i?.length===e?i:new Uint32Array(e);for(let o=0,l=0;o<e;o+=1,l+=Qs){const c=t[l+n],h=t[l+s];a[o]=c===r?r:c+h>>1}return a}function xk(e,{collectLevel:t,shouldContinue:i,minRange:n=er,compactInPlace:s=!1}){let r=e,a=t(r);const o=[a];for(;r.maxRange>n&&i(a,r);){const l=Kr(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 wv(e,t,i,n,s){if(t.length<ms)return;const[r,a]=e,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=s;let u=ys(t,r,a,{smallestKeyInterval:o,xNeedsValueOf:l});const d=h?.find(m=>m.maxRange===u);let{indexData:p,valueData:g}=bs(t,i,n,r,a,u,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),f=Zn(u,p,d?.midpointIndices);const y=[{maxRange:u,indexData:p,valueData:g,midpointIndices:f}];for(;u>er;){const m=u,v=Math.trunc(m/2),x=h?.find(D=>D.maxRange===v),M=Kr(p,g,m,{reuseIndexData:x?.indexData,reuseValueData:x?.valueData});u=M.maxRange,p=M.indexData,g=M.valueData,f=M.midpointData??Zn(u,p,x?.midpointIndices),y.push({maxRange:u,indexData:p,valueData:g,midpointIndices:f})}return y.reverse(),y}function Sk(e,t,i,n,s){if(t.length<ms)return;const[r,a]=e,{smallestKeyInterval:o,targetRange:l,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u}=s,d=ys(t,r,a,{smallestKeyInterval:o,xNeedsValueOf:c}),p=Math.min(d,io(Math.max(l,er))),g=u?.find(M=>M.maxRange===p),{indexData:f,valueData:y}=bs(t,i,n,r,a,p,{xNeedsValueOf:c,yNeedsValueOf:h,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),m=Zn(p,f,g?.midpointIndices),v={maxRange:p,indexData:f,valueData:y,midpointIndices:m};function x(){return wv([r,a],t,i,n,{smallestKeyInterval:o,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u})?.filter(D=>D.maxRange!==p)??[]}return{immediate:[v],computeRemaining:x}}var so=Symbol("is-dark-theme"),Yr=Symbol("default-shadow-colour"),tr=Symbol("default-caption-layout-style"),ir=Symbol("default-caption-alignment"),tg=Symbol("palette-up-stroke"),ig=Symbol("palette-down-stroke"),ng=Symbol("palette-up-fill"),sg=Symbol("palette-down-fill"),rg=Symbol("palette-neutral-stroke"),ag=Symbol("palette-neutral-fill"),og=Symbol("palette-alt-up-stroke"),lg=Symbol("palette-alt-down-stroke"),cg=Symbol("palette-alt-up-fill"),hg=Symbol("palette-alt-down-fill"),ug=Symbol("palette-gray-fill"),dg=Symbol("palette-gray-stroke"),qh=Symbol("default-polar-series-stroke"),Jh=Symbol("default-sparkline-crosshair-stroke"),wi=Symbol("default-financial-charts-annotation-stroke"),pg=Symbol("default-hierarchy-strokes"),Qh=Symbol("default-text-annotation-color"),Li=Symbol("default-financial-charts-annotation-background-fill"),eu=Symbol("default-annotation-handle-fill"),tu=Symbol("default-annotation-statistics-fill"),iu=Symbol("default-annotation-statistics-stroke"),nu=Symbol("default-annotation-statistics-color"),su=Symbol("default-annotation-statistics-divider-stroke"),gg=Symbol("default-annotation-statistics-fill"),fg=Symbol("default-annotation-statistics-stroke"),ru=Symbol("default-textbox-fill"),au=Symbol("default-textbox-stroke"),ou=Symbol("default-textbox-color"),jl=Symbol("default-toolbar-position");function Mk(e,t){return"context"in e}function Lv(e,t){return e!=null&&Mk(e,t)&&t!=null&&typeof t=="object"&&t.context===void 0?(t.context=e.context,!0):!1}function Cn(e,t,i){if(Array.isArray(e)){for(const n of e)if(Lv(n,i))break}else Lv(e,i);return t(i)}var Tv=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=Cn(e,t,s);return i&&n!=null&&i.set(n,r),r}catch(r){Ii("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}};function lu(e,t){if(!e)return;const{x:i,y:n,width:s,height:r}=Dk(t);hu(e.style,"width",s),hu(e.style,"height",r),hu(e.style,"left",i),hu(e.style,"top",n)}function Nv(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 Ik(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=Gi().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=Me().getSelection();i?.removeAllRanges(),i?.addRange(t)}function Ov(){const e=Me("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function cu(e){return`ag-charts-icon ag-charts-icon-${e}`}function Dk(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 hu(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}function mg(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 Ak(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 yg(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 cn=Math.PI*2,Hl=Math.PI/2;function bi(e){return e%=cn,e+=cn,e%=cn,e}function Ck(e){return e%=cn,e+=cn,e!==cn&&(e%=cn),e}function uu(e){return e%=cn,e<-Math.PI?e+=cn:e>=Math.PI&&(e-=cn),e}function nr(e,t,i){const n=bi(e),s=bi(t),r=bi(i);return s<r?s<=n&&n<=r:s>r?s<=n||n<=r:t!==i}function Ut(e){return e/180*Math.PI}function kk(e){return e/Math.PI*180}function du(e,t){return e=bi(e),t=bi(t),t-e+(e>t?cn:0)}function Ev(e){const t=bi(e);return t<=Hl?t/Hl:t<=Math.PI?(Math.PI-t)/Hl:t<=1.5*Math.PI?(t-Math.PI)/Hl:(cn-t)/Hl}function bg(e,t,i){const n=Ev(i);return e*n+t*Math.abs(1-n)}function vs(e){return e?bi(Ut(e)):0}var vg=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 xg(e=0){function t(i){setTimeout(i,e)}return new Promise(t)}async function wk(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 sr(e){return e==="true"}function Lk(e){return Number(e)}function Ui(e){return e}var Tk={role:Ui,"aria-checked":sr,"aria-controls":Ui,"aria-describedby":Ui,"aria-disabled":sr,"aria-expanded":sr,"aria-haspopup":Ui,"aria-hidden":sr,"aria-label":Ui,"aria-labelledby":Ui,"aria-live":Ui,"aria-orientation":Ui,"aria-selected":sr,"data-focus-override":sr,"data-focus-visible-override":sr,"data-preventdefault":sr,class:Ui,for:Ui,id:Ui,tabindex:Lk,title:Ui,placeholder:Ui};function ye(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function Zr(e,t){if(t!=null)for(const[i,n]of Mt(t))i!=="class"&&ye(e,i,n)}function Xr(e,t,i){if(!Sl(e))return;const n=e.getAttribute(t);return n===null?i:Tk[t]?.(n)??void 0}function kn(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function Rv(e,t){for(const[i,n]of Mt(t))kn(e,i,n)}function oi(e,t){const i=Array.isArray(e)?e:e.split(".");if(i.length===1){const[n]=i;return Zs((s,r,a)=>s[n]=a,s=>s[n],t)}return Zs((n,s,r)=>jp(n,i,r),n=>zp(n,i),t)}function Nk(e){return Zs((t,i,n)=>t[e]=n)}function rt(e,t){return Zs((i,n,s)=>i[e][t??n]=s)}function Vt(e){const{newValue:t,oldValue:i,changeValue:n}=e;return Zs((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 rr(e){return Vp(e)}var qr=class extends oe{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};b([Vt({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),S],qr.prototype,"enabled",2),b([rt("node","stroke"),S],qr.prototype,"stroke",2),b([rt("node","strokeOpacity"),S],qr.prototype,"strokeOpacity",2),b([Vt({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),S],qr.prototype,"strokeWidth",2);function Sg(e,t,i,n,s){return t<e.x+e.width&&t+n>e.x&&i<e.y+e.height&&i+s>e.y}function pu(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 Ok(e){return e==null||e.height===0||e.width===0||Number.isNaN(e.height)||Number.isNaN(e.width)}function gu(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 ar(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 ro(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 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?t=s-1:(n=r,e=s+1)}return n}function Rk(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 Pv(e=0,t=0){const i=gh();return new i(e,t).getContext("2d")}var Pk=800,Fk=600,Vk={quality:1};function Bk(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 Fv=!1;function _k(e,t){if(Fv)return;Fv=!0;const i=e.prototype.createConicGradient;Object.defineProperty(e.prototype,"createConicGradient",{value:function(n,s,r){return i.call(this,n+Math.PI/2,s,r)},writable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillText",{value:function(n,s,r){let a=this.outlineText(n);a=a.transform(new t([1,0,0,1,s,r])),this.fill(a)},writable:!0,configurable:!0})}var zk=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},Vv=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 Mg(e,t){return e.valueOf()-t.valueOf()}function Gk(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 Ig(e){const t=e.slice().sort(Mg);return Dg(t)==null?Gk(t):t}function Dg(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 Ag(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");Ii(i)}}function jk(e,t){const i=Ag(),n=t?.default;return Zs((s,r,a)=>(a!==n&&i(r.toString(),e),a))}function Hk(e,t){const i=Ag();return Zs((n,s,r)=>(r!==n[e]&&(i(s.toString(),`Use [${e}] instead.`),jp(n,e,t?t(r):r)),Vh),(n,s)=>(i(s.toString(),`Use [${e}] instead.`),zp(n,e)))}function Bv(e,t){const i=Math.max(e.length,t.length),n=new Set,s=new Set;for(let r=0;r<i;r++){const a=e[r],o=t[r];a!==o&&(s.has(o)?s.delete(o):o&&n.add(o),n.has(a)?n.delete(a):a&&s.add(a))}return{changed:n.size>0||s.size>0,added:n,removed:s}}function $l(e,t,i,n){const s=e-i,r=t-n;return s*s+r*r}function fu(e,t,i,n,s,r,a){if(i===s&&n===r)return Math.min(a,$l(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,$l(e,t,h,u))}function $k(e,t,i,n,s,r,a,o,l){o&&([a,r]=[r,a]);const c=Math.atan2(t-n,e-i);if(!nr(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,$l(e,t,u,d),$l(e,t,p,g))}const h=s-Math.sqrt($l(e,t,i,n));return Math.min(l,h*h)}function Jr(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"&&(a<i&&(i=a),a>n&&(n=a))}const s=[i,n];return s.every(Number.isFinite)?s:null}function mu(e,t,i,n,s,r,a){let o=!1;const l=Jr(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&&n<h&&(h=n),i!=null?(o||(o=i<u),u=i):s!=null&&s>u&&(u=s),h>u?{extent:[],clipped:!1}:{extent:[h,u],clipped:o}}function yu(e,t,i,n,s){const{extent:r,clipped:a}=mu(e.domain,ji(t)?new Date(t):t,ji(i)?new Date(i):i,ji(n)?new Date(n):n,ji(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 ao(e,t=2){return typeof e=="number"?Gv(e,t):typeof e=="string"?e:String(e??"")}function _v(e){return Uk.format(e)}var zv=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Gv(e,t){let i=zv.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),zv.set(t,i)),i.format(e)}function jv(e){return Array.isArray(e)&&e.length>=2&&e.every(Be)}function bu(e){return Array.isArray(e)&&e.length>=2&&e.every(jv)}function Wk(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 Hv(e){return Array.isArray(e)&&e.every(bu)&&e.every(Wk)}function $v(e){if(e===null)return!0;if(!le(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every($v);case"MultiPolygon":return Array.isArray(i)&&i.every(Hv);case"Polygon":return Hv(i);case"MultiLineString":return Array.isArray(i)&&i.every(bu);case"LineString":return bu(i);case"MultiPoint":return bu(i);case"Point":return jv(i);default:return!1}}function Kk(e){return le(e)&&e.type==="Feature"&&$v(e.geometry)}function Yk(e){return le(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(Kk)}var Uv=fe(Yk,"a GeoJSON object"),Wv=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 Kv(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}},Kv=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()}},Cg="class-instance";function Xn(e,t,i){if(ae(t)){if(!ae(e)||e.length!==t.length||t.some((n,s)=>Xn(e[s],n,i)!=null))return t}else if(xe(t)){if(!xe(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=Xn(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 Yv(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Fe(e,t){return ae(e)?Zk(e,t):xe(e)?Xk(e,t):e instanceof Map?new Map(Fe(Array.from(e))):Qr(e)}function Zk(e,t){const i=[],n=t?.seen;for(const s of e){if(typeof s=="object"&&n?.includes(s)){Gn("cycle detected in array",s);continue}n?.push(s),i.push(Fe(s,t)),n?.pop()}return i}function Xk(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]=Qr(e[n]):i[n]=Fe(e[n],t);return i}function Qr(e){return ae(e)?e.slice(0):xe(e)?{...e}:yn(e)?new Date(e):wb(e)?new RegExp(e.source,e.flags):e}function or(e,t,i,n,s,r){if(ae(e)){r=t(e,n,s,r);let a=0;for(const o of e)r=or(o,t,i,n?.[a],s,r),a++}else if(xe(e)){r=t(e,n,s,r);for(const a of Object.keys(e)){if(i?.has(a))continue;const o=e[a];r=or(o,t,i,n?.[a],s,r)}}return r}function Ul(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??"<root>"}`);if(t==null)return e;if(Qa(e))return e.set(t);const a=e,o=kg(e);for(const l of Object.keys(t)){if(Gp.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=kg(p),f=kg(h);if(o===Cg&&!(l in e||l==="context")){if(h===void 0)continue;Gn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(g!=null&&f!=null&&f!==g&&(g!==Cg||f!=="object")){Gn(`unable to set [${u}] in ${d?.name} - can't apply type of [${f}], allowed types are: [${g}]`);continue}if(Qa(p))h===void 0?p.clear():p.set(h);else if(f==="object"&&l!=="context"){if(!(l in a)){Gn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}p==null?a[l]=h:Ul(p,h,{...i,path:u,matcherPath:c})}else a[l]=h}catch(g){Gn(`unable to set [${u}] in [${d?.name}]; nested error is: ${g.message}`)}}return e}function kg(e){return e==null?null:xp(e)||yn(e)?"primitive":ae(e)?"array":le(e)?xe(e)?"object":Cg:$n(e)?"function":"primitive"}function Ve(e,t,i,n){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)}function wg(e,t,i=["Escape"]){return Ve(e,"keydown",n=>{vu(n,...i)&&t(n)})}function Zv(e,t){const i=Ve(Me(),"mousedown",n=>{[0,2].includes(n.button)&&!qv(e,n)&&(t(),i())});return i}function Xv(e,t){const i=Ve(Me(),"touchstart",n=>{Array.from(n.targetTouches).some(r=>!qv(e,r))&&(t(),i())});return i}function qv(e,t){return mp(t.target)&&t.target.shadowRoot!=null?!0:fh(t.target)&&e.contains(t.target)}function Jv(e,t,i){const n=s=>{for(const r of t)ye(r,"data-focus-visible-override",s)};return n(i),Ve(e,"keydown",()=>n(!0),{once:!0})}function Wl(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function vu(e,...t){return Wl(e)&&t.includes(e.key)}function Qv(e,t,i){return Ve(e,"keydown",n=>{vu(n,i)&&t.focus()})}var Kl={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function qk(e){const{orientation:t,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:r,onBlur:a}=e,{nextKey:o,prevKey:l}=Kl[t],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 Qe;for(let p=0;p<i.length;p++){const g=i[(h+p-1)%u],f=i[p],y=i[(h+p+1)%u];d.register(Ve(f,"focus",c),r&&Ve(f,"focus",r),a&&Ve(f,"blur",a),s&&wg(f,s),g&&Qv(f,g,l),y&&Qv(f,y,o),Ve(f,"keydown",m=>{vu(m,o,l)&&m.preventDefault()})),f.tabIndex=p===0?0:-1}return d}function Jk(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function Lg(e){return"button"in e?e.button===0:Wl(e)&&(e.code==="Space"||e.key==="Enter")}function Tg(e){const t=e?.target;if(mp(t)&&"tabindex"in t.attributes)return t}function ex(e){return Ve(e,"keydown",t=>{if(t.defaultPrevented)return;Xr(t.target,"data-preventdefault",!0)&&vu(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var Ng=new Map,tx=1;function Qk(){Ng.clear(),tx=1}function wn(e){const t=e.constructor;let i=Object.hasOwn(t,"className")?t.className:t.name;vb(()=>{if(!i)throw new Error(`The ${String(t)} is missing the 'className' property.`)}),i??(i="Unknown");const n=(Ng.get(i)??0)+1;return Ng.set(i,n),`${i}-${n}`}function Yl(){return`ag-charts-${tx++}`}function xu(){return crypto.randomUUID?.()??ew()}function ew(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let i=0;i<e.length;i++)(i===4||i===6||i===8||i===10)&&(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}function ix(e,t,i){let n=e,s=n;for(const r of t)if(n==null||i(n.value,r)>0)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 Zl=new WeakMap;function Xl(e,t){const i=JSON.stringify(e,null,0);return Zl.has(t)||Zl.set(t,new Map),Zl.get(t)?.has(i)||Zl.get(t)?.set(i,t(e)),Zl.get(t)?.get(i)}var Og=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function ql(e,t){let i=new Og;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 Og,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 Og},n}function Wt(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 Su(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<s.distanceSquared&&(s.nearest=r,s.distanceSquared=a)}return s}function tw(e,t,i,n=1/0){const{x:s=e,y:r=t}=i.transformPoint?.(e,t)??{},a={nearest:void 0,distanceSquared:n};for(const o of i.children){const{nearest:l,distanceSquared:c}=o.nearestSquared(s,r,a.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<a.distanceSquared&&(a.nearest=l,a.distanceSquared=c)}return a}var ea=class extends oe{constructor(e=0,t=e,i=e,n=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=n}};b([S],ea.prototype,"top",2),b([S],ea.prototype,"right",2),b([S],ea.prototype,"bottom",2),b([S],ea.prototype,"left",2);function nx(e,t,i,n){let{top:s,right:r,bottom:a,left:o,width:l,height:c}=n;return o!=null?l!=null?r=i.width-o+l:r!=null&&(l=i.width-o-r):r!=null&&l!=null&&(o=i.width-r-l),s!=null?c!=null?a=i.height-s-c:a!=null&&(c=i.height-a-s):a!=null&&c!=null&&(s=i.height-a-c),l==null?c==null?(c=t,l=e):l=Math.ceil(e*c/t):c??(c=Math.ceil(t*l/e)),o==null&&(r==null?o=Math.floor((i.width-l)/2):o=i.width-r-l),s==null&&(a==null?s=Math.floor((i.height-c)/2):s=i.height-c-a),{x:o,y:s,width:l,height:c}}var Eg="color: green",Rg="color: grey";function iw(){return Vp(()=>{})}function Pg(e,t){const i=Xs(t);if(i.length===0)return;const n=hv(e);for(const s of i)s in n&&(t[s]=n[s])}var sx=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},Fg=class _i extends sx{constructor(t,i,n){super(),this.defaultState=t,this.states=i,this.enterEach=n,this.debug=bb(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,Eg)}transition(t,i){if(!this.transitionChild(t,i)||this.state===_i.child||this.state===_i.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,Rg),u});else if(typeof a=="object"&&!(a instanceof _i)&&a.guard&&!a.guard(i)){this.debug(`${o} (guarded)`,a.target,Rg);return}if(!a){this.debug(`${o} ${this.state}`,Rg);return}const l=this.getDestinationState(a),c=l===this.state?void 0:r.onExit;this.debug(`${o} ${l}`,Eg),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof _i)&&a.action?.(i),c?.(),this.enterEach?.(s,l),l!==s&&l!==_i.child&&l!==_i.parent&&this.states[l].onEnter?.(s,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===_i.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!==_i.child||!this.childState||(Pg(this,this.childState),this.childState.transition(t,i),!this.childState.is(_i.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,Eg),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 _i?(this.childState=t,this.childState.parent=this,i=_i.child):typeof t=="object"&&(t.target instanceof _i?(this.childState=t.target,this.childState.parent=this,i=_i.child):t.target!=null&&(i=t.target)),i}};Fg.child="__child",Fg.parent="__parent";var Jl=Fg,nw=class extends sx{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)Pg(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)Pg(this,i),i.transitionAsync(e,t)}},Vg=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 i<a.width&&(i=a.width),n+=a.height,{text:r,...a}});return{width:i,height:n,lineMetrics:s}}textWidth(e,t){if(t){let i=0;for(let n=0;n<e.length;n++)i+=this.textWidth(e.charAt(n));return i}return e.length>1?this.ctx.measureText(e).width:this.charMap.get(e)??this.charWidth(e)}charWidth(e){const{width:t}=this.ctx.measureText(e);return this.charMap.set(e,t),t}},Bg=new ph(50);function vi(e){typeof e=="object"&&(e=Sp(e));let t=Bg.get(e);if(t)return t;const i=new ph(1e4),n=Pv();return n.font=e,t=new Vg(n,s=>{let r=i.get(s);return r||(r=n.measureText(s),i.set(s,r),r)}),Bg.set(e,t),t}vi.clear=()=>Bg.clear();function xs(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=vi(p),f=pt(o).split(zs);for(let y=0;y<f.length;y++){const m=f[y],v=g.measureText(m);y>0&&(i={segments:[],width:0,height:0,ascent:0,descent:0},n.push(i)),m&&(i.width+=v.width,i.ascent=Math.max(i.ascent,v.ascent),i.descent=Math.max(i.descent,v.descent),i.height=Math.max(i.height,i.ascent+i.descent),i.segments.push({...p,...d,text:m,textMetrics:v}))}}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 he(e,t,i){const n=Gi().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 at(e){return Gi().createElementNS("http://www.w3.org/2000/svg",e)}function rx(e,t){const i=Gi("body"),n=he("a",{display:"none"});n.href=e,n.download=t,i.appendChild(n),n.click(),setTimeout(()=>n.remove())}function ax(e,t){return t.overflow==="hide"&&e.some(Gs)}function Mu(e,t){return ae(e)?zg(e,t):_g(pt(e),t).join(`
|
|
`)}function ox(e,t){return _g(e,t).join(`
|
|
`)}function _g(e,t){return Iu(e,t)}function ta(e,t,i,n){const s=t.textWidth(Il);let r=0,a=0;for(;a<e.length;a++){const o=t.textWidth(e.charAt(a));if(r+o>i)break;r+=o}if(e.length===a&&(!n||r+s<=i))return n?Ip(e):e;for(e=e.slice(0,a).trimEnd();e.length&&t.textWidth(e)+s>i;)e=e.slice(0,-1).trimEnd();return Ip(e)}function Iu(e,t,i=0){const n=e.split(zs),s=vi(t.font),r=[];if(t.textWrap==="never"){for(const c of n){const h=ta(c.trimEnd(),s,Math.max(0,t.maxWidth-i));if(!h)break;r.push(h),i=0}return ax(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=0,d=0,p=0;for(r.length||(d=i);u<h.length;){const g=h.charAt(u);if(g===" "&&(p=u),d+=s.textWidth(g),d>t.maxWidth){if(u===0){h="";break}let f=s.textWidth(h.slice(0,u+1));if(r.length||(f+=i),f<=t.maxWidth){d=f,u++;continue}if(p){const v=sw(h,p+1),x=s.textWidth(v);if(x<=t.maxWidth){r.push(h.slice(0,p).trimEnd()),h=h.slice(p).trimStart(),u=0,d=0,p=0;continue}else o&&x>t.maxWidth&&r.push(h.slice(0,p).trimEnd(),ta(h.slice(p).trimStart(),s,t.maxWidth,!0))}else if(o){const v=ta(h,s,t.maxWidth,!0);v&&r.push(v)}if(o){h="";break}const y=a?"-":"";let m=h.slice(0,u).trim();for(;m.length&&s.textWidth(m+y)>t.maxWidth;)m=m.slice(0,-1).trimEnd();if(m&&m!==Dl)r.push(m+y);else{h="";break}h=h.slice(m.length).trimStart(),u=-1,d=0,p=0}u++}h&&r.push(h)}rw(r,s,t);const l=lx(r,s,t);return ax(l,t)?[]:l}function sw(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}function lx(e,t,i){if(!Be(i.maxHeight))return e;const{height:n,lineMetrics:s}=t.measureLines(e);if(n<=i.maxHeight)return e;for(let r=0,a=0;r<s.length;r++)if(a+=s[r].height,a>i.maxHeight){if(i.overflow==="hide"||r===0)return[];const o=e.slice(0,r),l=o.pop();return o.concat(Gs(l)?l:ta(l,t,i.maxWidth,!0))}return e}function rw(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:n}=e,s=e[n-1],r=e[n-2];if(r.length<s.length)return;const a=r.lastIndexOf(" ");if(a===-1||a===r.indexOf(" ")||s.includes(" "))return;const o=r.slice(a+1);t.textWidth(s+o)<=i.maxWidth&&(e[n-2]=r.slice(0,a),e[n-1]=o+" "+s)}function zg(e,t){const{maxHeight:i=1/0}=t,n=[];let s=0,r=0;function a(){const o=n.pop();if(!o)return;const l=vi(o),c=ta(o.text,l,t.maxWidth,!0),h=l.measureText(c);n.push({...o,text:c,textMetrics:h})}for(const{width:o,height:l,segments:c}of xs(e,t.font).lineMetrics){if(r+l>i){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=vi(h),d=Tb(h.text),p={...t,font:h,maxHeight:i-r};let g=Iu(d,{...p,overflow:"hide"},s);if(g.length===0)if(t.textWrap==="never")g=Iu(d,p,s);else{g=Iu(d,p);const m=n.at(-1);m&&(m.text+=`
|
|
`,s=0)}if(g.length===0){a();break}const f=g.findIndex(Gs);f!==-1&&(g=g.slice(0,f+1));const y=g.at(-1);for(const m of g){const v=Nb(m),x=u.measureText(v),M={...h,text:v,textMetrics:x};m===y?s+=x.width:(M.text+=`
|
|
`,s=0),r+=x.height,n.push(M)}if(f!==-1)break}}return n}function Du(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 oo=1e3,lr=oo*60,ia=lr*60,na=ia*24,cx=na*7,Gg=na*30,Ql=na*365,lo=new Date().getTimezoneOffset()*lr,co={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:oo,hierarchy:"day",encode(e,t){const i=t?0:lo;return Math.floor((e.getTime()-i)/oo)},decode(e,t){const i=t?0:lo;return new Date(i+e*oo)}},minute:{milliseconds:lr,hierarchy:"day",encode(e,t){const i=t?0:lo;return Math.floor((e.getTime()-i)/lr)},decode(e,t){const i=t?0:lo;return new Date(i+e*lr)}},hour:{milliseconds:ia,hierarchy:"day",encode(e,t){const i=t?0:lo;return Math.floor((e.getTime()-i)/ia)},decode(e,t){const i=t?0:lo;return new Date(i+e*ia)}},day:{milliseconds:na,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*lr;return Math.floor((e.getTime()-i)/na)},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:Gg,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:Ql,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 ec(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 tc(e,t,i,n){if(i==null)return 0;const s=co[e];return Math.floor(s.encode(new Date(i),n))%t}function ho(e,t,i,n,s){const r=co[t];return Math.floor((r.encode(new Date(e),n)-s)/i)}function uo(e,t,i,n,s){return co[t].decode(e*i+s,n)}function Au(e,t,i,n,s){const r=new Date(e),a=ho(r,t,i,n,s);return uo(a,t,i,n,s)}function Cu(e,t,i,n,s){const r=new Date(Number(e)-1),a=ho(r,t,i,n,s);return uo(a+1,t,i,n,s)}function Ti(e,t){const{unit:i,step:n,epoch:s,utc:r}=ec(e),a=tc(i,n,s,r);return Au(t,i,n,r,a)}function hx(e,t){const{unit:i,step:n,epoch:s,utc:r}=ec(e),a=tc(i,n,s,r);return Cu(t,i,n,r,a)}function ux(e,t){const{unit:i,step:n,epoch:s,utc:r}=ec(e),a=tc(i,n,s,r);return uo(ho(Cu(t,i,n,r,a),i,n,r,a)-1,i,n,r,a)}function jg(e,t){const{unit:i,step:n,epoch:s,utc:r}=ec(e),a=tc(i,n,s,r);return uo(ho(Au(t,i,n,r,a),i,n,r,a)+1,i,n,r,a)}function Hg(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 ic(e,t,i,{extend:n=!1,visibleRange:s=[0,1],limit:r,defaultAlignment:a="start"}={}){const o=ec(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=tc(o.unit,o.step,u,o.utc);let[p,g]=Hg(t,i,s);p=n?Au(p,l,c,h,d):Cu(p,l,c,h,d),g=n?Cu(g,l,c,h,d):Au(g,l,c,h,d);const f=ho(p,l,c,h,d);let y=ho(g,l,c,h,d);return r!=null&&y-f>r&&(y=f+r),{range:[f,y],unit:l,step:c,utc:h,offset:d}}function ku(e,t,i,n){const{range:[s,r]}=ic(e,t,i,n);return Math.abs(r-s)}function hn(e,t,i,n){const{range:[s,r],unit:a,step:o,utc:l,offset:c}=ic(e,t,i,n),h=[];for(let u=s;u<=r;u+=1){const d=uo(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}=ic(e,t,i,n),h=Math.max(0,r-s+1),u=new Array(h);for(let d=0;d<h;d++)u[d]=s+d;return{encodedValues:u,encodingParams:{unit:a,step:o,utc:l,offset:c}}}function px(e,t){return uo(e,t.unit,t.step,t.utc,t.offset)}var $g=new Date().getTimezoneOffset()*6e4,aw=1e3,ow=6e4,lw=36e5;function cr(e,t){const{unit:i,step:n,utc:s,offset:r}=t,a=e*n+r;switch(i){case"millisecond":return a;case"second":return(s?0:$g)+a*aw;case"minute":return(s?0:$g)+a*ow;case"hour":return(s?0:$g)+a*lw;default:return co[i].decode(a,s).valueOf()}}function Ug(e,t,i,{extend:n,visibleRange:s,limit:r,defaultAlignment:a}={}){const{range:[o]}=ic(e,t,i,{extend:n,visibleRange:s,limit:r,defaultAlignment:a}),{range:[l]}=ic(e,t,i,{extend:n,limit:r,defaultAlignment:a});return o-l}function Ss(e){return typeof e=="string"?e:e.unit}function hr(e){return typeof e=="string"?1:e.step??1}function nc(e){return typeof e=="string"?void 0:e.epoch}function sc(e){return co[Ss(e)].hierarchy}function Ni(e){return hr(e)*co[Ss(e)].milliseconds}var ot=(e,t)=>({duration:Ni(e)*t,timeInterval:e,step:t}),wu=[ot({unit:"second"},1),ot({unit:"second"},5),ot({unit:"second"},15),ot({unit:"second"},30),ot({unit:"minute"},1),ot({unit:"minute"},5),ot({unit:"minute"},15),ot({unit:"minute"},30),ot({unit:"hour"},1),ot({unit:"hour"},3),ot({unit:"hour"},6),ot({unit:"hour"},12),ot({unit:"day"},1),ot({unit:"day"},2),ot({unit:"day",step:7},1),ot({unit:"day",step:7},2),ot({unit:"day",step:7},3),ot({unit:"month"},1),ot({unit:"month"},2),ot({unit:"month"},3),ot({unit:"month"},4),ot({unit:"month"},6),ot({unit:"year"},1)],gx=[1,2,5,10];function fx(e,t){return Math.abs(Math.round(e)-e)<t}function mx(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function po(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=go(e,t,i,n,s);if(!Number.isFinite(a))return{ticks:[],count:0,firstTickIndex:void 0};let o=e,l=t;fx(o/a,1e-12)||(o=Math.ceil(o/a)*a),fx(l/a,1e-12)||(l=Math.floor(l/a)*a),r!=null&&(r=Du(r,[e,t],[o,l]));const{ticks:c}=Lu(o,l,a,r),h=c.at(0);return{ticks:c,count:mx(o,l,a),firstTickIndex:h==null?void 0:Math.round((h-o)/a)}}var cw=Math.floor(2*cx/Gg*10)/10;function yx({timeInterval:e,step:t}){const i=Ni(e)*t,n=sc(e),s=n?Ni(n):void 0;return i<=(s??1/0)*cw}function Wg(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function rc(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=wu.findLast(p=>(!a||yx(p))&&l>p.duration),h=wu.find(p=>(!a||yx(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max(go(e,t,i,n,s),1)};if(h==null)return{unit:"year",step:o==null?go(e/Ql,t/Ql,i,n,s):1};const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return{unit:u.unit,step:hr(u)*d,epoch:Wg(u,{weekStart:r})}}function go(e,t,i,n=0,s=1/0){if(e===t)return te(1,n,s);if(i<1)return Number.NaN;const r=Math.abs(t-e),a=10**Math.floor(Math.log10(r/i));let o=Number.NaN,l=1/0,c=!1;for(const h of gx){const u=Math.ceil(r/(h*a)),d=u>=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 bx(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function hw(e,t){const i=Ah(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)+bx(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=bx(o);return Math.max(0,l-r)}))));const n=Lp(i);return s=>n(Number(s))}function Lu(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**Dh(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:mx(r,a,i),firstTickIndex:h==null?void 0:Math.round((h-r)/i)}}function fo(e,t){return e>=t?(Ii("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function Kg(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 gx){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 vx(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 Kt(e){return e instanceof Date?e.getTime():e}function ac(e){return e<oo?"millisecond":e<lr?"second":e<ia?"minute":e<ia*23?"hour":e<28*na?"day":e<Ql?"month":"year"}function Yg(e){if(e.length===0)return"millisecond";if(e.length===1)return Tu(e[0]);let t=1/0;for(let i=1;i<e.length;i++)t=Math.min(t,Math.abs(e[i].valueOf()-e[i-1].valueOf()));return ac(t)}function Tu(e){return Ti("second",e)<e?"millisecond":Ti("minute",e)<e?"second":Ti("hour",e)<e?"minute":Ti("day",e)<e?"hour":Ti("month",e)<e?"day":Ti("year",e)<e?"month":"year"}function Zg(e){const[t,i]=e.length===0?[0,0]:Nt([e[0].valueOf(),e.at(-1).valueOf()]),n=new Date(t).getFullYear(),s=new Date(i).getFullYear();if(n!==s)return;const r=new Date(t).getMonth(),a=new Date(i).getMonth();if(r!==a)return"year";const o=new Date(t).getDate(),l=new Date(i).getDate();return o!==l?"month":"day"}function Xg(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}function qg(e){return e!=null&&Object.hasOwn(e,"toString")&&dt(e.toString())}function xx(e){return e!=null&&Object.hasOwn(e,"valueOf")&&Be(e.valueOf())}function Nu(e){return Be(e)||bh(e)||xx(e)}function Sx(e,t){return e!=null&&(!t||Nu(e))}function Ou(e){return qg(e)&&Object.hasOwn(e,"id")?e.id:e}function Jg(e){return qg(e)&&Object.hasOwn(e,"value")?e.value:e}var sa={};Si(sa,{add:()=>uw,angle:()=>mw,apply:()=>Aw,distance:()=>pw,distanceSquared:()=>gw,equal:()=>Iw,from:()=>Dw,gradient:()=>bw,intercept:()=>vw,intersectAtX:()=>Sw,intersectAtY:()=>xw,length:()=>Eu,lengthSquared:()=>Mx,multiply:()=>dw,normalized:()=>fw,origin:()=>Ix,required:()=>Cw,rotate:()=>yw,round:()=>Mw,sub:()=>Qg});function uw(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 Qg(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 dw(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 Eu(e){return Math.hypot(e.x,e.y)}function Mx(e){return e.x*e.x+e.y*e.y}function pw(e,t){return Eu(Qg(e,t))}function gw(e,t){return Mx(Qg(e,t))}function fw(e){const t=Eu(e);return{x:e.x/t,y:e.y/t}}function mw(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function yw(e,t,i=Ix()){const n=Eu(e);return{x:i.x+n*Math.cos(t),y:i.y+n*Math.sin(t)}}function bw(e,t,i){const n=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/n}function vw(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function xw(e,t,i=0,n){return{x:e===1/0?1/0:(i-t)/e,y:n==null?i:n-i}}function Sw(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 Mw(e,t=2){return{x:Ih(e.x,t),y:Ih(e.y,t)}}function Iw(e,t){return e.x===t.x&&e.y===t.y}function Dw(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 Aw(e,t){return e.x=t.x,e.y=t.y,e}function Cw(e){return{x:e?.x??0,y:e?.y??0}}function Ix(){return{x:0,y:0}}var mo={};Si(mo,{bottomCenter:()=>Nw,center:()=>Tw,clone:()=>Pw,collides:()=>Fw,end:()=>ww,from:()=>Vw,height:()=>Ew,normalise:()=>Ru,origin:()=>Bw,round:()=>Rw,start:()=>kw,topCenter:()=>Lw,width:()=>Ow});function kw(e){return{x:e.x1,y:e.y1}}function ww(e){return{x:e.x2,y:e.y2}}function Lw(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function Tw(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function Nw(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function Ow(e){return Math.abs(e.x2-e.x1)}function Ew(e){return Math.abs(e.y2-e.y1)}function Rw(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function Pw(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function Fw(e,t){const i=Ru(e),n=Ru(t);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1}function Ru(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 Vw(e,t,i,n){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:n};if("width"in e)return Ru({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 Bw(){return{x1:0,y1:0,x2:0,y2:0}}function Wi(e){return le(e)&&e.type=="gradient"}function _w(e){return ae(e)&&e.every(Wi)}function Dx(e){return ae(e)&&e.every(t=>typeof t=="string")}function Ms(e){return e!==null&&le(e)&&e.type=="pattern"}function ra(e){return e!==null&&le(e)&&e.type=="image"}function zw(e){return Wi(e)||Ms(e)}function yo(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 Pu(e,t,i,n,s){if(s<=Math.min(e,n))return e<n?0:1;if(s>=Math.max(e,n))return e<n?1:0;let r=0,a=1,o=Number.NaN;for(let l=0;l<12;l+=1)o=(r+a)/2,yo(e,t,i,n,o)<s?r=o:a=o;return o}function oc(e,t,i,n,s,r,a,o,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*n,u=(1-l)*i+l*s,d=(1-l)*n+l*r,p=(1-l)*s+l*a,g=(1-l)*r+l*o,f=(1-l)*c+l*u,y=(1-l)*h+l*d,m=(1-l)*u+l*p,v=(1-l)*d+l*g,x=(1-l)*f+l*m,M=(1-l)*y+l*v;return[[{x:e,y:t},{x:c,y:h},{x:f,y},{x,y:M}],[{x,y:M},{x:m,y:v},{x:p,y:g},{x:a,y:o}]]}function Ax(e,t,i,n){const s=-e+3*t-3*i+n,r=2*(e-2*t+i),a=-e+t;if(s===0){if(r!==0){const l=-a/r;if(l>0&&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 Cx(e,t,i,n,s,r,a,o){const l=Ax(e,i,s,a),c=Ax(t,n,r,o);return[...l,...c]}function ef(e,t,i){const n=yo(e[0].x,e[1].x,e[2].x,e[3].x,.5),s=yo(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 kx(e,t,i,n,s,r,a,o,l,c,h=1){let d={value:ef([{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:y}=d.value;if(d=d.next,(p==null||f<p.distance)&&(p={distance:f,minDistance:y}),p!=null&&p.distance-y<=h)continue;const[m,v]=oc(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,.5),x=[ef(m,l,c),ef(v,l,c)].sort(wx);d=ix(d,x,wx)}return p?.distance??1/0}var wx=(e,t)=>t.minDistance-e.minDistance;function Gw({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;a<i?l=i:a>i+s&&(l=i+s);let c=o;o<n?c=n:o>n+r&&(c=n+r);const h=a-l,u=o-c;return Math.hypot(h,u)<=e.size/2}function Lx(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var jw={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 Tx(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;h<u;h++){const d=l[h],{point:p,label:g,anchor:f}=d,{text:y,width:m,height:v}=g,x=p.size/2;let M=0,D=0;if(x>0&&d.placement!=null){const k=jw[d.placement];M=(m/2+x+i)*k.x,D=(v/2+x+i)*k.y}let A=p.x-m/2+M,I=p.y-v/2+D;if(f&&(A-=(f.x-.5)*p.size,I-=(f.y-.5)*p.size),pu(t,A,I,m,v)&&!a.some(k=>Gw(k,A,I,m,v))&&!s.some(k=>Sg(k,A,I,m,v))){const k={index:h,text:y,x:A,y:I,width:m,height:v,datum:d};c.push(k),s.push(k)}}n.set(o,c)}}return n}function Nx(e){return e.type==="continuous"||e.type==="log"}function Ox(e){return e.type==="category"}function ur(e){return"variant"in e&&e.variant==="unit-time"}function Ex(e){return!("variant"in e)}function aa(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:Nx(e)&&Nx(t)?e.type===t.type&&zn(e.domain,t.domain)&&zn(e.range,t.range):Ox(e)&&Ox(t)?ur(e)&&ur(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:Ex(e)&&Ex(t)?e.inset===t.inset&&e.step===t.step&&zn(e.domain,t.domain):!1:!1}function lc(e){return e==null?!1:e.type==="category"?ur(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 Ki(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 Hw(e){const t=Ki(e);return t[0].x>t[1].x&&t.reverse(),t}function Rx(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 bo(e,t,i){const[n,s]=Ki(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 tf(e,t,i){const{moveTo:n}=e,[s,r]=Hw(e),{x:a,y:o}=s,{x:l,y:c}=r;if(i<a)return bo(e,s,s);if(t>l)return bo(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=Pu(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[u,d]=oc(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=Pu(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=oc(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(A=>A.x<=t);let d=h.findIndex(A=>A.x>=i);d===-1&&(d=h.length);const p=u>=0?h[u]:void 0,g=p?.x??a,f=p?.y??o,y=d<h.length?h[d]:void 0,m=y?.x??l,v=y?.y??c,x=f===v?void 0:(v-f)/(m-g),M=x==null?f:x*(g-a)+f,D=x==null?f:x*(m-a)+f;return{type:"multi-line",moveTo:n,x0:t,y0:M,x1:i,y1:D,midPoints:h.slice(Math.max(u,0),d)}}}}var Px=(e=>(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(Px||{});function Fx(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 $w={start:0,middle:.5,end:1};function Vx(e,t){const i=[];let n=0,s=Number.NaN,r=Number.NaN;const a=typeof t=="number"?t:$w[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 Bx(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;a<i.length;a+=1){const o=i[a-1],l=s[a-1],c=i[a],h=s[a],u=c.x-o.x,d=c.y-o.y;let p=u*t/3,g=u*l*t/3,f=u*t/3,y=u*h*t/3;h===0&&Math.abs(g)>Math.abs(d)&&(p*=Math.abs(d/g),g=Math.sign(g)*Math.abs(d)),l===0&&Math.abs(y)>Math.abs(d)&&(f*=Math.abs(d/y),y=Math.sign(y)*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-y,cp3x:c.x,cp3y:c.y})}return r}var nf=0,sf=1;function cc(e){return{x:{min:e?.x?.min??nf,max:e?.x?.max??sf},y:{min:e?.y?.min??nf,max:e?.y?.max??sf}}}var rf=class extends oe{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},Fu={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 af(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 _x(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(af(e,r)/7)+1:0}var Uw=0,zx=1,Gx=4;function jx(e,t=e.getFullYear()){const n=new Date(t,0,1).getDay(),s=(Gx-n+7)%7,r=new Date(t,0,s-(Gx-zx)+1);return r<=e?Math.floor(af(e,r)/7)+1:jx(e,t-1)}function Ww(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${Yt(Math.floor(i/60),2,"0")}${Yt(Math.floor(i%60),2,"0")}`}var Kw={a:e=>Fu.shortDays[e.getDay()],A:e=>Fu.days[e.getDay()],b:e=>Fu.shortMonths[e.getMonth()],B:e=>Fu.months[e.getMonth()],c:"%x, %X",d:(e,t)=>Yt(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>Yt(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>Yt(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":Yt(i,2,t??"0")},j:(e,t)=>Yt(af(e)+1,3,t??"0"),m:(e,t)=>Yt(e.getMonth()+1,2,t??"0"),M:(e,t)=>Yt(e.getMinutes(),2,t??"0"),L:(e,t)=>Yt(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)=>Yt(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>Yt(_x(e,Uw),2,t??"0"),V:(e,t)=>Yt(jx(e),2,t??"0"),w:(e,t)=>Yt(e.getDay(),2,t??"0"),W:(e,t)=>Yt(_x(e,zx),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>Yt(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>Yt(e.getFullYear(),4,t??"0"),Z:e=>Ww(e),"%":()=>"%"},Yw={_:" ",0:"0","-":""};function Yt(e,t,i){const n=String(Math.floor(e));return n.length>=t?n:`${i.repeat(t-n.length)}${n}`}function vo(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=Yw[n];s!=null&&i++;const r=e[i+1],a=Kw[r];if(typeof a=="function")t.push([a,s]);else if(typeof a=="string"){const o=vo(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 Zw(e,t){const i=he("button",Vu("ag-charts-input ag-charts-button",t));return e.label===void 0?(i.append(Hx(e.icon)),i.ariaLabel=e.altText):i.append(e.label),i.addEventListener("click",e.onPress),Zr(i,t),i}function Xw(e,t){const i=he("input",Vu("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=>{Lg(n)&&(n.preventDefault(),i.click())}),Zr(i,t),i}function qw(e,t){const i=he("select",Vu("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(n=>{const s=he("option");return s.value=n.value,s.textContent=n.label,s})),ye(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",n=>e.onChange(i.value,n)),Zr(i,t),i}function Jw(e,t){const i=he("textarea",Vu("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",n=>e.onChange(i.value,n)),Zr(i,t),ye(i,"data-preventdefault",!1),i}function Hx(e){const t=he("span",`ag-charts-icon ag-charts-icon-${e}`);return ye(t,"aria-hidden",!0),t}function Vu(e,t){return t==null?e:`${e} ${t.class}`}var $x=e=>e,Qw=e=>1-Math.cos(e*Math.PI/2),hc=e=>Math.sin(e*Math.PI/2),eL=e=>-(Math.cos(e*Math.PI)-1)/2,tL=e=>e*e,iL=e=>1-(1-e)**2,nL=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,Ux=e=>2*Math.asin(e)/Math.PI,xo=(e,t)=>e===t;function Y(e){return function(t,i){const n=`__${i}`;t[i]||lf(t,i,n,e)}}function Bu(e){return Y(e)}function oa(e){return Y(e)}function of(e){const t=e??{};return t.equals=zn,Y(e)}function He(e){return function(t,i){const n=`__${i}`;t[i]||lf(t,i,n,e)}}function uc(e){return function(t,i){const n=`__${i}`;t[i]||lf(t,i,n,e)}}function lf(e,t,i,n){const{changeCb:s,convertor:r,checkDirtyOnAssignment:a=!1}=n??{},o={changeCb:s,checkDirtyOnAssignment:a,convertor:r},l=aL(i,rL(sL(oL(i,o),o),o),o);function c(){return this[i]}Object.defineProperty(e,t,{set:l,get:c,enumerable:!0,configurable:!0})}function sL(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 Wx=Symbol("no-change");function rL(e,t){const{changeCb:i}=t;if(i){let s=function(a){const o=e.call(this,a);return o!==Wx&&r.call(this,this),o};var n=s;const r=i;return s}return e}function aL(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 oL(e,t){const{equals:i=xo}=t;function n(s){const r=this[e];return i(s,r)?Wx:(this[e]=s,this.onChangeDetection(e),s)}return n}var Kx=st(We,We),lL=Ie({...B,...j,...W,marker:Ks}),Yx={showInMiniChart:L,connectMissingData:L,interpolation:Fh,label:Pe,styler:lL,marker:Mn,tooltip:cv,shadow:Kn,...Se,...j,...B,...W,highlight:Kx,segmentation:Za},cf={...Yx,...Sn,highlight:Kx,type:Z(Ge("area")),xKey:Z(O),yKey:Z(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,legendItemName:O,stacked:L,stackGroup:O,normalizedTo:E};cf.yFilterKey=J(O);var Zx=st(bn,bn),Xx=Ie({...j,...B,...W,cornerRadius:w}),hf={direction:P("horizontal","vertical"),showInMiniChart:L,cornerRadius:w,styler:Xx,itemStyler:Xx,crisp:L,label:{...Pe,placement:P("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:w},errorBar:Fl,shadow:Kn,tooltip:ke,...Se,highlight:Zx,...j,...B,...W,segmentation:Za,width:Wn,widthRatio:X};hf.sparklineMode=J(L);var So={...hf,...Sn,highlight:Zx,type:Z(Ge("bar")),xKey:Z(O),yKey:Z(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,direction:P("horizontal","vertical"),grouped:L,stacked:L,stackGroup:O,normalizedTo:E,legendItemName:O,errorBar:Ph};So.yFilterKey=J(O),So.pickOutsideVisibleMinorAxis=J(L),So.focusPriority=J(E),So.simpleItemStyler=J(ze);var qx=st(We,Us),cL=Ie({...B,...W,marker:Ks}),uf={title:O,showInMiniChart:L,connectMissingData:L,interpolation:Fh,label:Pe,styler:cL,marker:Mn,tooltip:ke,errorBar:Fl,...Se,...B,...W,highlight:qx,segmentation:iv};uf.sparklineMode=J(L);var dc={...uf,...Sn,highlight:qx,type:Z(Ge("line")),xKey:Z(O),yKey:Z(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,stacked:L,stackGroup:O,normalizedTo:E,legendItemName:O,errorBar:Ph};dc.yFilterKey=J(O),dc.pickOutsideVisibleMinorAxis=J(L),dc.focusPriority=J(E);var Xe="13.1.0",Jx={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Jh,lineDash:[0],label:{enabled:!1}}},df={...Jx,nice:!1},_u={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},pf={style:[{stroke:{$ref:"gridLineColor"}}],width:2},hL={number:{gridLine:pf},time:{gridLine:pf},category:{gridLine:pf}},uL={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:{...df,interval:{values:[0]}},log:{...df},time:{...df},category:{...Jx}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{..._u,position:{..._u.position,anchorTo:"pointer"},range:"nearest"},axes:hL},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:_u},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:_u}}},Qx=Wt(dL);function dL(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:Qx(e.baseTheme,t)}:t}function e0(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 pL(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 gL(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 fL=Wt((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(dt(o)||ji(o)||yn(o))return pt(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 mL(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:y,max:m,tooltip:v,context:x,styleNonce:M,...D}=e,A={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:I,series:[k]=[],datumKey:C}=e0(p),T=D;k!=null&&Object.assign(T,k),T.tooltip={...v,renderer:fL(x,v,C)},A.theme=Qx(d,uL),A.data=I,A.series=[T];const N=T.type==="bar"&&T.direction==="horizontal",[R,F]=N?["left","bottom"]:["bottom","left"],G={...pL(f),position:R,...g==null?{}:{crosshair:g}},V={type:"number",gridLine:gL(f,!1,e),position:F,...y==null?{}:{min:y},...m==null?{}:{max:m}};return A.axes=N?{x:V,y:G}:{x:G,y:V},A}var gf=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],ff={visible:L,reverse:L,stroke:$,strokeWidth:w},pc={context:()=>!0,tooltip:ue,theme:ue,background:ue,container:ue,width:ue,height:ue,minWidth:ue,minHeight:ue,padding:ue,listeners:ue,locale:ue,data:ue,styleNonce:O,axis:El({number:{...ff,min:Ae(E,mi("max")),max:Ae(E,yi("min"))},category:{...ff,paddingInner:X,paddingOuter:X},time:{...ff,min:Ae(ne(E,fi),mi("max")),max:Ae(ne(E,fi),yi("min"))}},"axis options","category"),min:Ae(E,mi("max")),max:Ae(E,yi("min")),crosshair:{enabled:L,snap:L,...B,...W},xKey:O,yKey:O};pc.overrideDevicePixelRatio=J(E),pc.foreground=J(ue);var t0={type:"preset",name:"sparkline",version:Xe,options:El({area:{...pc,...K(cf,gf)},bar:{...pc,...K(So,gf)},line:{...pc,...K(dc,gf)}},"sparkline options"),create:mL,processData:e0},zu=Symbol("interpolate"),Gu=e=>e[zu]!=null,gc=class fl{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 fl(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.x<i&&(i=a.x),a.y<n&&(n=a.y),li(a.x,a.width)>s&&(s=li(a.x,a.width)),li(a.y,a.height)>r&&(r=li(a.y,a.height));return new fl(i,n,s-i,r-n)}static nearestBox(t,i,n){return Su(t,i,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:li(this.x,this.width),bottom:li(this.y,this.height),toJSON(){return{}}}}clone(){const{x:t,y:i,width:n,height:s}=this;return new fl(t,i,n,s)}equals(t){return gu(this,t)}containsPoint(t,i){return pu(this,t,i)}intersection(t){const i=Math.max(this.x,t.x),n=Math.max(this.y,t.y),s=Math.min(li(this.x,this.width),li(t.x,t.width)),r=Math.min(li(this.y,this.height),li(t.y,t.height));if(!(i>s||n>r))return new fl(i,n,s-i,r-n)}collidesBBox(t){return this.x<li(t.x,t.width)&&li(this.x,this.width)>t.x&&this.y<li(t.y,t.height)&&li(this.y,this.height)>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,i){if(this.containsPoint(t,i))return 0;const n=t-te(this.x,t,li(this.x,this.width)),s=i-te(this.y,i,li(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}[zu](t,i){return new fl(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)}};gc.zero=Object.freeze(new gc(0,0,0,0)),gc.NaN=Object.freeze(new gc(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var U=gc;function li(e,t){return e===-1/0&&t===1/0?1/0:e+t}function i0({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 n0(e){if(ce.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 s0(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var mf;function yL(){const e=gh();return mf??(mf=new e(1,1)),mf}var yf=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]=s0(t,i,n),o=gh();this.canvas=new o(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(n,0,0,n,0,0),n0(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?yL().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]=s0(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(){i0(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)}},bf=(e,t)=>Math.sign(e-t);function r0(e,t){if(typeof e=="number"&&typeof t=="number")return bf(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<s;r+=1){const a=bf(i[r],n[r]);if(a!==0)return a}return bf(i.length,n.length)}var a0=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(a0||{}),bL=5,la=class Zy{constructor(t){this.serialNumber=Zy._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=wn(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??Zy._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=at("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=at("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>=bL)throw i.errorCount=n,i;_.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{$p(this,t)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(t,i){this.batchLevel++;try{$p(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&&_.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${t} (${i.length}x)`,()=>{for(const n of i)_.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(t){t.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};la.className="AbstractNode",la._nextSerialNumber=0,la._debugEnabled=!1,b([He()],la.prototype,"visible",2),b([He({equals:ft,changeCb:la.handleNodeZIndexChange})],la.prototype,"zIndex",2);var Is=la,ju=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Hu=(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 o0(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 vL(e,t,i){return o0(e,t,i)??[0,e.length]}function l0(e,t,i){const n=o0(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 $u(e){const t=Jg(e.at(0)),i=Jg(e.at(-1));return t!=null&&i!=null?[t,i]:[void 0,void 0]}var c0=e=>{const t=Ne.fromString(e),[i,n,s]=Ne.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:n,h:s,a:t.a}},vf=1e-6,h0=e=>e.c<vf||e.l<vf||e.l>1-vf,xL=(e,t,i)=>{i=te(0,i,1);let n;if(h0(e))n=t.h;else if(h0(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 Ne.fromOKLCH(r,s,n,a)},Mo=class extends ju{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(c0)}update(){const{domain:e,range:t}=this;e.length<2&&(_.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const n=e[i-1],s=e[i];if(n>s){_.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,a)=>r-a);break}}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(c0)}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<t.length-2&&!(e<t[l+1]);l++);const d=t[l],p=t[l+1];c=(e-d)/(p-d)}const h=n[l],u=n[l+1];return xL(h,u,c).toRgbaString()}invert(){}getDomainMinMax(){return $u(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&_.warnOnce("Expected update to not invalidate scale"))}};b([Hu],Mo.prototype,"domain",2),b([Hu],Mo.prototype,"range",2);var xf=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const n=this.bbox??t;if(!n.isFinite())return;if(this._cache?.ctx===e&&this._cache.bbox.equals(n))return this._cache.gradient;const{stops:s,colorSpace:r}=this;if(s.length===0)return;if(s.length===1)return s[0].color;let a=this.createCanvasGradient(e,n,i);if(a==null)return;const o=r==="oklch",l=.05;let c=s[0];a.addColorStop(c.stop,c.color);for(let h=1;h<s.length;h+=1){const u=s[h];if(o){const d=new Mo;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let p=c.stop+l;p<u.stop;p+=l)a.addColorStop(p,d.convert(p)??"transparent")}a.addColorStop(u.stop,u.color),c=u}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:e,bbox:n,gradient:a},a}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);for(const{stop:n,color:s}of this.stops){const r=at("stop");r.setAttribute("offset",`${n}`),r.setAttribute("stop-color",`${s}`),i.appendChild(r)}return i}},SL=class extends xf{constructor(e,t,i=0,n){super(e,t,n),this.angle=i}createCanvasGradient(e,t,i){const{angle:s}=this,r=vs(s+-90),a=i?.centerX??t.x+t.width*.5,o=i?.centerY??t.y+t.height*.5;return e.createConicGradient(r,a,o)}createSvgGradient(e){return at("linearGradient")}},ML=class extends xf{constructor(e,t,i=0,n){super(e,t,n),this.angle=i}getGradientPoints(e){const{angle:i}=this,n=vs(i+90),s=Math.cos(n),r=Math.sin(n),a=e.width,o=e.height,l=e.x+a*.5,c=e.y+o*.5,h=Math.hypot(o,a)/2,u=Math.atan2(o,a);let d;n<Math.PI/2?d=n:n<Math.PI?d=Math.PI-n:n<1.5*Math.PI?d=n-Math.PI:d=2*Math.PI-n;const p=h*Math.abs(Math.cos(d-u));return{x0:l+s*p,y0:c+r*p,x1:l-s*p,y1:c-r*p}}createCanvasGradient(e,t){const{x0:i,y0:n,x1:s,y1:r}=this.getGradientPoints(t);if(!(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(s)||Number.isNaN(r)))return e.createLinearGradient(i,n,s,r)}createSvgGradient(e){const{x0:t,y0:i,x1:n,y1:s}=this.getGradientPoints(e),r=at("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(n)),r.setAttribute("y2",String(s)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},IL=class extends xf{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const n=i?.centerX??t.x+t.width*.5,s=i?.centerY??t.y+t.height*.5,r=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(n,s,r,n,s,a)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,n=at("radialGradient");return n.setAttribute("cx",String(t)),n.setAttribute("cy",String(i)),n.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),n.setAttribute("gradientUnits","userSpaceOnUse"),n}},Sf=class extends oe{constructor(){super(...arguments),this.color="black"}};b([S],Sf.prototype,"stop",2),b([S],Sf.prototype,"color",2);function DL(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function u0(e){return e.flatMap((t,i)=>{const{stop:n}=t,s=e.at(i+1)?.color;return s==null?[t]:[t,{stop:n,color:s}]})}function AL(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"?u0(n):n}function d0(e,t,i,n="continuous"){const s=e.map(g=>typeof g=="string"?{color:g}:g);if(s.length===0)return AL(t,n);if(!DL(s))return _.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<s.length;g+=1){const f=s[g];if(g>=h){h=s.length-1;for(let m=g+1;m<s.length;m+=1)if(s[m]?.stop!=null){h=m;break}}let y=f?.stop;if(y==null){const m=s[c]?.stop,v=s[h]?.stop,x=m??r,M=v??a,D=o&&m==null?1:0;y=x+(M-x)*(g-c+D)/(h-c+D)}else c=g;l[g]=Math.max(0,Math.min(1,(y-r)/(a-r)))}let u=s.find(g=>g.color!=null)?.color,d;const p=s.map((g,f)=>{let y=g?.color;const m=l[f];return y!=null?u=y:u==null?(d==null&&(d=new Mo,d.domain=[0,1],d.range=t),y=d.convert(m)):y=u,{stop:m,color:y}});return n==="discrete"?u0(p):p}var CL=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?(_.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=vs(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,y=l*h-c*u,m=c*h+l*u,v=y/2,x=m/2,M=gp();e?.setTransform(new M([l*d,c*p,-c*d,l*p,g-v,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=at("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=at("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=at("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}},kL=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,$e=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,wL=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,p0=/^[01]/,LL={z:[],h:[$e],v:[$e],m:[$e,$e],l:[$e,$e],t:[$e,$e],s:[$e,$e,$e,$e],q:[$e,$e,$e,$e],c:[$e,$e,$e,$e,$e,$e],a:[$e,$e,$e,p0,p0,$e,$e]};function TL(e){if(!e)return;const t=[];let i=0,n;for(;i<e.length;){const s=kL.exec(e.slice(i));let r;if(s==null){if(!n){_.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=n}else r=s[1],i+=s[0].length;const a=NL(r,e,i);if(!a)return;i=a[0],n=r,t.push(a[1])}return t}function NL(e,t,i){const n=LL[e.toLocaleLowerCase()],s={command:e,params:[]};for(const r of n){const a=t.slice(i),o=r.exec(a);if(o!=null){s.params.push(Number.parseFloat(o[0])),i+=o[0].length;const l=wL.exec(a.slice(o[0].length));l!=null&&(i+=l[0].length)}else{if(s.params.length===1)return[i,s];_.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,s]}function OL(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function EL(e,t,i,n=1e-6){if(Math.abs(e)<n)return OL(t,i);const s=t*t-4*e*i,r=[];if(Math.abs(s)<n){const a=-t/(2*e);a>=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 RL(e,t,i,n,s=1e-6){if(Math.abs(e)<s)return EL(t,i,n,s);const r=t/e,a=i/e,o=n/e,l=(3*a-r*r)/9,c=(9*r*a-27*o-2*r*r*r)/54,h=l*l*l+c*c,u=1/3,d=[];if(h>=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),y=Math.abs(Math.sqrt(3)*(g-f)/2),m=-u*r+(g+f);if(m>=0&&m<=1&&d.push(m),Math.abs(y)<s){const v=-u*r-(g+f)/2;v>=0&&v<=1&&d.push(v)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=u*r,f=2*Math.sqrt(-l),y=f*Math.cos(u*p)-g,m=f*Math.cos(u*(p+2*Math.PI))-g,v=f*Math.cos(u*(p+4*Math.PI))-g;y>=0&&y<=1&&d.push(y),m>=0&&m<=1&&d.push(m),v>=0&&v<=1&&d.push(v)}return d}function fc(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 PL(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),y=g0(e,i,s,a),m=g0(t,n,r,o),v=p*y[0]+g*m[0],x=p*y[1]+g*m[1],M=p*y[2]+g*m[2],D=p*y[3]+g*m[3]+f,A=RL(v,x,M,D);for(const I of A){const k=I*I,C=I*k,T=y[0]*C+y[1]*k+y[2]*I+y[3],N=m[0]*C+m[1]*k+m[2]*I+m[3];let R;l===h?R=(N-c)/(u-c):R=(T-l)/(h-l),R>=0&&R<=1&&d++}return d}function g0(e,t,i,n){return[-e+3*t-3*i+n,3*e-6*t+3*i,-3*e+3*t,e]}var Io=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=xl();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),y=e+h*g+d*f,m=t+u*g+p*f,v=(y-this.cx)**2+(m-this.cy)**2;this.openedPath?v>1e-6&&this.lineTo(y,m):this.moveTo(y,m);let x=o?-bi(r-a):bi(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),D=x/M,A=4/3*Math.tan(D/4);for(let I=0;I<M;I+=1){const k=r+D*(I+0),C=r+D*(I+1),T=l*Math.sin(k),N=l*Math.cos(k),R=l*Math.sin(C),F=l*Math.cos(C),G=N-A*T,V=T+A*N,H=F+A*R,q=R-A*F,z=F,ie=R;this.cubicCurveTo(e+h*G+d*V,t+u*G+p*V,e+h*H+d*q,t+u*H+p*q,e+h*z+d*ie,t+u*z+p*ie)}}arc(e,t,i,n,s,r){this.ellipse(e,t,i,i,0,n,s,r)}appendSvg(e){const t=TL(e);if(t==null)return!1;let i=0,n=0,s,r,a=0,o=0;for(const{command:l,params:c}of t){s??(s=c[0]),r??(r=c[1]);const h=l===l.toLowerCase(),u=h?s:0,d=h?r:0;switch(l.toLowerCase()){case"m":this.moveTo(u+c[0],d+c[1]),s=u+c[0],r=d+c[1],i=s,n=r;break;case"c":this.cubicCurveTo(u+c[0],d+c[1],u+c[2],d+c[3],u+c[4],d+c[5]),a=u+c[2],o=d+c[3],s=u+c[4],r=d+c[5];break;case"s":this.cubicCurveTo(s+s-a,r+r-o,u+c[0],d+c[1],u+c[2],d+c[3]),a=u+c[0],o=d+c[1],s=u+c[2],r=d+c[3];break;case"q":this.cubicCurveTo((u+2*c[0])/3,(d+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),a=c[0],o=c[1],s=c[2],r=c[3];break;case"t":this.cubicCurveTo((s+2*(s+s-a))/3,(r+2*(r+r-o))/3,(2*(s+s-a)+c[0])/3,(2*(r+r-o)+c[1])/3,c[0],c[1]),a=s+s-a,o=r+r-o,s=c[0],r=c[1];break;case"a":this.svgEllipse(s,r,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],u+c[5],d+c[6]),s=u+c[5],r=d+c[6];break;case"h":this.lineTo(u+c[0],r),s=u+c[0];break;case"l":this.lineTo(u+c[0],d+c[1]),s=u+c[0],r=d+c[1];break;case"v":this.lineTo(s,d+c[0]),r=d+c[0];break;case"z":this.closePath(),s=i,r=n;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(e,t,i,n,s,r,a,o,l){i=Math.abs(i),n=Math.abs(n);const c=(e-o)/2,h=(t-l)/2,u=Math.sin(s),d=Math.cos(s),p=d*c+u*h,g=-u*c+d*h,f=p/i,y=g/n;let m=f*f+y*y,v=(e+o)/2,x=(t+l)/2,M=0,D=0;m>=1?(m=Math.sqrt(m),i*=m,n*=m):(m=Math.sqrt(1/m-1),r===a&&(m=-m),M=m*i*y,D=-m*n*f,v+=d*M-u*D,x+=u*M+d*D);const A=Math.atan2((g-D)/n,(p-M)/i),I=Math.atan2((-g-D)/n,(-p-M)/i)-A,k=A+I,C=!!(1-a);this.ellipse(v,x,i,n,s,A,k,C)}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=xl();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<s;d++)switch(i[d]){case 0:u+=fc(o,l,c,h,r,a,e,t),c=n[p++],o=c,h=n[p++],l=h;break;case 1:u+=fc(c,h,n[p++],n[p++],r,a,e,t),c=n[p-2],h=n[p-1];break;case 2:u+=PL(c,h,n[p++],n[p++],n[p++],n[p++],n[p++],n[p++],r,a,e,t),c=n[p-2],h=n[p-1];break;case 3:u+=fc(o,l,c,h,r,a,e,t);break}return u%2===1}distanceSquared(e,t){let i=1/0;const n=this.commands,s=this.params,r=this.commandsLength;let a=Number.NaN,o=Number.NaN,l=0,c=0;for(let h=0,u=0;h<r;h++)switch(n[h]){case 0:l=a=s[u++],c=o=s[u++];break;case 1:{const d=l,p=c;l=s[u++],c=s[u++],i=fu(e,t,d,p,l,c,i);break}case 2:{const d=l,p=c,g=s[u++],f=s[u++],y=s[u++],m=s[u++];l=s[u++],c=s[u++],i=kx(d,p,g,f,y,m,l,c,e,t)**2;break}case 3:i=fu(e,t,l,c,a,o,i);break}return i}toSVG(e=(t,i)=>({x:t,y:i})){const t=[],{commands:i,params:n}=this,s=(a,o)=>{t.push(a);for(let l=0;l<o;l+=2){const{x:c,y:h}=e(n[r++],n[r++]);t.push(c,h)}};let r=0;for(let a=0;a<this.commandsLength;a++)switch(i[a]){case 0:s("M",2);break;case 1:s("L",2);break;case 2:s("C",6);break;case 3:s("Z",0);break}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,n,s,r]=[1/0,1/0,-1/0,-1/0],[a,o]=[Number.NaN,Number.NaN],[l,c]=[Number.NaN,Number.NaN];const h=(d,p)=>{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;d<this.commandsLength;d++)switch(e[d]){case 0:h(t[u++],t[u++]),l=a,c=o;break;case 1:h(t[u++],t[u++]);break;case 2:{const g=a,f=o,y=t[u++],m=t[u++],v=t[u++],x=t[u++],M=t[u++],D=t[u++],A=Cx(g,f,y,m,v,x,M,D);for(const I of A){const k=yo(g,y,v,M,I),C=yo(f,m,x,D,I);h(k,C)}h(M,D);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new U(n,i,s-n,r-i)}};function Ot(e,t,i){const n=Math.round(t*e)/e;return i==null?n:i===0?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-n}function f0(e,t){return Math.floor(t*e)/e}function Mf(e,t,i){const{width:n,height:s,padding:r,strokeWidth:a}=t,o=n/2,l=s/2,c=Math.max(1,n-r-a/2),h=Math.max(1,s-r-a/2);let u=!1;for(const[d,p]of i){const g=o+(d-.5)*c,f=l+(p-.5)*h;u?e.lineTo(g,f):e.moveTo(g,f),u=!0}e.closePath()}var m0={circles(e,{width:t,strokeWidth:i,padding:n}){const s=t/2,r=Math.max(1,s-n-i/2);e.arc(s,s,r,0,Math.PI*2)},squares(e,{width:t,height:i,pixelRatio:n,padding:s,strokeWidth:r}){const a=s+r/2;e.moveTo(Ot(n,a),Ot(n,a)),e.lineTo(Ot(n,t-a),Ot(n,a)),e.lineTo(Ot(n,t-a),Ot(n,i-a)),e.lineTo(Ot(n,a),Ot(n,i-a)),e.closePath()},triangles(e,t){Mf(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){Mf(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:n}){const r=Math.max(1,(t-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/2+Math.cos(h)*c,d=i/2+Math.sin(h)*c;e.lineTo(u,d)}e.closePath()},hearts(e,{width:t,height:i,padding:n}){const s=Math.max(1,t/4-n/2),r=t/2,a=i/2+s/2;e.arc(r-s,a-s,s,Ut(130),Ut(330)),e.arc(r+s,a-s,s,Ut(220),Ut(50)),e.lineTo(r,a+s),e.closePath()},crosses(e,t){Mf(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:n,strokeWidth:s}){const r=Ot(n,t/2)-s%2/2;e.moveTo(r,0),e.lineTo(r,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:n,strokeWidth:s}){const r=Ot(n,i/2)-s%2/2;e.moveTo(0,r),e.lineTo(t,r)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:n}){const s=Math.atan2(i,t),r=n*Math.cos(s),a=n*Math.sin(s);e.moveTo(-r,a),e.lineTo(r,-a),e.moveTo(-r,i+a),e.lineTo(t+r,-a),e.moveTo(t-r,i+a),e.lineTo(t+r,i-a)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:n}){const s=Math.atan2(i,t),r=n*Math.cos(s),a=n*Math.sin(s);e.moveTo(t-r,-a),e.lineTo(t+r,a),e.moveTo(-r,-a),e.lineTo(t+r,i+a),e.moveTo(-r,i-a),e.lineTo(r,i+a)}},FL=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:n,padding:s,strokeWidth:r,path:a}=this,o=new Io;let l=m0[t]!=null;return a&&l&&(l=!o.appendSvg(a)),l&&m0[t](o,{width:i,height:n,pixelRatio:e,strokeWidth:r,padding:s}),o}renderStroke(e,t){const{stroke:i,strokeWidth:n,strokeOpacity:s}=this;n&&(t.strokeStyle=i,t.lineWidth=n,t.globalAlpha=s,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:n}=this;i!=="none"&&(t.fillStyle=i,t.globalAlpha=n,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:n,scale:s,backgroundFill:r,backgroundFillOpacity:a}=this;if(i*s<1||n*s<1)return _.warnOnce("Pattern fill is too small to render, ignoring."),null;const o=new yf({width:i,height:n,pixelRatio:t*s}),l=o.context;r!=="none"&&(l.fillStyle=r,l.globalAlpha=a,l.fillRect(0,0,i,n));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=e.createPattern(o.canvas,"repeat");return this.setPatternTransform(h,t),o.destroy(),h}setPatternTransform(e,t,i=0,n=0){if(e==null)return;const s=vs(this.rotation),r=1/t,a=Math.cos(s)*r,o=Math.sin(s)*r,l=gp();e.setTransform(new l([a,o,-o,a,i,n]))}createPattern(e,t){if(this._cache?.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);if(i!=null)return this._cache={ctx:e,pattern:i,pixelRatio:t},i}toSvg(){const{width:e,height:t,fill:i,fillOpacity:n,backgroundFill:s,backgroundFillOpacity:r,stroke:a,strokeWidth:o,strokeOpacity:l,rotation:c,scale:h}=this,u=at("pattern");u.setAttribute("viewBox",`0 0 ${e} ${t}`),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const d=at("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("fill",s),d.setAttribute("fill-opacity",String(r)),u.appendChild(d);const p=at("path");return p.setAttribute("fill",i),p.setAttribute("fill-opacity",String(n)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",a),p.setAttribute("stroke-width",String(o)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(p),u}};function y0(e,t){const{fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r}=t;i&&e.setAttribute("font-style",i),n&&e.setAttribute("font-weight",String(n)),s!=null&&e.setAttribute("font-size",String(s)),r&&e.setAttribute("font-family",r)}function VL(e,t){const{stroke:i,strokeWidth:n,strokeOpacity:s}=t;i&&e.setAttribute("stroke",i),n!=null&&e.setAttribute("stroke-width",String(n)),s!=null&&e.setAttribute("stroke-opacity",String(s))}function BL(e,t){const{lineDash:i,lineDashOffset:n}=t;if(i?.some(s=>s!==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 Is{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(Wi(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=d0(s,["black"],[0,1]);switch(a&&(o=o.map(l=>({color:l.color,stop:1-l.stop})).reverse()),n){case"linear":return new ML(i,o,r);case"radial":return new IL(i,o);case"conic":return new SL(i,o,r)}}getPattern(t){if(Ms(t))return this.createPattern(t)}createPattern(t){return new FL(t)}getImage(t){if(ra(t))return this.createImage(t)}createImage(t){return new CL(this.imageLoader,t)}onFillChange(){typeof this.fill=="object"&&ft(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 Ot(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(Wi(n)&&this.fillGradient){i??(i=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=xu();r.setAttribute("id",a),i.push(r),t.setAttribute("fill",`url(#${a})`)}else if(Ms(n)&&this.fillPattern){i??(i=[]);const r=this.fillPattern.toSvg(),a=xu();r.setAttribute("id",a),i.push(r),t.setAttribute("fill",`url(#${a})`)}else if(ra(n)&&this.fillImage){i??(i=[]);const r=this.layerManager?.canvas?.pixelRatio??1,a=this.fillImage.toSvg(this.getBBox(),r),o=xu();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;VL(t,{stroke:dt(i)?i:void 0,strokeOpacity:n,strokeWidth:s}),BL(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||!Wi(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())}};b([He()],Bt.prototype,"drawingMode",2),b([He()],Bt.prototype,"fillOpacity",2),b([He()],Bt.prototype,"strokeOpacity",2),b([uc({equals:ft,changeCb:Bt.handleFillChange})],Bt.prototype,"fill",2),b([oa({equals:ft,changeCb:Bt.handleStrokeChange})],Bt.prototype,"stroke",2),b([He()],Bt.prototype,"strokeWidth",2),b([of()],Bt.prototype,"lineDash",2),b([He()],Bt.prototype,"lineDashOffset",2),b([He()],Bt.prototype,"lineCap",2),b([He()],Bt.prototype,"lineJoin",2),b([He()],Bt.prototype,"miterLimit",2),b([He({convertor:e=>te(0,e??1,1)})],Bt.prototype,"opacity",2),b([oa({equals:xo,checkDirtyOnAssignment:!0})],Bt.prototype,"fillShadow",2),b([uc({equals:gu,changeCb:e=>e.onFillChange()})],Bt.prototype,"fillBBox",2),b([uc({equals:ft,changeCb:e=>e.onFillChange()})],Bt.prototype,"fillParams",2);var ca=Bt,b0=[1,0,0,1,0,0],ha=class lp{get e(){return[...this.elements]}constructor(t=b0){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 lp?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 lp(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 lp([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,y;d===0?(f=0,y=0):(f=o?.rotationCenterX??0,y=o?.rotationCenterY??0);const m=r,v=a,x=h*(1-l)-f,M=u*(1-c)-y;return t.setElements([p*l,g*l,-g*c,p*c,p*x-g*M+f+m,g*x+p*M+y+v]),t}};function dr(e){return x0(e.constructor)}var v0=Symbol("isMatrixTransform");function x0(e){return e[v0]===!0}function If(e){var t,i;const n=e;if(x0(e))return e;const s=Symbol("matrix_combined_transform");class r extends n{constructor(){super(...arguments),this[i]=new ha,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(b0),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=at("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=v0,i=s,r[t]=!0,r}function Do(e){var t;const i=e,n=Symbol("matrix_rotation");class s extends If(i){constructor(){super(...arguments),this[t]=new ha,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:o,rotationCenterX:l,rotationCenterY:c}=this;o!==0&&(ha.updateTransformMatrix(this[n],1,1,o,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[n]))}}return t=n,b([Y()],s.prototype,"rotationCenterX",2),b([Y()],s.prototype,"rotationCenterY",2),b([Y()],s.prototype,"rotation",2),s}function _L(e){return"scalingX"in e&&"scalingY"in e&&"scalingCenterX"in e&&"scalingCenterY"in e}function Uu(e){var t;const i=e,n=Symbol("matrix_scale");class s extends If(i){constructor(){super(...arguments),this[t]=new ha,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||(ha.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,b([Y()],s.prototype,"scalingX",2),b([Y()],s.prototype,"scalingY",2),b([Y()],s.prototype,"scalingCenterX",2),b([Y()],s.prototype,"scalingCenterY",2),s}function Ao(e){var t;const i=e,n=Symbol("matrix_translation");class s extends If(i){constructor(){super(...arguments),this[t]=new ha,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:o,translationY:l}=this;o===0&&l===0||(ha.updateTransformMatrix(this[n],1,1,0,o,l),a.multiplySelf(this[n]))}}return t=n,b([Y()],s.prototype,"translationX",2),b([Y()],s.prototype,"translationY",2),s}var tt=class{static fromCanvas(e,t){const i=[];for(const n of e.traverseUp())dr(n)&&i.unshift(n);for(const n of i)t=n.fromParent(t);return dr(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():dr(e)&&(t=e.toParent(t));for(const i of e.traverseUp())dr(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const n=[];for(const s of e.traverseUp())dr(s)&&n.unshift(s);for(const s of n)({x:t,y:i}=s.fromParentPoint(t,i));return dr(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){dr(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const n of e.traverseUp())dr(n)&&({x:t,y:i}=n.toParentPoint(t,i));return{x:t,y:i}}},Wu,Df=class oh extends Is{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=t?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=t?.optimizeForInfrequentRedraws===!0}static is(t){return t instanceof oh}static computeChildrenBBox(t,i=!0){return U.merge(Is.extractBBoxes(t,i))}static compareChildren(t,i){return r0(t.__zIndex,i.__zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return oh.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 ca&&(n=Math.max(n,d.strokeWidth));const r=Math.max(1,n/2*s),{x:a,y:o}=tt.toCanvasPoint(this,0,0),l=f0(t,a+i.x-r)-a,c=f0(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 Wu?.pixelRatio===n?Wu.resize(t,i,n):Wu=new yf({width:t,height:i,pixelRatio:n}),Wu}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)}markDirty(t){this.dirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of uv(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;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:y}=u,m=Math.floor(f*l),v=Math.floor(y*l);if(m>0&&v>0){const x=this.prepareSharedCanvas(f,y,l);d(x,l,0,0,l,-p*l,-g*l),c={bitmap:x.transferToImageBitmap(),x:p,y:g,width:f,height:y}}}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(oh.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=tt.toCanvas(this,this.clipRect));for(const s of this.children()){if(!s.visible){n&&(n.nodesSkipped+=s.childNodeCounts.nonGroups+s.childNodeCounts.groups,n.opsSkipped+=s.childNodeCounts.complexity);continue}s.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 oh&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?tt.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}}};Df.className="Group",b([Y({convertor:e=>te(0,e,1)})],Df.prototype,"opacity",2);var re=Df,zL=class extends Uu(re){},xF=class extends Do(re){},Zt=class extends Ao(re){},Co=class extends Do(Ao(re)){},mt=class Ga{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=ce.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Is,i)?()=>new i:i}static select(t,i,n=!0){return new Ga(t,i,n)}static selectAll(t,i){const n=[],s=r=>{if(i(r)&&n.push(r),r instanceof re)for(const a of r.children())s(a)};return s(t),n}static selectByClass(t,...i){return Ga.selectAll(t,n=>i.some(s=>n instanceof s))}static selectByTag(t,i){return Ga.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;a++){const o=t[a];let l=n(o);if(s.has(l)){const c=(r.get(l)??0)+1;r.set(l,c),l=`${l}:${c}`}s.set(l,a)}for(const[a,o]of this._nodesMap.entries()){const l=s.get(o);l==null?this.garbageBin.add(a):(a.datum=t[l],this.garbageBin.delete(a),s.delete(o))}for(const[a,o]of s.entries()){const l=t[o];this._nodesMap.set(this.createNode(l,i,o),a)}}else{const s=Math.max(t.length,this.data.length);for(let r=0;r<s;r++)r>=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<this._nodes.length;t++){const i=this._nodes[t];yield{node:i,datum:i.datum,index:t}}}select(t){return Ga.selectAll(this.parentNode,t)}selectByClass(t){return Ga.selectByClass(this.parentNode,t)}selectByTag(t){return Ga.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}batchedUpdate(t){this.parentNode.batchedUpdate(t)}},mc=(e,{x0:t,y0:i,x1:n,y1:s,cx:r,cy:a},o,l)=>{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)},It=class extends ca{constructor(){super(...arguments),this.path=new Io,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 Io),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=at("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};It.className="Path",b([Y()],It.prototype,"clip",2),b([Y()],It.prototype,"clipX",1),b([Y()],It.prototype,"clipY",1);function Ku(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 Yu(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 I=Math.max(t,a.x),k=Math.min(t+n,a.x+a.width),C=Math.max(i,a.y),T=Math.min(i+s,a.y+a.height);e.rect(I,C,k-I,T-C)}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 I=Math.max(t,a.x),k=Math.min(t+n,a.x+a.width),C=Math.max(i,a.y),T=Math.min(i+s,a.y+a.height);a=new U(I,C,k-I,T-C)}const p=Math.max(u/s,d/n,1);p>1&&(o/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,y=!0,m=!0,v,x,M,D;if(g){const I=Ku(a.height,a.width,Math.max(t+o-a.x,0),Math.max(i+o-a.y,0),o);I.leadingClipped&&(m=!1),I.trailingClipped&&(f=!1);const k=Math.max(a.x+I.leading1,a.x),C=Math.max(a.y+I.leading0,a.y),T=Math.max(a.x+I.trailing1,a.x),N=Math.max(a.y+I.trailing0,a.y),R=t+o,F=i+o;v={x0:k,y0:C,x1:T,y1:N,cx:R,cy:F}}if(f){const I=Ku(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(t+n-l),0),l);I.leadingClipped&&(g=!1),I.trailingClipped&&(y=!1);const k=Math.min(a.x+a.width-I.leading0,a.x+a.width),C=Math.max(a.y+I.leading1,a.y),T=Math.min(a.x+a.width-I.trailing0,a.x+a.width),N=Math.max(a.y+I.trailing1,a.y),R=t+n-l,F=i+l;x={x0:k,y0:C,x1:T,y1:N,cx:R,cy:F}}if(y){const I=Ku(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);I.leadingClipped&&(f=!1),I.trailingClipped&&(m=!1);const k=Math.min(a.x+a.width-I.leading1,a.x+a.width),C=Math.min(a.y+a.height-I.leading0,a.y+a.height),T=Math.min(a.x+a.width-I.trailing1,a.x+a.width),N=Math.min(a.y+a.height-I.trailing0,a.y+a.height),R=t+n-c,F=i+s-c;M={x0:k,y0:C,x1:T,y1:N,cx:R,cy:F}}if(m){const I=Ku(a.width,a.height,Math.max(a.y+a.height-(i+s-h),0),Math.max(t+h-a.x,0),h);I.leadingClipped&&(y=!1),I.trailingClipped&&(g=!1);const k=Math.max(a.x+I.leading0,a.x),C=Math.min(a.y+a.height-I.leading1,a.y+a.height),T=Math.max(a.x+I.trailing0,a.x),N=Math.min(a.y+a.height-I.trailing1,a.y+a.height),R=t+h,F=i+s-h;D={x0:k,y0:C,x1:T,y1:N,cx:R,cy:F}}let A=!1;g&&v!=null&&(mc(e,v,o,!A),A||(A=!0)),f&&x!=null&&(mc(e,x,l,!A),A||(A=!0)),y&&M!=null&&(mc(e,M,c,!A),A||(A=!0)),m&&D!=null&&mc(e,D,h,!A),e.closePath()}var Dt=class extends It{constructor(){super(...arguments),this.borderPath=new Io,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(c<g){const m=o+g/2;t.moveTo(m,l),t.lineTo(m,l+h),u=g,this.borderClipPath=void 0}else if(h<g){const m=l+g/2;t.moveTo(o,m),t.lineTo(o+c,m),u=g,this.borderClipPath=void 0}else if(u<c&&u<h){const m=u/2;o+=m,l+=m,c-=u,h-=u;const v=d?.clone().shrink(m),x={topLeft:n>0?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&&(v==null||v?.width>0&&v?.height>0)&&(Yu(e,o,l,c,h,x,v),Yu(t,o,l,c,h,x,v))}else this.borderClipPath=this.borderClipPath??new Io,this.borderClipPath.clear(),this.borderClipPath.rect(o,l,c,h),t.rect(o,l,c,h);else{const m={topLeft:n,topRight:s,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,Yu(e,o,l,c,h,m,d)}if([n,s,r,a].every(GL)){let m=function(M,D){return x.getBBox().distanceSquared(M,D)};var y=m;const v=this.getBBox();this.hittester=v.containsPoint.bind(v);const x=this;this.distanceSquared=m}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}}};Dt.className="Rect",b([He()],Dt.prototype,"x",2),b([He()],Dt.prototype,"y",2),b([He()],Dt.prototype,"width",2),b([He()],Dt.prototype,"height",2),b([He()],Dt.prototype,"topLeftCornerRadius",2),b([He()],Dt.prototype,"topRightCornerRadius",2),b([He()],Dt.prototype,"bottomRightCornerRadius",2),b([He()],Dt.prototype,"bottomLeftCornerRadius",2),b([He({equals:gu})],Dt.prototype,"clipBBox",2),b([He()],Dt.prototype,"crisp",2);function GL(e){return e===0}function jL({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<t.length;){const d=t.slice(h),p=HL(d,h,l,c,a);if(!p)return;h+=p.processedBBoxCount,u.push(p.pageIndices)}return UL(u,e,t,s,r)}function HL(e,t,i,n,s){let a=KL(e,i);if(a<1){if(!s)return;a=1}let o=a;for(;o>=1;){const l=$L(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=l<o&&l>1?l:o,o--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function $L(e,t,i,n,s,r){const a=[];let o=0,l=0,c=[];const h=[];for(let u=0;u<e.length;u++){const d=(u+i)%i;d===0&&(o+=l,l=0,c.length>0&&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((m,v)=>m+v,0)>n.max&&!r)return h.length<i?h.length:void 0;c.push(u+t)}return c.length>0&&a.push(c),a.length>0?a:void 0}function UL(e,t,i,n,s){let r=0,a=0;return{pages:e.map(l=>{t==="horizontal"&&(l=WL(l));let c=0;const h=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let f=0,y=0;for(const m of g)f+=m.height+n,y=Math.max(y,m.width+s);return{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(y)}});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 WL(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 KL(e,t){const i=e.length;let n=0;for(let s=0;s<i;s++)if(n+=t.fn(e[s])+t.padding,n>t.max)return i/s<2?Math.ceil(i/2):s;return i}var S0=(e=>(e[e.Default=64]="Default",e[e.ZoomDrag=32]="ZoomDrag",e[e.Annotations=16]="Annotations",e[e.ContextMenu=8]="ContextMenu",e[e.Animation=4]="Animation",e[e.AnnotationsSelected=2]="AnnotationsSelected",e[e.Frozen=1]="Frozen",e[e.Clickable=82]="Clickable",e[e.Focusable=68]="Focusable",e[e.Keyable=86]="Keyable",e[e.ContextMenuable=72]="ContextMenuable",e[e.AnnotationsMoveable=18]="AnnotationsMoveable",e[e.AnnotationsDraggable=114]="AnnotationsDraggable",e[e.ZoomDraggable=100]="ZoomDraggable",e[e.ZoomClickable=68]="ZoomClickable",e[e.ZoomWheelable=118]="ZoomWheelable",e[e.All=126]="All",e))(S0||{}),M0=class{constructor(){this.stateQueue=68}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}},Af=(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))(Af||{}),YL=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(Af)){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})}};function yc(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 ZL={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){yc(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){yc(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,Ut(130),Ut(330)),e.arc(t+s,i-s,s,Ut(220),Ut(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){yc(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(Ot(s,t-r),Ot(s,i-r)),e.lineTo(Ot(s,t+r),Ot(s,i-r)),e.lineTo(Ot(s,t+r),Ot(s,i+r)),e.lineTo(Ot(s,t-r),Ot(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){yc(e,[[.5,0],[1,.87],[0,.87]])}},bc=class extends It{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=At.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=At.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"?ZL[t](o):typeof t=="function"&&t(o)}computeBBox(){const{x:e,y:t,size:i}=this,n=At.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)}};b([uc({equals:xo})],bc.prototype,"shape",2),b([He()],bc.prototype,"x",2),b([He()],bc.prototype,"y",2),b([He({convertor:Math.abs})],bc.prototype,"size",2);var At=class extends Do(Uu(Ao(bc))){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()}},XL=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){ce.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;_.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()}},ko,ua=0;function qL(){return ko??(ko=new XL),ko}function JL(){ua++;let e=!1;return()=>{e||ua===0||(e=!0,ua--,ua===0&&C0())}}function QL(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 e1(){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(QL(s));return`Heap ${n.join(" / ")}`}function I0(e,t,i,n,s={},r=U.zero,a){if(!ce.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,y=p-g,m=qL();m.recordTimings(f),m.recordTiming("\u23F1\uFE0F",y);const v=Object.entries(f).map(([z,ie])=>A0(z,ie)).filter(z=>z!=null).join(" + "),x=Object.entries(s).map(([z,ie])=>`${z}: ${JSON.stringify(ie)}`).join(" ; "),M=ce.check("scene:stats:verbose"),D=M?e1():null,A=M?Bs.flush():{},I=Object.entries(A),k=[],C=[];for(const[z,ie]of I)z.endsWith(":aggregation")&&Array.isArray(ie)?k.push(`${z.replace(":aggregation","")}(${ie.join(",")})`):z.endsWith(":nodeData")&&typeof ie=="number"&&C.push(`${z.replace(":nodeData","")}(${ie})`);const T=k.length>0?`Aggregation: ${k.join(", ")}`:null,N=C.length>0?`NodeData: ${C.join(", ")}`:null,R=[`${A0("\u23F1\uFE0F",g,p)} (${v})`,`${x}`,T,N,`Layers: ${M?Cf(o,l):e.size}`,M?`Nodes: ${Cf(c,h)}`:null,M?`Ops: ${Cf(u,d)}`:null,D].filter(dt),F=new Vg(i),G=new Map(R.map(z=>[z,F.measureText(z)])),V=Math.max(...Array.from(G.values(),z=>z.width)),H=a1(G.values(),z=>z.height),q=2+r.x;i.save();try{i.fillStyle=a?.background??"white",i.fillRect(q,0,V,H),i.fillStyle=a?.foreground??"black";let z=0;for(const[ie,de]of G.entries())z+=de.height,i.fillText(ie,q,z)}catch(z){_.warnOnce("Error during debug stats rendering",z)}finally{i.restore()}}function t1(e){const t=bl(Me("agChartsSceneDebug")),i=[];for(const n of t)n==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(n);e.debugNodeSearch=i}function i1(e,t){e.save();try{for(const[i,n]of Object.entries(t)){const s=tt.toCanvas(n);if(!s){_.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){_.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var n1=new Set,s1=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function r1(e){const{...t}=e;for(const i of Object.keys(t))s1.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(n1.add(i),delete t[i]);return t}function Zu(e,t){if(!ce.check(!0,"scene"))return{};let i=0;return{node:t==="json"?r1(e):e,name:e.name??e.id,dirty:e instanceof re?e.dirty:void 0,...Array.from(e instanceof re?e.children():[],n=>Zu(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})`),re.is(g)&&g.renderToOffscreenCanvas&&(r=`*${r}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,y=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`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 m=y,v=1;for(;n[m]!=null&&v<100;)m=`${y} (${v++})`;return n[m]=s,n},{})}}function D0(e){const t=e instanceof re?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof re?e.children():[],r=>D0(r)).filter(r=>r.paths.length>0),n=re.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??"<unknown>"]=a,r),{})},paths:s}}function Cf(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function A0(e,t,i){const n=i==null?t:i-t;return`${e}: ${Math.round(n*100)/100}ms`}function a1(e,t){let i=0;for(const n of e)i+=t(n);return i}function C0(e=!1){if(!ko){e&&(ua=0);return}!e&&ua>0||(ko.destroy(),ko=void 0,e&&(ua=0))}var Oi=class zi extends ca{constructor(t){super(t),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=zi.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(),ae(this.text))this.lines=[],this.richText??(this.richText=new re),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(t=>pt(t.text).split(zs)).filter(Boolean).map(()=>new zi({trimText:!1})));else{const t=pt(this.text).split(zs);this.lines=this.trimText?t.map(i=>i.trim()):t}}get font(){return this.fontCache??(this.fontCache=Sp(this)),this.fontCache}static measureBBox(t,i,n,s){if(ae(t)){const{font:r,lineHeight:a,textAlign:o,textBaseline:l}=s,{width:c,height:h,lineMetrics:u}=xs(t,r),d=a?a*u.length:h,p=zi.calcTopOffset(d,u[0],l),g=zi.calcLeftOffset(c,o);return new U(i-g,n-p,c,d)}else return zi.computeBBox(pt(t).split(zs),i,n,s)}static computeBBox(t,i,n,s){const{font:r,lineHeight:a,textAlign:o,textBaseline:l}=s,{width:c,height:h,lineMetrics:u}=vi(r).measureLines(t),d=a?a*u.length:h,p=zi.calcTopOffset(d,u[0],l),g=zi.calcLeftOffset(c,o);return new U(i-g,n-p,c,d)}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,vi(r).baselineDistance("middle")),0):t/2;case"bottom":return t;default:return 0}}static calcLeftOffset(t,i){let n=0;switch(i){case"center":n=.5;break;case"right":case"end":n=1}return t*n}getBBox(){const t=super.getBBox();if(!this.textMap?.size||!ae(this.text))return t;const{height:i,lineMetrics:n}=xs(this.text,this),s=zi.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.generateTextMap(),this.textMap?.size){const o=U.merge(this.textMap.values());return o.x=this.x-zi.calcLeftOffset(o.width,this.textAlign),o.y=this.y,o}const{x:t,y:i,lines:n,textBaseline:s,textAlign:r}=this,a=zi.computeBBox(n,t,i,{font:this,textBaseline:s,textAlign:r});return this.boxing!=null&&a.grow(this.boxPadding),a}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return Ze(this.text)}isPointInPath(t,i){return this.getBBox()?.containsPoint(t,i)??!1}setScene(t){this.richText?.setScene(t),super.setScene(t)}generateTextMap(){if(!ae(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 xs(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())return n&&(n.nodesSkipped+=1),super.render(t);if(ae(this.text)&&this.richText){this.generateTextMap();const s=this.richText.getBBox(),{width:r,height:a,lineMetrics:o}=xs(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-zi.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(zi.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??zi.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=vi(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 Dt({scene:this.scene})),this.boxing.fill=t.fill,this.boxing.fillOpacity=t.fillOpacity??1,this.boxing.cornerRadius=t.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=t.border?.strokeWidth??0,this.boxing.strokeOpacity=t.border?.strokeOpacity??1,this.boxPadding=t.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}getBoxingProperties(){const{fill:t,fillOpacity:i,cornerRadius: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=at("text");if(ae(t))for(const n of t){const s=at("tspan");y0(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=pt(n.text),i.append(s)}else this.applySvgFillAttributes(i),y0(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=pt(t);return{elements:[i]}}hasRenderableText(){const{text:t}=this;return t==null?!1:ae(t)?!0:pt(t)!==""}};Oi.className="Text",Oi.debug=ce.create(!0,"scene:text"),Oi.defaultFontSize=10,b([Y()],Oi.prototype,"x",2),b([Y()],Oi.prototype,"y",2),b([Bu({changeCb:e=>e.onTextChange()})],Oi.prototype,"text",2),b([Y({changeCb:e=>{e.fontCache=void 0}})],Oi.prototype,"fontStyle",2),b([Y({changeCb:e=>{e.fontCache=void 0}})],Oi.prototype,"fontWeight",2),b([Y({changeCb:e=>{e.fontCache=void 0}})],Oi.prototype,"fontSize",2),b([Y({changeCb:e=>{e.fontCache=void 0}})],Oi.prototype,"fontFamily",2),b([Y()],Oi.prototype,"textAlign",2),b([Y()],Oi.prototype,"textBaseline",2),b([Y()],Oi.prototype,"lineHeight",2);var Ei=Oi,k0=class extends Do(Ei){},wo=class extends Do(Ao(Ei)){},Lo=class extends oe{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};b([S],Lo.prototype,"color",2),b([S],Lo.prototype,"fontStyle",2),b([S],Lo.prototype,"fontWeight",2),b([S],Lo.prototype,"fontSize",2),b([S],Lo.prototype,"fontFamily",2);var Ds=class extends oe{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};b([S],Ds.prototype,"size",2),b([S],Ds.prototype,"fill",2),b([S],Ds.prototype,"fillOpacity",2),b([S],Ds.prototype,"stroke",2),b([S],Ds.prototype,"strokeWidth",2),b([S],Ds.prototype,"strokeOpacity",2);var Xu=class extends oe{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};b([Vt({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Xu.prototype,"shape",2),b([S],Xu.prototype,"size",2),b([S],Xu.prototype,"padding",2);var da=class extends oe{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=wn(this),this.marker=new Xu(this),this.activeStyle=new Ds,this.inactiveStyle=new Ds,this.highlightStyle=new Ds,this.label=new Lo,this.group=new Zt({name:"pagination"}),this.labelNode=new Ei,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new At,this.previousButton=new At,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){switch(this._orientation=e,e){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:n,fontStyle:s,fontWeight:r,fontSize:a,fontFamily:o}}=this;i.text=`${e+1} / ${t}`,i.fill=n,i.fontStyle=s,i.fontWeight=r,i.fontSize=a,i.fontFamily=o}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(9)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(9)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=tt.toCanvas(this.previousButton),t=tt.toCanvas(this.nextButton);return{prev:e,next:t}}};da.className="Pagination",b([S],da.prototype,"marker",2),b([S],da.prototype,"activeStyle",2),b([S],da.prototype,"inactiveStyle",2),b([S],da.prototype,"highlightStyle",2),b([S],da.prototype,"label",2);function w0(e,t,i,n){if(Wi(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(Ms(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 ra(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 kf(e,t,i,n){return!Wi(e?.fill)&&!Ms(e?.fill)&&!ra(e?.fill)?e:{...e,fill:w0(e.fill,t,i,n)}}var o1=class{constructor(e){this.callback=e,this.devicePixelRatio=Me("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=Me("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=Me("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},L0=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,n]of this.queuedObserveRequests)this.observe(i,n);this.queuedObserveRequests=[],this.observeWindow()};const e=fp();e!==void 0&&(this.resizeObserver=new e(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 o1(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=Gi("readyState")==="complete",this.documentReady?this.observeWindow():Me()?.addEventListener("load",this.onLoad)}destroy(){Me()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width: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){if(!this.documentReady){this.queuedObserveRequests.push([e,t]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},T0=.1,N0=200,O0=12,l1=.5,c1=class{constructor(){this.events=new ps,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,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<a;u+=1){const d=o-e,p=l-t,g=-(N0*d+O0*c)/T0,f=-(N0*p+O0*h)/T0;c+=g*r,h+=f*r,o+=c*r,l+=h*r}Math.hypot(o-e,l-t)<l1?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=o,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}},qu=null;function To(e){const t=Ze(e);return t===""?"":(qu??(qu=he("div")),qu.textContent=t,qu.innerHTML.replaceAll(`
|
|
`,"<br>"))}var Yi=class extends ca{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 fu(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=at("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]}}};Yi.className="Line",b([Y()],Yi.prototype,"x1",2),b([Y()],Yi.prototype,"y1",2),b([Y()],Yi.prototype,"x2",2),b([Y()],Yi.prototype,"y2",2);function h1(e,t,i=t*(5/3)){const n=new re,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 Yi;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 At;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 y=At.anchor(l),m=a/2+(y.x-.5)*t,v=o/2+(y.y-.5)*t,x=t/(t+s);f.x=m,f.y=v,f.scalingCenterX=m,f.scalingCenterY=v,f.scalingX=x,f.scalingY=x,n.append(f)}return re.toSVG(n,a,o)}var _t="ag-charts-tooltip",u1="ag-charts-tooltip--dark";function As(e){return e==null?!1:Array.isArray(e)?e.some(t=>As(t.text)):pt(e).trim()!==""}function pa(e,t=!1){return e==null?!t:typeof e=="number"&&!Number.isFinite(e)}function d1(e){return e.type==="raw"||!e.data||e.data.length===0?!1:e.data.every(t=>t.missing===!0)}function E0(e){const t=[],i=new Map;for(const n of e)if(!d1(n))if(n.type==="structured"){const{heading:s}=n,r=As(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 p1(e){const t=E0(e),i=[];for(const n of t)if(n.type!=="raw"){As(n.heading)&&i.push(Ze(n.heading));for(const s of n.items)if(As(s.title)&&i.push(Ze(s.title)),s.data)for(const r of s.data)r.missing!==!0&&i.push(r.label??r.fallbackLabel,Ze(r.value))}return i.filter(n=>n!=="").join("; ")}function R0(e,t,i){let n="";As(e)?(n+=`<span class="${_t}-label">${To(e)}</span>`,n+=" ",n+=`<span class="${_t}-value">${To(t)}</span>`):n+=`<span class="${_t}-label">${To(t)}</span>`;const s=[`${_t}-row`];return i&&s.push(`${_t}-row--inline`),n=`<div class="${s.join(" ")}">${n}</div>`,n}function g1(e){let t="";if(e.data?.length&&e.data.every(r=>r.missing===!0))return t;const i=As(e.title),n=!i&&e.data?.length===1,s=e.symbol==null?void 0:h1(e.symbol,12);if(s!=null&&(i||e.data?.length)&&(t+=`<span class="${_t}-symbol">${s}</span>`),i&&(t+=`<span class="${_t}-title">${To(e.title)}</span>`,t+=" "),e.data)for(const r of e.data)r.missing!==!0&&(t+=R0(r.label??r.fallbackLabel,Ze(r.value),n),t+=" ");return t}function P0(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${_t}-footer">${i}</div>`}function F0(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=Ze(s?.title);break;case"single":const h=As(t.heading);r=s!=null&&(!h||s.title==null)&&s.data?.length===1&&s.data[0].label==null&&s.data[0].value!=null,o=Ze(h?t.heading:s?.title);break;case"shared":r=!1}let l="";if(r&&s!=null){if(As(a)&&(l+=`<span class="${_t}-title">${To(a)}</span>`),s.data)for(const h of s.data)h.missing!==!0&&(l+=R0(h.label??o,Ze(h.value),!1),l+=" ")}else{As(t.heading)&&(l+=`<span class="${_t}-heading">${To(Ze(t.heading))}</span>`,l+=" ");for(const h of t.items)l+=g1(h)}if(l.length===0)return;const c=i!=="compact"&&n!=null?P0(e,n):void 0;return c+null&&(l+=c),l=`<div class="${_t}-content">${l.trimEnd()}</div>`,l}function f1(e,t){const i=t==null?void 0:P0(e,t);return i==null?"":`<div class="${_t}-content">${i}</div>`}function m1(e,t,i,n){const s=E0(t);if(s.length!==0){if(s.length===1&&s[0].type==="structured")return F0(e,s[0],i,n);{const r=s.map(a=>a.type==="structured"?F0(e,a,i):a.rawHtmlString);return n!=null&&r.push(f1(e,n)??""),r.join("")}}}var y1={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},b1={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},v1={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},V0={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},x1={pointer:"top",node:"top",chart:"top-left"},No=class extends oe{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};b([S],No.prototype,"xOffset",2),b([S],No.prototype,"yOffset",2),b([S],No.prototype,"anchorTo",2),b([S],No.prototype,"placement",2);var Ln=class extends oe{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new No,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new Qe,this.springAnimation=new c1,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new L0,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in Me().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",_t),this.element.setAttribute("popover","manual"),this.element.className=_t,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",_t),this.cleanup.flush(),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:n,relativeRect:s,meta:r}=i,{x:a,y:o}=this.springAnimation,l=r.position?.anchorTo??"pointer";let c=r.position?.placement??x1[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 y=0,m,v,x=!1;do{m=c[y],y+=1;const k=this.getTooltipBounds({elementSize:t,placement:m,anchorTo:l,canvasX:a,canvasY:o,yOffset:u,xOffset:h,canvasRect:n});v=nx(t.width,t.height,s,k),x=!1,V0[m]&1&&(x||(x=v.x<d||v.x>g)),V0[m]&2&&(x||(x=v.y<p||v.y>f))}while(y<c.length&&x);const M=te(d,v.x,g),D=te(p,v.y,f);x||(x=M!==v.x||D!==v.y);const A=l!=="chart"&&!x&&!h&&!u,I=r.showArrow??this.showArrow??A;this.arrowPosition=I?v1[m]:void 0,this.updateClassModifiers(),e.style.translate=`${M}px ${D}px`}show(e,t,i,n,s,r=!1){const{element:a}=this;if(a!=null&&n!=null&&n.length!==0){const c=m1(this.localeManager,n,this.mode,this.pagination?s:void 0);if(c==null){a.innerHTML="",this.toggle(!1);return}a.innerHTML=c}else if(a==null||a.innerHTML===""){this.toggle(!1);return}const o={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:o,meta:i},i.position?.anchorTo??"pointer"){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,a.style.pointerEvents="auto",a.removeAttribute("aria-hidden"),a.tabIndex=-1):(this.enableInteraction=!1,a.style.pointerEvents="none",a.setAttribute("aria-hidden","true"),a.removeAttribute("tabindex")),a.style.setProperty("--top",`${t.top}px`),a.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:e},t){const{interactive:i,interactiveLeave:n,enabled:s,element:r}=this;if(r==null)return!1;if(n)return!0;const a=i&&s&&this.isVisible()&&fh(e)&&this.contains(e);return a&&(this.interactiveLeave={callback:t,listener:o=>{(o.relatedTarget==null||fh(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,element:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback()))}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(i,n)=>e.toggle(`${_t}--${i}`,n);t("no-interaction",!this.enableInteraction),t("arrow-top",this.arrowPosition===1),t("arrow-right",this.arrowPosition===3),t("arrow-bottom",this.arrowPosition===2),t("arrow-left",this.arrowPosition===0),t("compact",this.mode==="compact"),e.toggle(u1,this.darkTheme);for(const i of this.wrapTypes)e.toggle(`${_t}--wrap-${i}`,i===this.wrapping)}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=y1[n],p=b1[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}};b([S],Ln.prototype,"enabled",2),b([S],Ln.prototype,"mode",2),b([S],Ln.prototype,"showArrow",2),b([S],Ln.prototype,"delay",2),b([S],Ln.prototype,"range",2),b([S],Ln.prototype,"wrapping",2),b([S],Ln.prototype,"position",2),b([S],Ln.prototype,"pagination",2),b([S],Ln.prototype,"darkTheme",2),b([S],Ln.prototype,"bounds",2);var S1=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=he("p"),this.itemDescription.style.display="none",this.itemDescription.id=Yl(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader: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,Ze(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=>s.onHover(u.sourceEvent,o)),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=tt.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}=tt.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=Ze(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 B0(e,{itemId:t,seriesId:i,label:{text:n}},s){const r={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:s,text:Ze(n),preventDefault:()=>r.defaultPrevented=!0}};return r}var Tn=class extends Zt{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new re({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Ei),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new At({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Yi({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=At.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}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};Tn.className="MarkerLabel",b([rt("label")],Tn.prototype,"text",2),b([rt("label")],Tn.prototype,"fontStyle",2),b([rt("label")],Tn.prototype,"fontWeight",2),b([rt("label")],Tn.prototype,"fontSize",2),b([rt("label")],Tn.prototype,"fontFamily",2),b([rt("label","fill")],Tn.prototype,"color",2),b([rr(e=>e.layoutLabel())],Tn.prototype,"spacing",2),b([rr(e=>e.layoutLabel())],Tn.prototype,"length",2),b([Y()],Tn.prototype,"isCustomMarker",2);function M1(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 pr=class extends oe{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"}};b([S],pr.prototype,"maxLength",2),b([S],pr.prototype,"color",2),b([S],pr.prototype,"fontStyle",2),b([S],pr.prototype,"fontWeight",2),b([S],pr.prototype,"fontSize",2),b([S],pr.prototype,"fontFamily",2),b([S],pr.prototype,"formatter",2);var Oo=class extends oe{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};b([S],Oo.prototype,"shape",2),b([S],Oo.prototype,"size",2),b([S],Oo.prototype,"padding",2),b([S],Oo.prototype,"strokeWidth",2),b([S],Oo.prototype,"enabled",2);var wf=class extends oe{};b([S],wf.prototype,"strokeWidth",2),b([S],wf.prototype,"length",2);var gr=class extends oe{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new Oo,this.label=new pr,this.line=new wf}};b([S],gr.prototype,"maxWidth",2),b([S],gr.prototype,"paddingX",2),b([S],gr.prototype,"paddingY",2),b([S],gr.prototype,"showSeriesStroke",2),b([S],gr.prototype,"marker",2),b([S],gr.prototype,"label",2),b([S],gr.prototype,"line",2);var Lf=class extends oe{};b([S],Lf.prototype,"legendItemClick",2),b([S],Lf.prototype,"legendItemDoubleClick",2);var _0={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},z0={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},G0={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},yt=class extends oe{constructor(e){super(),this.ctx=e,this.id=wn(this),this.group=new Zt({name:"legend",zIndex:16}),this.itemSelection=mt.select(this.group,Tn),this.containerNode=this.group.appendChild(new Dt({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new gr,this.listeners=new Lf,this.enabled=!1,this.position="bottom",this.border=new qr(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new Qe,this.size=[0,0],this._visible=!0,this.pagination=new da(i=>e.updateService.update(i),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),t["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(e.eventsHub.on("active:load-memento",i=>this.onActiveLoadMemento(i)),e.eventsHub.on("active:update",i=>this.onActiveUpdate(i)),e.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),e.eventsHub.on("legend:change-partial",this.onLegendDataChangePartial.bind(this)),e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new S1(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){ft(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(t=>!t.hideInLegend))}onLegendDataChangePartial(e){this.itemSelection.each(({proxyButton:t},{itemId:i})=>{if(t!=null)for(const 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=vi(s),g=r??e*.8,{markerWidth:f,anyLineEnabled:y}=this.calculateMarkerWidth();if(this.itemSelection.each((C,T)=>{C.fontStyle=o,C.fontWeight=l,C.fontSize=c,C.fontFamily=h;const N=this.updateMarkerLabel(C,T,f,y),R=T.itemId??T.id,F=this.getItemLabel(T),G=Ze(F,"<unknown>").replace(zs," ");C.text=this.truncate(G,a,g,N,d,R),u.push(C.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!Number.isFinite(e))return{};[e,t]=this.updateContainer(e,t);const m=this.size,v=this.oldSize;m[0]=e,m[1]=t,(m[0]!==v[0]||m[1]!==v[1])&&(v[0]=m[0],v[1]=m[1]);const{pages:x,maxPageHeight:M,maxPageWidth:D}=this.updatePagination(u,e,t),A=this.pages;this.pages=x,this.maxPageSize=[D-i,M-n];const I=this.pagination.currentPage,k=this.pages[I];return this.pages.length<1||!k?(this.visible=!1,{oldPages:A}):(this.visible=!0,this.updatePositions(I),this.update(),{oldPages:A})}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 At;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(Fe(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=ta(e,s,i-n,a);return Gs(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);this.pagination.orientation=n,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:r,maxPageHeight:a,maxPageWidth:o,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=r.findIndex(x=>x.endIndex>=s);this.pagination.currentPage=te(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,g=o-u,f=a-d;let y=0,m=-l.y-this.item.marker.size/2;c?m+=f+p:(y+=-l.x+g+p,m+=(f-l.height)/2),this.pagination.translationX=y,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((x,M,D)=>{D>(r[v]?.endIndex??1/0)&&v++,x.pageIndex=v}),{maxPageHeight:a,maxPageWidth:o,pages:r}}calculatePagination(e,t,i){const{paddingX:n,paddingY:s}=this.item,r=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:a}=Zh(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=m=>m.width===c.width&&m.height===c.height,y=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(g++>10){_.warn("unable to find stable legend layout.");break}c=h;const m=t-(l?0:c.width),v=i-(l?c.height:0),x=jL({orientation:o,bboxes:e,maxHeight:v,maxWidth:m,itemPaddingY:s,itemPaddingX:n,forceResult:y});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,p=[];i.each((g,f,y)=>{if(y<r||y>a){g.visible=!1;return}const m=y-r;let v,x;u?(v=m%c,x=Math.floor(m/c)):(v=Math.floor(m/h),x=m%h),g.visible=!0;const M=s[v];M&&(l=Math.floor(d*x),o=Math.floor(p[x]??0),p[x]=(p[x]??0)+M.columnWidth,g.translationX=o,g.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:n,pages:s}=this,{startIndex:r,endIndex:a}=s[e];r===0?this.paginationTrackingIndex=0:e===s.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((r+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:n,interactive:this.isInteractive()}),this.ctx.updateService.update(9)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){const e=this.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-series-visibility",e),this.ctx.contextMenuRegistry.toggle("toggle-other-series",e)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth: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 Ms(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),ra(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),kf({fill:t,stroke:i,strokeOpacity:n,fillOpacity:s,strokeWidth:this.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:o},_0,z0,G0)}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:n,fill:s,fillOpacity:r,padding:a}=this,o=typeof a=="number";return kf({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},_0,z0,G0)}computePagedBBox(){const e=re.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}=tt.toCanvasPoint(t,a,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:l,canvasY:c},{legendItem:n})}onClick(e,t,i){this.checkInteractionState()||this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick: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=B0("click",t,e);return n&&Cn([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.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.checkInteractionState()||this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService: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=B0("dblclick",t,e);if(i&&Cn([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.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=tt.toCanvas(t).computeCenter():(e.preventDefault(),i=tt.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){const s=a=>{if(a===void 0)this.ctx.activeManager.clear();else{const o=a.nodeDatum.series.id,l=a.itemId;this.ctx.activeManager.update({type:"legend",seriesId:o,itemId:l},void 0)}this.ctx.highlightManager.updateHighlight(this.id,a?.nodeDatum)},r=a=>{this.ctx.interactionManager.isState(64)||n?.initialState?s(a):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{s(a)}):a===void 0&&s(a)};if(e===!0&&i!==void 0&&t!==void 0){const a=t.itemId,o=M1(i,t);r({itemId:a,nodeDatum:o})}else r(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)_.warn(`Cannot find seriesId: "${t.seriesId}"`),e.reject();else if(i===void 0){const s=JSON.stringify({seriesId:t.seriesId,itemId:t.itemId});_.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}=Zh(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 y=this.spacing;let m,v;switch(t){case"top":m=(l-p.width)/2,v=0;break;case"bottom":m=(l-p.width)/2,v=c-p.height;break;case"right":m=l-p.width,v=(c-p.height)/2;break;case"left":m=0,v=(c-p.height)/2;break;case"top-right":case"right-top":m=l-p.width,v=0;break;case"top-left":case"left-top":m=0,v=0;break;case"bottom-right":case"right-bottom":m=l-p.width,v=c-p.height;break;case"bottom-left":case"left-bottom":m=0,v=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+y,M="top";break;case"bottom":case"bottom-right":case"bottom-left":x=p.height+y,M="bottom";break;case"left":case"left-top":case"left-bottom":x=p.width+y,M="left";break;case"right":case"right-top":case"right-bottom":x=p.width+y,M="right";break;default:f(t)}r.shrink(x,M)}m+=n,v+=s,this.group.translationX=Math.floor(a+m-p.x),this.group.translationY=Math.floor(o+v-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}=Zh(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)}};yt.className="Legend",b([S],yt.prototype,"toggleSeries",2),b([S],yt.prototype,"pagination",2),b([S],yt.prototype,"item",2),b([S],yt.prototype,"listeners",2),b([rr((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:n,stateManager:s}}=e;i===!1&&t===!0&&s.restoreState(n)}),S],yt.prototype,"enabled",2),b([S],yt.prototype,"position",2),b([S],yt.prototype,"maxWidth",2),b([S],yt.prototype,"maxHeight",2),b([S],yt.prototype,"reverseOrder",2),b([S],yt.prototype,"orientation",2),b([S],yt.prototype,"preventHidingAll",2),b([S],yt.prototype,"border",2),b([S],yt.prototype,"cornerRadius",2),b([S],yt.prototype,"fill",2),b([S],yt.prototype,"fillOpacity",2),b([S],yt.prototype,"padding",2),b([S],yt.prototype,"spacing",2),b([S],yt.prototype,"xOffset",2),b([S],yt.prototype,"yOffset",2);var Tf={type:"plugin",name:"legend",version:Xe,options:{enabled:L,position:Th,orientation:P("horizontal","vertical"),maxWidth:w,maxHeight:w,spacing:w,border:zr,cornerRadius:E,padding:Xa,fill:Ai,fillOpacity:X,preventHidingAll:L,reverseOrder:L,toggleSeries:L,item:{marker:{size:w,shape:Ws,padding:w,strokeWidth:w},line:{length:w,strokeWidth:w},label:{maxLength:w,formatter:ze,...Ce},maxWidth:w,paddingX:w,paddingY:w,showSeriesStroke:L},pagination:{marker:{size:w,shape:Ws,padding:w},activeStyle:{...j,...B},inactiveStyle:{...j,...B},highlightStyle:{...j,...B},label:Ce},listeners:{legendItemClick:ze,legendItemDoubleClick:ze}},themeTemplate:{...Iv,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:Hr.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 yt(e);return t.attachLegend(e.scene),t}},Nf=class extends yh{constructor(e){super(),this.ctx=e,this.localeText=void 0}};b([rr(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),S],Nf.prototype,"localeText",2),b([rr(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),S],Nf.prototype,"getLocaleText",2);var Of={type:"plugin",name:"locale",version:Xe,options:{localeText:$s,getLocaleText:$t(O)},create:e=>new Nf(e)},Ju=P("millisecond","second","minute","hour","day","month","year"),j0={unit:Z(Ju),step:Wn,epoch:fi,utc:L};j0.every=ze;var Ef=et(j0,"a time interval object"),Eo={enabled:L,text:O,padding:E,border:zr,cornerRadius:E,...Ce,...j},Cs=fe({enabled:L,type:Z(P("line","range")),range:Ae(fe((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),ee(ue),Wa(2,2)),value:Ae(fe((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),ue),label:Eo,fill:$,fillOpacity:X,...B,...W},"cross-line options"),H0={...Cs,label:{...Eo,position:P("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:E}},fr={enabled:L,rotation:E,avoidCollisions:L,minSpacing:w,spacing:w,formatter:$t(ai),itemStyler:Ie({...Ce,...rn,spacing:E}),...Ce,...rn},Qu={autoRotate:L,autoRotateAngle:E,wrapping:P("never","always","hyphenate","on-space"),truncate:L,...fr},$0={format:xn,...Qu},ed={format:ne(O,$s),...Qu},U0={enabled:L,width:w,size:w,stroke:$},Rf={enabled:L,label:ed,tick:U0},W0={values:ee(ue),minSpacing:w},Ro={reverse:L,gridLine:{enabled:L,width:w,style:Tt({fill:$,fillOpacity:w,stroke:ne($,Rl),strokeWidth:w,lineDash:ee(w)},"a grid-line style object array")},interval:W0,label:fr,line:{enabled:L,width:w,stroke:$},tick:U0,context:()=>!0};Ro.layoutConstraints=J({stacked:Z(L),align:Z(P("start","end")),unit:Z(P("percent","px")),width:Z(w)});var mr={...Ro,crossAt:{value:Z(ne(E,fi,O,ee(O))),sticky:L},crossLines:Tt(H0,"a cross-line options array"),position:P("top","right","bottom","left"),thickness:w,maxThicknessRatio:X,title:{enabled:L,text:ai,spacing:w,formatter:$t(ai),...Ce}};mr.title._enabledFromTheme=J(L);var td={enabled:L,...j,...B,...W};function ga(e,t){const i={enabled:L,xOffset:E,yOffset:E,formatter:$t(O),renderer:$t(ne(O,et({text:O,color:$,backgroundColor:$,opacity:X},"crosshair label renderer result object")))};let n;return e&&(n={...i,format:t?ne(O,et({millisecond:O,second:O,hour:O,day:O,month:O,year:O})):O}),{enabled:L,snap:L,label:n??i,...B,...W}}function vc(e,t){return{min:Ae(e,mi("max")),max:Ae(e,yi("min")),preferredMin:Ae(e,mi("preferredMax"),mi("max")),preferredMax:Ae(e,yi("preferredMin"),yi("min")),nice:L,interval:{step:t?ne(Wn,Ju,Ef):Wn,values:ee(e),minSpacing:Ae(w,mi("maxSpacing")),maxSpacing:Ae(w,yi("minSpacing"))}}}var K0={step:ne(Wn,Ju,Ef),values:ee(ne(E,fi)),minSpacing:Ae(w,mi("maxSpacing")),maxSpacing:Ae(w,yi("minSpacing")),placement:P("on","between")},Po={...mr,type:Ge("category"),label:Qu,paddingInner:X,paddingOuter:X,groupPaddingInner:X,crosshair:ga(),bandAlignment:P("justify","start","center","end"),bandHighlight:td,interval:{...W0,placement:P("on","between")}},Fo={...mr,type:Ge("grouped-category"),label:Qu,crosshair:ga(),bandHighlight:td,paddingInner:X,groupPaddingInner:X,depthOptions:Tt({label:{enabled:L,avoidCollisions:L,wrapping:P("never","always","hyphenate","on-space"),truncate:L,rotation:E,spacing:E,...Ce,...rn},tick:{enabled:L,stroke:$,width:w}},"depth options objects array")},Vo={...mr,...vc(E),type:Ge("number"),label:$0,crosshair:ga(!0)},Bo={...mr,...vc(E),type:Ge("log"),base:Ae(Wn,fe(e=>e!==1,"not equal to 1")),label:$0,crosshair:ga(!0)},_o={...mr,...vc(ne(E,fi),!0),type:Ge("time"),label:ed,parentLevel:Rf,crosshair:ga(!0,!0)},zo={...mr,type:Ge("unit-time"),unit:ne(Ef,Ju),label:ed,parentLevel:Rf,paddingInner:X,paddingOuter:X,groupPaddingInner:X,crosshair:ga(!0,!0),bandAlignment:P("justify","start","center","end"),bandHighlight:td,min:Ae(ne(E,fi),mi("max")),max:Ae(ne(E,fi),yi("min")),preferredMin:Ae(ne(E,fi),mi("preferredMax"),mi("max")),preferredMax:Ae(ne(E,fi),yi("preferredMin"),yi("min")),interval:K0},Pf=class LA extends ju{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 LA}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&&_.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const n=this.findIndex(t,i?.alignment);return n==null||n<0||n>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(n)}getDomainMinMax(){return $u(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;c<r&&(r=c,a=o),l<t?n=o+1:s=o-1}return a}update(){const[t,i]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:s}=this,r=this.getBandCountForUpdate();if(r===0)return;const a=i-t;let o;r===1?(n=0,o=a*(1-s*2)):o=a/Math.max(1,r-n+s*2);const l=this.round&&Math.floor(o)>0,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)}};b([Hu],Pf.prototype,"range",2),b([Hu],Pf.prototype,"round",2);var Nn=Pf,Go=class TA extends Nn{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof TA}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=Y0(a):(s&&(s=I1(a,i)),i=Y0([...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=Jp(a),a<=1)return l0(i,!1,n);r=Math.trunc(s.length/a);const o=a*r,l=Jp(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<d;f+=a)f>=0&&f<s.length&&p.push(s[f]);let g=p.length>0?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;r<s.length;r++)i.set(Kt(s[r]),r);this.indexInitialized=!0}return i.get(Kt(t))}};function Y0(e){let t;const i=new Set;for(const n of e){const s=Kt(n),r=i.size;i.add(s),i.size!==r?t?.push(n):t??(t=e.slice(0,i.size))}return t??e}function I1(e,t){let i=-1;for(const n of e){const s=t.indexOf(n);if(s===-1)i=1/0;else{if(s<=i)return!1;i=s}}return!0}var Z0={};Si(Z0,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>On,fromToMotion:()=>bt,staticFromToMotion:()=>ks});function D1(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function X0(e,t){if(typeof e=="string")try{e=Ne.fromString(e)}catch{e=Ne.fromArray([0,0,0])}if(typeof t=="string")try{t=Ne.fromString(t)}catch{t=Ne.fromArray([0,0,0])}return i=>Ne.mix(e,t,i).toRgbaString()}var Ff=.2,xc=["initial","remove","update","add","trailing","end","none"],id={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:Ff,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+Ff,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function A1(e){return e.every(t=>t instanceof Is)}function Vf(e){return A1(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function Bf(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,n)=>Bf(i,t[n])):Gu(e)&&Gu(t)?e.equals(t):xe(e)&&xe(t)?Bp(e,t,Bf):!1}var C1=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??$x,this.phase=e.phase;const t=e.duration??id[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 Bf(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"||Gu(t))return this.interpolateValue(e,t);if(Array.isArray(t)){const n=[];for(let s=0;s<t.length;s++){const r=this.createInterpolator(e[s],t[s]);r!=null&&n.push(r)}return 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(Gu(e))return i=>e[zu](t,i);try{switch(typeof e){case"number":return D1(e,t);case"string":return X0(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}`)}}},On={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function bt(e,t,i,n,s,r,a){const{fromFn:o,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=s,{nodes:h,selections:u}=Vf(n),d=(g,f)=>{let y,m=0,v=0;for(const x of f){const M=g[m]===x,D={last:v>=f.length-1,lastLive:m>=g.length-1,prev:f[v-1],prevFromProps:y,prevLive:g[m-1],next:f[v+1],nextLive:g[m+(M?1:0)]},A=`${e}_${t}_${x.id}`;i.stopByAnimationId(A);let I="unknown";M?r&&a&&(I=k1(x,x.datum,r,a)):I="removed",x.transitionOut=I==="removed";const{phase:k,start:C,finish:T,delay:N,duration:R,...F}=o(x,x.datum,I,D),{phase:G,start:V,finish:H,delay:q,duration:z,...ie}=l(x,x.datum,I,D),de=T==null;i.animate({id:A,groupId:e,phase:k??G??"update",duration:R??z,delay:N??q,from:F,to:ie,ease:hc,collapsable:de,onPlay:()=>{const pe={...C,...V,...F};c(x,pe,"start")},onUpdate(pe){c(x,pe,"update")},onStop:()=>{const pe={...C,...V,...F,...ie,...T,...H};c(x,pe,"end")}}),M&&m++,v++,y=F}};let p=0;for(const g of u){const f=g.nodes(),y=f.filter(m=>!g.isGarbage(m));d(y,f),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:hc,onStop(){g.cleanup()}}),p++}d(h,h)}function ks(e,t,i,n,s,r,a){const{nodes:o,selections:l}=Vf(n),{start:c,finish:h,phase:u}=a;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:s,to:r,ease:hc,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 y of g)y.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 k1(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 q0={};Si(q0,{resetMotion:()=>zt});function zt(e,t){const{nodes:i,selections:n}=Vf(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 J0=class Xy extends ju{constructor(t=[],i=[]){super(),this.range=i,this.defaultTickCount=Xy.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 Xy}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 Q0(...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]=Nt([a,o]);if(l<h)return s[0];if(l>u)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 $u(this.domain)}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};J0.defaultTickCount=5;var Ee=J0;function Q0(...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();l<i&&(i=l,t=o),l>s&&(s=l,n=o)}}return t!=null&&n!=null?{domain:[t,n],animatable:!0}:{domain:[],animatable:!1}}var w1=1e3,eS=20;function tS(e,t=0,i=e.length-1){const n=i-t+1;if(n<2)return{isUniform:!1};const s=Array.from({length:eS},(l,c)=>t+Math.floor(c*(n-1)/(eS-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;l<r.length;l++){const c=s[l]-s[l-1],h=(r[l]-r[l-1])/c;if(Math.abs(h-a)>o)return{isUniform:!1}}return{isUniform:!0,interval:a}}var qn=class NA extends Nn{static is(t){return t instanceof NA}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[0])return x[0];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),y=this.ordinalRange(u+d),v=(h-p)/(g-p)*(y-f)+f;return s?l-(v-o):v}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=ro(0,r-1,c=>this.ordinalRange(c)>=t)??r-1,s[a?r-1-o:o]}getUniformityCache(t){}findIndex(t,i=0){if(t==null)return;const n=this.numericBands,s=n.length;if(s===0)return;if(s===1)return 0;const r=t.valueOf();return i===1?ro(0,s-1,a=>n[a]>=r):ar(0,s-1,a=>n[a]<=r)}},qe=class extends oe{constructor(){super(...arguments),this.id=wn(this),this.node=new k0({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:n,wrapping:s}=this,r=Math.min(this.maxWidth??1/0,e)-n*2,a=this.maxHeight??t-n*2,o={maxWidth:r,maxHeight:a,font:this,textWrap:s};if(!Number.isFinite(r)&&!Number.isFinite(a)){this.node.text=i;return}let l;ae(i)?(l=zg(i,o),this.truncated=l.some(vh)):(l=ox(pt(i),o),this.truncated=Gs(l)),this.node.text=l}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(!this.enabled||!this.text){this.destroyProxyText();return}const n=tt.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=Ze(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}=tt.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:Ze(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}}};qe.className="Caption",qe.SMALL_PADDING=10,b([S,rt("node","visible")],qe.prototype,"enabled",2),b([S,rt("node")],qe.prototype,"text",2),b([S,rt("node")],qe.prototype,"textAlign",2),b([S,rt("node")],qe.prototype,"fontStyle",2),b([S,rt("node")],qe.prototype,"fontWeight",2),b([S,rt("node")],qe.prototype,"fontSize",2),b([S,rt("node")],qe.prototype,"fontFamily",2),b([S,rt("node","fill")],qe.prototype,"color",2),b([S],qe.prototype,"spacing",2),b([S],qe.prototype,"maxWidth",2),b([S],qe.prototype,"maxHeight",2),b([S],qe.prototype,"wrapping",2),b([S],qe.prototype,"padding",2),b([S],qe.prototype,"layoutStyle",2);var iS=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){_.errorOnce(n)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},Jn={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},L1={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"},ci={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},T1=/%[-_0]?L/,N1=/%[-_0]?S/,O1=/%[-_0]?M/,E1=/%[-_0]?[HI]/,R1=/^%[-_0]?[de]$/,P1=/^%[-_0]?[Bbm]$/,F1=/^%[-_0]?[Yy]$/;function V1(e,t,i){if(typeof e=="string")return e;e??(e=Jn);const{millisecond:n=Jn.millisecond,second:s=Jn.second,minute:r=Jn.minute,hour:a=Jn.hour,day:o=Jn.day,month:l=Jn.month,year:c=Jn.year}=e,h=ci[t],u=L1[t],d=i?ci[i]:-1;if(d<ci.year&&h>=ci.year&&!F1.test(c)||d<ci.month&&h>=ci.month&&!P1.test(l)||d<ci.day&&h>=ci.day&&!R1.test(o))return u;let p;switch(t){case"year":return c;case"month":return d<ci.year?`${l} ${c}`:l;case"day":return d<ci.year?`${l} ${o} ${c}`:`${l} ${o}`;case"hour":p=a;break;case"minute":p=r;break;case"second":p=s;break;case"millisecond":p=n;break;default:return u}if(h>=ci.hour&&!E1.test(p)||h>=ci.minute&&!O1.test(p)||h>=ci.second&&!N1.test(p)||h>=ci.millisecond&&!T1.test(p))return u;let g;return d<ci.year?g=`${l} ${o} ${c}`:d<ci.month&&(g=`${l} ${o}`),g?`${p} ${g}`:p}var jo=class cp extends iS{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=ql((t,i,n,s,r)=>{const a=cp.mergeSpecifiers(t,i)??Jn;return cp.getFormatter("date",a,n,s,{truncateDate:r})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const n of t)xe(n)&&xe(i)?i={...i,...n}:i=n;return i}static getFormatter(t,i,n,s="long",{truncateDate:r}={}){if(xe(i)){if(t!=="date"){_.warn("Date formatter configuration is not supported for non-date types.");return}n??(n="millisecond");const a=s==="component"?i?.[n]??Jn[n]:V1(i,n,r);return vo(a)}switch(t){case"number":{const a=Ah(i);return a==null?void 0:Lp(a)}case"date":return vo(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:pt(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=cp.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 ao(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"?ao(t.value):String(t.value)}}},fa=class{constructor(){this.enabled=!0}};b([S],fa.prototype,"enabled",2),b([S],fa.prototype,"stroke",2),b([S],fa.prototype,"strokeWidth",2),b([S],fa.prototype,"strokeOpacity",2);var Zi=class extends oe{constructor(){super(...arguments),this.border=new fa}};b([S],Zi.prototype,"border",2),b([S],Zi.prototype,"color",2),b([S],Zi.prototype,"cornerRadius",2),b([S],Zi.prototype,"fill",2),b([S],Zi.prototype,"fillOpacity",2),b([S],Zi.prototype,"fontStyle",2),b([S],Zi.prototype,"fontWeight",2),b([S],Zi.prototype,"fontSize",2),b([S],Zi.prototype,"fontFamily",2),b([S],Zi.prototype,"padding",2);var Xi=class extends Zi{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||ae(a)?a:String(a)}};b([S],Xi.prototype,"enabled",2),b([S],Xi.prototype,"formatter",2),b([S],Xi.prototype,"format",2),b([S],Xi.prototype,"itemStyler",2);function Ho(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 _f=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()}},Qn=class extends ca{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:y,lineJoin:m}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,g&&t.setLineDash([...g]),f&&(t.lineDashOffset=f),y&&(t.lineCap=y),m&&(t.lineJoin=m),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)}};Qn.className="Range",b([Y()],Qn.prototype,"x1",2),b([Y()],Qn.prototype,"y1",2),b([Y()],Qn.prototype,"x2",2),b([Y()],Qn.prototype,"y2",2),b([Y()],Qn.prototype,"startLine",2),b([Y()],Qn.prototype,"endLine",2),b([Y()],Qn.prototype,"horizontal",2);function nS(e,t){const i=e?.valueOf(),n=t?.valueOf();return typeof i!="number"||typeof n!="number"?[void 0,void 0]:i<n?[0,1]:[1,0]}function sS(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function rS(e,t){const i=sS(e);if(i==null)return!1;const n=Ee.is(t)||qn.is(t),s=r=>Sx(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 B1={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}},_1={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}},z1={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}},G1={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}},ma=class extends Zi{constructor(){super(...arguments),this.enabled=void 0,this.padding=5}};b([S],ma.prototype,"enabled",2),b([S],ma.prototype,"padding",2),b([S],ma.prototype,"text",2),b([S],ma.prototype,"position",2),b([S],ma.prototype,"rotation",2),b([S],ma.prototype,"parallel",2);var hi=class extends oe{constructor(){super(),this.id=wn(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new ma,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new re({name:this.id}),this.lineGroup=new re({name:this.id}),this.labelGroup=new re({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new Qn),this.crossLineLabel=this.labelGroup.appendChild(new wo),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||!rS(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 Nn?(l-o)/2:0;let[h,u]=Nt(r);h-=o,u+=o;let d,p,g,f;if(t==="line"){const y=o/2;if(d=s.convert(n)+y,p=Number.NaN,g=s.convert(n,{clamp:!0})+y,f=Number.NaN,g>=u||g<=h)return}else if(i){const[y,m]=i,[v,x]=nS(y,m);if(d=s.convert(y,{alignment:v}),p=s.convert(m,{alignment:x}),g=s.convert(y,{clamp:!0,alignment:v}),f=s.convert(m,{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=to(g,r),f=to(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}=this,s=Number.isFinite(i)?i-t:0;let r;switch(e){case"top":case"bottom":r=new U(t,e==="top"?0:-n,s,n);break;case"left":case"right":r=new U(e==="left"?0:-n,t,n,s)}this.updateRangeNode(r);const{label:a}=this;a.enabled!==!1&&a.text&&(this.updateLabel(),this.positionLabel(r))}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?z1:G1)[i]:(e?B1:_1)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:n}=this;t.rotation=Ut(i.rotation??0);const s=t.getBBox();if(!s)return;const{width:r,height:a}=s,o=i.padding+r/2,l=i.padding+a/2,c=e.x+e.width*(n.rangeH+1)/2-o*n.labelH,h=e.y+e.height*(n.rangeV+1)/2-l*n.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new wo;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=Ut(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:t,anchor:i}=this,n=this.computeLabelSize();if(!n)return;const{width:s,height:r}=n,a=t.padding+s,o=t.padding+r,l=this.position==="left"||this.position==="right";l&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,a):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,a))),l||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,o):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,o)))}};hi.className="CrossLine",b([S],hi.prototype,"enabled",2),b([S],hi.prototype,"type",2),b([S],hi.prototype,"range",2),b([S],hi.prototype,"value",2),b([S],hi.prototype,"defaultColorRange",2),b([S],hi.prototype,"fill",2),b([S],hi.prototype,"fillOpacity",2),b([S],hi.prototype,"stroke",2),b([S],hi.prototype,"strokeWidth",2),b([S],hi.prototype,"strokeOpacity",2),b([S],hi.prototype,"lineDash",2),b([S],hi.prototype,"label",2);var nd=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};b([S],nd.prototype,"enabled",2),b([S],nd.prototype,"width",2),b([S],nd.prototype,"style",2);var ya=class extends oe{};b([S],ya.prototype,"placement",2),b([S],ya.prototype,"step",2),b([S],ya.prototype,"values",2),b([S],ya.prototype,"minSpacing",2),b([S],ya.prototype,"maxSpacing",2);var Ke=class extends oe{constructor(){super(...arguments),this.enabled=!0,this.border=new fa,this.wrapping="never",this.truncate=!1,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(e,t,i,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??{},y=`${g}:${f??"none"}`;let m=this._formatters[y];const v=jo.mergeSpecifiers(p,r);(m?.type!==a||m?.unit!==u||!ft(m?.mergedFormat,v))&&(m={type:a,mergedFormat:v,unit:u,formatter:jo.getFormatter(a,v,u,g,{truncateDate:f})},this._formatters[y]=m),d=m.formatter?.(o,h)}return d==null||ae(d)?d:String(d)}};b([S],Ke.prototype,"enabled",2),b([S],Ke.prototype,"border",2),b([S],Ke.prototype,"cornerRadius",2),b([S],Ke.prototype,"fill",2),b([S],Ke.prototype,"fillOpacity",2),b([S],Ke.prototype,"fontStyle",2),b([S],Ke.prototype,"fontWeight",2),b([S],Ke.prototype,"fontSize",2),b([S],Ke.prototype,"fontFamily",2),b([S],Ke.prototype,"wrapping",2),b([S],Ke.prototype,"truncate",2),b([S],Ke.prototype,"spacing",2),b([S],Ke.prototype,"minSpacing",2),b([S],Ke.prototype,"color",2),b([S],Ke.prototype,"rotation",2),b([S],Ke.prototype,"avoidCollisions",2),b([S],Ke.prototype,"mirrored",2),b([S],Ke.prototype,"padding",2),b([S],Ke.prototype,"parallel",2),b([S],Ke.prototype,"itemStyler",2),b([S],Ke.prototype,"formatter",2),b([S],Ke.prototype,"format",2);var sd=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};b([S],sd.prototype,"enabled",2),b([S],sd.prototype,"width",2),b([S],sd.prototype,"stroke",2);var ba=class extends oe{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};b([S],ba.prototype,"enabled",2),b([S],ba.prototype,"width",2),b([S],ba.prototype,"size",2),b([S],ba.prototype,"stroke",2);var En=class extends oe{constructor(){super(...arguments),this.caption=new qe,this.enabled=!1,this.spacing=qe.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};b([S],En.prototype,"enabled",2),b([S],En.prototype,"text",2),b([S],En.prototype,"spacing",2),b([S],En.prototype,"fontStyle",2),b([S],En.prototype,"fontWeight",2),b([S],En.prototype,"fontSize",2),b([S],En.prototype,"fontFamily",2),b([S],En.prototype,"color",2),b([S],En.prototype,"wrapping",2),b([S],En.prototype,"formatter",2);var aS=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(aS||{});function j1(e){const[t,i]=Nt(e.range),n=Math.floor(t),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}var zf=Math.PI*2,H1=zf/2;function $1(e,t){return Math.abs(t-e)<H1?t:e>t?t+zf:t-zf}function U1(e){const{min:t,max:i}=e,n=l=>l<t||l>i;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:On[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:On.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:y}=u,m=l.opacity;return h==="removed"||n(u.y)?y=c.rotation:(h==="added"||n(l.datum.y))&&({x:d,y:p,rotationCenterX:g,rotationCenterY:f,rotation:y}=c,m=0),{x:d,y:p,rotationCenterX:g,rotationCenterY:f,rotation:y,opacity:m,phase:On[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:p,rotationCenterY:g}=c;let f=0,y=1;return h==="added"?f=c.rotation:h==="removed"?(y=0,f=c.rotation):f=$1(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:p,rotationCenterY:g,rotation:f,opacity:y,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:On.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function W1(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function rd(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function oS(){return(e,t)=>{const{x1:i,x2:n,y1:s,y2:r}=t;return{x1:i,x2:n,y1:s,y2:r}}}function K1(){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 lS=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(lS||{});function cS(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 hS(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,to(o,t),to(l,t)]}var yr=class OA{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new ya,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new En,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 re({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Co({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Co({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new re({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new Zt({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new re({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new re({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Co({name:`${this.id}-CrossLines-Range`,zIndex:6}),this.crossLineLineGroup=new Co({name:`${this.id}-CrossLines-Line`,zIndex:10}),this.crossLineLabelGroup=new Co({name:`${this.id}-CrossLines-Label`,zIndex:15}),this.tickLabelGroupSelection=mt.select(this.tickLabelGroup,wo,!1),this.line=new sd,this.tick=new ba,this.gridLine=new nd,this.label=this.createLabel(),this.defaultTickMinSpacing=OA.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 Qe,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new Vv(()=>{const{direction:n,boundSeries:s}=this;return ki(s.flatMap(r=>r.getFormatterContext(n)))}),this.moduleMap=new _f,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]=Nt(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]=Nt([i[0]-s*n[0],i[0]-s*n[0]+s]);return t<r?t-r:t>a?t-a:0}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange();for(const n of this.crossLines)this.initCrossLine(n)}onGridVisibilityChange(){}createLabel(){return new Ke}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=be(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.domain.reverse(),this.animatable=n}calculateDomain(t,i="none"){const{dataDomain:{domain:n},range:s,scale:r,gridLength:a}=this,o=Wr(s),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let u;if(h==null||!cS(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:y}=this,m=Wr(f),v=l.map(M=>M?1:2),{tickLayoutCache:x}=this;x==null||!cS(x,{domain:o,rangeExtent:m,nice:l,gridLength:y,visibleRange:s,initialPrimaryTickCount:t,scrollbarKey:n})?(c=this.calculateTickLayout(o,v,s,t),this.tickLayoutCache={domain:o,rangeExtent:m,nice:l,gridLength:y,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.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:A,step:I,epoch:k}=u;g={unit:A,step:I,epoch:k},f=u.truncateDate}const y=this.uncachedCallWithContext.bind(this),m={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:t,boundSeries:d},v=h??l,x=n?l.format:void 0,{allowNull:M}=this,D={specifier:jo.mergeSpecifiers(h?.format,l.format),truncateDate:f,allowNull:M};return(A,I)=>{const k=this.datumFormatParams(A,m,p,g,a);return k.value=A,v.formatValue(y,k,I,{specifier:x,dateStyle:a,truncateDate:f})??c.format(y,k,D)??c.defaultFormat(k,D)}}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 y;switch(n){case"crosshair":case"annotation-label":y=this.layout.label.fractionDigits+1;break;case"series-label":y=2;break;case"tooltip":y=3;break;case"legend-label":y=void 0;break}const m=this.datumFormatParams(i,{source:n,datum:a,seriesId:s,legendItemName:r,key:o,property:this.getFormatterProperty(),domain:l,boundSeries:f},y,void 0,"long"),{type:v,value:x}=m,M=this.createCallWithContext(t),D=c?.formatValue(M,v,x,h??m)??g.format(M,m,{allowNull:u})??this.label.formatValue(M,m,Number.NaN)??g.defaultFormat(m);return ae(D)?D:String(D)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}hasVisibleSeries(){return this.boundSeries.some(t=>t.isEnabled())}clipTickLines(t,i,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:Ee.is(t)||qn.is(t),getCanvasBounds:()=>tt.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(!Nn.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]=hS(i,n,r);return{id:s,value:r,band:[o,l],position:a}}measureBand(t){if(!Nn.is(this.scale))return;const[,i,n]=hS(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 Cn([this,n],t,i)}createCallWithContext(t){const{chartService:i}=this.moduleCtx;return(n,s)=>Cn([t,this,i],n,s)}};yr.defaultTickMinSpacing=50,yr.CrossLineConstructor=hi,b([S],yr.prototype,"nice",2),b([S],yr.prototype,"reverse",2),b([S],yr.prototype,"interval",2),b([S],yr.prototype,"title",2),b([rr((e,t,i)=>e.onGridLengthChange(t,i))],yr.prototype,"gridLength",2);var Gf=yr,jf=class extends Ke{constructor(){super(...arguments),this.autoRotateAngle=335}};b([S],jf.prototype,"autoRotate",2),b([S],jf.prototype,"autoRotateAngle",2);var ad=new Date(1970,0,4),$o=class EA extends Ee{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof EA}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;o<r;o++){const[l,c]=Z1(n,s,t,a);if(Kt(n)===Kt(l)&&Kt(s)===Kt(c))break;n=l,s=c}return[n,s]}ticks(t,i=this.domain,n=[0,1],{extend:s=!1}={}){const{nice:r,interval:a,tickCount:o=Ee.defaultTickCount,minTickCount:l,maxTickCount:c}=t;if(i.length<2)return;const h=i.map(Kt),u=h[0],d=h.at(-1);if(a!=null){const y=this.getPixelRange();return{ticks:uS({start:u,stop:d,interval:a,availableRange:y,visibleRange:n,extend:s})??Y1({start:u,stop:d,tickCount:o,minTickCount:l,maxTickCount:c,visibleRange:n,extend:s}),count:void 0}}else{if(r.every(Boolean)&&o===2)return{ticks:i,count:void 0};if(r.every(Boolean)&&o===1)return{ticks:i.slice(0,1),count:void 0}}const p=rc(u,d,o,l,c,{weekStart:ad});if(p==null)return;const g=hn(p,new Date(u),new Date(d),{visibleRange:n,extend:s}),f=Ug(p,new Date(u),new Date(d),{visibleRange:n,extend:s});return{ticks:g,count:void 0,firstTickIndex:f,timeInterval:p}}};function Y1({start:e,stop:t,tickCount:i,minTickCount:n,maxTickCount:s,visibleRange:r,extend:a}){const o=rc(e,t,i,n,s,{weekStart:ad});return o?hn(o,new Date(e),new Date(t),{visibleRange:r,extend:a}):[]}function uS({start:e,stop:t,interval:i,availableRange:n,visibleRange:s,extend:r}){if(!i)return[];if(xe(i)||typeof i=="string"){const u=hn(i,new Date(e),new Date(t),{visibleRange:s,extend:r});return fo(u.length,n)?void 0:u}const a=Math.abs(i);if(fo(Math.abs(t-e)/a,n))return;const o=wu.findLast(u=>a%u.duration===0);if(o){const{timeInterval:u,step:d,duration:p}=o,g={...u,step:d*hr(u)*Math.round(a/p),epoch:Wg(u,{weekStart:ad})};return hn(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 Z1(e,t,i,n){const{interval:s}=i,r=Math.min(Kt(e),Kt(t)),a=Math.max(Kt(e),Kt(t));let o;if(xe(s)||typeof s=="string")o=s;else{let u;typeof s=="number"&&(u=(a-r)/Math.max(s,1),fo(u,n)&&(u=void 0)),u??(u=i.tickCount??Ee.defaultTickCount),o=rc(r,a,u,i.minTickCount,i.maxTickCount,{weekStart:ad})}if(o==null)return[e,t];const l=hn(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 X1=1e3,br=class RA extends qn{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Ee.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof RA}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=dS(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>X1&&this._uniformityCache===void 0&&(this._uniformityCache=tS(i)),this._uniformityCache;const s=Math.floor(t[0]*n),r=Math.min(Math.ceil(t[1]*n),n-1);return tS(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=Dg(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()):Ig(a.slice())),{domain:a,animatable:!0}}return{domain:Ig(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:D}=this.getDefaultTicks(i,l,n,s);let A=x.length>0?this.findIndex(x[0]):void 0;return A=A==null?void 0:Math.floor((A-M)/D),{ticks:x,count:void 0,firstTickIndex:A}}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),y=uS({start:u,stop:d,interval:a,availableRange:f,visibleRange:n,extend:s})??this.getDefaultTicks(i,l,n,s).ticks,m=[];let v=-1;for(const x of y){const M=this.findIndex(x,1)??-1,D=M===v;v=M,!(r&&M===0)&&M!==-1&&!D&&m.push(c[M])}return{ticks:m,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-c<t&&a.pop(),a}bandCount(t=[0,1]){const{domain:i}=this,n=Math.floor(t[0]*i.length);return Math.ceil(t[1]*i.length)-n}getDefaultTicks(t,i,n,s){const{bands:r}=this,a=Math.ceil(r.length/i),o=Math.floor(a/2),l=t?this.bandDomainIndices(t):void 0;return{ticks:this.ticksEvery(l,n,a,o,s),tickOffset:o,tickEvery:a}}bandDomainIndices(t){const i=dS(t),n=this.findIndex(t[i?t.length-1:0],1)??0,s=this.findIndex(t[i?0:t.length-1],1)??this.bands.length-1;return[n,s]}ticksEvery([t,i]=[0,this.bands.length],n,s,r,a){const{bands:o}=this,l=t,c=i-t+1;let h=l+Math.floor(n[0]*c),u=l+Math.ceil(n[1]*c);a&&(h-=s,u+=s),h=Math.max(h,0),u=Math.min(u,o.length);let d;if(s<=1)d=o.slice(h,u);else{d=[];for(let p=h;p<u;p+=1)(p-l+r)%s===0&&d.push(o[p])}return d}};function dS(e){return e.length>0&&e[0]>e.at(-1)}var q1=1e3,Hf=5e7,vr=class PA extends qn{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=12,this._domain=[],this._bands=void 0}static is(t){return t instanceof PA}static supportsInterval(t,i){return pS(t,i)}set domain(t){t!==this._domain&&(this._domain=t,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(t){this._interval!==t&&(this._interval=t,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0)}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const t=this._encodingParams;this._bands=this._encodedBands.map(i=>px(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=>cr(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(ku(i,s,r,a)>Hf){_.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>q1&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=cr(this._encodedBands[0],this._encodingParams),s=cr(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=cr(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:cr(this._encodedBands[1],this._encodingParams)-n}}return{isUniform:!1}}normalizeDomains(...t){return Q0(...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=jg(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=cr(this._encodedBands[0],this._encodingParams),i=cr(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*a<o&&c===n-1)return}else if(r+c*a>o&&c===0)return;return c}const h=this.numericBands;if(i===1){for(;c>0&&h[c-1]>=o;)c--;for(;c<n-1&&h[c]<o;)c++;if(h[c]<o)return}else{for(;c<n-1&&h[c+1]<=o;)c++;for(;c>0&&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.d0||a>=r.dNext)return Number.NaN}}return super.convert(t,i)}calculateBands(t,i,n=!1){if(t===this.domain&&i[0]===0&&i[1]===1&&!n&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(t.length<2)return{bands:[],firstBandIndex:void 0};const{interval:s}=this;if(s==null)return{bands:[],firstBandIndex:void 0};const r={visibleRange:i,extend:n};if(!pS(t,s,r))return{bands:[],firstBandIndex:void 0};const a=t===this.domain?this.getCachedBandRange():$f(t,s);if(a==null)return{bands:[],firstBandIndex:void 0};const[o,l]=a;if(ku(s,o,l,r)>Hf)return _.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const c=hn(s,o,l,r),h=Ug(s,o,l,r);return{bands:c,firstBandIndex:h}}ticks({interval:t},i=this.domain,n=[0,1],{extend:s=!1}={}){if(i.length<2)return;let r,a,o;if(i===this.domain&&!s?({bands:r}=this.calculateBands(i,[0,1],!1),o=vL(r,!1,n),a=o[0]):{bands:r,firstBandIndex:a}=this.calculateBands(i,n,s),t==null)return{ticks:r,count:void 0,firstTickIndex:a};const l=this.interval?Ni(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(xe(t)||typeof t=="string")u=hn(t,i[0],i[1],{extend:!0,visibleRange:n}),d=0,p=u.length-1;else{const M=o?o[0]:0,D=o?o[1]:r.length-1;u=r,d=ar(M,D,A=>r[A].valueOf()<=c)??M,p=ar(M,D,A=>r[A].valueOf()<=h)??D}const g=[];let f;for(let M=d;M<=p;M++){const D=u[M].valueOf(),A=ar(0,r.length-1,k=>r[k].valueOf()<=D),I=A!=null&&A!=f?r[A]:void 0;f=A,I!=null&&D-I.getTime()<=l&&g.push(I)}let y,m;if(this.interval){const M=$f([new Date(c),new Date(h)],this.interval);y=M[0].valueOf(),m=M[1].valueOf()}else y=c,m=h;let v=ro(0,g.length-1,M=>g[M].valueOf()>=y)??0,x=ar(0,g.length-1,M=>g[M].valueOf()<=m)??g.length-1;return s&&(v=Math.max(v-1,0),x=Math.min(x+1,g.length-1)),{ticks:g.slice(v,x+1),count:g.length,firstTickIndex:a}}};function pS(e,t,i){const[n,s]=$f(e,t);return ku(t,n,s,i)<=Hf}function $f(e,t){const i=Ti(t,e[0]),n=Ti(t,e[1]);return[i,n]}function J1(e,t,i,n,s){let[r,a]=Nt(t.map(Number));const o=Math.floor(i.unzoomed);if(o<=1){const[m,v]=Q1(r,a),x=5*Math.pow(2,-Math.ceil(Math.log2(s[1]-s[0]))),{ticks:M}=po(m,v,x,void 0,void 0,s),D=[e.toDomain(m),e.toDomain(v)];return n&&D.reverse(),{domain:D,ticks:M}}if(r===a){const m=Math.floor(Math.log10(r)),v=Math.pow(10,m),x=Math.min(v,1),M=o-1;r-=x*Math.floor(M/2),a=r+x*M}let l=r,c=a;l=eT(l,c,o);const h=iT(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)),y=tT(l,f,Math.floor(i.zoomed));return{domain:g,ticks:y}}function Q1(e,t){let i=e,n=t,s=0;do{[i,n]=Kg(i,n);const{ticks:r}=po(i,n,5);if(r.length%2===1)return[i,n];i-=1,n+=1}while(s++<10);return[e,t]}function eT(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 tT(e,t,i){const n=Dh(t),s=Math.pow(10,n),r=[];for(let a=0;a<i;a++){const o=e+t*a;r.push(Math.round(o*s)/s)}return r}function iT(e,t,i){const n=i-1,s=(t-e)/n;return nT(s)}function nT(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),n=e/i;return n>0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:e}var sT=18,rT=[1,2,3,4,6,8,9,10,12];function gS(e,t=0){const i=[];for(const n of e){const{x:s,y:r,width:a,height:o}=n;if(i.some(l=>Sg(l,s,r,a+t,o+t)))return!0;i.push(n)}return!1}function aT(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 hn(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 fS(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}function oT(e){if(e.length<2)return 1/0;let t=0,i=e[0].translation;for(let n=1;n<e.length;n++){const s=e[n].translation,r=Math.abs(s-i);t=Math.max(t,r),i=s}return t}function lT(e,{niceDomain:t,rawTicks:i,rawFirstTickIndex:n=0,generatePrimaryTicks:s,primaryTicksIndices:r,alignment:a,fractionDigits:o,timeInterval:l}){const{scale:c,label:h,tickFormatter:u,inRange:d,isVertical:p,sizeLimit:g=1/0}=e,f=$o.is(c)||qn.is(c),y=vi(h),m=Xg(),v=[];return mS(c,t,()=>{const x=Nn.is(c)?c.bandwidth??1/0:1/0,M=(c.bandwidth??0)/2,D=cT(h.enabled,s,t,i,o,l,u);let A=p?g:x,I=p?x:g;if(h.rotation){const C=mg(h.rotation,A,I);A=C.width,I=C.height}const k={font:h,maxWidth:A,maxHeight:I,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping};for(let C=0;C<i.length;C++){const T=i[C],N=c.convert(T,{alignment:a})+M;if(d&&!d(N))continue;const R=r?.has(C)??!1,F=D(R,T,C);let G=null;h.avoidCollisions&&(G=Mu(F,k)||null);const V=G??F,H=ae(V),q=V!==F&&(H?vh(V.at(-1)):Gs(pt(V)));let z;if(f){const ie=T?.valueOf();Number.isFinite(ie)&&(z=m(`v:${ie}`))}z??(z=m(`l:${H?Ze(V.flat()):V}`)),v.push({tick:T,tickId:z,tickLabel:V,isPrimary:R,index:C+n,textUntruncated:q?Ze(F):void 0,textMetrics:H?xs(V,h):y.measureLines(pt(V)),translation:Math.floor(N)})}}),v}function mS(e,t,i){const n=e.domain;try{e.domain=t,i()}finally{e.domain=n}}function cT(e,t,i,n,s,r,a){const o=t?"component":"long",l=t&&r?sc(r):void 0,c=t?a(i,n,!0,s,l,o):null,h=e?a(i,n,!1,s,r,o):null;return(u,d,p)=>(u?c:h)?.(d,p)??String(d)}function hT(e,t,i,n,s,r,a,o){if(!$o.is(e)&&!qn.is(e))return;const l=sc(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]=Hg(new Date(c),new Date(h),t);u=Ti(l,u),u.valueOf()>=c&&(u=ux(l,u)),d=hx(l,d),d.valueOf()<=h&&(d=jg(l,d));const p=hn(l,u,d),g=Ni(r),f=br.is(e),y={...s,interval:r},m=[];let v,x,M,D=0;if(br.is(e)){const A=Ss(r);x=o!=null&&Ni(o)>=Ni(A)?2:3,M=1;const I=i/n,k=e.bandCount(t)/(I*sT);D=rT.findLast(C=>k>=C)??1}else vr.is(e)&&(e.interval==null||Ni(e.interval)>=g)?x=1:(x=0,M=2);for(let A=0;A<p.length-1;A++){const I=p[A],k=p[A+1],C=A===0,T=A===p.length-2,N=k.valueOf()-I.valueOf(),R=[Math.max((c-I.valueOf())/N,0),Math.min((h-I.valueOf())/N,1)];let F;switch(x){case 0:F=aT(y.interval,[I,k],R,!0);break;case 1:case 3:{F=e.ticks(y,[I,k],R,{extend:!0,dropInitial:!0})?.ticks??[];break}case 2:F=e.stepTicks(D,[I,k],void 0,!T);break}if(ab(F,q=>q.valueOf()<I.valueOf()),T||ob(F,q=>{switch(x){case 0:case 3:return q.valueOf()+g>k.valueOf();case 1:case 2:return q.valueOf()>=k.valueOf()}}),F.length===0)continue;const G=F[0],V=Mg(G,I);(x===0?V===0:V<=g)&&(!f||!C)&&(v??(v=new Set),v.add(m.length)),m.push(...F)}return v?.size===1&&v.has(0)&&(v=void 0),{ticks:m,primaryTicksIndices:v,alignment:M}}function uT(e,t,i,n,s){const r=yS(e.format,n);if(r==null)return{width:0,height:0};const a=vo(r),o=n?sc(n):void 0,l=yS(t?.format,o),c=l?vo(l):a,h=new Date(i[0]),u=new Date(i.at(-1)),d=o?hn(o,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let p=0,g=0;if(a!=null){const f=Ho(e),y=f.left+f.right,m=f.top+f.bottom;let v,x;d!=null&&d.length>1?(v=d[0],x=d[1]):(v=h,x=u);const M=hn(n,v,x,{limit:50});for(const D of M){const A=a(D),{width:I,height:k}=s.measureLines(A);p=Math.max(p,I+y),g=Math.max(g,k+m)}}if(c!=null&&d!=null){const f=Ho(t),y=f.left+f.right,m=f.top+f.bottom;for(const v of d){const x=c(v),{width:M,height:D}=s.measureLines(x);p=Math.max(p,M+y),g=Math.max(g,D+m)}}return{width:Math.ceil(p),height:Math.ceil(g)}}function dT(e,t,i,n){return e&&!t?i*n===-1?"top":"bottom":"middle"}function pT(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"end"}else return"center";else if(n*s===-1)return"end";return"start"}function yS(e,t){if(e!=null){if(typeof e=="string")return e;if(xe(e)&&t!=null)return e[Ss(t)]}}function gT(e,t,i=0){const n=vs(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 fT=new Date(1970,0,4);function bS(e){const{label:t,domain:i,axisRotation:n,labelOffset:s,sideFlag:r}=e,{defaultRotation:a,configuredRotation:o,parallelFlipFlag:l,regularFlipFlag:c}=gT(t.rotation,t.parallel,n),h=o+a,u=(k,C=0)=>{const T=t.minSpacing??(o===0&&C===0?10:0),N=h+C,R=Ho(t);return gS(bT(e,k,N),T)||gS(vT(k.ticks,s,N,R),T)},{maxTickCount:d}=vS(e),p=mT(e),g=t.enabled&&t.avoidCollisions,f=Number.isFinite(d)?d:10,y=g&&t.autoRotate&&t.rotation==null;let m=0,v=0,x=!0,M={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;x&&m<=f;)({tickData:M,index:m}=yT(e,p,M,m)),v=y&&u(M,0)?vs(t.autoRotateAngle):0,x=g&&u(M,v);const D=pT(t.parallel,o,v,r,c),A=dT(t.parallel,o,r,l),I=o+v;return{tickData:M,textAlign:D,textBaseline:A,rotation:I}}function mT(e){return e.interval?.values?2:e.primaryTickCount!=null?1:0}function vS({scale:e,domain:t,range:i,visibleRange:n,label:s,defaultTickMinSpacing:r,interval:{minSpacing:a,maxSpacing:o}}){const{defaultTickCount:l}=e,c=Wr(i),h=Wr(n);if(Go.is(e)||br.is(e)&&t.length<1e3){const u=Go.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 vx(c,h,a,o,l,r)}function yT(e,t,i,n){const{step:s,values:r}=e.interval,{maxTickCount:a,minTickCount:o,tickCount:l}=vS(e),c=C=>Math.max(l-C,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=xS(e,t,p);if(h&&fS(g.rawTicks,u)){let C=n,T=d;for(;C<=T;){n=Math.trunc((C+T)/2),p.tickCount=c(n);const N=xS(e,t,p);fS(N.rawTicks,u)?C=n+1:(g=N,T=n-1)}}const{tickDomain:f,niceDomain:y,rawTicks:m,rawTickCount:v,rawFirstTickIndex:x,generatePrimaryTicks:M,primaryTicksIndices:D,alignment:A,fractionDigits:I,timeInterval:k}=g;return{tickData:{tickDomain:f,niceDomain:y,rawTicks:m,rawTickCount:v,fractionDigits:I,timeInterval:k,ticks:lT(e,{niceDomain:y,rawTicks:m,rawFirstTickIndex:x,generatePrimaryTicks:M,primaryTicksIndices:D,alignment:A,fractionDigits:I,timeInterval:k})},index:n+1}}function xS(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(C=>C===0),interval:o.step,...i},p={...d,nice:c.map(C=>C===0||C===1)};let g;t===1&&h!=null&&Ee.is(a)&&(g=J1(a,n,h,s,r));const f=c.includes(0)?g?.domain??a.niceDomain(d,n):n;let y=f,m,v,x,M,D,A;const I=l?.enabled===!0&&p.interval==null;mS(a,f,()=>{switch(t){case 2:if(y=o.values,m=o.values,v=m.length,br.is(a)?A=1:vr.is(a)&&(A=2),Ee.is(a)){const[C,T]=Nt(f.map(Number));m=m.filter(N=>Number(N)>=C&&Number(N)<=T).sort((N,R)=>Number(N)-Number(R))}break;case 1:if(g)m=g.ticks,v=g.ticks.length;else{const C=a.ticks(p,f,r);m=C?.ticks,v=C?.count}break;default:{const{tickCount:C,minTickCount:T,maxTickCount:N}=i;if(f.length>0&&p.interval==null&&(vr.is(a)||I&&($o.is(a)||br.is(a)))){const G=f,V=Math.min(G[0].valueOf(),G.at(-1).valueOf()),H=Math.max(G[0].valueOf(),G.at(-1).valueOf());M=rc(V,H,C,T,N,{weekStart:l==null?fT:void 0,primaryOnly:!0})}let R;br.is(a)?R=u:vr.is(a)&&(R=a.interval),R!=null&&M!=null&&Ni(R)>=Ni(M)&&(M=R);const F=M?hT(a,r,C,N,p,M,s,u):void 0;if(F)({ticks:m,primaryTicksIndices:D,alignment:A}=F);else{const G=vr.is(a)&&p.interval==null&&M!=null?{...p,interval:M}:p,V=a.ticks(G,f,r);if(m=V?.ticks,v=V?.count,x=V?.firstTickIndex,$o.is(a)||qn.is(a)){const H=typeof p.interval=="number"?ac(p.interval):p.interval;M??(M=H??V?.timeInterval)}}}}}),m??(m=[]);let k=0;for(const C of m){if(typeof C!="number")continue;const T=Dh(C);T>k&&(k=T)}return I||(D=void 0),{tickDomain:y,niceDomain:f,rawTicks:m,rawTickCount:v,rawFirstTickIndex:x,generatePrimaryTicks:I,primaryTicksIndices:D,alignment:A,fractionDigits:k,timeInterval:M}}function bT(e,t,i){const{niceDomain:n,ticks:s,timeInterval:r}=t;if(r==null)return[];const a=oT(s),{label:o,labelOffset:l,primaryLabel:c,domain:h}=e,{width:u,height:d}=uT(o,c,n??h,r,vi(o)),p=[];for(const g of[0,a]){const{x:f,y}=yg(l,g,i);p.push({x:f,y,width:u,height:d})}return p}function vT(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}=yg(t,c,i),d=l.width+r,p=l.height+a;s.push({x:h,y:u,width:d,height:p})}return s}var Sc=class FA extends Gf{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 Zt({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Zt({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Yi({zIndex:1})),this.tickLineGroupSelection=mt.select(this.tickLineGroup,Yi,!1),this.gridLineGroupSelection=mt.select(this.gridLineGroup,Yi,!1),this.gridFillGroupSelection=mt.select(this.gridFillGroup,Dt,!1),this.tempText=new wo({debugDirty:!1}),this.tempCaption=new qe,this.animationManager=t.animationManager,this.animationState=new Jl("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&&!zn(r,n)&&this.animationState.transition("resize"),n=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof FA}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 jf}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:ri}=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:ri}}}const{label:c,primaryLabel:h,scale:u,range:d,interval:p,reverse:g,defaultTickMinSpacing:f,minimumTimeGranularity:y}=this,m=bS({label:c,scale:u,interval:p,primaryLabel:h,domain:t,range:d,reverse:g,niceMode:i,visibleRange:n,defaultTickMinSpacing:f,minimumTimeGranularity:y,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:v}=m;if(this.label.avoidCollisions&&this.horizontal&&v.ticks.length>2&&(Ee.is(this.scale)||qn.is(this.scale))){const ve=this.chartLayout?.padding.right??0,ri=v.ticks.at(-1);ri?.tickLabel!=null&&ri.translation+ri.textMetrics.width/2>d[1]+ve&&(ri.tickLabel=void 0,n[0]===0&&n[1]===1&&(v.ticks[0].tickLabel=void 0))}const{ticks:M,tickDomain:D,rawTicks:A,rawTickCount:I,fractionDigits:k,timeInterval:C,niceDomain:T}=v,N=M.map(ve=>this.getTickLabelProps(ve,m,l)),{position:R,gridPadding:F,gridLength:G}=this,V=R==="bottom"||R==="right"?-1:1,H=V*F,q=V*(G+F),z=this.calculateGridLines(M,H,q),ie=this.calculateGridFills(M,H,q),de=this.calculateTickLines(M,V,l),{bbox:pe,spacing:Re}=this.measureAxisLayout(D,M,N,o,l);return{ticks:A,rawTickCount:I,tickDomain:D,niceDomain:T,fractionDigits:k,timeInterval:C,bbox:pe,layout:{ticks:M,gridLines:z,gridFills:ie,tickLines:de,labels:N,spacing:Re}}}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:y=0,lineDash:m}=g[t%g.length]??{};return{tickId:i,offset:n,x1:h,y1:u,x2:d,y2:p,stroke:f,strokeWidth:y,lineDash:m}}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].translation<r[0]||!c&&t[0].translation>r[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,y,m]=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:v,fillOpacity:x}=l.style[s%l.style.length]??{};return{tickId:t,x1:g,y1:f,x2:y,y2:m,fill:v,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,[y,m,v,x]=l?[n,g,n,g+f]:[g,n,g+f,n],{stroke:M,width:D}=u;return{tickId:i,offset:n,x1:y,y1:m,x2:v,y2:x,stroke:M,strokeWidth:D,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=Bv(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]=Nt(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;return n.node.setProperties(this.titleProps(n,t,i)),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 D of i)g.push(this.getTickLineBBox(D,r));const{tempText:f}=this;if(l.enabled)for(const D of n){if(!D.visible)continue;f.setProperties(D);const A=f.getBBox();A&&g.push(A)}if(c?.enabled&&u==="bottom"&&(g.push(new U(0,Mp(l.fontSize)+2,1,this.getTickSize(a)+this.getTickSpacing(a)+l.spacing+p)),c.format!=null)){const{format:A}=c,k=(xe(A)?Object.values(A):[A]).reduce((C,T)=>Math.max(C,Eb(T)),0);g.push(new U(0,this.getTickSize(o??a)+this.getTickSpacing(o??a)+c.spacing+p,1,k*Mp(c.fontSize)+2))}const y=U.merge(g),m=d?y.height:y.width,{spacing:v,scrollbarLayout:x}=this.applyScrollbarLayout(g,m,s);return this.layout.labelThickness=m,this.layout.scrollbar=x,h.enabled&&g.push(this.titleBBox(t,v)),{bbox:U.merge(g),spacing:v}}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;const r=(s.spacing??0)+n,{range:a}=this,o=(a[0]+a[1])/2;let l,c,h,u;switch(this.position){case"top":l=o,c=-r,h=0,u="bottom";break;case"bottom":l=o,c=r,h=0,u="top";break;case"left":l=-r,c=o,h=Math.PI/-2,u="bottom";break;case"right":l=r,c=o,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:y,textBaseline:m,textAlign:v}=i,{range:x}=l,M=this.label.getSideFlag(),D=Ho(g)[this.position];let A=M*(this.getTickSize(f)+this.getTickSpacing(f)+g.spacing+o)-D;n&&(A+=M*n);const I=h!=="",k=s?u:A,C=s?-A:u;return{...this.getLabelStyles({value:t.tick,formattedValue:h},void 0,g),tickId:c,rotation:y,text:h,textAlign:v,textBaseline:m,textUntruncated:p,visible:I,x:k,y:C,rotationCenterX:k,rotationCenterY:C,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);n.node.visible=s.visible,n.node.text=s.text,n.node.textBaseline=s.textBaseline,n.node.datum=s}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=j1(this),s=U1(n);bt(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],s.group),bt(this.id,"line",i,[this.lineNode],s.line),bt(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],s.tick,(r,a)=>a.tickId,t),bt(this.id,"tick-labels",i,[this.tickLabelGroupSelection],s.label,(r,a)=>a.tickId,t),bt(this.id,"title",i,[this.title.caption.node],s.label,(r,a)=>a.tickId,t)}resetSelectionNodes(){zt([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],W1()),zt([this.gridLineGroupSelection,this.tickLineGroupSelection],oS()),zt([this.gridFillGroupSelection],K1()),zt([this.tickLabelGroupSelection],rd()),zt([this.title.caption.node],rd()),zt([this.lineNode],oS())}};b([S],Sc.prototype,"thickness",2),b([S],Sc.prototype,"maxThicknessRatio",2),b([S],Sc.prototype,"position",2),b([S],Sc.prototype,"crossAt",2);var Mc=Sc,xr=class VA extends Mc{constructor(t,i=new Go,n=!0){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=n,this.nice=!1}static is(t){return t instanceof VA}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t.domain,clipped:!1}}getUpdateTypeOnResize(){return this.bandAlignment==null||this.bandAlignment==="justify"?super.getUpdateTypeOnResize():3}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!Be(t)||!Be(i)){const 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=n<u.step?Math.floor(u.step/2):u.step/2,p=n-d,[g,f,y,m]=c?[p,Math.max(r,a),p,Math.min(r,a)]:[Math.min(r,a),p,Math.max(r,a),p],{style:v}=l,{stroke:x,strokeWidth:M=0,lineDash:D}=v[t%v.length]??{};return{tickId:i,offset:p,x1:g,y1:f,x2:y,y2:m,stroke:x,strokeWidth:M,lineDash:D}}calculateGridFills(t,i,n){const{horizontal:s,range:r,scale:a}=this;if(this.interval.placement!=="between")return super.calculateGridFills(t,i,n);const o=[];if(t.length==0)return o;const l=t[0],c=l.translation>r[0]+a.step/2,h=t.at(-1),u=s&&h.translation<r[1]-a.step/2;if(c){const d={tickId:`before:${l.tickId}`,translation:l.translation-a.step};o.push(this.calculateGridFill(d,-1,l.index-1,i,n,t))}if(o.push(...t.map((d,p)=>this.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,y,m]=c?[d,Math.max(r,a),p,Math.min(r,a)]:[Math.min(r,a),d,Math.max(r,a),p],{fill:v,fillOpacity:x}=l.style[s%l.style.length]??{};return{tickId:t,x1:g,y1:f,x2:y,y2:m,fill:v,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<u.step?Math.floor(u.step/2):u.step/2,y=n-f,m=-r*(o+this.getTickSpacing(p)),[v,x,M,D]=l?[y,m,y,m+g]:[m,y,m+g,y],{stroke:A,width:I}=p;return{tickId:i,offset:y,x1:v,y1:x,x2:M,y2:D,stroke:A,strokeWidth:I,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce((t,i)=>{const n=i.getBandScalePadding?.();return n&&(t.inner>n.inner&&(t.inner=n.inner),t.outer<n.outer&&(t.outer=n.outer)),t},{inner:1/0,outer:-1/0})}tickFormatParams(t,i,n,s){return{type:"category"}}datumFormatParams(t,i,n,s,r){const{datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}=i;return Array.isArray(t)&&t.some(g=>typeof 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}}};xr.className="CategoryAxis",xr.type="category",b([S],xr.prototype,"groupPaddingInner",2),b([S],xr.prototype,"paddingInner",2),b([S],xr.prototype,"paddingOuter",2),b([rt("layoutConstraints","align")],xr.prototype,"bandAlignment",2),b([Vt({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())}})],xr.prototype,"requiredRange",2);var Ic=xr,va=class qy extends Ee{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof qy}static getTickStep(t,i,n){const{interval:s,tickCount:r=Ee.defaultTickCount,minTickCount:a,maxTickCount:o}=n;return s??go(t,i,r,a,o)}toDomain(t){return t}ticks({interval:t,tickCount:i=Ee.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(!fo((l-o)/c,this.getPixelRange()))return Lu(o,l,c,a)}return po(o,l,i,n,s,a)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:n=Ee.defaultTickCount}=t;let[s,r]=i;if(n===1)[s,r]=Kg(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;c<l;c++){const h=s,u=r,d=qy.getTickStep(s,r,t),[p,g]=i;if(s=a(p/d)*d,r=o(g/d)*d,s===h&&r===u)break}}return[t.nice[0]?s:i[0],t.nice[1]?r:i[1]]}},qi=class extends Mc{constructor(e,t=new va){super(e,t)}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i,preferredMin:n,preferredMax:s}=this,{extent:r,clipped:a}=mu(e.domain,t,i,n,s,void 0,e.sortMetadata?.sortOrder);return{domain:r,clipped:a}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}getVisibleDomain(e){const[t,i]=e,[n,s]=this.visibleRange,r=i-t;return[t+n*r,i-(1-s)*r]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:this.getVisibleDomain(e),fractionDigits:i}}datumFormatParams(e,t,i){const{datum:n,seriesId:s,legendItemName:r,key:a,source:o,property:l,domain:c,boundSeries:h}=t,u=this.getVisibleDomain(c);return{type:"number",value:e,datum:n,seriesId:s,legendItemName:r,key:a,source:o,property:l,domain:c,visibleDomain:u,boundSeries:h,fractionDigits:i}}};qi.className="NumberAxis",qi.type="number",b([S],qi.prototype,"min",2),b([S],qi.prototype,"max",2),b([S],qi.prototype,"preferredMin",2),b([S],qi.prototype,"preferredMax",2);var xT={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},ST=(e,t)=>Math.log(t)/Math.log(e);function Uf(e,t,i){const n=Math.min(...t),s=xT[e]??ST;return n>=0?s(e,i):-s(e,-i)}var MT={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},IT=(e,t)=>e**t;function Wf(e,t,i){const n=Math.min(...t),s=MT[e]??IT;return n>=0?s(e,i):-s(e,-i)}var Kf=class BA extends Ee{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=n=>Uf(this.base,this.domain,n),this.pow=n=>Wf(this.base,this.domain,n)}static is(t){return t instanceof BA}transform(t){const[i,n]=Nt(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,n]=Nt(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=Wf(n,i,a(Uf(n,i,s))),c=Wf(n,i,o(Uf(n,i,r)));return[t.nice[0]?l:i[0],t.nice[1]?c:i[1]]}ticks({interval:t,tickCount:i=Ee.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 y=A=>A>=l&&A<=c,m=Math.min(Math.abs(t),Math.abs(u-h)),{ticks:v,count:x,firstTickIndex:M}=Lu(h,u,m,s),D=v.map(this.pow).filter(y);if(!fo(D.length,this.getPixelRange()))return{ticks:D,count:x,firstTickIndex:M}}if(!Hb(r)||u-h>=i){const y=Math.min(u-h,i),{ticks:m,count:v,firstTickIndex:x}=po(h,u,y,void 0,void 0,s);return{ticks:m.map(this.pow),count:v,firstTickIndex:x}}const d=[],p=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const g=Wr(this.range)/i;let f=1/0;for(let y=h;y<=u;y++){const m=this.convert(this.pow(y+1));for(let v=1;v<r;v++){const x=p?v:r-v+1,M=this.pow(y)*x,D=this.convert(M),A=Math.abs(f-D),I=Math.abs(D-m),k=A>=g&&I>=g;M>=l&&M<=c&&(v===1||k||d.length===0)&&(d.push(M),f=D)}}return l0(d,p,s)}},Yf=class extends It{constructor(){super(...arguments),this.segmentPath=new It}drawPath(e){if(!this.segments||this.segments.length===0){super.drawPath(e);return}e.save();const t=xl(),i=new t;Uo(i,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const s of this.segments)Uo(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;Uo(l,s),e.clip(l),n.drawPath(e),e.restore()}}};b([Bu()],Yf.prototype,"segments",2);function Uo(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 SS=class extends Zt{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(Uu(It))}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=xl(),n=new i;Uo(n,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const r of this.segments)Uo(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;Uo(o,r),t.clip(o),s.setProperties(a);for(const l of this.children())!l.visible||!(l instanceof It)||(s.path=l.path,s.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,..._L(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),s.render(e));t.restore()}}};b([Bu()],SS.prototype,"segments",2);var MS=class{constructor(e,t,i){this.root=new CT(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}},DT=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)}},AT=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.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(this.subdivisions===void 0?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:n}=this.boundary,{capacity:s}=this,r=this.maxdepth-1,a=i/2,o=n/2,l=new U(e,t,a,o),c=new U(e+a,t,a,o),h=new U(e,t+o,a,o),u=new U(e+a,t+o,a,o);return new DT(this.child(s,r,l),this.child(s,r,c),this.child(s,r,h),this.child(s,r,u))}},CT=class _A extends AT{addCondition(t){const{x:i,y:n}=t.hitTester.midPoint;return this.boundary.containsPoint(i,n)}findCondition(t,i,n){const{best:s}=n;return s.distanceSquared!==0&&this.boundary.distanceSquared(t,i)<s.distanceSquared}findAction(t,i,n){const s=Su(t,i,this.elems,n.best.distanceSquared);s.nearest!==void 0&&s.distanceSquared<n.best.distanceSquared&&(n.best=s)}child(t,i,n){return new _A(t,i,n)}},Wo=class extends oe{constructor(){super(...arguments),this.enabled=!1,this.label=new Ke,this.tick=new ba}};b([S],Wo.prototype,"enabled",2),b([S],Wo.prototype,"label",2),b([S],Wo.prototype,"tick",2);var es=class extends Mc{constructor(e){super(e,new $o),this.parentLevel=new Wo,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0}get _unit(){}set _unit(e){_.warnOnce("To use 'unit', use an axis with type 'unit-time' instead of 'time'.")}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(e){const{extent:t,clipped:i}=yu(e,this.min,this.max,this.preferredMin,this.preferredMax);return{domain:t,clipped:i}}processData(){super.processData();const{boundSeries:e,direction:t,min:i,max:n}=this;this.minimumTimeGranularity=IS(e,t,i,n)}tickFormatParams(e,t,i,n){n??(n=Yg(t));const s=Zg(e),r=Ss(n),a=hr(n),o=nc(n);return{type:"date",unit:r,step:a,epoch:o,truncateDate:s}}datumFormatParams(e,t,i,n,s){if(typeof e=="number"&&(e=new Date(e)),n==null){const{minimumTimeGranularity:y}=this,m=Tu(e);y!=null&&Ni(y)<Ni(m)?n=y:n=m}const{datum:r,seriesId:a,legendItemName:o,key:l,source:c,property:h,domain:u,boundSeries:d}=t,p=Ss(n),g=hr(n),f=nc(n);return{type:"date",value:e,datum:r,seriesId:a,legendItemName:o,key:l,source:c,property:h,domain:u,boundSeries:d,unit:p,step:g,epoch:f,style:s}}};es.className="TimeAxis",es.type="time",b([S],es.prototype,"parentLevel",2),b([S],es.prototype,"min",2),b([S],es.prototype,"max",2),b([S],es.prototype,"preferredMin",2),b([S],es.prototype,"preferredMax",2),b([S,rt("_unit")],es.prototype,"unit",2);function IS(e,t,i,n){const s=e.reduce((r,a)=>Math.min(a.minTimeInterval()??1/0,r),1/0);return Number.isFinite(s)?ac(s):DS(e,t,i,n)?.unit}function DS(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}=yu(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 y=Math.abs(f-g);if(y===0)continue;const m=d.dataCount();if(o=Math.max(o,m),m<=1)continue;const v=y/(m-1);a=Math.min(a??1/0,v)}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,kT(l));const c=ac(a);let h=a/Ni(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 kT(e){e.sort((i,n)=>i-n);let t=1/0;for(let i=1;i<e.length;i++){const n=e[i-1],s=e[i];s-n>0&&(t=Math.min(t,Math.abs(s-n)))}return t}function wT(e,t,i,n){return t<e.startIndex?(e.startIndex+=i,e.endIndex+=i,!1):t<e.endIndex||t===e.endIndex&&n?(e.endIndex+=i,!0):!1}function LT(e,t,i){const n=t+i;if(n<=e.startIndex)return e.startIndex=Math.max(0,e.startIndex-i),e.endIndex=Math.max(e.startIndex,e.endIndex-i),!1;if(t>=e.endIndex)return!1;if(t<=e.startIndex&&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 AS(e,t){const i=Math.ceil(e/1e3);return Math.max(t,i)}function CS(e,t){return Math.max(1,Math.ceil(e/t))}function TT(e){return e.filter(t=>t.endIndex>t.startIndex)}function NT(e,t,i){if(!t.enableBanding||e<t.minDataSizeForBanding)return[i(0,e)];const n=AS(e,t.targetBandCount),s=CS(e,n),r=[];for(let a=0;a<e;a+=s){const o=Math.min(a+s,e);r.push(i(a,o))}return r}function OT(e,t){for(const i of t)i.insertCount>0&&e.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&e.handleRemoval(i.index,i.deleteCount)}function ET(e,t){for(const i of t)e.handleInsertion(i,0)}function RT(e,t){OT(e,t.spliceOps),t.updatedIndices.size>0&&ET(e,t.updatedIndices)}var PT=1e3,FT=10,kS=class{constructor(e={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:e.minDataSizeForBanding??PT,targetBandCount:e.targetBandCount??FT,maxBandSize:e.maxBandSize??1/0,enableBanding:e.enableBanding??!0}}applyIndexMap(e){RT(this,e)}initializeBands(e){this.dataSize=Math.max(0,e),this.bands=NT(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=AS(this.dataSize,this.config.targetBandCount),n=CS(this.dataSize,i),s=Math.ceil(n*1.1);for(let r=0;r<this.bands.length;r++){const a=this.bands[r],o=r===this.bands.length-1;if(e===a.endIndex&&o&&t>0){a.endIndex-a.startIndex>=n?this.bands.push(this.createBand(e,e+t)):(a.endIndex+=t,a.isDirty=!0);break}wT(a,e,t,o)&&(a.isDirty=!0,t>0&&e<a.endIndex&&a.endIndex-a.startIndex>s&&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)LT(n,e,i)&&(n.isDirty=!0);this.bands=TT(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)e<i.endIndex&&t>i.startIndex&&(i.isDirty=!0)}},Ji=class zA{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 zA}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}}},Qi=class GA{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof GA}static extendDomain(t,i=[1/0,-1/0]){for(const n of t)typeof n=="number"&&(i[0]>n&&(i[0]=n),i[1]<n&&(i[1]=n));return i}extend(t){typeof t!="number"&&!(t instanceof Date)||(this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t))}getDomain(){return[...this.domain]}},Dc=class extends kS{constructor(e,t={},i=!1){super(t),this.fullDomainCache=null,this.sortOrder=void 0,this.isUnique=!1,this.domainFactory=e,this.isDiscrete=i}setSortOrderMetadata(e,t){this.sortOrder=e,this.isUnique=t}createBand(e,t){const i=this.domainFactory();return this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&Ji.is(i)&&i.setSortedUniqueMode(this.sortOrder,this.isUnique),{startIndex:e,endIndex:t,subDomain:i,isDirty:!0}}initializeBands(e){super.initializeBands(e),this.fullDomainCache=null}handleInsertion(e,t){super.handleInsertion(e,t),this.fullDomainCache=null}handleRemoval(e,t){super.handleRemoval(e,t),this.fullDomainCache=null}splitBand(e,t){this.bands.length>1&&super.splitBand(e,t)}markBandsDirty(e,t){this.markRangeDirty(e,t),this.fullDomainCache=null}markAllBandsDirty(){for(const e of this.bands)e.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(e,t){const i=e.length;for(const n of this.bands){if(!n.isDirty)continue;const s=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&Ji.is(s)&&s.setSortedUniqueMode(this.sortOrder,this.isUnique),n.subDomain=s;const{startIndex:r,endIndex:a}=n;for(let o=r;o<a&&o<i;o++)t?.[o]||n.subDomain.extend(e[o]);n.isDirty=!1}this.fullDomainCache=null}getDirtyBands(){return this.bands.filter(e=>e.isDirty)}extend(e){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const e of this.bands)if(!Ji.is(e.subDomain)||!e.subDomain.isSortedUniqueMode()||e.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const e=new Ji;e.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const t of this.bands)Ji.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(Ji.is(e))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const t=new Ji;for(const i of this.bands)Ji.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&&s<e)&&(e=s),(t===void 0||r!=null&&t!=null&&r>t)&&(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 wS(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 VT(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,aggregateFunction:n=>wS(n),groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function BT(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:n=>Qi.extendDomain(n)}}function LS(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 _T(e,t){const i=t?.visible??!0;return{id:e,matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:s=>wS(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 TS(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 zT(e){return()=>{let t=0;return i=>Be(i)?(t+=e?Math.max(0,i):i,t):i}}function GT(){return()=>{let e=0;return t=>{if(!Be(t))return t;const i=e;return e+=t,i}}}var Zf="\0__AG_NULL__\0",Xf="\0__AG_UNDEFINED__\0";function NS(e){return e===null?Zf:e===void 0?Xf:Array.isArray(e)?"["+e.map(NS).join(",")+"]":le(e)?JSON.stringify(e):String(e)}function qf(e){return e.map(NS).join("-")}function Ri(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function OS(e,t){return t?.get(e.id)??0}function Jf(e){return"scopes"in e&&Array.isArray(e.scopes)}function Sr(e,t){const i=[];for(let n=0;n<e;n+=1)i[n]=t;return i}function od(e){const t=new Set;for(const i of e.values())i&&t.add(i);return t}function Qf(e,t,i=!1){const n=[];for(const s of e){const r=s?.[t];if(r==null&&!i)return;n.push(r)}return n}function jT(e){const t=[];let i=0,n;const s=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;n=s.exec(e);){if(n.index!==i)return;i=n.index+n[0].length;const r=n[1].trim();if(r.startsWith("."))t.push(r.slice(1).trim());else if(r.startsWith("[")){const a=r.slice(1,-1).trim();a.startsWith("'")?t.push(a.slice(1,-1).replaceAll(/(?<!\\)\\'/g,"'")):a.startsWith('"')?t.push(a.slice(1,-1).replaceAll(/(?<!\\)\\"/g,'"')):t.push(a)}else t.push(r)}if(i===e.length)return t}function HT(e){return t=>{let i=t;for(const n of e)i=i[n];return i}}var $T=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=Ci(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]),y=Qf(r,c,o),m=y==null?void 0:d.aggregateFunction(f,y);m&&(g=d.groupAggregateFunction?.(m,g)??Qi.extendDomain(m,g));const v=d.finalFunction?.(g)??g;h[u]=v,Qi.extendDomain(v,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;a<e.groups.length;a++){const o=e.groups[a];o.aggregation??(o.aggregation=[]);const l=o.keys;let c=s.groupAggregateFunction?.()??[1/0,-1/0];const h=Math.max(...r.map(d=>o.datumIndices[d]?.length??0));for(let d=0;d<h;d++){const p=r.map(f=>{const y=o.datumIndices[f]?.[d];if(y==null)return;const m=this.resolvers.resolveAbsoluteIndex(a,y);return i[f][m]}),g=s.aggregateFunction(p,l);g&&(c=s.groupAggregateFunction?.(g,c)??Qi.extendDomain(g,c))}const u=s.finalFunction?.(c)??c;o.aggregation[n]=u,Qi.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;l<e.groups.length;l++){const c=e.groups[l];o(n,a,c,l)}for(const l of a){const h=this.ctx.values[l].valueType==="category",u=n[l],d=Ci(i[l]),p=s?.get(d),g=h?new Ji:new Qi;for(let f=0;f<u.length;f+=1)p?.[f]!==!0&&g.extend(u[f]);e.domain.values[l]=g.getDomain()}}}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}},UT=class{constructor(e){this.ctx=e}setupDomainForDefinition(e,t,i){const n=e.valueType==="category";let s=t.get(e);return!s&&this.ctx.bandingConfig?.enableBanding!==!1&&(s=new Dc(n?()=>new Ji:()=>new Qi,this.ctx.bandingConfig,n),t.set(e,s)),s&&n&&s.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),s||(n?new Ji:new Qi)}extendDomainFromData(e,t,i){if(e instanceof Dc)e.extendBandsFromData(t,i);else for(let n=0;n<t.length;n++)i?.[n]!==!0&&e.extend(t[n])}initializeBandedDomain(e,t,i){if(!(e instanceof Dc))return;const n=e.getStats(),s=n.bandCount===0||n.dataSize!==t;this.ctx.debug.check()&&s&&i&&this.ctx.debug(`Reinitializing bands for ${i}: bandCount=${n.bandCount}, dataSize=${n.dataSize}, dataLength=${t}`),s&&e.initializeBands(t)}},Mr=Symbol("key-sort-orders"),em=Symbol("column-sort-orders"),tm=Symbol("domain-ranges"),Ac=Symbol("domain-bands"),xa=Symbol("reducer-bands"),ES=Object.freeze([0]);function im(e,t){if(typeof t=="string")e.set(t,(e.get(t)??0)+1);else for(const i of t)e.set(i,(e.get(i)??0)+1)}function ld(e,t){if(e.reusableResult.valid=!1,e.hasInvalidValue){e.reusableResult.value=e.invalidValue,e.domain.extend(e.invalidValue);return}e.mode!=="integrated"&&_.warnOnce(`invalid value of type [${typeof t}] for [${e.def.scopes} / ${e.def.id}] ignored:`,`[${t}]`),e.reusableResult.value=void 0}function Cc(e,t,i,n,s,r){return e&&t&&e(i,n,s)===!1?(r.reusableResult.missing=!1,ld(r,i),r.reusableResult):null}function kc(e,t,i,n,s){s.missing=!e,!e&&!t&&im(i,n)}function cd(e,t,i){return t.valid=!0,t.value=e,i.extend(e),t}var WT=class{constructor(e){this.ctx=e}createProcessValueFn(e,t,i,n,s,r){const a={def:e,accessor:t,domain:i,reusableResult:n,processorFns:s,mode:this.ctx.mode};return(r==="extend"?this.createSpecializedProcessValue(a,e.validation):null)??this.createGenericProcessValue(a,r)}createSpecializedProcessValue(e,t){return e.def.forceValue!=null?this.createSpecializedProcessValueForceValue(e):e.def.processor?this.createSpecializedProcessValueProcessor(e,t):t?e.def.type==="key"?this.createSpecializedProcessValueKeyValidation(e,t):this.createSpecializedProcessValueValueValidation(e,t):null}createValidationMeta(e){const{def:t,domain:i,reusableResult:n,mode:s}=e;return{reusableResult:n,hasInvalidValue:"invalidValue"in t,invalidValue:t.invalidValue,domain:i,def:t,mode:s}}createSpecializedProcessValueKeyValidation(e,t){const{def:i,accessor:n,domain:s,reusableResult:r}=e,a=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=i.allowNullKey??!1,u=this.createValidationMeta(e);if(n){const d=n;return function(g,f,y){let m;try{m=d(g)}catch{}const v=m!=null||h&&m==null,x=!h&&m==null;return!v||x||t(m,g,f)===!1?(r.missing=!v,!v&&!o&&im(c,y),ld(u,m),r):(r.missing=!1,r.valid=!0,r.value=m,s.extend(m),r)}}return function(p,g,f){const y=a in p,m=y?p[a]:l,v=!h&&m==null;return!y||v||t(m,p,g)===!1?(r.missing=!y,!y&&!o&&im(c,f),ld(u,m),r):(r.missing=!1,r.valid=!0,r.value=m,s.extend(m),r)}}createSpecializedProcessValueValueValidation(e,t){const{def:i,accessor:n,domain:s,reusableResult:r}=e,a=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=this.createValidationMeta(e);if(n){const u=n;return function(p,g,f){let y;try{y=u(p)}catch{}const m=y!=null,v=Cc(t,m,y,p,g,h);return v!==null?v:(kc(m,o,c,f,r),cd(y,r,s))}}return function(d,p,g){const f=a in d,y=f?d[a]:l,m=Cc(t,f,y,d,p,h);return m!==null?m:(kc(f,o,c,g,r),cd(y,r,s))}}createSpecializedProcessValueForceValue(e){const{def:t,accessor:i,domain:n,reusableResult:s}=e,r=t.property,a=t.forceValue;if(i){const o=i;return function(c,h,u){let d;try{d=o(c)}catch{}const f=d!=null&&Ka(d)?-1*a:a;return s.missing=!1,s.valid=!0,s.value=f,n.extend(f),s}}return function(l,c,h){const u=r in l,d=u?l[r]:void 0,g=u&&Ka(d)?-1*a:a;return s.missing=!1,s.valid=!0,s.value=g,n.extend(g),s}}createSpecializedProcessValueProcessor(e,t){const{def:i,accessor:n,domain:s,reusableResult:r,processorFns:a}=e,o=i.property,l="missingValue"in i,c=i.missingValue,h=i.missing,u=i.processor,d=this.createValidationMeta(e);if(n){const p=n;return function(f,y,m){let v;try{v=p(f)}catch{}const x=v!=null,M=Cc(t,x,v,f,y,d);if(M!==null)return M;kc(x,l,h,m,r);let D=a.get(i);return D==null&&(D=u(),a.set(i,D)),v=D(v,y),cd(v,r,s)}}return function(g,f,y){const m=o in g;let v=m?g[o]:c;const x=Cc(t,m,v,g,f,d);if(x!==null)return x;kc(m,l,h,y,r);let M=a.get(i);return M==null&&(M=u(),a.set(i,M)),v=M(v,f),cd(v,r,s)}}createGenericProcessValue(e,t){const{def:i,accessor:n,domain:s,processorFns:r}=e,a=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=t==="extend",u=e.reusableResult,d=this.createValidationMeta(e);return function(g,f,y){let m,v;if(n){try{m=n(g)}catch{}v=m!=null}else v=a in g,m=v?g[a]:l;i.forceValue!=null&&(m=v&&Ka(m)?-1*i.forceValue:i.forceValue,v=!0),kc(v,o,c,y,u);const x=i.allowNullKey??!1;if(i.type==="key"&&m==null&&!x)return ld(d,m),u;const D=Cc(i.validation,v,m,g,f,d);if(D!==null)return D;if(u.valid=!0,i.processor){let A=r.get(i);A==null&&(A=i.processor(),r.set(i,A)),m=A(m,f)}return h&&s.extend(m),u.value=m,u}}};function KT(e,t){return!e||!t||e.length===0||t.length===0?!0:e.some(i=>t.includes(i))}function RS(e,t){if(e.valueType==="category"){for(const i of t)if(i.property===e.property&&i.valueType===e.valueType&&KT(i.scopes,e.scopes)&&i.validation===e.validation)return i}}var YT=class{constructor(e,t,i){this.ctx=e,this.initializer=t,this.scopeCacheManager=i,this.processValueFactory=new WT(e)}recomputeDomains(e){const t=this.ctx.debug.check()?performance.now():0,i=e[Ac];let n;const s=e[Mr],r=this.setupDefinitionDomains(this.ctx.keys,i,s),a=new Map;for(const h of this.ctx.values){const u=RS(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 Dc){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=>[Ci(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 Qi.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 Qi.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 Ji):s.set(d,new Qi);for(const d of i){const p=RS(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 Ji):(s.set(d,new Qi),a&&(a=(d.scopes?.length??0)===n.size))}};o();const l=this.scopeCacheManager.buildAccessors(Gr(t,i)),c=new WeakMap;for(const d of Gr(t,i)){const p=l.get(d.property),g=s.get(d),f={value:void 0,missing:!1,valid:!1},y=this.processValueFactory.createProcessValueFn(d,p,g,f,r,e);c.set(d,y)}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 Dc;let g;p||(g=h.valueType==="category"?"discrete domain":"not configured");let f;if(p&&d){const y=s.get(d)??d.getStats(),m=y.bandCount>0?y.dirtyBandCount/y.bandCount:0;f={totalBands:y.bandCount,dirtyBands:y.dirtyBandCount,dataSize:y.dataSize,scanRatio:m}}return{property:String(h.property),applied:p,reason:g,stats:f}}),a=r(this.ctx.keys,t),o=r(this.ctx.values,i);e.optimizations.domainBanding={keyDefs:a,valueDefs:o}}};function ZT(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function XT(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 qT(e){return{sortOrder:e.isOrdered&&e.sortOrder!==0?e.sortOrder:void 0,isUnique:e.isUnique,isDirty:!1}}var JT=class{constructor(e,t){this.ctx=e,this.domainManager=t,this.markScopeDatumInvalid=function(i,n,s,r,a){for(const o of i){r.has(o)||(r.set(o,Sr(n.length,!1)),a.set(o,0));const l=r.get(o);l[s]||(l[s]=!0,a.set(o,a.get(o)+1))}}}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,allKeyMappings:h,keySortOrders:u}=this.extractKeys(s,e,i),{columns:d,columnScopes:p,columnNeedValueOf:g,partialValidDataCount:f,maxDataLength:y}=this.extractValues(a,c,r,e,o,i),m=v=>{const x=t.get(v),M=x.getDomain();return Qi.is(x)&&M[0]>M[1]?[]:M};return{type:"ungrouped",input:{count:y},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...h.values()],columns:d,columnScopes:p,columnNeedValueOf:g,invalidKeys:o,invalidKeyCount:l,invalidData:a,invalidDataCount:c,domain:{keys:s.map(m),values:r.map(m)},defs:{allScopesHaveSameDefs:n,keys:s,values:r},partialValidDataCount:f,time:0,version:0,[tm]:new Map,[Mr]:u,[em]:new Map,[Ac]:new Map,[xa]: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;let c,h;const u=e.map(p=>i(p)),d=(p,g)=>{const f=h.get(p);c.set(g,c.get(f)),n.has(f)&&(n.set(g,n.get(f)),s.set(g,s.get(f)),a.set(g,a.get(f)))};for(const[p,g]of e.entries()){const{invalidValue:f,scopes:y}=g,m=u[p];c=new Map,h=new Map,o.set(g,c);const v=ZT();for(const x of y??[]){const M=t.get(x)?.data??[];if(h.has(M)){d(M,x);continue}const D=[];c.set(x,D),h.set(M,x);let A,I,k=0;for(let C=0;C<M.length;C++){if(M[C]==null||typeof M[C]!="object"){A??(A=Sr(M.length,!1)),I??(I=Sr(M.length,!1)),k+=1,A[C]=!0,I[C]=!0,D.push(f);continue}const T=m(M[C],C,x);if(T.valid){D.push(T.value),XT(v,T.value);continue}D.push(f),A??(A=Sr(M.length,!1)),I??(I=Sr(M.length,!1)),k+=1,A[C]=!0,I[C]=!0}A&&I&&(n.set(x,A),s.set(x,I),r.set(x,k),a.set(x,k))}l.set(p,qT(v))}return{invalidData:s,invalidKeys:n,invalidKeyCount:r,invalidDataCount:a,allKeyMappings:o,keySortOrders:l}}extractValues(e,t,i,n,s,r){let a=0;const o=[],l=[],c=[];let h=0;const u=i.map(d=>r(d));for(const[d,p]of i.entries()){const{invalidValue:g}=p,f=u[d];if(new Set(p.scopes.map(I=>n.get(I))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(p)}`);const m=new Set(p.scopes),v=Ci(p.scopes),x=n.get(v)?.data??[],M=new Array,D=s.get(v);let A=!1;for(let I=0;I<x.length;I++){if(x[I]==null||typeof x[I]!="object"){this.markScopeDatumInvalid(p.scopes,x,I,e,t),M[I]=g;continue}const k=x[I],C=D==null?!1:D[I],T=f(k,I,p.scopes);let N=T.value;(C||!T.valid)&&this.markScopeDatumInvalid(p.scopes,x,I,e,t),C?N=g:T.valid||(a+=1,N=g),!A&&N!=null&&typeof N=="object"&&(A=!0),M[I]=N}o.push(M),l.push(m),c.push(A),h=Math.max(h,M.length)}return{columns:o,columnScopes:l,columnNeedValueOf:c,partialValidDataCount:a,maxDataLength:h}}warnDataMissingProperties(e){if(e.size!==0)for(const t of Gr(this.ctx.keys,this.ctx.values))for(const[i,n]of t.missing){if(n<(e.get(i)?.data.length??1/0))continue;const s=i==null?"":` for ${i}`;_.warnOnce(`the key '${t.property}' was not found in any data element${s}.`)}}},QT=class{constructor(e){this.ctx=e}groupData(e,t){var i;const{keys:n,columns:s,columnScopes:r,invalidKeys:a,invalidData:o}=e,l=e.scopes,c=[],h=[],u=l.size!==1||t!=null?new Map:void 0;let d=!0,p=0;const g=l.size,f=this.groupBatches(l,s,r,n,o,a),y=f.length;if(this.ctx.debug?.check()&&!e.optimizations&&(e.optimizations={}),this.ctx.debug?.check()){const x=g>0?1-y/g:0;e.optimizations.batchMerging={originalBatchCount:g,mergedBatchCount:y,mergeRatio:x}}const m=f.length===1,v=Object.freeze(Sr(f[0][1].length,ES));for(const[x,M,D,A,I,k]of f){const C=s[Ci(M)];for(let T=0;T<C.length;T++){if(k?.[T]===!0)continue;const N=D.map(z=>z[T]);if(N==null||N.length===0)throw new Error("AG Charts - no keys found for scope(s): "+x.join(", "));const R=t?.(N)??N,F=u==null?void 0:qf(R);let G=u?.get(F),V,H,q=!1;if(G==null?(V={keys:R,datumIndices:[],aggregation:[],validScopes:l},H=p++,G=[H,V],q=!0,u?.set(F,G),c.push(V.keys),h.push(V)):([H,V]=G,d=!1),I?.[T]===!0){V.validScopes===l&&(V.validScopes=new Set(l.values()));for(const z of A)V.validScopes.delete(z)}if(q&&T===H&&m)V.datumIndices=v;else{!q&&V.datumIndices===v&&(V.datumIndices=v.map(z=>[...z]));for(const z of M)(i=V.datumIndices)[z]??(i[z]=[]),V.datumIndices[z].push(T-H)}}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:h,groupsUnique:d,optimizations:e.optimizations,[Ac]:e[Ac],[xa]:e[xa]}}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;n<e.length;n++){if(i.has(n))continue;const[s,r,a,o,l,c]=e[n],h=[[s],[...r],a,new Set(o),l,c];this.findAndMergeCompatibleBatches(e,n,h,i),t.push(h),i.add(n)}return t}findAndMergeCompatibleBatches(e,t,i,n){const s=e[t];for(let r=t+1;r<e.length;r++){if(n.has(r))continue;const a=e[r],[o,l,,c]=a;if(this.areBatchesCompatible(s,a)){i[0].push(o),i[1].push(...l);for(const h of c)i[3].add(h);n.add(r)}}}};function PS(e){return e.removedIndices.size===0&&e.totalPrependCount===0&&e.totalAppendCount>0}function eN(e){return e.removedIndices.size===0&&e.totalAppendCount===0&&e.totalPrependCount>0}function tN(e){return e.removedIndices.size===0}function iN(e){return e.removedIndices.size===0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0&&t.deleteCount===0)}function nN(e){return e.removedIndices.size>0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0)}function sN(e){const{removedIndices:t}=e;if(t.size===0)return!1;const i=Array.from(t).sort((n,s)=>n-s);if(i[0]!==0)return!1;for(let n=0;n<i.length;n++)if(i[n]!==n)return!1;return!0}function rN(e){return sN(e)&&e.totalAppendCount>0&&e.totalPrependCount===0}var aN=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;o<t;o++){for(;a<r.length&&r[a]<o;)s++,a++;if(!i.has(o)){const l=o+n-s;e(o,l)}}}getPrependedValues(){return this.prependValues}getAppendedValues(){return this.appendValues}getInsertionValues(){return this.insertionValues}applyToArray(e,t,i){const{spliceOps:n,finalLength:s,originalLength:r}=this.indexMap;if(!(r===s&&n.length===0)){for(const a of n){const o=a.insertCount>0?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)}}},oN=class extends kS{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;h<c;h+=1){for(let u=0;u<o.length;u++)o[u]=a[u]?.[h];r=t(r,o)}return r}captureStatsBeforeProcessing(){const e=this.bands.filter(i=>i.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}}},FS=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;h<c;h+=1){for(let u=0;u<o.length;u++)o[u]=a[u]?.[h];r=t(r,o)}return r}evaluate(e,t,i={}){var n;const s=this.createContext(e,t);if(!s)return;t[n=xa]??(t[n]=new Map);const r=t[xa],a=e.property;let o=r.get(a);return o||(o=new oN(this.bandingConfig),r.set(a,o)),o.getBandCount()===0&&o.initializeBands(s.rawData.length),i.beforeEvaluate?.(o,s),o.captureStatsBeforeProcessing(),o.evaluateFromData(e,s,i.reuseCleanBands??!1),o.getResult(e)}applyIndexMap(e,t){const i=e[xa];if(i)for(const n of i.values())n.applyIndexMap(t)}createContext(e,t){if(t.type!=="ungrouped")return;const i=Jf(e)?e.scopes[0]:Ci(t.dataSources.keys());if(i==null)return;const n=t.dataSources.get(i)?.data??[],s=t.keys.map(a=>a.get(i)).filter(a=>a!=null),r=s.map(()=>{});return{scopeId:i,rawData:n,keyColumns:s,keysParam:r}}},lN=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=Ci(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=od(o);return e.changeDescription=p.size===1?p.values().next().value:void 0,e}updateBandsForChanges(e,t){const i=e[Ac];if(i.size===0)return;const n=od(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<o.insertCount;l++){const c=o.index+l;if(c<0||c>=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;if(r==null||typeof r!="object")l=!0,c=!0;else{for(const{index:h,def:u,processValue:d}of n){if(!u.scopes?.includes(i))continue;const p=d(r,t,i);a.set(h,{value:p.value,valid:p.valid}),p.valid||(l=!0)}for(const{index:h,def:u,processValue:d}of s){if(!u.scopes?.includes(i))continue;const p=d(r,t,u.scopes);o.set(h,{value:p.value,valid:p.valid}),p.valid||(c=!0)}}return{keys:a,values:o,hasInvalidKey:l,hasInvalidValue:c}}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(([y,m])=>m===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 y=f?.keys.get(o);return y?.valid?y.value:l.invalidValue},f=>{for(const y of f)p.tuples[g]||(p.tuples[g]=new Array(this.ctx.keys.length)),p.tuples[g][o]=y,g+=1})}const 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(qf(u))}a.set(o,c)}return a}transformColumnsArrays(e,t,i){this.transformArraysWithCache(this.ctx.values,t,i,n=>e.columns[n],n=>[Ci(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=Sr(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)}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=Ci(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(Sr(t.columnScopes.length,ES)),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?qf(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;h<c.insertCount;h++){const u=c.index+h,d=n(s,u);d&&a.added.add(d)}const{originalLength:o,totalPrependCount:l}=r.indexMap;if(!PS(r.indexMap))if(eN(r.indexMap)&&o>0)for(let c=l;c<l+o;c++){const h=n(s,c);h&&a.moved.add(h)}else if(tN(r.indexMap)&&l>0)for(let c=0;c<o;c++){const h=c+l,u=n(s,h);u&&a.moved.add(u)}else r.forEachPreservedIndex((c,h)=>{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<s.length;a++)s[a]&&!r?.[a]&&(i+=1)}e.partialValidDataCount=i,this.recountInvalid(e.invalidKeys,e.invalidKeyCount),this.recountInvalid(e.invalidData,e.invalidDataCount),this.invalidateCachesForChanges(e)}updateSortOrderForAppend(e,t,i){if(i.length===0)return;const n=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[Mr].get(i);if(!s)continue;const r=Ci(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=od(t);let n=!0,s=!1,r=!1,a,o;for(const l of i){const{indexMap:c}=l;iN(c)||(PS(c)?(s=!0,a=c.originalLength):nN(c)||(rN(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[Mr].clear(),e[em].clear())}updateKeySortOrdersForRollingWindow(e,t){const{originalLength:i,removedCount:n}=t;for(const[s,r]of e.keys.entries()){const a=e[Mr].get(s);if(!a)continue;const o=Ci(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[tm])}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())}},Sa=0,Ma=1,ts=2,cN=class lh{constructor(t){this.isDirty=!1;const i=t.reduce((r,a)=>Math.max(r,a.length),0),{maxLevelSize:n,buffer:s}=lh.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=lh.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;o<a;o+=1){const l=Number(r[o]);if(l!==l)continue;const c=s+o<<1,h=n[c],u=n[c+1];(h!==h||l<h)&&(n[c]=l),(u!==u||l>u)&&(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;h<r;h+=1){const u=c+2,d=n[c],p=n[u];n[l]=p!==p||d<p?d:p;const g=n[c+1],f=n[u+1];n[l+1]=f!==f||g>f?g:f,l+=2,c+=4}}}rebuild(t){const i=t.reduce((s,r)=>Math.max(s,r.length),0);if(lh.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:s,buffer:r}=lh.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*ts)+Sa,o=Math.trunc(r*ts)+Ma;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)||c<h)&&(s[a]=c),(!Number.isFinite(u)||c>u)&&(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*ts)+Sa],o=i[Math.trunc(s*ts)+Ma],l=i[Math.trunc(r*ts)+Sa],c=i[Math.trunc(r*ts)+Ma];i[Math.trunc(n*ts)+Sa]=!Number.isFinite(l)||a<l?a:l,i[Math.trunc(n*ts)+Ma]=!Number.isFinite(c)||o>c?o:c,t=n}}computeRangeInto(t,i,n,s,r,a,o){const l=r+a-1;if(l<i||r>=n)return o;if(r>=i&&l<n){const c=t[Math.trunc(s*ts)+Sa],h=t[Math.trunc(s*ts)+Ma];Number.isFinite(c)&&(o[0]=Math.min(o[0],c)),Number.isFinite(h)&&(o[1]=Math.max(o[1],h))}else a>1&&(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[Sa],n[1]=i[Ma],n}get range(){const{buffer:t}=this;return[t[Sa],t[Ma]]}get length(){return this.dataLength}};function hN(e,t){const i=e.length;if(e.length<=1)return 1;let n=0,s=e[0];for(let r=1;r<i;r++){const a=e[r];if(a==null)continue;if(typeof(t?a.valueOf():a)!="number")return;const l=Math.sign(a-s);if(l!==0){if(n!==0&&n!==l)return;n=l}s=a}return n===0?1:n}var uN=class{constructor(e){this.ctx=e,this.rangeBetweenBuffer=[0,0]}resolveMissingDataCount(e){let t=0;for(const i of this.ctx.values)t=Math.max(t,i.missing.get(e.id)??0);return t}resolveProcessedDataDefById(e,t){const i=this.ctx.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.keys[n];if(s==null)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return s.get(e.id)}hasColumnById(e,t){return this.ctx.scopeCache.get(e.id)?.get(t)!=null}resolveColumnById(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.columns?.[n];if(s==null)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return s}resolveColumnNeedsValueOf(e,t,i){const n=this.resolveProcessedDataIndexById(e,t);return i.columnNeedValueOf?.[n]??!0}resolveAbsoluteIndex(e,t){return e+t}getDomain(e,t,i,n){return this.getDomainsByType(i??"value",n)?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,n],s){const r=t.map(u=>this.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]<d&&(d=f[0]),f[1]>p&&(p=f[1]))}return this.rangeBetweenBuffer[0]=d,this.rangeBetweenBuffer[1]=p,this.rangeBetweenBuffer}const o=r.join(":"),l=s[tm],c=r.map(u=>s.columns[u]);let h=l.get(o);return h==null?(h=new cN(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:hN(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[Mr],!0):void 0}getKeySortEntry(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i[Mr].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[em],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}}},dN=class{constructor(e){this.ctx=e}processScopeCache(){this.ctx.scopeCache.clear();for(const e of Gr(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=jT(i.property);if(s==null){_.warnOnce("Invalid property path [%s]",i.property);continue}const r=HT(s);t.set(i.property,r)}return t}},nm=class{constructor(e,t="standalone",i=!1,n){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=ce.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(Jf(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 uN(l),this.scopeCacheManager=new dN(l),this.domainInitializer=new UT(l),this.domainManager=new YT(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new FS(this.opts.domainBandingConfig),this.dataExtractor=new JT(l,this.domainManager),this.dataGrouper=new QT(l),this.aggregator=new $T(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new lN(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()&&pN(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 n=this.getUniqueDataSets(e);for(const s of n)s.commitPendingTransactions();return this.processData(e.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip");return this.incrementalProcessor.reprocessData(e,t,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this))}recomputeDomains(e){this.domainManager.recomputeDomains(e)}warnDataMissingProperties(e){this.dataExtractor.warnDataMissingProperties(e)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}valueIdxLookup(e,t){return this.scopeCacheManager.valueIdxLookup(e,t)}extractData(e){return this.dataExtractor.extractData(e)}reprocessGroupProcessors(e,t){const{groupProcessors:i}=this,{columns: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=od(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;u<h.insertCount;u++){const d=h.index+u,p=e.groups[d];o(n,a,p,d)}}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:n}of this.propertyProcessors)for(const s of this.valueIdxLookup(n,i))t()(e,s)}reduceData(e){e.reduced??(e.reduced={});for(const t of this.reducers)this.shouldUseReducerBanding(t,e)?e.reduced[t.property]=this.reduceWithBands(t,e):e.reduced[t.property]=this.reduceStandard(t,e)}shouldUseReducerBanding(e,t){return t.type==="ungrouped"&&e.supportsBanding===!0&&typeof e.combineResults=="function"}reduceWithBands(e,t){const i=this.reducerManager.evaluate(e,t,{reuseCleanBands:!1});return i===void 0?this.reduceStandard(e,t):i}reduceStandard(e,t){const i=e.reducer();if(t.type==="grouped"){let o=e.initialValue;for(const l of t.groups)o=i(o,l.keys);return o}const n=Jf(e)?e.scopes[0]:Ci(t.scopes);if(n==null)return e.initialValue;const s=t.dataSources.get(n)?.data??[],r=t.keys.map(o=>o.get(n)).filter(o=>o!=null),a=r.map(()=>{});return FS.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[xa];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=Ci(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 pN(e){const t=(i,n)=>{n.length>0&&(_.log(`DataModel.processData() - ${i}`),_.table(n))};if(_.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){_.log("DataModel.processData() - Optimization Summary");const i=e.optimizations;if(i.performance&&_.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})`:"";_.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){_.log(` Domain Banding: \u2713 (${r}/${a} definitions)`);for(const o of[...n,...s])if(o.stats){const l=(o.stats.scanRatio*100).toFixed(1);_.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(", ");_.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const n=i.sharedDatumIndices.applied?"\u2713":"\u2717",s=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;_.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}`;_.log(` Batch Merging: ${s} (${n}% reduction)`)}}}var VS=1e3;function BS(e,t,i){const n=e.filter(s=>typeof s=="number"&&Number.isFinite(s));return n.length>0?i(n):t}function un(e){return e.input.count<=VS}function _S(e){return e!=null&&Nu(e)}function gN(e){return e!=null}function fN(e){return!0}function zS(e,t){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return _S;default:return t?fN:gN}}function GS(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Ir(e,t,i={}){const n=i.allowNullKey??!1;return{property:e,type:"key",valueType:GS(t),validation:i.validation??zS(t,n),...i}}function Ue(e,t,i={}){const n=i.allowNullKey??!1;return{property:e,type:"value",valueType:GS(t),validation:i.validation??zS(t,n),...i}}function mN(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...t}}var yN=function(e){return e};function jS(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>yN: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 bN(e,t={}){const{min:i=-1/0,max:n=1/0,processor:s,...r}=t;return{type:"value",property:e,valueType:"range",validation:_S,processor:jS(s,function(){return function(l){return Be(l)?te(i,l,n):l}}),...r}}function sm(e,t,i={}){const{onlyPositive:n,processor:s,...r}=i;return{...Ue(e,t,r),processor:jS(s,zT(n))}}function vN(e,t,i={}){return{...Ue(e,t,i),processor:GT()}}function wc(e,t,i,n){return[Ue(e,n,i),wN(i.groupId,t,i.separateNegative),...i.rangeId==null?[]:[BT(i.rangeId,i.groupId)]]}var HS={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&&o<l?o:l}},supportsBanding:!0,combineResults(e){return BS(e,1/0,t=>Math.min(...t))},needsOverlap:!0},$S={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 BS(e,-1/0,t=>Math.max(...t))},needsOverlap:!0},xN={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:t}}){return t?.slice().sort((i,n)=>{for(let s=0;s<i.length;s++){const r=i[s]-n[s];if(r!==0)return r}return 0})}};function SN({normaliseTo:e}){const t=(i,n)=>{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=MN(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 MN(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 hd(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:Xl({normaliseTo:t},SN)}}function IN({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]:h<e[0]?e[0]:h};return function(){return function(l,c){let[h,u]=l.domain.values[c];i!=null&&(h=i),n!=null&&(u=n);const d=u-h;l.domain.values[c]=[e[0],e[1]];const p=l.columns[c];for(let g=0;g<p.length;g+=1)p[g]=r(p[g],h,d)}}}function rm(e,t,i,n,s){return{type:"property-value-processor",property:e,adjust:Xl({normaliseTo:t,rangeMin:n,rangeMax:s,zeroDomain:i},IN)}}var Lc=1,ud=2;function DN(e,t,i){let n=Lc|ud;if(e.valueType==="category")return t.length<i.length&&(n&=~Lc),n;let s=i[0]?.valueOf();for(let r=1;n!==0&&r<i.length;r++){const a=i[r]?.valueOf();(!Number.isFinite(a)||s>a)&&(n&=~ud),Number.isFinite(a)&&s===a&&(n&=~Lc),s=a}return n}function AN(e){return function(i,n){if(!un(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[Mr];for(let d=0;(c||h)&&d<s.length;d++){const p=s[d],g=u.get(d);if(p.valueType==="category"){const f=i.domain.keys[d]?.length??0,y=i.keys[d]?.values().next().value?.length??0;f<y&&(c=!1)}else g&&(g.isUnique===!1&&(c=!1),g.sortOrder!==1&&(h=!1))}if(e&&e.length>0){let d=Lc|ud;for(let p=0;d!==0&&p<r.length;p++){const g=r[p];e.includes(g.id)&&(d&=DN(g,o[p],l[p]))}d&Lc||(c=!1),d&ud||(h=!1)}}return{uniqueKeys:c,orderedKeys:h}}}function CN(){return{uniqueKeys:!0,orderedKeys:!1}}function Tc(e){return{type:"processor",property:"animationValidation",calculate:Xl(e,AN),incrementalCalculate:CN}}function kN({mode:e,separateNegative:t}){return function(){return function(){return function(r,a,o,l){const c=[0,0];for(const h of a){const u=o.datumIndices[h];if(u==null)continue;const d=c[0],p=c[1],g=r[h];let f=!1;for(const y of u){const m=l+y,v=g[m];if(!Be(v))continue;const x=t&&Ka(v),M=x?d:p;if(e==="normal"?g[m]=M+v:g[m]=M,!f){const D=x?0:1;c[D]=M+v,f=!0}}}}}}}function wN(e,t,i=!1){const n=Xl({mode:t,separateNegative:i},kN);return{type:"group-value-processor",matchGroupIds:[e],adjust:n,supportsReprocessing:!0}}function US(e){return e.id??e.property}function LN(e,t,i){const n=new Map,s=t.defs.values;for(let o=0;o<s.length;o+=1){const l=s[o];if(l.scopes?.includes(e)===!1)continue;const c=US(l);if(n.has(c))return;n.set(c,o)}const r=[],a=i.defs.values;for(let o=0;o<a.length;o+=1){const l=a[o];if(l.scopes?.includes(e)===!1)continue;const c=US(l),h=n.get(c);if(h==null)return;n.delete(c),r.push({previousIndex:h,nextIndex:o})}if(n.size===0)return r}function am(e,t,i,n,s){for(const{previousIndex:r,nextIndex:a}of i){const o=e[r],l=t[a],c=o[n],h=l[s];if(c!==h)return!1}return!0}function dd(e,t,i=!0){return{type:"processor",property:"diff",calculate(n,s){if(!un(n))return;const r=new Map,a=new Map,o=new Map,l=new Map,c=t.keys.map(v=>v.get(e)),h=n.keys.map(v=>v.get(e)),u=t.columns,d=n.columns,p=LN(e,t,n);if(p==null)return s;const g=Math.max(t.input.count,n.input.count),f=n.defs.keys.some(v=>v.allowNullKey===!0);for(let v=0;v<g;v++){const x=v<t.input.count,M=v<n.input.count,D=x?Qf(c,v,f):void 0,A=D==null?"":Xt(...D),I=M?Qf(h,v,f):void 0,k=I==null?"":Xt(...I);if(M&&x&&A===k){am(u,d,p,v,v)||o.set(k,v);continue}const C=l.get(k);C!=null?((i||!am(u,d,p,C,v))&&(o.set(k,v),r.set(k,v)),l.delete(k)):M&&a.set(k,v);const T=a.get(A);T!=null?((i||!am(u,d,p,T,v))&&(o.set(A,v),r.set(A,v)),a.delete(A)):x&&(o.delete(A),l.set(A,v))}const m={changed:a.size>0||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]:m}}}}function Xt(...e){if(e.length===1){const t=Ou(e[0]);if(t===null)return Zf;if(t===void 0)return Xf;if(typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t}return e.map(t=>{const i=Ou(t);return i===null?Zf:i===void 0?Xf:i}).join("___")}var Ko=class hp{constructor(t){this.data=t,this.pendingTransactions=[]}static empty(){return new hp([])}static wrap(t){return new hp(t)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const t=this.getChangeDescription();return t?t.indexMap.finalLength:this.data.length}addTransaction(t){const i=this.normalizeTransaction(t);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){return new hp([...this.data])}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.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;return 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.pendingTransactions=[],this.cachedChangeDescription=void 0,this.updateItemToIndexCache(t,s,i,n),!0}updateItemToIndexCache(t,i,n,s){if(!this.itemToIndexCache)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}let u=!1,d=0;if(c){const y=Array.from(l).sort((m,v)=>m-v);if(u=y[0]===0,u){for(let m=0;m<y.length;m++)if(y[m]!==m){u=!1;break}u&&(d=y.length)}}if(c&&!u){this.itemToIndexCache=void 0;return}const p=this.itemToIndexCache,g=a-d;if(g!==0)for(const[y,m]of p)l.has(m)?p.delete(y):p.set(y,m+g);else if(c)for(const[y,m]of p)l.has(m)&&p.delete(y);for(let y=0;y<n.length;y++){const m=n[y];p.has(m)||p.set(m,y)}const f=r.finalLength-o;for(let y=0;y<i.length;y++){const m=i[y];p.has(m)||p.set(m,f+y)}}clearPendingTransactions(){const t=this.pendingTransactions.length;return this.pendingTransactions=[],this.cachedChangeDescription=void 0,t}getPendingTransactions(){return[...this.pendingTransactions]}toJSON(){return this.data}getChangeDescription(){if(!this.hasPendingTransactions())return;if(this.cachedChangeDescription)return this.cachedChangeDescription;const{indexMap:t,prependValues:i,appendValues:n,insertionValues:s}=this.buildIndexMap(),r=new aN(t,{prependValues:i,appendValues:n,insertionValues:s});return this.cachedChangeDescription=r,r}removeFromGroups(t,i){for(const n of t){let s=0;for(;s<n.length&&i.size>0;)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}}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}}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){if(!Array.isArray(t)||t.length===0)return;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;s<this.data.length&&n.size>0;s++){const r=this.data[s];n.has(r)&&(i.removedOriginalIndices.add(s),n.delete(r),i.virtualLength--)}n.size>0&&_.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyUpdates(t,i){if(!Array.isArray(t)||t.length===0)return;const 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&&_.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;t<this.data.length;t++)this.itemToIndexCache.has(this.data[t])||this.itemToIndexCache.set(this.data[t],t)}return this.itemToIndexCache}collectUpdatedOriginalIndices(t,i){const n=this.getItemToIndexMap();for(const s of[...t]){const r=n.get(s);r!==void 0&&!i.removedOriginalIndices.has(r)&&(i.updatedOriginalIndices.add(r),t.delete(s))}}removeFromTrackedInsertions(t,i){for(let n=0;n<i.trackedInsertions.length;n++){const s=i.trackedInsertions[n],r=s.items.length,a=[];let o=0;for(;o<s.items.length;)t.includes(s.items[o])?(a.push(o+a.length),s.items.splice(o,1),i.virtualLength--):o++;a.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,s,r,a)}}adjustLaterInsertionsAfterRemoval(t,i,n,s,r){const a=r.length;for(let o=i+1;o<t.length;o++){const l=t[o];if(l.virtualIndex<=n.virtualIndex)continue;const c=Math.min(Math.max(l.virtualIndex-n.virtualIndex,0),s);let h=0;for(const u of r)if(u<c)h++;else break;c===s&&(h=a),h>0&&(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;u<a.length;u++){const d=a[u];a[u-1]-d===1?h++:(l.push({index:c-h+1+t,deleteCount:h,insertCount:0}),c=d,h=1)}l.push({index:c-h+1+t,deleteCount:h,insertCount:0})}if(r.length>0)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+i<n)s++;else break;return s}resolveUpdatedIndices(t,i,n,s,r,a,o){const l=new Set;if(s)for(const c of s.updatedPrependsIndices)l.add(c);if(a.size>0){const c=Array.from(a).sort((u,d)=>u-d);let h=0;for(const u of c){if(r)for(;h<r.length&&r[h]<u;)h++;const d=r?h:0,p=u+t;let g=0;for(const y of o)y.virtualIndex<=p&&(g+=y.items.length);const f=u+t-d+g;l.add(f)}}if(s){const c=t+n+i;for(const h of s.updatedAppendsIndices)l.add(c+h);if(s.updatedInsertionsIndices.length>0&&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;g<u.items.length;g++)s.updatedInsertionsIndices.includes(h)&&l.add(p+g),h++}}}return l}},WS=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if(typeof t!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);i!=null&&(i.delete(t),i.size===0&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){const t=this.eventListeners.get(e.type);if(t)for(const i of t)i(e)}},KS=(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))(KS||{}),om=[0,1,2,3,4];function TN(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 Yo(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 Dr=class extends oe{};b([S],Dr.prototype,"fill",2),b([S],Dr.prototype,"fillOpacity",2),b([S],Dr.prototype,"stroke",2),b([S],Dr.prototype,"strokeWidth",2),b([S],Dr.prototype,"strokeOpacity",2),b([S],Dr.prototype,"lineDash",2),b([S],Dr.prototype,"lineDashOffset",2);var ws=class extends oe{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(e){const t=TN(e);return t.length===0?{}:be(...t.map(i=>this[i]))}};b([S],ws.prototype,"enabled",2),b([S],ws.prototype,"range",2),b([S],ws.prototype,"bringToFront",2),b([S],ws.prototype,"highlightedItem",2),b([S],ws.prototype,"unhighlightedItem",2),b([S],ws.prototype,"highlightedSeries",2),b([S],ws.prototype,"unhighlightedSeries",2);var is=class extends oe{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};b([S],is.prototype,"start",2),b([S],is.prototype,"stop",2),b([S],is.prototype,"fill",2),b([S],is.prototype,"fillOpacity",2),b([S],is.prototype,"stroke",2),b([S],is.prototype,"strokeWidth",2),b([S],is.prototype,"strokeOpacity",2),b([S],is.prototype,"lineDash",2),b([S],is.prototype,"lineDashOffset",2);var pd=class{constructor(){this.key="x",this.segments=new Ja(is)}};b([S],pd.prototype,"enabled",2),b([S],pd.prototype,"key",2),b([S],pd.prototype,"segments",2);var Ar=class extends oe{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};b([S],Ar.prototype,"type",2),b([S],Ar.prototype,"colorStops",2),b([S],Ar.prototype,"bounds",2),b([S],Ar.prototype,"gradient",2),b([S],Ar.prototype,"rotation",2),b([S],Ar.prototype,"reverse",2),b([S],Ar.prototype,"colorSpace",2);var Ct=class extends oe{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};b([S],Ct.prototype,"type",2),b([S],Ct.prototype,"colorStops",2),b([S],Ct.prototype,"bounds",2),b([S],Ct.prototype,"gradient",2),b([S],Ct.prototype,"rotation",2),b([S],Ct.prototype,"scale",2),b([S],Ct.prototype,"reverse",2),b([S],Ct.prototype,"path",2),b([S],Ct.prototype,"pattern",2),b([S],Ct.prototype,"width",2),b([S],Ct.prototype,"height",2),b([S],Ct.prototype,"padding",2),b([S],Ct.prototype,"fill",2),b([S],Ct.prototype,"fillOpacity",2),b([S],Ct.prototype,"backgroundFill",2),b([S],Ct.prototype,"backgroundFillOpacity",2),b([S],Ct.prototype,"stroke",2),b([S],Ct.prototype,"strokeOpacity",2),b([S],Ct.prototype,"strokeWidth",2);var Ls=class extends oe{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};b([S],Ls.prototype,"type",2),b([S],Ls.prototype,"url",2),b([S],Ls.prototype,"rotation",2),b([S],Ls.prototype,"scale",2),b([S],Ls.prototype,"backgroundFill",2),b([S],Ls.prototype,"backgroundFillOpacity",2),b([S],Ls.prototype,"repeat",2),b([S],Ls.prototype,"fit",2);var Rn=class extends oe{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new ws}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context")),"allowNullKeys"in t&&(this.allowNullKeys=t.allowNullKeys,e.delete("allowNullKeys"))}};b([S],Rn.prototype,"id",2),b([S],Rn.prototype,"visible",2),b([S],Rn.prototype,"focusPriority",2),b([S],Rn.prototype,"showInLegend",2),b([S],Rn.prototype,"cursor",2),b([S],Rn.prototype,"nodeClickRange",2),b([S],Rn.prototype,"highlight",2);function YS(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 lm(e,t,i,n,s,r){const[a,o]=YS(t,r),[l,c]=YS(e,s);return{xKey:i,yKey:n,xValue:e,yValue:t,first:l,last:c,min:a,max:o}}function Nc(e,t,[i,n],s){let r=ro(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=ar(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 cm(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}=tt.toCanvasPoint(e.contentGroup,n.x,n.y);return{canvasX:Math.round(s),canvasY:Math.round(r)}}}function NN(e,t,i,n,s){let r=-1,a=0,o=0,l=!1;for(;a<n&&r<=t-e;){r+=1;const c=i+o;if(l||(o*=-1),o>=0&&(o+=1),l&&o<0&&(o-=1),c<e||c>t){l=!0;continue}s(c)&&(a+=1)}return a}function hm(e){const t={};for(const i of om)t[i]=e(void 0,!1,i);return t}function ON(e,...t){const i={};for(const n of t??["default"])for(const s of om){const r=i[n]??(i[n]={});r[s]=e(void 0,!1,s,n)}return i}function um(e){return(e?.opacity??1)<1||(e?.fillOpacity??1)<1||(e?.strokeOpacity??1)<1}var ZS=new Map;function EN(e){if(e==null)return!1;const t=e.fill;if(!dt(t))return!1;const i=t.trim(),n=i.toLowerCase();if(n==="transparent"||n==="none")return!1;let s=ZS.get(i);if(s==null){try{s=Ne.fromString(i).a===1}catch{s=!1}ZS.set(i,s)}return s}function RN(e,t){return e!=="cutout"?e:EN(t)?"cutout":"overlay"}function XS(e,t){for(const i of t??[])switch(typeof e){case"string":if(i.itemId===e)return i;break;case"number":if(i.datumIndex===e)return i;break;default:return e}}var qS=(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))(qS||{}),PN=.25,FN=.125,gd=class{constructor(e,t,i,n){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=n.id}preventDefault(){this.defaultPrevented=!0}},dm=class{constructor(e,t){this.series=e,this.seriesGrouping=t,this.type="groupingChanged"}};function JS(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function pm(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius";default:return"x"}}var Oc=class extends WS{constructor(e){super(),this.cleanup=new Qe,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=gd,this.internalId=wn(this),this.contentGroup=new Zt({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Zt({name:`${this.internalId}-highlight`,zIndex:1}),this.highlightNodeGroup=this.highlightGroup.appendChild(new re({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new re({name:`${this.internalId}-highlight-label`,zIndex:2})),this.annotationGroup=new Zt({name:`${this.internalId}-annotation`}),this.labelGroup=new Zt({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new _f,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new ps,this._pickNodeCache=new ph(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||this.ctx.highlightManager.getActiveHighlight()==null)return!1;const{unhighlightedItem:e,unhighlightedSeries:t}=this.properties.highlight;return um(e)||um(t)}getDrawingMode(e,t="cutout"){return e?t:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const e=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:e}}}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,t){const i=JS(e),n=i==null?e:pm(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(pm(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(pm(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;r<i.length;r++)s.push({seriesId:t,key:i[r],name:n[r]});return s}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(n=>n.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 tt.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?0:this.isSeriesHighlighted(e,n)?this.isItemHighlighted(e,i)==null?2:4:3:0}getHighlightStateString(e,t,i,n){return Yo(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||!kl(a)||!kl(o)||!kl(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 RN(e,t)}filterItemStylerFillParams(e){return Wi(e)?K(e,["bounds","colorSpace","gradient","reverse"]):Ms(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||t==="highlight"&&!this.properties.highlight.enabled||t==="highlight-tooltip"&&!this.properties.highlight.enabled)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();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=Su(e.x,e.y,t),n=i.nearest?.closestDatum();if(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){Cn([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},y=c?JS(n):void 0,m=y==null?void 0:l[this.resolveKeyDirection(y)];if(m!=null)return m.formatDatum(d,e,p,u,g,t,i,s,r,f,o);const{formatManager:v}=h,x=this.callWithContext.bind(this),M=A=>r.formatValue(x,A.type,A.value,f)??v.format(x,A)??(e==null?"":String(e)),D=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:D,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return M({type:"category",value:e,datum:t,seriesId:u,legendItemName:g,key:i,source:p,property:n,domain:s,boundSeries:D})}}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 v={permissivePath:!0},x=this.ctx.optionsGraphService.resolvePartial(g,a,v);x&&(a={...x,size:x.size??a.size})}const f=u?this.getHighlightStyle(h,t,c):void 0;let m=be(f,a,e.getStyle(),o);if(l&&s){const v=this.ctx.highlightManager?.getActiveHighlight(),x=this.getHighlightStateString(v,h,t),M=this.filterItemStylerFillParams(m.fill),D=this.cachedCallWithContext(l,{seriesId:this.id,...m,fill:M,...s,highlightState:x,datum:i}),A=this.ctx.optionsGraphService.resolvePartial(g,D);m=be(A,m)}return m}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*=PN,t.strokeOpacity*=FN),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=Xn(this.nodeDataDependencies,n)!=null;return s&&(this._nodeDataDependencies=n,this.markNodeDataDirty()),s}pickFocus(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){_.error(String(s))}}cachedCallWithContext(e,t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,t)}callWithContext(e,t){return Cn([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}};Oc.className="Series",b([Vt({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Oc.prototype,"seriesGrouping",2);var gm=class extends Oc{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=Ee.is(e),n=Ee.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??Ko.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 XS(e,this.getNodeData())}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox: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(;a<t.length&&!this.isDatumEnabled(t,a);)a+=o;return a===t.length?void 0:a};let s;const r=te(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?s=i(r,e.datumIndexDelta):e.datumIndexDelta>0?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;a<r.length;a+=1){if(s?.[a]===!0)continue;const o=r[a]?.valueOf();if(ft(e,o))return a}}},Zo={x:["xKey"],y:["yKey"]},Xo={x:["xName"],y:["yName"]},fm=class extends gd{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.yKey=n.properties.yKey}},Pn=class extends Rn{constructor(){super(...arguments),this.xKeyAxis="x",this.yKeyAxis="y",this.pickOutsideVisibleMinorAxis=!1,this.segmentation=new pd}};b([S],Pn.prototype,"xKeyAxis",2),b([S],Pn.prototype,"yKeyAxis",2),b([S],Pn.prototype,"legendItemName",2),b([S],Pn.prototype,"pickOutsideVisibleMinorAxis",2),b([S],Pn.prototype,"segmentation",2);var mm=100,Cr=class extends gm{constructor({pathsPerSeries:e=["path"],pathsZIndexSubOrderOffset:t=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:n=!1,animationAlwaysPopulateNodeData:s=!1,segmentedDataNodes:r=!0,animationResetFns:a,propertyKeys:o,propertyNames:l,...c}){if(super({propertyKeys:o,propertyNames:l,canHaveAxes:!0,...c}),this.NodeEvent=fm,this.dataNodeGroup=this.contentGroup.appendChild(new SS({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new Zt({name:`${this.id}-series-labels`})),this.labelSelection=mt.select(this.labelGroup,Ei),this.highlightSelection=mt.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=mt.select(this.highlightLabelGroup,Ei),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=ce.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 Yf({name:`${this.id}-${h}`})),this.datumSelection=mt.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new Jl("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>mm}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||!un(i)||e:!1}trimIncrementalNodeArray(e,t){t<e.length&&(e.length=t)}createNodeData(){const e=this.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e,n=this.createNodeDatumContext(t,i);if(!n)return this.getEmptyResult();const s=this.initializeResult(n);return!this.visible&&(this.seriesGrouping==null&&!this.opts.animationAlwaysPopulateNodeData||!n.animationEnabled)?s:(this.populateNodeData(n),this.finalizeNodeData(n),this.assembleResult(n,s))}createNodeDatumContext(e,t){throw new Error(`${this.constructor.name}: createNodeDatumContext() must be implemented when using the template method pattern`)}populateNodeData(e){throw new Error(`${this.constructor.name}: populateNodeData() must be implemented when using the template method pattern`)}initializeResult(e){throw new Error(`${this.constructor.name}: initializeResult() must be implemented when using the template method pattern`)}validateCreateNodeDataPreconditions(){const e=this.axes.x,t=this.axes.y;if(!(!e||!t||!this.dataModel||!this.processedData))return{xAxis:e,yAxis:t}}getEmptyResult(){}finalizeNodeData(e){e.canIncrementallyUpdate&&this.trimIncrementalNodeArray(e.nodes,e.nodeIndex)}assembleResult(e,t){return t}updateSelections(){var e;const t=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&t)return!1;const{nodeDataRefresh:i}=this;if(!i&&!this.isPathOrSelectionDirty())return!1;if(i){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const n=this.isProcessedDataAnimatable();if(this._contextNodeData){(e=this._contextNodeData).animationValid??(e.animationValid=n);const a=this._contextNodeData.nodeData?.length;a!=null&&Bs.record(`${this.type}:nodeData`,a)}const{dataModel:s,processedData:r}=this;s!==void 0&&r!==void 0&&this.events.emit("data-update",{dataModel:s,processedData:r}),this.updateSeriesSelections()}return i}updateSeriesSelections(){const{datumSelection:e,labelSelection:t,paths:i}=this,n=this._contextNodeData;if(!n)return;const{nodeData:s,labelData:r,itemId:a}=n;this.updatePaths({itemId:a,contextData:n,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:e}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:t})??t})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[n,s]=Nt(t?.range??[0,1]),[r,a]=Nt(i?.range??[0,1]),o=yl(this.getSeriesDomain("x")),l=[t?.scale.convert(o.at(0)),t?.scale.convert(o.at(-1))],c=yl(this.getSeriesDomain("y")),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=Nt(l),[p,g]=Nt(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.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);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 MS(100,10,t),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}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);g<l&&(l=g,c=h)}if(l!=null)return{datum:c,distance:Math.sqrt(l)}}pickModulesClosestDatum(e){let t=1/0,i;for(const n of this.moduleMap.modules()){const s=n.pickNodeNearest(e);s!==void 0&&s.distanceSquared<t&&(t=s.distanceSquared,i=s.datum)}if(t!=null)return{datum:i,distance:Math.sqrt(t)}}pickNodeClosestDatum(e){let t=1/0,i;const n=this.pickNodeDataClosestDatum(e);n!=null&&n.distance<t&&(t=n.distance,i=n.datum);const s=this.pickModulesClosestDatum(e);if(s!=null&&s.distance<t&&(t=s.distance,i=s.datum),i){const r=Math.max(t-(i.point?.size??0)/2,0);return{datum:i,distance:r}}}pickNodeMainAxisFirst(e,t){const{x:i,y:n}=e,{axes:s,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:a}=this.properties;if(!r)return;const o=s.x,l=s.y;if(o==null||l==null)return;const c=[o,l].filter(g=>g.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=Number.NaN}=g.point??g.midPoint??{};if(Number.isNaN(f)||Number.isNaN(y)||g.missing===!0)continue;const m=[o?.inRange(f,1),l?.inRange(y,1)];if(h!=="x"&&m.reverse(),!m[0]||!a&&!m[1])continue;const v=[f,y];h!=="x"&&v.reverse();let x=!0;for(let M=0;M<v.length;M++){const D=Math.abs(v[M]-u[M]);if(D>d[M]){x=!1;break}else D<d[M]&&(d[M]=D,d.fill(1/0,M+1,d.length))}x&&(p=g)}if(p){let g=Math.max(d[0]**2+d[1]**2-(p.point?.size??0),0);for(const f of this.moduleMap.modules()){const y=f.pickNodeMainAxisFirst(e,h);if(y!=null&&y.distanceSquared<g){p=y.datum,g=y.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(e,t,i,n){let s;if(n==null){const{processedData:c,dataModel:h}=this;s=h.getColumnSortOrder(this,e,c)??1}else s=n.sortOrder;const r=this.keysOrValues(e),a=0,[o,l]=Nc(s,i?.length??r.length,t,c=>{const h=i?.[c]??c;return this.xCoordinateRange(r[h],a,h)});return o<l?[o,l]:[l,o]}domainForVisibleRange(e,t,i,n,s){const{processedData:r,dataModel:a}=this,[o,l]=n,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const g=this.visibleRangeIndices(i,n,s,{sortOrder:h});return a.getDomainBetweenRange(this,t,g,r)}const u=t.map(g=>this.keysOrValues(g));let d=1/0,p=-1/0;for(const[g,f]of c.entries()){const[y,m]=this.xCoordinateRange(f,0,g);if(!(m<o||y>l))for(let v=0;v<t.length;v++){const x=u[v][g];d=Math.min(d,x),p=Math.max(p,x)}}return d>p?[Number.NaN,Number.NaN]:[d,p]}domainForClippedRange(e,t,i){const{processedData:n,dataModel:s,axes:r}=this,o=VN(r[e==="x"?"y":"x"]);if(!o)return t.flatMap(g=>s.getDomain(this,g,"value",n).domain);const l=this.keysOrValues(i),c=s.getColumnSortOrder(this,i,n);if(c!=null){const g=BN(c,l.length,o,f=>l[f]);return s.getDomainBetweenRange(this,t,g,n)}const h=t.map(g=>this.keysOrValues(g)),u=o[0].valueOf(),d=o[1].valueOf(),p=[];for(const[g,f]of l.entries()){const y=f.valueOf();if(y<u||y>d)continue;const m=h.map(v=>v[g]);y>=u&&p.push(...m),y<=d&&p.push(...m)}return p}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[0]&&(d+=1),this.xCoordinateRange(c[p],g,p)[1]>i[1]&&(p-=1);let f;if(Math.abs(p-d)>=s-1)f=i;else{const y=(i[0]+i[1])/2;for(;Math.abs(p-d)<s-1&&(d>0||p<c.length-1);)if(d===0)p+=1;else if(p===c.length-1)d-=1;else{const x=this.xCoordinateRange(c[d-1],g,d-1)[0],M=this.xCoordinateRange(c[p+1],g,p+1)[1];Math.abs(x-y)<Math.abs(M-y)?d-=1:p+=1}const m=this.xCoordinateRange(c[d],g,d)[0],v=this.xCoordinateRange(c[p],g,p)[1];f=[Math.min(i[0],m),Math.max(i[1],v)]}return h.range=u,{x:f,y:void 0}}countVisibleItems(e,t,i,n,s){const{dataModel:r,processedData:a}=this;if(!r||!a)return 1/0;const o=this.keysOrValues(e),l=t.map(I=>r.resolveColumnById(this,I,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 I=this.sortOrder(e);if(I!=null){const k=h.scale,C=k.range;k.range=[0,1];const T=this.keysOrValues(e);let[N,R]=this.visibleRangeIndices(e,d,void 0,{sortOrder:I});if(R-=1,R<N)return 0;const F=0;this.xCoordinateRange(T[N],F,N)[0]<d[0]&&(N+=1),this.xCoordinateRange(T[R],F,R)[1]>d[1]&&(R-=1);const G=Math.abs(R-N)+1;return k.range=C,G}}const g=(I,k,C)=>I[0]+(C-k[0])/(k[1]-k[0])*(I[1]-I[0]),f=h.range.toSorted(),y=u.range.toSorted(),m=g(f,h.visibleRange,d[0]),v=g(f,h.visibleRange,d[1]),x=g(y,u.visibleRange,Math.min(...p)),M=g(y,u.visibleRange,Math.max(...p)),D=Math.round((d[0]+(d[1]-d[0])/2)*o.length),A=0;return NN(0,o.length-1,D,s,I=>{const[k,C]=this.xCoordinateRange(o[I],A,I),[T,N]=this.yCoordinateRange(l.map(R=>R[I]),A,I);return!Be(k)||!Be(C)||!Be(T)||!Be(N)?!1:k>=m&&C<=v&&T>=x&&N<=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;s<e.length;s++){const r=e[s];if(r!=null&&i!=null){const a=r.valueOf()-i.valueOf(),o=Math.sign(a);if(o===0)continue;if(n!==void 0&&o!==n)return;t=Math.min(t,Math.abs(a)),n=o}i=r}if(Number.isFinite(t))return t}updateHighlightSelectionItem(e){const{items:t,highlightSelection:i}=e,n=t??[];return this.updateDatumSelection({nodeData:n,datumSelection:i})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateDatumStyles(e){}updatePaths(e){for(const t of e.paths)t.visible=!1}updatePathNodes(e){const{paths:t,visible:i}=e;for(const n of t)n.visible=i}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};if(t)for(const i of e.paths)zt([i],t)}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&zt([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&zt([e.labelSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),e.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&zt([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}:void 0}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof Kf){const{range:t,domain:i}=e;return{type:"log",convert:n=>e.convert(n),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Ee){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Nn){if(e instanceof vr){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(qp)){const i=this.axes[t];if(!i)continue;const n=this.getScaling(i.scale);n!=null&&(e[t]=n)}return e}};function VN(e){let t,i;if((e instanceof qi||e instanceof es)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function BN(e,t,i,n){const s=i[0].valueOf(),r=i[1].valueOf();let a=ro(0,t-1,l=>{const c=e===1?l:t-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h>=s}),o=ar(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 QS(e){const t=new Map;for(const i of e){if(!(i instanceof Cr))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 _N=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 zN(e){const t=Me();function i(s,r){return t.requestAnimationFrame(s)}function n(s){t.cancelAnimationFrame(s)}return eM(i,e,n)}function ym(e){function t(n,s=0){if(s===0){queueMicrotask(n);return}return setTimeout(n,s)}function i(n){clearTimeout(n)}return eM(t,e,i)}function eM(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 y=t({count:f});if(!y){c();return}y.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 tM=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function qo(e,t,i){const{offsetX:n,offsetY:s,clientX:r,clientY:a}=t,{currentX:o,currentY:l}=kr.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:t}}function fd(e,t,i){return{type:e,sourceEvent:t}}var GN={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>qo("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>qo("click",e,t),dblclick:(e,t)=>qo("dblclick",e,t),mouseenter:(e,t)=>qo("mouseenter",e,t),mousemove:(e,t)=>qo("mousemove",e,t),mouseleave:(e,t)=>qo("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:n,clientY:s}=e,r=e.deltaMode===0?.01:1,a=e.deltaX*r,o=e.deltaY*r;return{type:"wheel",offsetX:t,offsetY:i,clientX:n,clientY:s,deltaX:a,deltaY:o,sourceEvent:e}},touchstart:(e,t)=>fd("touchstart",e,t),touchmove:(e,t)=>fd("touchmove",e,t),touchend:(e,t)=>fd("touchend",e,t),touchcancel:(e,t)=>fd("touchcancel",e,t)},kr=class{static alloc(e,t,i){return GN[e](t,i)}static isHTMLEvent(e){return tM.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},jN=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=kr.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 Mt(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)}},HN=class{constructor(e,t,i,n){this.glob=e,this.self=t,this.window=Me(),this.cleanup=new Qe,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:s,mousegeneral:r,mousemove:a,mouseup:o}=this;this.cleanup.register(Ve(s,"mousedown",r,{capture:!0}),Ve(s,"mouseenter",r,{capture:!0}),Ve(s,"mouseleave",r,{capture:!0}),Ve(s,"mouseout",r,{capture:!0}),Ve(s,"mouseover",r,{capture:!0}),Ve(s,"mousemove",a,{capture:!0}),Ve(s,"mouseup",o,{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 $N(e,t,i,n){if(e.globalMouseDragCallbacks==null)return new HN(e,t,i,n)}var UN=500,WN=100;function KN(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY;return i*i+n*n}var bm=!1,YN=class{constructor(e,t,i,n,s){this.glob=e,this.self=t,this.initialTouch=n,this.target=s,this.cleanup=new Qe,this.longTapInterrupted=!1,this.longtap=()=>{const{target:o,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new Qe;o.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),bm=!0;const h=f=>f.preventDefault(),u=f=>{bm=!1,f.preventDefault(),c.flush()};c.register(Ve(o,"touchmove",h,{passive:!1}),Ve(o,"touchend",u,{passive:!1}),Ve(o,"touchcancel",u,{passive:!1}));const{clientX:d,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:Me(),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||KN(h,u)>WN,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,UN);const{touchmove:r,touchend:a}=this;this.cleanup.register(Ve(s,"touchmove",r,{passive:!1}),Ve(s,"touchstart",a,{passive:!1}),Ve(s,"touchend",a,{passive:!1}),Ve(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 ZN(e,t,i,n,s){if(!(e.globalTouchDragCallbacks!=null||bm))return new YN(e,t,i,n,s)}function vm(e,t,i,n){const{currentX:s,currentY:r}=kr.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 XN(e,{pageX:t,pageY:i}){const{x:n,y:s}=e.getElement().getBoundingClientRect();return{offsetX:t-n,offsetY:i-s}}function xm(e,t,i,n,s){const{currentX:r,currentY:a}=kr.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 iM={},nM=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 Qe;i.register(Ve(t,"mousedown",n=>this.triggerMouseDrag(e,n)),Ve(t,"touchstart",n=>this.triggerTouchDrag(e,n),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){t.button===0&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};Hp(["pageX","pageY","offsetX","offsetY"],i,t);const n={mousedown:s=>{const r=vm(e,"drag-start",i,s);this.dispatch("drag-start",e,r)},mousemove:s=>{const r=vm(e,"drag-move",i,s);this.dispatch("drag-move",e,r)},mouseup:s=>{const r=vm(e,"drag-end",i,s);this.dispatch("drag-end",e,r),this.endDrag(e,r)}};this.mouseDragger=$N(iM,this,n,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:n}){const s=e.getElement(),r=s.getBoundingClientRect();pu(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,...XN(e,i)};Hp(["pageX","pageY"],n,i);const s={touchmove:(o,l)=>{const c=xm(e,"drag-move",n,o,l);this.dispatch("drag-move",e,c)},touchend:(o,l)=>{const c=xm(e,"drag-end",n,o,l);this.dispatch("drag-end",e,c)}},r=e.getElement();this.touchDragger=ZN(iM,this,s,i,r);const a=xm(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)}},qN=class{constructor(e){this.elem=e}setBounds(e){lu(this.elemContainer??this.elem,e)}getBounds(){return Nv(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();lu(t,i),Rv(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Ts=class extends qN{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(e){ye(this.elem,"id",e)}get id(){return Xr(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){kn(this.elem,"display",e?"none":void 0)}isHidden(){return Me()?.getComputedStyle?.(this.elem).display==="none"}setCursor(e){kn(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){ye(this.elem,"aria-describedby",e)}setAriaHidden(e){ye(this.elem,"aria-hidden",e)}setAriaLabel(e){ye(this.elem,"aria-label",e)}setAriaExpanded(e){ye(this.elem,"aria-expanded",e)}setAriaControls(e){ye(this.elem,"aria-controls",e)}setAriaHasPopup(e){ye(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){kn(this.elem,"pointer-events",e)}setCSSVariable(e,t){this.elem.style.setProperty(e,t)}isDisabled(){return Xr(this.elem,"aria-disabled",!1)}hasPopup(){const e=Xr(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){ye(this.elem,"data-focus-override",e)}setPreventsDefault(e){ye(this.elem,"data-preventdefault",e)}setTabIndex(e){ye(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){e.getElement().remove()}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(e!==void 0)return this.children.filter(t=>t.domIndex!==void 0&&t.domIndex>e).reduce((t,i)=>!t||i.domIndex<t.domIndex?i:t,void 0)}addListener(e,t){return kr.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new jN),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new nM(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){kr.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new nM(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,...kr.calcCurrentXY(i.getElement(),t)};n.dispatch(e,i,s)}i=i.parent}}static addWindowEvent(e,t){const i=n=>{n.persisted||t()};return Ve(Me(),"pagehide",i)}},Jo=class extends yh{constructor(e){super(),this.ctx=e,this.rectNode=new Dt,this.textNode=new Ei,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 re({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};b([S,rt("node","visible")],Jo.prototype,"visible",2),b([S,rt("rectNode","fill")],Jo.prototype,"fill",2),b([S],Jo.prototype,"image",2),b([S,rt("textNode")],Jo.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&&dv(e,(t,i)=>le(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}},JN=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]}},QN=class extends md{get angle(){return this.getById("angle")}get radius(){return this.getById("radius")}},yd=class{constructor(){this.title=new qe,this.subtitle=new qe,this.footnote=new qe}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}=ae(t.text)?xs(t.text,t):vi(t).measureLines(pt(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"&&ae(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)}}};b([S],yd.prototype,"title",2),b([S],yd.prototype,"subtitle",2),b([S],yd.prototype,"footnote",2);var eO=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],tO=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||eO.includes(e)}restoreMemento(e,t,i){if(i==null)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch(s=>_.error("error restoring state",s))}},sM=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=ce.create(!0,"history"),this.cleanup=new Qe,this.cleanup.register(e.on("series:undo",this.undo.bind(this)),e.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const 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===sM)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):sM}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(Xe,Xe,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},nO=class{constructor(){this.caretaker=new Xp(Xe),this.state=new Map}setState(e,t){ft(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)}},sO=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-background{position:absolute}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border: 1px solid #dddddd;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border: 1px solid #dddddd;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border: 1px solid #dddddd;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border: 1px solid #dddddd;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: 1px solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:var(--ag-charts-button-border);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border:var(--ag-charts-tooltip-border);border-radius:var(--ag-charts-tooltip-border-radius);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-button-border);color:var(--ag-charts-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2;+.ag-charts-toolbar__button{border-left-color:var(--ag-charts-accent-color)}}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-right-width:0}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);border-right-width:1px}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);border-right-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
|
|
`,Sm=class{constructor(){this.cleanup=new Qe,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},rO=class up{constructor(t,i,n){this.element=t,this.topTabGuard=i,this.bottomTabGuard=n,this.cleanup=new Qe,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(Ve(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;ye(this.topTabGuard,"tabindex",i),ye(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=Me();return Array.from(t.querySelectorAll(i)).filter(s=>{if(Sl(s)){const r=n.getComputedStyle(s);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(t){const i=up.queryFocusable(this.element,'[tabindex="0"]'),n=t?i.length-1:0;return i[n]}findExitTarget(t){const i=up.queryFocusable(Gi(),"[tabindex]").filter(r=>r.tabIndex>0).sort((r,a)=>r.tabIndex-a.tabIndex),{before:n,after:s}=up.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?(r=t[o],n=o+1):(a=t[o],s=o-1)}return{before:r,after:a}}},Ec=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}},aO='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas-background" aria-hidden="true"></div><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',oO=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],lO=new Set(["styles","canvas-container","canvas","tooltip-container"]),rM={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},cO=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 hO(e,t){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(n=>{for(const s of n)s.target===e&&t(s.intersectionRatio)},{root:e});return i.observe(e),i}var aM={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return aM}};function oM(e,t){const i=he("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var bd=class ja extends Sm{constructor(t,i,n,s,r,a="normal"){super(),this.eventsHub=t,this.chart=i,this.styleContainer=s,this.skipCss=r,this.mode=a,this.anchorName=`--${wn(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new L0,this.cursorState=new Ec("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let o=!1;if(this.observer=hO(this.element,l=>{l===0&&!o&&this.eventsHub.emit("dom:hidden",null),o=l===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",sO),this.setContainer(n),this.cleanup.register(ex(this.element)),this.mode==="normal"){const l=this.rootElements["canvas-center"].element;if(l==null)throw new Error("Error initializing tab guards");const c=oM(l,"beforebegin"),h=oM(l,"afterend");this.tabGuards=new rO(l,c,h)}}initDOM(){if(this.mode==="normal"){const n=he("div");return n.innerHTML=aO,n.firstChild}const t=he("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=he("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 oO){const r=`ag-charts-${s}`;let a;if(t==="normal"?a=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:lO.has(s)?a=i:a=i.getElementsByClassName(r)[0]??he("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.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const t of Object.values(this.rootElements)){for(const i of t.children.values())i.remove();t.element.remove()}this.element.remove()}postRenderUpdate(){this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(ja.batchedUpdateContainer.length===0&&Me().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),ja.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of ja.batchedUpdateContainer)t.destroyed||t.updateContainer();ja.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;r.width=`${n??t}px`,r.height=`${s??i}px`,this.minWidth=n??t,this.minHeight=s??i,this.updateContainerClassName()}updateContainerSize(){const{style:t}=this.rootElements["canvas-center"].element;t.visibility=this.containerSize==null?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(!(t==null||t===this.container)){if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=t.isConnected;for(const[i,n]of this.styles)this.addStyles(i,n);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.eventsHub.emit("dom:resize",null)}),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(t){const i="ag-charts-theme-";for(const n of Array.from(this.element.classList))n.startsWith(i)&&n!==t&&this.element.classList.remove(n);this.element.classList.add(t)}setThemeParameters(t){for(const[i,n]of Mt(t)){let s=`${n}`;i.endsWith("Size")||i.endsWith("Radius")?s=`${n}px`:i.endsWith("Border")&&typeof n=="boolean"&&(s=n?"var(--ag-charts-border)":"none"),this.element.style.setProperty(`--ag-charts-${Pb(i)}`,s)}}updateCanvasLabel(t){ye(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 Ve(s,t,i,n)}removeEventListener(t,i,n){this.getEventElement(this.element,t).removeEventListener(t,i,n)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=Me(),i=new U(0,0,t.innerWidth,t.innerHeight),n=this.getRawOverlayClientRect();return i.intersection(n)?.toDOMRect()??aM}getRawOverlayClientRect(){let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let r;if(i!=null&&t===i)r=!0;else{const o=t.computedStyleMap?.()?.get("overflow-y")?.toString();r=o==="auto"||o==="scroll"}if(r)return U.fromObject(t.getBoundingClientRect());t=t.parentElement}if(this.documentRoot!=null)return U.fromObject(this.documentRoot.getBoundingClientRect());const{innerWidth:n,innerHeight:s}=Me();return new U(0,0,n,s)}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??Gi("body");for(;t!=null;){if(t===i)return;if(pb(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=he("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&&!ja.headStyles.has(t)?(a=r(Gi("head")),ja.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),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}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"}=cO.get(t)??{};if(n&&n.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=n??he(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}removeChild(t,i){const{children:n}=this.rootElements[t];n&&(n.get(i)?.remove(),n.delete(i))}incrementDataCounter(t){const{dataset:i}=this.element;i[t]??(i[t]="0"),i[t]=String(Number(i[t])+1)}setDataBoolean(t,i){this.element.dataset[t]=String(i)}setDataNumber(t,i){this.element.dataset[t]=String(i)}updateContainerClassName(){const{element:t,containerSize:i,minWidth:n,minHeight:s}=this;t.classList.toggle(rM.safeHorizontal,n>=(i?.width??1/0)),t.classList.toggle(rM.safeVertical,s>=(i?.height??1/0))}};bd.className="DOMManager",bd.batchedUpdateContainer=[],bd.headStyles=new Set;var lM=bd,uO=class extends Ts{constructor(){super(he("div")),this.textElement=at("text"),this.textElement.role="presentation",this.svgElement=at("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(){}},dO=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})}},Mm=class extends Ts{constructor(e,t){super(e),ye(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{Lg(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new dO(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(e){ye(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)})}},vd=class extends Mm{constructor(){super(he("button"))}},cM=class extends Ts{constructor(){super(he("div")),ye(this.elem,"role","group")}destructor(){}},Im=class extends Ts{constructor(e,t){super(he("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,a]=s==="both"?[Kl.horizontal,Kl.vertical]:[Kl[s],void 0];let o=-1;if(Wl(i.sourceEvent)){const l=i.sourceEvent.key;l===r.nextKey||l===a?.nextKey?o=n.index+1:(l===r.prevKey||l===a?.prevKey)&&(o=n.index-1)}this.children[o]?.focus()},ye(this.elem,"role",t),this.orientation=e}get orientation(){return Xr(this.elem,"aria-orientation")??"both"}set orientation(e){ye(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;s<i.length;s++){const r=i[s];r.index===t&&(this.focusedChildIndex=s),r.index=s}if(n){const s=i[t]??i[t-1];s?(this.focusedChildIndex=s.index,s.setTabIndex(0)):this.focusedChildIndex=0}}},pO=class extends Im{constructor(){super("both","list"),this.setHidden(!0)}destructor(){for(const e of this.children)e.getElement().parentElement.remove()}addChildToDOM(e,t){const i=he("div");ye(i,"role","listitem"),kn(i,"position","absolute"),Ts.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(e){this.children.length===0&&(e=!0),super.setHidden(e)}},Qo=class extends Ts{constructor(e){super(e)}destructor(){}},Dm=class ch extends Ts{constructor(){super(he("input")),this._step=ch.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),t!==void 0)){const i=()=>this.getElement().step=t.attributeValue,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 Xr(this.elem,"aria-orientation")??"both"}set orientation(t){ye(this.elem,"aria-orientation",t==="both"?void 0:t),ch.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=_v(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",ch.onKeyDown):t.addListener("keydown",ch.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()}};Dm.STEP_ONE={attributeValue:"1",divider:1},Dm.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Am=Dm,gO=class extends vd{constructor(){super(),ye(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){ye(this.elem,"aria-checked",e)}},xd=class extends Im{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function el(e,t){return t.params?.type===e}function fO(e){if(e==="button")return new vd;if(e==="slider")return new Am;if(e==="toolbar")return new xd;if(e==="group")return new cM;if(e==="list")return new pO;if(e==="region")return new Qo(he("div"));if(e==="text")return new uO;if(e==="listswitch")return new gO;throw new Error("AG Charts - error allocating meta")}function hM(e){const t={params:e,result:void 0};return t.result=fO(t.params.type),t}var mO=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new Qe}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=hM(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,el("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=hM(e);if(el("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(el("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(el("text",t)){const{params:i,result:n}=t;this.initElement(i,n),this.setParent(t.params,t.result)}if(el("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(el("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 kn(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)}}}},uM={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},yO=/\$\{(\w+)}(?:\[(\w+)])?/gi,Cm={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"})},bO=({defaultValue:e,variables:t})=>e?.replaceAll(yO,(i,n,s)=>{const r=t[n],a=s==null?null:Cm[s];return s!=null&&a==null&&_.warnOnce(`Format style [${s}] is not supported`),a!=null?a.format(r):typeof r=="number"?Cm.number.format(r):r instanceof Date?Cm.datetime.format(r):String(r)}),vO=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=uM,getLocaleText:n}=this,s=i[e];return String(n?.({key:e,defaultValue:s,variables:t})??bO({key:e,defaultValue:s,variables:t})??e)}},dM=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:n,willReadFrequently:s=!1}=e;this.pixelRatio=e.pixelRatio??Me("devicePixelRatio")??1,this.element=n??he("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:s}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),n0(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}clear(){i0(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};b([rr(e=>e.onEnabledChange())],dM.prototype,"enabled",2);var xO=class extends ps{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=ub(),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()}},SO=class{constructor(e){this.canvas=e,this.debug=ce.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 yf({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()}},Sd=class extends ps{constructor(e){super(),this.debug=ce.create(!0,"scene"),this.id=wn(this),this.imageLoader=new xO,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new Qe,this.updateDebugFlags(),this.canvas=new dM(e),this.layersManager=new SO(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{_.warnOnce(`Unable to load image ${t}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.remove(),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){ce.inDevelopmentMode(()=>Is._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){rx(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:n,debugColors:s}=e??{},{canvas:r,canvas:{context:a}={},root:o,width:l,height:c,pixelRatio:h}=this;if(!a)return;const u=ce.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 re&&(g=o.dirty),o!=null&&g===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:Zu(o,"console")}),u&&I0(this.layersManager,t,a,void 0,i,n,s);return}const f={ctx:a,width:l,height:c,devicePixelRatio:h,debugNodes:{}};ce.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),t1(f);let y=!1;if((g!==!1||p)&&(y=!0,r.clear()),o&&ce.check("scene:dirtyTree")){const{dirtyTree:m,paths:v}=D0(o);ce.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:m,paths:v})}if(o&&y){if(o.visible&&o.preRender(f),this.debug.check()){const m=Zu(o,"console");this.debug("Scene.render() - before",{canvasCleared:y,tree:m})}if(o.visible)try{a.save(),o.render(f),a.restore()}catch(m){throw this.canvas.reset(),m}}t["\u270D\uFE0F"]=performance.now()-d,a.verifyDepthZero?.(),this.isDirty=!1,u&&I0(this.layersManager,t,a,f.stats,i,n,s),i1(a,f.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:Zu(o,"console"),canvasCleared:y})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const e=JL(),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 Is.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(),C0(),Object.assign(this,{canvas:void 0})}};Sd.className="Scene";var MO=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||ae(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(n=>{const s=this.getAnnotationTypeStyles(n.type);return be(n,s)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Fe([...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}},IO=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new re({name:"Axes-Grids",zIndex:2}),this.axisGroup=new re({name:"Axes",zIndex:3}),this.axisLabelGroup=new re({name:"Axes-Labels",zIndex:15}),this.axisCrosslineRangeGroup=new re({name:"Axes-Crosslines-Range",zIndex:6}),this.axisCrosslineLineGroup=new re({name:"Axes-Crosslines-Line",zIndex:10}),this.axisCrosslineLabelGroup=new re({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()}},km=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=ce.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 Dp(t=>this.fetch(t).catch(i=>_.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return Dp((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}`),_.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}};b([Vt({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],km.prototype,"dispatchThrottle",2),b([Vt({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],km.prototype,"requestThrottle",2);var DO=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){if(!(!e||e.size===0)){this.loadFonts(e);for(const t of e)this.observeFontStatus(t)}}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(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=fp();if(t===void 0)return;const i=Gi();if(!i)return;const n=i.createElement("div");n.style.setProperty("position","absolute"),n.style.setProperty("top","0"),n.style.setProperty("margin","0"),n.style.setProperty("padding","0"),n.style.setProperty("overflow","hidden"),n.style.setProperty("visibility","hidden"),n.style.setProperty("width","auto"),n.style.setProperty("max-width","none"),n.style.setProperty("font-synthesis","none"),n.style.setProperty("font-family",e),n.style.setProperty("font-size","16px"),n.style.setProperty("white-space","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&&(vi.clear(),this.updateService.update(5))});s.observe(n),this.observers.push(s)}},wm={activeItem:{type:Z(zb()("series-node","legend")),seriesId:O,itemId:Z(ne(O,w))}};wm.frozen=J(L);var Rc={mode:J(P("integrated","standalone")),container:Cp,context:()=>!0,theme:ue,series:Un,annotations:ue,navigator:ue,scrollbar:ue,initialState:{active:wm,chartType:O,annotations:ue,legend:Tt({visible:L,seriesId:O,itemId:O,legendItemName:O},"legend state array"),zoom:ue}},AO={...se,...Rc,axes:$s,data:Un},CO={...se,...Rc,axes:$s,data:Un},kO={...se,...Rc,data:Un,topology:Uv},wO={...se,...Rc,data:Un},LO=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(){this.update(void 0,void 0)}update(e,t){this.performUpdate("user-interaction",e,t,!1)}performUpdate(e,t,i,n){if(!this.updateable)return;const s=this.currentItem;if(this.currentItem=t,this.eventsHub.emit("active:update",t),n||!ft(s,t)){const{activeItem:r}=this.createMemento(),{datum:a}=i??{};this.fireEvent({type:"activeChange",source:e,activeItem:r,datum:a})}}createMemento(){switch(this.currentItem?.type){case"series-node":case"legend":{const{type:e,seriesId:t,itemId:i}=this.currentItem;return{activeItem:{type:e,seriesId:t,itemId:i}}}default:return this.currentItem?.type,{}}}guardMemento(e,t){if(e==null)return!0;const i=Ft(e,Rc.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]}},pM=class{constructor(e){this.maxAnimationTime=e,this.debug=ce.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(xc.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(xc[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(xc.indexOf(e.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",e.id),e.stop();return}this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);i!=null&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=xc[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:id[c]}};let{phase:n,phaseControllers:s,phaseMeta:r}=i();const a=()=>xc[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&&id[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){_.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 gM(e){return e==null?!0:!Number.isNaN(e)&&e>=0&&e<=2}var TO=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.maxAnimatableItems=VS,this.batch=new pM(this.defaultDuration*1.5),this.debug=ce.create(!0,"animation"),this.events=new ps,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.phase==="none";n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:r}=e;if(!gM(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);if(!gM(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const a=new C1({...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=Me().requestAnimationFrame(t=>{e(t).catch(i=>_.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&&(cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){_.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 pM(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()}},NO=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}}},OO=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},EO=class{constructor(){this.items=new NO,this.lists=new OO}},fM=class{constructor(e){this.eventsHub=e,this.builtins=new EO,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}}},mM=class Jy{constructor(t){this.eventsHub=t,this.highlightStates=new Ec,this.pendingUnhighlights=new Map,this.unhighlightDelay=100}updateHighlight(t,i,n=!1){i?.series?.isHighlightEnabled()===!1&&(i=void 0);const s=this.getActiveHighlight();if(i==null&&n&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(t)){const a=ym(()=>{this.applyPendingUnhighlight(t)});this.pendingUnhighlights.set(t,{scheduler:a}),a.schedule(this.unhighlightDelay)}return}const r=this.pendingUnhighlights.get(t);r&&(r.scheduler.cancel(),this.pendingUnhighlights.delete(t)),i?this.highlightStates.set(t,i):this.highlightStates.delete(t),this.maybeEmitChange(t,s)}maybeEmitChange(t,i){const n=this.getActiveHighlight();this.isEqual(n,i)||this.eventsHub.emit(Jy.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:n,previousHighlight:i})}applyPendingUnhighlight(t){if(!this.pendingUnhighlights.has(t))return;this.pendingUnhighlights.delete(t);const i=this.getActiveHighlight();this.highlightStates.delete(t);const n=this.getActiveHighlight();this.isEqual(n,i)||this.eventsHub.emit(Jy.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:n,previousHighlight:i})}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:t}of this.pendingUnhighlights.values())t.cancel();this.pendingUnhighlights.clear()}isEqual(t,i){return t===i||t!=null&&i!=null&&t.series===i.series&&this.idsMatch(t,i)&&t.datum===i.datum}idsMatch(t,i){return t.itemId!=null&&i.itemId!=null&&t.itemId===i.itemId||t.datumIndex!=null&&i.datumIndex!=null&&ft(t.datumIndex,i.datumIndex)}};mM.HIGHLIGHT_CHANGE_EVENT="highlight:change";var yM=mM,Md=class{constructor(e,t,i,n){this.domManager=i,this.tooltip=n,this.stateTracker=new Ec,this.suppressState=new Ec(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new Qe,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=ym(()=>{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(ft(this.appliedState?.content,t?.content)&&ft(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=cm(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}}}},bM=3,RO=505,vM=30;function Lm(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 xM(e,t){const i=e*e+t*t,n=bM*bM;return i>=n}function PO(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY,s=i*i+n*n,r=vM*vM;return s<r}var FO=class{constructor(e){this.cleanup=new Qe,this.events=new ps,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.events.emit("mousemove",e)}onDblClick(e){this.events.emit("dblclick",e)}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&xM(e.originDeltaX,e.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",e)}onDragEnd(e){if(this.isDragging){this.events.emit("drag-end",e),this.isDragging=!1;return}if(e.device==="mouse"){const t=Lm("click",e);this.events.emit("click",t)}else if(e.sourceEvent.type==="touchend"){if(xM(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=Lm("click",e);this.events.emit("click",t);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=RO&&PO(this.lastClick,e)){const n=Lm("dblclick",e);this.events.emit("dblclick",n),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},Tm=class extends Qo{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},VO=class{constructor(e,t){this.seriesWidget=new Tm(e.getParent("series-area")),this.chartWidget=new Tm(e.getParent("canvas-proxy")),this.containerWidget=new Tm(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),t.withDragInterpretation&&(this.seriesDragInterpreter=new FO(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function Id(e,t,i,n,s){return t+(n-t)*((s-e)/(i-e))}function SM(e,t,i,n,s){return e+(s-t)*((i-e)/(n-t))}function MM(e,t,i){return[SM(e,i.min,t,i.max,0),SM(e,i.min,t,i.max,1)]}function BO(e,t,i){const[n,s]=MM(e.x1,e.x2,t),[r,a]=MM(e.y1,e.y2,i);return{x1:n,x2:s,y1:r,y2:a}}function IM(e,t,i,n,s,r){if(i<=s&&r<=n)return i;const a=s-i,o=r-n,l=Math.abs(a)<Math.abs(o)?a:o;return te(e,i+l,t)}function _O(e,t,i){const{x:n={min:0,max:1},y:s={min:0,max:1}}=t,r=mo.from(i),a=mo.from(e),o=BO(a,n,s),l=IM(o.x1,o.x2,a.x1,a.x2,r.x1,r.x2),c=IM(o.y1,o.y2,a.y1,a.y2,r.y1,r.y2),h={x:{min:Id(a.x1,n.min,a.x2,n.max,l),max:Id(a.x1,n.min,a.x2,n.max,l+e.width)},y:{min:Id(a.y1,s.min,a.y2,s.max,c),max:Id(a.y1,s.min,a.y2,s.max,c+e.height)}},u=h.x.max-h.x.min,d=h.y.max-h.y.min;return h.x.min=te(0,h.x.min,1-u),h.x.max=h.x.min+u,h.y.min=te(0,h.y.min,1-d),h.y.max=h.y.min+d,h}var DM=e=>fe((t,{options:i})=>!Ee.is(e?.scale)&&!qn.is(e?.scale)||t==null||i.end==null?!0:t<i.end,"to be less than end");function zO(e){for(const t of gs(e)){const i=e[t];if(!i)continue;const{min:n,max:s}=i;(n<0||s>1)&&(_.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 AM(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 GO(e,t){const i=gs(e),n=gs(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 jO(e){return{source:"user-interaction",sourceDetail:e}}var CM=class extends Sm{constructor(e,t,i){super(),this.eventsHub=e,this.fireChartEvent=i,this.mementoOriginatorKey="zoom",this.state={},this.axes=[],this.didLayoutAxes=!1,this.lastRestoredState={},this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.cleanup.register(e.on("zoom:change-request",n=>{this.constrainZoomToRequiredWidth(n)}),t.addListener("pre-series-update",({requiredRangeRatio:n,requiredRangeDirection:s})=>{this.didLayoutAxes=!0;const{pendingMemento:r}=this;r?this.restoreMemento(r.version,r.mementoVersion,r.memento):this.restoreRequiredRange(n,s),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=gs(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 gs(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(!le(e))return!1;const i=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y"),s={rangeX:{start:DM(i),end:ue},rangeY:{start:DM(n),end:ue},ratioX:{start:ue,end:ue},ratioY:{start:ue,end:ue},autoScaledAxes:ue},{invalid:r}=Ft(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=cc(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=ki(Fe(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=AM(e,i);this.state=n,this.lastRestoredState=AM(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 gs(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;zO(s);const r=this.computeChangedAxesIds(s),a=Fe(this.state),o=Fe(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;if(!(e.width>0&&e.height>0&&Math.abs(t.width)<=Math.abs(e.width)&&Math.abs(t.height)<=Math.abs(e.height)))return _.warnOnce("cannot pan to target BBox - chart too small?"),!1;const s=_O(e,i,t),r=this.toCoreZoomState(s);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:r,isReset:!1})}fireZoomPanStartEvent(e){this.eventsHub.emit("zoom:pan-start",{callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,n=>Number(n)-i)}extendWith({source:e,sourceDetail:t},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const r=this.getDomainExtents(s);if(!r)return;const[,a]=r,o=n(a),l=this.rangeToRatioAxis(s,{start:o});l&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:l},isReset:!1})}updateWith({source:e,sourceDetail:t},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const r=this.getDomainExtents(s);if(!r)return;let[a,o]=r;[a,o]=n(a,o);const l=this.rangeToRatioAxis(s,{start:a,end:o});l&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:l},isReset:!1})}getZoom(){return this.toZoomState(this.state)}getAxisZoom(e){return this.state[e]??{min:0,max:1}}getAxisZooms(){return this.state}getCoreZoom(){return this.state}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}getBoundSeries(){const e=this.getPrimaryAxis("x"),t=this.getPrimaryAxis("y");let i;if(this.independentAxes){const 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 cc({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=cc(this.getZoom()),t={rangeX:this.getRangeDirection("x",e.x),rangeY:this.getRangeDirection("y",e.y),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:void 0};return this.eventsHub.emit("zoom:save-memento",{memento:t}),t}restoreRequiredRange(e,t){const{lastRestoredRequiredRange:i,lastRestoredRequiredRangeDirection:n}=this,s=t!=="x"&&t!=="y",r=n===t&&i===e,a=e===0&&(i==null||i===0);if(s||r||a)return;const o=this.getPrimaryAxisId(t);if(!o)return;const l=this.getAxisZoom(o),c=Math.min(1,1/e);let h=0,u=1;t==="x"?(h=te(0,1-c,l.min),u=te(0,h+c,1)):(u=Math.min(1,l.max),h=u-c,h<0&&(u-=h,h=0),h=te(0,h,1),u=te(0,u,1)),this.lastRestoredRequiredRange=e,this.lastRestoredRequiredRangeDirection=t;const d={[t]:{min:h,max:u}},p=this.toCoreZoomState(d);this.lastRestoredState=ki(Fe(p)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:p,isReset:!1})}constrainZoomToRequiredWidth(e){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const t=this.lastRestoredRequiredRangeDirection,i=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!i)return;const n=e.stateAsDefinedZoom(),s=e.oldState[i],r=n[t].max-n[t].min,a=1/this.lastRestoredRequiredRange;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,h={source:e,sourceDetail:t,isReset:n,changedAxes:i,state:o,oldState:s,x:r,y:a,stateAsDefinedZoom(){return cc(c.toZoomState(h.state))},constrainZoom(p){this.constrainChanges(c.toCoreZoomState(p))},constrainChanges(p){l??(l=Fe(o));for(const g of gs(p)){const f=p[g],y=l[g];f&&y&&(y.min=f.min,y.max=f.max)}h.state=l}};this.eventsHub.emit("zoom:change-request",h);let u=!1;l&&!GO(o,l)&&(u=!0,this.state=l);const d=i.length>0||u;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||!t||!Ee.is(e.scale)&&!qn.is(e.scale))return;const i=this.getDomainPixelExtents(e);if(!i)return;const[n,s]=i;let r,a;return n<=s?(r=e.scale.invert(0),a=e.scale.invert(n+(s-n)*t.max)):(r=e.scale.invert(n-(n-s)*t.min),a=e.scale.invert(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]=nS(a,o),h=a==null?n:r.convert(a,{alignment:l}),u=o==null?s:r.convert(o,{alignment:c})+(r.bandwidth??0);if(!Be(h)||!Be(u))return;const[d,p]=[Math.min(n,s),Math.max(n,s)];if(h<d||h>p){_.warnOnce(`Invalid range start [${a}], expecting a value between [${r.invert(n)}] and [${r.invert(s)}], ignoring.`);return}if(u<d||u>p){_.warnOnce(`Invalid range end [${o}], expecting a value between [${r.invert(n)}] and [${r.invert(s)}], ignoring.`);return}const g=s-n;if(g===0)return;const f=Math.abs((h-n)/g),y=Math.abs((u-n)/g);if(!(f>=y))return{min:f,max:y}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),n=t.at(-1);if(!(i==null||n==null))return[i,n]}getDomainPixelExtents(e){const[t,i]=e.scale.range;if(!(!Be(t)||!Be(i)))return[t,i]}},HO=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(Lx)&&this.labelData.set(a.id,o)}const r=Tx(this.labelData,n,5);for(const a of e)a.updatePlacedLabelData?.(r.get(a.id)??[])}},$O=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||ae(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){_.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}},UO=class{updateCallback(e){this.resolvePartialCallback=e}resolvePartial(e,t,i){return this.resolvePartialCallback?.(e,t,i)}},WO=class extends Nn{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(e){this._domain!==e&&(e.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=e)}get domain(){return this._domain}get bands(){return this.domain}addBand(e,t,i){this._domain.push(this.getDomainValue(e,t)),this._bandRanges.has(e)||this._bandRanges.set(e,new Map),this._bandRanges.get(e).set(t,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(e,t){return`${e}-${t}`}findIndex(e){let t=0;for(const i of this._bandRanges.keys()){if(i===e)return t;t++}}convert(e){const{_bandwidth:t,_bandRanges:i,_inset: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;l<o;l++){const c=i.get(l);if(!c){r+=s;continue}let h=0;for(const u of c.values())h=Math.max(h,u??t);r+=h+s}return r}invert(e,t){}getBandCountForUpdate(){return this._bandRanges.size}update(){if(!this._hasFixedWidth)return super.update();const[e,t]=this.range;let{paddingInner:i}=this;const n=this.getBandCountForUpdate();if(n===0)return;let s=0,r=n,a=n;for(const f of this._bandRanges.values()){let y=0,m=!1;for(const v of f.values()){if(v==null){m=!0;continue}y=Math.max(y,v)}m?a-=1:(r-=1,s+=y)}n===1&&(i=0);const o=t-e,l=o/n*i,c=s+l*(n-1),h=o-c;let u=e,d=r>0&&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){}},KO=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 WO;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)}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}},YO=class{constructor(e){this.updateCallback=e,this.events=new ps}addListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e,t){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e,wasShortcut:t})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSeriesUpdate(e,t){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:e,requiredRangeDirection:t})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},ZO=class{constructor(e,t){this.eventsHub=new ps,this.callbackCache=new Tv,this.highlightManager=new yM(this.eventsHub),this.formatManager=new jo,this.layoutManager=new YL(this.eventsHub),this.localeManager=new vO(this.eventsHub),this.seriesStateManager=new KO,this.stateManager=new nO,this.seriesLabelLayoutManager=new HO,this.cleanup=new Qe;const{scene:i,root:n,syncManager:s,container:r,fireEvent:a,updateCallback:o,updateMutex:l,styleContainer:c,skipCss:h,chartType:u,domMode:d,withDragInterpretation:p}=t;this.chartService=e,this.syncManager=s,this.domManager=new lM(this.eventsHub,this.chartService,r,c,h,d),this.widgets=new VO(this.domManager,{withDragInterpretation:p});const g=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Sd({canvasElement:g}),this.scene.setRoot(n),this.cleanup.register(this.scene.on("scene-changed",()=>{this.updateService.update(9)})),this.axisManager=new IO(this.eventsHub,n),this.legendManager=new $O(this.eventsHub),this.annotationManager=new MO(this.eventsHub,e.annotationRoot,a),this.chartTypeOriginator=new tO(e),this.interactionManager=new M0,this.contextMenuRegistry=new fM(this.eventsHub),this.optionsGraphService=new UO,this.updateService=new YO(o),this.activeManager=new LO(this.chartService,this.eventsHub,this.updateService,this.interactionManager,a),this.proxyInteractionService=new mO(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new DO(this.domManager,this.updateService),this.historyManager=new iO(this.eventsHub),this.animationManager=new TO(this.interactionManager,l),this.dataService=new km(this.eventsHub,e,this.animationManager),this.tooltipManager=new Md(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new CM(this.eventsHub,this.updateService,a);for(const f of Q.listModulesByType("plugin"))(!f.chartType||f.chartType===u)&&f.patchContext?.(this)}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.cleanup.flush()}},Nm=class extends oe{constructor(){super(...arguments),this.range="tooltip",this.drawingMode="cutout"}};b([S],Nm.prototype,"range",2),b([S],Nm.prototype,"drawingMode",2);function XO(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function qO(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||!XO(n,s))return!1}return!0}function JO(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:n,idsMap:s,scopes:r,data:a,...o}=e[i],{type:l,idsMap:c,scopes:h,data:u,...d}=t[i];if(n!==l||r&&h&&!zn(r,h)||a&&u&&a!==u||!ft(o,d)||!qO(s,c))return!1}return!0}function QO(e,t){const{props:i,...n}=e,{props:s,...r}=t;return ft(n,r)&&JO(i,s)}function eE(e,t,i,n){return t!==e.dataSet?!1:zn(i,e.ids)&&QO(n,e.opts)}function kM(e){return e.filter(t=>t.type==="key").map(t=>t.property).join(";")}var Om=class fn{constructor(t,i,n){this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=ce.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()&&(Me().processedData=[]);const r=[];for(const{dataSet:o,ids:l,opts:c,resolves:h,rejects:u}of s){let d=function(x){return eE(x,o,l,c)};var a=d;const p=t?.find(d),g=(x,M)=>{if(this.debug.check()&&Me("processedData").push(M),M==null){for(const D of u)D(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 D of h)D({dataModel:x,processedData:M})},f=()=>{try{const x=new nm(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(n.map(A=>[A.id,A.dataSet])),D=x.processData(M);return g(x,D),x}catch(x){for(const M of u)M(x)}};if(p==null){f();continue}const{dataModel:y,processedData:m}=p,v=i.get(o);if(m&&v&&y.isReprocessingSupported(m)){if(this.debug("DataController.execute() - reprocessing data",m,o),y.reprocessData(m,i),ce.check("data-model:reprocess-diff")){const x=new nm(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(n.map(C=>[C.id,C.dataSet])),D=x.processData(M),A=JSON.parse(JSON.stringify(m,fn.jsonReplacer)),I=JSON.parse(JSON.stringify(D,fn.jsonReplacer));delete A.time,delete A.optimizations,delete I.time,delete I.optimizations;const k=Xn(I,A);k?(_.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),_.log("Difference between incremental update and full reprocess:"),_.log(""),_.log("BASELINE (full reprocess):"),_.log(JSON.stringify(I,null,2)),_.log(""),_.log("REPROCESSED (incremental update):"),_.log(JSON.stringify(A,null,2)),_.log(""),_.log("DIFF (what changed):"),_.log(JSON.stringify(k,null,2))):_.log("\u2705 Data-model reprocess matches baseline (no diff)")}g(y,m);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(fn.groupMatch(n));s?s.push(n):i.push([n])}return i.map(fn.mergeRequests)}static groupMatch({dataSet:t,opts:i}){const{groupByData:n,groupByKeys:s=!1,groupByFn:r,props:a}=i,o=kM(a);return([l])=>(n===!1||l.dataSet===t)&&(l.opts.groupByKeys??!1)===s&&l.opts.groupByFn===r&&kM(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};fn.createIdsMap(o,g);let f;fn.crossScopeMergableTypes.has(g.type)?f=-1:s.has(l.data)?f=s.get(l.data):(f=r++,s.set(l.data,f));const y=`${g.type}-${f}-${g.groupId}`,m=n.get(y),v=m?.find(x=>fn.deepEqual(x,g));if(m==null){i.opts.props.push(g),n.set(y,[g]);continue}else if(v==null){i.opts.props.push(g),m.push(g);continue}g.scopes!=null&&(v.scopes??(v.scopes=[]),v.scopes.push(...g.scopes)),(v.type==="key"||v.type==="value")&&g.idsMap?.size&&(v.idsMap??(v.idsMap=new Map),fn.mergeIdsMap(g.idsMap,v.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(!fn.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(!fn.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!fn.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}};Om.crossScopeMergableTypes=new Set(["key","group-value-processor"]),Om.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var wM=Om,Em=class Vs{constructor(t){this.chart=t}subscribe(t=Vs.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},Vs.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=Vs.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=Vs.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=Vs.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=Vs.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=Vs.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return Vs.chartsGroups.get(t)}};Em.chartsGroups=new Map,Em.DEFAULT_GROUP=Symbol("sync-group-default");var tE=Em,Rm=class extends oe{constructor(){super(...arguments),this.enabled=!1}};b([S],Rm.prototype,"enabled",2),b([S],Rm.prototype,"tabIndex",2);var LM=["right","top","left","bottom"];function iE(e){return typeof e=="string"&&LM.includes(e)}function nE(e){const t=[],i=[],n=[...LM];for(const s of e)s instanceof Mc&&(iE(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 TM=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function sE(e,t,i){const n=new Map,s=u=>{if(u===void 0)return TM;if(n.has(u))return n.get(u);const d=Q.getSeriesModule(u)?.matchingKeys??TM;return n.set(u,d),d},r=(u,d,p)=>{const g=s(u),f=[u];for(const y of g)y in d&&d[y]!=null&&f.push(`${y}=${d[y]}`);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[y,m]=f.shift(),v=i?.[m]??{},x=Xn(v,p??{}),{groupIndex:M,stackIndex:D}=x?.seriesGrouping??{};M!=null||D!=null?h.push({opts:p,series:y,diff:x,targetIdx:g,idx:m,status:"series-grouping"}):x?h.push({opts:p,series:y,diff:x,targetIdx:g,idx:m,status:"update"}):h.push({opts:p,series:y,targetIdx:g,idx:m,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 wr=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 rE(e){const t=wr.get(e);return t?.type==="series"?t.chartType:void 0}function Pc(e){const t=e.series?.[0]?.type??"line";return Q.getSeriesModule(t)?.chartType??rE(t)??"unknown"}function aE(e){return Pc(e)==="cartesian"}var oE=class extends _f{*legends(){for(const e of Q.listModulesByType("plugin"))(e.name==="legend"||e.name==="gradientLegend")&&(yield{legendType:e.name==="legend"?"category":"gradient",legend:this.getModule(e.name)})}},Pm="ag-charts-overlay",NM="ag-charts-dark-overlay",Ia=class extends oe{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return ae(this.text)?Ze(this.text):this.rendererAsText?this.rendererAsText:e.t(pt(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=Cn(e,this.renderer,s);if(Sl(r))this.content=r;else{const a=he("div");a.innerHTML=r;const{firstElementChild:o}=a;Sl(o)&&a.childElementCount===1?this.content=o:this.content=a}this.rendererAsText=this.content?.textContent?.trim()??void 0}else{const s=he("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(ae(this.text)){const r=he("div");for(const a of this.text){const o=he("span",{color:a.color,fontSize:`${a.fontSize}px`,fontFamily:a.fontFamily??"inherit",fontWeight:String(a.fontWeight),fontStyle:a.fontStyle});o.innerText=pt(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}}};b([S],Ia.prototype,"enabled",2),b([S],Ia.prototype,"text",2),b([S],Ia.prototype,"renderer",2);var tl=class extends oe{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Ia("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Ia("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Ia("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Ia("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()}};b([S],tl.prototype,"darkTheme",2),b([S],tl.prototype,"loading",2),b([S],tl.prototype,"noData",2),b([S],tl.prototype,"noVisibleSeries",2),b([S],tl.prototype,"unsupportedBrowser",2);function lE(e,t){const{animationDuration:i}=id.add,n=i*t,s=he("div",`${Pm}--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 ${n}ms linear 50ms both`}),r=he("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"}),a=he("p",{marginTop:"1em"});a.innerText=e;const o=he("div",`${Pm}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=he("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),s.replaceChildren(l,r,a,o),s}var Fc=class extends oe{constructor(e){super(),this.ctx=e,this.rectNode=new Dt,this.border=new qr(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new Qe,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 re({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}};b([S],Fc.prototype,"border",2),b([S],Fc.prototype,"clip",2),b([rt("rectNode","cornerRadius"),S],Fc.prototype,"cornerRadius",2),b([S],Fc.prototype,"padding",2);var cE=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=he("div"),this.svg=at("svg"),this.outerPath=at("path"),this.innerPath=at("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=he("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 It){const n=(r,a)=>{let{x:o,y:l}=tt.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);lu(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.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return t!=null&&Me().getComputedStyle(t).opacity==="1"}},hE=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=>(kn(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>(kn(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),ye(this.label1,"id",Yl()),ye(this.label2,"id",Yl()),kn(this.label1,"display","none"),kn(this.label2,"display","none"),this.label1.textContent=n,this.label2.textContent=n,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),ye(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(n)}createAnnouncer(e){const t=he("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],Zr(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Zr(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},uE={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function dE(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 pE(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:n}]of Mt(uE))if(dE(e,n))return{name:t,activatesFocusIndicator:i}}function gE(e,t,i){const n=cm(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 tt.toCanvas(s).computeCenter()}}function fE({bounds:e}){return e instanceof U?e:e!=null?tt.toCanvas(e):U.NaN}function mE(e,t,i){const{x:n,y:s}=gE(e,t,i)??{};if(n!==void 0&&s!==void 0)return{type:"keyboard",canvasX:n,canvasY:s}}function yE(e){return e.datum.itemId!==void 0?e.datum.itemId:typeof e.datum.datumIndex=="number"?e.datum.datumIndex:JSON.stringify(e.datum.datumIndex)}function Dd(e,t){return e.series===t.series&&ft(e.datumIndex,t.datumIndex)}function bE(e,t){return t==null?-1:e.findIndex(i=>Dd(i,t))}var vE=class{constructor(e,t,i){this.activeManager=e,this.tooltipProperties=t,this.focusState=i,this.candidates=[],this.activeState=new Ec}getActive(){return this.activeState.stateValue()}clear(){this.activeState.clear(),this.lastNotifiedActive=void 0,this.candidates.length=0,this.pendingPickedNodes=void 0}setSource(e,t){t===void 0?this.activeState.delete(e):this.activeState.set(e,t),this.syncActiveManager()}syncActiveManager(){const e=this.getActive(),t=this.lastNotifiedActive;if(e!==t&&!(e!==void 0&&t!==void 0&&Dd(e,t)))if(this.lastNotifiedActive=e,e===void 0)this.activeManager.clear();else{const i=e.series.id,n=yE(e);this.activeManager.update({type:"series-node",seriesId:i,itemId:n},e.datum)}}popPendingPickedNodes(){const e=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,e}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(e){if(e!==void 0){const i=this.getActive();if(this.tooltipProperties.pagination&&i!==void 0){const n=e.matches.find(s=>Dd(s,i));if(n)return n}}const t=e?.matches[0];return this.setSource("highlight",t),t}onPickedNodesTooltip(e){if(e!==void 0&&this.tooltipProperties.pagination){const i=this.getActive(),n=e.matches;this.candidates=n;let s=bE(n,i);s===-1&&(s=0);const r=n[s];this.setSource("tooltip",r);const a={index:s,length:n.length};return{active:r,paginationState:a}}const t=e?.matches[0];return this.setSource("tooltip",t),{active:t}}onPickedNodesFocus(e){const{series:t}=this.focusState;if(this.clear(),t!==void 0&&e!==void 0){const{datum:i,datumIndex:n}=e;this.setSource("focus",{series:t,datum:i,datumIndex:n})}}onPickedNodesAPI(e){return this.pendingPickedNodes=e,e.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:e}=this,t=this.getActive(),i=t==null?-1:e.findIndex(a=>Dd(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];this.setSource("tooltip",s);const r={index:n,length:this.candidates.length};return{active:s,paginationState:r}}return{active:this.getActive()}}},OM=class extends Sm{constructor(e){super(),this.chart=e,this.id=wn(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0},this.hoverDevice="pointer",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=zN(()=>{if(this.hoverDevice==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=7){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.pickManager=new vE(e.ctx.activeManager,e.tooltip,this.focus);const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),n=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new hE(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 cE(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.clearAll()),e.ctx.eventsHub.on("highlight:change",o=>this.changeHighlightDatum(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",()=>this.clearAll()),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()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var e;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.hoverDevice!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.hoverDevice==="setState"&&this.refreshSetState()}updateComplete(){this.isState(68)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.handleFocus(0,0))}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let n=t.properties.focusPriority??1/0,s=i.properties.focusPriority??1/0;return n===s&&([n,s]=[t.declarationOrder,i.declarationOrder]),n<s?-1:n>s?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onAnimationStart(){this.hoverDevice!=="setState"&&this.clearAll()}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(t!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:c,canvasY:h},void 0)}return}let n,s;if(this.focusIndicator?.isFocusVisible())n=this.chart.ctx.highlightManager.getActiveHighlight(),n&&this.seriesRect&&n.midPoint&&(s=tt.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.chart.ctx.highlightManager.updateHighlight(this.id),n=c.matches[0].datum)}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.hoverDevice!=="keyboard"&&this.clearAll(!0))}onWheel(e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.hoverDevice="pointer")}onDragMove(e,t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(82)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(this.isIgnoredTouch(e)||(e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),t!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=e,this.hoverDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule();let i;if(this.isState(64)){const{currentX: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(82)))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t);const i=t===this.chart.ctx.widgets.seriesWidget;if(!this.isState(64)){i&&this.emitSeriesAreaClickEvent(e,!1);return}if(i){if(this.checkSeriesNodeClick(e)){this.emitSeriesAreaClickEvent(e,!0),this.update(7),e.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(e,!1)}const 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(){this.isState(68)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(e){this.isState(68)&&(this.hoverDevice="pointer",this.maybeEnterInteractiveTooltip(e)||this.clearAll(!0),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(86))return;const t=pE(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.hoverDevice==="keyboard"),t?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:e});case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(68)&&(this.hoverDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.eventsHub.emit("series:focus-change",null))}onSubmit(e){if(!this.isState(68))return;const{series:t,datum:i}=this.focus,n=e.sourceEvent;t!=null&&i!=null?t.fireNodeClickEvent(n,i):this.chart.fireEvent({type:"click",event:n}),n.preventDefault()}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{series:s,datum:r}=n.active,a=n.paginationState==null?i.distance:0;if(e.type==="click"){if(s.fireNodeClickEvent(e.sourceEvent,r)){const l=this.pickManager.nextCandidate();if(l.active!==void 0){const{canvasX:c,canvasY:h}=this.toCanvasCoordinates(e);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.active,c,h,l.paginationState)}}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=a===0,s.fireNodeDoubleClickEvent(e.sourceEvent,r),!0):!1}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(e,t)===0?this.announceMode="when-changed":this.announceMode="always":(this.focusIndicator?.update(i.rect,this.seriesRect,!1),this.swapChain.update(i.text),this.announceMode="always")}handleSeriesFocus(e,t){if(this.chart.chartType==="standalone")return this.handleSoloSeriesFocus(e,t);const{focus:i}=this,n=i.sortedSeries.filter(l=>l.visible&&l.focusable);if(n.length===0)return 1;const s=i.datumIndex-t,r=i.seriesIndex-e;i.seriesIndex=te(0,i.seriesIndex,n.length-1),i.series=n[i.seriesIndex];const a=this.focus.datumIndex,o=this.focus.seriesIndex;return this.updatePickedFocus(a,t,s,o,e,r)}handleSoloSeriesFocus(e,t){this.focus.series=this.focus.sortedSeries[0];const i=this.focus.datumIndex,n=this.focus.seriesIndex,s=this.focus.datumIndex-t,r=this.focus.seriesIndex-e;return this.updatePickedFocus(i,t,s,n,e,r)}pickFocus(e,t){const i=e.pickFocus(t);return this.hoverDevice==="keyboard"&&this.pickManager.onPickedNodesFocus(i),i}updatePickedFocus(e,t,i,n,s,r){const{focus:a,hoverRect:o,seriesRect:l}=this;if(a.series==null||o==null)return 1;const c={datumIndex:e,datumIndexDelta:t,otherIndex:n,otherIndexDelta:s,seriesRect:l},h=this.pickFocus(a.series,c);if(!h)return 2;const{datum:u}=h;if(a.datum=u,a.datumIndex=h.datumIndex,h.otherIndex!=null&&(a.seriesIndex=h.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const g=fE(h),{x:f,y}=g.computeCenter();if(!o.containsPoint(f,y)&&this.chart.ctx.zoomManager.panToBBox(o,g))return 3;const{x1:m,x2:v,y1:x,y2:M}=mo.from(g),D=o.containsPoint(m,x),A=o.containsPoint(v,x),I=o.containsPoint(m,M),k=o.containsPoint(v,M);if(!(D||A||I||k)){const C=mo.from(o);h.movedBounds=g.clone(),m<C.x1&&v<C.x1?(h.movedBounds.x=C.x1-2,h.movedBounds.width=4):m>C.x2&&v>C.x2&&(h.movedBounds.x=C.x2-2,h.movedBounds.width=4),x<C.y1&&M<C.y1?(h.movedBounds.y=C.y1-2,h.movedBounds.height=4):x>C.y2&&M>C.y2&&(h.movedBounds.y=C.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const d=this.getTooltipContent(a.series,u.datumIndex,u,"aria-label"),p=mE(a.series,o,h);if(p!=null&&this.hoverDevice==="keyboard"){this.clearCachedEvents();const g=Md.makeTooltipMeta(p,a.series,u,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,u),this.isTooltipEnabled(a.series)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,g,d)}return this.maybeAnnouncePickedFocus(t,i,s,r,h,d),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?"":p1(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(e=!1){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,e)}clearTooltip(e=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,e),this.tooltip.lastHover=void 0}clearAll(e=!1){this.pickManager.onClearUI(),this.clearHighlight(e),this.clearTooltip(e),this.focusIndicator?.clear()}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}handleHoverFromState(){const{active:e,paginationState:t}=this.pickManager.onPickedNodesAPIDebounced();if(e===void 0)return;this.chart.ctx.highlightManager.updateHighlight(this.id,e.datum);const i=cm(e.series,e.datum,void 0);if(this.chart.tooltip.enabled&&i){const{canvasX:n,canvasY:s}=i;this.showTooltip(e,n,s,t)}}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(82))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,n)){this.clearHighlight();return}const{range:s}=this.chart.highlight,r=s==="tooltip"?"highlight-tooltip":"highlight",a=this.pickNodes({x:t.currentX,y:t.currentY},r),o=this.pickManager.onPickedNodesHighlight(a);o===void 0?this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0):this.chart.ctx.highlightManager.updateHighlight(this.id,o.datum,!1)}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.hoverDevice=="pointer"&&this.clearTooltip();return}if(s&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(s,"canvas-overlay",_t))return;const r=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip"),{active:a,paginationState:o}=this.pickManager.onPickedNodesTooltip(r);a===void 0?this.hoverDevice=="pointer"&&this.clearTooltip(!0):this.showTooltip(a,i,n,o)}showTooltip({series:e,datum:t,datumIndex:i},n,s,r){const a=this.getTooltipContent(e,i,t,"tooltip");if(a!=null){const l=Md.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:s},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,l,a,r)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&i.properties.cursor!=="default"&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),this.hoverDevice==="setState"||i==null||t==null?this.update(7,{clearCallbackCache:!0}):this.update(7,{seriesToUpdate:new Set([t,i].filter(Boolean)),clearCallbackCache:!0})}pickNodes(e,t,i){const 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 y of g){const{datumIndex:m}=y;u.matches.push({series:d,datum:y,datumIndex:m})}}else if(u==null||u.distance>f){const[y]=g,{datumIndex:m}=y;u={matches:[{series:d,datum:y,datumIndex:m}],distance:f}}}}return u}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t,i,n){let s;if(n==="aria-label"||this.isTooltipEnabled(e)){const{cachedTooltipContent:r}=this;if(r?.series===e&&r.datumIndex===t)s=r.content;else{const a=this.chart.getTooltipContent(e,t,i,n);this.cachedTooltipContent={series:e,datumIndex:t,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.hoverDevice==="setState"&&(this.clearHighlight(),this.clearTooltip()),this.activeState.lastActive="legend")}onActiveClear(){this.pickManager.onClearAPI(),this.hoverDevice="setState",this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.clearAll();else if(this.activeState.lastActive!=="legend"){const{seriesId:e,itemId:t}=this.activeState.lastActive,i=this.findPickedNodes(e,t);i&&(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(e,t){const{seriesId:i,itemId:n}=e,s=this.findPickedNodes(i,n);if(s===void 0)t.reject(),this.onActiveClear();else{const r=this.pickManager.onPickedNodesAPI(s);t.setDatum(r?.datum),this.hoverDevice="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(r=>r.id===e);if(i==null){_.warn(`Cannot find seriesId: "${e}"`);return}const n=i.findNodeDatum(t);if(n==null){_.warn(`Cannot find itemId: ${JSON.stringify(t)}`);return}return{matches:[{datum:n,datumIndex:n.datumIndex,series:i}],distance:0}}};OM.className="SeriesAreaManager";var EM=30,xE=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>=EM?"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 re({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)*EM)}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=r0(t,s)<=0?t:s}return t??1}},RM=class extends oe{constructor(){super(...arguments),this.dragAction="drag"}};b([S],RM.prototype,"dragAction",2);var SE=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 Qe,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.updateService.update(1)}onDataError(){this.updateService.update(5)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){!e.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||e.wasShortcut||this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,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}}},ME=/^((?!chrome|android).)*safari/i,IE=/Version\/(\d+(\.\d+)?)/,DE=/Chrome/,AE=/Chrome\/(\d+)/,CE=/Edg/,kE=/OPR/;function wE(){const{userAgent:e}=Me("navigator");if(ME.test(e)){const t=IE.exec(e);if(t==null)return!1;const i=Number.parseFloat(t[1]),n=Math.floor(i)>16;return n||_.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!n}else if(DE.test(e)&&!CE.test(e)&&!kE.test(e)){const t=AE.exec(e);if(t==null)return!1;const i=Number.parseInt(t[1],10),n=i>126;return n||_.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!n}return!1}var LE=new Set(["map-shape-background","map-line-background"]),TE=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 Qe,this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(Pm),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&&!LE.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(NM):this.overlayElem.classList.remove(NM),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const s=t,r=!t&&!i,a=i&&!n,o=this.overlays.unsupportedBrowser.enabled&&wE();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;ye(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},dn=ce.create(!0,"opts"),it=class jA extends WS{constructor(t,i){var n;super(),this.id=wn(this),this.seriesRoot=new Zt({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new Zt({name:`${this.id}-annotation-root`,zIndex:11}),this.titleGroup=new re({name:"titles",zIndex:15}),this.debug=ce.create(!0,"chart"),this.extraDebugStats={},this.data=Ko.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new vg,this._requiredRange=0,this._requiredRangeDirection="x",this.chartCaptions=new yd,this.padding=new ea(20),this.keyboard=new Rm,this.touch=new RM,this.mode="standalone",this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this.cleanup=new Qe,this.chartAnimationPhase="initial",this.modulesManager=new oE,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=u=>super.fireEvent(u),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new vg,this.performUpdateType=10,this.runningUpdateType=10,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new _N,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=ym(({count:u})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,u)).catch(d=>_.errorOnce(d))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=u=>{this.fireEvent(u)},this.onSeriesNodeDoubleClick=u=>{this.fireEvent(u)},this.onSeriesVisibilityChange=u=>{this.fireEvent(u)},this.seriesGroupingChanged=u=>{if(!(u instanceof dm))return;const{series:d,seriesGrouping:p}=u;if(d.contentGroup.isRoot())return;const g=this.seriesLayerManager.changeGroup({internalId:d.internalId,type:d.type,contentGroup:d.contentGroup,bringToFront:()=>d.bringToFront(),renderToOffscreenCanvas:()=>d.renderToOffscreenCanvas(),seriesGrouping:p});g!=null&&d.attachSeries(g,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 re({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Ln,this.seriesLayerManager=new xE(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const c=this.ctx=new ZO(this,{chartType:this.getChartType(),scene:s,root:l,container:r,styleContainer:a,skipCss:o,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new tE(this),fireEvent:u=>this.fireEvent(u),updateCallback:(u,d)=>this.update(u,d),updateMutex:this.updateMutex});t.optionMetadata.presetType==="sparkline"&&(c.highlightManager.unhighlightDelay=0,c.tooltipManager.removeDelay=0),this.cleanup.register(c.eventsHub.on("dom:resize",()=>this.parentResize(c.domManager.containerSize))),this.overlays=new tl,(n=this.overlays.loading).renderer??(n.renderer=()=>lE(this.overlays.loading.getText(c.localeManager),c.animationManager.defaultDuration)),this.processors=[new SE(this,c.eventsHub,c.dataService,c.updateService,c.zoomManager,c.animationManager),new TE(this,this.overlays,c.eventsHub,c.dataService,c.localeManager,c.animationManager,c.domManager)],this.highlight=new Nm,this.container=r;const h=this.getModuleContext();this.background=_s.createBackground?.(h)??new Jo(h),this.foreground=_s.createForeground?.(h),this.seriesArea=new Fc(h),c.domManager.setDataBoolean("animating",!1),c.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new OM(this.initSeriesAreaDependencies()),this.cleanup.register(c.layoutManager.registerElement(0,u=>{u.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(u)}),c.eventsHub.on("layout:complete",u=>this.chartCaptions.positionAbsoluteCaptions(u)),c.eventsHub.on("data:load",u=>{this.data=new Ko(u.data)}),this.title.registerInteraction(h,"beforebegin"),this.subtitle.registerInteraction(h,"beforebegin"),this.footnote.registerInteraction(h,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),Ts.addWindowEvent("page-left",()=>this.destroy()),c.animationManager.addListener("animation-frame",()=>{this.update(9),c.domManager.setDataNumber("animationTimeMs",c.animationManager.getCumulativeAnimationTime())}),c.animationManager.addListener("animation-start",()=>c.domManager.setDataBoolean("animating",!0)),c.animationManager.addListener("animation-stop",()=>{c.domManager.setDataBoolean("animating",!1),c.domManager.setDataNumber("animationTimeMs",c.animationManager.getCumulativeAnimationTime())}),c.eventsHub.on("zoom:change-complete",()=>{for(const d of this.series)d.animationState?.transition("updateData");const u=this.chartAnimationPhase!=="initial";this.update(5,{forceNodeDataRefresh:!0,skipAnimations:u})})),this.parentResize(c.domManager.containerSize)}static getInstance(t){return jA.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}fireEvent(t){Cn(this,this.fireEventWrapper,t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:n,overlays:s,seriesRoot:r,mode:a}=this,o=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(u,d,p,g)=>this.getTooltipContent(u,d,p,g),chartType:o,ctx:t,tooltip:i,highlight:n,overlays:s,seriesRoot:r,mode:a}}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<this.series.length;n++){const s=this.series[n],r=t.processedOptions.series?.[n];(i.identifiers.has(s.id)||i.indices.has(n))&&r!==void 0&&"visible"in r&&(r.visible=s.visible)}}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(t){if(this.destroyed)return;const i=t?.keepTransferableResources;let n;this.performUpdateType=10,this.cleanup.flush();for(const s of this.processors)s.destroy();return this.overlays.destroy(),this.modulesManager.destroy(),this.background.destroy(),this.foreground?.destroy(),this.seriesArea.destroy(),i?(this.ctx.scene.strip(),n={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.destroy(),this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),n}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>_.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??"<unknown>";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}updateSplits(t){const i=this._performUpdateSplits;i[t]??(i[t]=0),i[t]+=performance.now()-this._previousSplit,this._previousSplit=performance.now()}async tryPerformUpdate(t){try{await this.performUpdate(t)}catch(i){_.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.updateShortcutCount===0&&i<9&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",Ur[i]),this._previousSplit=performance.now(),s.start??(s.start=this._previousSplit),i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;if(await this.processData(),this.seriesAreaManager.dataChanged(),this.pendingLocaleText){const l=this.modulesManager.getModule("locale");l&&"localeText"in l&&(l.localeText=this.pendingLocaleText),this.pendingLocaleText=void 0}this.updateSplits("\u{1F4CA}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case 4:if(this.checkUpdateShortcut(4))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case 5:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(5))break;await this.processLayout(),this.updateSplits("\u2316");case 6:if(this.checkUpdateShortcut(6))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case 7:{if(this.checkUpdateShortcut(7))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(a),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case 8:if(this.checkUpdateShortcut(8))break;r.updateService.dispatchPreSceneRender(),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:this.getDebugColors()}),this.extraDebugStats={};for(const l of Object.keys(s))delete s[l];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 10:this.updateShortcutCount=0,this.updateRequestors={},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();const o=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Ih(o-s.start),count:t,performUpdateType:Ur[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?(_.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: ",Ur[t]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",Ur[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){_.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||!Be(h)||!Be(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 y=f.getUpdateTypeOnResize();y<g&&(g=y)}this.update(g,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}updateData(){this.ctx.eventsHub.emit("data:update",this.data)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new wM(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 Q.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&&_.warnOnce(`legend item '${Ze(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=Ne.fromString(t),[n]=Ne.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)}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=Me("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);_.warnOnce(r)}Ov()&&await xg(),this.ctx.scene.waitingForUpdate()&&await xg(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){dn("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;dn("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"];"listeners"in n&&this.registerListeners(this,n.listeners),Ul(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");if(n.data&&u){const x=n.data,M=t.userOptions.data,A=Array.isArray(x)&&x!==M?x.slice():x;this.data=new Ko(A)}if("legend"in n&&n.legend&&"listeners"in n.legend&&this.modulesManager.isEnabled("legend")){const x=n.legend.listeners;x?Object.assign(this.legend.listeners,x):this.legend.listeners.clear()}n.locale?.localeText&&(this.pendingLocaleText=n.locale?.localeText),this.chartOptions=t;const d=this.modulesManager.getModule("navigator"),p=this.modulesManager.getModule("zoom"),g=this.modulesManager.getModule("scrollbar");!d?.enabled&&!p?.enabled&&!g?.enabled&&this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const f=d?.miniChart,y=r.navigator?.miniChart?.series??r.series;f?.enabled===!0&&y!=null?this.applyMiniChartOptions(f,y,r,s):f?.enabled===!1&&(f.series=[],f.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(n,c));const v=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),dn("Chart.applyOptions() - update type",Ur[v],{seriesStatus:c,forceNodeDataRefresh:l}),t.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=t.optionsProcessingTime;const x=performance.now()-t.optionsProcessingTime;this._performUpdateSplits.start=x}this.update(v,{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 be(h,u)});a.setState(n,c)}l?.chartType!=null&&a.setState(s,l.chartType),(t.navigator?.enabled||t.zoom?.enabled||t.scrollbar?.enabled)&&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;g<p.length;g++)p[g].label.enabled=!1}else(c.type==="time"||c.type==="unit-time"||c.type==="ordinal-time")&&(c.parentLevel.enabled=!1);c.interval.step=d?.step,c.interval.values=d?.values,c.interval.minSpacing=d?.minSpacing,c.interval.maxSpacing=d?.maxSpacing}}applyModules(){const{type:t}=this.constructor;let i=!1;for(const n of Q.listModulesByType("plugin")){const s=!n.chartType||n.chartType===t;if(s!==this.modulesManager.isEnabled(n.name)){if(s){const r=n.create(this.getModuleContext());this.modulesManager.addModule(n.name,r),this[n.name]=r}else this.modulesManager.removeModule(n.name),delete this[n.name];i=!0}}return i}initSeriesDeclarationOrder(t){for(let i=0;i<t.length;i++)t[i].setSeriesIndex(i)}applySeries(t,i,n){if(!i)return"no-change";const s=sE(t.series,i,n);if(s.status==="no-overlap"){dn(`Chart.applySeries() - creating new series instances, status: ${s.status}`,s);const u=i.map(d=>this.createSeries(d));return this.initSeriesDeclarationOrder(u),t.series=u,"replaced"}dn("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),dn("Chart.applySeries() - created new series",d);break}case"remove":dn(`Chart.applySeries() - removing series at previous idx ${u.idx}`,u.series);break;case"no-op":r.push(u.series),dn(`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;dn(`Chart.applySeries() - applying series diff previous idx ${g}`,p,d),this.applySeriesValues(d,p),d.markNodeDataDirty(),r.push(d)}}return this.initSeriesDeclarationOrder(r),dn("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)&&aE(n)){for(const c of t.axes){const h=n.axes?.[c.id]??{},u=Xn(h,a[c.id]);dn(`Chart.applyAxes() - applying axis diff idx ${c.id}`,u),Ul(c,u,{skip:r})}return!0}return dn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),t.axes=this.createAxes(a,r),!0}createSeries(t){const n=Q.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 Q.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 Q.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:Ko.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 Mt(t)){const o=Q.getAxisModule(a.type).create(s);o.id=r,this.applyAxisModules(o,a),Ul(o,a,{skip:i}),n.push(o)}return nE(n),n}applyAxisModules(t,i){const n=t.createModuleContext(),s=t.getModuleMap();for(const r of Q.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 Mt(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()}};it.className="Chart",it.chartsInstances=new WeakMap,b([Vt({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),it.chartsInstances.set(e,this))},oldValue(e){it.chartsInstances.delete(e)}})],it.prototype,"container",2),b([Vt({newValue(e){this.resize("width option",{inWidth:e})}})],it.prototype,"width",2),b([Vt({newValue(e){this.resize("height option",{inHeight:e})}})],it.prototype,"height",2),b([Vt({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],it.prototype,"minWidth",2),b([Vt({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],it.prototype,"minHeight",2),b([Vt({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],it.prototype,"overrideDevicePixelRatio",2),b([S],it.prototype,"padding",2),b([S],it.prototype,"keyboard",2),b([S],it.prototype,"touch",2),b([S],it.prototype,"mode",2),b([S],it.prototype,"styleNonce",2),b([oi("chartCaptions.title")],it.prototype,"title",2),b([oi("chartCaptions.subtitle")],it.prototype,"subtitle",2),b([oi("chartCaptions.footnote")],it.prototype,"footnote",2),b([S],it.prototype,"formatter",2),b([S],it.prototype,"suppressFieldDotNotation",2),b([S],it.prototype,"loadGoogleFonts",2),b([Vt({changeValue(e,t){this.onAxisChange(e,t)}})],it.prototype,"axes",2),b([Vt({changeValue(e,t){this.onSeriesChange(e,t)}})],it.prototype,"series",2);var Ad=it,NE=["top","right","bottom","left"],Vc=class HA extends Ad{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 JN}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;ks(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:pv(this.axes.map(g=>[g.id,g.getLayoutState()])),series:{visible:a,rect:r,paddedRect:c},clipSeries:s}),QS(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){_.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 D of NE){const A=c[D]??0,I=this.axes.findLast(k=>k.position===D);I?I.seriesAreaPadding=A:i.shrink(A,D)}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,y=i.clone().shrink(Object.fromEntries(t));for(const D of this.axes){const{position:A="left",direction:I}=D,k=I==="y";let C;this.sizeAxis(D,y,A),D.thickness==null?C=Fm(k,f)*(D.maxThicknessRatio??1):C=D.thickness;const T={sizeLimit:C-D.label.spacing,padding:this.padding,scrollbars:s},{primaryTickCount:N,bbox:R}=D.calculateLayout(D.nice?a[I]:void 0,T);a[I]??(a[I]=N),l||(l=D.dataDomain.clipped||D.visibleRange[0]>0||D.visibleRange[1]<1),D.thickness==null&&(C=Math.min(Fm(k,R)??0,C)),r.set(D.id,Math.ceil(C))}let m;n.length>0&&(m=this.calculateAxesCrossPositions(r,y,n));const v=vl(this.axes,D=>D.position??"left"),x=new Map,M=new Map;for(const[D,A]of Mt(v)){let I=Fm(D!=="left"&&D!=="right",f)%f.pixelRatio,k=0;for(const C of A??[]){M.set(C.id,I);const T=r.get(C.id)??0;k=Math.max(k,I+T),C.layoutConstraints.stacked&&(I+=T+HA.AxesPadding)}x.set(D,Math.ceil(k))}for(const[D,A]of Mt(v))this.positionAxes({axes:A??[],position:D,axisWidths:r,axisOffsets:M,axisAreaWidths:x,axisBound:i,seriesRect:y});return m!=null&&this.applyAxisCrossing(y,m),{clipSeries:l,seriesRect:y,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]]:to(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 hi&&(o.position=r??"top",(i=o.label).parallel??(i.parallel=a.parallel)),o.calculatePadding?.(n)}for(const[s,r=0]of Mt(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 y=h-c;if(f==="end")c=l-y,h=l;else if(f==="center"){const m=c+(l-c)/2;c=m-y/2,h=m+y/2}else f==="justify"&&(h=l);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,y=s.get(g.id)??0,m=r.get(g.id)??0;g.gridPadding=c-m-y,g.translation[u]=n[u]+f,g.translation[h]=this.clampToOutsideSeriesRect(o,p+d*(m+y),h,d)}}shouldFlipXY(){return this.series.every(t=>t instanceof Cr&&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}}};Vc.className="CartesianChart",Vc.type="cartesian",Vc.AxesPadding=15,b([Vt({changeValue(e,t){this.onAxisChange(e,t)}})],Vc.prototype,"axes",2);var OE=Vc;function Fm(e,t){return e?t?.width:t?.height}var EE=new Set(["number","log","time"]),RE=e=>le(e)&&e.type!=null&&!EE.has(e.type),en={type:"chart",name:"cartesian",version:Xe,options:AO,create(e,t){return new OE(e,t)},validate(e,t,i){const n=[];e?.series?.[0]?.type==="histogram"&&Object.values(e?.axes??{}).some(RE)&&(n.push(new Hs("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=K(e,["axes"]));const s=Ft(e,t,i);return s.invalid.push(...n),s}},PM={type:"axis",name:"category",chartType:"cartesian",version:Xe,dependencies:[en],options:Po,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:e=>new Ic(e)},PE=1e3,FM=class $A extends Go{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(t){return t instanceof $A}set domain(t){if(t.length<=PE){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)}},FE=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},VE=class UA{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.screen=0,this.depth=i?i.depth+1:0}insertTick(t,i){let n=this,s;for(let r=0;r<t.length;r++){const a=t[r],o=r!==t.length-1,{children:l}=n,c=l.find(h=>h.label===a);if(c&&o)n=c,s=c;else{const h=new UA(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 BE(e){const t=e.reduce((s,r)=>Math.max(s,r.length),0),i=new VE,n=new Map;for(let s=0;s<e.length;s++){const r=e[s];for(;r.length<t;)r.push("");const a=i.insertTick(r,s);a!=null&&n.set(r,a)}return{root:i,tickNodes:n}}function _E(e,t,i){const n=t.index-e.index,s=i/n;t.change-=s,t.shift+=i,e.change+=s,t.prelim+=i,t.mod+=i}function zE(e,t,i){return t.getSiblings().includes(e.ancestor)?e.ancestor:i}function GE({children:e}){let t=0,i=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.prelim+=t,s.mod+=t,i+=s.change,t+=s.shift+i}}function jE(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&&(_E(zE(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 VM(e){const{children:t}=e;if(t.length){let[i]=t;for(const r of t)VM(r),i=jE(r,i);GE(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 BM(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const n of e.children)BM(n,t+e.mod,i)}function _M(e){const{children:t}=e;let i=0;for(const n of t)_M(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.subtreeLeft=e.position,e.subtreeRight=e.position)}function HE(e){const t=new $E,{root:i,tickNodes:n}=BE(e);return VM(i),BM(i,-i.prelim,t),_M(i),{layout:t,tickNodes:n}}var $E=class{constructor(){this.dimensions=new FE,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:n,right:s}=this.dimensions;s!==n&&(i=e/(s-n))}return t&&(i*=-1),i}},Bc=5,ui=class extends oe{constructor(){super(...arguments),this.enabled=!0,this.border=new fa}};b([S],ui.prototype,"enabled",2),b([S],ui.prototype,"avoidCollisions",2),b([S],ui.prototype,"border",2),b([S],ui.prototype,"color",2),b([S],ui.prototype,"cornerRadius",2),b([S],ui.prototype,"spacing",2),b([S],ui.prototype,"rotation",2),b([S],ui.prototype,"wrapping",2),b([S],ui.prototype,"truncate",2),b([S],ui.prototype,"fill",2),b([S],ui.prototype,"fontStyle",2),b([S],ui.prototype,"fontWeight",2),b([S],ui.prototype,"fontSize",2),b([S],ui.prototype,"fontFamily",2),b([S],ui.prototype,"padding",2);var Cd=class extends oe{constructor(){super(...arguments),this.enabled=!0}};b([S],Cd.prototype,"enabled",2),b([S],Cd.prototype,"width",2),b([S],Cd.prototype,"stroke",2);var Vm=class extends oe{constructor(){super(...arguments),this.label=new ui,this.tick=new Cd}};b([S],Vm.prototype,"label",2),b([S],Vm.prototype,"tick",2);var _c=class extends Ic{constructor(e){super(e,new FM),this.tickScale=new FM,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.depthOptions=new Ja(Vm),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:n,bandwidth:s}=this.scale,r=Math.abs(t[1]-t[0])-i,a=this.tickTreeLayout.scaling(r,t[0]>t[1]),o=n+s/2;let l=0;for(const c of e){const h=c.position*a;l>h&&(l=h),c.screen=h+o}for(const c of e)c.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:n}=this,s=this.horizontal?0:-90;for(let r=0;r<e;r++)t.push(i[r]?.label.enabled??n.enabled?{enabled:!0,spacing:i[r]?.label.spacing??n.spacing,wrapping:i[r]?.label.wrapping??n.wrapping,truncate:i[r]?.label.truncate??n.truncate,rotation:i[r]?.label.rotation??(r?s:n.rotation),avoidCollisions:i[r]?.label.avoidCollisions??n.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>{e.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.pointerEvents=t.textUntruncated==null?1:0,e.setFont(t),e.setBoxing(t)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:e}=this.scale,{title:t,label:i,range:n,depthOptions:s,horizontal:r,line:a}=this,o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o);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.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:U.zero,spacing:0,depthLabelMaxSize:{},tickLabelLayout:[]};const{depth:c,nodes:h}=this.tickTreeLayout,u=r?-i.getSideFlag():i.getSideFlag(),d=[],p=new Map,g=new Map,f=new wo,y=this.getDepthOptionsMap(c),m=u*(y[0].spacing+this.getTickSpacing()+l),v=this.tickFormatter(this.scale.domain,this.scale.domain,!1),x=(V,H)=>{const q=c-V.depth;if(!y[q]?.enabled||!jb(V.screen,n))return!1;let z=(V.leafCount||1)*e;if(z<Bc)return!1;const ie=v(V.label,H-1);let de=ie;const pe=this.getLabelStyles({value:V.index,formattedValue:de,depth:q},s[q]?.label);if(i.avoidCollisions){const Re=y[q].rotation;let Rt=this.thickness;if(Re!=null){const ri=mg(Re,z,Rt);z=ri.width,Rt=ri.height}const ve={font:pe,textWrap:y[q].wrapping,overflow:y[q].truncate?"ellipsis":"hide",maxWidth:z,maxHeight:Rt};de=Mu(de,ve)||de}return de!==ie&&Ob(de)?g.set(H,Ze(ie)):g.delete(H),f.x=r?V.screen:m,f.y=r?m:V.screen,f.rotation=0,f.fill=pe.color,f.text=de,f.textAlign="center",f.textBaseline=i.parallel?"top":"bottom",f.setFont(pe),f.setBoxing(pe),!0},M={};for(const[V,H]of h.entries()){const q=c-H.depth;if(M[q]??(M[q]=0),!H.children.length&&e<Bc||!x(H,V)||!f.getBBox())continue;p.set(V,f.getBBox()),f.rotation=vs(y[q]?.rotation);const{width:de,height:pe}=f.getBBox(),Re=r?pe:de;M[q]<Re&&(M[q]=Re)}const D=Xg(),A=V=>{if(V===0)return 0;let H=M[0];for(let q=1;q<=V;q++)H+=y[q].spacing,q!==V&&(H+=M[q]);return H};for(const[V,H]of h.entries()){if(V===0)continue;const q=x(H,V),z=!H.children.length,ie=c-H.depth;if(z&&e<Bc||!q)continue;const de=vs(y[ie].rotation),pe=p.get(V);if(!pe)continue;const{width:Re,height:Rt}=pe,ve=A(ie);if(f.textAlign="center",f.textBaseline="middle",f.rotation=de,r?(f.y+=(ve+bg(Re/2,Rt/2,de))*u,f.rotationCenterX=H.screen,f.rotationCenterY=f.y):(f.x+=ve*u+bg((y[ie].spacing*u+Re)/2,i.mirrored?Re:0,de)-Re/2,f.rotationCenterX=f.x,f.rotationCenterY=H.screen),y[ie].avoidCollisions){const{width:De,height:Fr}=f.getBBox(),Fs=r?De:Fr,Vr=z?e:H.leafCount*e;if(Fs>Vr){p.delete(V);continue}}const ri=f.getPlainText(),us=f.getBoxingProperties();d.push({text:ri,textUntruncated:g.get(V),visible:!0,tickId:D(ri),range:this.scale.range,border:us.border,color:f.fill,cornerRadius:us.cornerRadius,fill:us.fill,fontFamily:f.fontFamily,fontSize:f.fontSize,fontStyle:f.fontStyle,fontWeight:f.fontWeight,padding:us.padding,rotation:f.rotation,rotationCenterX:f.rotationCenterX,rotationCenterY:f.rotationCenterY,textAlign:f.textAlign,textBaseline:f.textBaseline,x:f.x,y:f.y}),p.set(V,tt.toCanvas(f))}let I=M[0];for(let V=0;V<c;V++)I+=y[V].spacing,V!==0&&(I+=M[V]);const k=I+l,C=[this.lineNodeBBox(),U.merge(p.values()),new U(0,0,k*u,0)],T=U.merge(C),N=r?T.height:T.width,{spacing:R,scrollbarLayout:F}=this.applyScrollbarLayout(C,N,o);this.layout.labelThickness=N,this.layout.scrollbar=F,t.enabled&&C.push(this.titleBBox(this.scale.domain,R));const G=U.merge(C);return this.layoutCrossLines(),{bbox:G,spacing:R,depthLabelMaxSize:M,tickLabelLayout:d}}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{depthLabelMaxSize:a,spacing:o}=this.computedLayout,{depth:l}=r,c=this.getDepthOptionsMap(l),h=this.chartLayout?.scrollbars?.[this.id],u=this.getScrollbarThickness(h),{position:d,horizontal:p,gridPadding:g}=this,f=d==="bottom"||d==="right"?-1:1,y=g,m=f*n-g,v={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},{ticks:x}=e.ticks(v,void 0,s),{tickInfos:M,minSpacingByDepth:D}=WE(x,this.tickNodes,e,l),A=KE(D),I=ZE(M,A,l,D),k=I.map(({tickLabel:C,position:T},N)=>({index:e.findIndex(C),tickId:Xt(N,...C),translation:Math.round(T)}));this.gridLineGroupSelection.update(i.enabled&&n?this.calculateGridLines(k,y,m):[]),this.gridFillGroupSelection.update(i.enabled&&n?this.calculateGridFills(k,y,m):[]),this.tickLineGroupSelection.update(t.enabled?I.map(({depth:C},T)=>{const{tickId:N,translation:R}=k[T],F=this.depthOptions[C]?.tick;let G=a[0];for(let ve=0;ve<=C;ve++)G+=c[ve].spacing,ve!==0&&(G+=a[ve]);const V=F?.stroke??t.stroke,H=F?.enabled===!1?0:F?.width??t.width,q=-f*G,z=-f*(u+this.getTickSpacing()),[ie,de,pe,Re]=p?[R,z,R,z+q]:[z,R,z+q,R];return{tickId:N,offset:R,x1:ie,y1:de,x2:pe,y2:Re,stroke:V,strokeWidth:H,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{depthLabelMaxSize:i,tickLabelLayout:n,spacing:s,bbox:r}=this.computeLayout();return this.computedLayout={depthLabelMaxSize: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=>yl(l.getDomain(e)));this.dataDomain={domain:Jr(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(zM),{layout:n,tickNodes:s}=HE(i);this.tickTreeLayout=n,this.tickNodes=s;const r=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||r.push(this.dataDomain.domain[l.refId]);const a=rb(this.dataDomain.domain,r);this.scale.domain=a;const o=a.map(zM);o.push([""]),this.tickScale.domain=o}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const n=ae(i)?JSON.stringify(i):i;return t.has(n)?!1:(t.add(n),!0)})}};_c.className="GroupedCategoryAxis",_c.type="grouped-category",b([S],_c.prototype,"depthOptions",2);function UE(e){let t=0,i=e;for(;i?.index===0;)t+=1,i=i.parent;return t}function WE(e,t,i,n){const s=new Array(e.length),r=new Array(n).fill(1/0),a=new Array(n).fill(Number.NaN);for(let o=0;o<e.length;o++){const l=e[o],c=t?.get(l),h=c==null?n-1:Math.min(UE(c),n-1),u=i.convert(l);if(s[o]={tickLabel:l,depth:h,position:u},!!Number.isFinite(u))for(let d=0;d<=h;d++){const p=a[d];Number.isFinite(p)&&(r[d]=Math.min(r[d],Math.abs(u-p))),a[d]=u}}return{tickInfos:s,minSpacingByDepth:r}}function KE(e){for(let t=0;t<e.length;t++){const i=e[t];if(!Number.isFinite(i)||i>=Bc)return t}return e.length}function YE(e){return!Number.isFinite(e)||e<=0?1:Math.max(1,Math.ceil(Bc/e))}function ZE(e,t,i,n){if(t<=0)return e;const s=Math.min(t-1,i-1);if(s<0)return e;const r=YE(n[s]),a=[];let o=0;for(const l of e){if(l.depth>=t){a.push(l);continue}l.depth===s&&(o%r===0&&a.push(l),o++)}return a}function zM(e){return bl(le(e)&&"value"in e?e.value:e)}var GM={type:"axis",name:"grouped-category",chartType:"cartesian",version:Xe,dependencies:[en],options:Fo,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:e=>new _c(e)},il=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}=mu(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?(_.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?(_.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 Kf)}};il.className="LogAxis",il.type="log";var jM={type:"axis",name:"log",chartType:"cartesian",version:Xe,dependencies:[en],options:Bo,themeTemplate:{base:10,line:{enabled:!1}},create:e=>new il(e)},HM={type:"axis",name:"number",chartType:"cartesian",version:Xe,dependencies:[en],options:Vo,themeTemplate:{line:{enabled:!1}},create:e=>new qi(e)},$M={type:"axis",name:"time",chartType:"cartesian",version:Xe,dependencies:[en],options:_o,themeTemplate:{gridLine:{enabled:!1}},create:e=>new es(e)},UM=class extends Ic{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,y]=l?[d,Math.max(s,r),d,Math.min(s,r)]:[Math.min(s,r),d,Math.max(s,r),d],{style:m}=o,{stroke:v,strokeWidth:x=0,lineDash:M}=m[e%m.length]??{};return{tickId:t,offset:d,x1:p,y1:g,x2:f,y2:y,stroke:v,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,y,m,v]=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:y,x2:m,y2:v,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],y=-s*(a+this.getTickSpacing(d)),[m,v,x,M]=o?[f,y,f,y+p]:[y,f,y+p,f],{stroke:D,width:A}=d;return{tickId:t,offset:f,x1:m,y1:v,x2:x,y2:M,stroke:D,strokeWidth:A,lineDash:void 0}}},Ns=class extends UM{constructor(e){super(e,new vr,!1),this.parentLevel=new Wo,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!0}processData(){super.processData();let e;const{domain:t}=this.dataDomain;if(t.length===2&&t[0].valueOf()===t[1].valueOf())e=Tu(t[0]);else{const{boundSeries:i,direction:n,min:s,max:r}=this;e=DS(i,n,s,r)}ft(this.defaultUnit,e)||(this.defaultUnit=e)}updateScale(){super.updateScale(),this.scale.interval=this.unit??this.defaultUnit}normaliseDataDomain(e){const{extent:t,clipped:i}=yu(e,this.min,this.max,this.preferredMin,this.preferredMax);return{domain:t,clipped:i}}tickFormatParams(e,t,i,n){n??(n=Yg(t));const s=Zg(e),r=Ss(n),a=hr(n),o=nc(n);return{type:"date",unit:r,step:a,epoch:o,truncateDate:s}}datumFormatParams(e,t,i,n,s){const r=this.unit??this.defaultUnit??"millisecond";n??(n=r);const{datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}=t,g=Ss(n),f=hr(n),y=nc(n);return{type:"date",value:Ti(r,e),datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p,unit:g,step:f,epoch:y,style:s}}};Ns.className="UnitTimeAxis",Ns.type="unit-time",b([S],Ns.prototype,"parentLevel",2),b([S],Ns.prototype,"min",2),b([S],Ns.prototype,"max",2),b([S],Ns.prototype,"preferredMin",2),b([S],Ns.prototype,"preferredMax",2),b([S],Ns.prototype,"unit",2);var WM={type:"axis",name:"unit-time",chartType:"cartesian",version:Xe,dependencies:[en],options:zo,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:!1},parentLevel:{enabled:!0},interval:{placement:"between"}},create:e=>new Ns(e)},KM=[HM,jM,$M,PM,GM,WM];function kd(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:hc,collapsable:p,onUpdate(f,y){y&&u!=="removed"||(d.path.clear(!0),g(f,d),d.checkPathDirty())},onStop(){u==="added"&&(d.path.clear(!0),g(1,d),d.checkPathDirty())},phase:On[u]})},a=new It,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 Da(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 be(h,c)}return n}function YM(e,t,i,n,s,r,a){if(e.visible&&n.enabled&&s){const o=Da(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 XE={"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 ZM({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}=XE[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 qE=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=Me(),t=Math.max(0,this.timeout-this.minimumDelay);typeof e.requestIdleCallback=="function"?this.idleCallbackId=e.requestIdleCallback(this.execute.bind(this),{timeout:t}):this.idleCallbackId=setTimeout(()=>this.execute(),t)}cancelScheduled(){if(this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId==null)return;const e=Me();typeof e.cancelIdleCallback=="function"?e.cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0}execute(){const e=this.pending;if(!e)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const t=e.computation();return e.onComplete(t),t}},wd=class{constructor(){this._dataLength=0,this.executor=new qE}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>10||t<.1||this._dataLength===0)this._filters=void 0,this._dataLength=e;else if(this._filters)for(const i of this._filters)i.stale=!0;else this._dataLength=e;this.executor.cancel()}mergeFilters(e){if(!this._filters||e.length===0)return;const t=[...this._filters,...e];t.sort((i,n)=>i.maxRange-n.maxRange),this._filters=t}};function lt({id:e},t,i,...n){for(const s of n)s.cleanup();ks(e,t,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function Ld({id:e},t,i,...n){ks(e,t,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Aa(e){return{opacity:1}}var JE=10;function Td(e,t,i,n,s,r,a){const o=e[r];if(o===void 0)return-1;const l=Number.isFinite(t)?ln(o,t,i,a):no(r,e.length),c=Xh(l,s);return r===n[c+an]||r===n[c+In]||r===n[c+Dn]||r===n[c+An]?c:-1}function XM(e,t,i,n,s,r,a,o,l){let c=0,h=0,u=-1;for(let y=0;y<a;y++){const m=Td(e,t,i,n,s,y,r);m!==-1&&(c++,m!==u&&(h++,u=m))}h++;const d=o?.length===c?o:new Uint32Array(c),p=l?.length===h?l:new Uint32Array(h);let g=0,f=0;u=-1;for(let y=0;y<a;y++){const m=Td(e,t,i,n,s,y,r);m!==-1&&(m!==u&&(p[f++]=g,u=m),d[g++]=y)}return p[f]=c-1,{indices:d,metaIndices:p}}function Bm(e,t,i,n){const s=t.length;if(s<ms)return;const[r,a]=e,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:c}=n;let h=ys(t,r,a,{xNeedsValueOf:o});const u=c?.find(m=>m.maxRange===h);let{indexData:d,valueData:p}=bs(t,i,i,r,a,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),{indices:g,metaIndices:f}=XM(t,r,a,d,h,o,s,u?.indices,u?.metaIndices);const y=[{maxRange:h,metaIndices:f,indices:g,indexData:d,valueData:p}];for(;g.length>JE&&h>er;){const m=h,v=Math.trunc(m/2),x=c?.find(F=>F.maxRange===v),M=Kr(d,p,m,{reuseIndexData:x?.indexData,reuseValueData:x?.valueData});h=M.maxRange,d=M.indexData,p=M.valueData;const D=g;let A=0,I=0,k=-1;for(const F of D){const G=Td(t,r,a,d,h,F,o);G!==-1&&(A++,G!==k&&(I++,k=G))}I++;const C=x?.indices?.length===A?x.indices:new Uint32Array(A),T=x?.metaIndices?.length===I?x.metaIndices:new Uint32Array(I);let N=0,R=0;k=-1;for(const F of D){const G=Td(t,r,a,d,h,F,o);G!==-1&&(G!==k&&(T[R++]=N,k=G),C[N++]=F)}T[R]=A-1,g=C,f=T,y.push({maxRange:h,metaIndices:f,indices:g,indexData:d,valueData:p})}return y.reverse(),y}function QE(e,t,i,n){const s=t.length;if(s<ms)return;const[r,a]=e,{xNeedsValueOf:o,yNeedsValueOf:l,targetRange:c,existingFilters:h}=n,u=ys(t,r,a,{xNeedsValueOf:o}),d=Math.min(u,io(Math.max(c,er))),p=h?.find(M=>M.maxRange===d),{indexData:g,valueData:f}=bs(t,i,i,r,a,d,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),{indices:y,metaIndices:m}=XM(t,r,a,g,d,o,s,p?.indices,p?.metaIndices),v={maxRange:d,indices:y,metaIndices:m,indexData:g,valueData:f};function x(){return Bm([r,a],t,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(D=>D.maxRange!==d)??[]}return{immediate:[v],computeRemaining:x}}function eR(e,t,i,n,s,r){const[a,o]=on(e,n);return Bm([a,o],t,i,{xNeedsValueOf:s,yNeedsValueOf:r})}var tR=ql(eR);function iR(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]=on(e,l);return Bm([u,d],a,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:r})}return tR(e,a,o,l,c,h)}function nR(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]=on(e,c);return QE([d,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:u,targetRange:r,existingFilters:a})}var ns=class extends rf{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};b([S,Y()],ns.prototype,"enabled",2),b([S,Y()],ns.prototype,"color",2),b([S,Y()],ns.prototype,"xOffset",2),b([S,Y()],ns.prototype,"yOffset",2),b([S,Y()],ns.prototype,"blur",2);var xi=class extends rf{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}};b([S,Y()],xi.prototype,"enabled",2),b([S,oa({equals:xo})],xi.prototype,"shape",2),b([S,Y()],xi.prototype,"size",2),b([S,oa({equals:ft})],xi.prototype,"fill",2),b([S,Y()],xi.prototype,"fillOpacity",2),b([S,Y()],xi.prototype,"stroke",2),b([S,Y()],xi.prototype,"strokeWidth",2),b([S,Y()],xi.prototype,"strokeOpacity",2),b([S],xi.prototype,"lineDash",2),b([S],xi.prototype,"lineDashOffset",2),b([S,oa({equals:xo})],xi.prototype,"itemStyler",2);function sR(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 qM=class extends oe{constructor(){super(...arguments),this.enabled=!1}};b([S],qM.prototype,"enabled",2);var Os=class extends oe{constructor(){super(...arguments),this.interaction=new qM,this.position=new No,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const n=this.renderer==null?void 0:Cn(e,this.renderer,i);if(dt(n)||ji(n)||yn(n))return{type:"raw",rawHtmlString:pt(n)};if(n!=null){const s=be(n.symbol?.marker,t.symbol?.marker),r=n.symbol?.line??t.symbol?.line?be(n.symbol?.line,t.symbol?.line):void 0,a=t.symbol||n.symbol?{marker:s,line:sR(r,s)}:void 0;return{type:"structured",...t,...n,symbol:a}}return{type:"structured",...t}}};b([S],Os.prototype,"enabled",2),b([S],Os.prototype,"showArrow",2),b([S],Os.prototype,"renderer",2),b([S],Os.prototype,"interaction",2),b([S],Os.prototype,"position",2),b([S],Os.prototype,"range",2),b([S],Os.prototype,"class",2);function Ca(){return new Os}var gt=class extends Pn{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 eo,this.shadow=new ns,this.marker=new xi,this.label=new Xi,this.tooltip=Ca(),this.connectMissingData=!1}};b([S],gt.prototype,"xKey",2),b([S],gt.prototype,"xName",2),b([S],gt.prototype,"yKey",2),b([S],gt.prototype,"yName",2),b([S],gt.prototype,"yFilterKey",2),b([S],gt.prototype,"stackGroup",2),b([S],gt.prototype,"normalizedTo",2),b([S],gt.prototype,"fill",2),b([S],gt.prototype,"fillOpacity",2),b([S],gt.prototype,"stroke",2),b([S],gt.prototype,"strokeWidth",2),b([S],gt.prototype,"strokeOpacity",2),b([S],gt.prototype,"lineDash",2),b([S],gt.prototype,"lineDashOffset",2),b([S],gt.prototype,"interpolation",2),b([S],gt.prototype,"styler",2),b([S],gt.prototype,"shadow",2),b([S],gt.prototype,"marker",2),b([S],gt.prototype,"label",2),b([S],gt.prototype,"tooltip",2),b([S],gt.prototype,"connectMissingData",2);function kt(e,t,i){return(t-e)*i+e}function JM(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=Pu(i,s,a,l,t),[u,d]=oc(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 aR(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 QM(e,t){return e.type==="linear"?JM(e,t):e.type==="cubic"?rR(e,t):e.type==="step"?aR(e):JM(e,t)}function eI(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 tI(e,t,i,n,s,r){r?e.lineTo(t,i):e.lineTo(n,s)}function iI(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 nI(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 oR(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 zc(e,t,i,n){const[s,r]=Ki(t);switch(eI(e,i,s.x,s.y,r.x,r.y,n),t.type){case"linear":tI(e,t.x0,t.y0,t.x1,t.y1,n);break;case"cubic":iI(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,n);break;case"step":nI(e,t.x0,t.y0,t.x1,t.y1,t.stepX,n);break;case"multi-line":oR(e,t.x0,t.y0,t.x1,t.y1,t.midPoints,n);break}}function sI(e,t,i){const[n,s]=Ki(e),[r,a]=Ki(t),o=kt(n.x,r.x,i),l=kt(n.y,r.y,i),c=kt(s.x,a.x,i),h=kt(s.y,a.y,i);return[{x:o,y:l},{x:c,y:h}]}function _m(e,t,i,n,s,r){const[{x:a,y:o},{x:l,y:c}]=sI(t,i,n);if(eI(e,s,a,o,l,c,r),t.type==="cubic"&&i.type==="cubic"){const h=kt(t.cp1x,i.cp1x,n),u=kt(t.cp1y,i.cp1y,n),d=kt(t.cp2x,i.cp2x,n),p=kt(t.cp2y,i.cp2y,n);iI(e,a,o,h,u,d,p,l,c,r)}else if(t.type==="step"&&i.type==="step"){const h=kt(t.stepX,i.stepX,n);nI(e,a,o,l,c,h,r)}else if(t.type==="linear"&&i.type==="linear")tI(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=QM(t,h),d=QM(i,h),p=kt(u.leftCp1x,d.leftCp1x,n),g=kt(u.leftCp1y,d.leftCp1y,n),f=kt(u.leftCp2x,d.leftCp2x,n),y=kt(u.leftCp2y,d.leftCp2y,n),m=kt(u.stepX,d.stepX,n),v=kt(u.stepY0,d.stepY0,n),x=kt(u.stepY1,d.stepY1,n),M=kt(u.rightCp1x,d.rightCp1x,n),D=kt(u.rightCp1y,d.rightCp1y,n),A=kt(u.rightCp2x,d.rightCp2x,n),I=kt(u.rightCp2y,d.rightCp2y,n);r?(e.cubicCurveTo(A,I,M,D,m,x),e.lineTo(m,v),e.cubicCurveTo(f,y,p,g,a,o)):(e.cubicCurveTo(p,g,f,y,m,v),e.lineTo(m,x),e.cubicCurveTo(M,D,A,I,l,c))}}var rI=1e3,aI=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(aI||{});function lR(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 di(e){return Ou(e).valueOf()}function qt(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(ur(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&&c<a)return o+l*c}return Number.NaN}const i=di(e);let n=t.domain.findIndex(s=>di(s)===i);return n===-1&&(n=t.domain.findIndex(s=>lR(e,s))),n>=0?t.inset+t.step*n:Number.NaN}function oI({data:e},t){return e.map((i,n)=>({xValue0Index:t.indexOf(di(i.xValue0)),xValue1Index:t.indexOf(di(i.xValue1)),datumIndex:n}))}function lI(e){return Object.values(e.scales).every(t=>t.type==="category"?ur(t)?t.bandCount<rI:t.domain.length<rI:!0)}function cR(e,t){const i=t.scales.x,n=e.scales.x;if(i?.type!=="category"||n?.type!=="category"||ur(i)||ur(n))return!0;let s=-1/0;for(const r of i.domain){const a=qt(r,n);if(Number.isFinite(a)){if(a<s)return!1;s=a}}return!0}function hR(e,t){let i=-1/0;for(const n of e){const s=qt(n.value,t.scales.x);if(Number.isFinite(s)){if(s<i)return!1;i=s}}return!0}function uR(e,t){const i=new Map;for(const{xValue0:h,xValue1:u}of e.data){const d=di(h),p=di(u);i.set(d,h).set(p,u)}const n=Array.from(i,([h,u])=>({axisValue:h,value:u}));n.sort((h,u)=>qt(h.value,e.scales.x)-qt(u.value,e.scales.x));const s=[];for(const{xValue0:h,xValue1:u}of t.data){const d=di(h),p=di(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)=>qt(h.value,t.scales.x)-qt(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=qt(h.value,t.scales.x),p=qt(r[u].value,t.scales.x);if(d>p){a=u+1;break}}r.splice(a,0,h),a+=1}if(!hR(r,t))return;const o=r.map(h=>h.axisValue),l=oI(t,o),c=oI(e,o);return{axisValues:o,oldDataAxisIndices:l,newDataAxisIndices:c}}function cI(e,t,i,n,s){if(s.xValue1Index===s.xValue0Index+1)return e;const r=Ki(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=qt(l,t.scales.x),o=qt(c,t.scales.x)}return tf(e,a,o)}function hI(e,t){const[i,n]=Ki(e),s=qt(0,t.scales.y);return bo(e,{x:i.x,y:s},{x:n.x,y:s})}function uI(e){const[t,i]=Ki(e);return Rx(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function dI(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 hI(e,i);case 1:return uI(e)}const l=qt(a,i.scales.x),c=qt(o,i.scales.y),h={x:l,y:c};return bo(e,h,h)}function zm(e,t){if(t==null)return;const i=di(e.xValue0),n=di(e.xValue1);return t.find(s=>di(s.xValue0)===i&&di(s.xValue1)===n)?.span}function pI(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=dI(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 gI(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=dI(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 fI(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(m=>di(m.xValue0)<=a),c=i.data.find(m=>di(m.xValue1)>=o)):(l=i.data.find(m=>di(m.xValue0)===a),c=i.data.find(m=>di(m.xValue1)===o)),l==null||c==null)return;const[{x:h},{x:u}]=Ki(e),d=qt(l.xValue0,i.scales.x),p=qt(l.yValue0,i.scales.y),g=qt(c.xValue1,i.scales.x),f=qt(c.yValue1,i.scales.y);let y=n.data[s.datumIndex].span;return y=bo(y,{x:d,y:p},{x:g,y:f}),y=tf(y,h,u),y}function dR(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){pI(e,i,r,u,d,o,l);return}else if(h!=null&&u==null){gI(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],y=cI(f.span,t,n,s,h),m=e.data[u.datumIndex],v=cI(m.span,e,n,s,u);if(g===1){const x=fI(y,n,t,e,u);x==null?gI(t,i,a,h,p,o,l):(l.removed.push({from:y,to:x}),l.moved.push({from:x,to:v}),l.added.push({from:v,to:v}))}else if(g===-1){const x=fI(v,n,e,t,h);x==null?pI(e,i,r,u,d,o,l):(l.removed.push({from:y,to:y}),l.moved.push({from:y,to:x}),l.added.push({from:x,to:v}))}else l.removed.push({from:y,to:y}),l.moved.push({from:y,to:v}),l.added.push({from:v,to:v})}function pR(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;c<r.length-1;c+=1)dR(t,i,n,r,c,o,a,l,s);return s}function gR(e,t){const i=[],n=[],s=[];for(let r=0;r<t.data.length;r+=1){const a=t.data[r].span,o=e.data[r].span;i.push({from:a,to:a}),n.push({from:a,to:o}),s.push({from:o,to:o})}return{removed:i,moved:n,added:s}}function mI(e,t,i){const{span:n}=t;switch(i){case 0:return zm(t,e.zeroData)??hI(n,e);case 1:return uI(n)}}function fR(e,t,i){const n=[],s=[];for(const r of t.data){const a=r.span,o=mI(t,r,i);s.push({from:a,to:o})}for(const r of e.data){const a=r.span,o=mI(e,r,i);n.push({from:o,to:a})}return{removed:s,moved:[],added:n}}function Gc(e,t,i){if(!lI(e)||!lI(t)||!cR(e,t))return;const n=uR(e,t);return n==null?fR(e,t,i):n.axisValues.length===n.oldDataAxisIndices.length+n.newDataAxisIndices.length+2?gR(e,t):pR(n,e,t,i)}function jc(e,t){const i=e.map(s=>s.point);let n=Fx(i);switch(t.type){case"linear":break;case"smooth":n=Bx(i,t.tension);break;case"step":n=Vx(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 Nd(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function Gm({path:e},t){let i;for(const{span:n}of t){const[s,r]=Ki(n),a=i!=null&&Nd(i,s)?2:0;zc(e,n,a,!1),i=r}}function Od(e,t,i){let n;for(const s of i){const[r,a]=sI(s.from,s.to,e),o=n!=null&&Nd(n,r)?2:0;_m(t.path,s.from,s.to,e,o,!1),n=a}}function yI(e,t,i,n=1){const s=(l,c)=>Od(l,c,t.removed),r=(l,c)=>Od(l,c,t.moved),a=(l,c)=>Od(l,c,t.added),o=jm(e,i,n);return{status:e,path:{addPhaseFn:a,updatePhaseFn:r,removePhaseFn:s},pathProperties:o}}function jm(e,t,i=1){const n=t==="none"?"updated":e,s={fromFn(r,a){const o={phase:On[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:On[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 mR(e,t,i,n=1){const s=e.scales.x?.type==="category",r=t.scales.x?.type==="category";if(s!==r||!lc(e.scales.x)||!lc(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=Gc({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(o==null)return;const l=yI(a,o,"fade",n),c=(i?.changed??!0)||!aa(e.scales.x,t.scales.x)||!aa(e.scales.y,t.scales.y)||a!=="updated";return{status:a,stroke:l,hasMotion:c}}function bI({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<t.length;a+=1){const{span:o}=t[a],{span:l}=i[a],{0:c,1:h}=Ki(o),{0:u,1:d}=Ki(l);if(Nd(s,c)&&Nd(r,u))zc(e,o,2,!1);else{for(let p=a-1;p>=n;p-=1)zc(e,i[p].span,1,!0);e.closePath(),zc(e,o,0,!1),n=a}s=h,r=d}for(let a=t.length-1;a>=n;a-=1)zc(e,i[a].span,1,!0);e.closePath()}function Hm(e,{path:t},i,n){for(let s=0;s<i.length;s+=1){const r=i[s],a=n[s];_m(t,r.from,r.to,e,0,!1),_m(t,a.from,a.to,e,1,!0),t.closePath()}}function vI(e,t,i,n){const s=(l,c)=>Hm(l,c,t.removed,i.removed),r=(l,c)=>Hm(l,c,t.moved,i.moved),a=(l,c)=>Hm(l,c,t.added,i.added),o=jm(e,n);return{status:e,path:{addPhaseFn:a,updatePhaseFn:r,removePhaseFn:s},pathProperties:o}}function yR(e,t){const i=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(i!==n||!lc(e.scales.x)||!lc(t.scales.x))return;let s="updated";t.visible&&!e.visible?s="removed":!t.visible&&e.visible&&(s="added");const r=Gc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(r==null)return;const a=Gc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(a==null)return;const o=Gc({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=vI(s,r,a,l),h=yI(s,o,l);return{status:s,fill:c,stroke:h}}function Hc({id:e},t,i,n,...s){const r={...n,phase:n?.phase??(i?On[i]:"trailing")};ks(e,"markers",t,s,{opacity:0},{opacity:1},r);for(const a of s)a.cleanup()}function bR({id:e},t,...i){ks(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const n of i)n.cleanup()}function $m({id:e,nodeDataDependencies:t},i,n,...s){const r=t.seriesRectWidth;bt(e,"markers",i,s,{fromFn:(l,c)=>{const h=c.midPoint?.x??r;let u=te(0,Ux(h/r),1);return Number.isNaN(u)&&(u=0),{scalingX:0,scalingY:0,delay:n?.delay??u,duration:n?.duration??Ff,phase:n?.phase??"initial",start:n?.start,finish:n?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function Ed(e){return{opacity:1,scalingX:1,scalingY:1}}function Rd(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 $c(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 Pd(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=At.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 tt.toCanvas(e.contentGroup,new U(d,p,l,l))}function Um(e,t,i,n=i){if(!(n.enabled??i.enabled))return!1;const r=1;return(t.step??Wr(t.range)/Math.max(1,e))>r}function Fd(e,t,i,n){return n??(n={stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}),om.reduce((s,r)=>(s[r]=e.getMarkerStyle(i,{},void 0,{highlightState:r},void 0,n),s),{})}function Wm({id:e,visible:t,nodeDataDependencies:i},n,...s){const{seriesRectWidth:r,seriesRectHeight:a}=i;ks(e,"path_properties",n,s,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:a,visible:t},finish:{clip:!1,visible:t}})}function Km({id:e},t,i,n="add",...s){ks(e,t,i,s,{opacity:0},{opacity:1},{phase:n})}function Ym(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Vd({nodeDataDependencies:e},t){const i=n=>Number.isFinite(n)?n:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}function xI(e){return e.isReversed()!==e.range[1]<e.range[0]}function Bd(e,t,i,n,s,r=!0){if(t.scale.domain.length===0||i.scale.domain.length===0)return;const a=e.key==="x"?t:i,{scale:o,direction:l}=a,c=l==="x",h=o.bandwidth??0,u=r?((o.step??0)-h)/2:0,d=Math.max(n.x,s.width-(n.x+n.width)),p=Math.max(n.y,s.height-(n.y+n.height)),g=()=>xI(c?t:i)?c?n.width+d:n.height+p:c?-d:-p,f=()=>xI(c?t:i)?c?-d:-p:c?n.width+d:n.height+p;return(m=>{const v=[];let x=-1;for(let M=0;M<m.length;M++){const D=m[M];if(kl(D))continue;const{start:A,stop:I,...k}=m[M],C=m[x]?.stop,T=m.slice(M+1).find(V=>V.start!=null)?.start;let N=o.convert(A??C)-u,R=o.convert(I??T)+2*u;const F=A!=null&&Number.isNaN(N),G=I!=null&&Number.isNaN(R);F||G||(Number.isNaN(N)&&(N=g()),Number.isNaN(R)&&(R=f()),I!=null&&(x=M),v.push({start:N,stop:R,...k}))}return v})(e.segments).map(({stop:m,start:v,...x})=>{const M=c?v:-d,D=c?-p:v,A=c?m+h:n.width+d,I=c?n.height+p:m+h;return{clipRect:{x0:M,y0:D,x1:A,y1:I},...x}})}var SI=new Set(["time","timestamp","date","datetime"]);function Zm(e,t,i,{allowPrimitiveTypes:n=!0}={}){if(e!=="x"&&e!=="y"||!le(t))return;const s=MI(e,i);if(s==null||!(s in t))return;const r=t[s],a=II(e,i),o=xR(r);if(o)return{type:o,position:a};const l=SR(s,r);if(l)return{type:l,position:a};if(n)return typeof r=="number"?{type:"number",position:a}:{type:"category",position:a}}function Uc(e,t,i){return Zm(e,t,i,{allowPrimitiveTypes:!1})}function vR(e,t,i){if(e!=="x"||!le(t))return;const n=MI(e,i);if(n==null||!(n in t))return;const s=t[n],r=II(e,i),a=MR(n,s);if(a)return{type:a,position:r};if(dt(s))return{type:"category",position:r}}function xR(e){if(ae(e)&&e.every(t=>dt(t)||t===null))return"grouped-category"}function SR(e,t){if(yn(t)||SI.has(e)&&ji(t))return"time"}function MR(e,t){if(yn(t)||SI.has(e)&&ji(t))return"ordinal-time"}function MI(e,t){if(e==="x"&&"xKey"in t)return t.xKey;if(e==="y"&&"yKey"in t)return t.yKey}function II(e,t){return"direction"in t&&t.direction==="horizontal"?e==="x"?"left":"bottom":e==="x"?"bottom":"left"}var IR=.125,DR=.25,Xm=class extends Cr{constructor(e){super({moduleCtx:e,propertyKeys:Zo,propertyNames:Xo,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:Ym({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Aa,datum:(t,i)=>({...Ed(t),...$c(t,i)})},clipFocusBox:!1}),this.properties=new gt,this.connectsToYAxis=!0,this.aggregationManager=new wd,this.backgroundGroup=new re({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>mm||this.contextNodeData.strokeData.spans.length>mm)}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,yFilterKey: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,y={value:`area-stack-${n}-yValue`,marker:`area-stack-${n}-yValues-marker`},m={invalidValue:null};(Hn(c)||l)&&s>1&&(m.invalidValue=0),i||(m.forceValue=0);const v=this.properties.allowNullKeys??!1,x=[Ir(r,p,{id:"xValue",allowNullKey:v}),Ue(a,g,{id:"yValueRaw",...m}),...o==null?[]:[Ue(o,g,{id:"yFilterRaw"})]];f&&x.push(...wc(a,"normal",{id:"yValueCumulative",...m,groupId:y.marker},g)),Hn(c)&&x.push(Ue(a,g,{id:"yValue",...m,groupId:y.value}),hd(Object.values(y),c)),h&&x.push(Tc());const{dataModel:M,processedData:D}=await this.requestDataModel(e,t,{props:x,groupByKeys:f,groupByData:!f});this.aggregateData(M,D),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(Jr(o.domain))}}const r=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(s instanceof qi&&!(s instanceof il)){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),un(t))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>nR(i.scale.type,e,t,this.yCumulativeKey(t),this,n,r),computeFull:r=>iR(i.scale.type,e,t,this.yCumulativeKey(t),this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Bs.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),y=r.resolveColumnById(this,this.yCumulativeKey(a),a);let[m,v]=Nc(1,i.length-1,l.range,I=>{const k=i[I],C=i[I+1],T=t[k],N=t[C],R=f[T],F=f[N],{0:G}=this.xCoordinateRange(R,0),{1:V}=this.xCoordinateRange(F,0);return[G,V]});m=Math.max(m-1,0),v=Math.min(v+1,i.length-1);let x=[];if(o?.fillSpans)x=o?.fillSpans;else for(let I=m;I<v;I+=1){const k=i[I],C=i[I+1],T=t[k],N=t[C],R=f[T],F=f[N],G={type:"linear",moveTo:!1,x0:h.convert(R)+d,y0:u.convert(0),x1:h.convert(F)+d,y1:u.convert(0)};x.push({span:G,xValue0:R,xValue1:F,yValue0:0,yValue1:0})}this.phantomSpans=x;const M=[],D=[];let A=0;for(let I=m;I<v;I+=1){const k=i[I],C=i[I+1],T=t[k],N=t[C],R=!p&&this.hasInvalidDatumsInRange(g,y,T,N),F=x[A++];if(R){M.push(F),D.push(F);continue}const G=[];for(let de=k;de<=C;de++){const pe=t[de];if(g?.[pe])continue;const Re=y[pe];if(!Number.isFinite(Re))continue;const Rt=f[pe];G.push({point:{x:h.convert(Rt)+d,y:u.convert(Re)},xDatum:Rt,yDatum:Re})}if(G.length<2){M.push(F),D.push(F);continue}const V=G[0],H=G.at(-1),q=G.slice(1,-1).map(de=>de.point),ie={span:{type:"multi-line",moveTo:!1,x0:V.point.x,y0:V.point.y,x1:H.point.x,y1:H.point.y,midPoints:q},xValue0:V.xDatum,xValue1:H.xDatum,yValue0:V.yDatum,yValue1:H.yDatum};M.push(ie),D.push(ie)}return this.fillSpans=M,this.strokeSpans=D,{stack:[],fillSpans:M,strokeSpans:D}}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),m=(g?n.invalidData?.get(this.id):void 0)??f;m!=null&&(d=d.filter((N,R)=>m[R]===!1),p=p.filter((N,R)=>m[R]===!1));let[v,x]=Nc(1,d.length,a.range,N=>this.xCoordinateRange(d[N],0));v=Math.max(v-2,0),x=Math.min(x+2,d.length);let M;if(s?.fillSpans)M=s?.fillSpans;else{const N=[];for(let R=v;R<x;R+=1){const F=d[R];N.push({point:{x:c.convert(F)+u,y:h.convert(0)},xDatum:F,yDatum:0})}M=jc(N,{type:"linear"})}if(this.phantomSpans=M,!e)return this.fillSpans=M,this.strokeSpans=[],s;let D=s?.stack;if(D==null){D=[];for(let N=v;N<x-1;N+=1)D.push({leading:0,trailing:0,dataValid:!0,breakBefore:!1})}const A=D.slice();let I=!1;for(let N=0;N<A.length;N+=1){const R=v+N,F=v+N+1;let{leading:G,trailing:V,breakBefore:H}=D[N];const q=p[R],z=p[F],ie=!Number.isFinite(q),de=!Number.isFinite(z),pe=!ie&&!de;pe&&(G+=q,V+=z),N!==0&&pe!==I&&(H=!0),I=pe,A[N]={leading:G,trailing:V,dataValid:pe,breakBefore:H}}const k=[],C=[],T=[];for(let N=0;N<A.length;N+=1){const{leading:R,dataValid:F,breakBefore:G}=A[N],V=v+N;if(G){if(T.length!==0){const H=A[N-1],q={point:{x:c.convert(d[V])+u,y:h.convert(H.trailing)},xDatum:d[V],yDatum:H.trailing};T.push(q);const z=jc(T,l);k.push(...z),C.push(...z)}T.length=0}if(F){const H={point:{x:c.convert(d[V])+u,y:h.convert(R)},xDatum:d[V],yDatum:R};T.push(H)}else k.push(M[N])}if(T.length!==0){const N=A.at(-1),R=v+A.length,F={point:{x:c.convert(d[R])+u,y:h.convert(N.trailing)},xDatum:d[R],yDatum:N.trailing};T.push(F);const G=jc(T,l);k.push(...G),C.push(...G),T.length=0}return this.fillSpans=k,this.strokeSpans=C,{stack:A,fillSpans:k,strokeSpans:C}}createStackContext(){const e=this.axes.x;if(e==null)return;const{scale:t}=e,[i,n]=t.range,s=Math.abs(n-i);this.aggregationManager.ensureLevelForRange(s);const r=this.aggregationManager.getFilterForRange(s);return r?this.stackAggregatedData(r):this.stackYValueData()}createNodeDatumContext(e,t){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const{xKey:s,xName:r,yFilterKey:a,yKey:o,yName:l,legendItemName:c,marker:h,label:u,fill:d,stroke:p,normalizedTo:g}=this.properties,f=e.scale,y=t.scale,{isContinuousY:m}=this.getScaleInformation({xScale:f,yScale:y}),v=n.type==="grouped",[x,M]=f.range,D=Math.abs(M-x);this.aggregationManager.ensureLevelForRange(D);const A=this.aggregationManager.getFilterForRange(D),I=this.contextNodeData?.nodeData,k=I!=null&&this.canIncrementallyUpdateNodes(A!=null);return{xAxis:e,yAxis:t,rawData:n.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValueRaw",n),yCumulativeValues:v?i.resolveColumnById(this,"yValueCumulative",n):i.resolveColumnById(this,"yValueRaw",n),yFilterValues:a==null?void 0:i.resolveColumnById(this,"yFilterRaw",n),invalidData:n.invalidData?.get(this.id),xScale:f,yScale:y,xOffset:(f.bandwidth??0)/2,yOffset:0,indices:A?.indices,isContinuousY:m,labelsEnabled:u.enabled,normalizedTo:g,canIncrementallyUpdate:k,animationEnabled:!this.ctx.animationManager.isSkipped(),xKey:s,yKey:o,xName:r,yName:l,legendItemName:c,markerSize:h.size,markerFill:h.fill??d,markerStroke:h.stroke??p,markerStrokeWidth:h.strokeWidth??this.properties.strokeWidth,yDomain:this.getSeriesDomain("y").domain,nodes:k?I:[],labelData:[],nodeIndex:0,crossFiltering:!1}}computeMarkerCoordinate(e,t){let i;(Hn(e.normalizedTo)?e.isContinuousY&&Nu(t.yDatum):!Number.isNaN(t.yDatum))&&(i=t.yCumulative),t.x=e.xScale.convert(t.xDatum)+e.xOffset,t.y=e.yScale.convert(i),Number.isFinite(t.x)||(t.validPoint=!1)}handleDatum(e,t,i){if(t.xDatum=e.xValues[i],!(t.xDatum===void 0&&!this.properties.allowNullKeys)){if(t.datum=e.rawData[i],t.yDatum=e.yRawValues[i],t.yCumulative=+e.yCumulativeValues[i],t.validPoint=Number.isFinite(t.yDatum)&&e.invalidData?.[i]!==!0,this.computeMarkerCoordinate(e,t),t.selected=e.yFilterValues==null?void 0:e.yFilterValues[i]===t.yDatum,t.selected===!1&&(e.crossFiltering=!0),t.validPoint){if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const s=e.nodes[e.nodeIndex];s.datum=t.datum,s.datumIndex=i,s.midPoint={x:t.x,y:t.y},s.cumulativeValue=t.yCumulative,s.yValue=t.yDatum,s.xValue=t.xDatum,s.point={x:t.x,y:t.y,size:e.markerSize},s.selected=t.selected}else e.nodes.push({series:this,datum:t.datum,datumIndex:i,midPoint:{x:t.x,y:t.y},cumulativeValue:t.yCumulative,yValue:t.yDatum,xValue:t.xDatum,yKey:e.yKey,xKey:e.xKey,point:{x:t.x,y:t.y,size:e.markerSize},fill:e.markerFill,stroke:e.markerStroke,strokeWidth:e.markerStrokeWidth,selected:t.selected});e.nodeIndex++}if(e.labelsEnabled&&t.validPoint){const n=this.getLabelText(t.yDatum,t.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:t.yDatum,datum:t.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName});e.labelData.push({series:this,datum:t.datum,datumIndex:i,x:t.x,y:t.y,labelText:n})}}}populateNodeData(e){const t={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0,validPoint:!1};let[i,n]=this.visibleRangeIndices("xValue",e.xAxis.range,e.indices);i=Math.max(i-2,0),n=Math.min(n+2,e.indices?.length??e.xValues.length),this.processedData.input.count<1e3&&(i=0,n=this.processedData.input.count);for(let s=i;s<n;s+=1){const r=e.indices?.[s]??s;this.handleDatum(e,t,r)}}initializeResult(e){const{visibleSameStackCount:t}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return{itemId:e.yKey,fillData:{spans:this.fillSpans,phantomSpans:this.phantomSpans},strokeData:{spans:this.strokeSpans},labelData:e.labelData,nodeData:e.nodes,scales:this.calculateScaling(),visible:this.visible,stackVisible:t>0,crossFiltering:e.crossFiltering,styles:Fd(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){return t.segments=Bd(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?.crossFiltering===!0,a=this.contextNodeData?.segments,o=be(this.getHighlightStyle(),this.getStyle()),{strokeWidth:l,stroke:c,strokeOpacity:h,lineDash:u,lineDashOffset:d,fill:p,fillOpacity:g,opacity:f}=o;i.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:c,strokeWidth:l,strokeOpacity:h*(r?DR:1),lineDash:u,lineDashOffset:d,opacity:f,visible:n||s}),i.datum=a,t.setStyleProperties({fill:p,stroke:void 0,fillOpacity:g*(r?IR:1)},this.getShapeFillBBox()),t.setProperties({segments:a,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:f,visible:n||s}),t.datum=a,Vd(this,i),Vd(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(),bI(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,n]=e;n.path.clear(),Gm(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||Um(s.input.count,r.x.scale,o,c);o.isDirty()&&(i.clear(),i.cleanup());const u=h?t:[];return un(this.processedData)?i.update(u,void 0,d=>Xt(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=Da(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=Yo(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{...lm(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],y=i.resolveKeysById(this,"xValue",n)[e],m=i.resolveColumnById(this,"yValueRaw",n)[e];if(y===void 0&&!d)return;const v=this.getStyle(),x=this.makeItemStylerParams(i,n,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:f},x,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",y,f,a,u,d),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",m,f,l,u),missing:pa(m)}]},{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){Rd([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(s,n),Wm(this,r,...s),zt([t],$c),$m(this,r,{...this.getAnimationDrawingModes(),phase:"initial"},t),lt(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(),Hc(this,t,"added",this.getAnimationDrawingModes(),i),Km(this,"fill_path_properties",t,"add",o),Km(this,"stroke_path_properties",t,"add",l),lt(this,"labels",t,n);return}if(s.crossFiltering!==a.crossFiltering){h();return}const u=yR(s,a);if(u===void 0){h();return}else if(u.status==="no-op")return;Hc(this,t,void 0,this.getAnimationDrawingModes(),i),bt(this.id,"fill_path_properties",t,[o],u.fill.pathProperties),kd(this.id,"fill_path_update",t,[o],u.fill.path),bt(this.id,"stroke_path_properties",t,[l],u.stroke.pathProperties),kd(this.id,"stroke_path_update",t,[l],u.stroke.path),lt(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 At}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),y=this.cachedCallWithContext(t,f)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],y,{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 It){i=n;break}return i?.getBBox().containsPoint(e,t)?i.isPointInPath(e,t):!1}computeFocusBounds(e){return Pd(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Xm.className="AreaSeries",Xm.type="area";var AR={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Js],["image",fs],["pattern",Hi]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Yr,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",_l],["pattern",Hi]]},stroke:{$palette:"stroke"}},label:{...Yn,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:Yp,segmentation:Yh}},DI={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:Xe,dependencies:[en],options:cf,predictAxis:Uc,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:AR,create:e=>new Xm(e)},CR=.001,qm=class extends Dt{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)>CR}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}}};b([He()],qm.prototype,"direction",2),b([He()],qm.prototype,"featherRatio",2);function _d(e,t){for(const i of t){const n=i.datum;n===void 0?_.error("undefined datum"):e.addValue(i,n)}}function zd(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 Wc=class extends Pn{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};b([S],Wc.prototype,"direction",2),b([S],Wc.prototype,"width",2),b([S],Wc.prototype,"widthRatio",2);var AI=class extends Cr{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,n=Be(this.smallestDataInterval)?this.smallestDataInterval*i:0,s=Jr(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 _c||t instanceof Ic))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 Ee.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,n=this.getBandwidth(t,0)??0,s=Ee.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[Math.min(...n),Math.max(...n)]}getBarDimensions(){const e=this.getCategoryAxis(),t=this.getBandwidth(e)??0;this.ctx.seriesStateManager.updateGroupScale(this,t,e);const i=this.getGroupOffset(),n=this.getBarWidth(),s=this.getBarOffset(n);return{groupOffset:i,barOffset:s,barWidth:n}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(e){const t=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let n=0;Ee.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}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){_d(e,this.datumNodesIter())}pickNodeClosestDatum(e){return zd(this,e)}};function Jm(e,t,i,n,s){if(t.length<ms)return;const[r,a]=e,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=s;let u=ys(t,r,a,{smallestKeyInterval:o,xNeedsValueOf:l});const d=h?.find(M=>M.maxRange===u);let{indexData:p,valueData:g,negativeIndexData:f,negativeValueData:y}=bs(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||!y)throw new Error("Negative aggregation data missing in split mode");let m=Zn(u,p,d?.positiveIndices),v=Zn(u,f,d?.negativeIndices);const x=[{maxRange:u,positiveIndices:m,positiveIndexData:p,positiveValueData:g,negativeIndices:v,negativeIndexData:f,negativeValueData:y}];for(;u>64;){const M=u,D=Math.trunc(M/2),A=h?.find(C=>C.maxRange===D),I=Kr(p,g,M,{reuseIndexData:A?.positiveIndexData,reuseValueData:A?.positiveValueData}),k=Kr(f,y,M,{reuseIndexData:A?.negativeIndexData,reuseValueData:A?.negativeValueData});u=I.maxRange,p=I.indexData,g=I.valueData,m=I.midpointData??Zn(u,p,A?.positiveIndices),f=k.indexData,y=k.valueData,v=k.midpointData??Zn(u,f,A?.negativeIndices),x.push({maxRange:u,positiveIndices:m,positiveIndexData:p,positiveValueData:g,negativeIndices:v,negativeIndexData:f,negativeValueData:y})}return x.reverse(),x}function kR(e,t,i,n,s){if(t.length<ms)return;const[r,a]=e,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,targetRange:h,existingFilters:u}=s,d=ys(t,r,a,{smallestKeyInterval:o,xNeedsValueOf:l}),p=Math.min(d,io(Math.max(h,er))),g=u?.find(D=>D.maxRange===p),{indexData:f,valueData:y,negativeIndexData:m,negativeValueData:v}=bs(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(!m||!v)throw new Error("Negative aggregation data missing in split mode");const x={maxRange:p,positiveIndices:Zn(p,f,g?.positiveIndices),positiveIndexData:f,positiveValueData:y,negativeIndices:Zn(p,m,g?.negativeIndices),negativeIndexData:m,negativeValueData:v};function M(){return Jm([r,a],t,i,n,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:u})?.filter(A=>A.maxRange!==p)??[]}return{immediate:[x],computeRemaining:M}}function wR(e,t,i,n,s,r,a,o){const[l,c]=on(e,s);return Jm([l,c],t,i,n,{smallestKeyInterval:r,xNeedsValueOf:a,yNeedsValueOf:o})}var LR=ql(wR);function TR(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]=on(e,c);return Jm([d,p],r,o,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:u,existingFilters:s})}return LR(e,r,o,l,c,i.reduced?.smallestKeyInterval,h,u)}function NR(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]=on(e,h);return kR([p,g],a,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:u,yNeedsValueOf:d,targetRange:s,existingFilters:r})}var Qm=class extends Xi{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};b([S],Qm.prototype,"placement",2),b([S],Qm.prototype,"spacing",2);var nt=class extends Wc{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 ns,this.label=new Qm,this.tooltip=Ca(),this.sparklineMode=!1}};b([S],nt.prototype,"xKey",2),b([S],nt.prototype,"xName",2),b([S],nt.prototype,"yKey",2),b([S],nt.prototype,"yName",2),b([S],nt.prototype,"yFilterKey",2),b([S],nt.prototype,"stackGroup",2),b([S],nt.prototype,"normalizedTo",2),b([S],nt.prototype,"fill",2),b([S],nt.prototype,"fillOpacity",2),b([S],nt.prototype,"stroke",2),b([S],nt.prototype,"strokeWidth",2),b([S],nt.prototype,"strokeOpacity",2),b([S],nt.prototype,"lineDash",2),b([S],nt.prototype,"lineDashOffset",2),b([S],nt.prototype,"cornerRadius",2),b([S],nt.prototype,"crisp",2),b([S],nt.prototype,"styler",2),b([S],nt.prototype,"itemStyler",2),b([S],nt.prototype,"simpleItemStyler",2),b([S],nt.prototype,"shadow",2),b([S],nt.prototype,"label",2),b([S],nt.prototype,"tooltip",2),b([S],nt.prototype,"sparklineMode",2);function CI(e,t,i,n){if(t!=null){const[s,r]=t;if(s!==0||r!==1)return!1}if(Ee.is(e)){const s=e.calcBandwidth(n)-e.calcBandwidth(i);if(s>0&&s<1)return!1}if(Nn.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 ey=e=>Ka(e.yValue??0);function Kc(e,t,i){const{startingX:n,startingY:s}=ER(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&&!ey(o)?c+=o.height:!e&&ey(o)&&(l+=o.width));let p;return a.clipBBox==null?p=void 0:ey(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 OR(e,t){return{isVertical:e,calculate:i=>({x:e?i.x:i.x+i.width/2,y:e?i.y+i.height/2:i.y,width:e?i.width:0,height:e?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:t}}function Yc(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"?{...Zc(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={...Zc(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=On[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 ER(e,t){const i=t[e?"y":"x"];let n=1/0,s=0;return i?(e?s=i.scale.convert(Ee.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(Ee.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}function Zc(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 Gd(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 ty(e,t){if(t===void 0)return;const{x:i,y:n,width:s,height:r}=t;return tt.toCanvas(e.contentGroup,new U(i,n,s,r))}function kI(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=RR(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 wI(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function RR(e,t){if(!t)return!1;const i=e.scales,n=t.scales;if(!aa(i.x,n.x)||!aa(i.y,n.y))return!0;if(!wI(e)||!wI(t))return!1;const s=e.groupScale,r=t.groupScale;return!aa(s,r)}var iy=class extends AI{constructor(e){super({moduleCtx:e,propertyKeys:Zo,propertyNames:Xo,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Zc,label:Aa}}),this.properties=new nt,this.connectsToYAxis=!0,this.aggregationManager=new wd,this.phantomGroup=this.contentGroup.appendChild(new re({name:"phantom",zIndex:-1})),this.phantomSelection=mt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new re({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=mt.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey: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}),y=`bar-stack-${r}-yValues`,m=`${y}-trailing`,v=this.visible?{}:{forceValue:0},x=this.properties.allowNullKeys??!1,M=[Ir(t,g,{id:"xValue",allowNullKey:x}),Ue(i,f,{id:"yValue-raw",invalidValue:null,...v})];this.crossFilteringEnabled()&&M.push(Ue(n,f,{id:"yFilterValue",invalidValue:null,...v})),l&&M.push(...wc(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0,...v},f),...wc(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:m,separateNegative:!0,...v},f)),p&&M.push(HS,$S),Be(s)&&M.push(hd([y,m],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&M.push(dd(this.id,this.processedData)),(h||!c)&&M.push(Tc());const{dataModel:D,processedData:A}=await this.requestDataModel(e,a,{props:M,groupByKeys:c,groupByData:!c});this.aggregateData(D,A),this.smallestDataInterval=A.reduced?.smallestKeyInterval,this.largestDataInterval=A.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 o=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","key",t);return o?.def.type==="key"&&o.def.valueType==="category"?l:{domain:this.padBandExtent(l.domain)}}const n=this.yCumulativeKey(i);let s=this.domainForClippedRange(e,[n],"xValue");const r=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t).domain:void 0;r!=null&&(s=[Math.min(s[0],r[0]),Math.max(s[1],r[1])]);const a=this.getValueAxis();if(a instanceof qi&&!(a instanceof il)){const o=Number.isFinite(s[1]-s[0])?[Math.min(0,s[0]),Math.max(0,s[1])]:[];return{domain:Ri(o)}}else return{domain:Ri(s)}}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),un(t))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>NR(i.scale.type,e,t,this,n,r),computeFull:r=>TR(i.scale.type,e,t,this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Bs.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=i.hasColumnById(this,"yValue-start"),{label:h}=this.properties,u=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:d,barOffset:p,barWidth:g}=this.getBarDimensions();return{dataSource:s,rawData:s.data,xValues:i.resolveKeysById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValue-raw",n),yFilterValues:this.crossFilteringEnabled()?i.resolveColumnById(this,"yFilterValue",n):void 0,yStartValues:c?i.resolveColumnById(this,"yValue-start",n):void 0,yEndValues:c?i.resolveColumnById(this,"yValue-end",n):void 0,xScale:r,yScale:a,xAxis:e,yAxis:t,groupOffset:d,barOffset:p,barWidth:g,range:o,yReversed:t.isReversed(),bboxBottom:a.convert(0),labelSpacing:h.spacing+(typeof h.padding=="number"?h.padding:0),crisp:l==null&&(this.properties.crisp??CI(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:u,phantomNodes:u?this.contextNodeData.phantomNodeData??[]:[],nodes:u?this.contextNodeData.nodeData:[],labels:u?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()==="x",shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:h,yDomain:this.getSeriesDomain("y").domain}}computeXPosition(e,t){const i=e.xScale.convert(e.xValues[t]);return Number.isFinite(i)?i+e.groupOffset+e.barOffset:Number.NaN}prepareNodeDatumState(e,t,i,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),y=e.yScale.convert(u),m=i.width*.5*(1-(d??1)),v=e.barAlongX?Math.min(g,f):i.x+m,x=e.barAlongX?i.x+m:Math.min(g,f),M=e.barAlongX?Math.abs(f-g):i.width*(d??1),D=e.barAlongX?i.width*(d??1):Math.abs(f-g),A=e.barAlongX?Math.min(e.bboxBottom,y):i.x+m,I=e.barAlongX?i.x+m:Math.min(e.bboxBottom,y),k=e.barAlongX?Math.abs(e.bboxBottom-y):i.width*(d??1),C=e.barAlongX?i.width*(d??1):Math.abs(e.bboxBottom-y);s.datum=n.datum,s.datumIndex=i.datumIndex,s.cumulativeValue=l,s.xValue=n.xValue,s.yValue=o,s.x=A,s.y=I,s.width=k,s.height=C;const T=s.midPoint;T.x=v+M/2,T.y=x+D/2;const N=e.shouldFlipXY?D:M;s.capDefaults.lengthRatioMultiplier=N,s.capDefaults.lengthMax=N,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=v,R.y=x,R.width=M,R.height=D):s.clipBBox=new U(v,x,M,D),s.crisp=e.crisp,c==null)s.label=void 0;else{const F=ZM({isUpward:p,isVertical:!e.barAlongX,placement:e.label.placement,spacing:e.labelSpacing,rect:{x:v,y:x,width:M,height:D}}),G=s.label;G?(G.text=c,G.x=F.x,G.y=F.y,G.textAlign=F.textAlign,G.textBaseline=F.textBaseline):s.label={text:c,...F}}s.missing=pa(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?Dn:An,c=r?An:Dn,h=this.visibleRangeIndices("xValue",e.xAxis.range,a),u=h[0],d=h[1];for(let p=u;p<d;p+=1){const g=p*Qs,f=o[g+an],y=o[g+In],m=o[g+l],v=o[g+c];if(f===Gl||e.xValues[v]==null||e.xValues[m]==null)continue;const x=t(Math.trunc((f+y)/2)),M=Math.abs(t(y)-t(f))+e.barWidth;if(x-M<0||x>e.range)continue;const D=Math.abs(y-f)+1,A=Nn.is(e.xScale)?Math.min(e.xScale.bandwidth*Math.max(D-1,1)/(e.xScale.step*D),1):1;if(i.datumIndex=v,i.x=x,i.width=M,i.opacity=A,e.isStacked)i.yStart=Number(e.yStartValues[m]),i.yEnd=Number(e.yEndValues[v]),i.featherRatio=0;else{const I=Number(e.yRawValues[v]),k=Number(e.yRawValues[m]);i.yStart=0,i.yEnd=I,i.featherRatio=(r?1:-1)*n*(1-k/I)}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,a=e.isStacked?this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):-1,o=n.columnScopes.findIndex(d=>d.has(this.id)),l=n.groups,c=Nc(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<u;d+=1){const p=l[d],g=p.aggregation,f=p.datumIndices[o];if(f!=null)for(const y of f){const m=d+y,v=t(m);if(s?.[m]===!0)continue;const x=e.yRawValues[m];if(x==null)continue;const M=x>=0&&!Object.is(x,-0),D=e.isStacked?Number(e.yStartValues?.[m]):0,A=e.isStacked?Number(e.yEndValues?.[m]):x;let I=A;e.isStacked&&(I=g[a][M?1:0]),i.datumIndex=m,i.x=v,i.width=r,i.yStart=D,i.yEnd=A,i.yRange=I,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<o;l+=1){if(n?.[l]===!0)continue;const c=e.yRawValues[l];if(c==null)continue;const h=t(l),u=Number(c);i.datumIndex=l,i.x=h,i.width=s,i.yStart=0,i.yEnd=u,i.yRange=u,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(e,i)}}upsertNodeDatum(e,t){const i=e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length,n=e.yFilterValues!=null,s=n&&e.canIncrementallyUpdate&&e.phantomIndex<e.phantomNodes.length;let r,a;if(i)r=e.nodes[e.nodeIndex],this.updateNodeDatum(e,r,t),e.nodeIndex>=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:hm(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=Bd(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene),t}nodeFactory(){return new qm}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 un(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=Yo(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),y=this.filterItemStylerFillParams(r.fill)??r.fill;return{seriesId:a,...lm(n,u,o,l,d,p),datum:h,xValue:n,yValue:u,stackGroup:c,highlightState:f,...r,fill:y}}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 be(u,l,this.getStyle(!1,i))}let c=be(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(Xt(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=be(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,y=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,y,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,YM(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],y=i.resolveKeysById(this,"xValue",n)[e],m=i.resolveColumnById(this,"yValue-raw",n)[e];if(y===void 0&&!d)return;const v=this.getItemStyle(e,!1);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",y,f,r,c,d),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:o,value:this.getAxisValueText(g,"tooltip",m,f,o,c),missing:pa(m)}]},{seriesId:t,datum:f,title:l,xKey:r,xName:a,yKey:o,yName:l,legendItemName:c,stackGroup:h,...v,...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){Gd([e.datumSelection,this.phantomSelection])}animateReadyHighlight(e){Gd([e,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const{phantomSelection:n}=this,s=Yc(Kc(this.isVertical(),this.axes,"normal"),"unknown");bt(this.id,"nodes",this.ctx.animationManager,[e,n],s),lt(this,"labels",this.ctx.animationManager,t),lt(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=kI(this.id,i,this.getDatumId.bind(this),e.contextData,a,this.processedData,this.processedDataUpdated),l=a==null?"fade":"normal",c=Yc(Kc(this.isVertical(),this.axes,l),"added");bt(this.id,"nodes",this.ctx.animationManager,[i,t],c,(h,u)=>this.getDatumId(u),o),(!o||o?.changed||!aa(r.groupScale,a?.groupScale))&&(lt(this,"labels",this.ctx.animationManager,n),lt(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return Xt(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return ty(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};iy.className="BarSeries",iy.type="bar";var PR={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Js],["image",fs],["pattern",Hi]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Yn,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:Yr,xOffset:3,yOffset:3,blur:5},highlight:zl,segmentation:Yh}},LI={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:Xe,dependencies:[en],options:So,predictAxis:Uc,defaultAxes:Sv,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:PR,create:e=>new iy(e)},jd=3,FR=5,TI=.05;function VR(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,y=(h+d)/2;for(const m of t){const v=n[m],x=s[m];if(v==null||x==null)continue;const M=ln(v,r.min,r.max,o),D=ln(x,a.min,a.max,l),A=(M-f)**2+(D-y)**2;A<g&&(g=A,p=m)}return p}function BR(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;for(const g of t){const f=n[g],y=s[g];if(f==null||y==null)continue;const m=ln(f,r.min,r.max,o),v=ln(y,a.min,a.max,l);m>=c&&m<=u&&v>=h&&v<=d&&(p+=1)}return p}function _R(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 m of t){const v=n[m],x=s[m];if(v==null||x==null)continue;const M=ln(v,r.min,r.max,o),D=ln(x,a.min,a.max,l),A=(M>g?1:0)+(D>f?2:0),I=p[A];I.indices.push(m),I.x0=Math.min(I.x0,M),I.y0=Math.min(I.y0,D),I.x1=Math.max(I.x1,M),I.y1=Math.max(I.y1,D)}const y=[];for(const m of p){const{indices:v,x0:x,x1:M,y0:D,y1:A}=m;if(v.length===0)continue;const I=ny(e,v,{x0:x,y0:D,x1:M,y1:A});y.push(I)}return y}function ny(e,t,i){const{x0:n,y0:s,x1:r,y1:a}=i;let l=t.length<FR&&r-n<TI&&a-s<TI||n===r&&s===a?null:_R(e,t,i);if(l?.length===1)return l[0];l?.length===0&&(l=null);const c=Math.hypot(r-n,a-s),h=VR(e,t,i);return{scale:c,x0:n,y0:s,x1:r,y1:a,indices:t,primaryDatumIndex:h,children:l}}function zR(e,t,i,n,s,r,a){const[o,l]=e,[c,h]=t,[u,d]=r,{xNeedsValueOf:p,yNeedsValueOf:g}=a,f={xValues:i,yValues:n,xDomain:{min:o,max:l},yDomain:{min:c,max:h},xNeedsValueOf:p,yNeedsValueOf:g},y=[];if(s!=null&&d>u){const m=Array.from({length:jd},()=>[]);for(let v=0;v<s.length;v+=1){const M=(s[v]-u)/(d-u),D=Math.trunc(M*jd);D>=0&&D<jd&&m[D].push(v)}for(let v=0;v<m.length;v+=1){const x=m[v],M=ny(f,x,{x0:0,y0:0,x1:1,y1:1});if(M!=null){const D=v/jd;y.push({sizeRatio:D,node:M})}}}else{const m=i.map((x,M)=>M),v=ny(f,m,{x0:0,y0:0,x1:1,y1:1});v!=null&&y.push({sizeRatio:0,node:v})}return y.length>0?{xValues:i,yValues:n,xd0:o,xd1:l,yd0:c,yd1:h,filters:y,xNeedsValueOf:p,yNeedsValueOf:g}:void 0}function GR(e,t,i,n,s,r,a,o,l,c){const[h,u]=on(e,r),[d,p]=on(t,a);return zR([h,u],[d,p],i,n,s,[o[0],o[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function jR(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 GR(e,t,o,l,c,h,u,d,p,g)}function NI(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:y,xd1:m,yd0:v,yd1:x,xNeedsValueOf:M,yNeedsValueOf:D}=t,A=1/Math.min(a/(c-l),o/(u-h)),I={xValues:g,yValues:f,xDomain:{min:y,max:m},yDomain:{min:v,max:x},xNeedsValueOf:M,yNeedsValueOf:D};for(const{sizeRatio:k,node:C}of t.filters){const T=.5*(d+k*(p-d)),N=T*A,R=e*N,F=l-T/a,G=c+T/a,V=h-T/o,H=u+T/o,q=[C];for(;q.length>0;){const z=q.pop();if(!(z.x1<F||z.x0>G||z.y1<V||z.y0>H))if(e!==1&&z.scale<=R)n!=null&&(n.count+=1),s?.push({datumIndex:z.primaryDatumIndex,count:z.indices.length,area:(z.x1-z.x0)*(z.y1-z.y0),dilation:te(1,z.scale/N,e)});else if(z.children==null){const{indices:ie}=z;if(n!=null){const pe=z.x0>=l&&z.x1<=c&&z.y0>=h&&z.y1<=u?ie.length:BR(I,ie,{x0:l,y0:h,x1:c,y1:u});n.count+=pe}r?.push(...ie)}else q.push(...z.children)}}}function Hd(e,t,i){const n={count:0};return NI(e,t,i,n,void 0,void 0),n.count}var HR=100,$R=12;function UR(e,t,i){if(Hd(1,e,t)<=i)return 1;let n=1,s=2;for(;Hd(s,e,t)>i&&s<HR;)n*=2,s*=2;for(let r=0;r<$R;r+=1){const a=(s+n)/2;Hd(a,e,t)>i?n=a:s=a}return(n+s)/2}function WR(e,t,i){const n=[],s=[];return NI(e,t,i,void 0,n,s),{groupedAggregation:n,singleDatumIndices:s}}var sy=class extends xi{constructor(){super(...arguments),this.maxSize=30}};b([S,Y()],sy.prototype,"maxSize",2),b([S,of()],sy.prototype,"domain",2);var OI=class extends Xi{constructor(){super(...arguments),this.placement="top"}};b([S],OI.prototype,"placement",2);var _e=class extends Pn{constructor(){super(...arguments),this.label=new OI,this.tooltip=Ca(),this.maxRenderedItems=1/0,this.marker=new sy}};b([S],_e.prototype,"xKey",2),b([S],_e.prototype,"yKey",2),b([S],_e.prototype,"sizeKey",2),b([S],_e.prototype,"labelKey",2),b([S],_e.prototype,"xFilterKey",2),b([S],_e.prototype,"yFilterKey",2),b([S],_e.prototype,"sizeFilterKey",2),b([S],_e.prototype,"xName",2),b([S],_e.prototype,"yName",2),b([S],_e.prototype,"sizeName",2),b([S],_e.prototype,"labelName",2),b([S],_e.prototype,"title",2),b([oi("marker.shape")],_e.prototype,"shape",2),b([oi("marker.size")],_e.prototype,"size",2),b([oi("marker.maxSize")],_e.prototype,"maxSize",2),b([oi("marker.domain")],_e.prototype,"domain",2),b([oi("marker.fill")],_e.prototype,"fill",2),b([oi("marker.fillOpacity")],_e.prototype,"fillOpacity",2),b([oi("marker.stroke")],_e.prototype,"stroke",2),b([oi("marker.strokeWidth")],_e.prototype,"strokeWidth",2),b([oi("marker.strokeOpacity")],_e.prototype,"strokeOpacity",2),b([oi("marker.lineDash")],_e.prototype,"lineDash",2),b([oi("marker.lineDashOffset")],_e.prototype,"lineDashOffset",2),b([oi("marker.itemStyler")],_e.prototype,"itemStyler",2),b([S],_e.prototype,"styler",2),b([S],_e.prototype,"label",2),b([S],_e.prototype,"tooltip",2),b([S],_e.prototype,"maxRenderedItems",2);function ry(e,t,i,n){const s=e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length;let r;return s?(r=e.nodes[e.nodeIndex],n(e,r,t)):(r=i(e,t),r!=null&&e.nodes.push(r)),e.nodeIndex++,r}var KR=class extends fm{constructor(e,t,i,n){super(e,t,i,n),this.sizeKey=n.properties.sizeKey}},$d=class extends Cr{constructor(e){super({moduleCtx:e,propertyKeys:{...Zo,label:["labelKey"],size:["sizeKey"]},propertyNames:{...Xo,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:Aa,datum:Ed},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=KR,this.properties=new _e,this.dataAggregation=void 0,this.sizeScale=new va,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:n,yScaleType:s}=this.getScaleInformation({xScale:t,yScale:i}),r=this.sizeScale.type,{xKey:a,yKey:o,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:u,labelKey:d,marker:p}=this.properties,g=this.properties.allowNullKeys??!1,{dataModel:f,processedData:y}=await this.requestDataModel(e,this.data,{props:[Ue(a,n,{id:"xValue",allowNullKey:g}),Ue(o,s,{id:"yValue",allowNullKey:g}),...c==null?[]:[Ue(c,n,{id:"xFilterValue"})],...h==null?[]:[Ue(h,s,{id:"yFilterValue"})],...u==null?[]:[Ue(u,r,{id:"sizeFilterValue"})],...l?[Ue(l,r,{id:"sizeValue"})]:[],...d?[Ue(d,"category",{id:"labelValue"})]:[]]}),m=l?f.resolveProcessedDataIndexById(this,"sizeValue"):void 0,v=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=v??(m==null?void 0:y.domain.values[m])??[],this.dataAggregation=this.aggregateData(f,y),this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:n,sizeScale:s}=this,{size:r,sizeKey:a}=n,o=this.axes.x.scale.convert(e),l=a==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?r:s.convert(l[i]))*t;return[o-h,o+h]}yCoordinateRange(e,t,i){const{properties:n,sizeScale:s}=this,{size:r,sizeKey:a}=n,o=this.axes.y.scale.convert(e[0]),l=a==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?r:s.convert(l[i]))*t;return[o-h,o+h]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};const n={x:"xValue",y:"yValue"},s=n[e],r=t.resolveProcessedDataDefById(this,s),a=t.getDomain(this,s,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return{domain:a.domain};const l=n[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[s],l);return{domain:Ri(Jr(c))}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){const{dataAggregation:n,axes:s}=this,r=s.x,a=s.y;if(n==null||r==null||a==null)return this.countVisibleItems("xValue",["yValue"],e,t,i);const o=this.aggregationOptions(r,a,e,t??[0,1]);return Hd(0,n,o)}aggregateData(e,t){if(t.type==="grouped"||t.input.count<=this.properties.maxRenderedItems)return;const i=this.axes.x,n=this.axes.y;if(i==null||n==null)return;const s=i.scale,r=n.scale;if(!(!Ee.is(s)||!Ee.is(r)))return jR(s.type,r.type,e,t,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(e,t,i=e.visibleRange,n=t.visibleRange){const{processedData:s,dataModel:r}=this,{sizeKey:a}=this.properties,[o,l]=this.getSizeRange(),c=Math.abs(e.range[1]-e.range[0]),h=Math.abs(t.range[1]-t.range[0]),u=Math.max(o,1),d=a?Math.max(l,1):u,p=e.scale,g=t.scale;return s!=null&&r!=null&&(Ee.is(p)&&(i=Du(i,p.domain.map(Kt),r.getDomain(this,"xValue","value",s).domain.map(Kt))),Ee.is(g)&&(n=Du(n,g.domain.map(Kt),r.getDomain(this,"yValue","value",s).domain.map(Kt)))),{xRange:c,yRange:h,minSize:u,maxSize:d,xVisibleRange:i,yVisibleRange:n}}createNodeDatumContext(e,t){const{dataModel:i,processedData:n,sizeScale:s,visible:r}=this;if(!i||!n)return;const a=n.dataSources.get(this.id)?.data;if(a==null)return;const{xKey:o,yKey:l,sizeKey:c,xFilterKey:h,yFilterKey:u,sizeFilterKey:d,labelKey:p,xName:g,yName:f,sizeName:y,labelName:m,label:v,legendItemName:x,marker:M}=this.properties,D=e.scale,A=t.scale,I=n.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let k;p?k=[]:c?k=i.getDomain(this,"sizeValue","value",n).domain:k=[];const C=i.resolveColumnById(this,"xValue",n);return{xAxis:e,yAxis:t,rawData:a,xValues:C,xDataValues:C,yDataValues:i.resolveColumnById(this,"yValue",n),sizeDataValues:c==null?void 0:i.resolveColumnById(this,"sizeValue",n),labelDataValues:p==null?void 0:i.resolveColumnById(this,"labelValue",n),xFilterDataValues:h==null?void 0:i.resolveColumnById(this,"xFilterValue",n),yFilterDataValues:u==null?void 0:i.resolveColumnById(this,"yFilterValue",n),sizeFilterDataValues:d==null?void 0:i.resolveColumnById(this,"sizeFilterValue",n),xScale:D,yScale:A,sizeScale:s,xOffset:(D.bandwidth??0)/2,yOffset:(A.bandwidth??0)/2,xKey:o,yKey:l,sizeKey:c,labelKey:p,xName:g,yName:f,sizeName:y,labelName:m,legendItemName:x,labelsEnabled:v.enabled,labelPlacement:v.placement,labelAnchor:At.anchor(M.shape),labelTextDomain:k,labelPadding:Ho(v),labelTextMeasurer:vi(v),label:v,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:r,canIncrementallyUpdate:I,nodes:I?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(e){this.sizeScale.range=this.getSizeRange();const t={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,x:0,y:0,selected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0},{dataAggregation:i}=this;i==null?this.createNodeDataSimple(e,t):this.createNodeDataWithAggregation(e,t,e.xAxis,e.yAxis,i)}initializeResult(e){const{marker:t}=this.properties;return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,styles:Fd(this,this.properties,t)}}upsertBubbleNodeDatum(e,t,i){this.prepareNodeDatumState(e,t,i)&&ry(e,{scratch:t,datumIndex:i},(n,s)=>{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;n<i;n++)t.count=1,t.dilation=1,t.area=0,this.upsertBubbleNodeDatum(e,t,n)}createNodeDataWithAggregation(e,t,i,n,s){const{maxRenderedItems:r}=this.properties,a=this.aggregationOptions(i,n),o=UR(s,a,r),{groupedAggregation:l,singleDatumIndices:c}=WR(o,s,a);for(const{datumIndex:h,count:u,dilation:d,area:p}of l)t.count=u,t.dilation=d,t.area=p,this.upsertBubbleNodeDatum(e,t,h);for(const h of c)t.count=1,t.dilation=1,t.area=0,this.upsertBubbleNodeDatum(e,t,h)}prepareNodeDatumState(e,t,i){const n=e.rawData[i],s=e.xDataValues[i],r=e.yDataValues[i],a=this.properties.allowNullKeys??!1;if((s===void 0||r===void 0)&&!a)return;const o=e.sizeDataValues?.[i],l=e.xScale.convert(s)+e.xOffset,c=e.yScale.convert(r)+e.yOffset;if(!Number.isFinite(l)||!Number.isFinite(c))return;let h;e.xFilterDataValues!=null&&e.yFilterDataValues!=null&&(h=e.xFilterDataValues[i]===s&&e.yFilterDataValues[i]===r,e.sizeFilterDataValues!=null&&h&&(h=e.sizeFilterDataValues[i]===o));let u;e.labelsEnabled?u=this.computeLabel(e,n,r,o,i):u={text:"",width:0,height:0};const d=o==null?e.sizeScale.range[0]:e.sizeScale.convert(o);return t.datum=n,t.xDatum=s,t.yDatum=r,t.sizeValue=o,t.x=l,t.y=c,t.selected=h,t.nodeLabel=u,t.markerSize=d,t}computeLabel(e,t,i,n,s){let r,a,o;e.labelKey&&e.labelDataValues?(r=e.labelDataValues[s],a=e.labelKey,o="label"):e.sizeKey?(r=n,a=e.sizeKey,o="size"):(r=i,a=e.yKey,o="y");const l=this.getLabelText(r,t,a,o,e.labelTextDomain,e.label,{value:r,datum:t,xKey:e.xKey,yKey:e.yKey,sizeKey:e.sizeKey,labelKey:e.labelKey,xName:e.xName,yName:e.yName,sizeName:e.sizeName,labelName:e.labelName,legendItemName:e.legendItemName});let{width:c,height:h}=ae(l)?xs(l,e.label):e.labelTextMeasurer.measureLines(String(l));return c+=e.labelPadding.left+e.labelPadding.right,h+=e.labelPadding.bottom+e.labelPadding.top,{text:l,width:c,height:h}}createSkeletonNodeDatum(e,t,i){return{series:this,yKey:e.yKey,xKey:e.xKey,datum:void 0,datumIndex:0,xValue:void 0,yValue:void 0,sizeValue:void 0,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},point:{x:0,y:0,size:0},midPoint:{x:0,y:0},label:{text:"",width:0,height:0},anchor:e.labelAnchor,placement:e.labelPlacement,count:1,dilation:1,area:0,selected:void 0}}updateNodeDatum(e,t,i,n){const s=t,{x:r,y:a,markerSize:o,dilation:l}=i;s.datum=i.datum,s.datumIndex=n,s.xValue=i.xDatum,s.yValue=i.yDatum,s.sizeValue=i.sizeValue,s.selected=i.selected,s.count=i.count,s.dilation=i.dilation,s.area=i.area,s.label=i.nodeLabel,s.anchor=e.labelAnchor,s.placement=e.labelPlacement;const c=s.point;c.x=r,c.y=a,c.size=Math.sqrt(l)*o;const h=s.midPoint;h.x=r,h.y=a}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;if(this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),!un(this.processedData))return i.update(t);const{sizeKey:n}=this.properties;let s;return n&&(s=r=>Xt(r.xValue,r.yValue,r.sizeValue,Ze(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),y={...c.style??t.styles[f]};if(y.size=u,g>1){const m=y.fillOpacity??0,v=.269669+683e-6*d+-37.534348*p+.004449*d*p+-0*d**2+44.428603*p**2;y.fillOpacity=te(m/g,m/.1*v,1)}this.applyMarkerStyle(y,l,c.point,r,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(s,y),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=Da(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,y=Yo(e??0);return this.type==="bubble"?{highlightState:y,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:y,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:y,tooltip:m,marker:v,legendItemName:x}=r,M=s.x,D=s.y;if(!i||!n||!M||!D)return;const A=n.dataSources.get(this.id)?.data?.[e],I=i.resolveColumnById(this,"xValue",n)[e],k=i.resolveColumnById(this,"yValue",n)[e],C=this.properties.allowNullKeys??!1;if(I===void 0&&!C)return;const T=[];if(this.isLabelEnabled()&&g!=null){const R=i.resolveColumnById(this,"labelValue",n)[e],F=o.format(this.callWithContext.bind(this),{type:"category",value:R,datum:A,seriesId:t,legendItemName:x,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});T.push({label:f,fallbackLabel:g,value:F??ao(R)})}if(T.push({label:c,fallbackLabel:l,value:this.getAxisValueText(M,"tooltip",I,A,l,x,C),missing:pa(I,C)},{label:u,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",k,A,h,x,C),missing:pa(k,C)}),d!=null){const R=i.resolveColumnById(this,"sizeValue",n)[e];if(R!=null){const F=i.getDomain(this,"sizeValue","value",n).domain,G=o.format(this.callWithContext.bind(this),{type:"number",value:R,datum:A,seriesId:t,legendItemName:x,key:d,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:F,fractionDigits:void 0,visibleDomain:void 0});T.push({label:p,fallbackLabel:d,value:G??ao(R)})}}const N=this.getMarkerStyle(v,{datum:A,datumIndex:e},{xKey:l,yKey:h,sizeKey:d,labelKey:g},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(m,{title:y,symbol:this.legendItemSymbol(),data:T},{seriesId:t,datum:A,title:h,xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:f,legendItemName:x,...N,...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}){bR(this,this.ctx.animationManager,e),lt(this,"labels",this.ctx.animationManager,t)}resetDatumAnimation(e){Rd([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new At}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 Pd(this,e)}hasItemStylers(){const{styler:e,itemStyler:t,marker:i,label:n}=this.properties;return!!(e??t??i.itemStyler??n.itemStyler)}initQuadTree(e){_d(e,this.datumNodesIter())}pickNodeDataClosestDatum(e){return zd(this,e)}};$d.className="BubbleSeries",$d.type="bubble";var EI={title:O,domain:ee(E),maxSize:w,showInMiniChart:L,label:{placement:P("top","right","bottom","left"),...Pe},tooltip:ke,styler:Ie({...Mn,maxSize:w}),maxRenderedItems:E,...Se,...K(Mn,["enabled"]),highlight:st(We,We)},Ud={...EI,...Sn,type:Z(Ge("bubble")),xKey:Z(O),yKey:Z(O),sizeKey:Z(O),labelKey:O,xName:O,yName:O,sizeName:O,labelName:O,legendItemName:O,xKeyAxis:O,yKeyAxis:O,highlight:st(We,We)};Ud.xFilterKey=J(O),Ud.yFilterKey=J(O),Ud.sizeFilterKey=J(O);var YR={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",_l],["image",fs],["pattern",Hi]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Yn,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:zl}},RI={type:"series",name:"bubble",chartType:"cartesian",version:Xe,dependencies:[en],options:Ud,predictAxis:Zm,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:YR,create:e=>new $d(e)},wt=class extends Pn{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 ns,this.label=new Xi,this.tooltip=Ca()}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}}};b([S],wt.prototype,"xKey",2),b([S],wt.prototype,"yKey",2),b([S],wt.prototype,"xName",2),b([S],wt.prototype,"yName",2),b([S],wt.prototype,"fill",2),b([S],wt.prototype,"fillOpacity",2),b([S],wt.prototype,"stroke",2),b([S],wt.prototype,"strokeWidth",2),b([S],wt.prototype,"strokeOpacity",2),b([S],wt.prototype,"lineDash",2),b([S],wt.prototype,"lineDashOffset",2),b([S],wt.prototype,"cornerRadius",2),b([S],wt.prototype,"areaPlot",2),b([S],wt.prototype,"bins",2),b([S],wt.prototype,"aggregation",2),b([S],wt.prototype,"binCount",2),b([S],wt.prototype,"shadow",2),b([S],wt.prototype,"label",2),b([S],wt.prototype,"tooltip",2);var PI=10,ay=class extends Cr{constructor(e){super({moduleCtx:e,propertyKeys:Zo,propertyNames:Xo,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:Zc,label:Aa}}),this.properties=new wt,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(e){const t=po(e[0],e[1],PI).ticks,i=go(e[0],e[1],PI),[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;a<n;a++){const o=Math.round((e+a*i)*r)/r;let l=Math.round((e+(a+1)*i)*r)/r;a===n-1&&(l=Math.max(l,t)),s[a]=[o,l]}return s}calculatePrecision(e){let t=10;if(Number.isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const 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=[Ir(i,l),xN];if(n){let v=LS("groupAgg",{visible:t});r==="count"||(r==="sum"?v=VT("groupAgg",{visible:t}):r==="mean"&&(v=_T("groupAgg",{visible:t}))),s&&(v=TS("groupAgg",v)),u.push(Ue(n,c,{invalidValue:void 0,...h}),v)}else{u.push(mN("count"));let v=LS("groupAgg",{visible:t});s&&(v=TS("groupAgg",v)),u.push(v)}let d=[];const p=v=>{const x=Ri(v.domain.keys[0]);if(x.length===0)return v.domain.groups=[],()=>[];const M=ji(this.properties.binCount)?this.calculateNiceBins(x,this.properties.binCount):this.properties.bins??this.deriveBins(x),D=M.length;return d=[...M],A=>{let I=A[0];if(yn(I)&&(I=I.getTime()),!ji(I))return[];for(let k=0;k<D;k++){const C=M[k];if(I>=C[0]&&I<C[1]||k===D-1&&I<=C[1])return C}return[]}},{dataModel:g,processedData:f}=await this.requestDataModel(e,this.data,{props:u,groupByFn:p}),y=f,m=new Map;for(const[v,x]of y.groups.entries()){const M=x.keys;m.set(Xt(...M),{group:x,groupIndex:v})}this.calculatedBins=d.map(v=>{const x=m.get(Xt(...v));if(x){const{group:M,groupIndex:D}=x,[[A,I]=[0,0]]=M.aggregation,k=[...g.forEachDatum(this,y,M,D)],C=this.frequency(M),T=A+I;return{domain:v,datum:k,groupIndex:D,frequency:C,total:T}}else return{domain:v,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return{domain:[]};const 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]=Nt([r.convert(d),r.convert(p)]);if(f>=t&&g<=i){const y=h+u;o=Math.max(o,y)}}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),y=s.convert(0),m=s.convert(h),v=Math.abs(f-g),x=Math.abs(m-y),M=Math.min(g,f),D=Math.min(y,m);u.datumIndex=l,u.datum=o,u.aggregatedValue=h,u.frequency=c,u.domain=a,u.x=M,u.y=D,u.xValue=g,u.yValue=m,u.width=v,u.height=x,u.midPoint?(u.midPoint.x=M+v/2,u.midPoint.y=D+x/2):u.midPoint={x:M+v/2,y:D+x/2},u.topLeftCornerRadius=!r,u.topRightCornerRadius=!r,u.bottomRightCornerRadius=r,u.bottomLeftCornerRadius=r,u.label=this.createLabelData(e,i,M,D,v,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)ry(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:hm(this.getItemStyle.bind(this))}}finalizeNodeData(e){super.finalizeNodeData(e),e.nodes.sort((t,i)=>t.x-i.x)}nodeFactory(){return new Dt}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return un(this.processedData)?i.update(t,void 0,n=>Xt(...n.domain)):i.update(t)}getItemStyle(e,t,i){const{properties:n}=this,s=this.getHighlightStyle(t,e,i);return be(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=Da(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 re&&_d(e,t.children())}pickNodeClosestDatum(e){return zd(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:y,keys:m}=f,[[v,x]=[0,0]]=y,M=this.frequency(f),D=m,[A,I]=D,k=v+x,C={data:[...i.forEachDatum(this,n,f,e)],aggregatedValue:k,frequency:M,domain:D},T=[{label:l,fallbackLabel:o,value:`${this.getAxisValueText(p,"tooltip",A,C,o,d)} - ${this.getAxisValueText(p,"tooltip",I,C,o,d)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(g,"tooltip",M,C,c,d)}];if(c!=null){let N;switch(r.aggregation){case"sum":N=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":N=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":N=a.t("seriesHistogramTooltipCount",{yName:h??c});break}T.push({label:N,value:this.getAxisValueText(g,"tooltip",k,C,c,d)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:T},{seriesId:t,datum:C,title:h,xKey:o,xName:l,yKey:c,yName:h,xRange:[A,I],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:Fe(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){Gd([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Yc(Kc(!0,this.axes,"normal"),"unknown");bt(this.id,"datums",this.ctx.animationManager,[e],i),lt(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Yc(Kc(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};bt(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(n,s)=>Xt(...s.domain),i),i?.changed&<(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return ty(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.label.itemStyler!=null}};ay.className="HistogramSeries",ay.type="histogram";var FI={showInMiniChart:L,cornerRadius:w,label:Pe,tooltip:ke,shadow:Kn,...Se,...j,...B,...W,highlight:st(We,We),areaPlot:L,aggregation:P("count","sum","mean"),bins:ee(ee(E)),binCount:w},ZR={...Sn,...FI,type:Z(Ge("histogram")),xKey:Z(O),yKey:O,xKeyAxis:O,yKeyAxis:O,xName:O,yName:O},XR={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Js],["image",fs],["pattern",Hi]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Yn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Yr,xOffset:3,yOffset:3,blur:5},highlight:zl}},VI={type:"series",name:"histogram",chartType:"cartesian",version:Xe,dependencies:[en],options:ZR,predictAxis:Uc,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:XR,create:e=>new ay(e)},qR=10;function Wd(e,t,i,n,s,r,a,o){const l=e[r];if(l===void 0)return!1;const c=Number.isFinite(t)?ln(l,t,i,a):no(r,o),h=Xh(c,s);return r===n[h+an]||r===n[h+In]||r===n[h+Dn]||r===n[h+An]}function BI(e,t,i,n,s,r,a,o){let l=0;for(let u=0;u<a;u++)Wd(e,t,i,n,s,u,r,a)&&l++;const c=o?.length===l?o:new Uint32Array(l);let h=0;for(let u=0;u<a;u++)Wd(e,t,i,n,s,u,r,a)&&(c[h++]=u);return c}function JR(e,t,i,n,s,r,a,o,l){let c=0;for(const d of e)Wd(t,i,n,s,r,d,a,o)&&c++;const h=l?.length===c?l:new Uint32Array(c);let u=0;for(const d of e)Wd(t,i,n,s,r,d,a,o)&&(h[u++]=d);return h}function oy(e,t,i,n){const s=t.length;if(s<ms)return;const[r,a]=e,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:c}=n;let h=ys(t,r,a,{xNeedsValueOf:o});const u=c?.find(y=>y.maxRange===h);let{indexData:d,valueData:p}=bs(t,i,i,r,a,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),g=BI(t,r,a,d,h,o,s,u?.indices);const f=[{maxRange:h,indices:g,indexData:d,valueData:p}];for(;g.length>qR&&h>64;){const y=h,m=Math.trunc(y/2),v=c?.find(M=>M.maxRange===m),x=Kr(d,p,y,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=x.maxRange,d=x.indexData,p=x.valueData,g=JR(g,t,r,a,d,h,o,s,v?.indices),f.push({maxRange:h,indices:g,indexData:d,valueData:p})}return f.reverse(),f}function QR(e,t,i,n){const s=t.length;if(s<ms)return;const[r,a]=e,{xNeedsValueOf:o,yNeedsValueOf:l,targetRange:c,existingFilters:h}=n,u=ys(t,r,a,{xNeedsValueOf:o}),d=Math.min(u,io(Math.max(c,er))),p=h?.find(x=>x.maxRange===d),{indexData:g,valueData:f}=bs(t,i,i,r,a,d,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),y=BI(t,r,a,g,d,o,s,p?.indices),m={maxRange:d,indices:y,indexData:g,valueData:f};function v(){return oy([r,a],t,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(M=>M.maxRange!==d)??[]}return{immediate:[m],computeRemaining:v}}function eP(e,t,i,n,s,r){const[a,o]=on(e,n);return oy([a,o],t,i,{xNeedsValueOf:s,yNeedsValueOf:r})}var tP=ql(eP);function iP(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]=on(e,l);return oy([u,d],a,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:r})}return tP(e,a,o,l,c,h)}function nP(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]=on(e,c);return QR([d,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:u,targetRange:r,existingFilters:a})}var vt=class extends Pn{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new eo,this.marker=new xi,this.label=new Xi,this.tooltip=Ca(),this.connectMissingData=!1,this.sparklineMode=!1}};b([S],vt.prototype,"xKey",2),b([S],vt.prototype,"yKey",2),b([S],vt.prototype,"xName",2),b([S],vt.prototype,"yName",2),b([S],vt.prototype,"yFilterKey",2),b([S],vt.prototype,"stackGroup",2),b([S],vt.prototype,"normalizedTo",2),b([S],vt.prototype,"title",2),b([S],vt.prototype,"stroke",2),b([S],vt.prototype,"strokeWidth",2),b([S],vt.prototype,"strokeOpacity",2),b([S],vt.prototype,"lineDash",2),b([S],vt.prototype,"lineDashOffset",2),b([S],vt.prototype,"interpolation",2),b([S],vt.prototype,"styler",2),b([S],vt.prototype,"marker",2),b([S],vt.prototype,"label",2),b([S],vt.prototype,"tooltip",2),b([S],vt.prototype,"connectMissingData",2),b([S],vt.prototype,"sparklineMode",2);var sP=.25,ly=class extends Cr{constructor(e){super({moduleCtx:e,propertyKeys:Zo,propertyNames:Xo,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:Ym({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Aa,datum:(t,i)=>({...Ed(t),...$c(t,i)})},clipFocusBox:!1}),this.properties=new vt,this.aggregationManager=new wd}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,yFilterKey: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,y={invalidValue:null};l&&f&&(y.invalidValue=0),f&&!i&&(y.forceValue=0);const m={value:`area-stack-${n}-yValue`,marker:`area-stack-${n}-yValues-marker`},v=[],x=this.properties.allowNullKeys??!1;(!d||f)&&v.push(Ir(r,p,{id:"xKey",allowNullKey:x})),v.push(Ue(r,p,{id:"xValue",allowNullKey:x}),Ue(a,g,{id:"yValueRaw",...y,invalidValue:void 0})),o!=null&&v.push(Ue(o,g,{id:"yFilterRaw"})),f&&v.push(...wc(a,"normal",{id:"yValueCumulative",...y,groupId:m.marker},g)),Hn(c)&&v.push(Ue(a,g,{id:"yValue",...y,groupId:m.value}),hd(Object.values(m),c)),this.needsDataModelDiff()&&(v.push(Tc(d?["xValue"]:void 0)),this.processedData&&v.push(dd(this.id,this.processedData)));const{dataModel:M,processedData:D}=await this.requestDataModel(e,t,{props:v,groupByKeys:f,groupByData:!f});this.aggregateData(M,D),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(e,t){const{marker:i}=this.properties,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(Jr(o.domain))}}const r=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&s instanceof qi&&!(s instanceof il)){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"||un(t))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>nP(i.scale.type,e,t,this.yCumulativeKey(t),this,n,r),computeFull:r=>iP(i.scale.type,e,t,this.yCumulativeKey(t),this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&Bs.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.yFilterKey?i.resolveColumnById(this,"yFilterRaw",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.nodeIndex<e.nodes.length){const r=e.nodes[e.nodeIndex];r.datum=t.datum,r.datumIndex=i,r.point={x:t.x,y:t.y,size:e.size},r.midPoint={x:t.x,y:t.y},r.cumulativeValue=t.yCumulative,r.yValue=t.yDatum,r.xValue=t.xDatum,r.labelText=n,r.selected=t.selected}else e.nodes.push({series:this,datum:t.datum,datumIndex:i,yKey:e.yKey,xKey:e.xKey,point:{x:t.x,y:t.y,size:e.size},midPoint:{x:t.x,y:t.y},cumulativeValue:t.yCumulative,yValue:t.yDatum,xValue:t.xDatum,capDefaults:e.capDefaults,labelText:n,selected:t.selected});e.nodeIndex++}this.updateSpanPoints(e,t)}}updateSpanPoints(e,t){const i=e.spanPoints.at(-1);if(t.yDatum!=null){const n={point:{x:t.x,y:t.y},xDatum:t.xDatum,yDatum:t.yCumulative};Array.isArray(i)?i.push(n):i==null?e.spanPoints.push([n]):(i.skip+=1,e.spanPoints.push([n]))}else e.connectMissingData||(Array.isArray(i)||i==null?e.spanPoints.push({skip:0}):i.skip+=1)}populateNodeData(e){const t={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0},i=e.dataAggregationFilter?.indices;let[n,s]=this.visibleRangeIndices("xValue",e.xAxis.range,i);n=Math.max(n-1,0),s=Math.min(s+1,i?.length??e.xValues.length),this.processedData.input.count<1e3&&(n=0,s=this.processedData.input.count);for(let r=n;r<s;r+=1)this.handleDatum(e,t,i?.[r]??r)}initializeResult(e){return{itemId:e.yKey,nodeData:e.nodes,labelData:e.nodes,strokeData:{itemId:e.yKey,spans:[]},scales:this.calculateScaling(),visible:this.visible,crossFiltering:!1,styles:Fd(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){const i=e.spanPoints.flatMap(n=>Array.isArray(n)?jc(n,this.properties.interpolation):[]);return t.strokeData={itemId:e.yKey,spans:i},t.crossFiltering=e.selectionValues?.some((n,s)=>n===e.yRawValues[s])??!1,t.segments=Bd(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=this.contextNodeData?.crossFiltering===!0,r=be(this.getHighlightStyle(),this.getStyle()),{strokeWidth:a,stroke:o,strokeOpacity:l,lineDash:c,lineDashOffset:h,opacity:u}=r,d=this.contextNodeData?.segments;t.setProperties({segments:d,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:u,stroke:o,strokeWidth:a,strokeOpacity:l*(s?sP:1),lineDash:c,lineDashOffset:h}),t.datum=d,n||(t.visible=i),Vd(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||Um(s.input.count,r.x.scale,o)?t:[],o.isDirty()&&(i.clear(),i.cleanup()),un(this.processedData)?i.update(t,void 0,c=>Xt(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=Da(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=Yo(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{...lm(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],y=i.resolveColumnById(this,"xValue",n)[e],m=i.resolveColumnById(this,"yValueRaw",n)[e];if(y===void 0&&!d)return;const v=this.getStyle(),x=this.makeItemStylerParams(i,n,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:f},x,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",y,f,a,u,d),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",m,f,l,u),missing:pa(m)}]},{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(),Gm(n,i),n.markDirty("LineSeries")}resetDatumAnimation(e){Rd([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:n,contextData:s,paths:r}=e,{animationManager:a}=this.ctx;this.updateLinePaths(r,s),Wm(this,a,...r),zt([t],$c),$m(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),lt(this,"labels",a,i),lt(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(),Hc(this,t,"added",this.getAnimationDrawingModes(),i),ks(this.id,"path_properties",t,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),lt(this,"labels",t,n),lt(this,"annotations",t,...s);return}if(r.crossFiltering!==o.crossFiltering){h();return}const u=mR(r,o,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(u===void 0){h();return}else if(u.status==="no-op")return;bt(this.id,"path_properties",t,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(a,r):u.status==="removed"?this.updateLinePaths(a,o):kd(this.id,"path_update",t,[l],u.stroke.path),u.hasMotion&&(Hc(this,t,void 0,this.getAnimationDrawingModes(),i),lt(this,"labels",t,n),lt(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 At}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 Pd(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};ly.className="LineSeries",ly.type="line";var rP={series:{stroke:Kp,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",_l],["image",fs],["pattern",Hi]]},stroke:{$palette:"stroke"}},label:{...Yn,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:Yp,segmentation:Yh}},_I={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:Xe,dependencies:[en],options:dc,predictAxis:Uc,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:rP,create:e=>new ly(e)},cy=class extends $d{};cy.className="ScatterSeries",cy.type="scatter";var zI={title:O,showInMiniChart:L,label:{placement:P("top","right","bottom","left"),...Pe},tooltip:ke,errorBar:Fl,styler:Ie(Mn),maxRenderedItems:E,...Se,...K(Mn,["enabled"]),highlight:st(We,We)},Kd={...zI,...Sn,type:Z(Ge("scatter")),xKey:Z(O),yKey:Z(O),labelKey:O,xName:O,yName:O,labelName:O,legendItemName:O,xKeyAxis:O,yKeyAxis:O,errorBar:Ph,highlight:st(We,We)};Kd.xFilterKey=J(O),Kd.yFilterKey=J(O),Kd.sizeFilterKey=J(O);var aP={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",_l],["image",fs],["pattern",Hi]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Yn,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:zl}},GI={type:"series",name:"scatter",chartType:"cartesian",version:Xe,dependencies:[en],options:Kd,predictAxis:Zm,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:aP,create:e=>new cy(e)},jI=[DI,LI,RI,VI,_I,GI],HI=[KM,jI,Tf,Of].flat(),$I={angle:["angleKey"],radius:["radiusKey"]},UI={angle:["angleName"],radius:["radiusName"]},hy=class extends gm{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 re({name:"items"})),this.nodeData=[],this.itemSelection=mt.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=mt.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=mt.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=mt.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=n,this.animationState=new Jl("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 Ei;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&&zt([this.itemSelection,this.highlightSelection],e),t&&zt([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&&zt([this.highlightSelection],t),i&&zt([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 It&&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}},uy=class extends Ad{constructor(e,t){super(e,t),this.axes=this.createChartAxes(),this.padding=new ea(40),this.ctx.axisManager.axisGroup.zIndex=8}createChartAxes(){return new QN}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(WI))n.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:t,paddedRect: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(WI),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<d.length-1;p++)d[p].series.surroundingRadius=d[p+1].innerRadius}},n=e.width/2,s=e.height/2,r=Math.max(0,Math.min(e.width,e.height)/2);let a=r;i(n,s,a);const o=async({hideWhenNecessary:l=!1}={})=>{const c=[];for(const d of Gr(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 Gr(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,y=.5*i.height/2,m=Math.min(f,y);if(g<m){g=m;const M=l+h,D=c+u;if(2*g+D>i.height){const A=i.height-2*g;Math.min(c,u)*2>A?(c=A/2,u=A/2):c>u?c=A-u:u=A-c}if(2*g+M>i.width){const A=i.width-2*g;Math.min(l,h)*2>A?(l=A/2,h=A/2):l>h?l=A-h:h=A-l}}const v=l+2*g+h,x=c+2*g+u;return{centerX:(i.width-v)/2+l+g,centerY:(i.height-x)/2+c+g,radius:g}}};uy.className="PolarChart",uy.type="polar";function WI(e){return e instanceof hy}var Yd={type:"chart",name:"polar",version:Xe,options:CO,create(e,t){return new uy(e,t)},validate(e,t,i){const n=[],s=e?.series?.[0]?.type;(s==="pie"||s==="donut")&&e?.axes&&(n.push(new Mh([],e.axes,i,"axes")),e=K(e,["axes"]));const r=Ft(e,t,i);return r.invalid.push(...n),r}},KI=class Qy{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 Qy(t,i,n,s)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[zu](t,i){return new Qy(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 YI({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)),nr(0,e,t)&&l(n,0),nr(Math.PI*.5,e,t)&&l(0,n),nr(Math.PI,e,t)&&l(-n,0),nr(Math.PI*1.5,e,t)&&l(0,-n),new U(s,r,a-s,o-r)}function dy(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||n<Math.min(s,r)||n>Math.max(s,r))return!1;const a=uu(i.startAngle),o=uu(i.endAngle),l=Math.atan2(t,e);return a<o?l<=o&&l>=a:l<=o&&l>=-Math.PI||l>=a&&l<=Math.PI}function oP(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 y=(-p+Math.sqrt(f))/2/d,m=(-p-Math.sqrt(f))/2/d;let v=0;for(const x of[y,m]){if(!(x>=Math.min(a,l)&&x<=Math.max(a,l)))continue;const D=h*x+u,A=x-e,I=D-t,k=Math.atan2(I,A);nr(k,n,s)&&v++}return v}function ZI(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 fc(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,l.x,l.y)||fc(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,c.x,c.y)||oP(0,0,r,i,n,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function lP(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 ZI({start:i,end:n},t)||ZI({start:s,end:r},t)}function XI(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 cP=1e-6;function Lr(e,t){return du(e,t)<cP?t:bi(e-t)+t}function Zd(e,t,i=0){const s=Math.abs(t-e)>=2*Math.PI?2*Math.PI:bi(t-e);return e=Lr(e,i),t=e+s,{startAngle:e,endAngle:t}}function Xd(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,D=-2*(e+t*x),A=D**2-4*M*l;if(A<0)return;const I=(-D+Math.sqrt(A))/(2*M),k=(-D-Math.sqrt(A))/(2*M);c=I,h=I*x,u=k,d=k*x}else{const x=o/a,M=1+x**2,D=-2*(t+e*x),A=D**2-4*M*l;if(A<0)return;const I=(-D+Math.sqrt(A))/(2*M),k=(-D-Math.sqrt(A))/(2*M);c=I*x,h=I,u=k*x,d=k}const p=o,g=a,f=c*p+h*g,y=u*p+d*g,m=f>0?Lr(Math.atan2(h-t,c-e),n):Number.NaN,v=y>0?Lr(Math.atan2(d-t,u-e),n):Number.NaN;if(m>=n&&m<=s)return m;if(v>=n&&v<=s)return v}function qd(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=Lr(c+h,n),d=Lr(c-h,n);if(u>=n&&u<=s)return u;if(d>=n&&d<=s)return d}var py=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.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},Jt=class extends It{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 YI(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}=Zd(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),r=Zd(e.startAngle,e.endAngle,t);return new KI(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}=Zd(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,y=f*Math.cos(g),m=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&&f<d.innerRadius-1e-6||!o&&f>d.outerRadius+1e-6))return;const v=new py(y,m,e,i,n);if(d!=null){o?(v.clipStart(Xd(y,m,e,i,n,d.endAngle)),v.clipEnd(Xd(y,m,e,i,n,d.startAngle))):(v.clipStart(Xd(y,m,e,i,n,d.startAngle)),v.clipEnd(Xd(y,m,e,i,n,d.endAngle)));let I,k;if(a?(I=qd(y,m,e,i,n,d.innerRadius),k=qd(y,m,e,i,n,d.outerRadius)):(I=qd(y,m,e,i,n,d.outerRadius),k=qd(y,m,e,i,n,d.innerRadius)),v.clipStart(I),v.clipEnd(k),I!=null){const{x:C,y:T}=v.pointAt(I),N=Lr(Math.atan2(T,C),l);a?r?.clipStart(N):s.clipEnd(N)}if(k!=null){const{x:C,y:T}=v.pointAt(k),N=Lr(Math.atan2(T,C),l);a?s.clipStart(N):r?.clipEnd(N)}}if(d!=null){const{x:I,y:k}=v.pointAt((v.a0+v.a1)/2);if(!dy(I,k,d))return}const{x,y:M}=v.pointAt(a===o?v.a0:v.a1),D=Lr(Math.atan2(M,x),l),A=o?r:s;return a?A?.clipStart(D):A?.clipEnd(D),v}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}=Zd(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=u-h,y=f>=2*Math.PI-1e-6;t.clear();const m=this.getAngleOffset(d),v=f-2*m,x=p-d,M=d>0&&v>0?2*d*Math.sin(v/2):0,D=p>0&&v>0?2*p*Math.sin(v/2):0;if(a=Math.floor(Math.max(0,Math.min(a,D/2,x/2))),o=Math.floor(Math.max(0,Math.min(o,D/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||D<=0)return;if((g?.startAngle??h)===(g?.endAngle??u))return;if(y&&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 I=this.getAngleOffset(p);if(f<2*I)return;const C=(g?.innerRadius??d)>s,T=d<s||f<2*m,N=Math.max(a,l,o,c),R=N>0?Math.min(x/N,1):1;a*=R,o*=R,l*=R,c*=R;const F=XI(p,f-2*I,-a,-o);if(a*=F,o*=F,!T&&C){const me=XI(d,f-2*m,l,c);l*=me,c*=me}else l=0,c=0;const G=Math.max(a+l,o+c),V=G>0?Math.min(x/G,1):1;a*=V,o*=V,l*=V,c*=V;let H=0,q=0;const z=a/(p-a),ie=o/(p-o);if(z>=0&&z<1-1e-6)H=Math.asin(z);else{H=f/2;const me=p/(1/Math.sin(H)+1);a=Math.min(me,a)}if(ie>=0&&ie<1-1e-6)q=Math.asin(ie);else{q=f/2;const me=p/(1/Math.sin(q)+1);o=Math.min(me,o)}const de=Math.asin(l/(d+l)),pe=Math.asin(c/(d+c)),Re=g?.outerRadius??p,Rt=this.getAngleOffset(Re),ve=new py(0,0,Re,h+Rt,u-Rt),ri=g?.innerRadius??d,us=this.getAngleOffset(ri),De=C?new py(0,0,ri,h+us,u-us):void 0;g!=null&&(ve.clipStart(g.startAngle),ve.clipEnd(g.endAngle),De?.clipStart(g.startAngle),De?.clipEnd(g.endAngle));const Fr=this.arc(a,H,h-Math.PI*.5,h+H,ve,De,!0,!1),Fs=this.arc(o,q,u-q,u+Math.PI*.5,ve,De,!1,!1),Vr=this.arc(c,pe,u+Math.PI*.5,u+Math.PI-pe,ve,De,!1,!0),jt=this.arc(l,de,h+Math.PI+de,h+Math.PI*1.5,ve,De,!0,!0);if(!(T&&C)){if(T){const me=f<Math.PI*.5?r*(1+Math.cos(f))/Math.sin(f):Number.NaN;let ut;me>0&&me<p?ut=Math.max(Math.hypot(r,me),d):ut=r,ut=Math.max(ut,d);const Le=h+f*.5;t.moveTo(i+ut*Math.cos(Le),n+ut*Math.sin(Le))}else if(!(jt?.isValid()===!0||De?.isValid()===!0)){const me=h+f/2,ut=d*Math.cos(me),Le=d*Math.sin(me);t.moveTo(i+ut,n+Le)}}if(Fr?.isValid()===!0){const{cx:me,cy:ut,r:Le,a0:ds,a1:gn}=Fr;t.arc(i+me,n+ut,Le,ds,gn)}if(ve.isValid()){const{r:me,a0:ut,a1:Le}=ve;t.arc(i,n,me,ut,Le)}if(Fs?.isValid()===!0){const{cx:me,cy:ut,r:Le,a0:ds,a1:gn}=Fs;t.arc(i+me,n+ut,Le,ds,gn)}if(!T){if(Vr?.isValid()===!0){const{cx:me,cy:ut,r:Le,a0:ds,a1:gn}=Vr;t.arc(i+me,n+ut,Le,ds,gn)}if(De?.isValid()===!0){const{r:me,a0:ut,a1:Le}=De;t.arc(i,n,me,Le,ut,!0)}if(jt?.isValid()===!0){const{cx:me,cy:ut,r:Le,a0:ds,a1:gn}=jt;t.arc(i+me,n+ut,Le,ds,gn)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=this.clipSector??this;return dy(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:n,innerRadius:Math.min(s,r),outerRadius:Math.max(s,r)})}};Jt.className="Sector",b([Y()],Jt.prototype,"centerX",2),b([Y()],Jt.prototype,"centerY",2),b([Y()],Jt.prototype,"innerRadius",2),b([Y()],Jt.prototype,"outerRadius",2),b([Y()],Jt.prototype,"startAngle",2),b([Y()],Jt.prototype,"endAngle",2),b([oa({equals:(e,t)=>e.equals(t)})],Jt.prototype,"clipSector",2),b([Y()],Jt.prototype,"concentricEdgeInset",2),b([Y()],Jt.prototype,"radialEdgeInset",2),b([Y()],Jt.prototype,"startOuterCornerRadius",2),b([Y()],Jt.prototype,"endOuterCornerRadius",2),b([Y()],Jt.prototype,"startInnerCornerRadius",2),b([Y()],Jt.prototype,"endInnerCornerRadius",2);var xt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Es={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},qI=class extends qe{constructor(){super(...arguments),this.showInLegend=!1}};b([S],qI.prototype,"showInLegend",2);var gy=class extends Xi{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};b([S],gy.prototype,"text",2),b([S],gy.prototype,"spacing",2);var fy=class extends oe{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};b([S],fy.prototype,"fill",2),b([S],fy.prototype,"fillOpacity",2);var nl=class extends Xi{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([S],nl.prototype,"offset",2),b([S],nl.prototype,"minAngle",2),b([S],nl.prototype,"minSpacing",2),b([S],nl.prototype,"maxCollisionOffset",2),b([S],nl.prototype,"avoidCollisions",2);var my=class extends Xi{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([S],my.prototype,"positionOffset",2),b([S],my.prototype,"positionRatio",2);var Xc=class extends oe{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([S],Xc.prototype,"colors",2),b([S],Xc.prototype,"length",2),b([S],Xc.prototype,"strokeWidth",2),b([S],Xc.prototype,"itemStyler",2);var ge=class extends Rn{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(xt),this.strokes=Object.values(Es),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 Ja(gy),this.title=new qI,this.innerCircle=new fy,this.shadow=new ns,this.calloutLabel=new nl,this.sectorLabel=new my,this.calloutLine=new Xc,this.tooltip=Ca()}};b([S],ge.prototype,"angleKey",2),b([S],ge.prototype,"angleName",2),b([S],ge.prototype,"angleFilterKey",2),b([S],ge.prototype,"radiusKey",2),b([S],ge.prototype,"radiusName",2),b([S],ge.prototype,"radiusMin",2),b([S],ge.prototype,"radiusMax",2),b([S],ge.prototype,"calloutLabelKey",2),b([S],ge.prototype,"calloutLabelName",2),b([S],ge.prototype,"sectorLabelKey",2),b([S],ge.prototype,"sectorLabelName",2),b([S],ge.prototype,"legendItemKey",2),b([S],ge.prototype,"defaultColorRange",2),b([S],ge.prototype,"defaultPatternFills",2),b([S],ge.prototype,"fills",2),b([S],ge.prototype,"strokes",2),b([S],ge.prototype,"fillOpacity",2),b([S],ge.prototype,"strokeOpacity",2),b([S],ge.prototype,"lineDash",2),b([S],ge.prototype,"lineDashOffset",2),b([S],ge.prototype,"cornerRadius",2),b([S],ge.prototype,"itemStyler",2),b([S],ge.prototype,"rotation",2),b([S],ge.prototype,"outerRadiusOffset",2),b([S],ge.prototype,"outerRadiusRatio",2),b([S],ge.prototype,"innerRadiusOffset",2),b([S],ge.prototype,"innerRadiusRatio",2),b([S],ge.prototype,"strokeWidth",2),b([S],ge.prototype,"sectorSpacing",2),b([S],ge.prototype,"hideZeroValueSectorsInLegend",2),b([S],ge.prototype,"innerLabels",2),b([S],ge.prototype,"title",2),b([S],ge.prototype,"innerCircle",2),b([S],ge.prototype,"shadow",2),b([S],ge.prototype,"calloutLabel",2),b([S],ge.prototype,"sectorLabel",2),b([S],ge.prototype,"calloutLine",2),b([S],ge.prototype,"tooltip",2);function yy(e,t,i,n){const s=[i.convert(0),i.convert(1)],r=[n.convert(0),n.convert(1)],a=Math.PI/-2+Ut(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,y,{prevLive:m})=>{let{startAngle:v,endAngle:x,innerRadius:M,outerRadius:D}=f;const{stroke:A,fill:I}=f.sectorFormat;if(y==="removed"&&m?(v=m.datum?.endAngle,x=m.datum?.endAngle):y==="removed"&&!m&&(v=a,x=a),y==="removed"){const C=l(f);M=C.innerRadius,D=C.outerRadius}return{startAngle:v,endAngle:x,outerRadius:D,innerRadius:M,stroke:A,...typeof I=="string"?{fill:I}:{}}},fromFn:(g,f,y,{prevFromProps:m})=>{let{startAngle:v,endAngle:x,innerRadius:M,outerRadius:D}=g,{fill:A,stroke:I}=f.sectorFormat;if(y==="updated"&&g.previousDatum==null&&(y="added"),y==="unknown"||y==="added"&&!m?(v=a,x=a,M=f.innerRadius,D=f.outerRadius):y==="added"&&m&&(v=m.endAngle??a,x=m.endAngle??a,M=m.innerRadius??f.innerRadius,D=m.outerRadius??f.outerRadius),y==="added"&&!e){const C=c(f);M=C.innerRadius,D=C.outerRadius}return y==="updated"&&(A=g.fill??A,I=(typeof g.stroke=="string"?g.stroke:void 0)??I),{startAngle:v,endAngle:x,innerRadius:M,outerRadius:D,stroke:I,phase:o,...typeof A=="string"?{fill:A}:{}}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:o}),toFn:(g,f)=>({size:f.radius??0})}}}function hP(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function uP(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&&nr(s,a.startAngle,a.endAngle)){const o=Math.hypot(n,i);let l=0;return o<a.innerRadius?l=a.innerRadius-o:o>a.outerRadius&&(l=o-a.outerRadius),{datum:a.datum,distance:l}}}var dP=class extends gd{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}},Jd=class extends hy{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...$I,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...UI,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:hP,label:Aa}}),this.properties=new ge,this.phantomNodeData=void 0,this.backgroundGroup=new Zt({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new va,this.radiusScale=new va,this.phantomGroup=this.contentGroup.appendChild(new re({name:"phantom",zIndex:-1})),this.phantomSelection=mt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new re({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=mt.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new re({name:"pieCalloutLabels"})),this.calloutLabelSelection=new mt(this.calloutLabelGroup,re),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new re({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new At({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new At({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new re({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new re({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=mt.select(this.innerLabelsGroup,Ei),this.innerCircleSelection=mt.select(this.innerCircleGroup,()=>new At({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=dP,this.angleScale=new va,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 Jt;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=()=>(m,v)=>t&&n.getItemEnabled({seriesId:i,itemId:v})?m:0,u=!this.ctx.animationManager.isSkipped(),d=this.properties.allowNullKeys??!1,p=[],g=[];c?p.push(Ir(c,"category",{id:"legendItemKey",allowNullKey:d})):o?p.push(Ir(o,"category",{id:"calloutLabelKey",allowNullKey:d})):l&&p.push(Ir(l,"category",{id:"sectorLabelKey",allowNullKey:d}));const f=this.radiusScale.type,y=this.angleScale.type;a&&g.push(bN(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Ue(a,f,{id:"radiusRaw",processor:h}),rm("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&g.push(Ue(o,"category",{id:"calloutLabelValue",allowNullKey:d})),l&&g.push(Ue(l,"category",{id:"sectorLabelValue",allowNullKey:d})),c&&g.push(Ue(c,"category",{id:"legendItemValue",allowNullKey:d})),r&&g.push(sm(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Ue(r,y,{id:"angleFilterRaw"}),rm("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(dd(this.id,this.processedData)),g.push(Tc()),await this.requestDataModel(e,this.data,{props:[...p,sm(s,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Ue(s,y,{id:"angleRaw"}),rm("angleValue",[0,1],0,0),...g]});for(const m of this.processedData?.defs?.values??[]){const{id:v,missing:x,property:M}=m,D=OS(this,x);v!=="angleRaw"&&D>0&&_.warnOnce(`no value was found for the key '${String(M)}' on ${D} data element${D>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,e.length>0&&Bs.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,y=d?.some((I,k)=>I>h[k])??!1;let m=0,v=0;const x=[],M=d==null?void 0:[],D=t.dataSources.get(this.id)?.data??[],A=t.invalidData?.get(this.id);for(const[I,k]of D.entries()){if(A?.[I]===!0)continue;const C=y?u[I]:c[I],T=d!=null&&!y?Math.sqrt(d[I]/h[I]):1,N=n.convert(m)+Ut(a);m=C,v+=C;const R=n.convert(m)+Ut(a),F=Math.abs(R-N),G=N+F/2,V=h[I],q=(p?.[I]??1)*T,z=g?.[I],ie=f?.[I],de=this.getLabels(I,k,G,F,l),pe=this.getItemStyle({datum:k,datumIndex:I},!1),Re={series:this,datum:k,datumIndex:I,angleValue:V,midAngle:G,midCos:Math.cos(G),midSin:Math.sin(G),startAngle:N,endAngle:R,radius:q,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(q),0),sectorFormat:pe,radiusValue:z,legendItemValue:ie,enabled:r&&s.getItemEnabled({seriesId:e,itemId:I}),focusable:!0,...de};x.push(Re),M?.push({...Re,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=v===0,this.zerosumInnerRing.visible=v===0&&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],y={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},m={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(m.callout=this.getLabelText(p,t,c,"calloutLabel",[],o,{...y,value:p},d)),h&&(m.sector=this.getLabelText(g,t,h,"sectorLabel",[],l,{...y,value:g},d)),u!=null&&(f!=null||d)){const v=f??"";m.legendItem=a.format(this.callWithContext.bind(this),{type:"category",value:d?f:v,datum:t,seriesId:n,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??v}return m}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>=Ut(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=uu(e),n=-.75*Math.PI,s=i-n,r=Math.floor(s/(Math.PI/2)),a=$b(r,t.length);return t[a]}getFillParams(e,t,i){if(!(!Wi(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:y,cornerRadius:m,opacity:v}=be(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:y,cornerRadius:m});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??y,cornerRadius:x?.cornerRadius??m,opacity:v}}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=Xn(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 Yi;d.tag=0,d.pointerEvents=1,u.appendChild(d);const p=new Ei;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,y,m)=>{const v=this.getItemStyle(g,y,void 0,r);g.sectorFormat.fill=v.fill,g.sectorFormat.stroke=v.stroke,u&&(p.startAngle=g.startAngle,p.endAngle=g.endAngle,p.innerRadius=g.innerRadius,p.outerRadius=g.outerRadius),(y||u)&&(p.fill=v.fill,p.stroke=v.stroke);const x=this.getFillParams(v.fill,l,c);p.setStyleProperties(v,h,x),p.drawingMode=m,p.cornerRadius=v.cornerRadius,p.fillShadow=this.properties.shadow;const M=Math.max((this.properties.sectorSpacing+(v.stroke==null?0:v.strokeWidth))/2,0);p.inset=M,p.lineJoin=this.properties.sectorSpacing>=0||M>0?"miter":"round"};this.itemSelection.each((p,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=Dx(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 y=r.midCos*g,m=r.midSin*g;let v=r.midCos*(g+o),x=r.midSin*(g+o);if((p.collisionTextAlign??p.collisionOffsetY!==0)&&p.box!=null){const D=p.box;let A=v,I=x;v<D.x?A=D.x:v>D.x+D.width&&(A=D.x+D.width),x<D.y?I=D.y:x>D.y+D.height&&(I=D.y+D.height);const k=A-v,C=I-x,T=Math.sqrt(Math.pow(k,2)+Math.pow(C,2)),N=T-t;N>0&&(v=v+k*N/T,x=x+C*N/T)}s.x1=y,s.y1=m,s.x2=v,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+a<i?o=(e.x+e.width-i)/e.width:e.x+e.width-a>n&&(o=(n-e.x)/e.width);const l=e.y+a<s||e.y+e.height-a>r,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=y=>!y.calloutLabel||y.outerRadius===0,a=this.calloutNodeData,o=a.filter(y=>!r(y));for(const y of o){const m=y.calloutLabel;m!=null&&(m.hidden=!1,m.collisionTextAlign=void 0,m.collisionOffsetY=0)}if(o.length<=1)return;const l=o.filter(y=>y.midCos<0).sort((y,m)=>y.midSin-m.midSin),c=o.filter(y=>y.midCos>=0).sort((y,m)=>y.midSin-m.midSin),h=o.filter(y=>y.midSin<0&&y.calloutLabel?.textAlign==="center").sort((y,m)=>y.midCos-m.midCos),u=o.filter(y=>y.midSin>=0&&y.calloutLabel?.textAlign==="center").sort((y,m)=>y.midCos-m.midCos),d=y=>{const m=y.calloutLabel;if(m==null)return U.zero.clone();const v=this.getLabelStyle(y,t,"calloutLabel"),x=Ho(v),M=this.getCalloutLineStyle(y,!1).length,D=y.outerRadius+M+i,A=y.midCos*D,I=y.midSin*D+m.collisionOffsetY,k=m.collisionTextAlign??m.textAlign,C=m.textBaseline;return Ei.measureBBox(m.text,A,I,{font:this.properties.calloutLabel,textAlign:k,textBaseline:C}).grow(x)},p=(y,m,v)=>{const x=d(y).grow(n/2),M=d(m).grow(n/2);x.x<M.x+M.width&&x.x+x.width>M.x&&(v==="to-top"?x.y<M.y+M.height:x.y+x.height>M.y)&&(m.calloutLabel.collisionOffsetY=v==="to-top"?x.y-M.y-M.height:x.y+x.height-M.y)},g=y=>{const m=y.slice().sort((x,M)=>Math.abs(x.midSin)-Math.abs(M.midSin))[0],v=y.indexOf(m);for(let x=v-1;x>=0;x--){const M=y[x+1],D=y[x];p(M,D,"to-top")}for(let x=v+1;x<y.length;x++){const M=y[x-1],D=y[x];p(M,D,"to-bottom")}},f=y=>{const m=o.some(I=>I.calloutLabel.collisionOffsetY!==0),v=y.map(I=>d(I)),x=v.map(I=>I.clone().grow(n/2));let M=!1;for(let I=0;I<x.length&&!M;I++){const k=x[I];for(let C=I+1;C<y.length;C++){const T=x[C];if(k.collidesBBox(T)){M=!0;break}}}const D=a.map(I=>{const{startAngle:k,endAngle:C,outerRadius:T}=I;return{startAngle:k,endAngle:C,innerRadius:s,outerRadius:T}}),A=v.some(I=>D.some(k=>lP(I,k)));if(!(!M&&!m&&!A))for(const I of y){if(I.calloutLabel.textAlign!=="center")continue;const k=I.calloutLabel;I.midCos<0?k.collisionTextAlign="right":I.midCos>0?k.collisionTextAlign="left":k.collisionTextAlign="center"}};g(l),g(c),f(h),f(u)}getLabelStyle(e,t,i,n=!1){const s=this.ctx.highlightManager?.getActiveHighlight();return Da(this,e,this.properties,t,n,s,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i}=this.properties,n=new Ei,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,y=o.midSin*g+l.collisionOffsetY,m={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};n.text=l.text,n.x=f,n.y=y,n.setFont(d),n.setAlign(m),n.setBoxing(d);const v=n.getBBox();let x=l.text,M=!0;if(i.avoidCollisions){const{maxWidth:D,hasVerticalOverflow:A}=this.getLabelOverflow(v,e);if(v.width>D){const I={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:D};x=Mu(l.text,I)}M=!A}a.text=x,a.x=f,a.y=y,a.setFont(d),a.setAlign(m),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 Ei;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,y=h.midSin*g+u.collisionOffsetY;o.text=u.text,o.x=f,o.y=y,o.setFont(d),o.setAlign({textAlign:u.collisionTextAlign??u.textAlign,textBaseline:u.textBaseline}),o.setBoxing(d);const m=o.getBBox();if(u.box=m,Math.abs(u.collisionOffsetY)>s){u.hidden=!0;continue}if(l){const v=-this.centerY,x=new U(l.x-r,v,l.width+2*r,l.y+l.height+r-v);if(m.collidesBBox(x)){u.hidden=!0;continue}}if(e.hideWhenNecessary){const{maxWidth:v,hasVerticalOverflow:x,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(m,t),D=m.width>v;if(x||D||M){u.hidden=!0;continue}}u.hidden=!1,a.push(m)}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 y=!1;if(u.sectorLabel&&d!==0){const m=this.getLabelStyle(u,e.sectorLabel,"sectorLabel",f),v=r*(1-i)+d*i+t;h.fill=m.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*v,h.y=u.midSin*v),h.setFont(m),h.setAlign(o),h.setBoxing(m);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]],D={startAngle:p,endAngle:g,innerRadius:r,outerRadius:d};M.every(([A,I])=>dy(A,I,D))&&(y=!0)}h.visible=y});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:y}=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=y,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<e.length;h++){const p=e[h].height+u+i(h);c.push(p),u=p+n(h)}this.innerLabelsSelection.each((h,u,d)=>{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 uP(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,y=this.properties.title.node.getPlainText();if(!i||!n)return;const m=n.dataSources.get(this.id)?.data?.[e],v=this.getProcessedDataValues(i,n),{angleRawValues:x}=v,M=x[e],D=this.getLabelContent(e,m,v),A=D.legendItem??D.callout??D.sector??d,I=yl(i.getDomain(this,"angleRaw","value",n)),k=r.format(this.callWithContext.bind(this),{type:"number",value:M,datum:m,seriesId:t,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:I,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??ao(M,3);return this.formatTooltipWithContext(f,{title:y,symbol:this.legendItemSymbol(e),data:[{label:Ze(A),fallbackLabel:u,value:k}]},{seriesId:t,datum:m,title:d,legendItemKey:a,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,...this.getItemStyle({datum:m,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 Wi(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,y=i.dataSources.get(this.id)?.data,m=i.invalidData?.get(this.id);for(let v=0;v<i.input.count;v++){const x=y?.[v],M=d[v];if(m?.[v]===!0||f&&M===0)continue;const D=[];p&&D.push(p);const A=this.getLabelContent(v,x,u);c&&A.legendItem!==void 0?D.push(A.legendItem):o&&o!==a&&A.callout!==void 0?D.push(A.callout):l&&l!==a&&A.sector!==void 0&&D.push(A.sector),D.length!==0&&g.push({legendType:"category",id:s,datum:x,itemId:v,seriesId:s,hideToggleOtherSeries:!0,enabled:t&&r.getItemEnabled({seriesId:s,itemId:v}),label:{text:D.map(I=>Ze(I)).join(" - ")},symbol:this.legendItemSymbol(v),legendItemName:c==null?void 0:x[c],hideInLegend:!h})}return g}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:n}}=this;for(const[s,r]of e.entries())i.toggleItem(r,t,s);i.update(),n.update(7)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=yy(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);bt(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(n,s)=>this.getDatumId(s.datumIndex)),bt(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),lt(this,"callout",t,this.calloutLabelSelection),lt(this,"sector",t,this.labelSelection,this.highlightLabelSelection),lt(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=yy(!1,this.properties.rotation,r,a);bt(this.id,"nodes",o,[e,t,i,n],p.nodes,(g,f)=>this.getDatumId(f.datumIndex),l),bt(this.id,"innerCircle",o,[this.innerCircleSelection],p.innerCircle),lt(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),lt(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,lt(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=yy(!1,this.properties.rotation,s,r);bt(this.id,"nodes",a,[e,t,i,n],o.nodes,(l,c)=>this.getDatumId(c.datumIndex)),bt(this.id,"innerCircle",a,[this.innerCircleSelection],o.innerCircle),Ld(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ld(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),Ld(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 Xt(a[e])}else if(n){const a=t.resolveKeysById(this,"calloutLabelKey",i);return Xt(a[e])}else if(s){const a=t.resolveKeysById(this,"sectorLabelKey",i);return Xt(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))}};Jd.className="DonutSeries",Jd.type="donut";var JI=st(We,We),by={...Se,radiusMin:w,radiusMax:w,rotation:E,outerRadiusOffset:E,outerRadiusRatio:X,hideZeroValueSectorsInLegend:L,sectorSpacing:w,cornerRadius:w,itemStyler:Ie({...j,...B,...W,cornerRadius:w}),title:{enabled:L,text:O,showInLegend:L,spacing:w,...Ce},calloutLabel:{enabled:L,offset:E,minAngle:w,avoidCollisions:L,formatter:$t(ai),format:O,itemStyler:Ie({enabled:L,...rn,...Ce}),...rn,...Ce},sectorLabel:{enabled:L,positionOffset:E,positionRatio:X,formatter:$t(ai),format:O,itemStyler:Ie({enabled:L,...rn,...Ce}),...rn,...Ce},calloutLine:{colors:ee($),length:w,strokeWidth:w,itemStyler:Ie({color:$,length:w,strokeWidth:w})},fills:ee(Ai),strokes:ee($),tooltip:ke,shadow:Kn,highlight:JI,...W,...K(j,["fill"]),...K(B,["stroke"])},ss={...by,...Sn,type:Z(Ge("pie")),angleKey:Z(O),radiusKey:O,calloutLabelKey:O,sectorLabelKey:O,legendItemKey:O,angleName:O,radiusName:O,calloutLabelName:O,sectorLabelName:O,highlight:JI};ss.angleFilterKey=J(O),ss.defaultColorRange=J(ee(ee($))),ss.defaultPatternFills=J(ee($)),ss.title._enabledFromTheme=J(L),ss.calloutLabel._enabledFromTheme=J(L),ss.sectorLabel._enabledFromTheme=J(L),ss.angleKeyAxis=J(O),ss.radiusKeyAxis=J(O);var QI={...by,innerRadiusOffset:E,innerRadiusRatio:X,innerCircle:{fill:O,fillOpacity:X},innerLabels:{spacing:w,...Ce,...rn}},eD={...QI,...ss,type:Z(Ge("donut")),innerLabels:Tt({text:Z(O),spacing:w,...Ce,...rn},"inner label options array")};eD.angleFilterKey=J(O);var vy={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Hr.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Yn,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Yn,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",Mv],["pattern",Hi],["image",fs]]}]},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:Yr,xOffset:3,yOffset:3,blur:5},highlight:Zp},legend:{enabled:!0}},pP={...vy,series:{...vy.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...Yn,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:Zp}},tD={type:"series",name:"donut",chartType:"polar",version:Xe,dependencies:[Yd],options:eD,themeTemplate:pP,create:e=>new Jd(e)},xy=class extends Jd{};xy.className="PieSeries",xy.type="pie";var iD={type:"series",name:"pie",chartType:"polar",version:Xe,dependencies:[Yd],options:ss,themeTemplate:vy,create:e=>new xy(e)},nD=[Yd,tD,iD,Tf,Of],Sy=[HI,nD,t0].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 rD={};function St(e,t=1,i,n=!1){_.warnOnce("time import is deprecated, use object notation instead");const s=`${e}:${t}:${i?.getTime()??0}:${n}`;let r=rD[s];return r==null&&(r=sD(e,t,i,n),rD[s]=r),r}var gP={get millisecond(){return St("millisecond")},get second(){return St("second")},get minute(){return St("minute")},get hour(){return St("hour")},get day(){return St("day")},get monday(){return St("day",7,new Date(1970,0,5))},get tuesday(){return St("day",7,new Date(1970,0,6))},get wednesday(){return St("day",7,new Date(1970,0,7))},get thursday(){return St("day",7,new Date(1970,0,1))},get friday(){return St("day",7,new Date(1970,0,2))},get saturday(){return St("day",7,new Date(1970,0,3))},get sunday(){return St("day",7,new Date(1970,0,4))},get month(){return St("month")},get year(){return St("year")},get utcMillisecond(){return St("millisecond",1,void 0,!0)},get utcSecond(){return St("second",1,void 0,!0)},get utcMinute(){return St("minute",1,void 0,!0)},get utcHour(){return St("hour",1,void 0,!0)},get utcDay(){return St("day",1,void 0,!0)},get utcMonth(){return St("month",1,void 0,!0)},get utcYear(){return St("year",1,void 0,!0)}};function aD(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var My="white",fP={"radial-gauge":!0,"linear-gauge":!0};function sl(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 mP(e){return fP[e]===!0}var tn=class hh{static getDefaultColors(){return{fills:xt,fillsFallback:Object.values(xt),strokes:Es,sequentialColors:$i(xt),divergingColors:[xt.ORANGE,xt.YELLOW,xt.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Ne.interpolate([Ne.fromHexString(xt.BLUE),Ne.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[xt.GREEN,xt.YELLOW,xt.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:xt.GREEN,stroke:Es.GREEN},down:{fill:xt.RED,stroke:Es.RED},neutral:{fill:xt.GRAY,stroke:Es.GRAY},altUp:{fill:xt.BLUE,stroke:Es.BLUE},altDown:{fill:xt.ORANGE,stroke:Es.ORANGE},altNeutral:{fill:xt.GRAY,stroke:Es.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:My,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:qs,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},separationLinesColor:{$foregroundBackgroundMix:.17},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"}}}static getAxisDefaults({title:t,time:i}){return be(t&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Hr.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},i&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},{left:12,right:12,top:8,bottom:8},void 0]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"},border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Hr.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:tr,textAlign:ir},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Hr.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:tr,textAlign:ir},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:Hr.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:tr,textAlign:ir},highlight:{drawingMode:{$if:[{$or:[sl("highlight/highlightedItem/opacity"),sl("highlight/unhighlightedItem/opacity"),sl("highlight/highlightedSeries/opacity"),sl("highlight/unhighlightedSeries/opacity"),sl("fillOpacity"),sl("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:so,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:so},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}=Fe(t),r=this.createChartConfigPerChartType(this.getDefaults()),a={};i&&this.processOverrides(a,i);const{fills:o,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=ki(be(n,{fills:Object.values(o),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=aD(n),this.params=be(s,this.getPublicParameters()),this.config=ki(Fe(r)),this.overrides=ki(i),this.presets=ki(a)}processOverrides(t,i){for(const n of Q.listModulesByType("series")){const s=n.name,r=i[s];mP(s)&&(t[s]=r,delete i[s])}}createChartConfigPerChartType(t){var i;for(const n of Q.listModulesByType("chart"))for(const s of Q.listModulesByType("series"))s.chartType===n.name&&(t[i=s.name]??(t[i]=n.themeTemplate));return t}getDefaults(){const t=(s,r)=>{const a={},o=be({axes:{}},...Array.from(Q.listModulesByType("plugin"),l=>({[l.name]:l.themeTemplate})),Q.getChartModule(s)?.themeTemplate,this.getChartDefaults());for(const l of r){a[l]=be(bP(l),a[l]??o);const{axes:c}=a[l];for(const h of Q.listModulesByType("axis"))c[h.name]=be(c[h.name],!h.chartType||h.chartType===s?yP(h.name):null,hh.axisDefault[h.name]);(l==="map-shape-background"||l==="map-line-background")&&delete a[l].series.tooltip}return a},i=[...Q.listModulesByType("series")],n=vl(i,s=>s.chartType||"unknown");return be(...Object.keys(n).map(s=>t(s,n[s]?.map(r=>r.name)??[])))}static applyTemplateTheme(t,i,n){if(ae(t))for(let s=0;s<t.length;s++){const r=t[s];typeof r=="symbol"&&n?.has(r)&&(t[s]=n.get(r))}else for(const s of Object.keys(t)){const r=t[s];typeof r=="symbol"&&n?.has(r)&&(t[s]=n.get(r))}}templateTheme(t,i=!0){const n=i?Fe(t):t,s=this.getTemplateParameters();return or(n,hh.applyTemplateTheme,void 0,void 0,s),n}getDefaultColors(){return hh.getDefaultColors()}getPublicParameters(){return hh.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(so,!1),t.set(Yr,"#00000080"),t.set(Jh,"#aaa"),t.set(tr,"block"),t.set(ir,"center"),t.set(pg,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(qh,My),t.set(wi,xt.BLUE),t.set(Li,xt.BLUE),t.set(Qh,xt.BLUE),t.set(eu,My),t.set(tu,"#fafafa"),t.set(iu,"#ddd"),t.set(nu,"#000"),t.set(su,"#181d1f"),t.set(gg,"#e35c5c"),t.set(fg,"#e35c5c"),t.set(ru,"#fafafa"),t.set(au,"#ddd"),t.set(ou,"#000"),t.set(jl,"top");const i=this.getDefaultColors();return t.set(tg,this.palette.up?.stroke??i.up.stroke),t.set(ng,this.palette.up?.fill??i.up.fill),t.set(ig,this.palette.down?.stroke??i.down.stroke),t.set(sg,this.palette.down?.fill??i.down.fill),t.set(rg,this.palette.neutral?.stroke??i.neutral.stroke),t.set(ag,this.palette.neutral?.fill??i.neutral.fill),t.set(og,this.palette.altUp?.stroke??i.up.stroke),t.set(cg,this.palette.altUp?.fill??i.up.fill),t.set(lg,this.palette.altDown?.stroke??i.down.stroke),t.set(hg,this.palette.altDown?.fill??i.down.fill),t.set(ug,this.palette.altNeutral?.fill??i.altNeutral.fill),t.set(dg,this.palette.altNeutral?.stroke??i.altNeutral.stroke),t}};tn.axisDefault={number:tn.getAxisDefaults({title:!0,time:!1}),log:tn.getAxisDefaults({title:!0,time:!1}),category:tn.getAxisDefaults({title:!0,time:!1}),"grouped-category":tn.getAxisDefaults({title:!0,time:!1}),time:tn.getAxisDefaults({title:!0,time:!0}),"unit-time":tn.getAxisDefaults({title:!0,time:!0}),"ordinal-time":tn.getAxisDefaults({title:!0,time:!0}),"angle-category":tn.getAxisDefaults({title:!1,time:!1}),"angle-number":tn.getAxisDefaults({title:!1,time:!1}),"radius-category":tn.getAxisDefaults({title:!0,time:!1}),"radius-number":tn.getAxisDefaults({title:!0,time:!1})};var Fn=tn;function yP(e){let t=Q.getAxisModule(e)?.themeTemplate??{};for(const i of Q.listModulesByType("axis:plugin"))(i.axisTypes?.includes(e)??!0)&&(t=be({[i.name]:i.themeTemplate},t));return t}function bP(e){let t=Q.getSeriesModule(e)?.themeTemplate??{};for(const i of Q.listModulesByType("series:plugin"))(i.seriesTypes?.includes(e)??!0)&&(t=be({series:{[i.name]:i.themeTemplate}},t));return t}var vP=new Set(["foreground"]);function oD(e){const t=new Map;for(const[h,{type:u}]of wr)Q.hasModule(h)||(t.has(u)?t.get(u).add(h):t.set(u,new Set([h])));if(t.size===0)return e;function i(h){const u=t.get("plugin");if(!(!le(h)||!u))for(const d of u)d in h&&h[d].enabled!==!0&&delete h[d]}function n(h){const u=t.get("series:plugin");if(!(!le(h)||!u))for(const d of u)d in h&&delete h[d]}function s(h){const u=t.get("axis:plugin");if(!(!le(h)||!u))for(const d of u)d in h&&h[d].enabled!==!0&&delete h[d]}function r(h){if(le(h))for(const u of Object.keys(h)){if(t.get("axis")?.has(u)){delete h[u];continue}s(h[u])}}function a(h){le(h)&&(r(h.axes),i(h),n(h.series))}const o=Fe(e.config),l=Fe(e.overrides),c=Fe(e.presets);for(const h of Object.keys(o)){if(t.get("series")?.has(h)){delete o[h];continue}a(o[h])}if(le(l)){const h=l;le(h.common)&&(r(h.common.axes),i(h.common));for(const u of Object.keys(h))if(u!=="common"){if(t.get("series")?.has(u)){delete h[u];continue}a(h[u])}}if(le(c)){const h=c;for(const u of Object.keys(h)){if(t.get("preset")?.has(u)||t.get("series")?.has(u)){delete h[u];continue}i(h[u]),r(h[u]?.axes)}}return Object.create(e,{config:{value:ki(o),enumerable:!0},overrides:{value:le(l)?ki(l):l,enumerable:!0},presets:{value:le(c)?ki(c):c,enumerable:!0}})}function xP(e,t,i){const n=pp(DP(e,t).concat(i));if(!n.length)return;const s=Q.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/r/module-registry/",r=vl(n,a=>a.enterprise?"enterprise":"community");if(n.length){const a=Q.isEnterprise()||r.enterprise?.length?"enterprise":"community";_.errorOnce(["required modules are not registered. Check if you have registered the modules:","",Q.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":IP(n.map(SP),a),"",`See ${s} for more details.`].join(`
|
|
`))}}function SP(e){return e.moduleId??e.name}function lD(e){return` ${e},`}function MP(e,t){return e.length?`import {
|
|
${e.map(lD).join(`
|
|
`)}
|
|
} from 'ag-charts-${t}';`:null}function IP(e,t){const i=MP(["ModuleRegistry"].concat(e),t),n=e.map(lD).join(`
|
|
`);return`${i}
|
|
|
|
ModuleRegistry.registerModules([
|
|
${n}
|
|
]);`}function DP(e,t){const i=new Map,n="axes"in t&&le(t.axes)?t.axes:{},s=new Set(Object.values(n).map(o=>o?.type).filter(Hn)),r=new Set(t.series?.map(o=>o.type).filter(Hn));function a(o){i.set(o.name,o)}for(const o of wr.values())if(!Q.hasModule(o.name)&&!vP.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];le(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=wr.get(o);l?.type==="series"&&!Q.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 cD(e,t){const i="axes"in t&&le(t.axes),n="series"in t&&ae(t.series),s=a=>e==null||!a.chartType||a.chartType===e,r=[];for(const a of Q.listModules())if(Q.isModuleType("plugin",a))s(a)||(delete t[a.name],r.push(a.name));else if(Q.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(Q.isModuleType("series:plugin",a)&&n&&!s(a)){for(const o of t.series)delete o[a.name];r.push(a.name)}return r}var Iy="#192232",Qt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ka={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},rl=class extends Fn{getDefaultColors(){return{fills:Qt,fillsFallback:Object.values(Qt),strokes:ka,sequentialColors:$i(Qt),divergingColors:[Qt.ORANGE,Qt.YELLOW,Qt.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Qt.GREEN,Qt.YELLOW,Qt.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:Qt.GREEN,stroke:ka.GREEN},down:{fill:Qt.RED,stroke:ka.RED},neutral:{fill:Qt.GRAY,stroke:ka.GRAY},altUp:{fill:Qt.BLUE,stroke:ka.BLUE},altDown:{fill:Qt.ORANGE,stroke:ka.ORANGE},altNeutral:{fill:Qt.GRAY,stroke:ka.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:Iy,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},separationLinesColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(so,!0),e.set(qh,Iy),e.set(wi,Qt.BLUE),e.set(Qh,"#fff"),e.set(Li,Qt.BLUE),e.set(eu,Iy),e.set(tu,"#28313e"),e.set(iu,"#4b525d"),e.set(nu,"#fff"),e.set(su,"#fff"),e.set(ru,"#28313e"),e.set(au,"#4b525d"),e.set(ou,"#fff"),e}constructor(e){super(e)}},Pi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},wa={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},AP=class extends rl{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Pi},fillsFallback:Object.values({...Pi}),strokes:{...wa},sequentialColors:$i(Pi),divergingColors:[Pi.GREEN,Pi.BLUE,Pi.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Pi.GREEN,stroke:wa.GREEN},down:{fill:Pi.RED,stroke:wa.RED},neutral:{fill:Pi.BLUE,stroke:wa.BLUE},altUp:{fill:Pi.GREEN,stroke:wa.GREEN},altDown:{fill:Pi.RED,stroke:wa.RED},altNeutral:{fill:Pi.GRAY,stroke:wa.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,Pi.BLUE),e.set(Li,Pi.BLUE),e.set(tr,"overlay"),e.set(ir,"left"),e.set(jl,"bottom"),e}},Fi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},La={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},CP=class extends Fn{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Fi},fillsFallback:Object.values({...Fi}),strokes:{...La},sequentialColors:$i(Fi),divergingColors:[Fi.GREEN,Fi.BLUE,Fi.RED],up:{fill:Fi.GREEN,stroke:La.GREEN},down:{fill:Fi.RED,stroke:La.RED},neutral:{fill:Fi.BLUE,stroke:La.BLUE},altUp:{fill:Fi.GREEN,stroke:La.GREEN},altDown:{fill:Fi.RED,stroke:La.RED},altNeutral:{fill:Fi.GRAY,stroke:La.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,Fi.BLUE),e.set(Li,Fi.BLUE),e.set(tr,"overlay"),e.set(ir,"left"),e.set(jl,"bottom"),e}},ei={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ta={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},kP=class extends rl{getDefaultColors(){return{...super.getDefaultColors(),fills:ei,fillsFallback:Object.values(ei),strokes:Ta,sequentialColors:$i(ei),divergingColors:[ei.ORANGE,ei.YELLOW,ei.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[ei.GREEN,ei.YELLOW,ei.RED],up:{fill:ei.GREEN,stroke:Ta.GREEN},down:{fill:ei.RED,stroke:Ta.RED},neutral:{fill:ei.GRAY,stroke:Ta.GRAY},altUp:{fill:ei.BLUE,stroke:Ta.BLUE},altDown:{fill:ei.RED,stroke:Ta.RED},altNeutral:{fill:ei.GRAY,stroke:Ta.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,ei.BLUE),e.set(Li,ei.BLUE),e}},ti={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Na={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},wP=class extends Fn{getDefaultColors(){return{...super.getDefaultColors(),fills:ti,fillsFallback:Object.values(ti),strokes:Na,sequentialColors:$i(ti),divergingColors:[ti.ORANGE,ti.YELLOW,ti.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[ti.GREEN,ti.YELLOW,ti.RED],up:{fill:ti.GREEN,stroke:Na.GREEN},down:{fill:ti.RED,stroke:Na.RED},neutral:{fill:ti.GRAY,stroke:Na.GRAY},altUp:{fill:ti.BLUE,stroke:Na.BLUE},altDown:{fill:ti.RED,stroke:Na.RED},altNeutral:{fill:ti.GRAY,stroke:Na.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,ti.BLUE),e.set(Li,ti.BLUE),e}},ct={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Oa={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},LP=class extends rl{getDefaultColors(){return{fills:ct,fillsFallback:Object.values(ct),strokes:Oa,sequentialColors:$i(ct),divergingColors:[ct.BLUE,ct.RED],hierarchyColors:[],secondSequentialColors:[ct.BLUE,ct.PURPLE,ct.MAGENTA,ct.PINK,ct.RED,ct.ORANGE,ct.YELLOW,ct.GREEN],secondDivergingColors:[ct.BLUE,ct.RED],secondHierarchyColors:[],up:{fill:ct.GREEN,stroke:Oa.GREEN},down:{fill:ct.RED,stroke:Oa.RED},neutral:{fill:ct.GRAY,stroke:Oa.GRAY},altUp:{fill:ct.BLUE,stroke:Oa.BLUE},altDown:{fill:ct.RED,stroke:Oa.RED},altNeutral:{fill:ct.GRAY,stroke:Oa.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,ct.BLUE),e.set(Li,ct.BLUE),e}},ht={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ea={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},TP=class extends Fn{getDefaultColors(){return{...super.getDefaultColors(),fills:ht,fillsFallback:Object.values(ht),strokes:Ea,sequentialColors:$i(ht),divergingColors:[ht.BLUE,ht.RED],hierarchyColors:[],secondSequentialColors:[ht.BLUE,ht.PURPLE,ht.MAGENTA,ht.PINK,ht.RED,ht.ORANGE,ht.YELLOW,ht.GREEN],secondDivergingColors:[ht.BLUE,ht.RED],secondHierarchyColors:[],up:{fill:ht.GREEN,stroke:Ea.GREEN},down:{fill:ht.RED,stroke:Ea.RED},neutral:{fill:ht.GRAY,stroke:Ea.GRAY},altUp:{fill:ht.BLUE,stroke:Ea.BLUE},altDown:{fill:ht.RED,stroke:Ea.RED},altNeutral:{fill:ht.GRAY,stroke:Ea.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,ht.BLUE),e.set(Li,ht.BLUE),e}},Lt={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"},Tr={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"},NP=class extends rl{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Lt,RED:Lt.ORANGE},fillsFallback:Object.values({...Lt,RED:Lt.ORANGE}),strokes:{...Tr,RED:Tr.ORANGE},sequentialColors:$i({...Lt,RED:Lt.ORANGE}),divergingColors:[Lt.ORANGE,Lt.YELLOW,Lt.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Lt.GREEN,Lt.YELLOW,Lt.ORANGE],up:{fill:Lt.GREEN,stroke:Tr.GREEN},down:{fill:Lt.ORANGE,stroke:Tr.ORANGE},neutral:{fill:Lt.GRAY,stroke:Tr.GRAY},altUp:{fill:Lt.BLUE,stroke:Tr.BLUE},altDown:{fill:Lt.ORANGE,stroke:Tr.ORANGE},altNeutral:{fill:Lt.GRAY,stroke:Tr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,Lt.BLUE),e.set(Li,Lt.BLUE),e}},Et={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"},Rs={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"},OP=class extends Fn{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Et,RED:Et.ORANGE},fillsFallback:Object.values({...Et,RED:Et.ORANGE}),strokes:{...Rs,RED:Rs.ORANGE},sequentialColors:$i({...Et,RED:Et.ORANGE}),divergingColors:[Et.ORANGE,Et.YELLOW,Et.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Et.GREEN,Et.YELLOW,Et.ORANGE],secondHierarchyColors:[],up:{fill:Et.GREEN,stroke:Rs.GREEN},down:{fill:Et.ORANGE,stroke:Rs.ORANGE},neutral:{fill:Rs.GRAY,stroke:Rs.GRAY},altUp:{fill:Et.BLUE,stroke:Rs.BLUE},altDown:{fill:Et.ORANGE,stroke:Rs.ORANGE},altNeutral:{fill:Et.GRAY,stroke:Rs.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,Et.BLUE),e.set(Li,Et.BLUE),e}},al={...mr,type:Ge("ordinal-time"),paddingInner:X,paddingOuter:X,groupPaddingInner:X,label:ed,parentLevel:Rf,interval:K0,crosshair:ga(!0,!0),bandHighlight:td,bandAlignment:P("justify","start","center","end")},hD={...Ro,...vc(E),type:Ge("angle-number"),crossLines:Tt(Cs),startAngle:E,endAngle:E,label:{...fr,orientation:P("fixed","parallel","perpendicular"),format:xn}},Dy={...Ro,type:Ge("angle-category"),shape:P("polygon","circle"),crossLines:Tt(Cs),startAngle:E,endAngle:E,paddingInner:X,groupPaddingInner:X,label:{...fr,orientation:P("fixed","parallel","perpendicular")}};Dy.innerRadiusRatio=X;var uD={...Ro,...vc(E),type:Ge("radius-number"),shape:P("polygon","circle"),positionAngle:E,innerRadiusRatio:X,crossLines:Tt({...Cs,label:{...Eo,positionAngle:E}},"cross-line options"),title:{enabled:L,text:ai,spacing:w,formatter:$t(ai),...Ce},label:{...fr,format:xn}},dD={...Ro,type:Ge("radius-category"),positionAngle:E,innerRadiusRatio:X,paddingInner:X,paddingOuter:X,groupPaddingInner:X,label:fr,crossLines:Tt({...Cs,label:{...Eo,positionAngle:E}},"cross-line options"),title:{enabled:L,text:ai,spacing:w,formatter:$t(ai),...Ce}},ol={lineStyle:P("solid","dashed","dotted"),...W},Ra={...j,...B,...W},qc={visible:L,locked:L,readOnly:L,handle:Ra,...Ce},Qd={position:P("top","center","bottom"),alignment:P("left","center","right"),...Ce},pD={position:P("top","inside","bottom"),alignment:P("left","center","right"),...Ce},EP={enabled:L,cornerRadius:w,...Ce,...j,...B,...W},RP={visible:L,...ol,...B},gD={divider:B,...j,...B,...Ce},fD={handle:Ra,statistics:gD,...ol,...j,...B},ep={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:Ra,text:Qd,...ol,...B},Ay={visible:L,locked:L,readOnly:L,axisLabel:EP,handle:Ra,text:Qd,...ol,...B},mD={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:Ra,text:pD,background:j,...ol,...B},yD={...mD},bD={...mD,middle:RP},Cy={label:Ce,showFill:L,isMultiColor:L,strokes:ee($),rangeStroke:$,bands:P(4,6,10),...ep},vD={...j,...B,...qc},xD={...j,...B,...qc},SD={...j,...B,...qc,background:{...j,...B}},ky={visible:L,locked:L,readOnly:L,handle:Ra,...j},tp={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:Ra,text:Qd,background:j,statistics:gD,...ol,...B},MD={visible:L,up:fD,down:fD},ll={enabled:L,axesButtons:{enabled:L,axes:P("x","y","xy")},toolbar:{enabled:L,padding:w,buttons:Tt({...qa,value:P("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:ee(ne(et({...qa,value:Z(P("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),et({...qa,value:Z(P("lock")),checkedOverrides:qa})))}};ll.data=J(Un),ll.xKey=J(O),ll.volumeKey=J(O),ll.snap=J(L);var rs={...j,...B,opacity:X},ID={...j,...B,...W,cornerRadius:w,whisker:{...B,...W},cap:{lengthRatio:X}},DD={...ID,opacity:X},AD=Ie({...j,...B,...W,cornerRadius:w,whisker:{...B,...W},cap:{lengthRatio:X}}),CD={direction:P("horizontal","vertical"),showInMiniChart:L,styler:AD,itemStyler:AD,tooltip:ke,...Se,...ID,highlight:st(DD,DD),segmentation:Za,width:Wn,widthRatio:X},wy={cornerRadius:w,wick:{...B,...W},...j,...B,...W},kD={...wy,opacity:X},wD={item:{up:wy,down:wy},itemStyler:Ie({...j,...B,...W,cornerRadius:w,wick:{...B,...W}}),showInMiniChart:L,tooltip:ke,...Se,highlight:st(kD,kD)},LD={fills:ee(Ai),strokes:ee($),label:{spacing:w,maxWidth:w,...Pe},link:{tension:X,itemStyler:Ie({...j,...B,...W,tension:X}),...j,...B,...W},node:{width:w,spacing:w,itemStyler:Ie({...j,...B,...W}),...j,...B,...W},tooltip:ke,...Se},TD={direction:P("horizontal","vertical"),fills:ee(Ai),strokes:ee($),label:{spacing:w,placement:P("before","middle","after"),...Pe},stageLabel:{placement:P("before","after"),format:xn,...fr},tooltip:ke,...K(Se,["showInLegend"]),...K(j,["fill"]),...K(B,["stroke"]),...W,highlight:Op(Us)},ND={direction:P("horizontal","vertical"),fills:ee(Ai),strokes:ee($),itemStyler:Ie({...j,...B,...W}),spacingRatio:X,crisp:L,dropOff:{enabled:L,...j,...B,...W},stageLabel:{placement:P("before","after"),format:xn,...fr},label:Pe,tooltip:ke,shadow:Kn,...K(Se,["showInLegend"]),...K(j,["fill"]),...K(B,["stroke"]),...W},OD={title:O,textAlign:P("left","center","right"),verticalAlign:P("top","middle","bottom"),itemPadding:w,itemStyler:Ie({...j,...B}),showInMiniChart:L,label:Ys,tooltip:ke,...Se,...B},ED={showInMiniChart:L,itemStyler:Ie({...B,...W}),item:{up:{...B,...W},down:{...B,...W}},tooltip:ke,...Se,highlight:st(Us,Us)},RD={maxStrokeWidth:w,itemStyler:Ie({...B,...W}),sizeDomain:ee(w),label:Pe,tooltip:ke,...Se,...B,...W,highlight:st(Us,Us)},PD={...B,...W},FD={colorRange:ee($),maxSize:w,sizeDomain:ee(w),label:{placement:P("top","bottom","left","right"),...Pe},tooltip:ke,...Se,...K(Mn,["enabled"]),highlight:st(We,We)},VD={colorRange:ee($),padding:w,itemStyler:Ie({...j,...B,...W}),label:Ys,tooltip:ke,...Se,...j,...B,...W,highlight:st(We,We)},BD={...Se,...j,...B,...W},cl=Ie({...j,...B,...W,cornerRadius:w}),_D={cornerRadius:w,styler:cl,itemStyler:cl,label:Pe,tooltip:ke,...Se,...j,...B,...W,highlight:st(bn,bn)},zD={direction:P("horizontal","vertical"),aspectRatio:w,spacing:w,reverse:L,itemStyler:Ie({...j,...B,...W}),fills:ee(Ai),strokes:ee($),label:Pe,stageLabel:{spacing:w,placement:P("before","after"),...Pe},tooltip:ke,shadow:Kn,...Se,...K(j,["fill"]),...K(B,["stroke"]),...W},GD={connectMissingData:L,marker:Mn,styler:Ie({marker:Ks,...j,...B,...W}),label:Pe,tooltip:ke,...Se,...j,...B,...W,highlight:st(We,We)},jD={connectMissingData:L,marker:Mn,styler:Ie({marker:Ks,...B,...W}),label:Pe,tooltip:ke,...Se,...B,...W,highlight:st(We,Us)},HD={cornerRadius:w,styler:cl,itemStyler:cl,label:Pe,tooltip:ke,...Se,...j,...B,...W,highlight:st(bn,bn)},$D={cornerRadius:w,columnWidthRatio:X,maxColumnWidthRatio:X,styler:cl,itemStyler:cl,label:Pe,tooltip:ke,...Se,...j,...B,...W,highlight:st(bn,bn)},PP={marker:Mn,...B,...W},UD={marker:{enabled:L,...Ks},...B,...W},WD={marker:Ks,...B,...W},KD={showInMiniChart:L,connectMissingData:L,interpolation:Fh,label:{...Pe,placement:P("inside","outside"),spacing:w},tooltip:ke,shadow:Kn,...Se,...j,...PP,item:{low:{...UD},high:{...UD}},styler:Ie({...j,item:{low:{...WD},high:{...WD}}}),highlight:st(We,We),segmentation:Za,invertedStyle:{enabled:L,...j}},YD=Ie({...j,...B,...W,cornerRadius:w}),ZD={direction:P("horizontal","vertical"),grouped:L,showInMiniChart:L,cornerRadius:w,styler:YD,itemStyler:YD,label:{...Pe,placement:P("inside","outside"),spacing:w},tooltip:ke,shadow:Kn,...Se,...j,...B,...W,highlight:st(bn,bn),segmentation:Za,width:Wn,widthRatio:X},XD={fills:ee(Ai),strokes:ee($),label:{...Pe,spacing:w,placement:P("left","right","center"),edgePlacement:P("inside","outside")},link:{itemStyler:Ie({...j,...B,...W}),...j,...B,...W},node:{width:w,spacing:w,minSpacing:Ae(w,_b("spacing")),alignment:P("left","center","right","justify"),verticalAlignment:P("top","bottom","center"),sort:P("data","ascending","descending","auto"),itemStyler:Ie({...j,...B,...W}),...j,...B,...W},tooltip:ke,...Se},qD={fills:ee(Ai),strokes:ee($),colorRange:ee($),sectorSpacing:w,cornerRadius:w,padding:w,itemStyler:Ie({...j,...B}),label:{spacing:w,...Ys},secondaryLabel:Ys,tooltip:ke,...K(Se,["highlight","showInLegend"]),...K(j,["fill"]),...K(B,["stroke"]),highlight:{highlightedItem:rs,highlightedBranch:rs,unhighlightedItem:rs,unhighlightedBranch:rs}},JD={fills:ee(Ai),strokes:ee($),colorRange:ee($),itemStyler:Ie({...j,...B}),group:{gap:w,padding:w,cornerRadius:w,textAlign:P("left","center","right"),interactive:L,highlight:{highlightedItem:rs,unhighlightedItem:rs},label:{...Pe,spacing:w},...j,...B},tile:{gap:w,padding:w,cornerRadius:w,textAlign:P("left","center","right"),verticalAlign:P("top","middle","bottom"),label:{...Pe,spacing:w,lineHeight:w,minimumFontSize:w,wrapping:P("never","always","hyphenate","on-space"),overflowStrategy:P("ellipsis","hide")},secondaryLabel:{...Pe,lineHeight:w,minimumFontSize:w,wrapping:P("never","always","hyphenate","on-space"),overflowStrategy:P("ellipsis","hide")},highlight:{highlightedItem:rs,highlightedBranch:rs,unhighlightedItem:rs,unhighlightedBranch:rs},...j,...B},tooltip:ke,...K(Se,["highlight","showInLegend"])},Ly={name:O,cornerRadius:w,itemStyler:Ie({...j,...B,...W,cornerRadius:w}),label:{...Pe,placement:P("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:w},tooltip:ke,shadow:Kn,...j,...B,...W},QD={direction:P("horizontal","vertical"),showInMiniChart:L,item:{positive:Ly,negative:Ly,total:Ly},line:{enabled:L,...B,...W},tooltip:ke,width:Wn,widthRatio:X,...Se},ip=et({__type:Z(Ge("date")),value:ne(O,E)},"a serializable date object"),eA={width:w,height:w,grip:L,fill:$,stroke:$,strokeWidth:w,cornerRadius:w},we={enabled:L,height:w,spacing:w,cornerRadius:E,mask:{fill:$,fillOpacity:X,stroke:$,strokeWidth:w},minHandle:eA,maxHandle:eA,miniChart:{enabled:L,padding:{top:w,bottom:w},label:{enabled:L,avoidCollisions:L,spacing:w,format:xn,formatter:$t(ai),interval:{minSpacing:w,maxSpacing:w,values:Un,step:E},...Ce},series:ue}},Ty={...j,...B,...W,cornerRadius:w,opacity:X},tA={...Ty,minSize:w,hoverStyle:{fill:j.fill,stroke:B.stroke}},iA={enabled:L,thickness:w,spacing:w,tickSpacing:w,visible:P("auto","always","never"),placement:P("outer","inner"),track:Ty,thumb:tA},FP={...iA,position:P("top","bottom")},VP={...iA,position:P("left","right")},pi={enabled:L,thickness:w,spacing:w,tickSpacing:w,visible:P("auto","always","never"),placement:P("outer","inner"),track:Ty,thumb:tA,horizontal:FP,vertical:VP},Pa=K(H0,["type","value","range"]),gi={number:{...K(Vo,["type","crossLines"]),top:K(Vo,["type","crossLines","position"]),right:K(Vo,["type","crossLines","position"]),bottom:K(Vo,["type","crossLines","position"]),left:K(Vo,["type","crossLines","position"]),crossLines:Pa},log:{...K(Bo,["type","crossLines"]),top:K(Bo,["type","crossLines","position"]),right:K(Bo,["type","crossLines","position"]),bottom:K(Bo,["type","crossLines","position"]),left:K(Bo,["type","crossLines","position"]),crossLines:Pa},category:{...K(Po,["type","crossLines"]),top:K(Po,["type","crossLines","position"]),right:K(Po,["type","crossLines","position"]),bottom:K(Po,["type","crossLines","position"]),left:K(Po,["type","crossLines","position"]),crossLines:Pa},time:{...K(_o,["type","crossLines"]),top:K(_o,["type","crossLines","position"]),right:K(_o,["type","crossLines","position"]),bottom:K(_o,["type","crossLines","position"]),left:K(_o,["type","crossLines","position"]),crossLines:Pa},"unit-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:Pa},"grouped-category":{...K(Fo,["type"]),top:K(Fo,["type","position"]),right:K(Fo,["type","position"]),bottom:K(Fo,["type","position"]),left:K(Fo,["type","position"]),crossLines:Pa},"ordinal-time":{...K(al,["type","crossLines"]),top:K(al,["type","crossLines","position"]),right:K(al,["type","crossLines","position"]),bottom:K(al,["type","crossLines","position"]),left:K(al,["type","crossLines","position"]),crossLines:Pa}},hl={"angle-category":{...K(Dy,["type","crossLines"]),crossLines:K(Cs,["type"])},"angle-number":{...K(hD,["type","crossLines"]),crossLines:K(Cs,["type"])},"radius-category":{...K(dD,["type","crossLines"]),crossLines:{...K(Cs,["type"]),label:{...Eo,positionAngle:E}}},"radius-number":{...K(uD,["type","crossLines"]),crossLines:{...K(Cs,["type"]),label:{...Eo,positionAngle:E}}}},Oe={visible:J(L)},BP={common:{...se,navigator:we,scrollbar:pi,axes:{...gi,...hl},annotations:{...ll,line:ep,"horizontal-line":Ay,"vertical-line":Ay,"disjoint-channel":yD,"parallel-channel":bD,"fibonacci-retracement":Cy,"fibonacci-retracement-trend-based":Cy,callout:vD,comment:xD,note:SD,text:qc,arrow:ep,"arrow-up":ky,"arrow-down":ky,"date-range":tp,"price-range":tp,"date-price-range":tp,"quick-date-price-range":MD},chartToolbar:{enabled:L},initialState:{legend:Tt({visible:L,seriesId:O,itemId:O,legendItemName:O},"legend state array"),zoom:{rangeX:{start:ne(E,ip),end:ne(E,ip)},rangeY:{start:ne(E,ip),end:ne(E,ip)},ratioX:{start:X,end:X},ratioY:{start:X,end:X},autoScaledAxes:ee(Ge("y"))}}},line:{...se,axes:gi,series:uf,navigator:we,scrollbar:pi,...Oe},scatter:{...se,axes:gi,series:zI,navigator:we,scrollbar:pi,...Oe,paired:J(L)},bubble:{...se,axes:gi,series:EI,navigator:we,scrollbar:pi,...Oe},area:{...se,axes:gi,series:Yx,navigator:we,scrollbar:pi,...Oe},bar:{...se,axes:gi,series:hf,navigator:we,scrollbar:pi,...Oe},"box-plot":{...se,axes:gi,series:CD,navigator:we,scrollbar:pi,...Oe},candlestick:{...se,axes:gi,series:wD,navigator:we,scrollbar:pi,...Oe},"cone-funnel":{...se,axes:gi,series:TD,navigator:we,scrollbar:pi,...Oe},funnel:{...se,axes:gi,series:ND,navigator:we,scrollbar:pi,...Oe},ohlc:{...se,axes:gi,series:ED,navigator:we,scrollbar:pi,...Oe},histogram:{...se,axes:K(gi,["category","grouped-category","unit-time","ordinal-time"]),series:FI,navigator:we,scrollbar:pi,...Oe},heatmap:{...se,axes:gi,series:OD,navigator:we,scrollbar:pi,...Oe},waterfall:{...se,axes:gi,series:QD,navigator:we,scrollbar:pi,...Oe},"range-bar":{...se,axes:gi,series:ZD,navigator:we,scrollbar:pi,...Oe},"range-area":{...se,axes:gi,series:KD,navigator:we,scrollbar:pi,...Oe},donut:{...se,series:QI,navigator:we,...Oe},pie:{...se,series:by,navigator:we,...Oe},"radar-line":{...se,axes:hl,series:jD,navigator:we,...Oe},"radar-area":{...se,axes:hl,series:GD,navigator:we,...Oe},"radial-bar":{...se,axes:hl,series:HD,navigator:we,...Oe},"radial-column":{...se,axes:hl,series:$D,navigator:we,...Oe},nightingale:{...se,axes:hl,series:_D,navigator:we,...Oe},sunburst:{...se,series:qD,navigator:we,...Oe},treemap:{...se,series:JD,navigator:we,...Oe},"map-shape":{...se,series:VD,navigator:we,...Oe},"map-line":{...se,series:RD,navigator:we,...Oe},"map-marker":{...se,series:FD,navigator:we,...Oe},"map-shape-background":{...se,series:BD,navigator:we,...Oe},"map-line-background":{...se,series:PD,navigator:we,...Oe},sankey:{...se,series:XD,navigator:we,...Oe},chord:{...se,series:LD,navigator:we,...Oe},pyramid:{...se,series:zD,navigator:we,...Oe},"radial-gauge":{...se,...Uh,targets:K(Hh,["value"]),tooltip:{...Uh.tooltip,...se.tooltip}},"linear-gauge":{...se,...$h,targets:K(jh,["value"]),tooltip:{...$h.tooltip,...se.tooltip}}};function np(e,t){const i={};for(const n of Reflect.ownKeys(e))i[n]=t(e[n],n,e);return i}var _P=np(BP,function e(t,i){if(wl(i))return t;if($n(t))return ne(t,Rl,wl);if(le(t))return ne(et(Nl in t?np(t,n=>le(n)?np(n,e):n):np(t,e)),Rl,wl);throw new Error(`Invalid theme override value: ${String(t)}`)}),ii={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Fa={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},zP=class extends rl{getDefaultColors(){return{fills:ii,fillsFallback:Object.values(ii),strokes:Fa,sequentialColors:$i(ii),divergingColors:[ii.ORANGE,ii.YELLOW,ii.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ii.GREEN,ii.YELLOW,ii.RED],secondHierarchyColors:[],up:{fill:ii.GREEN,stroke:Fa.GREEN},down:{fill:ii.RED,stroke:Fa.RED},neutral:{fill:ii.GRAY,stroke:Fa.GRAY},altUp:{fill:ii.BLUE,stroke:Fa.BLUE},altDown:{fill:ii.ORANGE,stroke:Fa.ORANGE},altNeutral:{fill:ii.GRAY,stroke:Fa.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,ii.BLUE),e.set(Li,ii.BLUE),e}},ni={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Va={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},GP=class extends Fn{getDefaultColors(){return{...super.getDefaultColors(),fills:ni,fillsFallback:Object.values(ni),strokes:Va,sequentialColors:$i(ni),divergingColors:[ni.ORANGE,ni.YELLOW,ni.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ni.GREEN,ni.YELLOW,ni.RED],secondHierarchyColors:[],up:{fill:ni.GREEN,stroke:Va.GREEN},down:{fill:ni.RED,stroke:Va.RED},neutral:{fill:ni.GRAY,stroke:Va.GRAY},altUp:{fill:ni.BLUE,stroke:Va.BLUE},altDown:{fill:ni.ORANGE,stroke:Va.ORANGE},altNeutral:{fill:ni.GRAY,stroke:Va.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(wi,ni.BLUE),e.set(Li,ni.BLUE),e}},Ny=Wt(()=>new Fn),jP=ce.create(!0,"perf"),Vn=(e,t,i)=>{jP("[CACHE] ChartTheme",e,t.name,i)},Oy={"ag-default-dark":Wt(()=>new rl),"ag-sheets-dark":Wt(()=>new NP,Vn),"ag-polychroma-dark":Wt(()=>new LP,Vn),"ag-vivid-dark":Wt(()=>new zP,Vn),"ag-material-dark":Wt(()=>new kP,Vn),"ag-financial-dark":Wt(()=>new AP,Vn),"ag-default":Ny,"ag-sheets":Wt(()=>new OP,Vn),"ag-polychroma":Wt(()=>new TP,Vn),"ag-vivid":Wt(()=>new GP,Vn),"ag-material":Wt(()=>new wP,Vn),"ag-financial":Wt(()=>new CP,Vn)},sp=Wt(HP,Vn);function HP(e){if(e instanceof Fn)return e;if(!KP(e))return Ny();if(e==null||typeof e=="string"){const s=Oy[e??"ag-default"];if(s)return s();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=Ft($P(e),UP,"theme");for(const s of i)_.warnOnce(String(s));const n=t?.baseTheme?sp(t.baseTheme):Ny();return t?new n.constructor(t):n}function $P(e){if(!le(e)||!le(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:be(...s),params:n,palette:i}}var UP={baseTheme:ne(O,$s),overrides:_P,params:{accentColor:$,axisColor:$,backgroundColor:$,borderColor:$,borderRadius:E,chartBackgroundColor:$,chartPadding:E,focusShadow:O,foregroundColor:$,fontFamily:Lh,fontSize:E,fontWeight:Pl,gridLineColor:$,popupShadow:O,subtleTextColor:$,textColor:$,separationLinesColor:$,chromeBackgroundColor:$,chromeFontFamily:Lh,chromeFontSize:E,chromeFontWeight:Pl,chromeSubtleTextColor:$,chromeTextColor:$,buttonBackgroundColor:$,buttonBorder:L,buttonFontWeight:Pl,buttonTextColor:$,inputBackgroundColor:$,inputBorder:L,inputTextColor:$,menuBackgroundColor:$,menuBorder:L,menuTextColor:$,panelBackgroundColor:$,panelSubtleTextColor:$,tooltipBackgroundColor:$,tooltipBorder:L,tooltipTextColor:$,tooltipSubtleTextColor:$,crosshairLabelBackgroundColor:$,crosshairLabelTextColor:$},palette:{fills:ee(Ai),strokes:ee($),up:{fill:ne($,wh),stroke:$},down:{fill:ne($,wh),stroke:$},neutral:{fill:ne($,wh),stroke:$}}},WP=P("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 KP(e){const{invalid:t}=Ft({theme:e},{theme:ne(WP,$s)});for(const i of t)_.warnOnce(String(i));return t.length===0}var Je="path",pn="pathArray",Ye="default",Vi="override",si="user",Nr="userPartial",as="operation",os="operationValue",ul="dependency",Ey="autoEnable",nA="autoEnableValue",sA="prune",rA="childrenSource";function Ry(e){return ji(e)&&e>=0&&e<=1}function Jc(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 Gt(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 dl(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<r;o++){const l=t[o],c=t[o+1];let h=s[l];(h==null||!Cl(h))&&(h=Number.isNaN(Number(c))?{}:[],s[l]=h),s=h}s[a]=i}var YP=/^\d+$/;function ZP(e,t=0){let i=0;for(let n=e.length-1;n>=0;n--){const s=e[n];if(YP.test(s)&&(i++,i>t))return n}return-1}function pl(e,t=0){const i=ZP(e,t);return Number(e[i])}function Ba(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=pl(e);if(Number.isNaN(o))return ls;s.push(`${o}`)}else if(a==="$prevIndex"){const o=pl(e);if(Number.isNaN(o)||Number(o)<=0)return ls;s.push(`${Number(o)-1}`)}else if(a.startsWith("$")){const o=i?.[a.slice(1)];if(o==null)return ls;s.push(o)}else a.length!==0&&s.push(a);r=a===".."}return s}var ls=Symbol("unresolvable-path"),Bi=Symbol("resolved-to-branch");function Qc(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(cA.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function XP(e,t,i){const n=Qc(e.getVertexValue(i));switch(n?.operation){case"$path":{const[s]=n.values,r=e.getPathArray(t),a=Ba(r,s);return a===ls?void 0:e.findVertexAtPath(a)}case"$value":return t}}var qP={$cacheMax:JP};function JP(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 QP={$hasSeriesType:{dependencies:Py,resolve:e2},$isChartType:{dependencies:Py,resolve:i2},$isSeriesType:{dependencies:Py,resolve:t2}};function Py(e,t,i){const n=e.findVertexAtPath(["series","0","type"]);n&&e.addEdge(t,n,ul)}function e2(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 t2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return e.getResolvedPath(["series","0","type"])===s}function i2(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=Q.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 n2={$foregroundBackgroundMix:s2,$foregroundOpacity:r2,$interpolate:a2,$isGradient:o2,$isImage:l2,$isPattern:c2,$mix:h2};function s2(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"&&Ry(s))return Ne.mix(Ne.fromString(r),Ne.fromString(a),1-s).toString();ce.inDevelopmentMode(()=>_.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(s)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function r2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),r=e.getParamValue("foregroundColor");if(typeof r=="string"&&Ry(s)){const a=Ne.fromString(r);return new Ne(a.r,a.g,a.b,s).toString()}ce.inDevelopmentMode(()=>_.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(s)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function a2(e,t,i){const[n,s]=i,r=e.resolveVertexValue(t,n),a=e.resolveVertexValue(t,s);if(!(!ae(r)||!ji(a)))return Ne.interpolate(r.map(o=>Ne.fromString(o)),a).map(o=>o.toString())}function o2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Wi(s)}function l2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return ra(s)}function c2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Ms(s)}function h2(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"||!Ry(l)){ce.inDevelopmentMode(()=>_.warnOnce(u));return}if(typeof a=="string")try{return Ne.mix(Ne.fromString(a),Ne.fromString(o),l).toString()}catch{ce.inDevelopmentMode(()=>_.warnOnce(u));return}if(!Wi(a)){ce.inDevelopmentMode(()=>_.warnOnce(u));return}let d=a.colorStops;try{d=d?.map(p=>{let g;return typeof p.color=="string"&&(g=Ne.mix(Ne.fromString(p.color),Ne.fromString(o),l).toString()),{...p,color:g}})}catch{ce.inDevelopmentMode(()=>_.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...a,colorStops:d}}var u2={$rem:d2};function d2(e,t,i){const[n]=i,s=e.getVertexValue(n),r=e.getParamValue("fontSize");if(typeof r=="number"&&typeof s=="number")return Math.round(s*r);ce.inDevelopmentMode(()=>_.warnOnce(`\`$rem\` json operation failed on [${String(s)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var p2={$and:g2,$eq:f2,$every:m2,$greaterThan:y2,$if:b2,$lessThan:v2,$not:x2,$or:S2,$some:M2,$switch:I2};function g2(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 f2(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 m2(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 y2(e,t,i){const[n,s]=i;return e.resolveVertexValue(t,n)>e.resolveVertexValue(t,s)}function b2(e,t,i){const[n,s,r]=i,o=e.resolveVertexValue(t,n)?s:r,l=e.neighboursWithEdgeValue(o,Je);if(l)for(const c of l)e.addEdge(t,c,Je);return e.resolveVertexValue(t,o)}function v2(e,t,i){const[n,s]=i;return e.resolveVertexValue(t,n)<e.resolveVertexValue(t,s)}function x2(e,t,i){const[n]=i;if(n)return!e.resolveVertexValue(t,n)}function S2(e,t,i){for(const n of i){const s=e.resolveVertexValue(t,n);if(i.length===1&&Array.isArray(s))return s.some(r=>!!r);if(s)return!0}return!1}function M2(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 I2(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 D2={$isUserOption:A2,$palette:C2,$mapPalette:k2,$path:{dependencies:lA,resolve:w2},$pathString:{dependencies:lA,resolve:L2},$ref:T2};function A2(e,t,i){const[n,s,r]=i,a=e.neighboursWithEdgeValue(n,Je);if(a)for(const o of a){const l=e.findNeighbour(o,Ye);if(l&&aA(e,t,l))return e.resolveVertexValue(t,s)}else if(aA(e,t,n))return e.resolveVertexValue(t,s);return e.resolveVertexValue(t,r)}function aA(e,t,i){const n=e.resolveVertexValue(t,i);if(!dt(n))throw new Error(`\`$isUserOption\` json operation failed on [${String(n)}], expecting a string.`);const s=e.getPathArray(t),r=Ba(s,n);return r===ls?!1:e.hasUserOption(r)}var oA=new Set(["fill","fillFallback","stroke","gradient","range2"]);function C2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);if(!dt(s))return;if(oA.has(s)){const a=e.getPathArray(t),o=pl(a);if(Number.isNaN(o))return;switch(s){case"fill":return mn(e.palette.fills,1,o)[0];case"fillFallback":return mn(e.palette.fillsFallback,1,o)[0];case"stroke":return mn(e.palette.strokes,1,o)[0];case"gradient":return mn(e.palette.sequentialColors,1,o)[0];case"range2":return mn(e.palette.fills,2,o)}return}if(s==="gradients")return e.palette.sequentialColors;if(s==="type")return e.paletteType;const r=Gt(e.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function k2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);if(!dt(s))return;if(oA.has(s)){const a=e.getPathArray(t);let o=pl(a),l=0;const c=["series","0","type"];for(let h=0;h<o;h++){c[1]=`${h}`;const u=e.getResolvedPath(c);(u==="map-shape-background"||u==="map-line-background")&&l++}if(o-=l,Number.isNaN(o))return;switch(s){case"fill":return mn(e.palette.fills,1,o)[0];case"fillFallback":return mn(e.palette.fillsFallback,1,o)[0];case"stroke":return mn(e.palette.strokes,1,o)[0];case"gradient":return mn(e.palette.sequentialColors,1,o)[0];case"range2":return mn(e.palette.fills,2,o)}return}if(s==="gradients")return e.palette.sequentialColors;if(s==="type")return e.paletteType;const r=Gt(e.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function lA(e,t,i){const[n]=i,s=e.getVertexValue(n);if(dt(s)){const r=e.getPathArray(t),a=Ba(r,s);if(a===ls)return;const o=e.findVertexAtPath(a);o&&e.addEdge(t,o,ul)}}function w2(e,t,i){const n=i.length>1,s=i.length>2,[r,a,o]=i,l=e.resolveVertexValue(t,r),c=s?e.resolveVertexValue(t,o):null;if(!dt(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),u=Ba(h,l);if(u===ls)return;const d=c?Gt(c,u):e.getResolvedPath(u);if(d!=null)return d;if(n)return e.resolveVertexValue(t,a)}function L2(e,t,i){const[n,s]=i,r=e.resolveVertexValue(t,n);if(!dt(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=Ba(o,r,a);if(l===ls)throw new Error(`Unresolvable path [${r}] at [${o.join(".")}]`);return l}function T2(e,t,i){const[n]=i,s=e.getVertexValue(n);return e.getParamValue(s)}var N2={$apply:O2,$applyCycle:E2,$applySwitch:R2,$applyTheme:P2,$clone:F2,$findFirstSiblingNotOperation:V2,$map:B2,$merge:_2,$omit:z2,$size:G2,$shallow:H2,$shallowSimple:j2,$value:$2};function O2(e,t,i){const[n,s,r,a]=i,o=e.getVertexValue(n);if(!xe(o))return;const l=s?e.getVertexValue(s):void 0,c=e.neighboursWithEdgeValue(t,Je),h=c&&c.length>0;if(!h&&l==null)return Bi;const u=r?e.resolveVertexValue(t,r):void 0,d=a?e.resolveVertexValue(t,a):void 0;if(!h&&l!=null)if(Qc(l)){const p=e.resolveVertexValue(t,s);xe(p)&&e.graftObject(t,p,[u,d])}else e.graftObject(t,l,[u,d]);if(!h)return Bi;for(const p of c){const g=e.neighboursWithEdgeValue(p,Je);if(!g||g.length===0){const f=e.addVertex({});e.addEdge(p,f,Ye)}else e.graftObject(p,o,[u,d])}return Bi}function E2(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:si,u=l??e.resolveVertexValue(t,s);if(!Array.isArray(u))return;const d=r?e.getVertexValue(r):void 0;for(let p=0;p<a;p++){const g=u[p%u.length];g!=null&&((l||!c)&&e.graftValue(t,`${p}`,g,void 0,h),d&&e.graftValue(t,`${p}`,d,g,h))}return Bi}function R2(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 e.graftObject(t,h,[],Ye),Bi}return e.resolveVertexValue(t,s)}function P2(e,t,i){const[n,s,r]=i;let a=e.getVertexValue(n);if(typeof a=="string"&&(a=[a]),!Array.isArray(a))return;const o=e.neighboursWithEdgeValue(t,Je),l=r?e.getVertexValue(r):[],c=Array.isArray(l)?new Set(l):new Set;if(!o)return Bi;for(const h of o){const u=e.graftAndResolveOrphan(h,s);for(const d of a){const p=Ba([],d,u);p!==ls&&e.graftConfig(h,p,c)}}return Bi}function F2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);if(xe(s))return e.graftObject(t,s,void 0,si),Bi}function V2(e,t,i){const[n]=i,s=e.getPathArray(t),r=Ba(s,"..");if(r===ls)return;const a=e.findVertexAtPath(r);if(!a)return e.resolveVertexValue(t,n);const o=e.neighboursWithEdgeValue(a,Je);if(o)for(const l of o){const c=e.getPathArray(l);if(c[r.length]===s[r.length])continue;const h=c.concat(s.slice(r.length+1)),u=e.findVertexAtPath(h);if(!u)continue;const d=e.findNeighbourValue(u,si);if(d!=null)return d;const p=e.findNeighbourValue(u,Vi);if(p!=null)return p}return e.resolveVertexValue(t,n)}function B2(e,t,i){const[n,s]=i,r=e.getVertexValue(n),a=e.resolveVertexValue(t,s);if(!Array.isArray(a))return;const o=e.neighboursWithEdgeValue(t,Je);if(o&&o.length>0)return;let l=0;for(const c of a)e.graftValue(t,`${l}`,r,c),l++;return Bi}function _2(e,t,i){for(const n of i){const s=e.resolveVertexValue(t,n);xe(s)&&e.graftObject(t,s)}return Bi}function z2(e,t,i){const[n,s]=i;let r=e.getVertexValue(n);if(!Array.isArray(r)){const o=XP(e,t,s);if(!o)return;r=e.resolveVertexValue(o,n)}const a=e.resolveVertexValue(t,s);if(!(!Array.isArray(r)||!xe(a)))return K(a,r)}function G2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Cl(s)?"length"in s?s.length:Object.keys(s).length:0}function j2(e,t,i){const n=[];for(const s of i)n.push(e.getVertexValue(s));return n}function H2(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]),Bi):(e.graftObject(t,r),Bi)}function $2(e,t,i){const[n]=i,s=e.getVertexValue(n),r=e.getPathArray(t);if(s==="$index")return pl(r);if(s==="$parentIndex")return pl(r,1);if(s==="$1")return e.resolveValue$1(r)}var U2={$isEven:W2};function W2(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return Number.isNaN(Number(s))?!1:Number(s)%2===0}var eh={...qP,...QP,...n2,...u2,...D2,...p2,...U2,...N2},cA=new Set(Object.keys(eh));function th(e){return cA.has(e)}var je=ce.create("opts","options-graph"),K2=Wt(Y2);function Y2(e,t){return je.group("OptionsGraph.constructor()",()=>{const i=new hA(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 Or=class Ht extends Wv{constructor(t={},i={},n=void 0,s={},r=void 0,a=new Map){super(Je,as,new Set([Nr,si])),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=le(i?.theme)?aD(i.theme?.palette):"inbuilt";const o=i.series?.[0]?.type??"line";je("build user"),this.buildGraphFromObject(this.root,si,K(i,["theme"])),je("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&&(je("build series overrides"),this.buildGraphFromObject(this.root,Vi,l));const c=r?K(r.common,Ht.COMPLEX_KEYS):{};Object.keys(c).length>0&&(je("build common overrides"),this.buildGraphFromObject(this.root,Vi,Q.getSeriesModule(o)?.chartType==="cartesian"?c:K(c,["zoom","navigator"]))),n&&(je("build params"),this.buildGraphFromObject(this.params,Ye,n));const h=this.findNeighbourWithValue(this.root,"axes",Je),u=this.findNeighbourWithValue(this.root,"series",Je);h&&(je("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&&(je("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&&(je("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&&(je("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&&(je("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&&(je("build annotations overrides"),this.buildGraphFromObject(this.root,Vi,{annotations:f})),this.buildDependencyGraph()}static clearValueCache(){Ht.valueCache.clear()}clear(){je.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,je("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return je.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},je("resolve params"),this.resolveVertex(this.params,this.resolvedParams),je("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),je("resolve root"),this.resolveVertex(this.root),je("resolved root",this.resolved),je("vertex count",this.getVertexCount()),je("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(je.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,pn);if(this.userPartialOptions={},dl(this.userPartialOptions,t,i),r)for(const p of Object.keys(r)){const g=r[p],f=Gt(i,[p]);f!=null&&(dl(i,g,f),dl(this.userPartialOptions,[...t,...g],f),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=Nr,this.edgePriority=[Nr,...Ht.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(o,Nr,i,l);for(const p of a){const g=r?.[p]?this.findVertexAtPath([...t,...r[p]]):this.findNeighbourWithValue(o,p,Je);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=Gt(c,[...t,...g]);dl(c,[...t,p],f)}const h=Gt(c,t),d=n?.pick??!0?zh(Gt(c,t),a):h;return je("vertex count",this.getVertexCount()),je("edge count",this.getEdgeCount()),je("resolved partial",d),je.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,Je);if(n)return this.cachedPathVertices.set(i,n),n}hasUserOption(t){if(Jc(this.userOptions,t))return!0;const n=this.findVertexAtPath(t);if(n){if(this.findNeighbour(n,si)!=null||this.findNeighbour(n,Nr)!=null)return!0;const s=this.findNeighbourValue(n,rA);return s===si||s===Nr}return!1}dangerouslyGetUserOption(t){if(this.userPartialOptions){const i=Gt(this.userPartialOptions,t);if(i!=null)return i}return Gt(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(Jc(this.overrides,["common","axes",i,...t.slice(2)]))return!0;const n=this.getResolvedPath(["series","0","type"]);return Jc(this.overrides,[n,"axes",i,...t.slice(2)])}if(t[0]==="series"&&t.length>1){const i=this.getResolvedPath(["series",t[1],"type"]);return Jc(this.overrides,[i,"series",...t.slice(2)])}return Jc(this.overrides,t)}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],Je);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,pn)??[]}getResolvedPath(t){return Gt(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),sA)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,as);if(n&&th(n)){const r=this.neighboursWithEdgeValue(i,os),a=eh[n],l=(typeof a=="function"?a:a.resolve)?.(this,t,r??[]);return l===Bi?void 0:l}let s=this.getVertexValue(i);if(Array.isArray(s)){const r={};this.resolveVertexChildren(i,r),s=Gt(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=Gt(this.config,i),r=this.findNeighbour(t,pn);if(le(s)&&this.buildGraphFromObject(t,Ye,s,r,void 0,n),this.overrides){const a=Gt(this.overrides,i);le(a)&&this.buildGraphFromObject(t,Vi,a,r,void 0,n);const o=Gt(this.overrides,["common",...i.slice(1)]);le(o)&&this.buildGraphFromObject(t,Vi,o,r,void 0,n)}this.buildDependencyGraph()}graftObject(t,i,n,s=this.graftEdge){const r=this.findNeighbour(t,pn);if(this.buildGraphFromObject(t,s,i,r),this.overrides&&n)for(const a of n){if(a==null)continue;const o=Gt(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),Gt(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),Gt(a,c)}buildGraphFromObject(t,i,n,s,r=Ht.SHALLOW_KEYS,a){const o=Object.keys(n),l=Qc(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),rA);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===si&&s||i!==Ye&&i!==si&&i!==Nr&&i!==Vi)return;let r=this.findNeighbour(t,Ey);r||(r=this.addVertex(Ey),this.addEdge(t,r,Ey)),s&&this.addEdge(s,r,nA);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,Je);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,Je);let o=this.findNeighbour(i,pn);o||(o=this.addVertex([...s]),this.addEdge(i,o,pn));const l=Qc(r);if(l){const c=this.addVertex(r);this.addEdge(i,c,n),this.addEdge(c,o,pn),this.buildGraphFromOperation(c,n,l,o)}else if(Cl(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,Je);let a=this.findNeighbour(i,pn);a||(a=this.addVertex([...s]),this.addEdge(i,a,pn));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,as);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,pn),this.addEdge(t,r,os);const a=Qc(i);a?this.buildGraphFromOperation(r,n,a,s):Cl(i)&&this.buildGraphFromObject(r,n,i,s)}buildDependencyGraph(){for(let t=0;t<this.pendingProcessingEdgesFrom.length;t++){const i=this.pendingProcessingEdgesFrom[t],n=this.pendingProcessingEdgesTo[t],s=this.getVertexValue(n);if(!th(s))continue;const r=this.neighboursWithEdgeValue(i,os),a=eh[s];(typeof a=="function"?void 0:a.dependencies)?.(this,i,r??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}refreshPendingProcessingEdges(t){const n=this.findNeighbour(t,Ye)??t,s=this.findNeighbour(n,as);if(s){this.pendingProcessingEdgesFrom.push(n),this.pendingProcessingEdgesTo.push(s);const a=this.neighboursWithEdgeValue(n,os);if(a)for(const o of a)this.refreshPendingProcessingEdges(o)}const r=this.neighboursWithEdgeValue(t,Je);if(r)for(const a of r)this.refreshPendingProcessingEdges(a)}resolveVertex(t,i=this.resolved,n){const s=this.getPathArray(t),r=s[0];if(s.length===1&&this.resolvedRootAncestorsPaths.add(r),s.length>1&&!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=Gt(i,s);if(a!=null&&!xe(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,Je),[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 dl(i,n,c);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,as);if(n&&th(n)){const s=this.neighboursWithEdgeValue(i,os),r=eh[n],o=(typeof r=="function"?r:r.resolve)?.(this,t,s??[]);return o===Bi?void 0:o}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,n){const s=this.neighboursWithEdgeValue(t,nA)?.[0];if(!s)return;const r=this.findVertexAtPath(n),a=this.findNeighbourValue(s,Ye),o=this.findNeighbourValue(s,Vi),l=this.findNeighbourValue(s,si),h=r&&this.findNeighbour(r,si)!=null?void 0:this.findNeighbourValue(s,Nr);(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!a?._enabledFromTheme&&!o?._enabledFromTheme&&dl(i,n,!0)}resolveVertexChildren(t,i,n){const s=this.neighboursWithEdgeValue(t,Je);if(s){n??(n=this.findNeighbourValue(t,sA));for(const r of s){const a=this.getVertexValue(r);s.length>1&&th(a)||a!=="_enabledFromTheme"&&this.resolveVertex(r,i,n)}}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,ul);if(i)for(const n of i)this.resolveVertex(n)}graftAndResolveChildren(t,i,n,s){const r=this.neighboursWithEdgeValue(t,Je);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,Je);const d=this.addVertex(l);if(this.addEdge(h,d,pn),le(u)){this.buildGraphFromObject(h,Ye,u,d);const p=this.findNeighbour(h,Ye);this.addEdge(p,this.addVertex(l),pn);const g=this.findNeighbourValue(p,as);if(th(g)){const f=this.neighboursWithEdgeValue(p,os),y=eh[g];(typeof y=="function"?void 0:y.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(){je("snapshot"),this.isRollingBack=!0}rollback(){je(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let t=0;t<this.rollbackEdgesFrom.length;t++){const i=this.rollbackEdgesFrom[t],n=this.rollbackEdgesTo[t],s=this.rollbackEdgesValue[t];this.removeEdge(i,n,s)}for(const t of this.rollbackVertices)this.removeVertex(t);this.cachedPathVertices.clear(),this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1}diagram(t,i=2){this.diagramKeys=new Map,this.diagramEdges=new Map;const n=this.findVertexAtPath(t),s=["---","config:"," layout: elk"," look: neo"," theme: redux","---","flowchart TB"];n&&this.diagramVertex(s,n,1,i),s.push("classDef UO fill: #e8f5e8, stroke: #4caf50"),s.push("classDef DE fill: #e3f2fd, stroke: #2196f3"),s.push("classDef DEP fill: #ffe0fd, stroke: #ff00f2"),s.push("classDef OP fill: #fff3e0, stroke: #ff9800"),s.push("classDef OPV fill: #fff3e0, stroke: #ff9800, stroke-width: 1px"),s.push("classDef OV fill: #e8f5ee, stroke: #4caf87"),console.log(s.join(`
|
|
`))}diagramKey(t){let i=this.diagramKeys.get(t);return i||(i=`${this.diagramKeys.size}`,this.diagramKeys.set(t,i)),i}diagramLabel(t,i,n){let s=this.diagramKeys.get(t);if(s)return s;s=this.diagramKey(t);const r={[si]:"UO",[Ye]:"DE",[ul]:"DEP",[as]:"OP",[os]:"OPV",[Vi]:"OV"};let a=n?r[n]??void 0:void 0;return a=a?`:::${a}`:"",typeof i.value=="symbol"?`${s}[/"[symbol]"\\]${a}`:Array.isArray(i.value)?`${s}[/"[array]"\\]${a}`:typeof i.value=="object"?`${s}[/"[object]"\\]${a}`:n===Ye||n===si||n===Vi?`${s}("${i.value}")${a}`:`${s}["${i.value}"]${a}`}diagramVertex(t,i,n,s){const r=this.getPathArray(i),a=r.length>0?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,Je)??[]){const g=this.getPathArray(p),f=g.length>0?g.join("."):"root";s<r&&this.diagramVertex(t,p,s+1,r),this.diagramChild(t,Je,i,n,f,n)}const a=this.neighboursWithEdgeValue(n,si)??[];let o=0;for(const p of a)this.diagramChild(t,si,i,n,`${i}.${si}.${o}`,p),o++;const l=this.neighboursWithEdgeValue(n,Ye)??[];o=0;for(const p of l)this.diagramChildWithNeighbours(t,Ye,i,n,`${i}.${Ye}.${o}`,p,s+1,r),o++;const c=this.neighboursWithEdgeValue(n,as)??[];o=0;const[h]=c;h&&(this.diagramChildWithNeighbours(t,as,i,n,`${i}.${as}.${o}`,h,s+1,r),o++);const u=this.neighboursWithEdgeValue(n,os)??[];o=0;for(const p of u)this.diagramChildWithNeighbours(t,os,i,n,`${i}.${os}.${o}`,p,s+1,r),o++;const d=this.neighboursWithEdgeValue(n,ul)??[];o=0;for(const p of d)this.diagramChildWithNeighbours(t,ul,i,n,this.getPathArray(p).join("."),p,s+1,r),o++}diagramChild(t,i,n,s,r,a){let o=this.diagramEdges.get(n);if(o?.has(r))return;o||(o=new Set,this.diagramEdges.set(n,o)),o.add(r);const l=i===Je?"":`|${i}|`;t.push(` ${this.diagramLabel(n,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)}};Or.EDGE_PRIORITY=[si,Vi,Ye],Or.GRAFT_EDGE=Ye,Or.SHALLOW_KEYS=new Set(["context","data","topology"]),Or.COMPLEX_KEYS=["annotations","axes","series"],Or.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],Or.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),Or.valueCache=new Map;var hA=Or,uA=e=>`'${e}'`,Fy="__AXIS_ID_",_a={top:"x",bottom:"x",left:"y",right:"y"},za=class Pt{constructor(t,i,n,s,r,a,o=!1,l){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=n??{};let c=null;t instanceof Pt?(c=t,this.specialOverrides=c.specialOverrides,a&&(this.userDeltaKeys=new Set(Object.keys(a))),a??(a=Xn(c.userOptions,i,Pt.JSON_DIFF_OPTS)),this.userOptions=Fe(Bl(a,c.userOptions),{...Pt.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Fe(t??i,{...Pt.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...s})),this.findSeriesWithUserVisiblity(i,a),o&&this.removeLeftoverSymbols(this.userOptions);const h=t instanceof Pt&&a?.data!==void 0&&a?.data?.length!==t.userOptions.data?.length;let u,d,p,g,f,y,m;if(!o&&this.seriesWithUserVisibility==null&&a!==void 0&&Pt.isFastPathDelta(a)&&c!=null&&!h?({activeTheme:u,processedOptions:d,fastDelta:p}=this.fastSetup(a,c),g=c.themeParameters,f=c.annotationThemes):(Pt.perfDebug("ChartOptions.slowSetup()"),{activeTheme:u,processedOptions:d,themeParameters:g,annotationThemes:f,googleFonts:y,optionsGraph:m}=this.slowSetup(n,a,o)),this.activeTheme=u,this.processedOptions=d,this.fastDelta=p??void 0,this.themeParameters=g,this.annotationThemes=f,this.googleFonts=y,this.optionsGraph=m,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const v=performance.now();this.optionsProcessingTime=v-l}ce.inDevelopmentMode(()=>ki(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return Pt.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return Pt.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;r<s.length;r++){const a=s[r];"visible"in a&&(this.seriesWithUserVisibility??(this.seriesWithUserVisibility={identifiers:new Set,indices:new Set}),a.id?this.seriesWithUserVisibility.identifiers.add(a.id):this.seriesWithUserVisibility.indices.add(r))}}}fastSetup(t,i){const{activeTheme:n,processedOptions:s}=i,{presetType:r}=this.optionMetadata;if(r!=null&&t?.data!=null){const o=Q.getPresetModule(r);if(o?.processData){const{series:l,data:c}=o.processData(t.data);t=be({series:l,data:c},t)}}this.fastSeriesSetup(t,s);const a=be(t,s);return Pt.debug("ChartOptions.fastSetup() - processed options",a),{activeTheme:n,processedOptions:a,fastDelta:t}}fastSeriesSetup(t,i){t?.series&&(t.series?.every((n,s)=>Yv(n,i.series?.[s]??{}))?delete t.series:t.series=t.series.map((n,s)=>Bl(n,i.series?.[s]??{})))}slowSetup(t,i,n=!1){let s=Fe(this.userOptions,Pt.OPTIONS_CLONE_OPTS_FAST);i&&(s=be(i,s),n&&this.removeLeftoverSymbols(s));let r=oD(sp(s.theme));const{presetType:a}=this.optionMetadata;if(a!=null){const y=Q.getPresetModule(a);if(y){const{validate:m=Ft}=y,v=s,x=s.type,M=x==null?void 0:r.presets[x],{cleared:D,invalid:A}=m(v,y.options,"");for(const I of A)_.warn(I);_r(A,"")?s={}:(Pt.debug(">>> AgCharts.createOrUpdate() - applying preset",D),s=y.create(D,M,()=>this.activeTheme),r=oD(sp(s.theme)))}}this.soloSeriesIntegrity(s),a!=null&&r.templateTheme(s,!1),cD(void 0,s);const o=this.validateSeriesOptions(s),l=Pc(s);if(this.chartDef=Q.getChartModule(l),!this.chartDef.placeholder){const{validate:y=Ft}=this.chartDef,{cleared:m,invalid:v}=y(s,this.chartDef.options,"");for(const x of v)_.warn(x);s=m}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=K2(r,s),d=u.resolve(),p=u.resolveParams(),g=u.resolveAnnotationThemes();u.clearSafe();const f=be(t,d);return cD(this.chartDef.name,f),xP(this.chartDef.name,f,o),this.validateSeriesOptions(f),this.validateAxesOptions(f,h),this.validatePluginOptions(f),this.processMiniChartSeriesOptions(f),f.loadGoogleFonts||c.clear(),Pt.debug(()=>["ChartOptions.slowSetup() - processed options",Fe(f)]),{activeTheme:r,processedOptions:f,themeParameters:p,annotationThemes:g,googleFonts:c,optionsGraph:u}}validatePluginOptions(t){for(const i of Q.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}=Ft(t[n],i.options,i.name);for(const a of r)_.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;o<s;o++){const l=`series[${o}]`,c=t.series[o],h=Q.getSeriesModule(c.type);if(h==null){const g=Q.isEnterprise();a??(a=js(Array.from(wr.values()).filter(y=>y.type==="series"&&(g||!y.enterprise)&&(!i||y.chartType===i)).map(y=>y.name),"or",uA));const f=wr.get(c.type);if(c.type!=null&&f?.type==="series"){r.push(f);continue}_.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){_.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=Ft}=h,{cleared:d,invalid:p}=u(c,h.options,l);for(const g of p)_.warn(g);_r(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 Mt(t.axes)){if(!o)continue;if(o.type==null){s[a]=o;continue}const l=`axes.${i?.get(a)??a}`,c=Q.getAxisModule(o.type);if(c==null){const p=Q.isEnterprise();r??(r=js(Array.from(wr.values()).filter(f=>f.type==="axis"&&(p||!f.enterprise)&&f.chartType===n).map(f=>f.name),"or",uA)),wr.get(o.type)?.type!=="axis"&&_.warn(`Unknown type \`${o.type}\` at \`${l}.type\`; expecting one of ${r}, ignoring.`);continue}else if(c.chartType!==n){_.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${n}\`, ignoring.`);break}const{validate:h=Ft}=c,{cleared:u,invalid:d}=h(o,c.options,l);for(const p of d)_.warn(p);_r(d,l)||(s[a]=u)}t.axes=s}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??Xn(t.processedOptions,this.processedOptions,Pt.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.displayNullData,n=t.series?.map(s=>{const a=!!Q.getSeriesModule(s.type)?.options?.visible,o={};return a&&(o.visible=!0),i!==void 0&&s.allowNullKeys===void 0&&(o.allowNullKeys=i),be(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=le(l)&&"direction"in l&&l.direction==="horizontal"&&Q.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={},y=new Map;for(const[m,v]of g)f[v]="axes"in t?Qr(t.axes?.[m]):void 0,y.set(v,m);return this.remapSeriesAxisKeys(t,n,f,g,h,o),this.predictAxesMissingTypesAndPositions(t,n,f,h),this.alternateSecondaryAxisPositions(t,f,y),t.axes=f,y}getSeriesDirectionAxisKey(t,i){const n=Q.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||!Ll(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&&le(t.axes[a])&&!("position"in t.axes[a]))){for(const[l,c]of Mt(t.axes))if("position"in c&&c.position&&a===_a[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 Mt(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 Mt(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,`${Fy}${r.size}`);if(s)for(const a of n)r.has(a)||r.set(a,`${Fy}${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]=Qr(r[l]));let h=l;if(c in o){const u=o[c];s.has(u)?h=s.get(u):(h=`${Fy}${s.size}`,s.set(u,h),n[h]=Qr(r[l]))}else s.has(l)&&a&&(h=s.get(l),n[h]??(n[h]=Qr(r[l])));o[c]=h}}predictAxes(t,i,n,s){if(!n)return;const r=n?.data??s;if(!r?.length)return;const a=Q.getSeriesModule(t)?.predictAxis;if(!a)return;const o=new Map,l=lb(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?_p(h,u=>"position"in u&&u.position===c.position?c:u):void 0}return Object.fromEntries(o)}}cloneDefaultAxes(t){const i=Q.getSeriesModule(t);return i?.defaultAxes?Fe(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(t,i,n,s){for(const[r,a]of Mt(n)){if(!xe(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)||!Ll(t.position,_a))return!1;for(const n of Object.values(i))if(Ll(n.position,_a)&&_a[t.position]===_a[n.position])return t.type=n.type,!0;for(const[n,s]of Mt(_a))if(t.position!==n&&s===_a[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||!Ll(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 Mt(i)){if(!xe(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}=Q.getSeriesModule(t.type);t.grouped&&!i&&_.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!n&&_.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);Pt.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(!ae(t.series))return;const i=s=>Q.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))_.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}=vl(n,l=>i(l.type)?"solo":"nonSolo"),o=pp(r.map(l=>l.type)).join(", ");_.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 or(t,Pt.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){or(t,Pt.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!le(t)))for(const i of Object.keys(t)){const n=t[i];wl(n)&&delete t[i]}}removeLeftoverSymbols(t){or(t,Pt.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=Me():hb(t.window),t.document==null?t.document=Gi():cb(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}};za.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},za.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},za.JSON_DIFF_OPTS=new Set(["data","localeText"]),za.perfDebug=ce.create(!0,"perf"),za.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),za.debug=ce.create(!0,"opts");var ih=za,rp=ce.create(!0,"opts"),Er="AG Charts - Chart was destroyed, cannot perform request.",nh=class{constructor(t,i,n){this.factoryApi=i,this.licenseManager=n,this.chart=t}async update(t){if(!this.chart)throw new Error(Er);return rp.group("AgChartInstance.update()",async()=>{const i=ce.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(Er);return rp.group("AgChartInstance.updateDelta()",async()=>{const i=ce.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(Er);const t=Fe(this.chart.getOptions(),ih.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(Er);return this.chart.waitForUpdate()}applyTransaction(t){const{chart:i}=this;if(!i)throw new Error(Er);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 rp.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const o=i.data.deepClone();return o.addTransaction(t),o.commitPendingTransactions(),this.updateDelta({data:o.data})}return rp("transaction",t),await this.chart?.applyTransaction(t)})}async download(t){if(!this.chart)throw new Error(Er);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(Er);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(Er);const i=await this.prepareResizedChart(this,this.chart,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const{chart:i}=this;if(!i)return;const n=this.getEnabledOriginators();if(!n.includes(i.ctx.legendManager)){await this.setStateOriginators(t,n);return}await this.setStateOriginators(t,n.filter(s=>s!==i.ctx.zoomManager)),await this.setStateOriginators(t,[i.ctx.zoomManager])}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(t,i,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.processedOverrides,container:Gi().createElement("div"),width:s,height:r};n.width!=null&&n.height!=null&&(o.overrideDevicePixelRatio=1);const l=i.getOptions();if(Q.isEnterprise()){o.animation={enabled:!1};const f=this.licenseManager?.getWatermarkForegroundConfigForBrowser();f&&(o.foreground=f)}const c={...i.chartOptions.specialOverrides},h={...i.chartOptions.optionMetadata},u=await this.chart?.ctx.dataService.getData(),d=this.factoryApi.create(l,o,c,h,u);a.legend&&this.syncLegend(i,d,a),d.chart?.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),await d.setState(a);const p={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};d.chart?.ctx.zoomManager.updateZoom(p,i.ctx.zoomManager.getZoom()),d.chart?.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate();const g=[];for(const f of i.modulesManager.legends())g.push(f.legend.pagination?.currentPage??0);for(const f of d.chart.modulesManager.legends()){const y=g.shift()??0;f.legend.pagination&&f.legend.pagination.setPage(y)}return d.chart?.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),d}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.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};nh.chartInstances=new WeakMap,b([Vt({oldValue(e){e.destroyed||(e.publicApi=void 0),nh.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,nh.chartInstances.set(e,this))}})],nh.prototype,"chart",2);var dA=nh,Z2=1e3,Vy=class Br{constructor(t,i,n,s,r,a=Z2){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 Br(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),Br.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):Br.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 Br.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.");Br.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),Br.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)<n&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const i of t)this.destroyItem(i);Br.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};Vy.pools=new Map,Vy.debug=ce.create(!0,"pool");var X2=Vy,Ps=ce.create(!0,"opts"),Rr=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=_s.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return _s.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return pA.getInstance(e)}static create(e,t){const i=ce.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Ps.group("AgCharts.create()",()=>{e=ce.inDevelopmentMode(()=>ki(Fe(e)))??e,this.licenseCheck(e);const n=pA.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t,apiStartTime:i});return this.licenseManager?.isDisplayWatermark()&&_s.injectWatermark?.(n.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),n})}static createFinancialChart(e){return Ps.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return Ps.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return Ps.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};Rr.licenseChecked=!1;var cs=class uh{static getInstance(t){const i=Ad.getInstance(t);return i?dA.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=_s.styles==null?[]:[["ag-charts-enterprise",_s.styles]];if(Q.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(`
|
|
`));Ps(()=>[">>> AgCharts.createOrUpdate() user options",Fe(n)]);const{presetType:p}=o;let g=n;Rr.optionsMutationFn&&g&&(g=Rr.optionsMutationFn(Fe(g,ih.OPTIONS_CLONE_OPTS_FAST),p),Ps(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Fe(g)]));const f=this.getPool(o);let y=!1,m,v=i?.chart;v==null&&f?.hasFree()&&(m=f.obtainFree(),v=m.item);const{document:x,window:M,styleContainer:D,skipCss:A,...I}=g??{},k=v?.getChartOptions(),C=new ih(k,I,r,{...a,document:x,window:M,styleContainer:D,skipCss:A},o,l,h,u);(v==null||Pc(C.processedOptions)!==Pc(v.chartOptions.processedOptions))&&(m?.release(),m=this.getPool(C.optionMetadata)?.obtain(C),m?v=m.item:(y=!0,v=uh.createChartInstance(C,v))),C.optionsGraph&&v.ctx.optionsGraphService.updateCallback((T,N,R)=>C.optionsGraph?.resolvePartial(T,N,R));for(const[T,N]of d)v.ctx.domManager.addStyles(T,N);return v.ctx.fontManager.updateFonts(C.googleFonts),c!=null&&v.ctx.dataService.restoreData(c),i==null?(i=new dA(v,uh.callbackApi,s),i.releaseChart=m?.release):(m||y)&&(i.releaseChart?.(),i.chart=v,i.releaseChart=m?.release),Ps.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[v.id]=v),v.queuedUserOptions.push(C.userOptions),v.queuedChartOptions.push(C),v.requestFactoryUpdate(T=>{Ps.group(">>>> Chart.applyOptions()",()=>{T.applyOptions(C);const N=T.queuedUserOptions.indexOf(C.userOptions)+1;T.queuedUserOptions.splice(0,N),T.queuedChartOptions.splice(0,N)})}),i}static updateUserDelta(t,i,n){i=Fe(i,ih.OPTIONS_CLONE_OPTS_FAST);const s=or(i,uh.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Ps(()=>[">>> AgCharts.updateUserDelta() user delta",Fe(i)]),uh.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:s,apiStartTime:n})}static createChartInstance(t,i){const n=i?.destroy({keepTransferableResources:!0}),s=Pc(t.processedOptions);return Q.getChartModule(s).create(t,n)}static getPool(t){if(t.pool===!0)return X2.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};cs.caretaker=new Xp(Xe),cs.callbackApi={caretaker:cs.caretaker,create(e,t,i,n,s){return cs.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:n,data:s})},update(e,t,i,n){return cs.createOrUpdate({userOptions:e,proxy:t,specialOverrides:i,apiStartTime:n})},updateUserDelta(e,t,i){return cs.updateUserDelta(e,t,i)}},cs.markRemovedProperties=(e,t,i,n)=>{let s=n??!1;if(typeof e!="object"||e==null)return s;for(const r of gs(e))e[r]===void 0&&(Object.assign(e,{[r]:Symbol("UNSET")}),s||(s=!0));return s},cs.detachAndClear=e=>e.detachAndClear(),cs.destroy=e=>e.destroy();var pA=cs,gA={};Si(gA,{APPROXIMATE_THRESHOLD:()=>w1,AbstractBarSeries:()=>AI,AbstractBarSeriesProperties:()=>Wc,AggregationManager:()=>wd,AnchoredPopover:()=>IA,ApproximateOrdinalTimeScale:()=>sF,Arc:()=>hs,Axis:()=>Gf,AxisGroupZIndexMap:()=>lS,AxisInterval:()=>ya,AxisLabel:()=>Ke,AxisTick:()=>ba,BBox:()=>U,Background:()=>Jo,BandScale:()=>Nn,BaseToolbar:()=>$y,Caption:()=>qe,CartesianAxis:()=>Mc,CartesianCrossLine:()=>hi,CartesianSeries:()=>Cr,CartesianSeriesNodeEvent:()=>fm,CartesianSeriesProperties:()=>Pn,CategoryAxis:()=>Ic,CategoryScale:()=>Go,Chart:()=>Ad,ChartAxes:()=>md,ChartOptions:()=>ih,CollapseMode:()=>aI,ColorScale:()=>Mo,ContextMenuRegistry:()=>fM,ContinuousScale:()=>Ee,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Zo,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Xo,DEFAULT_POLAR_DIRECTION_KEYS:()=>$I,DEFAULT_POLAR_DIRECTION_NAMES:()=>UI,DOMManager:()=>lM,DataController:()=>wM,DataModel:()=>nm,DataModelSeries:()=>gm,DataSet:()=>Ko,DiscreteTimeAxis:()=>UM,DraggablePopover:()=>DA,DropShadow:()=>ns,ExtendedPath2D:()=>Io,FillGradientDefaults:()=>Ar,FillImageDefaults:()=>Ls,FillPatternDefaults:()=>Ct,FloatingToolbar:()=>uF,FormatManager:()=>jo,Group:()=>re,GroupWidget:()=>cM,HierarchyHighlightState:()=>fA,HierarchyNode:()=>q2,HierarchySeries:()=>J2,HierarchySeriesProperties:()=>Pr,HighlightManager:()=>yM,HighlightProperties:()=>ws,HighlightState:()=>KS,Image:()=>gl,InteractionManager:()=>M0,InteractionState:()=>S0,LARGEST_KEY_INTERVAL:()=>$S,Label:()=>Xi,LabelStyle:()=>Zi,LayoutElement:()=>Af,Line:()=>Yi,LinearScale:()=>va,LogScale:()=>Kf,Marker:()=>At,Menu:()=>aF,MercatorScale:()=>Q2,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>On,NativeWidget:()=>Qo,NiceMode:()=>aS,Node:()=>Is,OrdinalTimeScale:()=>br,Path:()=>It,PointerEvents:()=>a0,PolarAxis:()=>jy,PolarSeries:()=>hy,QuadtreeNearest:()=>MS,RadialColumnShape:()=>Bn,Range:()=>Qn,Rect:()=>Dt,Rotatable:()=>Do,RotatableText:()=>k0,SMALLEST_KEY_INTERVAL:()=>HS,Scalable:()=>Uu,ScalableGroup:()=>zL,Scene:()=>Sd,Sector:()=>Jt,SectorBox:()=>KI,SegmentedPath:()=>Yf,Selection:()=>mt,Series:()=>Oc,SeriesItemHighlightStyle:()=>Dr,SeriesMarker:()=>xi,SeriesNodeEvent:()=>gd,SeriesNodePickMode:()=>qS,SeriesProperties:()=>Rn,SeriesTooltip:()=>Os,Shape:()=>ca,SliderWidget:()=>Am,StopProperties:()=>Sf,SvgPath:()=>yA,Text:()=>Ei,TimeAxisParentLevel:()=>Wo,TimeScale:()=>$o,Toolbar:()=>cF,ToolbarButtonWidget:()=>AA,ToolbarWidget:()=>xd,TooltipManager:()=>Md,Transformable:()=>tt,TransformableGroup:()=>Co,TransformableText:()=>wo,Translatable:()=>Ao,TranslatableGroup:()=>Zt,TranslatableSvgPath:()=>nF,UnitTimeScale:()=>vr,ZoomManager:()=>CM,accumulativeValueProperty:()=>sm,addHitTestersToQuadtree:()=>_d,adjustLabelPlacement:()=>ZM,angleCategoryAxisOptionsDefs:()=>Dy,angleNumberAxisOptionsDefs:()=>hD,animationValidation:()=>Tc,annotationCalloutStylesDefs:()=>vD,annotationChannelTextDefs:()=>pD,annotationCommentStylesDefs:()=>xD,annotationCrossLineStyleDefs:()=>Ay,annotationDisjointChannelStyleDefs:()=>yD,annotationFibonacciStylesDefs:()=>Cy,annotationLineStyleDefs:()=>ep,annotationLineTextDefs:()=>Qd,annotationMeasurerStylesDefs:()=>tp,annotationNoteStylesDefs:()=>SD,annotationOptionsDef:()=>ll,annotationParallelChannelStyleDefs:()=>bD,annotationQuickMeasurerStylesDefs:()=>MD,annotationShapeStylesDefs:()=>ky,annotationTextStylesDef:()=>qc,boxPlotSeriesThemeableOptionsDef:()=>CD,buildResetPathFn:()=>Ym,calculateDataDiff:()=>kI,calculateLabelTranslation:()=>iF,calculateSegments:()=>Bd,candlestickSeriesThemeableOptionsDef:()=>wD,checkCrisp:()=>CI,chordSeriesThemeableOptionsDef:()=>LD,clippedRoundRect:()=>Yu,collapsedStartingBarPosition:()=>Kc,computeBarFocusBounds:()=>ty,computeMarkerFocusBounds:()=>Pd,coneFunnelSeriesThemeableOptionsDef:()=>TD,createDatumId:()=>Xt,diff:()=>dd,drawCorner:()=>mc,drawMarkerUnitPolygon:()=>yc,findNodeDatumInArray:()=>XS,findQuadtreeMatch:()=>zd,fixNumericExtent:()=>Ri,fromToMotion:()=>bt,funnelSeriesThemeableOptionsDef:()=>ND,generateTicks:()=>bS,getColorStops:()=>d0,getCrossLineValue:()=>sS,getItemStyles:()=>hm,getItemStylesPerItemId:()=>ON,getLabelStyles:()=>Da,getMarkerStyles:()=>Fd,getMissCount:()=>OS,getRadialColumnWidth:()=>bA,getShapeFill:()=>w0,getShapeStyle:()=>kf,groupAccumulativeValueProperty:()=>wc,hasDimmedOpacity:()=>um,heatmapSeriesThemeableOptionsDef:()=>OD,initialStatePickedOptionsDef:()=>wm,interpolatePoints:()=>jc,isTooltipValueMissing:()=>pa,keyProperty:()=>Ir,makeSeriesTooltip:()=>Ca,mapLineBackgroundSeriesThemeableOptionsDef:()=>PD,mapLineSeriesThemeableOptionsDef:()=>RD,mapMarkerSeriesThemeableOptionsDef:()=>FD,mapShapeBackgroundSeriesThemeableOptionsDef:()=>BD,mapShapeSeriesThemeableOptionsDef:()=>VD,markerEnabled:()=>Um,markerFadeInAnimation:()=>Hc,markerSwipeScaleInAnimation:()=>$m,midpointStartingBarPosition:()=>OR,minimumTimeAxisDatumGranularity:()=>IS,motion:()=>pF,nightingaleSeriesThemeableOptionsDef:()=>_D,normaliseGroupTo:()=>hd,ohlcSeriesThemeableOptionsDef:()=>ED,ordinalTimeAxisOptionsDefs:()=>al,pairUpSpans:()=>Gc,pathFadeInAnimation:()=>Km,pathMotion:()=>kd,pathSwipeInAnimation:()=>Wm,plotAreaPathFill:()=>bI,plotInterpolatedLinePathStroke:()=>Od,plotLinePathStroke:()=>Gm,predictCartesianFinancialAxis:()=>vR,predictCartesianNonPrimitiveAxis:()=>Uc,prepareAreaFillAnimationFns:()=>vI,prepareBarAnimationFunctions:()=>Yc,prepareLinePathPropertyAnimation:()=>jm,processedDataIsAnimatable:()=>un,pyramidSeriesThemeableOptionsDef:()=>zD,radarAreaSeriesThemeableOptionsDef:()=>GD,radarLineSeriesThemeableOptionsDef:()=>jD,radialBarSeriesThemeableOptionsDef:()=>HD,radialColumnSeriesThemeableOptionsDef:()=>$D,radiusCategoryAxisOptionsDefs:()=>dD,radiusNumberAxisOptionsDefs:()=>uD,rangeAreaSeriesThemeableOptionsDef:()=>KD,rangeBarSeriesThemeableOptionsDef:()=>ZD,resetAxisLabelSelectionFn:()=>rd,resetBarSelectionsDirect:()=>Gd,resetBarSelectionsFn:()=>Zc,resetLabelFn:()=>Aa,resetMarkerFn:()=>Ed,resetMarkerPositionFn:()=>$c,resetMarkerSelectionsDirect:()=>Rd,resetMotion:()=>zt,sankeySeriesThemeableOptionsDef:()=>XD,sectorBox:()=>YI,seriesLabelFadeInAnimation:()=>lt,seriesLabelFadeOutAnimation:()=>Ld,stackCartesianSeries:()=>QS,standaloneChartOptionsDefs:()=>wO,sunburstSeriesThemeableOptionsDef:()=>qD,toHierarchyHighlightString:()=>sh,toHighlightString:()=>Yo,topologyChartOptionsDefs:()=>kO,trailingAccumulatedValueProperty:()=>vN,treemapSeriesThemeableOptionsDef:()=>JD,updateClipPath:()=>Vd,updateLabelNode:()=>YM,upsertNodeDatum:()=>ry,userInteraction:()=>jO,validateCrossLineValue:()=>rS,valueProperty:()=>Ue,visibleRangeIndices:()=>Nc,waterfallSeriesThemeableOptionsDef:()=>QD});var fA=(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))(fA||{});function sh(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 Pr=class extends Rn{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(xt),this.strokes=Object.values(Es)}};b([S],Pr.prototype,"childrenKey",2),b([S],Pr.prototype,"sizeKey",2),b([S],Pr.prototype,"colorKey",2),b([S],Pr.prototype,"colorName",2),b([S],Pr.prototype,"fills",2),b([S],Pr.prototype,"strokes",2),b([S],Pr.prototype,"colorRange",2);var mA=class dp{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=dp.Walk.PreOrder){i===dp.Walk.PreOrder&&t(this);for(const n of this.children)n.walk(t,i);i===dp.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}};mA.Walk={PreOrder:0,PostOrder:1};var q2=mA,J2=class extends Oc{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Mo,this.animationState=new Jl("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey: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,y=t==null?void 0:d[t],m=y==null||y.length===0;let v=i==null?void 0:d[i];Number.isFinite(v)?v=Math.max(v,0):v=m?1:0;const x=v;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 D=this.getItemStyle({datumIndex:p,datum:d,depth:f,colorValue:M},m,!1);return c(new e(this,Xt(p.join(";")),p,d,v,M,x,f,g,[],D),y)},c=(d,p)=>{const{datumIndex:g}=d;if(p)for(const[f,y]of p.entries()){const m=l(y,g.concat(f),d);d.children.push(m),d.sumSize+=m.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=a<o?[a,o]:[0,1],this.colorScale.range=s??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=r,this.colorDomain=u}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return this.rootNode?.find(t=>t.itemId===e)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(e){const{colorKey:t,colorRange:i}=this.properties,{id: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(zn(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)){_.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 be(t.highlightedItem,t.highlightedBranch);case 3:return be(t.unhighlightedItem,t.highlightedBranch);case 4:return t.unhighlightedBranch;default:return}}getHighlightStateString(e,t,i,n){if(!this.properties.highlight.enabled||i==null)return sh(0);const s=i.reduce((o,l)=>o?.children[l],this.rootNode),r=this.getActiveHighlightNode();if(s==null)return sh(0);const a=this.getHierarchyHighlightState(t??!1,r,s);return sh(a)}},ap=Math.PI/180,By=e=>e*ap,_y=e=>-Math.log(Math.tan(Math.PI*.25+e*ap*.5)),zy=e=>e/ap,Gy=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(ap*.5),Q2=class eb extends ju{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=eb.bounds(t)}static bounds(t){const[[i,n],[s,r]]=t,a=By(i),o=_y(n),l=By(s),c=_y(r);return new U(Math.min(a,l),Math.min(o,c),Math.abs(l-a),Math.abs(c-o))}static fixedScale(){return new eb([[zy(0),Gy(0)],[zy(1),Gy(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[(By(t)-this.bounds.x)*o+n,(_y(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),Gy((i-s)/l+this.bounds.y)]}getDomainMinMax(){return $u(this.domain)}},jy=class extends Gf{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(rd())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};b([S],jy.prototype,"shape",2),b([S],jy.prototype,"innerRadiusRatio",2);var eF={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}},tF={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 iF({yDirection:e,padding:t=0,position:i="top",bbox:n}){const s=e?eF:tF,{xTranslationDirection:r,yTranslationDirection:a}=s[i],o=r*(t+n.width/2),l=a*(t+n.height/2);return{xTranslation:o,yTranslation:l}}var yA=class extends It{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())}},nF=class extends Ao(yA){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},sF=class WA extends br{static is(t){return t instanceof WA}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)))}},gl=class extends Is{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)}};b([Y()],gl.prototype,"x",2),b([Y()],gl.prototype,"y",2),b([Y()],gl.prototype,"width",2),b([Y()],gl.prototype,"height",2),b([Y()],gl.prototype,"opacity",2);var hs=class extends It{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(bi(this.startAngle),bi(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)}};hs.className="Arc",b([Y()],hs.prototype,"centerX",2),b([Y()],hs.prototype,"centerY",2),b([Y()],hs.prototype,"radius",2),b([Y()],hs.prototype,"startAngle",2),b([Y()],hs.prototype,"endAngle",2),b([Y()],hs.prototype,"counterClockwise",2),b([Y()],hs.prototype,"type",2);function op(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 Bn=class extends It{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}=op(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=du(e,t);return bi(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])=>op(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(t<i)return null;const n=-Math.sqrt(t-i),s=Math.atan2(n,e);return{y:n,angle:s}}calculateBothIntersections(e,t,i){const n=i*i,s=this.calculateCircleIntersection(e,n),r=this.calculateCircleIntersection(t,n);return!s||!r?null:{left:s,right:r}}calculateAxisOuterIntersections(e,t,i){const n=i*i,s=this.calculateCircleIntersection(e,n),r=this.calculateCircleIntersection(t,n);return!s||!r?null:{left:s,right:r,radiusSquared:n}}moveToRotated(e,t,i){const n=op(e,t,i);this.path.moveTo(n.x,n.y)}lineToRotated(e,t,i){const n=op(e,t,i);this.path.lineTo(n.x,n.y)}renderTopWithCornerClipping(e,t,i){const{path:n}=this,{right:s,top:r,rotation:a}=i,o=r*r,l=t.radiusSquared-o;if(l<=0)this.lineToRotated(s,t.right.y,a),n.arc(0,0,e,a+t.right.angle,a+t.left.angle,!0);else{const c=Math.sqrt(l),h=Math.atan2(r,c),u=Math.atan2(r,-c);this.lineToRotated(s,t.right.y,a),n.arc(0,0,e,a+t.right.angle,a+h,!0),this.lineToRotated(-c,r,a),n.arc(0,0,e,a+u,a+t.left.angle,!0)}}updateBeveledPath(){const{columnWidth:e,path:t,axisInnerRadius:i,axisOuterRadius:n}=this,[s,r]=this.normalizeRadii(this.innerRadius,this.outerRadius),a=-e/2,o=e/2,l=-r,c=-s,h=this.getRotation(),u=Di(s,i),d=Di(r,n),p=Math.hypot(a,l)>n||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,y=p?this.calculateAxisOuterIntersections(a,o,n):null;if(u&&!g||d&&!f||p&&!y){this.updateRectangularPath();return}t.clear(!0);const m={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)):y?this.renderTopWithCornerClipping(n,y,m):(this.lineToRotated(o,l,h),this.lineToRotated(a,l,h)),t.closePath()}};Bn.className="RadialColumnShape",b([Y()],Bn.prototype,"isBeveled",2),b([Y()],Bn.prototype,"columnWidth",2),b([Y()],Bn.prototype,"startAngle",2),b([Y()],Bn.prototype,"endAngle",2),b([Y()],Bn.prototype,"outerRadius",2),b([Y()],Bn.prototype,"innerRadius",2),b([Y()],Bn.prototype,"axisInnerRadius",2),b([Y()],Bn.prototype,"axisOuterRadius",2);function bA(e,t,i,n,s){const r=du(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 Hy=class extends Mm{constructor(){super(he("div"),"menuitem")}},vA=class extends Mm{constructor(){super(he("div"),"menuitemradio")}setChecked(e){ye(this.elem,"aria-checked",e)}},rF=["Escape","ArrowLeft"],xA=class KA extends Im{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=Gi().createElement("div");return ye(t,"role","separator"),this.elem.appendChild(t),t}onChildAdded(t){super.onChildAdded(t),t.addListener("mouseenter",this.handleMouseEnter),t.addListener("mousemove",this.handleMouseMove)}onChildRemoved(t){super.onChildRemoved(t),t.removeListener("mouseenter",this.handleMouseEnter),t.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const t=new Hy,i=new KA(this.orientation);i.id=Yl();const n=()=>{this.collapseExpandedSubMenu(i),t.expandControlled()},s=r=>{Wl(r.sourceEvent)&&r.sourceEvent.code==="ArrowRight"&&(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)}expand(t){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:Tg(t.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new Qe};const i=this.expansionScope,n=this.children.map(s=>s.getElement());ye(i.lastFocus,"aria-expanded",!0),i.removers.register(Zv(this.elem,i.abort),Xv(this.elem,i.abort),...this.children.map(s=>wg(s.getElement(),i.close,rF)),t?.overrideFocusVisible&&Jv(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"}),ye(n,"aria-expanded",!1),i==="0"&&n?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},SA="canvas-overlay",MA=class extends yh{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=he("div"):this.element=e.domManager.addChild(SA,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>e.domManager.removeChild(SA,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=he("div","ag-charts-popover")),e.classList.toggle("ag-charts-popover",!0),t.ariaLabel!=null&&e.setAttribute("aria-label",t.ariaLabel),t.class!=null&&e.classList.add(t.class),this.element.replaceChildren(e),e}showWidget(e,t,i){this.setOwnedWidget(t),this.initPopoverElement(t.getElement(),i),t.addListener("collapse-widget",()=>{e.setControlled(void 0),this.setOwnedWidget(void 0)}),e.setControlled(t),e.expandControlled()}showWithChildren(e,t){const i=this.initPopoverElement(void 0,t);if(i.replaceChildren(...e),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const n=Tg(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",`${Math.floor(e.x)}px`),e.y!=null&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},IA=class extends MA{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}updateAnchor(e){const t=e.anchor??this.anchor,i=e.fallbackAnchor??this.fallbackAnchor;t&&this.setAnchor(t,i)}showWidget(e,t,i){super.showWidget(e,t,i),this.updateAnchor(i)}showWithChildren(e,t){const i=super.showWithChildren(e,t);return this.updateAnchor(t),Me().requestAnimationFrame(()=>{this.repositionWithinBounds()}),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;let o=te(0,e.x,s.width-r),l=te(0,e.y,s.height-a);o!==e.x&&i?.x!=null&&(o=te(0,i.x-r,s.width-r)),l!==e.y&&i?.y!=null&&(l=te(0,i.y-a,s.height-a)),this.updatePosition({x:o,y:l})}},aF=class extends IA{show(e,t){const i=new xA("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 Hy;{e.menuItemRole;const i=new vA;return i.setChecked(e.value===t.value),i}}createRow(e,t,i){const n=t.value===e.value,s=this.allocRow(e,t);if(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=he("span",`ag-charts-menu__icon ${cu(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=he("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}},DA=class extends MA{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:sa.from(e.clientX,e.clientY),position:sa.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=sa.sub(sa.from(e.clientX,e.clientY),t.client),s=sa.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"};function lF(e){return typeof e!="string"?"false":oF[e]}var AA=class extends vd{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&&(i=`<span class="${cu(e.icon)} ag-charts-toolbar__icon"></span>`),e.label!=null){const s=t.t(e.label);i=`${i}<span class="ag-charts-toolbar__label">${s}</span>`}const n=lF(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){ye(this.elem,"aria-checked",e)}},CA="ag-charts-toolbar__button--active",$y=class extends xd{constructor({eventsHub:e,localeManager:t},i,n){super(n),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new iS,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;i<t.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(CA,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(CA,e!=null&&e===t)}toggleButtonEnabledByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new U(i.x+t.x,i.y+t.y,i.width,i.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--gap",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 oe?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}},cF=class extends $y{createButtonWidget(){return new AA(this.localeManager)}},hF=class extends DA{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()}},uF=class extends $y{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new hF(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new dF(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)}},dF=class extends Qo{constructor(e){super(he("div","ag-charts-floating-toolbar__drag-handle"));const t=new Qo(he("span",`${cu("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},pF={...Z0,...q0},kA={};Si(kA,{ButtonWidget:()=>vd,MenuItemRadioWidget:()=>vA,MenuItemWidget:()=>Hy,MenuWidget:()=>xA,NativeWidget:()=>Qo,SliderWidget:()=>Am,ToolbarWidget:()=>xd,WIDGET_HTML_EVENTS:()=>tM,Widget:()=>Ts,WidgetEventUtil:()=>kr});var Uy={};Si(Uy,{Arc:()=>hs,BBox:()=>U,Caption:()=>qe,CategoryScale:()=>Go,Group:()=>re,Line:()=>Yi,LinearScale:()=>va,Marker:()=>At,Path:()=>It,RadialColumnShape:()=>Bn,Rect:()=>Dt,Scene:()=>Sd,Sector:()=>Jt,Shape:()=>ca,TranslatableGroup:()=>Zt,getRadialColumnWidth:()=>bA,toRadians:()=>Ut});var Wy={};Si(Wy,{AGGREGATION_INDEX_UNSET:()=>Gl,AGGREGATION_INDEX_X_MAX:()=>In,AGGREGATION_INDEX_X_MIN:()=>an,AGGREGATION_INDEX_Y_MAX:()=>An,AGGREGATION_INDEX_Y_MIN:()=>Dn,AGGREGATION_MAX_POINTS:()=>gk,AGGREGATION_MIN_RANGE:()=>er,AGGREGATION_SPAN:()=>Qs,AGGREGATION_THRESHOLD:()=>ms,AbstractModuleInstance:()=>yh,ActionOnSet:()=>Vt,AdjacencyListGraph:()=>Wv,AsyncAwaitQueue:()=>vg,BASE_FONT_SIZE:()=>qs,BREAK_TRANSFORM_CHAIN:()=>Vh,BaseProperties:()=>oe,Border:()=>qr,CANVAS_HEIGHT:()=>Fk,CANVAS_TO_BUFFER_DEFAULTS:()=>Vk,CANVAS_WIDTH:()=>Pk,CARTESIAN_AXIS_TYPE:()=>yv,CARTESIAN_POSITION:()=>mv,CallbackCache:()=>Tv,ChangeDetectableProperties:()=>rf,ChartAxisDirection:()=>qp,ChartTheme:()=>Fn,ChartUpdateType:()=>Ur,CleanupRegistry:()=>Qe,Color:()=>Ne,ConfiguredCanvasMixin:()=>Bk,DEFAULT_ANNOTATION_HANDLE_FILL:()=>eu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>nu,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>su,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>gg,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>fg,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>tu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>iu,DEFAULT_CAPTION_ALIGNMENT:()=>ir,DEFAULT_CAPTION_LAYOUT_STYLE:()=>tr,DEFAULT_FIBONACCI_STROKES:()=>pg,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Li,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>wi,DEFAULT_POLAR_SERIES_STROKE:()=>qh,DEFAULT_SHADOW_COLOUR:()=>Yr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Jh,DEFAULT_TEXTBOX_COLOR:()=>ou,DEFAULT_TEXTBOX_FILL:()=>ru,DEFAULT_TEXTBOX_STROKE:()=>au,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Qh,DEFAULT_TOOLBAR_POSITION:()=>jl,DIRECTION_SWAP_AXES:()=>Sv,Debug:()=>ce,DebugMetrics:()=>Bs,DeclaredSceneChangeDetection:()=>He,DeclaredSceneObjectChangeDetection:()=>uc,Deprecated:()=>jk,DeprecatedAndRenamedTo:()=>Hk,EllipsisChar:()=>Il,ErrorType:()=>Vb,EventEmitter:()=>ps,FILL_GRADIENT_BLANK_DEFAULTS:()=>ik,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>ok,FILL_GRADIENT_LINEAR_DEFAULTS:()=>Js,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>nk,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>rk,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>sk,FILL_GRADIENT_RADIAL_DEFAULTS:()=>Kh,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>_l,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>Mv,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>ak,FILL_IMAGE_BLANK_DEFAULTS:()=>dk,FILL_IMAGE_DEFAULTS:()=>fs,FILL_PATTERN_BLANK_DEFAULTS:()=>ck,FILL_PATTERN_DEFAULTS:()=>Hi,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>hk,FILL_PATTERN_KEYED_DEFAULTS:()=>uk,FILL_PATTERN_SINGLE_DEFAULTS:()=>lk,FONT_SIZE:()=>fv,FONT_SIZE_RATIO:()=>Hr,IS_DARK_THEME:()=>so,InterpolationProperties:()=>eo,LABEL_BOXING_DEFAULTS:()=>Yn,LEGEND_CONTAINER_THEME:()=>Iv,LRUCache:()=>ph,LineSplitter:()=>zs,Logger:()=>_,MARKER_SERIES_HIGHLIGHT_STYLE:()=>Yp,MULTI_SERIES_HIGHLIGHT_STYLE:()=>zl,MementoCaretaker:()=>Xp,ModuleRegistry:()=>Q,ModuleType:()=>nb,ObserveChanges:()=>rr,PALETTE_ALT_DOWN_FILL:()=>hg,PALETTE_ALT_DOWN_STROKE:()=>lg,PALETTE_ALT_NEUTRAL_FILL:()=>ug,PALETTE_ALT_NEUTRAL_STROKE:()=>dg,PALETTE_ALT_UP_FILL:()=>cg,PALETTE_ALT_UP_STROKE:()=>og,PALETTE_DOWN_FILL:()=>sg,PALETTE_DOWN_STROKE:()=>ig,PALETTE_NEUTRAL_FILL:()=>ag,PALETTE_NEUTRAL_STROKE:()=>rg,PALETTE_UP_FILL:()=>ng,PALETTE_UP_STROKE:()=>tg,PART_WHOLE_HIGHLIGHT_STYLE:()=>Zp,POLAR_AXIS_SHAPE:()=>vv,POLAR_AXIS_TYPE:()=>bv,PREV_NEXT_KEYS:()=>Kl,Padding:()=>ea,ParallelStateMachine:()=>nw,PolarZIndexMap:()=>kv,PropertiesArray:()=>Ja,Property:()=>S,ProxyOnWrite:()=>Nk,ProxyProperty:()=>oi,ProxyPropertyOnWrite:()=>rt,SAFE_FILLS_OPERATION:()=>ek,SAFE_FILL_OPERATION:()=>QC,SAFE_RANGE2_OPERATION:()=>tk,SAFE_STROKE_FILL_OPERATION:()=>Kp,SEGMENTATION_DEFAULTS:()=>Yh,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>pk,SKIP_JS_BUILTINS:()=>Gp,ScaleAlignment:()=>sb,SceneArrayChangeDetection:()=>of,SceneChangeDetection:()=>Y,SceneObjectChangeDetection:()=>oa,SceneRefChangeDetection:()=>Bu,SeriesContentZIndexMap:()=>Cv,SeriesZIndexMap:()=>Av,SimpleCache:()=>zk,SpanJoin:()=>Px,StateMachine:()=>Jl,StateMachineProperty:()=>iw,TRIPLE_EQ:()=>xo,TextMeasurer:()=>Vg,TickIntervals:()=>wu,TrimCharsRegex:()=>Cb,TrimEdgeGuard:()=>Dl,UNIT_MAX:()=>sf,UNIT_MIN:()=>nf,UnknownError:()=>Mh,ValidationError:()=>Hs,Vec2:()=>sa,Vec4:()=>mo,Vertex:()=>Kv,WeakCache:()=>Vv,ZIndexMap:()=>Dv,addEscapeEventListener:()=>wg,addFakeTransformToInstanceProperty:()=>S,addMouseCloseListener:()=>Zv,addObserverToInstanceProperty:()=>Vp,addOverrideFocusVisibleEventListener:()=>Jv,addTouchCloseListener:()=>Xv,addTransformToInstanceProperty:()=>Zs,aggregationBucketForDatum:()=>bk,aggregationDatumMatchesIndex:()=>vk,aggregationDomain:()=>on,aggregationIndexForXRatio:()=>Xh,aggregationRangeFittingPoints:()=>ys,aggregationXRatioForDatumIndex:()=>no,aggregationXRatioForXValue:()=>ln,and:()=>Ae,angleBetween:()=>du,angularPadding:()=>bg,appendEllipsis:()=>Ip,applySkiaPatches:()=>_k,arcDistanceSquared:()=>$k,areScalingEqual:()=>aa,array:()=>Un,arrayLength:()=>Wa,arrayOf:()=>ee,arrayOfDefs:()=>Tt,arraysEqual:()=>zn,assignIfNotStrictlyEqual:()=>$p,attachDescription:()=>fe,attachListener:()=>Ve,autoSizedLabelOptionsDefs:()=>Ys,barHighlightOptionsDef:()=>bn,bezier2DDistance:()=>kx,bezier2DExtrema:()=>Cx,boolean:()=>L,borderOptionsDef:()=>zr,boxCollides:()=>Sg,boxContains:()=>pu,boxEmpty:()=>Ok,boxesEqual:()=>gu,buildDateFormatter:()=>vo,cachedTextMeasurer:()=>vi,calcLineHeight:()=>Mp,calculatePlacement:()=>nx,callWithContext:()=>Cn,callback:()=>ze,callbackDefs:()=>Ie,callbackOf:()=>$t,ceilTo:()=>PC,checkDatum:()=>Sx,circularSliceArray:()=>mn,clamp:()=>te,clampArray:()=>to,clipLines:()=>lx,clipSpanX:()=>tf,collapseSpanToPoint:()=>Rx,collectAggregationLevels:()=>xk,color:()=>$,colorStopsOrderValidator:()=>Tp,colorUnion:()=>Ai,commonChartOptionsDefs:()=>se,commonSeriesOptionsDefs:()=>Sn,commonSeriesThemeableOptionsDefs:()=>Se,compactAggregationIndices:()=>Kr,compareDates:()=>Mg,computeExtremesAggregation:()=>wv,computeExtremesAggregationPartial:()=>Sk,constant:()=>Ge,contextMenuItemsArray:()=>ov,countFractionDigits:()=>Dh,countLines:()=>Eb,createAggregationIndices:()=>bs,createButton:()=>Zw,createCanvasContext:()=>Pv,createCheckbox:()=>Xw,createDeprecationWarning:()=>Ag,createElement:()=>he,createElementId:()=>Yl,createIcon:()=>Hx,createId:()=>wn,createIdsGenerator:()=>Xg,createNumberFormatter:()=>Lp,createSelect:()=>qw,createSvgElement:()=>at,createTextArea:()=>Jw,createTicks:()=>po,date:()=>fi,dateToNumber:()=>Kt,dateTruncationForDomain:()=>Zg,datesSortOrder:()=>Dg,debounce:()=>TC,decodeIntervalValue:()=>px,deepClone:()=>Fe,deepFreeze:()=>ki,defaultEpoch:()=>Wg,defined:()=>ue,definedZoomState:()=>cc,diffArrays:()=>Bv,distribute:()=>lb,downloadUrl:()=>rx,dropFirstWhile:()=>ab,dropLastWhile:()=>ob,durationDay:()=>na,durationHour:()=>ia,durationMinute:()=>lr,durationMonth:()=>Gg,durationSecond:()=>oo,durationWeek:()=>cx,durationYear:()=>Ql,easeIn:()=>Qw,easeInOut:()=>eL,easeInOutQuad:()=>nL,easeInQuad:()=>tL,easeOut:()=>hc,easeOutQuad:()=>iL,encodedToTimestamp:()=>cr,enterpriseRegistry:()=>_s,entries:()=>Mt,errorBarOptionsDefs:()=>Ph,errorBarThemeableOptionsDefs:()=>Fl,estimateTickCount:()=>vx,evaluateBezier:()=>yo,every:()=>dv,expandLegendPosition:()=>Zh,extent:()=>Jr,extractDecoratedProperties:()=>hv,extractDomain:()=>yl,fillGradientDefaults:()=>qb,fillImageDefaults:()=>Qb,fillOptionsDef:()=>j,fillPatternDefaults:()=>Jb,findMaxIndex:()=>ar,findMaxValue:()=>Ek,findMinIndex:()=>ro,findMinMax:()=>Nt,findMinValue:()=>Rk,findRangeExtent:()=>Wr,first:()=>Ci,flush:()=>Sb,focusCursorAtEnd:()=>Ik,fontFamilyFull:()=>Lh,fontOptionsDef:()=>Ce,fontWeight:()=>Pl,formatNumber:()=>Gv,formatObjectValidator:()=>lv,formatPercent:()=>_v,formatValue:()=>ao,fromPairs:()=>pv,generateUUID:()=>xu,geoJson:()=>Uv,getAngleRatioRadians:()=>Ev,getAttribute:()=>Xr,getChartTheme:()=>sp,getDOMMatrix:()=>gp,getDocument:()=>Gi,getElementBBox:()=>Nv,getIconClassNames:()=>cu,getImage:()=>ub,getLastFocus:()=>Tg,getMaxInnerRectSize:()=>mg,getMidpointsForIndices:()=>Zn,getMinOuterRectSize:()=>Ak,getOffscreenCanvas:()=>gh,getPath:()=>zp,getPath2D:()=>xl,getResizeObserver:()=>fp,getSequentialColors:()=>$i,getTickTimeInterval:()=>rc,getWindow:()=>Me,googleFont:()=>Ep,gradientColorStops:()=>kh,gradientStrict:()=>wh,greaterThan:()=>yi,groupBy:()=>vl,guardTextEdges:()=>Tb,hasNoModifiers:()=>Wl,hasRequiredInPath:()=>_r,highlightOptionsDef:()=>Op,htmlElement:()=>Cp,inRange:()=>jb,initRovingTabIndex:()=>qk,insertListItemsSorted:()=>ix,instanceOf:()=>RC,interpolationOptionsDefs:()=>Fh,intervalCeil:()=>hx,intervalEpoch:()=>nc,intervalExtent:()=>Hg,intervalFloor:()=>Ti,intervalHierarchy:()=>sc,intervalMilliseconds:()=>Ni,intervalNext:()=>jg,intervalPrevious:()=>ux,intervalRange:()=>hn,intervalRangeCount:()=>ku,intervalRangeNumeric:()=>dx,intervalRangeStartIndex:()=>Ug,intervalStep:()=>hr,intervalUnit:()=>Ss,inverseEaseOut:()=>Ux,isArray:()=>ae,isBetweenAngles:()=>nr,isBoolean:()=>kb,isButtonClickEvent:()=>Lg,isColor:()=>Lb,isContinuous:()=>Nu,isDate:()=>yn,isDecoratedObject:()=>_h,isDefined:()=>Hn,isDenseInterval:()=>fo,isDocumentFragment:()=>pb,isElement:()=>mp,isEmptyObject:()=>kl,isEnumKey:()=>kC,isEnumValue:()=>wC,isFiniteNumber:()=>Be,isFunction:()=>$n,isGradientFill:()=>Wi,isGradientFillArray:()=>_w,isGradientOrPatternFill:()=>zw,isHTMLElement:()=>Sl,isHtmlElement:()=>xp,isImageFill:()=>ra,isInputPending:()=>Ov,isInteger:()=>Hb,isKeyOf:()=>Ll,isNegative:()=>Ka,isNode:()=>fh,isNumber:()=>ji,isNumberEqual:()=>Di,isNumberObject:()=>xx,isObject:()=>le,isObjectLike:()=>Cl,isObjectWithProperty:()=>gv,isObjectWithStringProperty:()=>JC,isPatternFill:()=>Ms,isPlainObject:()=>xe,isPointLabelDatum:()=>Lx,isProperties:()=>Qa,isRegExp:()=>wb,isScaleValid:()=>lc,isSegmentTruncated:()=>vh,isString:()=>dt,isStringFillArray:()=>Dx,isStringObject:()=>qg,isSymbol:()=>wl,isTextTruncated:()=>Gs,isTruncated:()=>Ob,isUnitTimeCategoryScaling:()=>ur,isValidDate:()=>bh,isValidNumberFormat:()=>Kb,iterate:()=>Gr,joinFormatted:()=>js,jsonApply:()=>Ul,jsonDiff:()=>Xn,jsonPropertyCompare:()=>Yv,jsonWalk:()=>or,kebabCase:()=>Pb,labelBoxOptionsDef:()=>rn,legendPositionValidator:()=>Th,lessThan:()=>mi,lessThanOrEqual:()=>_b,levenshteinDistance:()=>Rb,lineDashOptionsDef:()=>W,lineDistanceSquared:()=>fu,lineHighlightOptionsDef:()=>Us,lineSegmentOptions:()=>tv,lineSegmentation:()=>iv,linear:()=>$x,linearGaugeSeriesOptionsDef:()=>jr,linearGaugeSeriesThemeableOptionsDef:()=>$h,linearGaugeTargetOptionsDef:()=>jh,linearPoints:()=>Fx,listDecoratedProperties:()=>Xs,lowestGranularityForInterval:()=>ac,lowestGranularityUnitForTicks:()=>Yg,lowestGranularityUnitForValue:()=>Tu,makeAccessibleClickListener:()=>Jk,mapValues:()=>_p,markerOptionsDefs:()=>Mn,markerStyleOptionsDefs:()=>Ks,measureTextSegments:()=>xs,memo:()=>Xl,merge:()=>Bl,mergeArrayDefaults:()=>qC,mergeDefaults:()=>be,modulus:()=>$b,multiSeriesHighlightOptionsDef:()=>st,nearestSquared:()=>Su,nearestSquaredInContainer:()=>tw,nextPowerOf2:()=>io,niceTicksDomain:()=>Kg,normalisedExtentWithMetadata:()=>mu,normalisedTimeExtentWithMetadata:()=>yu,normalizeAngle180:()=>uu,normalizeAngle360:()=>bi,normalizeAngle360FromDegrees:()=>vs,normalizeAngle360Inclusive:()=>Ck,number:()=>E,numberFormatValidator:()=>xn,numberMin:()=>wp,numberRange:()=>Bb,object:()=>$s,objectsEqual:()=>ft,objectsEqualWith:()=>Bp,optionsDefs:()=>et,or:()=>ne,padding:()=>Xa,paddingOptions:()=>nv,parseNumberFormat:()=>Ah,partialAssign:()=>Hp,pause:()=>xg,pick:()=>zh,placeLabels:()=>Tx,positiveNumber:()=>w,positiveNumberNonZero:()=>Wn,previousPowerOf2:()=>Jp,radialGaugeSeriesOptionsDef:()=>Wh,radialGaugeSeriesThemeableOptionsDef:()=>Uh,radialGaugeTargetOptionsDef:()=>Hh,range:()=>Lu,rangeValidator:()=>Oh,ratio:()=>X,readIntegratedWrappedValue:()=>Jg,record:()=>xb,required:()=>Z,rescaleSpan:()=>bo,rescaleVisibleRange:()=>Du,resetIds:()=>Qk,resolveOperation:()=>mF,rotatePoint:()=>yg,roundTo:()=>Ih,safeCall:()=>Ap,seriesLabelOptionsDefs:()=>Pe,seriesTooltipRangeValidator:()=>rv,setAttribute:()=>ye,setAttributes:()=>Zr,setDocument:()=>cb,setElementBBox:()=>lu,setElementStyle:()=>kn,setElementStyles:()=>Rv,setPath:()=>jp,setWindow:()=>hb,shadowOptionsDefs:()=>Kn,shallowClone:()=>Qr,shapeHighlightOptionsDef:()=>We,shapeSegmentOptions:()=>ev,shapeSegmentation:()=>Za,shapeValidator:()=>Ws,simpleMemorize:()=>Wt,simpleMemorize2:()=>ql,smoothPoints:()=>Bx,solveBezier:()=>Pu,sortAndUniqueDates:()=>Ig,sortBasedOnArray:()=>rb,spanRange:()=>Ki,splitBezier2D:()=>oc,stepPoints:()=>Vx,stopPageScrolling:()=>ex,strictObjectKeys:()=>gs,strictUnion:()=>zb,string:()=>O,stringLength:()=>kp,stringifyValue:()=>Tl,strokeOptionsDef:()=>B,textOrSegments:()=>ai,themeNames:()=>fF,themeOperator:()=>Rl,themeSymbols:()=>gF,themes:()=>Oy,throttle:()=>Dp,tickFormat:()=>hw,tickStep:()=>go,toArray:()=>bl,toDegrees:()=>kk,toFontString:()=>Sp,toIterable:()=>uv,toPlainText:()=>Ze,toRadians:()=>Ut,toTextString:()=>pt,toolbarButtonOptionsDefs:()=>qa,tooltipOptionsDefs:()=>ke,tooltipOptionsDefsWithArea:()=>cv,transformIntegratedCategoryValue:()=>Ou,truncateLine:()=>ta,typeUnion:()=>El,undocumented:()=>J,unguardTextEdges:()=>Nb,union:()=>P,unionSymbol:()=>Nl,unique:()=>pp,validate:()=>Ft,withTimeout:()=>wk,without:()=>K,wrapLines:()=>_g,wrapText:()=>ox,wrapTextOrSegments:()=>Mu,wrapTextSegments:()=>zg});var gF={DEFAULT_ANNOTATION_HANDLE_FILL:eu,DEFAULT_ANNOTATION_STATISTICS_COLOR:nu,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:su,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:gg,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:fg,DEFAULT_ANNOTATION_STATISTICS_FILL:tu,DEFAULT_ANNOTATION_STATISTICS_STROKE:iu,DEFAULT_CAPTION_ALIGNMENT:ir,DEFAULT_CAPTION_LAYOUT_STYLE:tr,DEFAULT_FIBONACCI_STROKES:pg,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:Li,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:wi,DEFAULT_POLAR_SERIES_STROKE:qh,DEFAULT_SHADOW_COLOUR:Yr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:Jh,DEFAULT_TEXTBOX_COLOR:ou,DEFAULT_TEXTBOX_FILL:ru,DEFAULT_TEXTBOX_STROKE:au,DEFAULT_TEXT_ANNOTATION_COLOR:Qh,DEFAULT_TOOLBAR_POSITION:jl,IS_DARK_THEME:so,PALETTE_ALT_DOWN_FILL:hg,PALETTE_ALT_DOWN_STROKE:lg,PALETTE_ALT_NEUTRAL_FILL:ug,PALETTE_ALT_NEUTRAL_STROKE:dg,PALETTE_ALT_UP_FILL:cg,PALETTE_ALT_UP_STROKE:og,PALETTE_DOWN_FILL:sg,PALETTE_DOWN_STROKE:ig,PALETTE_NEUTRAL_FILL:ag,PALETTE_NEUTRAL_STROKE:rg,PALETTE_UP_FILL:ng,PALETTE_UP_STROKE:tg},fF=Object.keys(Oy);function mF(e){const t=Fn.getDefaultPublicParameters(),i=Fn.getDefaultColors();return new hA({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var Ky={};Si(Ky,{Color:()=>Ne,interpolateColor:()=>X0});var yF={VERSION:Xe,_Scene:Uy,_Theme:Wy,_Util:Ky,create:Rr.create.bind(Rr),createSparkline:Rr.__createSparkline.bind(Rr),setup:()=>{Q.setRegistryMode(Q.RegistryMode.Integrated),Q.registerModules(Sy)},isEnterprise:!1};if(Q.registerModules(Sy),typeof _n.exports=="object"&&typeof ml=="object"){var bF=(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=bF(_n.exports,ml)}return _n.exports});
|