var vd=Object.defineProperty,ox=Object.getOwnPropertyDescriptor,si=(t,e)=>{for(var i in e)vd(t,i,{get:e[i],enumerable:!0})},g=(t,e,i,s)=>{for(var n=s>1?void 0:s?ox(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&vd(e,i,n),n},k={};si(k,{error:()=>Id,errorOnce:()=>hx,log:()=>ax,logGroup:()=>dx,reset:()=>ux,table:()=>lx,warn:()=>Sd,warnOnce:()=>cx});var Cr=new Set;function ax(...t){console.log(...t)}function Sd(t,...e){console.warn(`AG Charts - ${t}`,...e)}function Id(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function lx(...t){console.table(...t)}function cx(t,...e){const i=`Logger.warn: ${t}`;Cr.has(i)||(Sd(t,...e),Cr.add(i))}function hx(t,...e){const i=`Logger.error: ${t}`;Cr.has(i)||(Id(t,...e),Cr.add(i))}function ux(){Cr.clear()}function dx(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var Js=class{static[Symbol.iterator](){return this.registeredModules.values()}static register(t){const e=this.registeredModules.get(t.name);if(e&&(e.enterprise||!t.enterprise))throw new Error(`AG Charts - Module '${t.name}' already registered`);this.registeredModules.set(t.name,t)}static registerMany(t){for(const e of t)this.register(e)}static reset(){this.registeredModules.clear()}static detectChartDefinition(t){return this.detectDefinition("chart",t)}static detectSeriesDefinition(t){return this.detectDefinition("series",t)}static detectDefinition(t,e){for(const i of this.registeredModules.values())if(i.type===t&&i.detect(e))return i;throw new Error(`AG Charts - Unknown ${t} type; Check options are correctly structured and series types are specified`)}};Js.registeredModules=new Map;var tc=class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)||this.events.set(t,new Set),this.events.get(t)?.add(e),()=>this.off(t,e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),i.size===0&&this.events.delete(t))}emit(t,e){this.events.get(t)?.forEach(i=>i(e))}clear(t){t?this.events.delete(t):this.events.clear()}};function Qo(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}function px(t){return Array.from(new Set(t))}function ec(t,e){return t.reduce((i,s)=>{const n=e(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function Ri(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i{i.set(s,n)}),t.sort((s,n)=>{const r=i.get(s)??1/0,o=i.get(n)??1/0;return r-o})}function Ad(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,t=n+1):e=n-1}return s}function Ld(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,e=n-1):t=n+1}return s}function fx(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),r=i(n);r==null?t=n+1:(s=r,e=n-1)}return s}function mx(t,e){const i=Math.max(t.length,e.length),s=new Set,n=new Set;for(let r=0;r0||n.size>0,added:s,removed:n}}function Cd(t,e,i){const{leading:s=!0,trailing:n=!0}=i??{};let r,o,a=!1;function l(){n&&o?(r=setTimeout(l,e),t(...o)):a=!1,o=null}function c(...h){a?o=h:(a=!0,r=setTimeout(l,e),s?t(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(r),a=!1,o=null}})}function*tn(...t){for(const e of t)yield*e}function yx(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function Nr(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function xx(t,e="and",i=String,s=1/0){if(t.length===1)return i(t[0]);t=t.map(i);const n=t.pop();if(t.length>=s){const r=t.length-(s-1);return`${t.slice(0,s-1).join(", ")}, and ${r} more ${e} ${n}`}return`${t.join(", ")} ${e} ${n}`}function Tr(t,e=1/0){switch(typeof t){case"undefined":return"undefined";case"number":if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";default:return t=JSON.stringify(t),t.length>e?`${t.slice(0,e)}... (+${t.length-e} characters)`:t}}function bx(t){let e=1;for(let i=0;i"u"))if(en(l))l(c,t)?r[a]=c:n.push({key:a,path:i,value:c,message:Td(o(a),c,l)});else{const h=Jo(c,l,o(a));r[a]=h.valid,n.push(...h.errors)}}for(const a of s)n.push({key:a,path:i,unknown:!0,message:`Unknown option \`${o(a)}\`, ignoring.`});return{valid:r,errors:n}}function Td(t,e,i){const s=Ge(i)?i:i[wr],n=s?`; expecting ${s}`:"";return`${t?`Option \`${t}\``:"Value"} cannot be set to \`${Tr(e)}\`${n}, ignoring.`}function be(t,e){return Object.assign((i,s)=>t(i,s),{[wr]:e})}var ta=(...t)=>be((e,i)=>t.every(s=>s(e,i)),t.map(e=>e[wr]).filter(Boolean).join(" and ")),sn=(...t)=>be((e,i)=>t.some(s=>s(e,i)),t.map(e=>e[wr]).filter(Boolean).join(" or ")),hL=be(Ct,"an array"),uL=be(Nd,"a boolean"),dL=be(en,"a function"),Qi=be(pt,"a number"),ic=be(he,"an object"),Xe=be(Ge,"a string"),ea=be(t=>On(t)||(pt(t)||Ge(t))&&kr(new Date(t)),"a date"),Ax=(t,e=!0)=>be(i=>pt(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),Lx=(t,e)=>be(i=>pt(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),pL=Ax(0),ia=Lx(0,1),kd=t=>pt(t)||kr(t),wd=t=>be((e,i)=>!kd(e)||!kd(i[t])||e`'${i}'`,6);return be(i=>t.includes(i),`a keyword such as ${e}`)}var sc=(t,e)=>be((i,s)=>Ct(i)&&i.every(n=>t(n,s)),e??`${t[wr]} array`),Ed={};si(Ed,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Si,fromToMotion:()=>zt,staticFromToMotion:()=>ts});var Pi={};typeof window<"u"?Pi.window=window:typeof global<"u"&&(Pi.window=global.window),typeof document<"u"?Pi.document=document:typeof global<"u"&&(Pi.document=global.document);function qi(t){return t?Pi.document?.[t]:Pi.document}function Nt(t){return t?Pi.window?.[t]:Pi.window}function Od(t){Pi.document=t}function Rd(t){Pi.window=t}function lt(t,e,i){const s=qi().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const n of e.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function ri(t){return qi().createElementNS("http://www.w3.org/2000/svg",t)}function Pd(t,e){const i=qi("body"),s=lt("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}var nc=new Map;function Nx(){nc.clear()}function oi(t){const e=t.constructor,i=Object.hasOwn(e,"className")?e.className:e.name;if(!i)throw new Error(`The ${e} is missing the 'className' property.`);const s=(nc.get(i)??0)+1;return nc.set(i,s),`${i}-${s}`}function Tx(){return crypto.randomUUID?.()??kx()}function kx(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let i=0;i=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function Ex(t){return t==null||t.height===0||t.width===0||isNaN(t.height)||isNaN(t.width)}function Ox(t){let{x:e,y:i,width:s,height:n}=t;return(s==null||s>0)&&(n==null||n>0)?t:(e!=null&&s!=null&&s<0&&(s=-s,e=e-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:e,y:i,width:s,height:n})}var na=Symbol("interpolate"),ra=t=>t[na]!=null;function oa(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const o=r.distanceSquared(t,e);if(o===0)return{nearest:r,distanceSquared:0};oe[1]&&(e[1]=i);return e}function Rn(t){const[e,i]=ue(t);return i-e}function jd(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function vi(t,e,i=1e-10){return t===e||Math.abs(t-e)=1e21){let n;[e,n]=e.split("e"),n!=null&&(i=Number(n))}const s=e.split(".")[1]?.length??0;return Math.max(s-i,0)}var Er=class Lr{constructor(e,i,s,n){this.x=e,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:e,y:i,width:s,height:n}){return new Lr(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const o of e)o.xn&&(n=o.x+o.width),o.y+o.height>r&&(r=o.y+o.height);return new Lr(i,s,n-i,r-s)}static nearestBox(e,i,s){return oa(e,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:e,y:i,width:s,height:n}=this;return new Lr(e,i,s,n)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,i){return sa.containsPoint(this,e,i)}intersection(e){if(!this.collidesBBox(e))return;const i=it(e.x,this.x,e.x+e.width),s=it(e.y,this.y,e.y+e.height),n=it(e.x,this.x+this.width,e.x+e.width),r=it(e.y,this.y+this.height,e.y+e.height);return new Lr(i,s,n-i,r-s)}collidesBBox(e){return this.xe.x&&this.ye.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,i){if(this.containsPoint(e,i))return 0;const s=e-it(this.x,e,this.x+this.width),n=i-it(this.y,i,this.y+this.height);return s*s+n*n}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const[s,n]of Object.entries(e))this.applyMargin(n,s);return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const[s,n]of Object.entries(e))this.applyMargin(-n,s);return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[na](e,i){return new Lr(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};Er.zero=Object.freeze(new Er(0,0,0,0)),Er.NaN=Object.freeze(new Er(NaN,NaN,NaN,NaN));var F=Er;function j(t){return function(e,i){const s=`__${i}`;e[i]||jx(e,i,s,t)}}function jx(t,e,i,s){const{type:n="normal",changeCb:r,convertor:o,checkDirtyOnAssignment:a=!1}=s??{},l={type:n,changeCb:r,checkDirtyOnAssignment:a,convertor:o};let c;switch(n){case"normal":c=_x(i,l);break;case"transform":c=Gx(i);break;case"path":c=Vx(i);break}c=Bx(Fx(zx(c,l),l),l),Object.defineProperty(t,e,{set:c,get:function(){return this[i]},enumerable:!0,configurable:!0})}function zx(t,e){const{convertor:i}=e;return i?function(s){t.call(this,i(s))}:t}var ca=Symbol("no-change");function Fx(t,e){const{changeCb:i}=e;return i?function(s){const n=t.call(this,s);return n!==ca&&i.call(this,this),n}:t}function Bx(t,e){const{checkDirtyOnAssignment:i}=e;return i?function(s){const n=t.call(this,s);return s?._dirty===!0&&this.markDirty(),n}:t}function _x(t,e){const{changeCb:i}=e;return function(s){const n=this[t];return s!==n?(this[t]=s,this.markDirty(),i?.(this),s):ca}}function Gx(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this.markDirtyTransform(),e):ca}}function Vx(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this._dirtyPath||(this._dirtyPath=!0,this.markDirty()),e):ca}}var Fd=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(Fd||{}),ha=class Wy{constructor(e){this.serialNumber=Wy._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=oi(this),this.pointerEvents=0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=e?.name,this.tag=e?.tag??NaN,this.zIndex=e?.zIndex??0}static toSVG(e,i,s){const n=e?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=ri("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const o=ri("defs");o.append(...n.defs),r.append(o)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(e,i){for(const s of e)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum??this.parentNode?.datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}preRender(e,i=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i;for(const s of this.children()){const n=s.preRender(e);this.childNodeCounts.groups+=n.groups,this.childNodeCounts.nonGroups+=n.nonGroups,this.childNodeCounts.complexity+=n.complexity}return this.childNodeCounts}render(e){const{stats:i}=e;if(this._dirty=!1,e.debugNodeSearch){const s=this.name??this.id;e.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(e){this._layerManager=e,this._debug=e?.debug;for(const i of this.children())i._setLayerManager(e)}sortChildren(e){if(this.dirtyZIndex=!1,!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*traverseUp(e){let i=this;for(e&&(yield i);i=i.parentNode;)yield i}*children(){if(this.childNodes)for(const e of this.childNodes)yield e}*descendants(){for(const e of this.children())yield e,yield*e.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(e){this.childNodes??(this.childNodes=new Set);for(const i of yx(e))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i._setLayerManager(this.layerManager);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){return this.childNodes?.delete(e)?(delete e.parentNode,e._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty(),!0):!1}remove(){return this.parentNode?.removeChild(this)??!1}clear(){for(const e of this.children())delete e.parentNode,e._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(e,i){if(i)for(const s of i)this[s]=e[s];else Object.assign(this,e);return this}containsPoint(e,i){return!1}pickNode(e,i,s=!1){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return;const n=[...this.children()];if(n.length>1e3)for(let r=n.length-1;r>=0;r--){const o=n[r],l=o.containsPoint(e,i)?o.pickNode(e,i):void 0;if(l)return l}else if(n.length)for(let r=n.length-1;r>=0;r--){const o=n[r].pickNode(e,i);if(o)return o}else if(!this.isContainerNode)return this}invalidateCachedBBox(){this.cachedBBox!=null&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}markDirty(){const{_dirty:e}=this;this.cachedBBox==null&&e||(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1;for(const e of this.children())e.markClean()}}onZIndexChange(){const{parentNode:e}=this;e&&(e.dirtyZIndex=!0)}toSVG(){}};ha._nextSerialNumber=0,g([j()],ha.prototype,"visible",2),g([j({changeCb:t=>t.onZIndexChange()})],ha.prototype,"zIndex",2);var Cs=ha,ua=(t,e,i)=>t*(1-i)+e*i,ac=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},lc=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*i**(1/2.4)-.055):12.92*t},Bd=class kt{constructor(e,i,s,n=1){this.r=it(0,e||0,1),this.g=it(0,i||0,1),this.b=it(0,s||0,1),this.a=it(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!kt.parseHex(e):e.indexOf("rgb")>=0?!!kt.stringToRgba(e):kt.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return kt.fromHexString(e);const i=kt.nameToHex.get(e.toLowerCase());if(i)return kt.fromHexString(i);if(e.indexOf("rgb")>=0)return kt.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replace(/ /g,"").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let s=0;sparseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(e){const i=kt.parseHex(e);if(i){const[s,n,r,o]=i;return new kt(s/255,n/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,s=-1;for(let a=0;a=0?(c=it(0,c,100),c/=100):a===3?c=it(0,c,1):(c=it(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(e){const i=kt.stringToRgba(e);if(i){if(i.length===3)return new kt(i[0],i[1],i[2]);if(i.length===4)return new kt(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(e.length===4)return new kt(e[0],e[1],e[2],e[3]);if(e.length===3)return new kt(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(e,i,s,n=1){const r=kt.HSBtoRGB(e,i,s);return new kt(r[0],r[1],r[2],n)}static fromHSL(e,i,s,n=1){const r=kt.HSLtoRGB(e,i,s);return new kt(r[0],r[1],r[2],n)}static fromOKLCH(e,i,s,n=1){const r=kt.OKLCHtoRGB(e,i,s);return new kt(r[0],r[1],r[2],n)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+kt.padHex(Math.round(this.r*255).toString(16))+kt.padHex(Math.round(this.g*255).toString(16))+kt.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=kt.padHex(Math.round(this.a*255).toString(16))),e}toRgbaString(e=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,e);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return kt.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,s){const n=ac(e),r=ac(i),o=ac(s),a=Math.cbrt(.4122214708*n+.5363325363*r+.0514459929*o),l=Math.cbrt(.2119034982*n+.6806995451*r+.1073969566*o),c=Math.cbrt(.0883024619*n+.2817188376*r+.6299787005*o),h=.2104542553*a+.793617785*l-.0040720468*c,u=1.9779984951*a-2.428592205*l+.4505937099*c,d=.0259040371*a+.7827717662*l-.808675766*c,p=Math.atan2(d,u)*180/Math.PI,f=h,y=Math.hypot(u,d),b=p>=0?p:p+360;return[f,y,b]}static OKLCHtoRGB(e,i,s){const n=e,r=i*Math.cos(s*Math.PI/180),o=i*Math.sin(s*Math.PI/180),a=(n+.3963377774*r+.2158037573*o)**3,l=(n-.1055613458*r-.0638541728*o)**3,c=(n-.0894841775*r-1.291485548*o)**3,h=4.0767416621*a-3.3077115913*l+.2309699292*c,u=-1.2684380046*a+2.6097574011*l-.3413193965*c,d=-.0041960863*a-.7034186147*l+1.707614701*c,p=lc(h),f=lc(u),y=lc(d);return[p,f,y]}static RGBtoHSL(e,i,s){const n=Math.min(e,i,s),r=Math.max(e,i,s),o=(r+n)/2;let a,l;if(r===n)a=0,l=0;else{const c=r-n;l=o>.5?c/(2-r-n):c/(r+n),r===e?a=(i-s)/c+(i1&&(h-=1),h<1/6?r+(n-r)*6*h:h<1/2?n:h<2/3?r+(n-r)*(2/3-h)*6:r}const a=o(e/360+1/3),l=o(e/360),c=o(e/360-1/3);return[a,l,c]}static RGBtoHSB(e,i,s){const n=Math.min(e,i,s),r=Math.max(e,i,s),o=r===0?0:(r-n)/r;let a=0;if(n!==r){const l=r-n,c=(r-e)/l,h=(r-i)/l,u=(r-s)/l;e===r?a=u-h:i===r?a=2+c-u:a=4+h-c,a/=6,a<0&&(a=a+1)}return[a*360,o,r]}static HSBtoRGB(e,i,s){e=(e%360+360)%360/360;let n=0,r=0,o=0;if(i===0)n=r=o=s;else{const a=(e-Math.floor(e))*6,l=a-Math.floor(a),c=s*(1-i),h=s*(1-i*l),u=s*(1-i*(1-l));switch(a>>0){case 0:n=s,r=u,o=c;break;case 1:n=h,r=s,o=c;break;case 2:n=c,r=s,o=u;break;case 3:n=c,r=h,o=s;break;case 4:n=u,r=c,o=s;break;case 5:n=s,r=c,o=h;break}}return[n,r,o]}static mix(e,i,s){return new kt(ua(e.r,i.r,s),ua(e.g,i.g,s),ua(e.b,i.b,s),ua(e.a,i.a,s))}};Bd.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 jt=Bd;function Ux(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function _d(t,e){if(typeof t=="string")try{t=jt.fromString(t)}catch{t=jt.fromArray([0,0,0])}if(typeof e=="string")try{e=jt.fromString(e)}catch{e=jt.fromArray([0,0,0])}return i=>jt.mix(t,e,i).toRgbaString()}var da=Symbol("BREAK"),Pn="__decorator_config";function Gd(t,e){Object.getOwnPropertyDescriptor(t,Pn)==null&&Object.defineProperty(t,Pn,{value:{}});const i=t[Pn],s=e.toString();if(typeof i[s]<"u")return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const r=Object.getOwnPropertyDescriptor(t,e),o=r?.set,a=r?.get;return Object.defineProperty(t,e,{set:function(h){const{setters:u,observers:d}=i[s];let p;u.some(f=>f.length>2)&&(p=a?a.call(this):n.get(this));for(const f of u)if(h=f(this,e,h,p),h===da)return;o?o.call(this,h):n.set(this,h);for(const f of d)f(this,h,p)},get:function(){let h=a?a.call(this):n.get(this);for(const u of i[s].getters)if(h=u(this,e,h),h===da)return;return h},enumerable:!0,configurable:!1}),i[s]}function Ji(t,e,i){return(s,n)=>{const r=Gd(s,n);r.setters.push(t),e&&r.getters.unshift(e),i&&Object.assign(r,i)}}function Vd(t){return(e,i)=>{Gd(e,i).observers.push(t)}}function pa(t){return typeof t<"u"&&Pn in t}function nn(t){const e=new Set;for(;pa(t);)e.add(t?.[Pn]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function Ud(t){return nn(t).reduce((e,i)=>(e[i]=t[i]??null,e),{})}function Yx(t,e){const i=e.toString();for(;pa(t);){const s=t[Pn];if(Object.hasOwn(s,i))return s[i];t=Object.getPrototypeOf(t)}}function rn(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>rn(i,e[s])):xe(t)?xe(e)?cc(t,e,rn):!1:t===e}function cc(t,e,i){for(const s of Object.keys(e))if(!(s in t))return!1;for(const s of Object.keys(t))if(!(s in e)||!i(t[s],e[s]))return!1;return!0}function ot(...t){const e={};for(const i of t){if(!he(i))continue;const s=pa(i)?nn(i):Object.keys(i);for(const n of s)xe(e[n])&&xe(i[n])?e[n]=ot(e[n],i[n]):e[n]??(e[n]=i[n])}return e}function ga(t,...e){return e&&Ct(t)?t.map(i=>ot(i,...e)):t}function Wx(t,e){return Object.entries(t).reduce((i,[s,n])=>(i[s]=e(n,s,t),i),{})}function hc(t,e){const i={...t};for(const s of e)delete i[s];return i}function uc(t,e){return(Ct(e)?e:e.split(".")).reduce((s,n)=>s[n],t)}var dc=new Set(["__proto__","constructor","prototype"]);function pc(t,e,i){const s=Ct(e)?e.slice():e.split("."),n=s.pop();if(s.some(o=>dc.has(o)))return;const r=s.reduce((o,a)=>o[a],t);return r[n]=i,r[n]}function gc(t,e,i){if(i===void 0)return e;for(const s of t){const n=i[s];n!==void 0&&(e[s]=n)}return e}function Or(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Or(i)}),t}var fc={};si(fc,{easeIn:()=>Hx,easeInOut:()=>Kx,easeInOutQuad:()=>Xx,easeInQuad:()=>$x,easeOut:()=>Rr,easeOutQuad:()=>Zx,inverseEaseOut:()=>Wd,linear:()=>Yd});var Yd=t=>t,Hx=t=>1-Math.cos(t*Math.PI/2),Rr=t=>Math.sin(t*Math.PI/2),Kx=t=>-(Math.cos(t*Math.PI)-1)/2,$x=t=>t*t,Zx=t=>1-(1-t)**2,Xx=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,Wd=t=>2*Math.asin(t)/Math.PI,fa=.2,jn=["initial","remove","update","add","trailing","end","none"],Pr={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:fa,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+fa,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},Hd=(t=>(t.Loop="loop",t.Reverse="reverse",t))(Hd||{});function Qx(t){return t.every(e=>e instanceof Cs)}function ma(t){return Qx(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function mc(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>mc(i,e[s])):ra(t)&&ra(e)?t.equals(e):xe(t)&&xe(e)?cc(t,e,mc):!1}var Kd=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??Yd,this.phase=t.phase;const e=t.duration??Pr[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return mc(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(s-e)):0}get delta(){return this.ease(it(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||ra(e))return this.interpolateValue(t,e);const i=[];for(const s of Object.keys(e)){const n=this.interpolateValue(t[s],e[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[r,o]of i)n[r]=o(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(ra(t))return i=>t[na](e,i);try{switch(typeof t){case"number":return Ux(t,e);case"string":return _d(t,e);case"boolean":if(t===e)return()=>t;break}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},Si={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function zt(t,e,i,s,n,r,o){const{fromFn:a,toFn:l,applyFn:c=(f,y)=>f.setProperties(y)}=n,{nodes:h,selections:u}=ma(s),d=(f,y)=>{let b,m=0,M=0;for(const S of y){const v=f[m]===S,I={last:M>=y.length-1,lastLive:m>=f.length-1,prev:y[M-1],prevFromProps:b,prevLive:f[m-1],next:y[M+1],nextLive:f[m+(v?1:0)]},L=`${t}_${e}_${S.id}`;i.stopByAnimationId(L);let A="unknown";v?r&&o&&(A=qx(S,S.datum,r,o)):A="removed",S.transitionOut=A==="removed";const{phase:D,start:C,finish:N,delay:w,duration:O,...B}=a(S,S.datum,A,I),{phase:rt,start:Y,finish:X,delay:J,duration:st,...K}=l(S,S.datum,A,I),z=N==null;i.animate({id:L,groupId:t,phase:D??rt??"update",duration:O??st,delay:w??J,from:B,to:K,ease:Rr,collapsable:z,onPlay:()=>{const G={...C,...Y,...B};c(S,G,"start")},onUpdate(G){c(S,G,"update")},onStop:()=>{const G={...C,...Y,...B,...K,...N,...X};c(S,G,"end")}}),v&&m++,M++,b=B}};let p=0;for(const f of u){const y=f.nodes(),b=y.filter(m=>!f.isGarbage(m));d(b,y),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:Rr,onStop(){f.cleanup()}}),p++}d(h,h)}function ts(t,e,i,s,n,r,o){const{nodes:a,selections:l}=ma(s),{start:c,finish:h,phase:u}=o;i.animate({id:`${t}_${e}`,groupId:t,phase:u??"update",from:n,to:r,ease:Rr,onPlay:()=>{if(c){for(const d of a)d.setProperties(c);for(const d of l)for(const p of d.nodes())p.setProperties(c)}},onUpdate(d){for(const p of a)p.setProperties(d);for(const p of l)for(const f of p.nodes())f.setProperties(d)},onStop:()=>{for(const d of a)d.setProperties({...r,...h});for(const d of l){for(const p of d.nodes())p.setProperties({...r,...h});d.cleanup()}}})}function qx(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var ya=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}tickFormatter(t){}datumFormatter(t){}get bandwidth(){}get step(){}get inset(){}},$d=class Hy extends ya{constructor(e=[],i=[]){super(),this.domain=e,this.range=i,this.defaultClamp=!1}static is(e){return e instanceof Hy}normalizeDomains(...e){let i,s=1/0,n,r=-1/0;for(const o of e)for(const a of o){const l=a.valueOf();lr&&(r=l,n=a)}return i!=null&&n!=null?{domain:[i,n],animatable:!0}:{domain:[],animatable:!1}}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{domain:i}=this,s=this.getPixelRange();if(i.length===0)return s;const n=Math.abs(i[1].valueOf()-i[0].valueOf())/e+1,r=Math.floor(s),o=Math.min(n,r);return s/Math.max(1,o)}convert(e,i=this.defaultClamp){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=Number(this.transform(s[0])),r=Number(this.transform(s[1])),o=Number(this.transform(e)),{range:a}=this,[l,c]=a;if(i){const[h,u]=ue([n,r]);if(ou)return c}return n===r?(l+c)/2:o===n?l:o===r?c:l+(o-n)/(r-n)*(c-l)}invert(e,i){const s=this.domain.map(h=>this.transform(h)),[n,r]=s,{range:o}=this,[a,l]=o;let c;return a===l?c=this.toDomain((Number(n)+Number(r))/2):c=this.toDomain(Number(n)+(e-a)/(l-a)*(Number(r)-Number(n))),this.transformInvert(c)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};$d.defaultTickCount=5;var yt=$d,Zd={};si(Zd,{TimeInterval:()=>zn,day:()=>xa,friday:()=>pb,hour:()=>Gn,millisecond:()=>Xd,minute:()=>_n,monday:()=>cb,month:()=>an,saturday:()=>gb,second:()=>Bn,sunday:()=>zr,thursday:()=>db,tuesday:()=>hb,utcDay:()=>Cb,utcHour:()=>Db,utcMinute:()=>vb,utcMonth:()=>kb,utcYear:()=>Ob,wednesday:()=>ub,year:()=>ba});var zn=class{constructor(t,e,i){this._encode=t,this._decode=e,this._rangeCallback=i}floor(t){const e=new Date(t),i=this._encode(e);return this._decode(i)}ceil(t){const e=new Date(Number(t)-1),i=this._encode(e);return this._decode(i+1)}range(t,e,{extend:i=!1,visibleRange:s=[0,1]}={}){let n=!1;t.getTime()>e.getTime()&&([t,e]=[e,t],n=!0);const r=this._rangeCallback?.(t,e),o=this._encode(i?this.floor(t):this.ceil(t)),a=this._encode(i?this.ceil(e):this.floor(e));if(a{const u=r==="start"?c:h;return i=this.getOffset(u,t),()=>i=l}}else typeof r=="number"?i=this.getOffset(new Date(r),t):r instanceof Date&&(i=this.getOffset(r,t));const o=l=>Math.floor((this._encode(l)-i)/t),a=l=>this._decode(l*t+i);return new zn(o,a,s)}};function Jx(t){return t.getTime()}function tb(t){return new Date(t)}var Xd=new Qe(Jx,tb),Ns=1e3,fe=Ns*60,Ce=fe*60,ai=Ce*24,es=ai*7,jr=ai*30,Fn=ai*365,Qd=new Date().getTimezoneOffset()*fe;function eb(t){return Math.floor((t.getTime()-Qd)/Ns)}function ib(t){return new Date(Qd+t*Ns)}var Bn=new Qe(eb,ib),qd=new Date().getTimezoneOffset()*fe;function sb(t){return Math.floor((t.getTime()-qd)/fe)}function nb(t){return new Date(qd+t*fe)}var _n=new Qe(sb,nb),Jd=new Date().getTimezoneOffset()*fe;function rb(t){return Math.floor((t.getTime()-Jd)/Ce)}function ob(t){return new Date(Jd+t*Ce)}var Gn=new Qe(rb,ob);function ab(t){const e=t.getTimezoneOffset()*fe;return Math.floor((t.getTime()-e)/ai)}function lb(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}var xa=new Qe(ab,lb);function on(t){const i=(7+t-4)%7;function s(r){const o=r.getTimezoneOffset()*fe;return Math.floor((r.getTime()-o)/es-i/7)}function n(r){const o=new Date(1970,0,1);return o.setDate(o.getDate()+r*7+i),o}return new Qe(s,n)}var zr=on(0),cb=on(1),hb=on(2),ub=on(3),db=on(4),pb=on(5),gb=on(6);function fb(t){return t.getFullYear()*12+t.getMonth()}function mb(t){const e=Math.floor(t/12),i=t-e*12;return new Date(e,i,1)}var an=new Qe(fb,mb);function yb(t){return t.getFullYear()}function xb(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}var ba=new Qe(yb,xb);function bb(t){return Math.floor(t.getTime()/fe)}function Mb(t){return new Date(t*fe)}var vb=new Qe(bb,Mb);function Sb(t){return Math.floor(t.getTime()/Ce)}function Ib(t){return new Date(t*Ce)}var Db=new Qe(Sb,Ib);function Ab(t){return Math.floor(t.getTime()/ai)}function Lb(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}var Cb=new Qe(Ab,Lb);function Nb(t){return t.getUTCFullYear()*12+t.getUTCMonth()}function Tb(t){const e=Math.floor(t/12),i=t-e*12;return new Date(Date.UTC(e,i,1))}var kb=new Qe(Nb,Tb);function wb(t){return t.getUTCFullYear()}function Eb(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}var Ob=new Qe(wb,Eb),Ma={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 yc(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function tp(t,e){const s=new Date(t.getFullYear(),0,1).getDay(),n=(e-s+7)%7,r=new Date(t.getFullYear(),0,n+1);return r<=t?Math.floor(yc(t,r)/7)+1:0}var Rb=0,ep=1,ip=4;function sp(t,e=t.getFullYear()){const s=new Date(e,0,1).getDay(),n=(ip-s+7)%7,r=new Date(e,0,n-(ip-ep)+1);return r<=t?Math.floor(yc(t,r)/7)+1:sp(t,e-1)}function Pb(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${me(Math.floor(i/60),2,"0")}${me(Math.floor(i%60),2,"0")}`}var jb={a:t=>Ma.shortDays[t.getDay()],A:t=>Ma.days[t.getDay()],b:t=>Ma.shortMonths[t.getMonth()],B:t=>Ma.months[t.getMonth()],c:"%x, %X",d:(t,e)=>me(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>me(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>me(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":me(i,2,e??"0")},j:(t,e)=>me(yc(t)+1,3,e??"0"),m:(t,e)=>me(t.getMonth()+1,2,e??"0"),M:(t,e)=>me(t.getMinutes(),2,e??"0"),L:(t,e)=>me(t.getMilliseconds(),3,e??"0"),p:t=>t.getHours()<12?"AM":"PM",Q:t=>String(t.getTime()),s:t=>String(Math.floor(t.getTime()/1e3)),S:(t,e)=>me(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>me(tp(t,Rb),2,e??"0"),V:(t,e)=>me(sp(t),2,e??"0"),w:(t,e)=>me(t.getDay(),2,e??"0"),W:(t,e)=>me(tp(t,ep),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>me(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>me(t.getFullYear(),4,e??"0"),Z:t=>Pb(t),"%":()=>"%"},zb={_:" ",0:"0","-":""};function me(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function Fr(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const a=i>0?t.substring(0,i):t;e.push(a)}if(i<0)break;const s=t[i+1],n=zb[s];n!=null&&i++;const r=t[i+1],o=jb[r];if(typeof o=="function")e.push([o,n]);else if(typeof o=="string"){const a=Fr(o);e.push([a,n])}else e.push(`${n??""}${r}`);t=t.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return e.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}function Me(t){return t instanceof Date?t.getTime():t}function xc(t,e,i){const s=np(t,e,i),n=Fr(s);return r=>n(r)}function np(t,e,i=0){let s=1/0;for(let h=1;h0,c=isFinite(s)?Fb(s,t):Bb(t[0]);return Gb(Math.max(c-i,0),l,t)}function Fb(t,e){return t{if(typeof d=="string")return!0;const[p,f,y,b]=d;return b>=t&&f<=r&&r(typeof p=="string"?d.result.push(p):d.used.has(p[0])||(d.result.push(p),d.used.add(p[0])),d),{result:[],used:new Set}).result,h=c.findIndex(d=>typeof d!="string"),u=c.findLastIndex(d=>typeof d!="string");return c.slice(h,u+1).map(d=>typeof d=="string"?d:d[4]).join("").replaceAll(/\s+/g," ").trim()}var Vn=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};function rp(t,e,i){if(i==null||i[0]===0&&i[1]===1)return t;const s=it(0,Math.floor(i[0]*t.length),t.length),n=it(0,Math.ceil(i[1]*t.length),t.length),r=e?t.length-n:s,o=e?t.length-s:n;return t.slice(r,o)}var va=class Ky extends ya{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this.interval=void 0,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof Ky}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=it(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=it(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=it(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&k.warnOnce("Expected update to not invalidate scale"))}ticks(e,i=this.domain,s){return rp(i,!1,s)}convert(e,i){this.refresh();const s=this.getIndex(e);return s==null||s<0||s>=this.domain.length?NaN:this.ordinalRange(s)}invertNearestIndex(e){this.refresh();const{domain:i}=this;if(i.length===0)return-1;let s=0,n=i.length-1,r=1/0,o=0;for(;s<=n;){const a=(n+s)/2|0,l=this.ordinalRange(a),c=Math.abs(l-e);if(c===0)return a;c{const{optional:i}=Yx(this,e),s=i===!0||typeof this[e]<"u";return s||k.warnOnce(`${t??""}[${e}] is required.`),s})}toJson(){return nn(this).reduce((t,e)=>{const i=this[e];return t[e]=ji(i)?i.toJson():i,t},{})}},Gr=class $y extends Array{constructor(e,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(e)?r=>new e().set(r):e;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(Ct(e)){this.length=e.length;for(let i=0;ie?.toJson?.()??e)}};function ji(t){return t instanceof et||t instanceof Gr}function x(t,e={}){const{optional:i=!1,property:s}=e;return Ji((n,r,o)=>{const a={...e,target:n,property:r};if(i&&typeof o>"u"||t(o,a))return ji(n[r])&&!ji(o)?(n[r].set(o),n[r]):o;const l=s??String(r).replace(/^_*/,""),c=n.constructor.className??n.constructor.name.replace(/Properties$/,""),h=Tr(o,50);return k.warn(`Property [${l}] of [${c}] cannot be set to [${h}]${t.message?`; expecting ${Wr(t,a)}`:""}, ignoring.`),da},void 0,{optional:i})}var zi=(...t)=>{const e=[];return Mt((i,s)=>(e.length=0,t.every(n=>{const r=n(i,s);return r||e.push(Wr(n,s)),r})),()=>e.filter(Boolean).join(" AND "))},Ts=(...t)=>Mt((e,i)=>t.some(s=>s(e,i)),e=>t.map(qb(e)).filter(Boolean).join(" OR ")),P=Dc(Mt((t,e)=>ji(t)||he(t)&&ji(e.target[e.property]),"a properties object")),ap=Dc(Mt(t=>he(t),"an object")),H=Mt(Nd,"a boolean"),Ne=Mt(en,"a function"),T=Mt(Ge,"a string"),ut=tM(Mt(pt,"a number")),lp=Mt(t=>ni(t)&&!isNaN(t),"a real number"),Sa=Mt(t=>ni(t)&&isNaN(t),"NaN"),R=ut.restrict({min:0}),xt=ut.restrict({min:0,max:1}),Un=Ts(ut,Sa),Vr=Jb(Mt(Ct,"an array")),is=(t,e)=>Mt((i,s)=>Ct(i)&&i.every(n=>t(n,s)),i=>{const s=Wr(Vr,i)??"";return typeof e=="function"?`${s} of ${e(i)}`:e?`${s} of ${e}`:s}),Ia=t=>pt(t)||kr(t),Ur=t=>Mt((e,i)=>!Ia(e)||!Ia(i.target[t])||eMt((e,i)=>!Ia(e)||!Ia(i.target[t])||e>i.target[t],`to be greater than ${t}`),bc=Mt(kr,"Date object"),Mc=Ts(bc,R),cp="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",gt=Mt(t=>Ge(t)&&jt.validColorString(t),`color String. ${cp}`),hp=Dc(Mt(t=>he(t)&&t.type==="gradient","a color gradient object")),qe=Mt(is(gt),`color strings. ${cp}`),Ub=is(H,"boolean values"),Da=is(ut,"numbers"),up=is(T,"strings"),Yb=Mt(is(bc),"Date objects"),vc=Mt(is(P),"objects"),Wb=It(["butt","round","square"],"a line cap"),Hb=It(["round","bevel","miter"],"a line join"),Kb=It(["solid","dashed","dotted"],"a line style"),Fi=Mt(is(R),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),Sc=It(["top","right","bottom","left"],"a position"),ss=It(["normal","italic","oblique"],"a font style"),ns=Ts(It(["normal","bold","bolder","lighter"],"a font weight"),ut.restrict({min:1,max:1e3})),Aa=It(["never","always","hyphenate","on-space"],"a text wrap strategy"),dp=It(["left","center","right"],"a text align"),$b=It(["top","middle","bottom"],"a vertical align"),Zb=It(["ellipsis","hide"],"an overflow strategy"),pp=It(["horizontal","vertical"],"a direction"),Xb=It(["inside","outside"],"a placement"),La=Ts(It(["exact","nearest"],"interaction range"),ut),Ic=It(["top","bottom","left","right"]);function It(t,e="a"){return Mt((i,s)=>{const n=t.find(r=>{const o=typeof r=="string"?r:r.value;return i===o});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const r=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&r.push(`Use ${n.deprecatedTo} instead.`),k.warnOnce(r.join(" "),s.property)}return!0},`${e} keyword such as ${Qb(t)}`)}var gp=Ts(zi(ut.restrict({min:1}),Ur("maxSpacing")),Sa),fp=Ts(zi(ut.restrict({min:1}),Yr("minSpacing")),Sa);function Mt(t,e){return t.message=e,t}function Qb(t){const e=t.filter(s=>typeof s=="string"||s.undocumented!==!0).map(s=>`'${typeof s=="string"?s:s.value}'`);if(e.length===1)return e[0];const i=e.pop();return`${e.join(", ")} or ${i}`}function Wr(t,e){return en(t.message)?t.message(e):t.message}function qb(t){return e=>Wr(e,t)}function Jb(t){return Object.assign(t,{restrict({length:e,minLength:i}={}){let s="an array";return ni(i)&&i>0?s="a non-empty array":ni(e)&&(s=`an array of length ${e}`),Mt(n=>Ct(n)&&(ni(e)?n.length===e:!0)&&(ni(i)?n.length>=i:!0),s)}})}function tM(t){return Object.assign(t,{restrict({min:e,max:i}={}){const s=["a number"],n=ni(e),r=ni(i);return n&&r?s.push(`between ${e} and ${i} inclusive`):n?s.push(`greater than or equal to ${e}`):r&&s.push(`less than or equal to ${i}`),Mt(o=>pt(o)&&(n?o>=e:!0)&&(r?o<=i:!0),s.join(" "))}})}function Dc(t){return Object.assign(t,{restrict(e){return Mt(i=>i instanceof e,i=>Wr(t,i)??`an instance of ${e.name}`)}})}var mp={};si(mp,{resetMotion:()=>de});function de(t,e){const{nodes:i,selections:s}=ma(t);for(const n of s){for(const r of n.nodes()){const o=e(r,r.datum);r.setProperties(o)}n.cleanup()}for(const n of i){const r=e(n,n.datum);n.setProperties(r)}}var eM=2e3,yp=Date.now(),iM=()=>{const t=Date.now()-yp;if(t>eM){const e=(Math.floor(t/100)/10).toFixed(1);k.log(`**** ${e}s since last log message ****`)}yp=Date.now()},Dt={create(...t){return Object.assign((...i)=>{Dt.check(...t)&&(typeof i[0]=="function"&&(i=Qo(i[0]())),iM(),k.log(...i))},{check:()=>Dt.check(...t),group:(i,s)=>Dt.check(...t)?k.logGroup(i,s):s()})},check(...t){return t.length===0&&t.push(!0),Qo(Nt("agChartsDebug")).some(i=>t.includes(i))}};function xp({context:t,pixelRatio:e,width:i,height:s}){t.save(),t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(s*e)),t.restore()}function bp(t){if(Dt.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function Mp(t,e,i){return[Math.round(t*i),Math.round(e*i)]}var vp=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[r,o]=Mp(e,i,s);this.canvas=new OffscreenCanvas(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),bp(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:s,context:n}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[r,o]=Mp(t,e,i);s.width=r,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){xp(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)}},Sp=t=>{const e=jt.fromString(t),[i,s,n]=jt.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},Ac=1e-6,Ip=t=>t.c1-Ac,sM=(t,e,i)=>{i=it(0,i,1);let s;if(Ip(t))s=e.h;else if(Ip(e))s=t.h;else{const a=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=a*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,r=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return jt.fromOKLCH(r,n,s,o)},ks=class extends ya{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Sp)}update(){const{domain:t,range:e}=this;t.length<2&&(k.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let i=1;i=n){k.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((r,o)=>r-o);break}}if(e.length0?e[0]:"black");this.parsedRange=this.range.map(Sp)}normalizeDomains(...t){return{domain:t.flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],r=e.at(-1),o=i[0],a=i[i.length-1];if(t<=n)return o;if(t>=r)return a;let l,c;if(e.length===2){const d=(t-n)/(r-n),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=Math.PI&&(t-=li),t}function ws(t,e,i){const s=Tt(t),n=Tt(e),r=Tt(i);return nr?n<=s||s<=r:!0}function Jt(t){return t/180*Math.PI}function rM(t){return t/Math.PI*180}function Na(t,e){return t=Tt(t),e=Tt(e),e-t+(t>e?li:0)}function Dp(t){const e=Tt(t);return e<=Hr?e/Hr:e<=Math.PI?(Math.PI-e)/Hr:e<=1.5*Math.PI?(e-Math.PI)/Hr:(li-e)/Hr}var Lc=class extends Ca{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e){const{angle:s}=this,n=Tt(Jt(s+90)),r=Math.cos(n),o=Math.sin(n),a=e.width,l=e.height,c=e.x+a*.5,h=e.y+l*.5,u=Math.sqrt(l*l+a*a)/2,d=Math.atan2(l,a);let p;n{const{offset:s}=e,n=t.at(i+1)?.color;return n!=null?[e,{offset:s,color:n}]:[e]})}function aM(t,e){const i=e==="discrete"?1:0,s=t.map((n,r,{length:o})=>({offset:(r+i)/(o-1+i),color:n}));return e==="discrete"?Ap(s):s}function Lp(t,e,i,s="continuous"){if(t.length===0)return aM(e,s);if(!oM(t))return k.warnOnce("[fills] must have the stops defined in ascending order"),[];const n=Math.min(...i),r=Math.max(...i),o=s==="discrete",a=new Float64Array(t.length);let l=0,c=-1;for(let p=0;p=c){c=t.length-1;for(let b=p+1;bp.color!=null)?.color,u;const d=t.map(({color:p},f)=>{const y=a[f];return p!=null?h=p:h!=null?p=h:(u==null&&(u=new ks,u.domain=[0,1],u.range=e),p=u.convert(y)),{offset:y,color:p}});return s==="discrete"?Ap(d):d}function Cp(t){return t!==null&&he(t)&&t.type=="gradient"}function rs(t,e,i){const s=Math.round(e*t)/t;return i==null?s:i===0?0:i<1?Math.ceil(i*t)/t:Math.round((i+e)*t)/t-s}function Np(t,e){return Math.floor(e*t)/t}var lM=/^linear-gradient\((-?[\d.]+)deg,(.*?)\)$/i,Te=class Oi extends Cs{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=Oi.defaultStyles.fill,this.stroke=Oi.defaultStyles.stroke,this.strokeWidth=Oi.defaultStyles.strokeWidth,this.lineDash=Oi.defaultStyles.lineDash,this.lineDashOffset=Oi.defaultStyles.lineDashOffset,this.lineCap=Oi.defaultStyles.lineCap,this.lineJoin=Oi.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=Oi.defaultStyles.opacity,this.fillShadow=Oi.defaultStyles.fillShadow,this.gradientFillOptions={domain:[0,1],defaultColorRange:Oi.defaultStyles.defaultColorRange}}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){let i;if(e instanceof Ca)return e;if(typeof e=="string"&&e?.startsWith("linear-gradient")&&(i=lM.exec(e))){const s=parseFloat(i[1]),n=[],r=i[2],o=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let a;for(;a=o.exec(r);)n.push(a[0]);return new Lc("rgb",n.map((l,c)=>({color:l,offset:c/(n.length-1)})),s)}else if(Cp(e))return this.createLinearGradient(e)}createLinearGradient(e){const{colorStops:i=[],direction:s}=e,n=s==="horizontal",{domain:r,defaultColorRange:o=[]}=this.gradientFillOptions,a=Lp(i,o,r);return new Lc("oklch",a,n?0:90)}onFillChange(){this.fillGradient=this.getGradient(this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return rs(this.layerManager?.canvas?.pixelRatio??1,e,i)}fillStroke(e,i){this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){if(this.fill){const{globalAlpha:s}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=s}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,i){i?e.fill(i):e.fill()}applyFill(e){const i=this.gradientFillOptions.bbox??this.getBBox();e.fillStyle=this.fillGradient?.createGradient(e,i)??(typeof this.fill=="string"?this.fill:void 0)??"black"}applyStroke(e){e.strokeStyle=this.strokeGradient?.createGradient(e,this.getBBox())??(typeof this.stroke=="string"?this.stroke:void 0)??"black"}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,s=this.fillShadow;s?.enabled&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*i,e.shadowOffsetY=s.yOffset*i,e.shadowBlur=s.blur*i)}renderStroke(e,i){if(this.stroke&&this.strokeWidth){const{globalAlpha:s}=e;this.applyStroke(e),e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.miterLimit!=null&&(e.miterLimit=this.miterLimit),this.executeStroke(e,i),e.globalAlpha=s}}executeStroke(e,i){i?e.stroke(i):e.stroke()}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e){const{fill:i,fillOpacity:s}=this;e.setAttribute("fill",typeof i=="string"?i:"none"),e.setAttribute("fill-opacity",String(s))}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:o}=this;if(i!=null&&(e.setAttribute("stroke",typeof i=="string"?i:"none"),e.setAttribute("stroke-opacity",String(s)),e.setAttribute("stroke-width",String(n))),r?.some(a=>a!==0)===!0){const a=r.length%2===1?[...r,...r]:r;e.setAttribute("stroke-dasharray",a.join(" ")),e.setAttribute("stroke-dashoffset",String(o))}}};Te.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0,defaultColorRange:["#5090dc","#ef5452"]},g([j()],Te.prototype,"fillOpacity",2),g([j()],Te.prototype,"strokeOpacity",2),g([j({changeCb:t=>t.onFillChange()})],Te.prototype,"fill",2),g([j({changeCb:t=>t.onStrokeChange()})],Te.prototype,"stroke",2),g([j()],Te.prototype,"strokeWidth",2),g([j()],Te.prototype,"lineDash",2),g([j()],Te.prototype,"lineDashOffset",2),g([j()],Te.prototype,"lineCap",2),g([j()],Te.prototype,"lineJoin",2),g([j()],Te.prototype,"miterLimit",2),g([j({convertor:t=>it(0,t,1)})],Te.prototype,"opacity",2),g([j({checkDirtyOnAssignment:!0})],Te.prototype,"fillShadow",2),g([j({changeCb:t=>t.onFillChange()})],Te.prototype,"gradientFillOptions",2);var ci=Te,Tp=[1,0,0,1,0,0],Ii=class Zl{get e(){return[...this.elements]}constructor(e=Tp){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return vi(e[0],1)&&vi(e[1],0)&&vi(e[2],0)&&vi(e[3],1)&&vi(e[4],0)&&vi(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],a=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];s=s??e,s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=l,s[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=new Array(6);return e instanceof Zl?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new Zl(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],r=e[3];const o=e[4],a=e[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,new Zl([r,-s,-n,i,n*a-r*o,s*o-i*a])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],r=e[3];const o=e[4],a=e[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,e[0]=r,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*a-r*o,e[5]=s*o-i*a,this}transformPoint(e,i){const s=this.elements;return{x:e*s[0]+i*s[2]+s[4],y:e*s[1]+i*s[3]+s[5]}}transformBBox(e,i){const s=this.elements,n=s[0],r=s[1],o=s[2],a=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,u=e.y+c,d=Math.abs(l*n)+Math.abs(c*o),p=Math.abs(l*r)+Math.abs(c*a);return i??(i=new F(0,0,0,0)),i.x=h*n+u*o+s[4]-d,i.y=h*r+u*a+s[5]-p,i.width=d+d,i.height=p+p,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,s,n,r,o,a){const l=i,c=s;let h,u;l===1&&c===1?(h=0,u=0):(h=a?.scalingCenterX??0,u=a?.scalingCenterY??0);const d=n,p=Math.cos(d),f=Math.sin(d);let y,b;d===0?(y=0,b=0):(y=a?.rotationCenterX??0,b=a?.rotationCenterY??0);const m=r,M=o,S=h*(1-l)-y,v=u*(1-c)-b;return e.setElements([p*l,f*l,-f*c,p*c,p*S-f*v+y+m,f*S+p*v+b+M]),e}};function Es(t){return wp(t.constructor)}var kp=Symbol("isMatrixTransform");function wp(t){return t[kp]===!0}function Nc(t){var e,i;const s=t;if(wp(t))return t;const n=Symbol("matrix_combined_transform");class r extends s{constructor(){super(...arguments),this[i]=new Ii,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(a){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(Tp),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(a){return this.computeTransformMatrix(),this[n].identity?a.clone():this[n].transformBBox(a)}toParentPoint(a,l){return this.computeTransformMatrix(),this[n].identity?{x:a,y:l}:this[n].transformPoint(a,l)}fromParent(a){return this.computeTransformMatrix(),this[n].identity?a.clone():this[n].inverse().transformBBox(a)}fromParentPoint(a,l){return this.computeTransformMatrix(),this[n].identity?{x:a,y:l}:this[n].inverse().transformPoint(a,l)}computeBBox(){const a=super.computeBBox();return a&&this.toParent(a)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(a,l,c=!1){return c||({x:a,y:l}=this.fromParentPoint(a,l)),super.pickNode(a,l)}render(a){this.computeTransformMatrix();const{ctx:l}=a,c=this[n];let h=!1;c.identity||(l.save(),h=!0,c.toContext(l)),super.render(a),h&&l.restore()}toSVG(){this.computeTransformMatrix();const a=super.toSVG(),l=this[n];if(l.identity||a==null)return a;const c=ri("g");c.append(...a.elements);const[h,u,d,p,f,y]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${f} ${y})`),{elements:[c],defs:a.defs}}}return e=kp,i=n,r[e]=!0,r}function Yn(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends Nc(i){constructor(){super(...arguments),this[e]=new Ii,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:a,rotationCenterX:l,rotationCenterY:c}=this;a!==0&&(Ii.updateTransformMatrix(this[s],1,1,a,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return e=s,g([j({type:"transform"})],n.prototype,"rotationCenterX",2),g([j({type:"transform"})],n.prototype,"rotationCenterY",2),g([j({type:"transform"})],n.prototype,"rotation",2),n}function Tc(t){var e;const i=t,s=Symbol("matrix_scale");class n extends Nc(i){constructor(){super(...arguments),this[e]=new Ii,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(o){super.updateMatrix(o);const{scalingX:a,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;a===1&&l===1||(Ii.updateTransformMatrix(this[s],a,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}}return e=s,g([j({type:"transform"})],n.prototype,"scalingX",2),g([j({type:"transform"})],n.prototype,"scalingY",2),g([j({type:"transform"})],n.prototype,"scalingCenterX",2),g([j({type:"transform"})],n.prototype,"scalingCenterY",2),n}function ln(t){var e;const i=t,s=Symbol("matrix_translation");class n extends Nc(i){constructor(){super(...arguments),this[e]=new Ii,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:a,translationY:l}=this;a===0&&l===0||(Ii.updateTransformMatrix(this[s],1,1,0,a,l),o.multiplySelf(this[s]))}}return e=s,g([j({type:"transform"})],n.prototype,"translationX",2),g([j({type:"transform"})],n.prototype,"translationY",2),n}var Ft=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())Es(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return Es(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():Es(t)&&(e=t.toParent(e));for(const i of t.traverseUp())Es(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())Es(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return Es(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){Es(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())Es(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},kc=(t,e)=>Math.sign(t-e);function Ep(t,e){if(typeof t=="number"&&typeof e=="number")return kc(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let r=0;r0&&this.getVisibility()?this.layer??(this.layer=this._layerManager?.addLayer({name:this.name})):this.layer!=null&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e};if(!s){this.renderInContext(n),super.render(n);return}const{ctx:r,stats:o,devicePixelRatio:a}=e;let{image:l}=this;if(this.isDirty(e)){l?.bitmap.close(),l=void 0;const h=i?void 0:this.computeSafeClippingBBox(a),u=(d,...p)=>{const f=d.context;n.ctx=f,d.clear(),f.save(),f.setTransform(...p),f.globalAlpha=1,this.renderInContext(n),f.restore(),f.verifyDepthZero?.()};if(i)u(i,r.getTransform());else if(h){const{x:d,y:p,width:f,height:y}=h,b=this.prepareSharedCanvas(f,y,a);u(b,a,0,0,a,-d*a,-p*a),l={bitmap:b.transferToImageBitmap(),x:d,y:p,width:f,height:y}}else this.dirtyZIndex&&this.sortChildren($o.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(n),o&&o.layersSkipped++;const{globalAlpha:c}=r;if(r.globalAlpha=c*this.opacity,i)r.save(),r.resetTransform(),i.drawImage(r),r.restore();else if(l){const{bitmap:h,x:u,y:d,width:p,height:f}=l;r.drawImage(h,0,0,p*a,f*a,u,d,p,f)}r.globalAlpha=c,super.render(n)}skipRender(e){const{stats:i}=e;for(const s of this.children())s.markClean(),i&&(i.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,i.opsSkipped+=this.childNodeCounts.complexity)}applyClip(e,i){const{x:s,y:n,width:r,height:o}=i;e.beginPath(),e.rect(s,n,r,o),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&this.sortChildren($o.compareChildren),i.save(),i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Ft.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){n.markClean(),s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}i.save(),n.render(e),i.restore()}i.restore()}setClipRect(e){this.clipRect=e?Ft.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}_setLayerManager(e){this.layer&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),super._setLayerManager(e)}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&e.push(...n.defs))}return{elements:i,defs:e}}};wc.className="Group",g([j({convertor:t=>it(0,t,1)})],wc.prototype,"opacity",2);var Q=wc,cM=class extends Tc(Q){},hM=class extends Yn(Q){},ke=class extends ln(Q){},Zr=class extends Yn(ln(Q)){};function uM(t=0,e=0){return new OffscreenCanvas(t,e).getContext("2d")}var Ec=class{constructor(t=5){this.maxCacheSize=t,this.store=new Map}get(t){if(!this.store.has(t))return;const e=this.store.get(t);return this.store.delete(t),this.store.set(t,e),e}has(t){return this.store.has(t)}set(t,e){if(this.store.set(t,e),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return e}clear(){this.store.clear()}},os=class{static measureText(t,e){return this.getMeasurer(e).measureText(t)}static measureLines(t,e){return this.getMeasurer(e).measureLines(t)}static getMeasurer(t){const e=typeof t.font=="string"?t.font:Rt.toFontString(t.font),i=`${e}-${t.textAlign??"start"}-${t.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(e,t,i)}static createFontMeasurer(t,e,i){const s=uM();s.font=t,s.textAlign=e.textAlign??"start",s.textBaseline=e.textBaseline??"alphabetic";const n=new Op(s,e);return this.instanceMap.set(i,n),n}};os.instanceMap=new Ec(10);var Op=class{constructor(t,e){this.ctx=t,this.measureMap=new Ec(100),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline),t.font=typeof e.font=="string"?e.font:Rt.toFontString(e.font),this.textMeasurer=new Oc(i=>this.cachedCtxMeasureText(i),e.textBaseline??"alphabetic")}textWidth(t,e){return this.textMeasurer.textWidth(t,e)}measureText(t){return this.textMeasurer.measureText(t)}measureLines(t){return this.textMeasurer.measureLines(t)}cachedCtxMeasureText(t){if(!this.measureMap.has(t)){const e=this.ctx.measureText(t);this.measureMap.set(t,{actualBoundingBoxAscent:e.actualBoundingBoxAscent,emHeightAscent:e.emHeightAscent,emHeightDescent:e.emHeightDescent,actualBoundingBoxDescent:e.actualBoundingBoxDescent,actualBoundingBoxLeft:e.actualBoundingBoxLeft,actualBoundingBoxRight:e.actualBoundingBoxRight,alphabeticBaseline:e.alphabeticBaseline,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent,hangingBaseline:e.hangingBaseline,ideographicBaseline:e.ideographicBaseline,width:e.width})}return this.measureMap.get(t)}},Rt=class{static toFontString({fontSize:t=10,fontStyle:e,fontWeight:i,fontFamily:s,lineHeight:n}){let r="";return e&&(r+=`${e} `),i&&(r+=`${i} `),r+=`${t}px`,n&&(r+=`/${n}px`),r+=` ${s}`,r.trim()}static getLineHeight(t){return Math.ceil(t*this.defaultLineHeight)}static getVerticalModifier(t){switch(t){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};Rt.EllipsisChar="\u2026",Rt.defaultLineHeight=1.15,Rt.lineSplitter=/\r?\n/g;var Oc=class{constructor(t,e="alphabetic"){this.measureTextFn=t,this.textBaseline=e,this.charMap=new Map}getMetrics(t){const e=this.measureTextFn(t);return e.fontBoundingBoxAscent??(e.fontBoundingBoxAscent=e.emHeightAscent),e.fontBoundingBoxDescent??(e.fontBoundingBoxDescent=e.emHeightDescent),{width:e.width,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,lineHeight:e.fontBoundingBoxAscent+e.fontBoundingBoxDescent,offsetTop:e.actualBoundingBoxAscent,offsetLeft:e.actualBoundingBoxLeft}}getMultilineMetrics(t){let e=0,i=0,s=0,n=0,r=0;const o=Rt.getVerticalModifier(this.textBaseline),a=[];let l=0;const c=t.length;for(const h of t){const u=this.measureTextFn(h);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),e1?this.measureTextFn(t).width:this.charMap.get(t)??this.charWidth(t)}measureText(t){return this.getMetrics(t)}measureLines(t){const e=typeof t=="string"?t.split(Rt.lineSplitter):t;return this.getMultilineMetrics(e)}charWidth(t){const{width:e}=this.measureTextFn(t);return this.charMap.set(t,e),e}},Je=class Xl extends ci{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=Xl.defaultStyles.textAlign,this.textBaseline=Xl.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(` `).map(e=>e.trim())??[]}static computeBBox(e,i,s,n){const{offsetTop:r,offsetLeft:o,width:a,height:l}=os.measureLines(e,n);return new F(i-o,s-r,a,l)}computeBBox(){const{x:e,y:i,lines:s,textBaseline:n,textAlign:r}=this;return Xl.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:r})}isPointInPath(e,i){const s=this.getBBox();return s?s.containsPoint(e,i):!1}render(e){const{ctx:i,stats:s}=e;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(e);const{fill:n,stroke:r,strokeWidth:o}=this,{pixelRatio:a}=this.layerManager.canvas;if(i.font=Rt.toFontString(this),i.textAlign=this.textAlign,i.textBaseline=this.textBaseline,n){this.applyFill(i),i.globalAlpha*=this.opacity*this.fillOpacity;const{fillShadow:l}=this;l?.enabled&&(i.shadowColor=l.color,i.shadowOffsetX=l.xOffset*a,i.shadowOffsetY=l.yOffset*a,i.shadowBlur=l.blur*a),this.renderLines((c,h,u)=>i.fillText(c,h,u))}if(r&&o){this.applyStroke(i),i.lineWidth=o,i.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:l,lineDashOffset:c,lineCap:h,lineJoin:u}=this;l&&i.setLineDash(l),c&&(i.lineDashOffset=c),h&&(i.lineCap=h),u&&(i.lineJoin=u),this.renderLines((d,p,f)=>i.strokeText(d,p,f))}super.render(e)}renderLines(e){const{lines:i,x:s,y:n}=this,r=this.lineHeight??Rt.getLineHeight(this.fontSize);let o=(r-r*i.length)*Rt.getVerticalModifier(this.textBaseline);for(const a of i)e(a,s,n+o),o+=r}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}toSVG(){if(!this.visible||!this.text)return;const e=ri("text");return this.applySvgFillAttributes(e),e.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),e.setAttribute("font-size",String(this.fontSize)),e.setAttribute("font-style",this.fontStyle??""),e.setAttribute("font-weight",String(this.fontWeight??"")),e.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),e.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),e.setAttribute("x",String(this.x)),e.setAttribute("y",String(this.y)),e.textContent=this.text??"",{elements:[e]}}};Je.className="Text",Je.defaultStyles={...ci.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},g([j()],Je.prototype,"x",2),g([j()],Je.prototype,"y",2),g([j({changeCb:t=>t.onTextChange()})],Je.prototype,"text",2),g([j()],Je.prototype,"fontStyle",2),g([j()],Je.prototype,"fontWeight",2),g([j()],Je.prototype,"fontSize",2),g([j()],Je.prototype,"fontFamily",2),g([j()],Je.prototype,"textAlign",2),g([j()],Je.prototype,"textBaseline",2),g([j()],Je.prototype,"lineHeight",2);var re=Je,Rp=class extends Yn(re){},Wn=class extends Yn(ln(re)){},Rc="color: green",Pc="color: grey";function dM(){return Vd(()=>{})}function jc(t,e){const i=nn(e);if(i.length===0)return;const s=Ud(t);for(const n of i)n in s&&(e[n]=s[n])}var Pp=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},zc=class $e extends Pp{constructor(e,i,s){super(),this.defaultState=e,this.states=i,this.enterEach=s,this.debug=Dt.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,Rc)}transition(e,i){if(!this.transitionChild(e,i)||this.state===$e.child||this.state===$e.parent)return;const n=this.state,r=this.states[this.state];let o=r[e];const a=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(o))o=o.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${a} (guarded)`,h.target,Pc),u});else if(typeof o=="object"&&!(o instanceof $e)&&o.guard&&!o.guard(i)){this.debug(`${a} (guarded)`,o.target,Pc);return}if(!o){this.debug(`${a} ${this.state}`,Pc);return}const l=this.getDestinationState(o),c=l===this.state?void 0:r.onExit;this.debug(`${a} ${l}`,Rc),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof $e)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==$e.child&&l!==$e.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===$e.child&&this.childState?this.childState.is(e):this.state===e}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(e,i){return this.state!==$e.child||!this.childState||(jc(this,this.childState),this.childState.transition(e,i),!this.childState.is($e.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,Rc),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(e){let i=this.state;return typeof e=="string"?i=e:e instanceof $e?(this.childState=e,this.childState.parent=this,i=$e.child):typeof e=="object"&&(e.target instanceof $e?(this.childState=e.target,this.childState.parent=this,i=$e.child):e.target!=null&&(i=e.target)),i}};zc.child="__child",zc.parent="__parent";var Xr=zc,pM=class extends Pp{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)jc(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)jc(this,i),i.transitionAsync(t,e)}};function wt(t,e){const i=Ct(t)?t:t.split(".");if(i.length===1){const[s]=i;return Ji((n,r,o)=>n[s]=o,n=>n[s],e)}return Ji((s,n,r)=>pc(s,i,r),s=>uc(s,i),e)}function gM(t){return Ji((e,i,s)=>e[t]=s)}function pe(t,e){return Ji((i,s,n)=>i[t][e??s]=n)}function Ve(t){const{newValue:e,oldValue:i,changeValue:s}=t;return Ji((n,r,o,a)=>(o!==a&&(a!==void 0&&i?.call(n,a),o!==void 0&&e?.call(n,o),s?.call(n,o,a)),o))}function Os(t){return Vd(t)}var Fc=class{static wrapText(t,e){return this.wrapLines(t,e).join(` `)}static wrapLines(t,e){const i=this.textWrap(t,e);return e.overflow==="hide"&&i.some(s=>s.endsWith(Rt.EllipsisChar))?[]:i}static appendEllipsis(t){return t.replace(/[.,]{1,5}$/,"")+Rt.EllipsisChar}static truncateLine(t,e,i,s){const n=e.textWidth(Rt.EllipsisChar);let r=0,o=0;for(;oi)break;r+=a}if(t.length===o&&(!s||r+n<=i))return s?t+Rt.EllipsisChar:t;for(t=t.slice(0,o).trimEnd();t.length&&e.textWidth(t)+n>i;)t=t.slice(0,-1).trimEnd();return t+Rt.EllipsisChar}static textWrap(t,e){const i=t.split(Rt.lineSplitter),s=os.getMeasurer(e);if(e.textWrap==="never")return i.map(a=>this.truncateLine(a.trimEnd(),s,e.maxWidth));const n=[],r=e.textWrap==="hyphenate",o=e.textWrap==null||e.textWrap==="on-space";for(const a of i){let l=a.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,u=0;for(;ce.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=e.maxWidth){h=p,c++;continue}if(u){const b=this.getWordAt(l,u+1),m=s.textWidth(b);if(m<=e.maxWidth){n.push(l.slice(0,u).trimEnd()),l=l.slice(u).trimStart(),c=0,h=0,u=0;continue}else o&&m>e.maxWidth&&n.push(l.slice(0,u).trimEnd(),this.truncateLine(l.slice(u).trimStart(),s,e.maxWidth,!0))}else o&&n.push(this.truncateLine(l,s,e.maxWidth,!0));if(o){l="";break}const f=r?"-":"";let y=l.slice(0,c).trim();for(;y.length&&s.textWidth(y+f)>e.maxWidth;)y=y.slice(0,-1).trimEnd();if(n.push(y+f),!y.length){l="";break}l=l.slice(y.length).trimStart(),c=-1,h=0,u=0}c++}l&&n.push(l)}return this.avoidOrphans(n,s,e),this.clipLines(n,s,e)}static getWordAt(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}static clipLines(t,e,i){if(!i.maxHeight)return t;const{height:s,lineMetrics:n}=e.measureLines(t);if(s<=i.maxHeight)return t;for(let r=0,o=0;ri.maxHeight){if(i.overflow==="hide")return[];const l=t.slice(0,r||1),c=l.pop();return l.concat(this.truncateLine(c,e,i.maxWidth,!0))}}return t}static avoidOrphans(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:s}=t,n=t[s-1],r=t[s-2];if(r.lengththis.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n}=this,r=Math.min(this.maxWidth??1/0,t)-s*2,o=this.maxHeight??e-s*2;if(!isFinite(r)&&!isFinite(o)){this.node.text=i;return}const a=Fc.wrapText(i??"",{maxWidth:r,maxHeight:o,font:this,textWrap:n});this.node.text=a,this.truncated=a.includes(Rt.EllipsisChar)}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(this.enabled&&this.text){const s=Ft.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:e})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(t,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(t,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=Ft.toCanvas(this.node),n=e.sourceEvent.offsetX+i,r=e.sourceEvent.offsetY+s,o={type:"pointermove",canvasX:n,canvasY:r};t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:r,lastPointerEvent:o,showArrow:!1},{type:"structured",title:this.text})}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};At.SMALL_PADDING=10,At.LARGE_PADDING=20,g([x(H),pe("node","visible")],At.prototype,"enabled",2),g([x(T,{optional:!0}),pe("node")],At.prototype,"text",2),g([x(dp,{optional:!0}),pe("node")],At.prototype,"textAlign",2),g([x(ss,{optional:!0}),pe("node")],At.prototype,"fontStyle",2),g([x(ns,{optional:!0}),pe("node")],At.prototype,"fontWeight",2),g([x(R),pe("node")],At.prototype,"fontSize",2),g([x(T),pe("node")],At.prototype,"fontFamily",2),g([x(gt,{optional:!0}),pe("node","fill")],At.prototype,"color",2),g([x(R,{optional:!0})],At.prototype,"spacing",2),g([x(R,{optional:!0})],At.prototype,"maxWidth",2),g([x(R,{optional:!0})],At.prototype,"maxHeight",2),g([x(Aa)],At.prototype,"wrapping",2),g([x(R)],At.prototype,"padding",2),g([x(T)],At.prototype,"layoutStyle",2);var Bc=(t=>(t.X="x",t.Y="y",t))(Bc||{}),_c=class{constructor(){this.moduleMap=new Map}*modules(){for(const t of this.moduleMap.values())yield t.moduleInstance}addModule(t,e){if(this.moduleMap.has(t.optionsKey))throw new Error(`AG Charts - module already initialised: ${t.optionsKey}`);this.moduleMap.set(t.optionsKey,{module:t,moduleInstance:e(t)})}removeModule(t){const e=Ge(t)?t:t.optionsKey;this.moduleMap.get(e)?.moduleInstance.destroy(),this.moduleMap.delete(e)}getModule(t){return this.moduleMap.get(Ge(t)?t:t.optionsKey)?.moduleInstance}isEnabled(t){return this.moduleMap.has(Ge(t)?t:t.optionsKey)}mapModules(t){return Array.from(this.moduleMap.values(),(e,i)=>t(e.moduleInstance,i))}destroy(){for(const t of this.moduleMap.keys())this.moduleMap.get(t)?.moduleInstance.destroy();this.moduleMap.clear()}};function jp(t,e){return t.valueOf()-e.valueOf()}function fM(t){let e=NaN;const i=[];for(const s of t){const n=s.valueOf();e!==n&&i.push(s),e=n}return i}function Gc(t){const e=t.slice().sort(jp);return Vc(e)==null?fM(e):e}function Vc(t){if(t.length===0)return 1;const e=Number(t[t.length-1])>Number(t[0])?1:-1;let i=-1/0*e;for(const s of t){const n=s.valueOf();if(Math.sign(n-i)!==e)return;i=n}return e}function zp(t){let e,i;const s=yM.exec(t);s&&([,e,t,i]=s);const n=mM.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,r,o,a,l,c,h,u,d,p,f]=n;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:!!p,type:f,prefix:e,suffix:i}}function Fp(t){const e=typeof t=="string"?zp(t):t,{fill:i,align:s,sign:n="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=e;let{trim:p}=e;const f=d==null||isNaN(d);let y;if(!c)y=hi.g,p=!0;else if(c in hi&&c in Hn)y=f?Hn[c]:hi[c];else if(c in hi)y=hi[c];else if(c in Hn)y=Hn[c];else throw new Error(`The number formatter type is invalid: ${c}`);let b;return d==null||f?b=c?6:12:b=d,m=>{let M=y(m,b);return p&&(M=MM(M)),l&&(M=vM(M,l)),M=IM(m,M,n),r&&r!=="#"&&(M=`${r}${M}`),r==="#"&&c==="x"&&(M=`0x${M}`),c==="s"&&(M=`${M}${SM(m)}`),(c==="%"||c==="p")&&(M=`${M}%`),a!=null&&!isNaN(a)&&(M=DM(M,a,i??o,s)),M=`${h}${M}${u}`,M}}var mM=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,yM=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/,Hn={b:t=>Ta(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>Ta(t).toString(8),x:t=>Ta(t).toString(16),X:t=>Hn.x(t).toUpperCase(),n:t=>Hn.d(t),"%":t=>`${Ta(t*100).toFixed(0)}`},hi={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>hi.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>hi.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&shi.g(t,e).toUpperCase(),n:(t,e)=>hi.g(t,e),p:(t,e)=>hi.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i))-(e-1);if(n<=0)return i.toFixed(-n);const r=10**n;return(Math.round(i/r)*r).toFixed()},s:(t,e)=>{const i=Gp(t);return hi.r(t/10**i,e)},"%":(t,e)=>hi.f(t*100,e)},Bp=-24,_p=24,xM={[Bp]:"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",[_p]:"Y"},bM="\u2212";function Ta(t){return Math.floor(Math.abs(t))}function MM(t){return t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function vM(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let r=s.length-3;r>0;r-=3)s.splice(r,0,e);return`${s.join("")}${n}`}function SM(t){return xM[Gp(t)]}function Gp(t){return it(Bp,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,_p)}function IM(t,e,i=""){if(i==="(")return t>=0?e:`(${e})`;const s=i==="+"?"+":"";return`${t>=0?s:bM}${e}`}function DM(t,e,i=" ",s=">"){let n=t;if(s===">"||!s)n=n.padStart(e,i);else if(s==="<")n=n.padEnd(e,i);else if(s==="^"){const r=Math.max(0,e-n.length),o=Math.ceil(r/2),a=Math.floor(r/2);n=n.padStart(o+n.length,i),n=n.padEnd(a+n.length,i)}return n}var Bt=(t,e,i)=>({duration:e*i,timeInterval:t,step:i}),Qr=[Bt(Bn,Ns,1),Bt(Bn,Ns,5),Bt(Bn,Ns,15),Bt(Bn,Ns,30),Bt(_n,fe,1),Bt(_n,fe,5),Bt(_n,fe,15),Bt(_n,fe,30),Bt(Gn,Ce,1),Bt(Gn,Ce,3),Bt(Gn,Ce,6),Bt(Gn,Ce,12),Bt(xa,ai,1),Bt(xa,ai,2),Bt(zr,es,1),Bt(zr,es,2),Bt(zr,es,3),Bt(an,jr,1),Bt(an,jr,2),Bt(an,jr,3),Bt(an,jr,4),Bt(an,jr,6),Bt(ba,Fn,1)],Vp=[1,2,5,10];function Up(t,e){return Math.abs(Math.round(t)-t)=s&&u<=n;if(c&&!d)continue;const p=Math.abs(u-i);(l>p||c!==d)&&(c||(c=d),l=p,a=h)}return a*o}function Wp(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function Hp(t,e){const i=zp(e??",f");(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n))return 0;const[r,o]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+Wp(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const r=Math.floor(Math.log10(Math.abs(n))),o=i.type?6:12,a=n.toExponential(o-1).split(/[.e]/g)[1],l=Wp(a);return Math.max(0,l-r)}))));const s=Fp(i);return n=>s(Number(n))}function Jr(t,e,i){if(!Number.isFinite(i)||i<=0)return[];const s=10**la(i),n=Math.min(t,e),r=Math.max(t,e),o=[];for(let a=0;;a+=1){const l=Math.round((n+i*a)*s)/s;if(l>r)break;o.push(l)}return o}function to(t,e){return t>=e?(k.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function AM(t,e){const i=Math.abs(e-t),s=10**Math.floor(Math.log10(i));let n=1/0,r=[t,e];for(const o of Vp){const a=o*s,l=Math.floor(t/a)*a,c=Math.ceil(e/a)*a,h=1-i/Math.abs(c-l);n>h&&(n=h,r=[l,c])}return r}function Kp(t,e,i,s,n,r){r=Math.max(r,t/(n+1)),isNaN(i)&&(i=r),isNaN(s)&&(s=t),i>s&&(i===r?i=s:s=i);const o=Math.max(1,Math.floor(t/(e*i))),a=Math.min(o,Math.ceil(t/(e*s))),l=it(a,Math.floor(n/e),o);return{minTickCount:a,maxTickCount:o,tickCount:l}}var $p=class extends yt{constructor(){super([],[0,1]),this.type="time"}toDomain(t){return new Date(t)}convert(t,e){return t instanceof Date||(t=new Date(t)),super.convert(t,e)}invert(t){return new Date(super.invert(t))}niceDomain(t,e=this.domain){if(e.length<2)return[];const i=4;let[s,n]=e;for(let r=0;rr%h.duration===0);if(o)return o.timeInterval.every(r/(o.duration/o.step)).range(new Date(t),new Date(e),{visibleRange:n});let a=new Date(Math.min(t,e));const l=new Date(Math.max(t,e)),c=[];for(;a<=l;)c.push(a),a=new Date(a),a.setMilliseconds(a.getMilliseconds()+r);return c}function LM(t,e,i){const{interval:s}=i,n=Math.min(Me(t),Me(e)),r=Math.max(Me(t),Me(e)),o=t>e;let a;if(s instanceof zn)a=s;else{const l=typeof s=="number"?(r-n)/Math.max(s,1):i.tickCount??yt.defaultTickCount;a=Yp(n,r,l,i.minTickCount,i.maxTickCount)}if(a){const l=a.range(new Date(n),new Date(r),{extend:!0}),c=o?[...l].reverse():l,h=c[0],u=c.at(-1);return[h,u]}else return[t,e]}var Bi=class Zy extends Br{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(e){return e instanceof Zy}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this.isReversed=e.length>0&&e[0]>e[e.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}toDomain(e){return new Date(e)}normalizeDomains(...e){const i=e.filter(n=>n.length>0).map(n=>{let r=Vc(n);return r==null&&(n=Gc(n.slice()),r=1),{domain:n,sortOrder:r}});if(i.length===0)return{domain:[],animatable:!1};if(i.length===1)return{domain:i[0].domain,animatable:!0};let s=i.flatMap(n=>n.domain);return s=Gc(s),i.every(n=>n.sortOrder===-1)&&s.reverse(),{domain:s,animatable:!0}}ticks({interval:e,maxTickCount:i},s=this.domain,n=[0,1]){if(!s.length)return[];this.refresh();const{isReversed:r}=this;if(e==null)return CM(s,i,r,n);const[o,a]=[s[0].valueOf(),s.at(-1).valueOf()],l=Math.min(o,a),c=Math.max(o,a),[h,u]=this.range,d=Math.abs(u-h),p=Yc({start:l,stop:c,interval:e,availableRange:d,visibleRange:n})??[];let f=-1;return p.filter(y=>{const b=this.findInterval(y.valueOf()),m=b===f;return f=b,!m})}getSortedTimestamps(){let{sortedTimestamps:e}=this;return e==null&&(e=this.domain.map(Me),this.isReversed&&e.reverse(),this.sortedTimestamps=e),e}getPrecomputedSteps(){const{domain:e}=this;let{precomputedSteps:i}=this;const s=e.length<1e4?e.length:Math.ceil(e.length/16);if(i!=null||s<=1)return i;const n=this.getSortedTimestamps();i=new Int32Array(s);const r=n[0],a=n[n.length-1]-r,l=0,c=n.length-1;for(let h=0;hthis.ordinalRange(r)>=e?s[r]:void 0)??s[0]}getIndex(e){const i=this.getSortedTimestamps(),s=Number(e);if(snew i:i}static select(e,i,s=!0){return new kn(e,i,s)}static selectAll(e,i){const s=[],n=r=>{i(r)&&s.push(r);for(const o of r.children())n(o)};return n(e),s}static selectByClass(e,...i){return kn.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return kn.selectAll(e,s=>s.tag===i)}createNode(e,i,s){const n=this.nodeFactory(e);return n.datum=e,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(e,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),s){const n=new Map(e.map((r,o)=>[s(r),[r,o]]));for(const[r,o]of this._nodesMap.entries())if(n.has(o)){const[a]=n.get(o);r.datum=a,this.garbageBin.delete(r),n.delete(o)}else this.garbageBin.add(r);for(const[r,[o,a]]of n.entries())this._nodesMap.set(this.createNode(o,i,a),r)}else{const n=Math.max(e.length,this.data.length);for(let r=0;r=e.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(e[r],i):(this._nodes[r].datum=e[r],this.garbageBin.delete(this._nodes[r]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(e=>this.garbageBin.has(e)?(this._nodesMap.delete(e),this.garbageBin.delete(e),e.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}each(e){for(const i of this._nodes.entries())e(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let e=0;e=0&&e<=Math.PI?-1:1,r=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return t.parallel?o=n*Math.PI/2:r===-1&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:n,regularFlipFlag:r}}function wM(t,e){return isNaN(t)?e?0:10:t}function EM(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}function qp(t,e,i,s,n){const r=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI,a=r||o?-1:1;if(t)if(e||i){if(s*a===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function OM(t,e,i,s){const n=[];for(const{tickLabel:r,translationY:o}of t){if(!r)continue;const{width:a,height:l}=s.measureLines(r),c=new F(e,o,a,l),h=new F(e,o,0,0);i.transformBBox(h,c);const{x:u,y:d}=c;n.push({point:{x:u,y:d},label:{text:r,width:a,height:l}})}return n}function RM(t){return t!=null&&Object.hasOwn(t,"toString")&&Ge(t.toString())}function PM(t){return t!=null&&Object.hasOwn(t,"valueOf")&&pt(t.valueOf())}function wa(t){return pt(t)||kr(t)||PM(t)}function Jp(t,e){return t!=null&&(!e||wa(t))}function Wc(t){return RM(t)&&Object.hasOwn(t,"id")?t.id:t}var Hc=t=>t==="value"?Mt((e,i)=>i.target.type==="line",e=>e.target.type==="range"?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):Mt((e,i)=>i.target.type==="range",e=>e.target.type==="line"?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),tg=(t,e,i,s,n)=>{const r=t==="line"&&e!==void 0,o=t==="range"&&i!==void 0;if(!r&&!o)return!0;const[a,l]=i??[e,void 0],c=yt.is(s)||Bi.is(s),h=Jp(a,c)&&!isNaN(s.convert(a)),u=Jp(l,c)&&!isNaN(s.convert(l));if(r&&h||o&&h&&u)return n?.()??!0;const d=["Expecting crossLine"];return o?(h||d.push(`range start ${Tr(a)}`),u||d.push(`${h?"":"and "}range end ${Tr(l)}`)):d.push(`value ${Tr(a)}`),d.push("to match the axis scale domain."),k.warnOnce(d.join(" ")),!1},jM={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}},zM={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 Kc({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?jM:zM,{xTranslationDirection:r,yTranslationDirection:o}=n[i],a=r*(e+s.width/2),l=o*(e+s.height/2);return{xTranslation:a,yTranslation:l}}function eg({yDirection:t,bbox:e,padding:i=0,position:s="top"}){const n={};return s.startsWith("inside")||(s==="top"&&!t?n.top=i+e.height:s==="bottom"&&!t?n.bottom=i+e.height:s==="left"&&t?n.left=i+e.width:s==="right"&&t&&(n.right=i+e.width)),n}var Ea=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},ig=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:e,y:isNaN(n)?s:(s+n)/2}:{x:i/2,y:s},sg=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:(i+s)/2}:{x:e/2,y:isNaN(s)?i:s},ng=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i/2,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:(s+n)/2},FM=({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2}),rg=({direction:t,xStart:e,xEnd:i,yStart:s})=>t==="y"?{x:e/2,y:s}:{x:i,y:s},og=({direction:t,xStart:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},ag=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},lg=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:n},cg={top:{c:Ea},bottom:{c:ng},left:{c:ig},right:{c:sg},"top-left":{c:rg},"top-right":{c:ag},"bottom-left":{c:og},"bottom-right":{c:lg},inside:{c:FM},"inside-left":{c:ig},"inside-right":{c:sg},"inside-top":{c:Ea},"inside-bottom":{c:ng},"inside-top-left":{c:rg},"inside-bottom-left":{c:og},"inside-top-right":{c:ag},"inside-bottom-right":{c:lg}},BM=It(["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"],"crossLine label position"),ui=class extends et{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};g([x(H,{optional:!0})],ui.prototype,"enabled",2),g([x(T,{optional:!0})],ui.prototype,"text",2),g([x(ss,{optional:!0})],ui.prototype,"fontStyle",2),g([x(ns,{optional:!0})],ui.prototype,"fontWeight",2),g([x(R)],ui.prototype,"fontSize",2),g([x(T)],ui.prototype,"fontFamily",2),g([x(ut)],ui.prototype,"padding",2),g([x(gt,{optional:!0})],ui.prototype,"color",2),g([x(BM,{optional:!0})],ui.prototype,"position",2),g([x(ut,{optional:!0})],ui.prototype,"rotation",2),g([x(H,{optional:!0})],ui.prototype,"parallel",2);var Ue=class extends et{constructor(){super(),this.id=oi(this),this.label=new ui,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.rangeGroup=new Q({name:this.id}),this.lineGroup=new Q({name:this.id}),this.labelGroup=new Q({name:this.id}),this.crossLineRange=new Di,this.crossLineLabel=new Wn,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}update(t){const{enabled:e,data:i,type:s,value:n,range:r,scale:o}=this;if(!s||!o||!e||!t||!tg(s,n,r,o)||i.length===0){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const{isRange:a}=this;a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(t,e){if(!t)return;const{scale:i,gridLength:s,sideFlag:n,direction:r,label:{position:o="top"},clippedRange:a,strokeWidth:l=0}=this;if(this.data=[],!i)return;const c=i.bandwidth??0,h=i.step??0,u=(e?-1:1)*(i instanceof Br?(h-c)/2:0),[d,p]=[0,n*s];let[f,y]=this.getRange();const b=y===void 0&&Bi.is(i)?c/2+u:0;let[m,M]=[Number(i.convert(f,!0))-u+b,i.convert(y,!0)+c+u];m=rc(m,a),M=rc(M,a),[f,y]=[Number(i.convert(f))+b,i.convert(y)+c];const S=(f===m||y===M||m!==M)&&Math.abs(M-m)>0;if(S&&m>M&&([m,M]=[M,m],[f,y]=[y,f]),f-u>=m&&(f-=u),y+u<=M&&(y+=u),this.isRange=S,this.startLine=l>0&&f>=m&&f<=m+u,this.endLine=l>0&&y>=M-c-u&&y<=M,!S&&!this.startLine&&!this.endLine||(this.data=[m,M],!this.label.enabled))return;const{c:v=Ea}=cg[o]??{},{x:I,y:L}=v({direction:r,xStart:d,xEnd:p,yStart:m,yEnd:M});this.labelPoint={x:I,y:L}}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}updateRangeNode(){const{crossLineRange:t,sideFlag:e,gridLength:i,data:s,startLine:n,endLine:r,isRange:o,fill:a,fillOpacity:l,stroke:c,strokeWidth:h,lineDash:u}=this;t.x1=0,t.x2=e*i,t.y1=s[0],t.y2=s[1],t.startLine=n,t.endLine=r,t.isRange=o,t.fill=a,t.fillOpacity=l??1,t.stroke=c,t.strokeWidth=h??1,t.strokeOpacity=this.strokeOpacity??1,t.lineDash=u}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fill=e.color,t.text=e.text)}positionLabel(){const{crossLineLabel:t,labelPoint:{x:e=void 0,y:i=void 0}={},label:{parallel:s,rotation:n,position:r="top",padding:o=0},direction:a,parallelFlipRotation:l,regularFlipRotation:c}=this;if(e===void 0||i===void 0)return;const{defaultRotation:h,configuredRotation:u}=ka({rotation:n,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});t.rotation=h+u,t.textBaseline="middle",t.textAlign="center";const d=t.getBBox();if(!d)return;const p=a==="y",{xTranslation:f,yTranslation:y}=Kc({yDirection:p,padding:o,position:r,bbox:d});t.translationX=e+f,t.translationY=i+y}getRange(){const{value:t,range:e,scale:i}=this,s=yt.is(i)||Bi.is(i),n=e?.[0]??t;let r=e?.[1];return!s&&r===void 0&&(r=n),s&&n===r&&(r=void 0),[n,r]}computeLabelBBox(){const{label:t}=this;if(!t.enabled)return;const e=new Wn;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text;const{labelPoint:{x:i=void 0,y:s=void 0}={},label:{parallel:n,rotation:r,position:o="top",padding:a=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(i===void 0||s===void 0)return;const{configuredRotation:u}=ka({rotation:r,parallel:n,regularFlipRotation:h,parallelFlipRotation:c});e.rotation=u,e.textBaseline="middle",e.textAlign="center";const d=e.getBBox();if(!d)return;const p=l==="y",{xTranslation:f,yTranslation:y}=Kc({yDirection:p,padding:a,position:o,bbox:d});return e.x=i+f,e.y=s+y,e.getBBox()}calculatePadding(t){const{isRange:e,startLine:i,endLine:s,direction:n,label:{padding:r=0,position:o="top"}}=this;if(!e&&!i&&!s)return;const a=this.computeLabelBBox();if(a?.x==null||a?.y==null)return;const l=eg({yDirection:n==="y",padding:r,position:o,bbox:a});t.left=Math.max(t.left??0,l.left??0),t.right=Math.max(t.right??0,l.right??0),t.top=Math.max(t.top??0,l.top??0),t.bottom=Math.max(t.bottom??0,l.bottom??0)}};Ue.className="CrossLine",g([x(H,{optional:!0})],Ue.prototype,"enabled",2),g([x(It(["range","line"],"a crossLine type"),{optional:!0})],Ue.prototype,"type",2),g([x(zi(Hc("range"),Vr.restrict({length:2})),{optional:!0})],Ue.prototype,"range",2),g([x(Hc("value"),{optional:!0})],Ue.prototype,"value",2),g([x(gt,{optional:!0})],Ue.prototype,"fill",2),g([x(xt,{optional:!0})],Ue.prototype,"fillOpacity",2),g([x(gt,{optional:!0})],Ue.prototype,"stroke",2),g([x(ut,{optional:!0})],Ue.prototype,"strokeWidth",2),g([x(xt,{optional:!0})],Ue.prototype,"strokeOpacity",2),g([x(Fi,{optional:!0})],Ue.prototype,"lineDash",2),g([x(P)],Ue.prototype,"label",2);var hg=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_GRID=1]="AXIS_GRID",t[t.AXIS=2]="AXIS",t[t.ZOOM_SELECTION=3]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=5]="SERIES_LAYER",t[t.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=10]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=12]="STATUS_BAR",t[t.SERIES_LABEL=13]="SERIES_LABEL",t[t.LEGEND=14]="LEGEND",t[t.NAVIGATOR=15]="NAVIGATOR",t[t.FOREGROUND=16]="FOREGROUND",t))(hg||{}),_M=["stroke","lineDash"],GM=is(t=>he(t)&&Object.keys(t).every(e=>_M.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),Oa=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};g([x(H)],Oa.prototype,"enabled",2),g([x(R)],Oa.prototype,"width",2),g([x(GM)],Oa.prototype,"style",2);function Rs(t,e=[void 0]){return Ji((i,s,n)=>e.includes(n)?en(t)?t(n):t:n)}var ug=Mt(t=>pt(t)&&t>0||t instanceof zn,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),cn=class extends et{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};g([x(ug,{optional:!0})],cn.prototype,"step",2),g([x(Vr,{optional:!0})],cn.prototype,"values",2),g([x(gp),Rs(NaN)],cn.prototype,"minSpacing",2),g([x(fp),Rs(NaN)],cn.prototype,"maxSpacing",2);var ae=class extends et{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.spacing=5,this.minSpacing=NaN,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}};g([x(H)],ae.prototype,"enabled",2),g([x(ss,{optional:!0})],ae.prototype,"fontStyle",2),g([x(ns,{optional:!0})],ae.prototype,"fontWeight",2),g([x(ut.restrict({min:1}))],ae.prototype,"fontSize",2),g([x(T)],ae.prototype,"fontFamily",2),g([x(R)],ae.prototype,"spacing",2),g([x(Un),Rs(NaN)],ae.prototype,"minSpacing",2),g([x(gt,{optional:!0})],ae.prototype,"color",2),g([x(ut,{optional:!0})],ae.prototype,"rotation",2),g([x(H)],ae.prototype,"avoidCollisions",2),g([x(H)],ae.prototype,"mirrored",2),g([x(H)],ae.prototype,"parallel",2),g([x(Ne,{optional:!0})],ae.prototype,"itemStyler",2),g([x(Ne,{optional:!0})],ae.prototype,"formatter",2),g([x(T,{optional:!0})],ae.prototype,"format",2);var Ra=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};g([x(H)],Ra.prototype,"enabled",2),g([x(R)],Ra.prototype,"width",2),g([x(gt,{optional:!0})],Ra.prototype,"stroke",2);var Kn=class extends et{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};g([x(H)],Kn.prototype,"enabled",2),g([x(R)],Kn.prototype,"width",2),g([x(R)],Kn.prototype,"size",2),g([x(gt,{optional:!0})],Kn.prototype,"stroke",2);var Ai=class extends et{constructor(){super(...arguments),this.caption=new At,this.enabled=!1,this.spacing=At.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};g([x(H)],Ai.prototype,"enabled",2),g([x(T,{optional:!0})],Ai.prototype,"text",2),g([x(R,{optional:!0})],Ai.prototype,"spacing",2),g([x(ss,{optional:!0})],Ai.prototype,"fontStyle",2),g([x(ns,{optional:!0})],Ai.prototype,"fontWeight",2),g([x(R)],Ai.prototype,"fontSize",2),g([x(T)],Ai.prototype,"fontFamily",2),g([x(gt,{optional:!0})],Ai.prototype,"color",2),g([x(Aa)],Ai.prototype,"wrapping",2),g([x(Ne,{optional:!0})],Ai.prototype,"formatter",2);var dg=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(dg||{});function Pa(t){const[e,i]=ue(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var $c=Math.PI*2,VM=$c/2;function UM(t,e){return Math.abs(e-t)e?e+$c:e-$c}function pg(t){const e=(o,a)=>{const[l=t.min,c=t.max]=ue(a??[]);return oc};return{tick:{fromFn(o,a,l){let c=o.y1+o.translationY,h=o.opacity;return(l==="added"||e(o.datum.translationY,o.datum.range))&&(c=a.translationY,h=0),{y:0,translationY:c,opacity:h,phase:Si[l]}},toFn(o,a,l){const c=a.translationY;let h=1;return l==="removed"&&(h=0),{y:0,translationY:c,opacity:h,finish:{y:c,translationY:0}}},applyFn(o,a){o.setProperties(a),o.visible=!e(o.y)}},line:{fromFn(o,a){return{...o.previousDatum??a,phase:Si.updated}},toFn(o,a){return{...a}}},label:{fromFn(o,a,l){const c=o.previousDatum??a,h=c.x,u=c.y,d=c.rotationCenterX;let p=Math.round(o.translationY),f=c.rotation,y=o.opacity;return l==="removed"||e(c.y,c.range)?f=a.rotation:(l==="added"||e(o.datum.y,o.datum.range))&&(p=Math.round(c.translationY),y=0,f=a.rotation),{x:h,y:u,rotationCenterX:d,translationY:p,rotation:f,opacity:y,phase:Si[l]}},toFn(o,a,l){const c=a.x,h=a.y,u=a.rotationCenterX,d=Math.round(a.translationY);let p=0,f=1;return l==="added"?p=a.rotation:l==="removed"?(f=0,p=a.rotation):p=UM(o.previousDatum?.rotation??a.rotation,a.rotation),{x:c,y:h,rotationCenterX:u,translationY:d,rotation:p,opacity:f,finish:{rotation:a.rotation}}}},group:{fromFn(o,a){const{rotation:l,translationX:c,translationY:h}=o;return{rotation:l,translationX:c,translationY:h,phase:Si.updated}},toFn(o,a){const{rotation:l,translationX:c,translationY:h}=a;return{rotation:l,translationX:c,translationY:h}}}}}function gg(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function Zc(t){const{visible:e,min:i,max:s}=t;return(n,r)=>{const o=r.translationY,a=e&&o>=i&&o<=s;return{y:o,translationY:0,opacity:1,visible:a}}}function Xc(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function fg(){return(t,e)=>({...e})}var ja=class extends ln(ti){},mg=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(mg||{}),ls=class Xy{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id=oi(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new cn,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Zr({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Q({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Q({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Q({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new Zr({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new Q({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Zr({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new Zr({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new Zr({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLineGroupSelection=Wt.select(this.tickLineGroup,ja,!1),this.tickLabelGroupSelection=Wt.select(this.tickLabelGroup,Wn,!1),this.gridLineGroupSelection=Wt.select(this.gridLineGroup,ja,!1),this._crossLines=[],this.line=new Ra,this.tick=new Kn,this.gridLine=new Oa,this.label=this.createLabel(),this.defaultTickMinSpacing=Xy.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new Ai,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._scaleNiceDomainInputDomain=void 0,this._scaleNiceDomainRangeExtent=NaN,this.moduleMap=new _c,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=e.map(s=>{const n=new i;return n.set(s),n}),this._crossLines.forEach(s=>{this.attachCrossLine(s),this.initCrossLine(s)})}get crossLines(){return this._crossLines}resetAnimation(e){}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineRangeGroup.removeChild(e.rangeGroup),this.crossLineLineGroup.removeChild(e.lineGroup),this.crossLineLabelGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}updateScale(){const{range:e,visibleRange:i,scale:s}=this,n=(e[1]-e[0])/(i[1]-i[0]),r=n*i[0],o=e[0]-r;s.range=[o,o+n],this.crossLines.forEach(a=>{a.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(e){e.gridNode.removeChild(this.gridGroup),e.axisNode.removeChild(this.axisGroup),e.labelNode.removeChild(this.labelGroup),e.crossLineRangeNode.removeChild(this.crossLineRangeGroup),e.crossLineLineNode.removeChild(this.crossLineLineGroup),e.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[s,n]=ue(this.range);return e>=s-i&&e<=n+i}defaultDatumFormatter(e,i){return as(e,i+1)}defaultLabelFormatter(e,i){return as(e,i)}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new ae}update(){this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateGridLines(),this.updateTickLines(),this.updateCrossLines()}getAxisLineCoordinates(){const[e,i]=ue(this.range);return{x:0,y1:e,y2:i}}getLabelStyles(e,i){const{label:s}=this,n={color:s.color,spacing:s.spacing,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let r;s.itemStyler&&(r=this.moduleCtx.callbackCache.call(s.itemStyler,{...e,...n}));const{color:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}=ot(r,i,n);return{fill:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}}getTickSize(){return this.tick.enabled?this.tick.size:0}setTitleProps(e,i){const{title:s}=this;if(!s.enabled){e.enabled=!1,e.node.visible=!1;return}e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping;const n=e.node,r=(s.spacing??0)+i.spacing,o=this.label.getSideFlag(),a=Tt(this.rotation),l=o===-1&&a>Math.PI&&am.defaultValue}=s,b=f.call(y,this.getTitleFormatterParams());e.text=b,n.setProperties({visible:!0,text:b,textBaseline:h,x:d,y:p,rotation:c})}processData(){const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,r=(e?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(s));this.setDomains(...r)}setDomains(...e){let i,s;e.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...e):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateLayout(e){const{scale:i,label:s,visibleRange:n,nice:r}=this;this.updateScale();const o=Rn(this.range),a=this.dataDomain.domain;let l;n[0]===0&&n[1]===1?l=void 0:r?this._scaleNiceDomainInputDomain===a&&this._scaleNiceDomainRangeExtent===o?l=this.scale.domain:l=this.calculateTickLayout(a,0,[0,1]).niceDomain:l=a;let c;r?l==null?c=0:c=1:c=2;const{niceDomain:h,primaryTickCount:u,ticks:d,tickDomain:p,fractionDigits:f,bbox:y}=this.calculateTickLayout(l??a,c,n,e);this.scale.domain=h,this._scaleNiceDomainInputDomain=r?a:void 0,this._scaleNiceDomainRangeExtent=r?o:NaN;const b=s.format;this.labelFormatter=i.tickFormatter({domain:p,specifier:b,ticks:d,fractionDigits:f})??(L=>this.defaultLabelFormatter(L,f)),this.datumFormatter=i.datumFormatter({domain:p,specifier:b,ticks:d,fractionDigits:f})??(L=>this.defaultDatumFormatter(L,f)),this.scaleFormatterParams={domain:p,ticks:d,fractionDigits:f},this.layout.label={fractionDigits:f,spacing:this.label.spacing,format:this.label.format};const m=s.getSideFlag(),M=this.isAnySeriesActive(),{rotation:S,parallelFlipRotation:v,regularFlipRotation:I}=this.calculateRotations();return this.crossLines.forEach(L=>{var A;L.sideFlag=-m,L.direction=S===-Math.PI/2?"x":"y",L instanceof Ue&&((A=L.label).parallel??(A.parallel=s.parallel)),L.parallelFlipRotation=v,L.regularFlipRotation=I,L.calculateLayout?.(M,this.reverse)}),{primaryTickCount:u,bbox:y}}getTransformBox(e){const i=new Ii,{rotation:s,translationX:n,translationY:r}=this.getAxisTransform();return Ii.updateTransformMatrix(i,1,1,s,n,r),i.transformBBox(e)}calculateRotations(){const e=Jt(this.rotation),i=Tt(e),s=Tt(e-Math.PI/2);return{rotation:e,parallelFlipRotation:i,regularFlipRotation:s}}updateCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.update(e)})}updateTickLines(){const{tick:e,label:i}=this,s=i.getSideFlag();this.tickLineGroupSelection.each((n,r)=>{n.strokeWidth=r.tickWidth??e.width,n.stroke=r.tickStroke??e.stroke,n.x1=s*(r.tickSize??this.getTickSize()),n.x2=0})}getAxisTransform(){return{rotation:Jt(this.rotation),translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:r}=this,{rotation:o}=this.calculateRotations(),a=Math.floor(r.x),l=Math.floor(r.y);e.setProperties({rotation:o,translationX:a,translationY:l}),i.setProperties({rotation:o,translationX:a,translationY:l}),s.setProperties({rotation:o,translationX:a,translationY:l}),n.setProperties({rotation:o,translationX:a,translationY:l})}updateGridLines(){const e=this.label.getSideFlag(),{gridLine:{style:i,width:s},gridPadding:n,gridLength:r}=this;r===0||i.length===0||this.gridLineGroupSelection.each((o,a,l)=>{const{stroke:c,lineDash:h}=i[l%i.length];o.setProperties({x1:n,x2:-e*r+n,stroke:c,strokeWidth:s,lineDash:h})})}formatTick(e,i,s,n){const{labelFormatter:r,label:{formatter:o},moduleCtx:{callbackCache:a}}=this;let l;return o?l=a.call(o,{value:e,index:i,fractionDigits:s}):n?l=n(e):r&&(l=r(e)),String(l??e)}formatDatum(e){const{label:{formatter:i},moduleCtx:{callbackCache:s},datumFormatter:n=this.labelFormatter}=this;let r;return i?r=s.call(i,{value:e,index:NaN}):n?r=s.call(n,e):Ct(e)&&(r=e.filter(Boolean).join(" - ")),String(r??e)}getScaleValueFormatter(e){const{scaleFormatterParams:i}=this;let s;try{e!=null&&i!=null&&(s=this.scale.tickFormatter({...i,specifier:e}))}catch{k.warnOnce(`the format string ${e} is invalid, ignoring.`)}return s??(s=n=>this.formatDatum(n)),s}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,i,s,n){this.tickLineGroup.setClipRect(new F(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new F(e,i,s,n))}getTitleFormatterParams(){const{direction:e}=this,i=[];for(const s of this.boundSeries){const n=s.getKeys(e),r=s.getNames(e);for(let o=0;oFt.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(r=>i.add(r)),i),new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleValueFormatter:i=>this.getScaleValueFormatter(i),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s)}}isReversed(){return this.reverse}};ls.defaultTickMinSpacing=50,ls.CrossLineConstructor=Ue,g([x(H)],ls.prototype,"nice",2),g([x(H)],ls.prototype,"reverse",2),g([x(up)],ls.prototype,"keys",2),g([x(P)],ls.prototype,"interval",2),g([x(P)],ls.prototype,"title",2),g([Os((t,e,i)=>t.onGridLengthChange(e,i))],ls.prototype,"gridLength",2);var Qc=ls;function YM(t,e,i,s,n,r){if(t.size===0)return!1;let o=t.x,a=t.y;e!=null&&(o-=(e.x-.5)*t.size,a-=(e.y-.5)*t.size);let l=o;oi+n&&(l=i+n);let c=a;as+r&&(c=s+r);const h=o-l,u=a-c;return Math.sqrt(h*h+u*u)<=t.size*.5}function yg(t,e,i,s,n){const r=t.x+t.width>e&&t.xi&&t.yt.x&&i>t.y&&i+n[a,l.toSorted((c,h)=>h.point.size-c.point.size)])),o=[...r.values()].flat();for(const[a,l]of r.entries()){const c=[];if(l[0]?.label){for(let h=0,u=l.length;h0&&d.placement!=null){const O=KM[d.placement];v=(m*.5+S+i)*O.x,I=(M*.5+S+i)*O.y}const L=p.x-m*.5+v-((y?.x??.5)-.5)*p.size,A=p.y-M*.5+I-((y?.y??.5)-.5)*p.size;if(!(!e||WM(e,L,A,m,M))||o.some(O=>YM(O.point,O.anchor,L,A,m,M))||n.some(O=>yg(O,L,A,m,M)))continue;const w={index:h,text:b,x:L,y:A,width:m,height:M,datum:d};c.push(w),n.push(w)}s.set(a,c)}}return s}function ZM(t,e=0){const i=[];for(let s=0;syg(h,r,o,l,c)))return!0;i.push({index:s,text:a,x:r,y:o,width:l,height:c,datum:n})}return!1}function XM(t,e,i){let[s,n]=ue(t);s=QM(Math.floor(s),n,e);const r=JM(s,n,e),o=e-1;n=s+o*r;const a=i?[n,s]:[s,n],l=qM(s,r,e);return{domain:a,ticks:l}}function QM(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return Math.floor(t/r)*r}function qM(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,r=Math.pow(10,n),o=[];for(let a=0;a0&&s<=1?i/10:s>1&&s<=2?2*i/10:s>1&&s<=5?5*i/10:s>5&&s<=10?10*i/10:s>10&&s<=20?20*i/10:s>20&&s<=40?40*i/10:s>40&&s<=50?50*i/10:s>50&&s<=100?100*i/10:s}function qc(){const t=new Map;return e=>{const i=t.get(e);return i?(t.set(e,i+1),`${e}_${i}`):(t.set(e,1),e)}}var xg=class{constructor(t){this.axis=t}estimateTickCount(t,e,i){return Kp(Rn(this.axis.range),Rn(t),e,i,yt.defaultTickCount,this.axis.defaultTickMinSpacing)}filterTicks(t,e){const{minSpacing:i,maxSpacing:s}=this.axis.interval,r=!isNaN(i)||!isNaN(s)?Math.ceil(t.length/e):2,o=t.length%r?-1:0;return t.filter((a,l)=>(l+o)%r===0)}generateTicks({domain:t,primaryTickCount:e,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:r,labelX:o,sideFlag:a}){const{scale:l,label:c,interval:{minSpacing:h,maxSpacing:u}}=this.axis,{parallel:d,rotation:p,fontFamily:f,fontSize:y,fontStyle:b,fontWeight:m}=c,M=e!==void 0,{defaultRotation:S,configuredRotation:v,parallelFlipFlag:I,regularFlipFlag:L}=ka({rotation:p,parallel:d,regularFlipRotation:r,parallelFlipRotation:n}),A=v+S,D=new Ii,{maxTickCount:C}=this.estimateTickCount(i,h,u),w=!(yt.is(l)||Bi.is(l))||isNaN(C)?10:C;let O=qp(d,v,0,a,L);const B=EM(d,v,a,I),rt=Rt.toFontString({fontFamily:f,fontSize:y,fontStyle:b,fontWeight:m}),Y=os.getMeasurer({font:rt}),X={fontFamily:f,fontSize:y,fontStyle:b,fontWeight:m,textBaseline:B,textAlign:O},J=c.enabled&&c.avoidCollisions,st=({ticks:nt},V)=>{if(!J)return!1;const W=v!==0||V!==0,E=A+V,_=wM(c.minSpacing,W);Ii.updateTransformMatrix(D,1,1,E,0,0);const U=OM(nt,o,D,Y);return ZM(U,_)};let K={tickDomain:[],ticks:[],rawTicks:[],fractionDigits:0,niceDomain:void 0},z=0,G=0,$=!0,Z=!1;for(;!Z&&$&&z<=w;){G=0;for(const nt of this.getTickStrategies({domain:t,niceMode:s,secondaryAxis:M,index:z}))({tickData:K,index:z,autoRotation:G,terminate:Z}=nt({index:z,tickData:K,textProps:X,terminate:Z,primaryTickCount:e,visibleRange:i,get labelOverlap(){return st(K,G)}}));$=st(K,G)}O=qp(d,v,G,a,L);const q=S+v+G;return!M&&K.rawTicks.length>0&&(e=K.rawTicks.length),{tickData:K,primaryTickCount:e,combinedRotation:q,textBaseline:B,textAlign:O}}getTickStrategies({domain:t,niceMode:e,index:i,secondaryAxis:s}){const{scale:n,label:r,interval:o}=this.axis,{minSpacing:a}=o,l=yt.is(n)||Bi.is(n),c=r.enabled&&r.avoidCollisions,h=!l&&i!==0&&c,u=r.autoRotate===!0&&r.rotation===void 0,d=[];let p;o.values?p=3:s?p=1:h?p=2:p=0;const f=({index:y,tickData:b,primaryTickCount:m,visibleRange:M,terminate:S})=>this.createTickData(t,e,M,m,p,y,b,S);if(d.push(f),!l&&!isNaN(a)){const y=({index:b,tickData:m,primaryTickCount:M,visibleRange:S,terminate:v})=>this.createTickData(t,e,S,M,2,b,m,v);d.push(y)}if(c&&u){const y=({index:b,tickData:m,labelOverlap:M,terminate:S})=>({index:b,tickData:m,autoRotation:M?Tt(Jt(r.autoRotateAngle??0)):0,terminate:S});d.push(y)}return d}createTickData(t,e,i,s,n,r,o,a){const{scale:l,interval:c}=this.axis,{step:h,values:u,minSpacing:d,maxSpacing:p}=c,{maxTickCount:f,minTickCount:y,tickCount:b}=this.estimateTickCount(i,d,p),m=yt.is(l)||Bi.is(l),M=!m||isNaN(f)?10:f,S=I=>m?Math.max(b-I,y):f,v=h==null&&u==null&&S(r)>y&&(m||n===2);for(;r<=M;){const I=o.rawTicks;if(o=this.getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:n,previousTicks:I,minTickCount:y,maxTickCount:f,primaryTickCount:s,tickCount:S(r)}),r++,!v||!Ri(o.rawTicks,I))break}return a||(a=h!=null||u!=null),{tickData:o,index:r,autoRotation:0,terminate:a}}getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:s,previousTicks:n,tickCount:r,minTickCount:o,maxTickCount:a,primaryTickCount:l}){const{axis:c}=this,{label:h,range:u,scale:d,interval:p}=c,f=qc(),y={nice:e===0,interval:p.step,tickCount:r,minTickCount:o,maxTickCount:a},b={...y,nice:e===0||e===1};let m=e===0?d.niceDomain(y,t):t,M=m,S;switch(s){case 3:if(M=p.values,S=p.values,yt.is(d)){const[N,w]=ue(m.map(Number));S=S.filter(O=>Number(O)>=N&&Number(O)<=w).sort((O,B)=>Number(O)-Number(B))}break;case 1:if(yt.is(d)){const N=XM(t.map(Number),l??0,c.reverse);S=N.ticks,m=N.domain.map(w=>d.toDomain(w))}else S=d.ticks(b,m,i)??[];break;case 2:S=this.filterTicks(n,r);break;default:S=d.ticks(b,m,i)??[]}const v=S.reduce((N,w)=>Math.max(N,typeof w=="number"?la(w):0),0),I={domain:M,ticks:S,fractionDigits:v,specifier:h.format},L=d.tickFormatter(I),A=d.domain;d.domain=m;const D=(d.bandwidth??0)/2,C=[];for(let N=0;N0&&!c.inRange(O,.001))continue;const B=h.enabled?c.formatTick(w,N,v,L):"";C.push({tick:w,tickId:f(B),tickLabel:B,translationY:Math.floor(O)})}return d.domain=A,{tickDomain:M,rawTicks:S,fractionDigits:v,ticks:C,niceDomain:m}}},Jc=class extends ae{constructor(){super(...arguments),this.autoRotateAngle=335}};g([x(H,{optional:!0})],Jc.prototype,"autoRotate",2),g([x(ut)],Jc.prototype,"autoRotateAngle",2);var th=class Qy extends Qc{constructor(e,i){super(e,i),this.lineNode=this.axisGroup.appendChild(new ja({name:`${this.id}-Axis-line`,zIndex:1})),this.tempText=new Wn,this.tempCaption=new At,this.tickGenerator=new xg(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new Xr("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.axisGroup.appendChild(this.title.caption.node);let s;this.destroyFns.push(e.layoutManager.addListener("layout:complete",n=>{const r=[n.chart.width,n.chart.height];s!=null&&!Ri(r,s)&&this.animationState.transition("resize"),s=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof Qy}resetAnimation(e){e==="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 Jc}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}calculateTickLayout(e,i,s,n){const r=this.label.getSideFlag(),{parallelFlipRotation:o,regularFlipRotation:a}=this.calculateRotations(),l=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),c=this.tickGenerator.generateTicks({domain:e,niceMode:i,visibleRange:s,primaryTickCount:n,parallelFlipRotation:o,regularFlipRotation:a,labelX:l,sideFlag:r}),{tickData:h,primaryTickCount:u=n}=c,{ticks:d,tickDomain:p,rawTicks:f,fractionDigits:y,niceDomain:b=e}=h,m=d.map(S=>this.getTickLabelProps(S,c)),M=this.tickBBox(d,m);return this.generatedTicks={ticks:d,labels:m},{ticks:f,tickDomain:p,niceDomain:b,primaryTickCount:u,fractionDigits:y,bbox:M}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),r=>r.datum.tickId);if(super.update(),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:r}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=r.map(l=>l.tickId),a=mx(e,o);this.animationState.transition("update",a)}}const{enabled:i,stroke:s,width:n}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:i?n:0}),this.updateTitle(!this.generatedTicks?.ticks.length)}updatePosition(){super.updatePosition(),this.axisGroup.datum=this.getAxisTransform()}tickBBox(e,i){const s=this.label.getSideFlag(),n=[],{x:r,y1:o,y2:a}=this.getAxisLineCoordinates(),l=new F(r+Math.min(s*this.seriesAreaPadding,0),o,this.seriesAreaPadding,a-o);if(n.push(l),this.tick.enabled)for(const u of e){const{x1:d,x2:p,y:f}=this.getTickLineCoordinates(u),y=new F(d,f,p-d,0);n.push(y)}const{tempText:c}=this;if(this.label.enabled)for(const u of i){if(!u.visible)continue;c.setProperties({...u,translationY:Math.round(u.translationY)});const d=c.getBBox();d&&n.push(d)}if(this.title?.enabled){const u=F.merge(n).width;this.setTitleProps(this.tempCaption,{spacing:u});const d=this.tempCaption.node.getBBox();d&&n.push(d)}const h=F.merge(n);return this.getTransformBox(h)}getTickLabelProps(e,i){const{combinedRotation:s,textBaseline:n,textAlign:r}=i,{range:o}=this.scale,a=e.tickLabel,c=this.label.getSideFlag()*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),h=a!==""&&a!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:s,rotationCenterX:c,translationY:e.translationY,text:a,textAlign:r,textBaseline:n,visible:h,x:c,y:0,range:o}}getTickLineCoordinates(e){const s=this.label.getSideFlag()*this.getTickSize(),n=Math.min(0,s),r=n+Math.abs(s),o=e.translationY;return{x1:n,x2:r,y:o}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{ticks:i,labels:s}=this.generatedTicks,n=r=>r.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?i:[],void 0,n),this.tickLineGroupSelection.update(i,void 0,n),this.tickLabelGroupSelection.update(s,void 0,n)}updateTitle(e,i){const{title:s,tickLineGroup:n,tickLabelGroup:r,lineNode:o}=this;s.enabled&&!e&&i==null&&(i=Q.computeChildrenBBox([n,r,o]).width+(r.visible?0:this.seriesAreaPadding)),i??(i=0),this.setTitleProps(s.caption,{spacing:i})}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.fill,e.fontFamily=i.fontFamily,e.fontSize=i.fontSize,e.fontStyle=i.fontStyle,e.fontWeight=i.fontWeight,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center"})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,s=Pa(this),n=pg(s);zt(this.id,"axis-group",i,[this.axisGroup],n.group),zt(this.id,"line",i,[this.lineNode],n.line),zt(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(r,o)=>o.tickId,e),zt(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(r,o)=>o.tickId,e)}resetSelectionNodes(){const e=Pa(this);de([this.axisGroup],gg()),de([this.gridLineGroupSelection,this.tickLineGroupSelection],Zc(e)),de([this.tickLabelGroupSelection],Xc()),de([this.lineNode],fg())}};g([x(R,{optional:!0})],th.prototype,"thickness",2),g([x(Sc)],th.prototype,"position",2);var so=th,$n=class qy extends so{constructor(e,i=new _r){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}static is(e){return e instanceof qy}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!pt(e)||!pt(i)){const s=this.reduceBandScalePadding();e??(e=s.inner),i??(i=s.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const s=i.getBandScalePadding?.();return s&&(e.inner>s.inner&&(e.inner=s.inner),e.outere.type===s.type&&("optionsKey"in e&&"optionsKey"in s?e.optionsKey===s.optionsKey:!0)&&e.identifier===s.identifier);if(i){if(e.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}else this.modules.push(e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}hasEnterpriseModules(){return this.modules.some(t=>t.packageType==="enterprise")}*byType(...t){const e=new Set,i=this.modules.filter(r=>t.includes(r.type)),s=r=>{const o=this.dependencies.get(r);return o?.flatMap(s).concat(o)??[]},n=[];for(const r of i){const o="optionsKey"in r?r.optionsKey:r.contextKey;if(!e.has(o)){for(const a of s(o)){if(e.has(a))continue;const l=this.modulesByOptionKey.get(a);if(!l){n.push(a);continue}t.includes(l.type)&&(yield l,e.add(a))}yield r,e.add(o)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(t){if(t.dependencies==null||t.dependencies.length===0)return;const e="optionsKey"in t?t.optionsKey:t.contextKey;this.dependencies.set(e,t.dependencies)}},_i=new e0,bg=class{constructor(){this.queue=[]}await(t=50){return new Promise(e=>{const i=()=>{clearTimeout(n),e(!0)},n=setTimeout(()=>{const r=this.queue.indexOf(i);r<0||(this.queue.splice(r,1),e(!1))},t);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(t=>t())}};function i0(){return new Promise(t=>{setTimeout(t,0)})}function Fa(t,e){t&&(e=sa.normalize(e),e.width==null?t.style.removeProperty("width"):t.style.width=`${e.width}px`,e.height==null?t.style.removeProperty("height"):t.style.height=`${e.height}px`,e.x==null?t.style.removeProperty("left"):t.style.left=`${e.x}px`,e.y==null?t.style.removeProperty("top"):t.style.top=`${e.y}px`)}function Mg(t){const e=parseFloat(t.style.width)||t.offsetWidth,i=parseFloat(t.style.height)||t.offsetHeight,s=parseFloat(t.style.left)||t.offsetLeft,n=parseFloat(t.style.top)||t.offsetTop;return{x:s,y:n,width:e,height:i}}function s0(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const e=qi().createRange();e.setStart(t.lastChild,t.lastChild.textContent.length),e.setEnd(t.lastChild,t.lastChild.textContent.length);const i=Nt().getSelection();i?.removeAllRanges(),i?.addRange(e)}var n0=0;function r0(t){return`${t??"ag-charts-element"}-${n0++}`}function vg(){const t=Nt("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function Ba(t){return`ag-charts-icon ag-charts-icon-${t}`}var eh="class-instance";function cs(t,e,i){if(Ct(e)){if(!Ct(t)||t.length!==e.length||e.some((s,n)=>cs(t[n],s)!=null))return e}else if(xe(e)){if(!xe(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const r of n)if(!(t[r]===e[r]||i?.includes(r)))if(typeof t[r]==typeof e[r]){const o=cs(t[r],e[r]);o!==null&&(s[r]=o)}else s[r]=e[r];return Object.keys(s).length?s:null}else if(t!==e)return e;return null}function Sg(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function te(t,e){return Ct(t)?t.map(i=>te(i,e)):xe(t)?o0(t,e):t instanceof Map?new Map(te(Array.from(t))):ih(t)}function o0(t,e){const i={};for(const s of Object.keys(t))i[s]=e?.has(s)?ih(t[s]):te(t[s],e);return i}function ih(t){return Ct(t)?t.slice(0):xe(t)?{...t}:On(t)?new Date(t):Mx(t)?new RegExp(t.source,t.flags):t}function hs(t,e,i,s,n,r){if(Ct(t)){r=e(t,s,n,r);let o=0;for(const a of t)r=hs(a,e,i,s?.[o],n,r),o++}else if(xe(t)){r=e(t,s,n,r);for(const o of Object.keys(t)){if(i?.has(o))continue;const a=t[o];r=hs(a,e,i,s?.[o],n,r)}}return r}function no(t,e,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:r=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${s??""}`);if(e==null)return t;if(ji(t))return t.set(e);const o=t,a=sh(t);for(const l of Object.keys(e)){if(dc.has(l))continue;const c=`${n?n+".":""}${l}`;if(r.includes(c))continue;const h=e[l],u=`${s?s+".":""}${l}`,d=o.constructor,p=o[l];try{const f=sh(p),y=sh(h);if(a===eh&&!(l in t)){if(h===void 0)continue;k.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(f!=null&&y!=null&&y!==f&&(f!==eh||y!=="object")){k.warn(`unable to set [${u}] in ${d?.name} - can't apply type of [${y}], allowed types are: [${f}]`);continue}if(ji(p))o[l].set(h);else if(y==="object"){if(p==null){k.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}no(p,h,{...i,path:u,matcherPath:c})}else o[l]=h}catch(f){k.warn(`unable to set [${u}] in [${d?.name}]; nested error is: ${f.message}`)}}return t}function sh(t){return t==null?null:vx(t)||On(t)?"primitive":Ct(t)?"array":he(t)?xe(t)?"object":eh:en(t)?"function":"primitive"}function Ig(t,e,i){return nh(t,e,t,i)}function nh(t,e,i,s,n=[],r={}){if(Ct(t)){Dg(t,e,i,n,r);let o=0;for(const a of t)nh(a,e,i,s,[...n,`${o}`],r),o++}else if(xe(t)){Dg(t,e,i,n,r);for(const o of Object.keys(t)){if(s?.has(o))continue;const a=t[o];nh(a,e,i,s,[...n,o],r)}}return r}function Dg(t,e,i,s,n){if(Ct(t))for(let r=0;r(t.Ref="$ref",t.Path="$path",t.If="$if",t.Eq="$eq",t.Not="$not",t.Or="$or",t.And="$and",t.Mul="$mul",t.Round="$round",t.Rem="$rem",t.Mix="$mix",t.ForegroundBackgroundMix="$foregroundBackgroundMix",t.ForegroundBackgroundAccentMix="$foregroundBackgroundAccentMix",t))(Lg||{}),a0=new Set(Object.values(Lg));function rh(t){if(!xe(t))return{};const[e,...i]=Object.keys(t);return i.length!==0||!a0.has(e)?{}:{operation:e,values:t[e]}}function Cg(t,e,i,s,n,r){return Ct(e)&&(e=e.map(o=>{const{operation:a,values:l}=rh(o);return a?Cg(a,l,i,s,n,r):o})),Ng[t](e,i,s,n,r)}function _a(t){return ni(t)&&t>=0&&t<=1}var Ng={$ref:(t,e,i,s,n)=>{if(Ge(t)&&t in e){const{operation:r,values:o}=rh(e[t]);if(r!=="$ref")return e[t];if(n?.has(o)){k.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${s.join(".")}], circular reference detected with [${[...n].join(", ")}].`);return}return n?.add(o),Ng.$ref(o,e,i,s,n)}k.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${s.join(".")}], expecting one of [${Object.keys(e).join(", ")}].`)},$path:(t,e,i,s)=>{if(!Ge(t)){k.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${s.join(".")}], expecting a string.`);return}const n=t.split("/"),r=[...s];for(const a of n)a===".."?(r.pop(),r.pop()):a==="."?r.pop():r.push(a);let o=i;for(const a of r){if(!(a in o)){k.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${s.join(".")}], could not find path in object.`);return}o=o[a]}return o},$if:([t,e,i])=>t?e:i,$eq:([t,e])=>t===e,$not:([t,e])=>t!==e,$or:([t,e])=>t||e,$and:([t,e])=>t&&e,$mul:([t,e],i,s,n)=>{if(typeof t=="number"&&typeof e=="number")return t*e;k.warnOnce(`\`$mul\` json operation failed on [${String(t)}] and [${String(e)}] at [${n.join(".")}], expecting two numbers.`)},$round:([t],e,i,s)=>{if(typeof t=="number")return Math.round(t);k.warnOnce(`\`$round\` json operation failed on [${String(t)}] at [${s.join(".")}], expecting a number.`)},$rem:([t],e)=>{if(typeof t=="number")return Math.round(t*e.fontSize)},$mix:([t,e,i],s,n,r)=>{if(typeof t=="string"&&typeof e=="string"&&_a(i))try{return jt.mix(jt.fromString(t),jt.fromString(e),i).toString()}catch{}k.warnOnce(`\`$mix\` json operation failed on [${String(t)}, ${String(e)}, ${String(i)}] at [${r.join(".")}], expecting two colors and a number between 0 and 1.`)},$foregroundBackgroundMix:([t],e,i,s)=>{if(_a(t))return jt.mix(jt.fromString(e.foregroundColor),jt.fromString(e.backgroundColor),t).toString();k.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(t)}}}] at [${s.join(".")}], expecting a number between 0 and 1.`)},$foregroundBackgroundAccentMix:([t,e],i,s,n)=>{if(_a(t)&&_a(e))return jt.mix(jt.mix(jt.fromString(i.foregroundColor),jt.fromString(i.backgroundColor),t),jt.fromString(i.accentColor),e).toString();k.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(t)}, ${String(e)}}] at [${n.join(".")}], expecting two numbers between 0 and 1.`)}},l0=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(i=>k.errorOnce(i))})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(i){k.error("mutex callback error",i),e?.()}[t,e]=this.acquireQueue.shift()??[]}this.available=!0}},Tg=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){this.eventListeners.get(t)?.delete(e),this.eventListeners.size===0&&this.eventListeners.delete(t)}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){this.eventListeners.get(t.type)?.forEach(e=>e(t))}},Ps=class extends et{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}};g([x(R)],Ps.prototype,"top",2),g([x(R)],Ps.prototype,"right",2),g([x(R)],Ps.prototype,"bottom",2),g([x(R)],Ps.prototype,"left",2);function c0(t){return kg((e,i)=>Nt().requestAnimationFrame(e),t)}function h0(t){return kg((e,i=0)=>{i===0?queueMicrotask(e):setTimeout(e,i)},t)}function kg(t,e){let i=0,s=!1,n,r;const o=()=>s,a=()=>{s=!1,r?.(),r=void 0,n=void 0,i>0&&t(l)},l=()=>{const c=i;i=0,s=!0;const h=e({count:c});if(!h){a();return}h.then(a,a)};return{schedule(c){i===0&&!o()&&t(l,c),i++},async await(){if(o())for(n==null&&(n=new Promise(c=>{r=c}));o();)await n}}}function hn(t){return t==="true"}function u0(t){return Number(t)}function Li(t){return t}var d0={role:Li,"aria-checked":hn,"aria-controls":Li,"aria-describedby":Li,"aria-disabled":hn,"aria-expanded":hn,"aria-haspopup":hn,"aria-hidden":hn,"aria-label":Li,"aria-labelledby":Li,"aria-live":Li,"aria-orientation":Li,"aria-selected":hn,"data-preventdefault":hn,class:Li,id:Li,tabindex:u0,title:Li,placeholder:Li};function St(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function un(t,e){if(e!=null)for(const[i,s]of Object.entries(e))i!=="class"&&St(t,i,s)}function Ga(t,e,i){if(!(t instanceof HTMLElement))return;const s=t.getAttribute(e);return s===null?i:d0[e]?.(s)??void 0}function Ci(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function p0(t,e){for(const[i,s]of Object.entries(e))Ci(t,i,s)}var oh=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function Xn(t,e,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o}=e,{currentX:a,currentY:l}=us.calcCurrentXY(i,e);return{type:t,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:e}}function Va(t,e,i){return{type:t,sourceEvent:e}}var g0={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>Xn("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>Xn("click",t,e),dblclick:(t,e)=>Xn("dblclick",t,e),mouseenter:(t,e)=>Xn("mouseenter",t,e),mousemove:(t,e)=>Xn("mousemove",t,e),mouseleave:(t,e)=>Xn("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,r=t.deltaMode===0?.01:1,o=t.deltaX*r,a=t.deltaY*r;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:o,deltaY:a,sourceEvent:t}},touchstart:(t,e)=>Va("touchstart",t,e),touchmove:(t,e)=>Va("touchmove",t,e),touchend:(t,e)=>Va("touchend",t,e),touchcancel:(t,e)=>Va("touchcancel",t,e)},us=class{static alloc(t,e,i){return g0[t](e,i)}static isHTMLEvent(t){return oh.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},f0=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const s=r=>{const o=us.alloc(t,r,e.getElement());for(const a of this.widgetListeners?.[t]??[])a(o,e)},n={};t.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(t,s),e.getElement().addEventListener(t,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const s=this.lazyGetWidgetListeners(t,e),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(t){for(const[e,i]of Object.entries(this.sourceListeners??{})){const s=e;t.getElement().removeEventListener(s,i)}this.widgetListeners=void 0,this.sourceListeners=void 0}},m0=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.window=Nt(),this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:r,mousemove:o,mouseup:a}=this;n.addEventListener("mousedown",r,{capture:!0}),n.addEventListener("mouseenter",r,{capture:!0}),n.addEventListener("mouseleave",r,{capture:!0}),n.addEventListener("mouseout",r,{capture:!0}),n.addEventListener("mouseover",r,{capture:!0}),n.addEventListener("mousemove",o,{capture:!0}),n.addEventListener("mouseup",a,{capture:!0}),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(s)}destroy(){const{window:t,mousegeneral:e,mousemove:i,mouseup:s}=this;t.removeEventListener("mousedown",e,{capture:!0}),t.removeEventListener("mouseenter",e,{capture:!0}),t.removeEventListener("mouseleave",e,{capture:!0}),t.removeEventListener("mouseout",e,{capture:!0}),t.removeEventListener("mouseover",e,{capture:!0}),t.removeEventListener("mousemove",i,{capture:!0}),t.removeEventListener("mouseup",s,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function y0(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new m0(t,e,i,s)}var x0=500,b0=100;function M0(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}var ah=!1,v0=class{constructor(t,e,i,s,n){this.glob=t,this.self=e,this.initialTouch=s,this.target=n,this.longTapInterrupted=!1,this.longtap=()=>{const{target:a,initialTouch:l}=this;if(!this.longTapInterrupted){a.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),ah=!0;const c=f=>{f.preventDefault()},h=f=>{ah=!1,f.preventDefault(),a.removeEventListener("touchmove",c),a.removeEventListener("touchend",h),a.removeEventListener("touchcancel",h)};a.addEventListener("touchmove",c,{passive:!1}),a.addEventListener("touchend",h,{passive:!1}),a.addEventListener("touchcancel",h,{passive:!1});const{clientX:u,clientY:d}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:Nt(),clientX:u,clientY:d,pointerType:"touch"});a.dispatchEvent(p)}},this.touchmove=a=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(a.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||M0(h,u)>b0,c.dragTouchEnabled&&u!=null&&l.globalTouchDragCallbacks?.touchmove(a,u))},this.touchend=a=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(a.changedTouches,a.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(a,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,x0);const{touchmove:r,touchend:o}=this;n.addEventListener("touchmove",r,{passive:!1}),n.addEventListener("touchstart",o,{passive:!1}),n.addEventListener("touchend",o,{passive:!1}),n.addEventListener("touchcancel",o,{passive:!1}),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:t,touchmove:e,touchend:i}=this;clearTimeout(t),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",e),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.map(i=>Array.from(i)).flat();return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function S0(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||ah))return new v0(t,e,i,s,n)}function lh(t,e,i,s){const{currentX:n,currentY:r}=us.calcCurrentXY(t.getElement(),s),o=s.pageX-i.pageX,a=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+a,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:r,originDeltaX:o,originDeltaY:a,sourceEvent:s}}function I0(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function ch(t,e,i,s,n){const{currentX:r,currentY:o}=us.calcCurrentXY(t.getElement(),n),a=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+a,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:r,currentY:o,originDeltaX:a,originDeltaY:l,sourceEvent:s}}var wg={},Eg=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.dragStartListeners=void 0,this.dragMoveListeners=void 0,this.dragEndListeners=void 0,this.mouseDragger?.destroy(),this.touchDragger?.destroy()}add(t,e,i){switch(t){case"drag-start":{this.dragStartListeners??(this.dragStartListeners=[]),this.dragStartListeners.push(i),this.registerDragTrigger(e);break}case"drag-move":{this.dragMoveListeners??(this.dragMoveListeners=[]),this.dragMoveListeners.push(i),this.registerDragTrigger(e);break}case"drag-end":{this.dragEndListeners??(this.dragEndListeners=[]),this.dragEndListeners.push(i),this.registerDragTrigger(e);break}}}remove(t,e,i){switch(t){case"drag-start":return this.removeHandler(this.dragStartListeners,i);case"drag-move":return this.removeHandler(this.dragMoveListeners,i);case"drag-end":return this.removeHandler(this.dragEndListeners,i)}}removeHandler(t,e){const i=t?.indexOf(e);i!==void 0&&t?.splice(i,1)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=s=>this.triggerMouseDrag(t,s),i=s=>this.triggerTouchDrag(t,s);t.getElement().addEventListener("mousedown",e),t.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{t.getElement().removeEventListener("mousedown",e),t.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(t,e){e.button===0&&this.startMouseDrag(t,e)}startMouseDrag(t,e){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};gc(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const r=lh(t,"drag-start",i,n);this.dispatch("drag-start",t,r)},mousemove:n=>{const r=lh(t,"drag-move",i,n);this.dispatch("drag-move",t,r)},mouseup:n=>{const r=lh(t,"drag-end",i,n);this.dispatch("drag-end",t,r),this.endDrag(t,r)}};this.mouseDragger=y0(wg,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),r=n.getBoundingClientRect();sa.containsPoint(r,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches.item(0);e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:NaN,pageY:NaN,...I0(t,i)};gc(["pageX","pageY"],s,i);const n={touchmove:(a,l)=>{const c=ch(t,"drag-move",s,a,l);this.dispatch("drag-move",t,c)},touchend:(a,l)=>{const c=ch(t,"drag-end",s,a,l);this.dispatch("drag-end",t,c)}},r=t.getElement();this.touchDragger=S0(wg,this,n,i,r);const o=ch(t,"drag-start",s,e,i);this.dispatch("drag-start",t,o)}dispatch(t,e,i){switch(t){case"drag-start":this.dragStartListeners?.forEach(s=>s(i,e));break;case"drag-move":this.dragMoveListeners?.forEach(s=>s(i,e));break;case"drag-end":this.dragEndListeners?.forEach(s=>s(i,e));break}this.dispatchCallback(t,i)}},D0=class{constructor(t){this.elem=t}setBounds(t){Fa(this.elemContainer??this.elem,t)}getBounds(){return Mg(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();Fa(e,i),p0(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Gi=class extends D0{constructor(t){super(t),this.elem=t,this.index=NaN,this.children=[]}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(t=>{t.parent=void 0,t.destroy()}),this.children.length=0,this.destructor(),this.elem.remove(),this.elemContainer?.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}setHidden(t){Ci(this.elem,"display",t?"none":void 0)}isHidden(){return Nt()?.getComputedStyle?.(this.elem).display==="none"}setCursor(t){Ci(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){St(this.elem,"aria-describedby",t)}setAriaHidden(t){St(this.elem,"aria-hidden",t)}setAriaLabel(t){St(this.elem,"aria-label",t)}setInnerHTML(t){this.elem.innerHTML=t}isDisabled(){return Ga(this.elem,"aria-disabled",!1)}parseFloat(t){return t===""?0:parseFloat(t)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(){this.elem.focus()}setPreventsDefault(t){St(this.elem,"data-preventdefault",t)}setTabIndex(t){St(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.findIndex(i=>i===t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){this.elem.removeChild(t.getElement())}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndexthis.removeListener(t,e)}removeListener(t,e){us.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Eg(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...e,...us.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=s=>{s.persisted||e()};return Nt().addEventListener("pagehide",i),()=>Nt().removeEventListener("pagehide",i)}},hh=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Navigator=4]="Navigator",t[t.Overlay=5]="Overlay",t))(hh||{}),Og=class{constructor(){this.events=new tc,this.elements=new Map}addListener(t,e){return this.events.on(t,e)}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i=new A0(t,e);for(const s of Object.values(hh))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(t,e){const i="layout:complete",{width:s,height:n}=t;this.events.emit(i,{type:i,axes:e.axes??[],chart:{width:s,height:n},clipSeries:e.clipSeries??!1,series:e.series})}},A0=class{constructor(t,e){this.width=t,this.height=e,this.layoutBox=new F(0,0,t,e)}},Ua=class{constructor(){this.title=new At,this.subtitle=new At,this.footnote=new At}positionCaptions(t){const{title:e,subtitle:i,footnote:s}=this,n=t.layoutBox.height/10;if(e.enabled){const{spacing:r=i.enabled?At.SMALL_PADDING:At.LARGE_PADDING}=e;this.positionCaption("top",e,t.layoutBox,n),this.shrinkLayoutByCaption("top",e,t.layoutBox,r)}i.enabled&&(this.positionCaption("top",i,t.layoutBox,n),this.shrinkLayoutByCaption("top",i,t.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,t.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,t.layoutBox,s.spacing))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:s}=this,{rect:n}=t.series;for(const r of[e,i,s])if(r.layoutStyle==="overlay"){if(r.textAlign==="left")r.node.x=n.x+r.padding;else if(r.textAlign==="right"){const o=r.node.getBBox();r.node.x=n.x+n.width-o.width-r.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){const n=Math.max(Rt.getLineHeight(e.fontSize),s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,n)}shrinkLayoutByCaption(t,e,i,s=0){if(e.layoutStyle==="block"){const n=e.node.getBBox();i.shrink(Math.ceil(t==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),t)}}};g([x(P)],Ua.prototype,"title",2),g([x(P)],Ua.prototype,"subtitle",2),g([x(P)],Ua.prototype,"footnote",2);var L0=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],C0=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t==null&&(t="candlestick"),t}guardMemento(t){return t==null||L0.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>k.error("error restoring state",n))}},Rg=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0}setFns(t){this.destroy(),this.destroyFns=t}push(...t){this.destroyFns.push(...t)}},Qn="11.1.1",Pg=Symbol("previous-memento-not-found"),N0=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=Dt.create(!0,"history"),this.destroyFns=new Rg,this.destroyFns.setFns([t.addListener("series-undo",this.undo.bind(this)),t.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){this.historyIndexthis.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of e){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===Pg)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):Pg}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(Qn,Qn,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},jg=class fd{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const s of Object.values(e))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(e,...i){if(typeof e!="object"){k.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`);return}if(e==null){k.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in e)||typeof e.version!="string"){k.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,e[s.mementoOriginatorKey]),r=[];if(!s.guardMemento(n,r)){const o=r.length>0?` ${r.join(` `)} `:"";k.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${o}`,n);return}s.restoreMemento(this.version,e.version,n)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,fd.encodeTypes))}catch(s){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),fd.decodeTypes)}catch(s){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(e,i){return On(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return he(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}},T0=class{constructor(){this.caretaker=new jg(Qn),this.state=new Map}setState(t,e){rn(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const s=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:s},t)}},k0=`.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-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>*{display:block;pointer-events:none}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{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-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--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-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--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-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--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-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: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px 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-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--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-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:1px solid var(--ag-charts-border-color);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:1px solid var(--ag-charts-input-border-color);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:1px solid var(--ag-charts-border-color);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-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-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;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;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-chrome-text-color);background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{padding:3px 6px}.ag-charts-tooltip--arrow:before{content:"";position:absolute;top:100%;left:50%;margin:0 auto;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(45deg);display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-top:none;border-left:none;clip-path:polygon(0% 100%,100% 0%,100% 100%)}.ag-charts-tooltip--arrow:after{--tooltip-inner-size: calc(var(--tooltip-arrow-size) - 2px);content:"";position:absolute;top:100%;left:50%;margin:0 auto;transform:translate(-50%) translateY(calc(var(--tooltip-inner-size) * -.5)) rotate(45deg);display:block;width:var(--tooltip-inner-size);height:var(--tooltip-inner-size);border:inherit;border-color:transparent;background:inherit;clip-path:polygon(-10% 100%,100% -10%,100% 100%)}.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:8px}.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;align-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:16px;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-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-chrome-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-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-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-border);color:var(--ag-charts-chrome-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[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{margin:0 0 0 -1px}.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)}}.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);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} `,ds=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===t);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(s){k.errorOnce(String(s))}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},js=class{constructor(){this.listeners=new ds,this.destroyFns=[]}addListener(t,e){return this.listeners.addListener(t,e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t())}},w0=class Ql{constructor(e,i,s){this.element=e,this.topTabGuard=i,this.bottomTabGuard=s,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,n=>this.onTab(n,!1)),this.initTabGuard(this.bottomTabGuard,n=>this.onTab(n,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const e of this.destroyFns)e();this.destroyFns.length=0}initTabGuard(e,i){const s=()=>i(e);e.addEventListener("focus",s),this.destroyFns.push(()=>e.removeEventListener("focus",s))}setGuardIndices(e){const i=e;St(this.topTabGuard,"tabindex",i),St(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let s;e.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(e,i){const s=Nt();return Array.from(e.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const r=s.getComputedStyle(n);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(e){const i=Ql.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=Ql.queryFocusable(qi(),"[tabindex]").filter(r=>r.tabIndex>0).sort((r,o)=>r.tabIndex-o.tabIndex),{before:s,after:n}=Ql.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,r,o;for(;s<=n;){const a=Math.floor((s+n)/2),l=e[a].tabIndex;if(l===i){r=e[a-1]||void 0,o=e[a+1]||void 0;break}else le.removeEventListener(i,s,n);return t.push(r),r}function zg(t,e,i){Ni(t,e,"keydown",s=>{s.key==="Escape"&&i(s)})}function E0(t,e,i){const s=Ni(t,window,"mousedown",n=>{[0,2].includes(n.button)&&!Fg(e,n)&&(i(),s())});return s}function O0(t,e,i){const s=Ni(t,window,"touchstart",n=>{Array.from(n.targetTouches).some(o=>!Fg(e,o))&&(i(),s())});return s}function Fg(t,e){if(e.target instanceof Element){const{x:i,y:s,width:n,height:r}=t.getBoundingClientRect(),{clientX:o,clientY:a}=e;return o>=i&&a>=s&&o<=i+n&&a<=s+r}return!1}function Ya(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function uh(t,e,...i){return Ya(t)&&(t.key===e||i.some(s=>t.key===s))}function Bg(t,e,i,s){i&&Ni(t,e,"keydown",n=>{uh(n,s)&&i.focus()})}function R0(t,e,i,s,n,r){Bg(t,e,n,r),Bg(t,e,i,s),Ni(t,e,"keydown",o=>{uh(o,s,r)&&o.preventDefault()})}var qn={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function _g(t){const{orientation:e,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:r,onBlur:o}=t,{nextKey:a,prevKey:l}=qn[e],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(f=>f.tabIndex=-1),p.target.tabIndex=0)},[h,u]=s?[i.length,i.length]:[0,1/0],d=[];for(let p=0;pthis.close(!0))),this.destroyFns.push(O0(this.destroyFns,t,()=>this.close(!0)))}close(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(t)}finishClosing(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,St(this.lastFocus,"aria-expanded",!1),t||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function Gg(t){const{sourceEvent:e,orientation:i,menu:s,buttons:n,closeCallback:r,overrideFocusVisible:o,autoCloseOnBlur:a=!1}=t,{nextKey:l,prevKey:c}=qn[i],h=ph(e);St(h,"aria-expanded",!0);const u=new P0(s,h,r),d=()=>u.close(),{destroyFns:p}=u;if(s.role="menu",s.ariaOrientation=i,p.push(..._g({orientation:i,buttons:n,onEscape:d,wrapAround:!0})),s.tabIndex=-1,zg(p,s,d),Ni(p,s,"keydown",f=>{f.target===s&&(f.key===l||f.key===c)&&(f.preventDefault(),n[0]?.focus())}),a){const f=y=>{!n.includes(y.relatedTarget)&&d()};for(const y of n)Ni(p,y,"blur",f)}return n[0]?.focus({preventScroll:!0}),o!==void 0&&(n.forEach(y=>y.setAttribute("data-focus-visible-override",o.toString())),Ni(p,s,"keydown",()=>{n.forEach(y=>y.setAttribute("data-focus-visible-override","true"))},{once:!0})),u}function j0(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function dh(t){return"button"in t?t.button===0:Ya(t)&&(t.code==="Space"||t.key==="Enter")}function ph(t){if(t?.target instanceof HTMLElement&&"tabindex"in t.target.attributes)return t.target}function Vg(t){const e=i=>{if(i.defaultPrevented)return;Ga(i.target,"data-preventdefault",!0)&&uh(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}var z0=class{constructor(t){this.callback=t,this.devicePixelRatio=Nt("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=Nt("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=Nt("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},F0=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,i])=>this.observe(e,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:i,contentRect:{width:s,height:n}}of e){const r=this.elements.get(i);this.checkSize(r,i,s,n)}}));let t;this.pixelRatioObserver=new z0(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=qi("readyState")==="complete",this.documentReady?this.observeWindow():Nt()?.addEventListener("load",this.onLoad)}destroy(){Nt()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,s){if(t&&(i!==t.size?.width||s!==t.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:s,pixelRatio:n},t.cb(t.size,e)}}observe(t,e){if(!this.documentReady){this.queuedObserveRequests.push([t,e]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const i={cb:e};this.elements.set(t,i)}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},Jn=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),typeof e<"u"&&super.set(t,e),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},B0='',_0=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area"],Ug={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},G0=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}]]);function V0(t,e){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===t&&e(n.intersectionRatio)},{root:t});return i.observe(t),i}var Yg={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return Yg}};function Wg(t,e){const i=lt("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var Hg=class extends js{constructor(t,e){super(),this.styles=new Map,this.container=void 0,this.containerSize=void 0,this.sizeMonitor=new F0,this.cursorState=new Jn("default"),this.minWidth=0,this.minHeight=0;const i=lt("div");i.innerHTML=B0,this.element=i.children.item(0),this.styleRootElement=e,this.rootElements=_0.reduce((a,l)=>{const c=`ag-charts-${l}`,h=this.element.classList.contains(c)?this.element:this.element.querySelector(`.${c}`);if(!h)throw new Error(`AG Charts - unable to find DOM element ${c}`);return a[l]={element:h,children:new Map,listeners:[]},a},{});let s=!1;this.observer=V0(this.element,a=>{a===0&&!s&&this.listeners.dispatch("hidden",{type:"hidden"}),s=a===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",k0),t&&this.setContainer(t),this.destroyFns.push(Vg(this.element));const n=this.element.querySelector(".ag-charts-canvas-center");if(n==null)throw new Error("Error initializing tab guards");const r=Wg(n,"beforebegin"),o=Wg(n,"afterend");this.tabGuards=new w0(n,r,o)}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),Object.values(this.rootElements).forEach(t=>{t.children.forEach(e=>e.remove()),t.element.remove()}),this.element.remove()}setSizeOptions(t=300,e=300,i,s){const{style:n}=this.element;n.width=`${i??t}px`,n.height=`${s??e}px`,this.minWidth=i??t,this.minHeight=s??e,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.tabIndex=t}setContainer(t){if(t===this.container)return;if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),!(this.getShadowDocumentRoot(t)!=null))for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}setThemeClass(t){const e="ag-charts-theme-";this.element.classList.forEach(i=>{i.startsWith(e)&&i!==t&&this.element.classList.remove(i)}),this.element.classList.add(t)}setThemeParameters(t){const e={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},i=["fontSize","chromeFontSize"];for(const[s,n]of Object.entries(t)){let r=`${n}`;i.includes(s)&&(r=`${n}px`),this.element.style.setProperty(`--ag-charts-${e[s]}`,r)}}updateCanvasLabel(t){St(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,e){return["focus","blur","keydown","keyup"].includes(e)?this.rootElements["series-area"].element:t}addEventListener(t,e,i){this.getEventElement(this.element,t).addEventListener(t,e,i)}removeEventListener(t,e,i){this.getEventElement(this.element,t).removeEventListener(t,e,i)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=Nt(),e=new F(0,0,t.innerWidth,t.innerHeight),i=this.getRawOverlayClientRect();return e.intersection(i)?.toDOMRect()??Yg}getRawOverlayClientRect(){let t=this.element;for(;t!=null;){const r=t.computedStyleMap?.()?.get("overflow-y")?.toString();if(r==="auto"||r==="scroll")return F.fromDOMRect(t.getBoundingClientRect());t=t.parentElement}const e=this.getShadowDocumentRoot();if(e!=null)return F.fromDOMRect(e.getBoundingClientRect());const{innerWidth:i,innerHeight:s}=Nt();return new F(0,0,i,s)}getShadowDocumentRoot(t=this.container){const e=t?.ownerDocument?.body??qi("body");for(;t!=null;){if(t===e)return;if(t.parentNode instanceof DocumentFragment)return t;t=t.parentNode}return this.container}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:e}=this.rootElements[t],i=[];for(const s of e.values())i.push(F.fromDOMRect(s.getBoundingClientRect()));return F.merge(i)}isManagedChildDOMElement(t,e,i){const{children:s}=this.rootElements[e],n=s?.get(i);return n!=null&&t.contains(n)}contains(t,e){return e==null?this.element.contains(t):this.rootElements[e].element.contains(t)}addStyles(t,e){const i="data-ag-charts";if(this.styles.set(t,e),this.container==null)return;const s=o=>o.getAttribute(i)===t,n=o=>{const a=new Set(["TITLE","META"]);let l=!0,c;for(const u of o.children){if(l&&a.has(u.tagName)){c=u;continue}if(l=!1,s(u))return;u.hasAttribute(i)&&(c=u)}const h=lt("style");return c!=null?o.insertBefore(h,c.nextSibling):o.prepend(h),h};let r;this.styleRootElement?r=n(this.styleRootElement):this.getShadowDocumentRoot(this.container)!=null?r=this.addChild("styles",t):r=n(qi("head")),!(r==null||s(r))&&(r.setAttribute(i,t),r.innerHTML=e)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,e){this.cursorState.set(t,e),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(t,e,i,s){const{element:n,children:r,listeners:o}=this.rootElements[t];if(!r)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(r.has(e))return r.get(e);const{childElementType:a="div"}=G0.get(t)??{};if(i&&i.tagName.toLowerCase()!==a.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const l=i??lt(a);for(const[c,h,u]of o)l.addEventListener(c,h,u);if(r.set(e,l),s){const c=n.querySelector(s.query);if(c==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);c.insertAdjacentElement(s.where,l)}else n?.appendChild(l);return l}removeChild(t,e){const{children:i}=this.rootElements[t];i&&(i.get(e)?.remove(),i.delete(e))}incrementDataCounter(t){const{dataset:e}=this.element;e[t]??(e[t]="0"),e[t]=String(Number(e[t])+1)}setDataBoolean(t,e){this.element.dataset[t]=String(e)}updateContainerClassName(){const{element:t,containerSize:e,minWidth:i,minHeight:s}=this;t.classList.toggle(Ug.safeHorizontal,i>=(e?.width??1/0)),t.classList.toggle(Ug.safeVertical,s>=(e?.height??1/0))}},U0=class extends Gi{constructor(){super(lt("div")),this.textElement=ri("text"),this.textElement.role="presentation",this.svgElement=ri("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(t){this.textElement.textContent=t;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},ro=class extends Gi{constructor(){super(lt("button")),this.setEnabled(!0)}destructor(){}setEnabled(t){St(this.elem,"aria-disabled",!t),Ci(this.elem,"pointer-events",t?void 0:"none")}addListener(t,e){return super.addListener(t,(i,s)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,s)})}},Y0=class extends Gi{constructor(){super(lt("div")),St(this.elem,"role","group")}destructor(){}},Kg=class extends Gi{constructor(t,e){super(lt("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[r,o]=n==="both"?[qn.horizontal,qn.vertical]:[qn[n],void 0];let a=-1;if(Ya(i.sourceEvent)){const l=i.sourceEvent.key;l===r.nextKey||l===o?.nextKey?a=s.index+1:(l===r.prevKey||l===o?.prevKey)&&(a=s.index-1)}this.children[a]?.focus()},this.orientation=t,St(this.elem,"role",e)}get orientation(){return Ga(this.elem,"aria-orientation")??"both"}set orientation(t){St(this.elem,"aria-orientation",t!=="both"?t:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}onChildAdded(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}},W0=class extends Kg{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(t=>t.getElement().parentElement.remove())}addChildToDOM(t,e){const i=lt("div");St(i,"role","listitem"),Ci(i,"position","absolute"),Gi.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}},tr=class extends Gi{constructor(t){super(t)}destructor(){}},gh=class Zo extends Gi{constructor(){super(lt("input")),this._step=Zo.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),e!==void 0)){const i=()=>this.getElement().step=e.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Ga(this.elem,"aria-orientation")??"both"}set orientation(e){St(this.elem,"aria-orientation",e!=="both"?e:void 0),Zo.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=it(e,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(e,i){const{divider:s}=this.step,n=Math.round(e*1e4)/s,{ariaValueText:r=Xp(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=r}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",Zo.onKeyDown):e.addListener("keydown",Zo.onKeyDown)}static onKeyDown(e,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};gh.STEP_ONE={attributeValue:"1",divider:1},gh.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var fh=gh,H0=class extends ro{constructor(){super(),St(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){St(this.elem,"aria-checked",t)}},Wa=class extends Kg{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function er(t,e){return e.params?.type===t}function K0(t){if(t==="button")return new ro;if(t==="slider")return new fh;if(t==="toolbar")return new Wa;if(t==="group")return new Y0;if(t==="list")return new W0;if(t==="region")return new tr(lt("div"));if(t==="text")return new U0;if(t==="listswitch")return new H0;throw Error("AG Charts - error allocating meta")}function $g(t){const e={params:t,result:void 0};return e.result=K0(e.params.type),e}var Zg=class{constructor(t,e){this.localeManager=t,this.domManager=e,this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t())}addLocalisation(t){t(),this.destroyFns.push(this.localeManager.addListener("locale-changed",t))}createProxyContainer(t){const e=$g(t),{params:i,result:s}=e,n=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.type,"ariaOrientation"in i&&(n.ariaOrientation=i.ariaOrientation),er("toolbar",e)&&(e.result.orientation=e.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(t){const e=$g(t);if(er("button",e)){const{params:i,result:s}=e,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:r}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(r.id,r.params)})}this.setParent(e.params,e.result)}if(er("slider",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(er("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(er("listswitch",e)){const{params:i,result:s}=e;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(er("region",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return St(i,"id",t.id),Ci(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(t,e){const{tabIndex:i,domIndex:s}=t,n=this.initElement(t,e);i!==void 0&&(n.tabIndex=i),s!==void 0&&(e.domIndex=s)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i)}}},Xg={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",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",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",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",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent] to ${max}[percent]",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",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}"},$0=/\$\{(\w+)}(?:\[(\w+)])?/gi,mh={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,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"})},Z0=({defaultValue:t,variables:e})=>t?.replaceAll($0,(i,s,n)=>{const r=e[s],o=n!=null?mh[n]:null;return n!=null&&o==null&&k.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(r):typeof r=="number"?mh.number.format(r):r instanceof Date?mh.datetime.format(r):String(r)}),X0=class extends ds{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.dispatch("locale-changed"))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.dispatch("locale-changed"))}t(t,e={}){const{localeText:i=Xg,getLocaleText:s}=this,n=i[t];return s?.({key:t,defaultValue:n,variables:e})??Z0({key:t,defaultValue:n,variables:e})??t}},yh=class{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:e,height:i,canvasElement:s,willReadFrequently:n=!1}=t;this.pixelRatio=t.pixelRatio??Nt("devicePixelRatio")??1,this.element=s??lt("canvas"),this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(e??0,i??0,this.pixelRatio),bp(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:s,context:n}=this;s.width=Math.round(t*i),s.height=Math.round(e*i),n.setTransform(i,0,0,i,0,0),s.style.width=t+"px",s.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}clear(){xp(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};g([Os(t=>t.onEnabledChange())],yh.prototype,"enabled",2);var Q0=class{constructor(t){this.canvas=t,this.debug=Dt.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i),this.layersMap.forEach(({canvas:s})=>s.resize(t,e,i))}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{name:n}=t,r=new vp({width:e,height:i,pixelRatio:s});return this.layersMap.set(r,{id:this.nextLayerId++,name:n,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}};function q0(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function J0(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])typeof n=="number"&&s.push(q0(n));return`Heap ${s.join(" / ")}`}function Qg(t,e,i,s,n={},r=F.zero){if(!Dt.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:a=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:u=0}=s??{},d=performance.now(),{start:p,...f}=e,y=Object.entries(f).map(([N,w])=>Jg(N,w)).filter(N=>N!=null).join(" + "),b=Object.entries(n).map(([N,w])=>`${N}: ${JSON.stringify(w)}`).join(" ; "),m=Dt.check("scene:stats:verbose"),M=J0(),S=[`${Jg("\u23F1\uFE0F",p,d)} (${y})`,`${b}`,`Layers: ${m?xh(o,a):t.size}`,m?`Nodes: ${xh(l,c)}`:null,m?`Ops: ${xh(h,u)}`:null,m&&M?M:null].filter(Ge),v=new Oc(N=>i.measureText(N)),I=new Map(S.map(N=>[N,v.measureLines(N)])),L=Math.max(...Array.from(I.values(),N=>N.width)),A=rv(I.values(),N=>N.height),D=2+r.x;i.save(),i.fillStyle="white",i.fillRect(D,0,L,A),i.fillStyle="black";let C=0;for(const[N,w]of I.entries())C+=w.height,i.fillText(N,D,C);i.restore()}function tv(t){const e=Qo(Nt("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);t.debugNodeSearch=i}function ev(t,e){t.save();for(const[i,s]of Object.entries(e)){const n=Ft.toCanvas(s);if(!n){k.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(n.x,n.y,n.width,n.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,n.x,n.y,n.width),t.fillText(i,n.x,n.y,n.width)}t.restore()}var iv=new Set,sv=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function nv(t){const{...e}=t;for(const i of Object.keys(e))sv.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(iv.add(i),delete e[i]);return e}function Ha(t,e){if(!Dt.check(!0,"scene"))return{};let i=0;return{node:e==="json"?nv(t):t,name:t.name??t.id,dirty:t.dirty,...Array.from(t.children(),s=>Ha(s,e)).reduce((s,n)=>{let{name:r}=n;const{node:{visible:o,opacity:a,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:p},node:f}=n;(!o||a<=0)&&(r=`(${r})`),Q.is(f)&&f.renderToOffscreenCanvas&&(r=`*${r}*`);const y=Array.isArray(l)?`(${l.join(", ")})`:l,b=[`${(i++).toString().padStart(3,"0")}|`,`${r??""}`,`z: ${y}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,p!=null&&p!==1&&`sy: ${p}`].filter(S=>!!S).join(" ");let m=b,M=1;for(;s[m]!=null&&M<100;)m=`${b} (${M++})`;return s[m]=n,s},{})}}function qg(t){if(!t.dirty)return{dirtyTree:{},paths:[]};const e=Array.from(t.children(),n=>qg(n)).filter(n=>n.paths.length>0),i=Q.is(t)?t.name??t.id:t.id,s=e.length?e.flatMap(n=>n.paths).map(n=>`${i}.${n}`):[i];return{dirtyTree:{name:i,node:t,dirty:t.dirty,...e.map(n=>n.dirtyTree).filter(n=>n.dirty!=null).reduce((n,r)=>(n[r.name??""]=r,n),{})},paths:s}}function xh(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function Jg(t,e,i){const s=i!=null?i-e:e;return`${t}: ${Math.round(s*100)/100}ms`}function rv(t,e){let i=0;for(const s of t)i+=e(s);return i}var Ka=class{constructor(t){this.debug=Dt.create(!0,"scene"),this.id=oi(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.canvas=new yh(t),this.layersManager=new Q0(this.canvas)}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(t){const{element:e}=this.canvas;return e.parentElement?.removeChild(e),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=t,t&&(t.visible=!0,t._setLayerManager(this.layersManager)),this)}clear(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>this.removeChild(t)}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return this.root?.removeChild(t),this}download(t,e){Pd(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:s}=t??{},{canvas:n,canvas:{context:r}={},root:o,pendingSize:a,width:l,height:c,pixelRatio:h}=this;if(!r)return;const u=performance.now();if(a&&(this.layersManager.resize(...a),this.pendingSize=null),o&&!o.visible){this.isDirty=!1;return}if(o?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:Ha(o,"console")}),Qg(this.layersManager,e,r,void 0,i,s);return}const d={ctx:r,width:l,height:c,devicePixelRatio:h,debugNodes:{}};Dt.check("scene:stats:verbose")&&(d.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),tv(d);let p=!1;if(o?.dirty!==!1&&(p=!0,n.clear()),o&&Dt.check("scene:dirtyTree")){const{dirtyTree:f,paths:y}=qg(o);Dt.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:f,paths:y})}if(o&&p){if(o.visible&&o.preRender(d),this.debug.check()){const f=Ha(o,"console");this.debug("Scene.render() - before",{canvasCleared:p,tree:f})}o.visible&&(r.save(),o.render(d),r.restore())}e["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,Qg(this.layersManager,e,r,d.stats,i,s),ev(r,d.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:Ha(o,"console"),canvasCleared:p})}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return Cs.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};Ka.className="Scene";var ov=class{constructor(){this.cache=new WeakMap}call(t,...e){let i,s=this.cache.get(t);try{i=JSON.stringify(e)}catch{return this.invoke(t,e,s)}return s==null&&(s=new Map,this.cache.set(t,s)),s.has(i)?s.get(i):this.invoke(t,e,s,i)}invoke(t,e,i,s){try{const n=t(...e);return i&&s!=null&&i.set(s,n),n}catch(n){k.warnOnce("User callback errored, ignoring",n);return}}invalidateCache(){this.cache=new WeakMap}},av=class extends js{constructor(t){super(),this.annotationRoot=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||Ct(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return ot(s,n)}),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}attachNode(t){return this.annotationRoot.append(t),()=>(this.annotationRoot?.removeChild(t),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}},lv=class{constructor(t){this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new Q({name:"Axes-Grids",zIndex:1}),this.axisGroup=new Q({name:"Axes",zIndex:2}),this.axisLabelGroup=new Q({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new Q({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new Q({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new Q({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of e){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},$a=class extends ds{constructor(t){super(),this.animationManager=t,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=Dt.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(t){this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return Cd(e=>this.fetch(e).catch(i=>k.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return Cd((e,i)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:i})},t,{leading:!0,trailing:!0})}async fetch(t){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const e=performance.now(),i=this.requestCounter++;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);let s;try{s=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(r){this.debug(`DataService - request failed | ${i}`),k.errorOnce(`DataService - request failed | [${r}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(r=>r===i);if(n===-1||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1){this.debug(`DataService - discarding stale request | ${i}`);return}this.freshRequests=this.freshRequests.slice(n+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error")}};g([Ve({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],$a.prototype,"dispatchThrottle",2),g([Ve({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],$a.prototype,"requestThrottle",2);var tf=class{constructor(t){this.maxAnimationTime=t,this.debug=Dt.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(jn.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(jn[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(jn.indexOf(t.phase)=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=jn[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Pr[c]}};let{phase:s,phaseControllers:n,phaseMeta:r}=i();const o=()=>jn[this.currentPhase]==null,a=()=>{for({phase:s,phaseControllers:n,phaseMeta:r}=i();!o()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:r}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=e,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of n)h?d.stop():e=Math.min(d.update(c),e),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${u} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(e>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&Pr[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){k.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){this.stoppedCbs.forEach(t=>t()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},ef=(t=>(t[t.Default=32]="Default",t[t.ZoomDrag=16]="ZoomDrag",t[t.Annotations=8]="Annotations",t[t.ContextMenu=4]="ContextMenu",t[t.Animation=2]="Animation",t[t.AnnotationsSelected=1]="AnnotationsSelected",t[t.Clickable=41]="Clickable",t[t.Focusable=34]="Focusable",t[t.Keyable=43]="Keyable",t[t.ContextMenuable=36]="ContextMenuable",t[t.AnnotationsMoveable=9]="AnnotationsMoveable",t[t.AnnotationsDraggable=57]="AnnotationsDraggable",t[t.ZoomDraggable=50]="ZoomDraggable",t[t.ZoomClickable=34]="ZoomClickable",t[t.ZoomWheelable=59]="ZoomWheelable",t[t.All=63]="All",t))(ef||{}),sf=class{constructor(){this.stateQueue=34}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}};function nf(t){return t==null?!0:!isNaN(t)&&t>=0&&t<=2}var rf=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new tf(this.defaultDuration*1.5),this.debug=Dt.create(!0,"animation"),this.events=new tc,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(a){this.failsafeOnError(a);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||t.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:r}=t;if(!nf(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!nf(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new Kd({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=Nt().requestAnimationFrame(e=>{t(e).catch(i=>k.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{const s=()=>{const n=i-(t??i);t=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(2);try{this.batch.progress(n)}catch(r){this.failsafeOnError(r)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){k.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new tf(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},of=class extends js{seriesEvent(t){this.listeners.dispatch(t,{type:t})}seriesKeyNavZoom(t,e){const i={type:"series-keynav-zoom",delta:t,widgetEvent:e};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(t,e,i,s,n){const r={type:"legend-item-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",r)}legendItemDoubleClick(t,e,i,s,n,r){const o={type:"legend-item-double-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:r,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",o)}},af=class{constructor(){this.defaultActions=[],this.disabledActions=new Set,this.hiddenActions=new Set,this.listeners=new ds}static check(t,e){return e.type===t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{sourceEvent:n}=e,r=s?.x??e.canvasX,o=s?.y??e.canvasY;n.stopPropagation();const a={type:t,x:r,y:o,context:i,sourceEvent:n};this.listeners.dispatch("",a)}addListener(t){return this.listeners.addListener("",t)}filterActions(t){return this.defaultActions.filter(e=>e.id!=null&&!this.hiddenActions.has(e.id)&&["all",t].includes(e.type))}registerDefaultAction(t){const e=t.id!=null&&!this.defaultActions.some(({id:i})=>i===t.id);return e&&this.defaultActions.push(t),()=>{const i=e?this.defaultActions.findIndex(({id:s})=>s===t.id):-1;i!==-1&&this.defaultActions.splice(i,1)}}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}showAction(t){this.hiddenActions.add(t)}hideAction(t){this.hiddenActions.delete(t)}isDisabled(t){return this.disabledActions.has(t)}},lf=class extends js{constructor(){super(...arguments),this.highlightStates=new Jn}updateHighlight(t,e){const{activeHighlight:i}=this;this.highlightStates.set(t,e),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:t})}getActiveHighlight(){return this.activeHighlight}isEqual(t,e){return t===e||t!=null&&e!=null&&t?.series===e?.series&&t?.itemId===e?.itemId&&t?.datum===e?.datum}};function cf(t,e){if(t==null||e.length===0)return[!1,!1];const i=t.valueOf(),s=e[0],n=e[e.length-1];if(typeof s=="string")return[i===s,i===n];let r=s.valueOf(),o=n.valueOf();return r>o&&([r,o]=[o,r]),[i===r,i===o]}function zs(t,e,i,s,n){const{xValue:r,yValue:o}=t,[a,l]=cf(o,n),[c,h]=cf(r,s);return{datum:t,xKey:e,yKey:i,xValue:r,yValue:o,first:c,last:h,min:a,max:l}}function hf(t,[e,i],s){const n=Ld(0,t-1,o=>{const a=s(o)?.[1]??NaN;return!Number.isFinite(a)||a>e})??0;let r=Ad(0,t-1,o=>{const a=s(o)?.[0]??NaN;return!Number.isFinite(a)||a=0&&(a+=1),l&&a<0&&(a-=1),ce){l=!0;continue}n(c)&&(o+=1)}return o}var Za=class{constructor(t,e){this.domManager=t,this.tooltip=e,this.stateTracker=new Jn,this.suppressState=new Jn(!1),this.appliedState=null,e.setup(t),t.addListener("hidden",()=>this.tooltip.hide())}updateTooltip(t,e,i){this.tooltip.enabled&&(i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{content:i,meta:e}),this.applyStates())}removeTooltip(t){this.tooltip.enabled&&(this.stateTracker.delete(t),this.applyStates())}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}destroy(){this.domManager.removeStyles("tooltip")}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):null;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===e?.content){const n=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,n)}else this.tooltip.show(s,i,e?.meta,e?.content);this.appliedState=e}static makeTooltipMeta(t,e,i){const{canvasX:s,canvasY:n}=t,r=e.properties.tooltip,o={canvasX:s,canvasY:n,enableInteraction:r.interaction?.enabled??!1,lastPointerEvent:{type:t.type,canvasX:s,canvasY:n},showArrow:r.showArrow,position:{type:r.position.type,xOffset:r.position.xOffset,yOffset:r.position.yOffset}},a=bh(e,i);return(r.position.type==="node"||r.position.type==="sparkline")&&a?{...o,canvasX:a.canvasX,canvasY:a.canvasY}:o}isEnteringInteractiveTooltip(t){const{tooltip:e}=this,i=t.sourceEvent.relatedTarget;return e.interactive&&e.enabled&&e.isVisible()&&e.contains(i)}},df=3,cv=505;function Mh(t,e,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=i;return{type:e,device:t,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function pf(t,e){const i=t*t+e*e,s=df*df;return i>=s}var gf=class{constructor(t){this.destroyFns=[],this.listeners=new ds,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(t.addListener("touchstart",this.onTouchStart.bind(this)),t.addListener("touchmove",this.onTouchMove.bind(this)),t.addListener("touchend",this.onTouchEnd.bind(this)),t.addListener("mousemove",this.onMouseMove.bind(this)),t.addListener("dblclick",this.onDblClick.bind(this)),t.addListener("drag-start",this.onDragStart.bind(this)),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(t=>t()),this.listeners.destroy()}addListener(t,e){return this.listeners.addListener(t,e)}dispatch(t){this.listeners.dispatch(t.type,t)}onTouchStart(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches.item(0)??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches.item(0)??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.dispatch(t)}onDblClick(t){this.dispatch({device:"mouse",...t})}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&pf(t.originDeltaX,t.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(t)}onDragEnd(t){if(this.isDragging){this.dispatch(t),this.isDragging=!1;return}if(t.device==="mouse"){const e=Mh("mouse","click",t);this.dispatch(e)}else if(t.sourceEvent.type==="touchend"){if(pf(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=Mh("touch","click",t);this.dispatch(e);const i=Date.now();if(this.lastClickTime!==void 0&&i-this.lastClickTime<=cv){const s=Mh(t.device,"dblclick",t);this.dispatch(s),this.lastClickTime=void 0}else this.lastClickTime=i}}},vh=class extends tr{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},hv=class{constructor(t){this.seriesWidget=new vh(t.getParent("series-area")),this.chartWidget=new vh(t.getParent("canvas-proxy")),this.containerWidget=new vh(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new gf(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},Sh={bottomCenter:fv,center:gv,clone:bv,collides:Mv,end:dv,from:vv,height:yv,round:xv,start:uv,topCenter:pv,origin:Sv,width:mv};function uv(t){return{x:t.x1,y:t.y1}}function dv(t){return{x:t.x2,y:t.y2}}function pv(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function gv(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function fv(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function mv(t){return Math.abs(t.x2-t.x1)}function yv(t){return Math.abs(t.y2-t.y1)}function xv(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function bv(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function Mv(t,e){const i=ff(t),s=ff(e);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function ff(t){return{x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)}}function vv(t,e,i,s){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:s};if("width"in t)return{x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height};throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(t)}] [${e}] [${i}] [${s}]`)}function Sv(){return{x1:0,y1:0,x2:0,y2:0}}function Xa(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function mf(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function yf(t,e,i){return[mf(t,i.min,e,i.max,0),mf(t,i.min,e,i.max,1)]}function Iv(t,e,i){const[s,n]=yf(t.x1,t.x2,e),[r,o]=yf(t.y1,t.y2,i);return{x1:s,x2:n,y1:r,y2:o}}function xf(t,e,i,s,n,r){if(i<=n&&r<=s)return i;const o=n-i,a=r-s,l=Math.abs(o)be((e,i)=>!yt.is(t?.scale)&&!Bi.is(t?.scale)||e==null||i.end==null?!0:e<=i.end,"to be less than end"),Mf=class extends js{constructor(t,e){super(),this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Jn(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new Lv,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(e.addListener("layout:complete",()=>{const{pendingMemento:i}=this,s=!this.didLayoutAxes;this.didLayoutAxes=!0,i?this.restoreMemento(i.version,i.mementoVersion,i.memento):s&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!he(t))return!1;for(const o of Object.keys(t))if(!Av.includes(o))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:ta(sn(Qi,ea),bf(i)),end:sn(Qi,ea)},rangeY:{start:ta(sn(Qi,ea),bf(s)),end:sn(Qi,ea)},ratioX:{start:ta(ia,wd("end")),end:ia},ratioY:{start:ta(ia,wd("end")),end:ia},autoScaledAxes:sc(Cx("y"))},r=Jo(t,n);return r.errors.length>0?(e.push(...r.errors.map(o=>o.message)),!1):!0}restoreMemento(t,e,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const n=this.getDefinedZoom();if(i?.rangeX?n.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let a=i?.autoScaledAxes?.includes("y");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},a??(a=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},a??(a=!1)):(n.y={min:0,max:1},a??(a=!0)),n.autoScaleYAxis=a}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const r=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const a of[r,o])a&&this.updateAxisZoom("zoom-manager",a.id,n[a.direction])}updateAxes(t){this.axes=t;const e=new Map(t.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of t)this.axisZoomManagers.set(i.id,e.get(i.id)??new Cv(i));this.state.size>0&&t.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(t=!0){this.independentAxes=t}setAutoScaleYAxis(t,e){this.autoScaleYAxis.enabled=t,this.autoScaleYAxis.padding=e}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isZoomEnabled(){return this.zoomModule}updateZoom(t,e){if(e?.x&&(e.x.min<0||e.x.max>1)&&(k.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${e.x.min}, max: ${e.x.max} }], expecting a ratio of 0 to 1, ignoring.`),e.x=void 0),e?.y&&(e.y.min<0||e.y.max>1)&&(k.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${e.y.min}, max: ${e.y.max} }], expecting a ratio of 0 to 1, ignoring.`),e.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===t)&&this.state.set(t,e);return}this.state.set(t,e);const i=e?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(t,e?.[s.getDirection()])}),this.applyChanges(t)}updateAxisZoom(t,e,i){this.axisZoomManagers.get(e)?.updateZoom(t,i),this.applyChanges(t)}resetZoom(t){this.autoScaleYAxis.manuallyAdjusted=!1;const e=this.getRestoredZoom();this.updateZoom(t,{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1},autoScaleYAxis:e?.autoScaleYAxis??!0})}resetAxisZoom(t,e){const s=this.axisZoomManagers.get(e)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const r=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!r}this.updateAxisZoom(t,e,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(t,e){this.axisZoomManagers.get(e)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(t,e,i){const s=this.getPrimaryAxis(e);s&&this.updateAxisZoom(t,s.id,i)}panToBBox(t,e,i){if(!this.isZoomEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(e.width>0&&e.height>0&&Math.abs(i.width)<=Math.abs(e.width)&&Math.abs(i.height)<=Math.abs(e.height)))return k.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=Dv(e,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(t,"x",r.x),this.updatePrimaryAxisZoom(t,"y",r.y)):this.updateZoom(t,r),!0}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}extendToEnd(t,e,i){return this.extendWith(t,e,s=>Number(s)-i)}extendWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,r]=n,o=i(r),a=this.rangeToRatio({start:o,end:r},e);a&&this.updateZoom(t,{[e]:a})}updateWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[r,o]=n;[r,o]=i(r,o);const a=this.rangeToRatio({start:r,end:o},e);a&&this.updateZoom(t,{[e]:a})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?t??(t=i.getZoom()):i.getDirection()==="y"&&(e??(e=i.getZoom()))}),t||e)return{x:t,y:e}}getAxisZoom(t){return this.axisZoomManagers.get(t)?.getZoom()??{min:0,max:1}}getAxisZooms(){const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]={direction:i.getDirection(),zoom:i.getZoom()};return t}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}isVisibleItemsCountAtLeast(t,e){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n=new Set;let r=0;const o=[t.x.min,t.x.max],a=[t.y.min,t.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=e-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=e)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=e-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=e)return!0}return n.size===0}getMementoRanges(){const t=this.getDefinedZoom();let e;return this.autoScaleYAxis.enabled&&(e=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(t.x,"x"),rangeY:this.getRangeDirection(t.y,"y"),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:e}}autoScaleYZoom(t,e=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,n=this.getZoom();if(n?.x==null||!s.enabled||s.manuallyAdjusted)return;const{padding:r}=s;let o;if(n.x?.min===0&&n.x?.max===1?o={min:0,max:1}:i?o=this.primaryAxisZoom("y",n.x,{padding:r}):o=this.combinedAxisZoom("y",n.x,{padding:r}),o!=null){if(i){const a=this.getPrimaryAxis("y");(a==null?void 0:this.axisZoomManagers.get(a.id))?.updateZoom("zoom-manager",o)}else for(const a of this.axisZoomManagers.values())a.getDirection()==="y"&&a.updateZoom("zoom-manager",o);e&&this.applyChanges(t)}}applyChanges(t){if(this.autoScaleYZoom(t,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,n]of this.axisZoomManagers.entries())i[s]=n.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:i,callerId:t}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(t,e){const i=this.getPrimaryAxis(e);if(!i||!yt.is(i.scale)&&!Bi.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s;let o,a;return n<=r?(o=i.scale.invert(0),a=i.scale.invert(n+(r-n)*t.max)):(o=i.scale.invert(n-(n-r)*t.min),a=i.scale.invert(0)),{start:o,end:a}}rangeToRatio(t,e){const i=this.getPrimaryAxis(e);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s;let o=t.start==null?n:i.scale.convert?.(t.start),a=t.end==null?r:i.scale.convert?.(t.end);if(!pt(o)||!pt(a))return;const[l,c]=[Math.min(n,r),Math.max(n,r)];if(oc){k.warnOnce(`Invalid range start [${t.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(r)}], ignoring.`);return}if(ac){k.warnOnce(`Invalid range end [${t.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(r)}], ignoring.`);return}o=Math.min(c,Math.max(l,o)),a=Math.min(c,Math.max(l,a));const h=r-n,u=Math.abs((o-n)/h),d=Math.abs((a-n)/h);return{min:u,max:d}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainExtents(t){const{domain:e}=t.scale,i=e.at(0),s=e.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(t){const{domain:e}=t.scale,i=t.scale.convert?.(e.at(0)),s=t.scale.convert?.(e.at(-1));if(!(!pt(i)||!pt(s)))return[i,s]}getDefinedZoom(){const t=this.getZoom();return{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1}}}zoomBounds(t,e,i,s){const n=t.scale,r=n.range;n.range=[0,1];const o=e.scale,a=o.range;o.range=[0,1];let l=1,c=!1,h=0,u=!1;for(const f of e.boundSeries){const{connectsToYAxis:y}=f,b=f.getRange("y",[i.min,i.max]);for(const m of b){const M=o.convert(m);Number.isFinite(M)&&(Mh&&(h=M,u=!y||m>0))}}if(pt(e.min)&&(l=0),pt(e.max)&&(h=1),n.range=r,o.range=a,l>=h)return;const d=(c?s:0)+(u?s:0),p=Math.min((h-l)*(1+d),1);if(!(p<=0)){if(c&&u){const f=(h+l)/2;l=f-p/2,h=f+p/2}else!c&&u?h=l+p:c&&!u&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=this.getPrimaryAxis(s),r=this.getPrimaryAxis(t);if(!(n==null||r==null))return this.zoomBounds(n,r,e,i)}combinedAxisZoom(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)n.set(c,l);let r=1,o=0;for(const l of this.axes)if(l.direction===t)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const u=this.zoomBounds(h,l,e,i);if(u==null)return;r=Math.min(r,u.min),o=Math.max(o,u.max)}const a=1e-6;if(r1-a&&(o=1),!(r>o))return{min:r,max:o}}},Cv=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new Jn({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return te(this.state.stateValue())}hasChanges(){const t=this.currentZoom,e=this.state.stateValue();return t.min!==e.min||t.max!==e.max}applyChanges(){const t=this.hasChanges();return this.currentZoom=this.state.stateValue(),t}},Nv=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=F.zero){const s={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},n=new Set(t.map(o=>o.id));for(const o of this.labelData.keys())n.has(o)||this.labelData.delete(o);for(const o of t){const a=o.getLabelData();a.every(HM)&&this.labelData.set(o.id,a)}const r=$M(this.labelData,s,5);for(const o of t)o.updatePlacedLabelData?.(r.get(o.id)??[])}},Tv=class extends js{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:s})=>({visible:t,seriesId:e,itemId:i,legendItemName:s}))}guardMemento(t){return t==null||Ct(t)}restoreMemento(t,e,i){i?.forEach(s=>{const{seriesId:n,data:r}=this.getRestoredData(s)??{};!n||!r||this.updateData(n,r)}),this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const o=(this.legendDataMap.get(e)??[]).map(a=>{const l=a.seriesId===e&&(!i||a.itemId===i);return l&&a.isFixed&&this.warnFixed(a.seriesId,a.itemId),!a.isFixed&&l?{...a,enabled:n}:a});return{seriesId:e,data:o}}if(!(i==null&&s==null))for(const r of this.getData()){if(i!=null&&r.itemId!==i||s!=null&&r.legendItemName!==s)continue;if(r.isFixed){this.warnFixed(r.seriesId,i);return}const o=(this.legendDataMap.get(r.seriesId)??[]).map(a=>a.itemId===i||a.legendItemName===s?{...a,enabled:n}:a);return{seriesId:r.seriesId,data:o}}}warnFixed(t,e){k.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:t??this.getData()})}updateData(t,e=[]){this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem({enabled:t,seriesId:e,itemId:i,legendItemName:s}){if(s){this.getData().forEach(a=>{const l=(this.legendDataMap.get(a.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(a.seriesId,l)});return}const n=this.getData(e),r=n.length===1,o=n.map(a=>i==null&&r||a.itemId===i?{...a,enabled:t}:a);this.updateData(e,o)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,s])=>e.concat(s),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},kv=class{constructor(){this.groups={}}registerSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){var n;e&&((n=this.groups)[s]??(n[s]={}),this.groups[s][t]={grouping:e,visible:i})}updateSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){if(!e)return;const n=this.groups[s]?.[t];n&&(n.grouping=e,n.visible=i)}deregisterSeries({internalId:t,type:e}){this.groups[e]&&delete this.groups[e][t],this.groups[e]&&Object.keys(this.groups[e]).length===0&&delete this.groups[e]}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set;for(const o of Object.values(this.groups[t]??{}))o.visible&&(s.add(o.grouping.groupIndex),o.grouping.groupIndex===e.groupIndex&&n.add(o.grouping.stackIndex));const r=Array.from(s);return r.sort((o,a)=>o-a),{visibleGroupCount:r.length,visibleSameStackCount:n.size,index:r.indexOf(e.groupIndex)}}},oo=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",t[t.SERIES_UPDATE=4]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=5]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=6]="SCENE_RENDER",t[t.NONE=7]="NONE",t))(oo||{}),vf=class{constructor(t){this.updateCallback=t,this.events=new tc}addListener(t,e){return this.events.on(t,e)}removeListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}update(t=0,e){this.updateCallback(t,e)}dispatchUpdateComplete(){this.events.emit("update-complete",{type:"update-complete"})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}},wv=class{constructor(t,e){this.callbackCache=new ov,this.chartEventManager=new of,this.highlightManager=new lf,this.layoutManager=new Og,this.localeManager=new X0,this.seriesStateManager=new kv,this.stateManager=new T0,this.seriesLabelLayoutManager=new Nv,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:r,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:c,chartType:h}=e;this.chartService=t,this.syncManager=n,this.domManager=new Hg(r,c),this.widgets=new hv(this.domManager);const u=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Ka({canvasElement:u}),this.scene.setRoot(s),this.axisManager=new lv(s),this.legendManager=new Tv,this.annotationManager=new av(t.annotationRoot),this.chartTypeOriginator=new C0(t),this.interactionManager=new sf,this.contextMenuRegistry=new af,this.updateService=new vf(a),this.proxyInteractionService=new Zg(this.localeManager,this.domManager),this.historyManager=new N0(this.chartEventManager),this.animationManager=new rf(this.interactionManager,l),this.dataService=new $a(this.animationManager),this.tooltipManager=new Za(this.domManager,t.tooltip),this.zoomManager=new Mf(o,this.layoutManager);for(const d of _i.byType("context")){if(!d.chartTypes.includes(h))continue;const p=d.moduleFactory(this);this.contextModules.push(p),this[d.contextKey]=p}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(t=>t.destroy())}},Sf=class extends et{constructor(){super(...arguments),this.range="tooltip"}};g([x(It(["tooltip","node"],"a range"))],Sf.prototype,"range",2);function Ev(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function Ov(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const n=e.get(i);if(n==null||!Ev(s,n))return!1}return!0}function Rv(t,e){if(t.length!==e.length)return!1;for(let i=0;is&&(i[0]=s),i[1]e&&(this.domain[0]=e),this.domain[1]Math.max(r,o.length),0);let s=1<<32-Math.clz32(e);e===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const r of t)for(let o=0;od)&&(n[h]=a)}for(let r=s/2|0;r>=1;r=r/2|0){const o=r-1|0,a=o+r|0;for(let l=0;ly?f:y}}this.buffer=n}computeRangeInto(t,e,i,s,n,r,o){const a=n+r-1;if(a=i)return o;if(n>=e&&a1&&(s=s*2|0,r=r/2|0,this.computeRangeInto(t,e,i,s+1|0,n,r,o),this.computeRangeInto(t,e,i,s+2|0,n+r,r,o));return o}rangeBetween(t,e){if(t>e)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,t,e,0,0,i,n),n}get range(){const{buffer:t}=this;return[t[ir],t[sr]]}},Df=Symbol("domain-ranges");function Fv(t){return t.map(e=>he(e)?JSON.stringify(e):e).join("-")}function Af(t){return Number.isInteger(t)?t:Math.abs(t)>1e4?Math.trunc(t):Math.round(t*1e4)/1e4}function Ye(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function Ih(t,e){return e?.get(t.id)??0}function Bv(t){return"scopes"in t&&Array.isArray(t.scopes)}var Qa=Symbol("invalid");function Dh(t,e){const i=[];for(let s=0;s{let i=e;for(const s of t)i=i[s];return i}}var Cf=class{constructor(t,e="standalone",i=!1){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.debug=Dt.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(a,l,c,h){for(const u of a)h.has(u)||h.set(u,Dh(l.length,!1)),h.get(u)[c]=!0};let s=!0;for(const a of t.props){if(a.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");a.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:a=[]})=>{for(const l of a)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},r=new Set,o=new Set;for(const a of t.props){const l=a.type==="key"?r:o;switch(Bv(a)&&a.scopes?.forEach(c=>l.add(c)),a.type){case"key":this.keys.push({...a,index:this.keys.length,missing:new Map});break;case"value":if(a.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(a)}`);this.values.push({...a,index:this.values.length,missing:new Map});break;case"aggregate":n(a),this.aggregates.push({...a,index:this.aggregates.length});break;case"group-value-processor":n(a),this.groupProcessors.push({...a,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...a,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...a,index:this.reducers.length});break;case"processor":this.processors.push({...a,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const a=new Set(o.values());if(r.forEach(l=>a.delete(l)),a.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...a.values()]}`)}}resolveProcessedDataDefById(t,e){const i=this.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveKeysById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return n.get(t.id)}hasColumnById(t,e){return this.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return n}*forEachDatum(t,e,i){const s=e.columnScopes.findIndex(n=>n.has(t.id));for(const n of i.datumIndices[s]??[])yield e.columns[s][n]}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(r=>r.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const r of e.groups){s.group=r;let o=0;for(const a of r.datumIndices[i]??n)s.datumIndex=a,s.valueIndex=o++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(t,e){const s={columnIndex:e.columnScopes.findIndex(n=>n.has(t.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(t,e))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=n.group,s.nextGroupIndex=n.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=n.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(t,e,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,s],n){const r=e.map(c=>this.resolveProcessedDataIndexById(t,c)),o=r.join(":"),a=n[Df];let l=a.get(o);if(l==null){const c=r.map(h=>n.columns[h]);l=new zv(c),a.set(o,l)}return l.rangeBetween(i,s)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:s,groupProcessors:n,reducers:r,processors:o,propertyProcessors:a}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),a.length>0&&this.postProcessProperties(c),r.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,this.debug.check()&&Gv(c),this.processScopeCache(),c}warnDataMissingProperties(t){if(t.size!==0)for(const e of tn(this.keys,this.values))for(const[i,s]of e.missing){if(s<(t.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;k.warnOnce(`the key '${e.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const t of tn(this.keys,this.values,this.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const s of i)if(!this.scopeCache.has(e))this.scopeCache.set(e,new Map([[s,t]]));else{if(this.scopeCache.get(e)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(e).set(s,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,s]of this.values.entries())(!t||s.groupId&&t.includes(s.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,s=typeof e=="string"?e:e.id,n=o=>{if(o.idsMap){for(const[a,l]of o.idsMap)if(t?.includes(a)&&l.has(s))return!0}return!1},r=this.values.reduce((o,a,l)=>((a.scopes==null||i&&!a.scopes.length||a.scopes.some(h=>t?.includes(h)))&&(a.property===s||a.id===s||n(a))&&o.push(l),o),[]);if(r.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return r}extractData(t){const{dataDomain:e,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:r}=this,{invalidData:o,invalidKeys:a,allKeyMappings:l}=this.extractKeys(n,t,i),{columns:c,columnScopes:h,partialValidDataCount:u,maxDataLength:d}=this.extractValues(o,r,t,a,i),p=f=>{const y=e.get(f),b=y.getDomain();return Fs.is(y)&&b[0]>b[1]?[]:b};return{type:"ungrouped",input:{count:d},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:a,invalidData:o,domain:{keys:n.map(p),values:r.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:r},partialValidDataCount:u,time:0,[Df]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,r=new Map;let o,a;const l=(c,h)=>{const u=a.get(c);o.set(h,o.get(u)),s.has(u)&&(s.set(h,s.get(u)),n.set(h,n.get(u)))};for(const c of t){const{invalidValue:h,scopes:u}=c;o=new Map,a=new Map,r.set(c,o);for(const d of u??[]){const p=e.get(d)??[];if(a.has(p)){l(p,d);continue}const f=[];o.set(d,f),a.set(p,d);let y,b;for(let m=0;mi.get(b))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),p=Nr(c.scopes),f=i.get(p),y=f.map((b,m)=>{const M=s.get(p)?.[m];let S=n(c,b,m,c.scopes);return(M||S===Qa)&&this.markScopeDatumInvalid(c.scopes,f,m,t),M?S=h:S===Qa&&(r+=1,S=h),S});o.push(y),a.push(d),l=Math.max(l,y.length)}return{columns:o,columnScopes:a,partialValidDataCount:r,maxDataLength:l}}groupData(t,e){var i;const s=new Map,{keys:n,columns:r,columnScopes:o,invalidKeys:a,invalidData:l}=t,c=t.scopes,h=new Set;for(const p of c){const f=r.map((v,I)=>I).filter(v=>!h.has(v)&&o[v].has(p));if(f.length===0)continue;for(const v of f)h.add(v);const y=new Set;for(const v of f)for(const I of o[v])y.add(I);const b=n.map(v=>v.get(p)).filter(v=>v!=null),m=r[Nr(f)],M=l?.get(p),S=a?.get(p);for(let v=0;vC[v]);if(I==null||I.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const L=e?.(I)??I,A=Fv(L),D=s.get(A)??{keys:L,datumIndices:[],validScopes:c};if(s.has(A)||s.set(A,D),M?.[v]===!0){D.validScopes===c&&(D.validScopes=new Set(c.values()));for(const C of y)D.validScopes.delete(C)}if(D.validScopes.size!==0)for(const C of f)(i=D.datumIndices)[C]??(i[C]=[]),D.datumIndices[C].push(v)}}const u=[],d=[];for(const{keys:p,datumIndices:f,validScopes:y}of s.values())y?.size!==0&&(u.push(p),d.push({datumIndices:f,keys:p,aggregation:[],validScopes:y}));return{...t,type:"grouped",domain:{...t.domain,groups:u},groups:d}}aggregateUngroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{keys:i,columns:s,dataSources:n}=t,r=Nr(n.keys()),o=n.get(r);t.aggregation=o?.map((a,l)=>{const c=[];for(const[h,u]of this.aggregates.entries()){const d=this.valueGroupIdxLookup(u);let p=u.groupAggregateFunction?.()??[1/0,-1/0];const f=d.map(M=>s[M][l]),y=qa(i,r,l),b=y!=null?u.aggregateFunction(f,y):void 0;b&&(p=u.groupAggregateFunction?.(b,p)??Fs.extendDomain(b,p));const m=u.finalFunction?.(p)??p;if(u.round===!0)for(const M in m)m[M]=Af(m[M]);c[h]=m,Fs.extendDomain(m,e[h])}return c})}aggregateGroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[s,n]of this.aggregates.entries()){const r=this.valueGroupIdxLookup(n);for(const o of t.groups){if(o.aggregation??(o.aggregation=[]),o.validScopes?.size===0)continue;const a=o.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...r.map(u=>o.datumIndices[u]?.length??0));for(let u=0;ui[f][o.datumIndices[f]?.[u]]),p=n.aggregateFunction(d,a);p&&(l=n.groupAggregateFunction?.(p,l)??Fs.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;if(n.round===!0)for(const u in h)h[u]=Af(h[u]);o.aggregation[s]=h,Fs.extendDomain(h,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this,{columnScopes:i,columns:s,invalidData:n,scopes:r}=t;for(const o of e){const a=this.valueGroupIdxLookup(o),l=o.adjust()();for(const c of t.groups)c.validScopes===r&&l(s,a,c);for(const c of a){const u=this.values[c].valueType==="category",d=s[c],p=Nr(i[c]),f=n?.get(p),y=u?new If:new Fs;for(let b=0;bh.get(o)).filter(h=>h!=null),l=a.map(()=>{}),c=e.get(o);for(let h=0;h{for(const c of tn(t,e))c.valueType==="category"?s.set(c,new If):(s.set(c,new Fs),r&&(r=(c.scopes??[]).length===i.size))};o();const a=this.buildAccessors(tn(t,e));return{dataDomain:s,processValue:(c,h,u,d)=>{let p,f;if(a.has(c.property)){try{f=a.get(c.property)(h)}catch{}p=f!=null}else p=c.property in h,f=p?h[c.property]:c.missingValue;c.forceValue!=null&&(f=p&&aa(f)?-1*c.forceValue:c.forceValue,p=!0);const y="missingValue"in c;if(!p&&!y)if(typeof d=="string"){const b=c.missing.get(d)??0;c.missing.set(d,b+1)}else for(const b of d){const m=c.missing.get(b)??0;c.missing.set(b,m+1)}if(s.has(c)||o(),p&&c.validation?.(f,h,u)===!1)if("invalidValue"in c)f=c.invalidValue;else return this.mode!=="integrated"&&k.warnOnce(`invalid value of type [${typeof f}] for [${c.scopes} / ${c.id}] ignored:`,`[${f}]`),Qa;return c.processor&&(n.has(c)||n.set(c,c.processor()),f=n.get(c)?.(f)),s.get(c)?.extend(f),f},initDataDomain:o,scopes:i,allScopesHaveSameDefs:r}}buildAccessors(t){const e=new Map;if(this.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=Lf(i.property);if(n==null){k.warnOnce("Invalid property path [%s]",i.property);continue}const r=_v(n);e.set(i.property,r)}return e}};function Gv(t){const e=(i,s)=>{s.length>0&&(k.log(`DataModel.processData() - ${i}`),k.table(s))};k.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Group Domains",t.domain.groups??[]),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[])}var Nf=class Ls{constructor(e,i){this.mode=e,this.suppressFieldDotNotation=i,this.debug=Dt.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,r)=>{this.requested.push({id:e,opts:s,data:i,resolve:n,reject:r})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&(Nt().processedData=[]);const n=[];for(const{data:r,ids:o,opts:a,resolves:l,rejects:c}of s){const h=e?.find(p=>jv(p,r,o,a));let u,d;if(h==null)try{u=new Cf(a,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(f=>[f.id,f.data]));d=u.processData(p)}catch(p){c.forEach(f=>f(p));continue}else({dataModel:u,processedData:d}=h);n.push({opts:a,data:r,ids:o,dataModel:u,processedData:d}),this.debug.check()&&Nt("processedData").push(d),d?.partialValidDataCount===0?l.forEach(p=>p({dataModel:u,processedData:d})):d?this.splitResult(u,d,o,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return n}validateRequests(e){const i=[];for(const[s,n]of e.entries())s>0&&n.data.length!==e[0].data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(e){const i=[];for(const s of e){const n=i.find(Ls.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Ls.mergeRequests)}splitResult(e,i,s,n){for(let r=0;rh.type==="key").map(h=>h.property).join(";")}const{groupByData:n,groupByKeys:r=!1,groupByFn:o,props:a}=i,l=s(a);return([c])=>(n===!1||c.data===e)&&(c.opts.groupByKeys??!1)===r&&c.opts.groupByFn===o&&s(c.opts.props)===l}static mergeRequests(e){const i=new Set(["key","group-value-processor"]);return e.reduce((s,{id:n,data:r,resolve:o,reject:a,opts:{props:l,...c}})=>{s.ids.push(n),s.rejects.push(a),s.resolves.push(o),s.data??(s.data=r),s.opts??(s.opts={...c,props:[]});for(const h of l){const u={...h,scopes:[n],data:r};Ls.createIdsMap(n,u);const d=s.opts.props.find(p=>p.type===u.type&&(i.has(p.type)||p.data===u.data)&&Ls.deepEqual(p,u));if(!d){s.opts.props.push(u);continue}d.scopes??(d.scopes=[]),d.scopes.push(...u.scopes??[]),(d.type==="key"||d.type==="value")&&u.idsMap?.size&&Ls.mergeIdsMap(u.idsMap,d.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,i){for(const[s,n]of e){const r=i.get(s);if(r==null)i.set(s,new Set(n));else for(const o of n)r.add(o)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(e)){if(n=e.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Ls.deepEqual(e[s],i[s]))return!1;return!0}const r=Object.keys(e);if(n=r.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const o=r[s];if(!Ls.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!Ls.deepEqual(e[o],i[o])))return!1}return!0}return!1}};Nf.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Tf=Nf,Vv=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(t,e){this.axesMap.set(t,e.moduleFactory),e.themeTemplate&&this.setThemeTemplate(t,e.themeTemplate)}create(t,e){const i=this.axesMap.get(t);if(i)return i(e);throw new Error(`AG Charts - unknown axis type: ${t}`)}has(t){return this.axesMap.has(t)}keys(){return this.axesMap.keys()}setThemeTemplate(t,e){return this.themeTemplates.set(t,e),this}getThemeTemplate(t){return this.themeTemplates.get(t)}},ps=new Vv,nr=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function Uv(t){return nr.some(e=>e.type==="series"&&e.identifier===t)}function dn(t){return nr.find(e=>e.type==="series"&&e.identifier===t)?.chartTypes}function Yv(t){return dn(t)?.find(i=>i==="cartesian")==="cartesian"}function Wv(t){return dn(t)?.find(i=>i==="polar")==="polar"}function Hv(t){return dn(t)?.find(i=>i==="hierarchy")==="hierarchy"}function Kv(t){return dn(t)?.find(i=>i==="topology")==="topology"}function $v(t){return dn(t)?.find(i=>i==="flow-proportion")==="flow-proportion"}function Zv(t){return dn(t)?.find(i=>i==="standalone")==="standalone"}function Xv(t){return dn(t)?.find(i=>i==="gauge")==="gauge"}function Qv(t){return t.packageType==="enterprise"}function qv(t){if(!Qv(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=nr.find(i=>i.type===t.type&&("optionsKey"in i&&"optionsKey"in t?i.optionsKey===t.optionsKey:!0)&&("contextKey"in i&&"contextKey"in t?i.contextKey===t.contextKey:!0)&&i.identifier===t.identifier&&t.chartTypes.every(s=>i.chartTypes.includes(s)));return e&&(e.useCount??(e.useCount=0),e.useCount++),e!=null}function Jv(){return nr.filter(({useCount:t})=>t==null||t===0)}var tS=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(t,{optionsKey:e,moduleFactory:i,themeTemplate:s}){this.legendMap.set(t,{optionsKey:e,moduleFactory:i}),this.themeTemplates.set(e,s)}create(t,e){const i=this.legendMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown legend type: ${t}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((t,[e,i])=>(t[e]=i.optionsKey,t),{})}},Ah=new tS,kf=class extends Map{get(t){return super.get(t)??"unknown"}isCartesian(t){return this.get(t)==="cartesian"}isPolar(t){return this.get(t)==="polar"}isHierarchy(t){return this.get(t)==="hierarchy"}isTopology(t){return this.get(t)==="topology"}isFlowProportion(t){return this.get(t)==="flow-proportion"}isStandalone(t){return this.get(t)==="standalone"}isGauge(t){return this.get(t)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(t=>this.isCartesian(t))}get polarTypes(){return this.seriesTypes.filter(t=>this.isPolar(t))}get hierarchyTypes(){return this.seriesTypes.filter(t=>this.isHierarchy(t))}get topologyTypes(){return this.seriesTypes.filter(t=>this.isTopology(t))}get flowProportionTypes(){return this.seriesTypes.filter(t=>this.isFlowProportion(t))}get standaloneTypes(){return this.seriesTypes.filter(t=>this.isStandalone(t))}get gaugeTypes(){return this.seriesTypes.filter(t=>this.isGauge(t))}},eS=class extends Map{set(t,e){return super.set(t,ot(e,this.get(t)))}},Ot=new kf,wf=new kf,Lh=new eS,iS=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:r,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,hidden:u}){this.setThemeTemplate(t,r),this.seriesMap.set(t,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h}),Ot.set(t,e),u||wf.set(t,e)}create(t,e){const i=this.seriesMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown series type: ${t}`)}cloneDefaultAxes(t,e){const i=this.seriesMap.get(t)?.defaultAxes;if(i==null)return null;const s=typeof i=="function"?i(e):i;return{axes:te(s)}}isDerivedDefaultAxes(t){return typeof this.seriesMap.get(t)?.defaultAxes=="function"}setThemeTemplate(t,e){const i=this.themeTemplates.get(t);this.themeTemplates.set(t,ot(e,i))}getThemeTemplate(t){return this.themeTemplates.get(t)}getPaletteFactory(t){return this.seriesMap.get(t)?.paletteFactory}getTooltipDefauls(t){return this.seriesMap.get(t)?.tooltipDefaults}isSolo(t){return this.seriesMap.get(t)?.solo??!1}isGroupable(t){return this.seriesMap.get(t)?.groupable??!1}isStackable(t){return this.seriesMap.get(t)?.stackable??!1}isStackedByDefault(t){return this.seriesMap.get(t)?.stackedByDefault??!1}},We=new iS,Ch=class wn extends js{constructor(e){super(),this.chart=e}subscribe(e=wn.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,wn.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=wn.DEFAULT_GROUP){return this.get(e)?.delete(this.chart),this}getChart(){return this.chart}getGroup(e=wn.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=wn.DEFAULT_GROUP){return this.getGroup(e).filter(i=>i!==this.chart)}get(e){return wn.chartsGroups.get(e)}};Ch.chartsGroups=new Map,Ch.DEFAULT_GROUP=Symbol("sync-group-default");var sS=Ch,Nh=class extends et{constructor(){super(...arguments),this.enabled=!1}};g([x(H)],Nh.prototype,"enabled",2),g([x(ut)],Nh.prototype,"tabIndex",2);var Ef=["top","right","bottom","left"];function nS(t){return typeof t=="string"&&Ef.includes(t)}function rS(t){const e=[],i=[],s=[...Ef];for(const n of t)n instanceof so&&(nS(n.position)?i.push(n.position):e.push(n));for(const n of e){let r;do r=s.pop();while(r&&i.includes(r));if(r==null)break;n.position=r}}var oS=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function aS(t,e,i){const s=(c,h,u)=>{const d=[c];for(const p of oS)p in h&&h[p]!=null&&d.push(`${p}=${h[p]}`);return u?.seriesGrouping&&d.push(`seriesGrouping.groupId=${u?.seriesGrouping.groupId}`),d.join(";")},n=new Map;let r=0;for(const c of t){const h=s(c.type,c.properties,i?.[r]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,r++])}const o=new Map;r=0;for(const c of e){const h=s(c.type,c,c);o.has(h)||o.set(h,[]),o.get(h)?.push([c,r++])}if(![...n.keys()].some(c=>o.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:o.keys()};const l=[];for(const[c,h]of o.entries())for(const[u,d]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:u,targetIdx:d,idx:d,status:"add"}),n.delete(c);continue}const[f,y]=p.shift(),b=i?.[y]??{},m=cs(b,u??{}),{groupIndex:M,stackIndex:S}=m?.seriesGrouping??{};M!=null||S!=null?l.push({opts:u,series:f,diff:m,targetIdx:d,idx:y,status:"series-grouping"}):m?l.push({opts:u,series:f,diff:m,targetIdx:d,idx:y,status:"update"}):l.push({opts:u,series:f,targetIdx:d,idx:y,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,u]of c)l.push({series:h,idx:u,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function gs(t){const{series:e}=t;if(e)return e[0]?.type??"line"}function Th(t){const e=gs(t);return e==null?!1:Ot.isCartesian(e)||Yv(e)}function Of(t){const e=gs(t);return e==null?!1:Ot.isPolar(e)||Wv(e)}function lS(t){const e=gs(t);return e==null?!1:Ot.isHierarchy(e)||Hv(e)}function cS(t){const e=gs(t);return e==null?!1:Ot.isTopology(e)||Kv(e)}function hS(t){const e=gs(t);return e==null?!1:Ot.isFlowProportion(e)||$v(e)}function Rf(t){const e=gs(t);return e==null?!1:Ot.isStandalone(e)||Zv(e)}function Pf(t){const e=gs(t);return e==null?!1:Ot.isGauge(e)||Xv(e)}function uS(t){const e=gs(t);return Of(t)&&e!=="pie"&&e!=="donut"}function dS(t){return t==null?!1:Ot.has(t)}function pS(t){return t==null?!1:ps.has(t)}var gS=class extends _c{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&ji(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())t.type==="legend"&&(yield{legendType:t.identifier,legend:e})}},kh="ag-charts-overlay",jf="ag-charts-dark-overlay",pn=class extends et{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return t.t(this.text??this.defaultMessageId)}getElement(t,e,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const s=this.renderer();if(s instanceof HTMLElement)this.content=s;else{const n=lt("div");n.innerHTML=s,this.content=n.firstElementChild}}else{const s=lt("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)"});s.innerText=this.getText(e),this.content=s,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(n){s.style.opacity=String(n)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};g([x(H)],pn.prototype,"enabled",2),g([x(T,{optional:!0})],pn.prototype,"text",2),g([x(Ne,{optional:!0})],pn.prototype,"renderer",2);var rr=class extends et{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new pn("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new pn("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new pn("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new pn("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};g([x(H)],rr.prototype,"darkTheme",2),g([x(P)],rr.prototype,"loading",2),g([x(P)],rr.prototype,"noData",2),g([x(P)],rr.prototype,"noVisibleSeries",2),g([x(P)],rr.prototype,"unsupportedBrowser",2);function fS(t,e){const{animationDuration:i}=Pr.add,s=i*e,n=lt("div",`${kh}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),r=lt("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),o=lt("p",{marginTop:"1em"});o.innerText=t;const a=lt("div",`${kh}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=lt("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,r,o,a),n}var zf=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(zf||{}),Ff=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(Ff||{}),Bf=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(Bf||{}),mS=.25,yS=.125,ao=class{constructor(t,e,{datum:i},s){this.type=t,this.event=e,this.datum=i,this.seriesId=s.id}},wh=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},Ja=class extends Tg{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=ao,this.internalId=oi(this),this.contentGroup=new ke({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new ke({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new ke({name:`${this.internalId}-annotation`}),this.labelGroup=new ke({name:`${this.internalId}-series-labels`}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new _c,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new ds,this._pickNodeCache=new Ec;const{moduleCtx:e,pickModes:i,directionKeys:s={},directionNames:n={},canHaveAxes:r=!1,usesPlacedLabels:o=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=r,this.usesPlacedLabels=o,this.highlightGroup=new ke({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new Q({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Q({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(t){this.properties.visible=t,this.ctx.legendManager.toggleItem({enabled:t,seriesId:this.id}),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled??!1}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:s,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:e}),this.fireEvent(new wh(this,e,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){t?.removeChild(this.contentGroup),e.removeChild(this.highlightGroup),e.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(t){return t===this._declarationOrder?!1:(this._declarationOrder=t,this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t,!0)}renderToOffscreenCanvas(){return!1}addEventListener(t,e){return super.addEventListener(t,e)}addListener(t,e){return this.seriesListeners.addListener(t,e)}dispatch(t,e){this.seriesListeners.dispatch(t,e)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,e){const i=this.resolveKeyDirection(t),s=e?.[i],n=[];if(!s)return n;const r=(...o)=>{for(const a of o)Array.isArray(a)?r(...a):typeof a=="object"?r(...Object.values(a)):n.push(a)};return r(...s.map(o=>this.properties[o])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){return this.directionKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(s=>s.getDomain(t)).flat();return i.length!==0?e.concat(i):e}getRange(t,e){return this.getSeriesRange(t,e)}getVisibleItems(t,e,i){return 1/0}getGradientFillOptions({bounds:t},e){const{axes:i}=this,s=i.x,n=i.y,r=s?.range??[0,1],o=n?.range??[0,1],[a,l]=ue(r),[c,h]=ue(o),u=l-a,d=h-c;let p=[0,1];return t==="series"?p=this.getSeriesDomain("y"):t==="axes"&&(p=n?.scale.domain??[0,1]),{bbox:new F(a,c,u,d),domain:p,defaultColorRange:e}}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===1)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;case 2:default:return e}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===void 0)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){const t=this.ctx.highlightManager?.getActiveHighlight()?.series;return t==null?0:t!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNode(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:r,contentGroup:o}=this;if(!r||!o.visible||e==="highlight"&&!this.properties.highlight.enabled||e==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let a=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:d}=this.properties;a=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:d}=this.properties;a=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=s.filter(d=>!i||d===0),{x:c,y:h}=t,u=JSON.stringify({x:c,y:h,maxDistance:a,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let p;switch(d){case 0:p=this.pickNodeExactShape(t);break;case 1:p=this.pickNodeClosestDatum(t);break;case 2:p=n!=null?this.pickNodeMainAxisFirst(t,n==="main-category"):void 0;break}if(p&&p.distance<=a)return this._pickNodeCache.set(u,{pickMode:d,match:p.datum,distance:p.distance})}return this._pickNodeCache.set(u,void 0)}pickNodeExactShape(t){const e=this.contentGroup.pickNode(t.x,t.y);if(e&&e.datum.missing!==!0)return{datum:e.datum,distance:0}}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=oa(t.x,t.y,e);if(i.nearest!==void 0&&i.nearest.datum.missing!==!0)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireNodeClickEvent(t,e){this.fireEvent(new this.NodeEvent("nodeClick",t,e,this))}fireNodeDoubleClickEvent(t,e){this.fireEvent(new this.NodeEvent("nodeDoubleClick",t,e,this))}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=r!=null&&r===t.legendItemName;(s.id===this.id||a||o!=null)&&this.toggleSeriesItem(e,n,i,r,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:r}=t,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===t.legendItemName;s.id===this.id||l||a!=null?this.toggleSeriesItem(!0,r,i,o,t):e&&n===1?this.toggleSeriesItem(!0,r,void 0,o):this.toggleSeriesItem(!1,r,void 0,o)}toggleSeriesItem(t,e,i,s,n){const r=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(o),this.ctx.legendManager.toggleItem({enabled:t,seriesId:r,itemId:i,legendItemName:s})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,e,i=as){return t.formatter?this.ctx.callbackCache.call(t.formatter,{seriesId:this.id,...e})??i(e.value):i(e.value)}getMarkerStyle(t,e,i=t.getStyle()){const s={size:e.datum.point?.size??0},n=ot(s,i);if(t.itemStyler){const r=this.ctx.callbackCache.call(t.itemStyler,{seriesId:this.id,...n,...e,datum:e.datum.datum});return ot(r,n)}return n}updateMarkerStyle(t,e,i,s=e.getStyle(),{applyTranslation:n=!0,selected:r=!0}={}){const{point:o}=i.datum,a=this.getMarkerStyle(e,i,s),l=this.visible&&a.size>0&&o&&!isNaN(o.x)&&!isNaN(o.y);if(n?t.setProperties({visible:l,...a,translationX:o?.x,translationY:o?.y}):t.setProperties({visible:l,...a}),r||(t.fillOpacity*=mS,t.strokeOpacity*=yS),typeof e.shape=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(o!==void 0&&c.isFinite()){const h=c.computeCenter(),[u,d]=["x","y"].map(p=>(a.strokeWidth??0)+Math.abs(h[p]-o[p]));o.focusSize=Math.max(c.width+u,c.height+d)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:e,height:i}=t??{width:NaN,height:NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=cs(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,s=i.get(t);if(s!=null)return s;const n=e();return i.set(t,n),n}};g([Ve({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Ja.prototype,"seriesGrouping",2);function xS(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function bS(t,e,i){if(t===0)return xS(e,i);const s=e*e-4*t*i,n=[];if(s===0){const r=-e/(2*t);r>=0&&r<=1&&n.push(r)}else if(s>0){const r=Math.sqrt(s),o=(-e-r)/(2*t),a=(-e+r)/(2*t);o>=0&&o<=1&&n.push(o),a>=0&&a<=1&&n.push(a)}return n}function MS(t,e,i,s){if(t===0)return bS(e,i,s);const n=e/t,r=i/t,o=s/t,a=(3*r-n*n)/9,l=(9*n*r-27*o-2*n*n*n)/54,c=a*a*a+l*l,h=1/3,u=[];if(c>=0){const d=Math.sqrt(c),p=Math.sign(l+d)*Math.pow(Math.abs(l+d),h),f=Math.sign(l-d)*Math.pow(Math.abs(l-d),h),y=Math.abs(Math.sqrt(3)*(p-f)/2),b=-h*n+(p+f);if(b>=0&&b<=1&&u.push(b),y===0){const m=-h*n-(p+f)/2;m>=0&&m<=1&&u.push(m)}}else{const d=Math.acos(l/Math.sqrt(-a*a*a)),p=h*n,f=2*Math.sqrt(-a),y=f*Math.cos(h*d)-p,b=f*Math.cos(h*(d+2*Math.PI))-p,m=f*Math.cos(h*(d+4*Math.PI))-p;y>=0&&y<=1&&u.push(y),b>=0&&b<=1&&u.push(b),m>=0&&m<=1&&u.push(m)}return u}function or(t,e,i,s,n,r,o,a){const l=(i-t)*(a-r)-(s-e)*(o-n);if(l===0)return 0;const c=((o-n)*(e-r)-(t-n)*(a-r))/l,h=((i-t)*(e-r)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function vS(t,e,i,s,n,r,o,a,l,c,h,u){let d=0;const p=c-u,f=h-l,y=l*(u-c)-c*(h-l),b=_f(t,i,n,o),m=_f(e,s,r,a),M=p*b[0]+f*m[0],S=p*b[1]+f*m[1],v=p*b[2]+f*m[2],I=p*b[3]+f*m[3]+y,L=MS(M,S,v,I);for(const A of L){const D=A*A,C=A*D,N=b[0]*C+b[1]*D+b[2]*A+b[3],w=m[0]*C+m[1]*D+m[2]*A+m[3];let O;l===h?O=(w-c)/(u-c):O=(N-l)/(h-l),O>=0&&O<=1&&d++}return d}function _f(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function Gf(t,e,i,s,n,r,o,a,l,c){if(isNaN(t)||isNaN(e))return 0;r&&([n,s]=[s,n]);const h=(c-a)/(l-o),u=a-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-e)-t),f=Math.pow(t,2)+Math.pow(u-e,2)-Math.pow(i,2),y=Math.pow(p,2)-4*d*f;if(y<0)return 0;const b=(-p+Math.sqrt(y))/2/d,m=(-p-Math.sqrt(y))/2/d;let M=0;return[b,m].forEach(S=>{if(!(S>=Math.min(o,l)&&S<=Math.max(o,l)))return;const I=h*S+u,L=S-t,A=I-e,D=Math.atan2(A,L);ws(D,s,n)&&M++}),M}function tl(t,e,i,s,n){return(1-n)**3*t+3*(1-n)**2*n*e+3*(1-n)*n**2*i+n**3*s}function el(t,e,i,s,n){if(n<=Math.min(t,s))return t=Math.max(t,s))return t0&&l<1)return[l]}return[]}const a=r*r-4*n*o;if(a>=0){const l=Math.sqrt(a),c=(-r+l)/(2*n),h=(-r-l)/(2*n);return[c,h].filter(u=>u>0&&u<1)}return[]}function Vf(t,e,i,s,n,r,o,a){const l=Eh(t,i,n,o),c=Eh(e,s,r,a);return[...l,...c]}var lo=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.path2d.moveTo(t,e),this.commands.push(0),this.params.push(t,e)}lineTo(t,e){this.openedPath?(this.path2d.lineTo(t,e),this.commands.push(1),this.params.push(t,e)):this.moveTo(t,e)}rect(t,e,i,s){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.closePath()}roundRect(t,e,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(t,e+n),this.arc(t+n,e+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+n),this.lineTo(t+i,e+s-n),this.arc(t+i-n,e+s-n,n,0,Math.PI/2),this.lineTo(t+i-n,e+s),this.lineTo(t+n,e+s),this.arc(t+ +n,e+s-n,n,Math.PI/2,Math.PI),this.lineTo(t,e+s-n),this.closePath()}arc(t,e,i,s,n,r){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,r),this.commands.push(2),this.params.push(t,e,i,s,n,r?1:0)}cubicCurveTo(t,e,i,s,n,r){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,r),this.commands.push(3),this.params.push(t,e,i,s,n,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(t){t&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(t,e){const i=this.commands,s=this.params,n=i.length,r=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,u=0;for(let d=0,p=0;d({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(o,...a)=>{e.push(o);for(let l=0;l{i=Math.min(p,i),s=Math.min(d,s),n=Math.max(d,n),r=Math.max(p,r),f&&([o,a]=[d,p])};let u=0;for(const d of t)switch(d){case 0:h(e[u++],e[u++],!0),[l,c]=[o,a];break;case 1:h(e[u++],e[u++],!0);break;case 3:{const p=e[u++],f=e[u++],y=e[u++],b=e[u++],m=e[u++],M=e[u++];h(m,M,!0),Vf(o,a,p,f,y,b,m,M).forEach(v=>{const I=tl(o,p,y,m,v),L=tl(a,f,b,M,v);h(I,L)});break}case 2:{const p=e[u++],f=e[u++],y=e[u++];let b=Tt(e[u++]),m=Tt(e[u++]);e[u++]&&([b,m]=[m,b]);const S=(I,L)=>{const A=p+y*Math.cos(I),D=f+y*Math.sin(I);h(A,D,L)};S(b),S(m,!0);const v=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const I of v)(bm&&(b<=I||I<=m))&&S(I);break}case 4:[o,a]=[l,c];break}return new F(s,i,n-s,r-i)}};function tt(t){const{changeCb:e,convertor:i}=t??{};return j({type:"path",convertor:i,changeCb:e})}var we=class extends ci{constructor(){super(...arguments),this.path=new lo,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty())}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){e.save();const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new lo),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e),e.restore()}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=ri("path");return t.setAttribute("d",this.svgPathData()),this.applySvgFillAttributes(t),this.applySvgStrokeAttributes(t),{elements:[t]}}};we.className="Path",g([tt()],we.prototype,"clip",2),g([tt()],we.prototype,"clipX",1),g([tt()],we.prototype,"clipY",1);var SS=class{constructor(t){this.swapChain=t,this.div=lt("div"),this.svg=ri("svg"),this.outerPath=ri("path"),this.innerPath=ri("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=lt("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof we){const s=(r,o)=>{let{x:a,y:l}=Ft.toCanvasPoint(t,r,o);return a-=e.x??0,l-=e.y??0,{x:a,y:l}},n=t.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(t.x-e.x,0),r=Math.max(t.y-e.y,0),o=Math.min(t.x+t.width-e.x,e.width),a=Math.min(t.y+t.height-e.y,e.height);s=new F(n,r,o-n,a-r)}else s=new F(t.x-e.x,t.y-e.y,t.width,t.height);Fa(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(){const t=this.element.parentElement;return t!=null&&Nt().getComputedStyle(t).opacity==="1"}},IS=class{constructor(t,e,i,s){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(Ci(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(Ci(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),St(this.label1,"id",`${i}-label1`),St(this.label2,"id",`${i}-label2`),Ci(this.label1,"display","none"),Ci(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(s),this.inactiveAnnouncer=this.createAnnouncer(s),St(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(t){const e=lt("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1),this.listeners[t].forEach(i=>i(e))}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],un(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),un(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},DS={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 AS(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function LS(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of Object.entries(DS))if(AS(t,s))return{name:e,activatesFocusIndicator:i}}function CS(t,e,i){const s=bh(t,i.datum);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof F){const{x:r,y:o}=n.computeCenter();return{x:e.x+r,y:e.y+o}}return Ft.toCanvas(n).computeCenter()}}function NS({bounds:t}){return t instanceof F?t:t!=null?Ft.toCanvas(t):F.NaN}function TS(t,e,i){const{x:s,y:n}=CS(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}function Oh(t,e,i,s){let{top:n,right:r,bottom:o,left:a,width:l,height:c}=s;return a!=null?l!=null?r=i.width-a+l:r!=null&&(l=i.width-a-r):r!=null&&l!=null&&(a=i.width-r-l),n!=null?c!=null?o=i.height-n-c:o!=null&&(c=i.height-o-n):o!=null&&c!=null&&(n=i.height-o-c),l==null?c==null?(l=t,c=e):l=Math.ceil(t*c/e):c==null&&(c=Math.ceil(e*l/t)),a==null&&(r==null?a=Math.floor((i.width-l)/2):a=i.width-r-l),n==null&&(o==null?n=Math.floor((i.height-c)/2):n=i.height-c-o),{x:a,y:n,width:l,height:c}}var sl=null;function ar(t){if(t!=null)return t===""?"":(sl??(sl=lt("div")),sl.textContent=String(t),sl.innerHTML)}function co(t,e){const{path:i,size:s}=t,{x:n,y:r}=t;i.clear();let o=!1;for(const[a,l]of e){const c=n+(a-.5)*s,h=r+(l-.5)*s;o?i.lineTo(c,h):i.moveTo(c,h),o=!0}i.closePath()}var kS={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.clear(),t.arc(e,i,n,0,Math.PI*2),t.closePath()},cross(t){co(t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(t){co(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i=i+n/2,t.clear(),t.arc(e-n,i-n,n,Jt(130),Jt(330)),t.arc(e+n,i-n,n,Jt(220),Jt(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){t.moveTo(e+(.15625-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.15625-.5)*s,i+(.151491-.5)*s,e+(.307741-.5)*s,i+(0-.5)*s,e+(.5-.5)*s,i+(0-.5)*s),t.cubicCurveTo(e+(.692259-.5)*s,i+(0-.5)*s,e+(.84375-.5)*s,i+(.151491-.5)*s,e+(.84375-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.84375-.5)*s,i+(.493824-.5)*s,e+(.784625-.5)*s,i+(.600181-.5)*s,e+(.716461-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.699009-.5)*s,i+(.719769-.5)*s,e+(.681271-.5)*s,i+(.743104-.5)*s,e+(.663785-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.611893-.5)*s,i+(.834367-.5)*s,e+(.562228-.5)*s,i+(.899699-.5)*s,e+(.528896-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.524075-.5)*s,i+(.992358-.5)*s,e+(.512663-.5)*s,i+(1-.5)*s,e+(.5-.5)*s,i+(1-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.437772-.5)*s,i+(.899699-.5)*s,e+(.388107-.5)*s,i+(.834367-.5)*s,e+(.336215-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.318729-.5)*s,i+(.743104-.5)*s,e+(.300991-.5)*s,i+(.719769-.5)*s,e+(.283539-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.215375-.5)*s,i+(.600181-.5)*s,e+(.15625-.5)*s,i+(.493824-.5)*s,e+(.15625-.5)*s,i+(.34375-.5)*s),t.closePath()},plus(t){co(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:s,pixelRatio:n}){const r=s/2;t.clear(),t.moveTo(rs(n,e-r),rs(n,i-r)),t.lineTo(rs(n,e+r),rs(n,i-r)),t.lineTo(rs(n,e+r),rs(n,i+r)),t.lineTo(rs(n,e-r),rs(n,i+r)),t.closePath()},star({path:t,x:e,y:i,size:s}){const r=s/2,o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=e+Math.cos(h)*c,d=i+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},triangle(t){co(t,[[.5,0],[1,.87],[0,.87]])}},ho=class extends we{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:t,shape:e,x:i,y:s,size:n}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=le.anchor(e),a={path:t,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:r};t.clear(),typeof e=="string"?kS[e](a):typeof e=="function"&&e(a)}computeBBox(){const{x:t,y:e,size:i}=this,s=le.anchor(this.shape);return new F(t-i*s.x,e-i*s.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};g([tt()],ho.prototype,"shape",2),g([tt()],ho.prototype,"x",2),g([tt()],ho.prototype,"y",2),g([tt({convertor:Math.abs})],ho.prototype,"size",2);var le=class extends Yn(Tc(ln(ho))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}};function Uf(t,e,i=e*(5/3)){const s=new Q,n=Math.min(t.marker.strokeWidth,2),r=Math.min(t.line?.strokeWidth??0,2),o=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),a=Math.max(t.marker.enabled===!1?0:e,r);if(t.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,u=new ti;u.x1=0,u.y1=a/2,u.x2=o,u.y2=a/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=r,u.lineDash=h,s.append(u)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:p,lineDashOffset:f}=t.marker,y=new le;y.shape=l??"square",y.size=e,y.fill=c,y.fillOpacity=h,y.stroke=u,y.strokeOpacity=d,y.strokeWidth=n,y.lineDash=p,y.lineDashOffset=f;const b=le.anchor(l),m=o/2+(b.x-.5)*e,M=a/2+(b.y-.5)*e,S=e/(e+n);y.x=0,y.y=0,y.translationX=m,y.translationY=M,y.scalingX=S,y.scalingY=S,s.append(y)}return Q.toSVG(s,o,a)}var Yf=.1,Wf=200,Hf=12,wS=.5,ES=class extends ds{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const r=.001,o=Math.ceil(n/(r*1e3))|0;let{x:a,y:l,vx:c,vy:h}=this;for(let u=0;u{e.push(i.label??i.fallbackLabel,i.value)}),e.join("; "))}function Zf(t,e,i){let s="";t==null?s+=`${ar(e)}`:(s+=`${ar(t)}`,s+=" ",s+=`${ar(e)}`);const n=[`${ve}-row`];return i&&n.push(`${ve}-row--inline`),s=`
${s}
`,s}function OS(t){if(t.type==="raw")return t.rawHtmlString;let e="";if((t.heading==null||t.title==null)&&t.data?.length===1&&t.data[0].label==null&&t.data[0].value!=null){const i=t.data[0];e+=Zf(t.heading??t.title,i.value,!1)}else{const i=t.title==null&&t.data?.length===1;t.heading!=null&&(e+=`${ar(t.heading)}`,e+=" ");const s=t.symbol==null?void 0:Uf(t.symbol,12);s!=null&&(t.title!=null||t.data?.length)&&(e+=`${s}`),t.title!=null&&(e+=`${ar(t.title)}`,e+=" "),t.data?.forEach(n=>{e+=Zf(n.label??n.fallbackLabel,n.value,i),e+=" "})}return e=`
${e.trimEnd()}
`,e}var lr=class extends et{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};g([x(It(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left",{value:"sparkline",undocumented:!0},{value:"sparkline-",undocumented:!0}],"a position type"))],lr.prototype,"type",2),g([x(ut)],lr.prototype,"xOffset",2),g([x(ut)],lr.prototype,"yOffset",2);var Ui=class extends et{constructor(){super(),this.enabled=!0,this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new lr,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new ES,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this._compact=!1,this._visible=!1,this.positionParams=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(t){"togglePopover"in Nt().HTMLElement.prototype&&(this.element=t.addChild("canvas-overlay",ve),this.element.setAttribute("popover","manual"),this.element.className=ve)}destroy(t){t.removeChild("canvas-overlay",ve),this.destroyFns.forEach(e=>e())}isVisible(){return this._visible}contains(t){return this.element?.contains(t)??!1}updateTooltipPosition(){const{element:t,positionParams:e}=this;if(t==null||e==null)return;const{canvasRect:i,relativeRect:s,meta:n}=e,{x:r,y:o}=this.springAnimation,a=n.position?.type??this.position.type,l=n.position?.xOffset??0,c=n.position?.yOffset??0,h=s.x,u=s.y,d=s.width-t.clientWidth-1+h,p=s.height-t.clientHeight+u;let f=this.getTooltipBounds({positionType:a,canvasX:r,canvasY:o,yOffset:c,xOffset:l,canvasRect:i}),y=Oh(t.clientWidth,t.clientHeight,s,f);a==="sparkline"&&(y.x<=h||y.x>=d)&&(f=this.getTooltipBounds({positionType:"sparkline-constrained",canvasX:r,canvasY:o,yOffset:c,xOffset:l,canvasRect:i}),y=Oh(t.clientWidth,t.clientHeight,s,f));const b=it(h,y.x,d),m=it(u,y.y,p),M=b!==y.x||m!==y.y,S=(a==="node"||a==="pointer")&&!M&&!l&&!c,v=n.showArrow??this.showArrow??S;this.updateShowArrow(v),this.updateCompact(a==="sparkline"||a==="sparkline-constrained"),t.style.transform=`translate(${b}px, ${m}px)`}show(t,e,i,s,n=!1){const{element:r}=this;if(r!=null&&s!=null)r.innerHTML=OS(s);else if(r==null||r.innerHTML===""){this.toggle(!1);return}const o={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};this.positionParams={canvasRect:e,relativeRect:o,meta:i},this.springAnimation.update(i.canvasX,i.canvasY),r.style.top=`${e.top}px`,r.style.left=`${e.left}px`,i.enableInteraction?(this.enableInteraction=!0,r.style.pointerEvents="auto",r.removeAttribute("aria-hidden")):(this.enableInteraction=!1,r.style.pointerEvents="none",r.setAttribute("aria-hidden","true")),this.delay>0&&!n?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}hide(){this.springAnimation.reset(),this.toggle(!1)}toggle(t){if(!this.element?.isConnected)return;this._visible=t;const{classList:e}=this.element,i=(s,n)=>e.toggle(`${ve}--${s}`,n);t||clearTimeout(this.showTimeout),i("no-interaction",!this.enableInteraction),i("arrow",this._showArrow),i("compact",this._compact),e.toggle(Kf,this.darkTheme),this.element.togglePopover(t),t&&this.updateTooltipPosition();for(const s of this.wrapTypes)e.toggle(`${ve}--wrap-${s}`,s===this.wrapping)}updateShowArrow(t){this._showArrow=t}updateCompact(t){this._compact=t}getTooltipBounds(t){if(!this.element)return{};const{positionType:e,canvasX:i,canvasY:s,yOffset:n,xOffset:r,canvasRect:o}=t,{clientWidth:a,clientHeight:l}=this.element,c={width:a,height:l};switch(e){case"node":case"pointer":return c.top=s+n-l-8,c.left=i+r-a/2,c;case"top":return c.top=n,c.left=o.width/2-a/2+r,c;case"right":return c.top=o.height/2-l/2+n,c.left=o.width-a/2+r,c;case"left":return c.top=o.height/2-l/2+n,c.left=r,c;case"bottom":return c.top=o.height-l+n,c.left=o.width/2-a/2+r,c;case"top-left":return c.top=n,c.left=r,c;case"top-right":return c.top=n,c.left=o.width-a+r,c;case"bottom-right":return c.top=o.height-l+n,c.left=o.width-a+r,c;case"bottom-left":return c.top=o.height-l+n,c.left=r,c;case"sparkline":return c.top=s+n-l/2,c.left=i+r+8,c;case"sparkline-constrained":return c.top=s+n-l/2,c.left=i+r-8-a,c}}};g([x(H)],Ui.prototype,"enabled",2),g([x(H,{optional:!0})],Ui.prototype,"showArrow",2),g([x(R)],Ui.prototype,"delay",2),g([x(La,{optional:!0})],Ui.prototype,"range",2),g([x(Aa)],Ui.prototype,"wrapping",2),g([x(P)],Ui.prototype,"position",2),g([x(H)],Ui.prototype,"darkTheme",2),g([x(It(["extended","canvas"]))],Ui.prototype,"bounds",2);var RS=class extends js{constructor(t){super(),this.chart=t,this.id=oi(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=c0(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=4){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}});const e=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new IS(e,i,this.id,"img"),this.swapChain.addListener("blur",()=>this.onBlur()),this.swapChain.addListener("focus",()=>this.onFocus()),this.focusIndicator=new SS(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0);const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:r}=t.ctx.widgets;n.setTabIndex(-1),this.destroyFns.push(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus()),n.addListener("mousemove",o=>this.onHover(o)),n.addListener("wheel",o=>this.onWheel(o)),n.addListener("mouseleave",o=>this.onLeave(o)),n.addListener("keydown",o=>this.onKeyDown(o)),n.addListener("contextmenu",(o,a)=>this.onContextMenu(o,a)),s.addListener("drag-move",o=>this.onDragMove(o)),s.addListener("click",o=>this.onClick(o,n)),s.addListener("dblclick",o=>this.onClick(o,n)),r.addListener("contextmenu",(o,a)=>this.onContextMenu(o,a)),r.addListener("click",(o,a)=>this.onClick(o,a)),r.addListener("dblclick",(o,a)=>this.onClick(o,a)),t.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),t.ctx.domManager.addListener("resize",()=>this.clearAll()),t.ctx.highlightManager.addListener("highlight-change",o=>this.changeHighlightDatum(o)),t.ctx.layoutManager.addListener("layout:complete",o=>this.layoutComplete(o)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),t.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var t;(t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator.clear(),this.clearHighlight()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.focusIndicator.isFocusVisible()&&this.isState(34)&&this.handleSeriesFocus(0,0,!0)}update(t,e){this.chart.ctx.updateService.update(t,e)}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let s=e.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[e._declarationOrder,i._declarationOrder]),sn?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.paddedRect),this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:i,canvasX:l,canvasY:c},{})}return}let s,n;if(this.focusIndicator.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=Ft.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNode({x:t.currentX,y:t.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.datum)}const r=s?.series;this.clearAll();const o=t.currentX+e.cssLeft(),a=t.currentY+e.cssTop();this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{sourceEvent:i,canvasX:o,canvasY:a},{pickedSeries:r,pickedNode:s},n)}onLeave(t){!this.isState(41)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t)||(this.chart.ctx.domManager.updateCursor(this.id),this.focusIndicator.isFocusVisible()||this.clearAll())}onWheel(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t))}onHover(t){this.isState(41)&&this.onHoverLikeEvent(t)}onHoverLikeEvent(t){if(!this.isIgnoredTouch(t)&&((t.device==="touch"||PS(t,"drag-move"))&&(this.tooltip.lastHover=t),t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:e,currentY:i}=t,s=this.pickNode({x:e,y:i},"event");s?.series.hasEventListener("nodeClick")||s?.series.hasEventListener("nodeDoubleClick")?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(t,e){if(t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;if(this.focusIndicator.overrideFocusVisible(!1),this.onHoverLikeEvent(t),!this.isState(32))return;if(e==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(t)){this.update(4),t.sourceEvent.preventDefault();return}const i={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator.isFocusVisible()?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(){this.isState(34)&&(this.hoverDevice="pointer",this.clearAll(),this.focusIndicator.overrideFocusVisible(void 0))}onKeyDown(t){if(!this.isState(43))return;const e=LS(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator.overrideFocusVisible(this.previousInputDevice==="keyboard"),e?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,t);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"submit":return this.onSubmit(t)}}onArrow(t,e,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator.overrideFocusVisible(!0),this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocus(t,e),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(t){if(!this.isState(34))return;const{series:e,datum:i}=this.focus,s=t.sourceEvent;e!==void 0&&i!==void 0?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(t){const e=this.pickNode({x:t.currentX,y:t.currentY},"event");return e==null?!1:t.type==="click"?(e.series.fireNodeClickEvent(t.sourceEvent,e.datum),!0):t.type==="dblclick"?(t.preventZoomDblClick=e.distance===0,e.series.fireNodeDoubleClickEvent(t.sourceEvent,e.datum),!0):!1}handleFocus(t,e){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(t,e):this.focusIndicator.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(t,e,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(t,e,i);return}const{focus:s,seriesRect:n}=this,r=s.sortedSeries.filter(h=>h.visible&&h.focusable);if(r.length===0)return;const o={datumIndex:s.datumIndex-e,otherIndex:s.seriesIndex-t};s.seriesIndex=it(0,s.seriesIndex,r.length-1),s.series=r[s.seriesIndex];const{datumIndex:a,seriesIndex:l}=s,c=s.series.pickFocus({datumIndex:a,datumIndexDelta:e,otherIndex:l,otherIndexDelta:t,seriesRect:n});this.updatePickedFocus(t,e,o,c,i)}handleSoloSeriesFocus(t,e,i){this.focus.series=this.focus.sortedSeries[0];const{focus:{series:s,seriesIndex:n,datumIndex:r},seriesRect:o}=this;if(s==null)return;const a={datumIndex:this.focus.datumIndex-e,otherIndex:this.focus.seriesIndex-t},l=s.pickFocus({datumIndex:r,datumIndexDelta:e,otherIndex:n,otherIndexDelta:t,seriesRect:o});this.updatePickedFocus(t,e,a,l,i)}updatePickedFocus(t,e,i,s,n){const{focus:r,hoverRect:o}=this;if(s===void 0||r.series===void 0||o===void 0)return;const{datum:a,datumIndex:l,otherIndex:c}=s;if(c!==void 0&&(r.seriesIndex=c),r.datumIndex=l,r.datum=a,this.focusIndicator.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator.isFocusVisible()){const u=NS(s),{x:d,y:p}=u.computeCenter();if(!o.containsPoint(d,p)&&this.chart.ctx.zoomManager.panToBBox(this.id,o,u))return}this.focusIndicator.update(s.bounds,this.seriesRect,s.clipFocusBox);const h=TS(r.series,o,s);if(h!==void 0&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const u=r.series.getTooltipContent(a),d=Za.makeTooltipMeta(h,r.series,a);this.chart.ctx.highlightManager.updateHighlight(this.id,a),this.chart.tooltip.enabled&&r.series.tooltipEnabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,d,u):this.chart.ctx.tooltipManager.removeTooltip(this.id),n||(e===0&&t===0||i.datumIndex!==s.datumIndex||i.otherIndex!==(s.otherIndex??r.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(a,u))}}getDatumAriaText(t,e){const i=e==null?"":$f(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator.clear()}handleHoverHighlight(t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const e=this.highlight.appliedHoverEvent;if(!e||!this.isState(41))return;const{currentX:i,currentY:s}=e,n=e.currentX+(this.hoverRect?.x??0),r=e.currentY+(this.hoverRect?.y??0);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,r)){this.clearHighlight();return}const{range:o}=this.chart.highlight,a=o==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNode({x:i,y:s},a);if(l){this.chart.ctx.highlightManager.updateHighlight(this.id,l.datum),this.hoverDevice="pointer";return}this.chart.ctx.highlightManager.updateHighlight(this.id)}handleHoverTooltip(t,e){if(!this.isState(41))return;const{currentX:i,currentY:s}=t,n=i+(this.hoverRect?.x??0),r=s+(this.hoverRect?.y??0),o=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,r)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(o&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(o,"canvas-overlay",ve))return;const a=this.pickNode({x:t.currentX,y:t.currentY},"tooltip");if(!a){this.hoverDevice=="pointer"&&this.clearTooltip();return}this.hoverDevice="pointer";const l=a.series.getTooltipContent(a.datum);if(this.chart.tooltip.enabled&&a.series.tooltipEnabled&&l!=null){const u=Za.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:r},a.series,a.datum);this.chart.ctx.tooltipManager.updateTooltip(this.id,u,l)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(t){const e=new Set,{series:i=void 0,datum:s}=t.currentHighlight??{},{series:n=void 0,datum:r}=t.previousHighlight??{};n&&e.add(n),i&&e.add(i),n?.properties.cursor&&r&&this.chart.ctx.domManager.updateCursor(n.id),i?.properties.cursor&&i?.properties.cursor!=="default"&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||n==null?this.update(4):this.update(4,{seriesToUpdate:e})}pickNode(t,e,i){const s=[...this.series].reverse();let n;for(const r of s){if(!r.visible||!r.contentGroup.visible)continue;const{match:o,distance:a}=r.pickNode(t,e,i)??{};if(!(!o||a==null)&&((!n||n.distance>a)&&(n={series:r,distance:a,datum:o}),a===0))break}return n}};function PS(t,e){return t.type!==e}var Xf=30,jS=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}requestGroup(t){const{internalId:e,type:i,contentGroup:s,seriesGrouping:n}=t,{groupIndex:r=e}=n??{},o=this.series.get(e);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=Xf?"aggressive-grouping":"normal");let a=this.groups.get(i);a==null&&(a=new Map,this.groups.set(i,a));const l=this.lookupIdx(r);let c=a.get(l);return c==null&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Q({name:`${t.contentGroup.name??i}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t}),c.seriesIds.push(e),c.group.appendChild(s),c.group}changeGroup(t){const{internalId:e,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:r}=t,{groupIndex:o=e}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(e)||(this.series.has(e)&&this.releaseGroup({internalId:e,seriesGrouping:r,type:s,contentGroup:n}),this.requestGroup(t))}releaseGroup(t){const{internalId:e,contentGroup:i,type:s}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const n=this.series.get(e)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(r=>r!==e),n.group.removeChild(i)),n?.seriesIds.length===0?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(e)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){this.groups.forEach(t=>{t.forEach(e=>{const{group:i,seriesIds:s}=e;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!t)?0:Math.floor(it(0,t/this.expectedSeriesCount,1)*Xf)}destroy(){this.groups.forEach(t=>{t.forEach(e=>{this.seriesRoot.removeChild(e.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){return t.reduce((i,s)=>{const r=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||r==null?r:Ep(i,r)<=0?i:r},void 0)??1}},Qf=class extends et{constructor(){super(...arguments),this.dragAction="drag"}};g([x(It(["none","drag","hover"]))],Qf.prototype,"dragAction",2);var zS=class{constructor(t,e,i,s,n){this.chart=t,this.dataService=e,this.updateService=i,this.zoomManager=s,this.animationManager=n,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(t=>t())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow()}onZoomChange(){this.dirtyZoom=!0}updateWindow(){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let e,i=!0;if(t){const s=this.zoomManager.getAxisZoom(t.id);e=this.getAxisWindow(t,s),i=this.shouldRefresh(t,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:e?.min,windowEnd:e?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(t.id);return i&&e.min===i.min&&e.max===i.max?!1:(this.lastAxisZooms.set(t.id,e),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*e.min),r=new Date(Number(i[0])+s*e.max);return{min:n,max:r}}},FS=/^((?!chrome|android).)*safari/i,BS=/Version\/(\d+(\.\d+)?)/,_S=/Chrome/,GS=/Chrome\/(\d+)/,VS=/Edg/,US=/OPR/;function YS(){const{userAgent:t}=Nt("navigator");if(FS.test(t)){const e=parseFloat(BS.exec(t)?.[1]??"0"),i=Math.floor(e)>16;return i||k.warnOnce(`Unsupported Safari version: ${e}; ${t}`),!i}else if(_S.test(t)&&!VS.test(t)&&!US.test(t)){const e=parseInt(GS.exec(t)?.[1]??"0",10),i=e>126;return i||k.warnOnce(`Unsupported Chrome version: ${e}; ${t}`),!i}return!1}var WS=new Set(["map-shape-background","map-line-background"]),HS=class{constructor(t,e,i,s,n,r,o){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=r,this.domManager=o,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(kh),this.destroyFns.push(this.layoutManager.addListener("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.destroyFns.forEach(t=>t()),this.domManager.removeStyles("overlays"),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!WS.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(jf):this.overlayElem.classList.remove(jf),this.overlayElem.style.left=`${t.x}px`,this.overlayElem.style.top=`${t.y}px`,this.overlayElem.style.width=`${t.width}px`,this.overlayElem.style.height=`${t.height}px`;const n=e,r=!e&&!i,o=i&&!s,a=this.overlays.unsupportedBrowser.enabled&&YS();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),r?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),a?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||r||o||a;St(this.overlayElem,"aria-hidden",!l)}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Ti=Dt.create(!0,"opts"),Rh=class extends et{constructor(){super(...arguments),this.padding=new Ps(0)}};g([x(H,{optional:!0})],Rh.prototype,"clip",2),g([x(P)],Rh.prototype,"padding",2);var Ht=class ex extends Tg{constructor(e,i){var s;super(),this.id=oi(this),this.seriesRoot=new ke({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new ke({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new Q({name:"titles",zIndex:13}),this.debug=Dt.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new bg,this.padding=new Ps(20),this.seriesArea=new Rh,this.keyboard=new Nh,this.touch=new Qf,this.mode="standalone",this.chartCaptions=new Ua,this.suppressFieldDotNotation=!1,this.destroyed=!1,this._destroyFns=[],this.skipSync=!1,this.chartAnimationPhase="initial",this.modulesManager=new gS,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new bg,this.performUpdateType=7,this.runningUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new l0,this.updateRequestors={},this.performUpdateTrigger=h0(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(u){k.error("update error",u)}}).catch(u=>k.errorOnce(u))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=h=>{this.fireEvent({...h,type:"seriesNodeClick"})},this.onSeriesNodeDoubleClick=h=>{this.fireEvent({...h,type:"seriesNodeDoubleClick"})},this.onSeriesVisibilityChange=h=>{this.fireEvent(h)},this.seriesGroupingChanged=h=>{if(!(h instanceof wh))return;const{series:u,seriesGrouping:d,oldGrouping:p}=h;u.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:d,oldGrouping:p})},this.chartOptions=e;const n=i?.scene,r=i?.container??e.processedOptions.container??void 0,o=i?.styleContainer??e.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const a=new Q({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.annotationRoot),a.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Ui,this.seriesLayerManager=new jS(this.seriesRoot),this.mode=e.userOptions.mode??this.mode;const l=this.ctx=new wv(this,{chartType:this.getChartType(),scene:n,root:a,container:r,styleContainer:o,syncManager:new sS(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,u)=>this.update(h,u),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new rr,(s=this.overlays.loading).renderer??(s.renderer=()=>fS(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new zS(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new HS(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Sf,this.container=r;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new RS(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.layoutManager.addListener("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.dataService.addListener("data-load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Gi.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(6)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(u=>u.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(3,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(e){return ex.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator.overrideFocusVisible(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}=this,a=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,chartType:a,ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}}getModuleContext(){return this.ctx}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clear()}destroy(e){if(this.destroyed)return;const i=e?.keepTransferableResources;let s;return this.performUpdateType=7,this._destroyFns.forEach(n=>n()),this.processors.forEach(n=>n.destroy()),this.tooltip.destroy(this.ctx.domManager),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(n=>n.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>k.errorOnce(i)))}update(e=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:r=this.series,newAnimationBatch:o}=i??{};this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(a=>a.markNodeDataDirty());for(const a of r)this.seriesToUpdate.add(a);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.skipSync=i?.skipSync??!1,this.debug.check()){let a=new Error().stack??"";a=a.replace(/\([^)]*/g,""),this.updateRequestors[a]=e}ethis.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",oo[i]);let a=performance.now();n.start??(n.start=a);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-a,a=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("\u{1F3ED}");case 3:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(3))break;await this.processLayout(),l("\u2316");case 4:{if(this.checkUpdateShortcut(4))break;await this.updateSeries(o),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 5:if(this.checkUpdateShortcut(5))break;r.updateService.dispatchPreSceneRender(),l("\u2196");case 6:if(this.checkUpdateShortcut(6))break;r.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const h of Object.keys(n))delete n[h];this.ctx.domManager.incrementDataCounter("sceneRenders");case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.updateService.dispatchUpdateComplete(),this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=7),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:e,performUpdateType:oo[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let s=i[0],n=!1,{theme:r}=this.chartOptions.processedOptions;for(;typeof r!="string"&&r!=null;)r=r.baseTheme;typeof r=="string"&&(s=r.replace("ag-",e),n=r.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(k.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const s=i?.filter(n=>!e.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(e.length);for(const n of e){if(i?.includes(n))continue;const r=this.seriesLayerManager.requestGroup(n);n.attachSeries(r,this.seriesRoot,this.annotationRoot);const o=this;n.chart={get mode(){return o.mode},get isMiniChart(){return!1},get seriesRect(){return o.seriesRect}},n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n),n.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){e?.forEach(i=>{i.removeEventListener("nodeClick",this.onSeriesNodeClick),i.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(i=>i.axes[e.direction]===e)}assignAxesToSeries(){const e=ec(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=e[s];if(!n){k.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const r=i.getKeys(s),o=n.find(a=>!a.keys.length||r.some(l=>a.keys.includes(l)));if(!o){k.warnOnce(`no matching axis for direction [${s}] and keys [${r}]; check series and axes configuration.`);return}i.axes[s]=o}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=e;const{pixelRatio:n}=e;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[r=0,o=0,a=1]=this._lastAutoSize??[];r===i&&o===s&&a===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:r,inHeight:o,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,r??this.width,o??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=o??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:u,pixelRatio:d,stack:new Error().stack}),!(h==null||u==null||!pt(h)||!pt(u))&&s.resize(h,u,d)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const e=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(e)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new Tf(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>(n.resetDatumCallbackCache(),n.processData(e))),s=this.modulesManager.mapModules(n=>n.processData?.(e));this._cachedData=e.execute(this._cachedData),await Promise.all([...i,...s]);for(const n of this.axes)n.processData();this.updateLegends()}updateLegends(e){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(e):this.setLegendData(s,i)}setCategoryLegendData(e){var i;const{ctx:{legendManager:s,stateManager:n}}=this;e&&this.series.forEach(o=>{const a=e.find(l=>l.seriesId===o.id);o.onLegendInitialState("category",a)});const r=this.series.flatMap(o=>{const a=o.getLegendData("category");return s.updateData(o.id,a),a});if(e){n.setStateAndRestore(s,e);return}if(this.mode!=="integrated"){const o={},a=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of r.filter(u=>!u.hideInLegend)){if(c.fill==null)continue;const u=a.get(l),d=o[u]??(o[u]={});d[i=h.text]??(d[i]=c.fill),d[h.text]!==c.fill&&k.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(e,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(e))}async processLayout(){const e=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(e){const{seriesRect:i}=this;await Promise.all(e.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e=1e4,i=!1){const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==7||this.runningUpdateType!==7)&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==7||this.runningUpdateType!==7)&&await this._performUpdateNotify.await(),performance.now()-s>e){const n=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(n);k.warnOnce(n)}vg()&&await i0()}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){const i=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(i==null||Object.keys(i).length===0)return;const s=this.firstApply?{}:this.chartOptions.processedOptions,n=e.processedOptions;Ti("Chart.applyOptions() - applying delta",i);const r=this.applyModules(n),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"];i.listeners&&this.registerListeners(this,i.listeners),no(this,i,{skip:o});let a=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),a=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,n,s,l,[])&&(a=!0),i.data&&(this.data=i.data),i.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,i.legend.listeners),i.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=i.locale?.localeText),this.chartOptions=e;const c=this.modulesManager.getModule("navigator"),h=this.modulesManager.getModule("zoom");!c?.enabled&&!h?.enabled&&this.ctx.zoomManager.updateZoom("chart");const u=c?.miniChart,d=n.navigator?.miniChart?.series??n.series;u?.enabled===!0&&d!=null?this.applyMiniChartOptions(u,d,n,s):u?.enabled===!1&&(u.series=[],u.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),a||(a=this.shouldForceNodeDataRefresh(i,l));const f=a||r?0:3;this.maybeResetAnimations(l),this.shouldClearLegendData(n,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),Ti("Chart.applyOptions() - update type",oo[f],{seriesStatus:l,forceNodeDataRefresh:a}),this.update(f,{forceNodeDataRefresh:a,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:r,zoomManager:o}=this.ctx,{initialState:a}=e;if("annotations"in e&&e.annotations?.enabled&&a?.annotations!=null){const l=a.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return ot(c,h)});r.setState(i,l)}a?.chartType!=null&&r.setState(s,a.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&a?.zoom!=null&&r.setState(o,a.zoom),a?.legend!=null&&this.updateLegends(a.legend),a!=null&&n.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const s=!!e.data||i==="data-change"||i==="replaced",n=Ah.getKeys(),r=Object.values(n).some(a=>e[a]!=null),o=e.title!=null&&e.subtitle!=null;return s||r||o}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated",r=i.legend!=null&&e.legend==null;return n||r}applyMiniChartOptions(e,i,s,n){const r=n?.navigator?.miniChart?.series??n?.series,o=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r));this.applyAxes(e,s,n,o,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const a=e.series;for(const h of a)h.properties.id=void 0;const l=e.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,u=h?.label,d=h?.label?.interval;if(c.line.enabled=!1,c.label.set(hc(u,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(hc(d,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:f}=c;if(f.length===0)f.set([{label:{enabled:!0}}]);else for(let y=1;ya.moduleFactory(this.getModuleContext())),n.type==="legend"&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(e){for(let i=0;ithis.createSeries(u));return this.initSeriesDeclarationOrder(h),e.series=h,"replaced"}Ti("Chart.applySeries() - matchResult",n);const r=[];let o=!1,a=!1,l=!1;const c=n.changes.toSorted((h,u)=>h.targetIdx-u.targetIdx);for(const h of c)switch(a||(a=h.status==="series-grouping"),o||(o=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const u=this.createSeries(h.opts);r.push(u),Ti("Chart.applySeries() - created new series",u);break}case"remove":Ti(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":r.push(h.series),Ti(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:u,diff:d,idx:p}=h;Ti(`Chart.applySeries() - applying series diff previous idx ${p}`,d,u),this.applySeriesValues(u,d),u.markNodeDataDirty(),r.push(u)}}return this.initSeriesDeclarationOrder(r),Ti("Chart.applySeries() - final series instances",r),e.series=r,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,r=[]){if(!("axes"in i)||!i.axes)return!1;r=["axes[].type",...r];const{axes:o}=i;return!(n==="replaced")&&e.axes.length===o.length&&e.axes.every((c,h)=>c.type===o[h].type)&&Th(s)?(e.axes.forEach((c,h)=>{const u=s.axes?.[h]??{},d=cs(u,o[h]);Ti(`Chart.applyAxes() - applying axis diff idx ${h}`,d);const p=`axes[${h}]`;no(c,d,{path:p,skip:r})}),!0):(Ti(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(o,r),!0)}createSeries(e){const i=We.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(i,e),this.applySeriesValues(i,e),i}applySeriesOptionModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const r of _i.byType("series-option"))r.optionsKey in i&&r.seriesTypes.includes(e.type)&&n.addModule(r,o=>o.moduleFactory(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:r,listeners:o,seriesGrouping:a,showInMiniChart:l,...c}=i;for(const h of nr)if(h.type==="series-option"&&h.optionsKey in c){const u=s.getModule(h.optionsKey);if(u){const d=c[h.optionsKey];delete c[h.optionsKey],u.properties.set(d)}}e.properties.set(c),"data"in i&&e.setOptionsData(r),o&&this.registerListeners(e,o),"seriesGrouping"in i&&(a==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...a})}createAxis(e,i){const s=[],n=this.getModuleContext();for(let r=0;ra.moduleFactory(s)),e[r.optionsKey]=n.getModule(r)):(n.removeModule(r),delete e[r.optionsKey]))}}registerListeners(e,i){e.clearEventListeners();for(const[s,n]of Object.entries(i))en(n)&&e.addEventListener(s,n)}};Ht.chartsInstances=new WeakMap,g([Ve({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),Ht.chartsInstances.set(t,this))},oldValue(t){Ht.chartsInstances.delete(t)}})],Ht.prototype,"container",2),g([Ve({newValue(t){this.resize("width option",{inWidth:t})}})],Ht.prototype,"width",2),g([Ve({newValue(t){this.resize("height option",{inHeight:t})}})],Ht.prototype,"height",2),g([Ve({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],Ht.prototype,"minWidth",2),g([Ve({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],Ht.prototype,"minHeight",2),g([Ve({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],Ht.prototype,"overrideDevicePixelRatio",2),g([x(P)],Ht.prototype,"padding",2),g([x(P)],Ht.prototype,"seriesArea",2),g([x(P)],Ht.prototype,"keyboard",2),g([x(P)],Ht.prototype,"touch",2),g([x(It(["standalone","integrated"],"a chart mode"))],Ht.prototype,"mode",2),g([wt("chartCaptions.title")],Ht.prototype,"title",2),g([wt("chartCaptions.subtitle")],Ht.prototype,"subtitle",2),g([wt("chartCaptions.footnote")],Ht.prototype,"footnote",2),g([x(H)],Ht.prototype,"suppressFieldDotNotation",2),g([Ve({changeValue(t,e){this.onAxisChange(t,e)}})],Ht.prototype,"axes",2),g([Ve({changeValue(t,e){this.onSeriesChange(t,e)}})],Ht.prototype,"series",2);var nl=Ht,KS={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},$S=(t,e)=>Math.log(e)/Math.log(t);function Ph(t,e,i){const s=Math.min(...e),n=KS[t]??$S;return s>=0?n(t,i):-n(t,-i)}var ZS={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},XS=(t,e)=>t**e;function jh(t,e,i){const s=Math.min(...e),n=ZS[t]??XS;return s>=0?n(t,i):-n(t,-i)}var zh=class extends yt{constructor(t=[1,10],e=[0,1]){super(t,e),this.type="log",this.defaultClamp=!0,this.base=10,this.log=i=>Ph(this.base,this.domain,i),this.pow=i=>jh(this.base,this.domain,i)}toDomain(t){return t}transform(t){const[e,i]=ue(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[e,i]=ue(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.exp(t):-Math.exp(-t)}niceDomain(t,e=this.domain){if(e.length<2)return[];const{base:i}=this,[s,n]=e,r=s>n?Math.ceil:Math.floor,o=s>n?Math.floor:Math.ceil,a=jh(i,e,r(Ph(i,e,s))),l=jh(i,e,o(Ph(i,e,n)));return[a,l]}ticks({interval:t,tickCount:e=yt.defaultTickCount},i=this.domain,s){if(!i||i.length<2||e<1)return[];const n=this.base,[r,o]=i,a=Math.min(r,o),l=Math.max(r,o);let c=this.log(a),h=this.log(l);if(t){const y=M=>M>=a&&M<=l,b=Math.min(Math.abs(t),Math.abs(h-c)),m=Jr(c,h,b).map(this.pow).filter(y);if(!to(m.length,this.getPixelRange()))return m}if(!zd(n)||h-c>=e)return Uc(c,h,Math.min(h-c,e)).map(this.pow);let u=[];const d=a>0;c=Math.floor(c)-1,h=Math.round(h)+1;const p=Rn(this.range)/e;let f=1/0;for(let y=c;y<=h;y++){const b=this.convert(this.pow(y+1));for(let m=1;m=p&&L>=p;S>=a&&S<=l&&(m===1||A||u.length===0)&&(u.push(S),f=v)}}return u=rp(u,d,s),u}tickFormatter({specifier:t}){return t!=null?Fp(t):String}datumFormatter(t){return this.tickFormatter(t)}},QS=class{constructor(t,e,i){this.root=new tI(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(s,n)=>t.distanceSquared(s,n)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},qS=class{constructor(t,e,i,s){this.nw=t,this.ne=e,this.sw=i,this.se=s}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},JS=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??F.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length1){const o=n>r?Math.ceil:Math.floor,a=n>r?Math.floor:Math.ceil,l=4;for(let c=0;cas(n,i)}datumFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?Hp(e,s):n=>as(n,i+1)}};function fs(t){if(t.length===0)return null;let e=1/0,i=-1/0;for(const n of t){const r=n instanceof Date?n.getTime():n;typeof r=="number"&&(ri&&(i=r))}const s=[e,i];return s.every(isFinite)?s:null}function Fh(t,e,i){let s=!1;return t.length>2&&(t=fs(t)??[NaN,NaN]),isNaN(e)||(s||(s=e>t[0]),t=[e,t[1]]),isNaN(i)||(s||(s=it[1]&&(t=[]),{extent:t,clipped:s}}var Bs=class extends so{constructor(t,e=new ki){super(t,e),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=Fh(t,e,i);return{domain:s,clipped:n}}};Bs.className="NumberAxis",Bs.type="number",g([x(zi(Un,Ur("max"))),Rs(NaN)],Bs.prototype,"min",2),g([x(zi(Un,Yr("min"))),Rs(NaN)],Bs.prototype,"max",2);var gn=class extends so{constructor(t){super(t,new $p),this.min=void 0,this.max=void 0}normaliseDataDomain(t){let{min:e,max:i}=this,s=!1;return typeof e=="number"&&(e=new Date(e)),typeof i=="number"&&(i=new Date(i)),t.length>2&&(t=fs(t)?.map(n=>new Date(n))??[]),e instanceof Date&&(s||(s=e>t[0]),t=[e,t[1]]),i instanceof Date&&(s||(s=it[1]&&(t=[]),{domain:t,clipped:s}}};gn.className="TimeAxis",gn.type="time",g([x(zi(Mc,Ur("max")),{optional:!0})],gn.prototype,"min",2),g([x(zi(Mc,Yr("min")),{optional:!0})],gn.prototype,"max",2);var Bh=class extends Ja{constructor(){super(...arguments),this.clipFocusBox=!0}getScaleInformation({xScale:t,yScale:e}){const i=yt.is(t),s=yt.is(e);return{isContinuousX:i,isContinuousY:s,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes.x?.scale,e=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await t.request(this.id,e??[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const t=this.processedData?.reduced?.animationValidation;if(!t)return!0;const{orderedKeys:e,uniqueKeys:i}=t;return e&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:s}=this,n=e[i],r={...t,datumIndex:i},o=this.computeFocusBounds(r);if(o!==void 0)return{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}}computeFocusDatumIndex(t,e){const i=a=>{const{missing:l=!1,enabled:c=!0,focusable:h=!0}=e[a];return!l&&c&&h},s=(a,l)=>{for(;a>=0&&!i(a);)a+=l;return a===-1?void 0:a},n=(a,l)=>{for(;a0?r=n(o,t.datumIndexDelta):r=n(o,1)??s(o,-1),r===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:r}},ms=class extends et{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};g([x(gt,{optional:!0})],ms.prototype,"fill",2),g([x(xt,{optional:!0})],ms.prototype,"fillOpacity",2),g([x(gt,{optional:!0})],ms.prototype,"stroke",2),g([x(R,{optional:!0})],ms.prototype,"strokeWidth",2),g([x(xt,{optional:!0})],ms.prototype,"strokeOpacity",2),g([x(Fi,{optional:!0})],ms.prototype,"lineDash",2),g([x(R,{optional:!0})],ms.prototype,"lineDashOffset",2);var rl=class extends et{};g([x(R,{optional:!0})],rl.prototype,"strokeWidth",2),g([x(xt,{optional:!0})],rl.prototype,"dimOpacity",2),g([x(H,{optional:!0})],rl.prototype,"enabled",2);var qf=class extends et{constructor(){super(...arguments),this.color="black"}};g([x(gt,{optional:!0})],qf.prototype,"color",2);var _h=class extends et{constructor(){super(...arguments),this.enabled=!0}};g([x(H,{optional:!0})],_h.prototype,"enabled",2);var uo=class extends et{constructor(){super(...arguments),this.item=new ms,this.series=new rl,this.text=new qf}};g([x(P)],uo.prototype,"item",2),g([x(P)],uo.prototype,"series",2),g([x(P)],uo.prototype,"text",2);var ei=class extends et{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new _h,this.highlightStyle=new uo}};g([x(T,{optional:!0})],ei.prototype,"id",2),g([x(H)],ei.prototype,"visible",2),g([x(lp,{optional:!0})],ei.prototype,"focusPriority",2),g([x(H)],ei.prototype,"showInLegend",2),g([x(T)],ei.prototype,"cursor",2),g([x(La)],ei.prototype,"nodeClickRange",2),g([x(P)],ei.prototype,"highlight",2),g([x(P)],ei.prototype,"highlightStyle",2);var fn={x:["xKey"],y:["yKey"]},mn={x:["xName"],y:["yName"]},Gh=class extends ao{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},ys=class extends ei{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};g([x(T,{optional:!0})],ys.prototype,"legendItemName",2),g([x(H,{optional:!0})],ys.prototype,"pickOutsideVisibleMinorAxis",2);var ol=100,_s=class extends Bh{constructor({pathsPerSeries:t=["path"],hasMarkers:e=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:a,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Gh,this.dataNodeGroup=this.contentGroup.appendChild(new Q({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new Q({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new ke({name:`${this.id}-series-labels`})),this.labelSelection=Wt.select(this.labelGroup,re),this.highlightSelection=Wt.select(this.highlightNode,()=>this.opts.hasMarkers?new le:this.nodeFactory()),this.highlightLabelSelection=Wt.select(this.highlightLabel,re),this.annotationSelections=new Set,this.debug=Dt.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,hasMarkers:e,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:a,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:r},this.paths=t.map(u=>new we({name:`${this.id}-${u}`})),this.datumSelection=Wt.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=Wt.select(this.markerGroup,le,r),this.animationState=new Xr("empty",{empty:{update:{target:"ready",action:u=>this.animateEmptyUpdateReady(u)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:u=>this.animateReadyHighlight(u),highlightMarkers:u=>this.animateReadyHighlightMarkers(u),resize:u=>this.animateReadyResize(u),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:u=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(u):this.animateWaitingUpdateReady(u)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:u=>this.resetAllAnimation(u),reset:"empty"},clearing:{update:{target:"empty",action:u=>this.animateClearingUpdateEmpty(u)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths,e,i)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths,e,i)}attachPaths(t,e,i){for(const s of t)this.contentGroup.appendChild(s)}detachPaths(t,e,i){for(const s of t)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>ol}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",t=>this.onLegendItemClick(t)),this.ctx.chartEventManager.addListener("legend-item-double-click",t=>this.onLegendItemDoubleClick(t)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:t}){const{visible:e,_contextNodeData:i}=this,n=this.ctx.highlightManager?.getActiveHighlight()?.series===this,r=this.checkResize(t),o=this.updateHighlightSelection(n);this.updateSelections(e),this.updateNodes(o,n,e);const a=this.getAnimationData(t,i);a&&(r&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(t){var e;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!(!t&&i)&&!(!this.nodeDataRefresh&&!this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=s));const{dataModel:n,processedData:r}=this;n!==void 0&&r!==void 0&&this.dispatch("data-update",{dataModel:n,processedData:r})}this.updateSeriesSelections()}}updateSeriesSelections(t){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,r=this._contextNodeData;if(!r)return;const{nodeData:o,labelData:a,itemId:l}=r;this.updatePaths({seriesHighlighted:t,itemId:l,contextData:r,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s}))}updateNodes(t,e,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:r,hasHighlightedLabels:o}}=this,a=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=a||l,this.highlightGroup.visible=(a||l)&&e;const c=this.getOpacity();r?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),o&&this.updateLabelNodes({labelSelection:n});const{dataNodeGroup:h,markerGroup:u,datumSelection:d,labelSelection:p,markerSelection:f,paths:y,labelGroup:b}=this,{itemId:m}=this.contextNodeData??{};h.opacity=c,h.visible=a||l,b.visible=l,r&&(u.opacity=c,u.visible=l),b&&(b.opacity=c),this.updatePathNodes({seriesHighlighted:e,itemId:m,paths:y,opacity:c,visible:l,animationEnabled:a}),h.visible&&(this.updateDatumNodes({datumSelection:d,highlightedItems:t,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),r&&this.updateMarkerNodes({markerSelection:f,isHighlight:!1}))}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum&&s.itemId===e.itemId);return i.length===0?void 0:i}getHighlightData(t,e){return e?[e]:void 0}updateHighlightSelection(t){const{highlightSelection:e,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const n=this.ctx.highlightManager?.getActiveHighlight(),r=t&&n?.datum?n:void 0;let o,a;if(r!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:h}=s;a=this.getHighlightData(h,r),o=l?this.getHighlightLabelData(c,r):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:e}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const{width:t,height:e}=this.ctx.scene.canvas,i=new F(0,0,t,e);this.quadtree=new QS(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodeExactShape(t){const e=super.pickNodeExactShape(t);if(e)return e;const{x:i,y:s}=t,{opts:{hasMarkers:n}}=this;let r;const{dataNodeGroup:o,markerGroup:a}=this;if(r=o.pickNode(i,s),!r&&n&&(r=a?.pickNode(i,s)),r&&r.datum.missing!==!0)return{datum:r.datum,distance:0};for(const l of this.moduleMap.modules()){const{datum:c}=l.pickNodeExact(t)??{};if(c!=null&&c?.missing!==!0)return{datum:c,distance:0}}}pickNodeClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const r=s.x,o=s.y,a={x:e,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:u=NaN,y:d=NaN}={}}=h;if(isNaN(u)||isNaN(d)||!(r?.inRange(u)&&o?.inRange(d)))continue;const f=Math.max((a.x-u)**2+(a.y-d)**2,0);ff.direction);if(e&&c.length===0)return;const[h="x"]=c,u=[i,s];h!=="x"&&u.reverse();const d=[1/0,1/0];let p;for(const f of r.nodeData){const{x:y=NaN,y:b=NaN}=f.point??f.midPoint??{};if(isNaN(y)||isNaN(b)||f.missing===!0)continue;const m=[a?.inRange(y),l?.inRange(b)];if(h!=="x"&&m.reverse(),!m[0]||!o&&!m[1])continue;const M=[y,b];h!=="x"&&M.reverse();let S=!0;for(let v=0;vd[v]){S=!1;break}else I{const o=i?.[r]??r;return this.xCoordinateRange(s[o],n,o)})}domainForVisibleRange(t,e,i,s,n,r){const{processedData:o,dataModel:a}=this,[l,c]=s,h=this.keysOrValues(i);if(n){const f=this.visibleRange(i,s,r);return a.getDomainBetweenRange(this,e,f,o)}const u=e.map(f=>this.keysOrValues(f));let d=1/0,p=-1/0;return h.forEach((f,y)=>{const[b,m]=this.xCoordinateRange(f,0,y);if(!(mc))for(let M=0;Mp?[NaN,NaN]:[d,p]}domainForClippedRange(t,e,i,s){const{processedData:n,dataModel:r,axes:o}=this,l=eI(o[t==="x"?"y":"x"]);if(!l)return e.flatMap(f=>r.getDomain(this,f,"value",n));const c=this.keysOrValues(i);if(s){const f=iI(c.length,l,y=>c[y]);return r.getDomainBetweenRange(this,e,f,n)}const h=e.map(f=>this.keysOrValues(f)),u=l[0].valueOf(),d=l[1].valueOf(),p=[];return c.forEach((f,y)=>{const b=f.valueOf();if(bd)return;const m=h.map(M=>M[y]);b>=u&&p.push(...m),b<=d&&p.push(...m)}),p}countVisibleItems(t,e,i,s,n){const{dataModel:r,processedData:o}=this;if(!r||!o)return 1/0;const a=this.keysOrValues(t),l=e.map(I=>r.resolveColumnById(this,I,o)),c=this.axes.x,h=this.axes.y,u=this.shouldFlipXY(),d=c.range,p=h.range,f=(I,L,A)=>I[0]+(A-L[0])/(L[1]-L[0])*(I[1]-I[0]),y=f(d,c.visibleRange,i[0]),b=f(d,c.visibleRange,i[1]),m=f(p,h.visibleRange,u?s[0]:s[1]),M=f(p,h.visibleRange,u?s[1]:s[0]),S=Math.round((i[0]+(i[1]-i[0])/2)*a.length),v=0;return uf(0,a.length-1,S,n,I=>{let[L,A]=this.xCoordinateRange(a[I],v,I),[D,C]=this.yCoordinateRange(l.map(N=>N[I]),v,I);return!pt(L)||!pt(A)||!pt(D)||!pt(C)?!1:(u&&([L,A,D,C]=[D,C,L,A]),L>=y&&A<=b&&D>=m&&C<=M)})}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=i??[];if(e){const r=s;return this.updateMarkerSelection({nodeData:n,markerSelection:r})}else return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(t){return this.updateLabelSelection({labelData:t.items??[],labelSelection:t.highlightLabelSelection})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateMarkerSelection(t){return t.markerSelection}updateMarkerNodes(t){}updatePaths(t){t.paths.forEach(e=>e.visible=!1)}updatePathNodes(t){const{paths:e,opacity:i,visible:s}=t;for(const n of e)n.opacity=i,n.visible=s}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};e&&t.paths.forEach(i=>{de([i],e)})}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&de([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&de([t.labelSelection],e)}resetMarkerAnimation(t){const{marker:e}=this.opts?.animationResetFns??{};e&&this.opts.hasMarkers&&de([t.markerSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),this.resetMarkerAnimation(t),t.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){const{datum:e}=this.opts?.animationResetFns??{};e&&de([t],e)}animateReadyHighlightMarkers(t){const{marker:e}=this.opts?.animationResetFns??{};e&&de([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}:void 0}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof zh){const{range:e,domain:i}=t;return{type:"log",convert:s=>t.convert(s),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof yt){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Br){const{domain:e}=t;return{type:"category",domain:e,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(Bc)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}};function eI(t){let e,i;if(t instanceof Bs&&(Number.isFinite(t.min)||Number.isFinite(t.max))?(e=Number.isFinite(t.min)?t.min:void 0,i=Number.isFinite(t.max)?t.max:void 0):t instanceof gn&&(t.min!=null||t.max!=null)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function iI(t,e,i){const s=e[0].valueOf(),n=e[1].valueOf(),r=Ld(0,t-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l>=s});let o=Ad(0,t-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l<=n});return r==null||o==null?[0,0]:(o=Math.min(o+1,t),[r,o])}var sI=["top","right","bottom","left"],al=class nx extends nl{constructor(e,i){super(e,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(e,i){super.onAxisChange(e,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(e),s.setClipRect(e)}async processData(){await super.processData();for(const e of this.axes){const i=this.getSyncedDomain(e);i!=null&&e.setDomains(i)}this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}performLayout(e){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:r,visible:o}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=o,this.seriesRect=r,this.animationRect=e.layoutBox;const{x:a,y:l}=r;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const d of[i,s])d.translationX=Math.floor(a),d.translationY=Math.floor(l);else{const{translationX:d,translationY:p}=i;ts(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:d,translationY:p},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=r.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||n?c:void 0,{lastUpdateClipRect:u}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&u!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:u,to:c,onUpdate:d=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(e,{axes:this.axes.map(d=>d.getLayoutState()),series:{visible:o,rect:r,paddedRect:c},clipSeries:n})}updateAxes(e){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(e);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!n),this.clipAxis(r,s,e);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(e){let i,s,n=0;const r=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone()),n++>r){k.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(e,i){const s=new Map,n={};let r=!1,o=!1;for(const m of sI){const M=this.seriesArea.padding[m],S=this.axes.findLast(v=>v.position===m);S?S.seriesAreaPadding=M:i.shrink(M,m)}const a=(e.get("left")??0)+(e.get("right")??0),l=(e.get("top")??0)+(e.get("bottom")??0),c=this.buildCrossLinePadding(e);i.width<=a+c.hPadding||i.height<=l+c.vPadding?r=!0:i.shrink(c);const h=i.clone().shrink(Object.fromEntries(e));for(const m of this.axes){const{position:M="left",direction:S}=m;this.sizeAxis(m,h,M);const v=S==="y",{primaryTickCount:I,bbox:L}=m.calculateLayout(m.nice?n[S]:void 0);n[S]??(n[S]=I),o||(o=m.dataDomain.clipped||m.visibleRange[0]>0||m.visibleRange[1]<1),s.set(m.id,Math.ceil(m.thickness??(v?L?.width:L?.height)??0))}const u=Object.entries(ec(this.axes,m=>m.position??"left")),{width:d,height:p,pixelRatio:f}=this.ctx.scene,y=new Map,b=new Map;for(const[m,M]of u){let v=m==="left"||m==="right"?p%f:d%f,I=0;for(const L of M){b.set(L.id,v);const A=s.get(L.id)??0;I=Math.max(I,v+A),L.layoutConstraints.stacked&&(v+=A+nx.AxesPadding)}y.set(m,Math.ceil(I))}for(const[m,M]of u)this.positionAxes({axes:M,position:m,axisWidths:s,axisOffsets:b,axisAreaWidths:y,axisBound:i,seriesRect:h});return{clipSeries:o,seriesRect:h,axisAreaWidths:y,overflows:r}}buildCrossLinePadding(e){const i={top:0,right:0,bottom:0,left:0,hPadding:0,vPadding:0};this.axes.forEach(s=>{s.crossLines?.forEach(n=>{n.calculatePadding?.(i)})});for(const[s,n=0]of Object.entries(i))i[s]=Math.max(n-(e.get(s)??0),0);return i.hPadding=i.left+i.right,i.vPadding=i.top+i.bottom,i}clampToOutsideSeriesRect(e,i,s,n){const r=s==="x"?e.x:e.y,o=s==="x"?e.width:e.height;return n===1?Math.min(i,r+o):Math.max(i,r)}getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=i.getSyncedDomain(e);if(s&&e.dataDomain.domain.length){let n;const{domain:r}=e.scale;if(yt.is(e.scale)){const[o,a]=ue(s);n=o!==r[0]||a!==r[1]}else n=!Ri(s,r);n&&!this.skipSync&&i.updateSiblings()}return s}sizeAxis(e,i,s){const n=e instanceof Zn,r=s==="left"||s==="right",{width:o,height:a}=i,l=r?a:o;let c=0,h=l,{min:u,max:d}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:p,unit:f,align:y}=e.layoutConstraints;f==="px"?h=c+p:h=h*p/100,y==="end"&&(c=l-(h-c),h=l),r&&(n?[u,d]=[1-d,1-u]:[c,h]=[h,c]),e.range=[c,h],e.visibleRange=[u,d],e.gridLength=r?o:a}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:r,axisAreaWidths:o,seriesRect:a,position:l}=e,c=o.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let p=s[h];(l==="right"||l==="bottom")&&(d=-1,p+=h==="x"?s.width:s.height);for(const f of i){const y=o.get(u==="x"?"left":"top")??0,b=n.get(f.id)??0,m=r.get(f.id)??0;f.gridPadding=c-m-b,f.translation[u]=s[u]+y,f.translation[h]=this.clampToOutsideSeriesRect(a,p+d*(m+b),h,d)}}shouldFlipXY(){return this.series.every(e=>e instanceof _s&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&e.set(i,s)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const s of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const r=e.axisAreaWidths.get(s);if((n!=null||r!=null)&&n!==r)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),r=Math.ceil(e.line?.width??0);let{width:o,height:a}=i;switch(o+=e.direction==="x"?n:r,a+=e.direction==="y"?n:r,e.clipGrid(i.x,i.y,o,a),e.position){case"left":case"right":e.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":e.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);const{label:l,labelNodes:c,scale:h}=e;if(yt.is(h)&&l.enabled&&l.avoidCollisions&&c.length>1){const u=c.toSorted((y,b)=>y.translationY-b.translationY),d=u.at(-1),p=d.getBBox(),f=i.x+p.y+p.height<=s.x+s.width+this.padding.right;if(d.visible=f,f||e.visibleRange[0]>0||e.visibleRange[1]<1)u[0].visible=!0;else{const y=u[0].getBBox();u[0].visible=y.y>=0}}break}}};al.className="CartesianChart",al.type="cartesian",al.AxesPadding=15;var nI=al,rI={type:"chart",name:"cartesian",detect:Th,create(t,e){return new nI(t,e)}},Jf=Dt.create(!0,"opts"),po=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){return Jf.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await this.chart.waitForUpdate()})}async updateDelta(e){return Jf.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await this.chart.waitForUpdate()})}getOptions(){const e=te(this.chart.getOptions());for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){return this.chart.waitForUpdate()}async download(e){const i=await this.prepareResizedChart(this,e);try{i.chart.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){const i=await this.prepareResizedChart(this,{width:600,height:300,...e});try{return i.chart.toSVG()}finally{i.destroy()}}async getImageDataURL(e){const i=await this.prepareResizedChart(this,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const i=this.getEnabledOriginators();if(!i.includes(this.chart.ctx.legendManager)){await this.setStateOriginators(e,i);return}await this.setStateOriginators(e,i.filter(s=>s!==this.chart.ctx.zoomManager)),await this.setStateOriginators(e,[this.chart.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=null}async prepareResizedChart(e,i={}){const{chart:s}=e,n=i.width??s.width??s.ctx.scene.canvas.width,r=i.height??s.height??s.ctx.scene.canvas.height,o=e.getState(),a=_i.hasEnterpriseModules(),l={...s.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:r};i.width!=null&&i.height!=null&&(l.overrideDevicePixelRatio=1);const c=s.getOptions();a&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...s.chartOptions.specialOverrides},u={...s.chartOptions.optionMetadata},d=this.factoryApi.create(c,l,h,u);await d.setState(o),d.chart.ctx.zoomManager.updateZoom("chartProxy",s.ctx.zoomManager.getZoom()),d.chart.ctx.legendManager.clearData(),d.chart.ctx.legendManager.update(s.ctx.legendManager.getData()),s.series.forEach((f,y)=>{f.visible||(d.chart.series[y].visible=!1)});const p=[];for(const f of s.modulesManager.legends())p.push(f.legend.pagination?.currentPage??0);for(const f of d.chart.modulesManager.legends()){const y=p.shift()??0;f.legend.pagination&&f.legend.pagination.setPage(y)}return d.chart.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),d}getEnabledOriginators(){const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:r,legendManager:o}}=this.chart,a=[];return"annotations"in e&&e.annotations?.enabled&&a.push(s),i.presetType==="price-volume"&&a.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&a.push(r),"legend"in this.chart&&a.push(o),a}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart.waitForUpdate()}};po.chartInstances=new WeakMap,g([Ve({oldValue(t){t.destroyed||(t.publicApi=void 0),po.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,po.chartInstances.set(t,this))}})],po.prototype,"chart",2);var tm=po,Vh=class extends za{constructor(t){super(),this.ctx=t,this.localeText=void 0}};g([Os(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),x(ap,{optional:!0})],Vh.prototype,"localeText",2),g([Os(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),x(Ne,{optional:!0})],Vh.prototype,"getLocaleText",2);var oI={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Vh(t)},em=class extends _r{getIndex(t){return super.getIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const e=JSON.stringify(t),i=this._domain.find(s=>JSON.stringify(s)===e);if(i!=null)return super.getIndex(i)}},go=new WeakMap;function ll(t,e){const i=JSON.stringify(t,null,0);return go.has(e)||go.set(e,new Map),go.get(e)?.has(i)||go.get(e)?.set(i,e(t)),go.get(e)?.get(i)}function Ee(t){const e=new Map,i=(...r)=>r.map(o=>typeof o=="object"||typeof o=="symbol"?o:(e.has(o)||e.set(o,{v:o}),e.get(o))),s={},n=new WeakMap;return(...r)=>{const o=r.length===0?[s]:i(...r);let a=n;for(const h of o.slice(0,-1))a.has(h)||a.set(h,new WeakMap),a=a.get(h);const l=o.at(-1);let c=a.get(l);return c||(c=t(...r),a.set(l,c)),c}}function cl(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function aI(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>cl(s)}}function im(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:i=>cl(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s),round:!0}}function lI(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>Fs.extendDomain(s)}}function Uh(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,i=[0,0])=>(i[0]+=e?.[0]??0,i[1]+=e?.[1]??0,i)}}function sm(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:s=>cl(s),groupAggregateFunction:(s,n=[0,0,-1])=>(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0,n[2]++,n),finalFunction:(s=[0,0,0])=>{const n=s[0]+s[1];return n>=0?[0,n/s[2]]:[n/s[2],0]},round:!0}}function Yh(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,r=[])=>{const o=r[1]-r[0];return e.aggregateFunction(n).map(a=>a/o)},round:!0};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function nm(t){return()=>{let e=0;return i=>pt(i)?(e+=t?Math.max(0,i):i,e):i}}function rm(){return()=>{let t=0;return e=>{if(!pt(e))return e;const i=t;return t+=e,i}}}function om(t){return t!=null&&wa(t)}function cI(t){return t!=null}function am(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return om;default:return cI}}function lm(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function wi(t,e,i={}){return{property:t,type:"key",valueType:lm(e),validation:am(e),...i}}function at(t,e,i={}){return{property:t,type:"value",valueType:lm(e),validation:am(e),...i}}function cm(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...e}}function Wh(t,e={}){const{min:i=-1/0,max:s=1/0,...n}=e;return{type:"value",property:t,valueType:"range",validation:om,processor:()=>r=>pt(r)?it(i,r,s):r,...n}}function fo(t,e,i={}){const{onlyPositive:s,...n}=i;return{...at(t,e,n),processor:nm(s)}}function hI(t,e,i={}){return{...at(t,e,i),processor:rm()}}function Gs(t,e,i,s,n){return[at(t,n,s),fm(s.groupId,e,i,s.separateNegative),...s.rangeId!=null?[lI(s.rangeId,s.groupId)]:[]]}function hm(t,e,i){return[at(t,e,i),mm(i.groupId)]}var um={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n{let t=NaN;return(e=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n>e?n:e}}},pm={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>t?.slice().sort((e,i)=>{for(let s=0;s{if(s===0)return null;const n=(i??0)*t/s;return n>=0?Math.min(t,n):Math.max(-t,n)};return()=>()=>(i,s,n)=>{const r=dI(i,s,n);for(const o of s)for(const a of n.datumIndices[o]){const l=i[o],c=l[a];if(c==null){l[a]=void 0;continue}l[a]=typeof c=="number"?e(c,r):c.map(h=>e(h,r))}}}function dI(t,e,i){const s=[0,0];for(const n of e){const r=t[n];for(const o of i.datumIndices[n]){const a=r[o];if(a==null)continue;const l=typeof a=="number"?a:Math.max(...a.map(h=>h??0)),c=l<0?0:1;c===0?s[c]=Math.min(s[c],l):s[c]=Math.max(s[c],l)}}return Math.max(Math.abs(s[0]),s[1])}function hl(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:ll({normaliseTo:e},uI)}}function pI({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],r=(o,a,l)=>{const c=t[0]+(o-a)/l*n;return l===0?e:c>=t[1]?t[1]:c(o,a)=>{let[l,c]=o.domain.values[a];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;o.domain.values[a]=[t[0],t[1]];const u=o.columns[a];for(let d=0;d{let n=mo|ul;if(e.valueType==="category")return i.length!==t&&(n&=~mo),n;let r=s[0]?.valueOf();for(let o=1;n!==0&&oa)&&(n&=~ul),Number.isFinite(a)&&r===a&&(n&=~mo),r=a}return n};function cr(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:{count:n},domain:{keys:r,values:o},keys:a,columns:l}=e;let c=mo|ul;if(n!==0){for(let h=0;c!==0&&h()=>(i,s,n)=>{const r=[0,0];for(const o of s)for(const a of n.datumIndices[o]??[]){const l=i[o],c=l[a],h=aa(c)&&e?0:1;pt(c)&&(t==="normal"&&(r[h]+=c),l[a]=r[h],t==="trailing"&&(r[h]+=c))}}}function fI({mode:t,sum:e}){return()=>{const i=[];let s=!0;return()=>(n,r,o)=>{let a=0;for(const l of r){const c=n[l];for(const h of o.datumIndices[l]??[]){const u=c[h],d=s&&e==="current"?0:i[l];i[l]=u;const p=e==="current"?u:d;if(!pt(u)||!pt(d)){c[h]=a;continue}t==="normal"&&(a+=p),c[h]=a,t==="trailing"&&(a+=p)}}s=!1}}}function fm(t,e,i,s=!1){let n;if(e.startsWith("window")){const r=e.endsWith("-trailing")?"trailing":"normal";n=ll({mode:r,sum:i},fI)}else n=ll({mode:e,separateNegative:s},gI);return{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function mI(){return()=>(t,e,i)=>{const s=new Float64Array(e.length);let n=0;for(const r of e){const o=t[r];for(const a of i.datumIndices[r]??[]){const l=o[a];s[n]=Number.isFinite(l)?l:NaN,n+=1,o[a]=s.subarray(0,n)}}}}function mm(t){return{type:"group-value-processor",matchGroupIds:[t],adjust:mI}}function ym(t){return t.id??t.property}function yI(t,e,i){const s=new Map,n=e.defs.values;for(let a=0;a0||a.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...n,[t]:b}}}}function Kt(t,...e){let i;return Ct(t)?i=t.map(n=>Wc(n)).join("___"):i=Wc(t),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var xI=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){t>this.right&&(this.right=t),tthis.bottom&&(this.bottom=e),ec.label===r);if(l&&o)s=l;else{const c=new rx(r,s,i);c.index=a.length,a.push(c),o&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,i)=>i!==this.index)??[]}};function MI(t){const e=t.reduce((s,n)=>s=0?t.ancestor:i}function II({children:t}){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const n=t[s];n.prelim+=e,n.mod+=e,i+=n.change,e+=n.shift+i}}function DI(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,r=i,o=n.getLeftmostSibling(),a=n.mod,l=s.mod,c=r.mod,h=o.mod;for(;r.nextRight()&&n.nextLeft();){r=r.nextRight(),n=n.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=t;const u=r.prelim+c-(n.prelim+a)+1;u>0&&(vI(SI(r,t,e),t,u),a+=u,l+=u),c+=r.mod,a+=n.mod,h+=o.mod,l+=s.mod}r.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!o.nextLeft()&&(o.mod+=a-h),e=t)}return e}function xm(t){const{children:e}=t;if(e.length){let[i]=e;for(const r of e)xm(r),i=DI(r,i);II(t);const s=(e[0].prelim+e.at(-1).prelim)/2,n=t.getLeftSibling();n?(t.prelim=n.prelim+1,t.mod=t.prelim-s):t.prelim=s}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function bm(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.insertNode(t);for(const s of t.children)bm(s,e+t.mod,i)}function Mm(t){const{children:e}=t;let i=0;for(const s of e)Mm(s),s.children.length?i+=s.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[e.length-1].subtreeRight,t.x=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.x,t.subtreeRight=t.x)}function AI(t){const e=new LI,i=MI(t);return xm(i),bm(i,-i.prelim,e),Mm(i),e}var LI=class{constructor(){this.dimensions=new xI,this.nodes=[],this.depth=0}insertNode(t){this.depth0){const{left:s,right:n}=this.dimensions;i=t/(n-s)}return e&&(i*=-1),i}},xs=class extends et{constructor(){super(...arguments),this.enabled=!0}};g([x(H)],xs.prototype,"enabled",2),g([x(H,{optional:!0})],xs.prototype,"avoidCollisions",2),g([x(gt,{optional:!0})],xs.prototype,"color",2),g([x(R,{optional:!0})],xs.prototype,"spacing",2),g([x(ss,{optional:!0})],xs.prototype,"fontStyle",2),g([x(ns,{optional:!0})],xs.prototype,"fontWeight",2),g([x(ut.restrict({min:1}),{optional:!0})],xs.prototype,"fontSize",2),g([x(T,{optional:!0})],xs.prototype,"fontFamily",2);var dl=class extends et{constructor(){super(...arguments),this.enabled=!0}};g([x(H)],dl.prototype,"enabled",2),g([x(R,{optional:!0})],dl.prototype,"width",2),g([x(gt,{optional:!0})],dl.prototype,"stroke",2);var Kh=class extends et{constructor(){super(...arguments),this.label=new xs,this.tick=new dl}};g([x(P)],Kh.prototype,"label",2),g([x(P)],Kh.prototype,"tick",2);var ur=class extends Zn{constructor(t){super(t,new em),this.tickScale=new em,this.depthOptions=new Gr(Kh),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:t}=this.tickTreeLayout,{range:e,step:i,inset:s,bandwidth:n}=this.scale,r=Math.abs(e[1]-e[0])-i,o=this.tickTreeLayout.scalingX(r,e[0]>e[1]),a=s+n/2;let l=0;for(const c of t){const h=c.x*o;l>h&&(l=h),c.screenX=h+a}for(const c of t)c.screenX-=l}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this;for(let n=0;nt.setProperties(e))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:F.zero,separatorLayout:[],tickLabelLayout:[]};const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n}=this,{depth:r,nodes:o}=this.tickTreeLayout,a=Math.ceil(i.fontSize/t),l=Jt(this.rotation),c=this.position==="top"||this.position==="bottom",h=i.getSideFlag(),u=[],d=new Map,p=new Wn,{defaultRotation:f,configuredRotation:y}=ka({rotation:i.rotation,parallel:i.parallel,regularFlipRotation:Tt(l-Math.PI/2),parallelFlipRotation:Tt(l)}),b=f+y,m=this.getDepthOptionsMap(r),M=(Y,X)=>{const J=r-Y.depth;if(!m[J]?.enabled||X%a!==0||!jd(Y.screenX,s))return!1;const st=this.formatTick(Y.label,X-1),K=this.getLabelStyles({value:st,depth:J},n[J]?.label);return p.setProperties({...K,text:st,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",rotation:0,translationX:0,translationY:Y.screenX}),!0};let S=0;const v={};o.forEach((Y,X)=>{const J=r-Y.depth,st=bx(Y.label);if(v[J]??(v[J]=1),v[J]{let X=S;for(let J=1;J<=Y;J++)X+=m[J].spacing,(i.mirrored||J!==Y)&&(X+=v[J]*m[J].lineHeight);return X};o.forEach((Y,X)=>{if(X===0)return;const J=M(Y,X),st=!Y.children.length,K=r-Y.depth;if(Y.parent){const G=st?Y.x:Y.x-(Y.leafCount-1)/2;if(!A.has(G)){const $=this.depthOptions[K]?.tick;let Z=S;for(let q=0;q<=K;q++)Z+=m[q].spacing,q!==0&&(Z+=v[q]*m[q].lineHeight);A.set(G,{tickSize:Z,tickStroke:$?.stroke,tickWidth:$?.enabled!==!1?$?.width:0})}}if(!J)return;if(p.x=L,p.y=0,st){const{width:G}=d.get(X),$=Dp(b);p.rotation=b,p.textAlign="end",p.textBaseline="middle",p.rotationCenterX=L-G/2,p.translationX=(m[K].spacing-G)/2*$*h,i.mirrored&&(p.translationX+=G)}else p.rotation=c?f:-Math.PI/2,p.rotationCenterX=L,p.translationX=h*D(K);if(m[K].avoidCollisions){const G=st?t:Y.leafCount*t;if(p.getBBox().height>G){d.delete(X);return}}const{text:z=""}=p;u.push({text:z,visible:!0,range:this.scale.range,tickId:I(z),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,textAlign:p.textAlign,textBaseline:p.textBaseline,translationX:p.translationX,translationY:p.translationY,x:p.x,y:p.y}),d.set(X,Ft.toCanvas(p))});const{enabled:C,stroke:N,width:w}=this.line;this.lineNode.datum={x:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:N,strokeWidth:C?w:0});const O=[...A.values()];O.push(O[0]);const B=[this.lineNode.getBBox(),new F(0,0,O[0].tickSize*h,0)];e.enabled&&(this.updateTitle(!1,O[0].tickSize),B.push(e.caption.node.getBBox()));const rt=F.merge(tn(d.values(),B));return{bbox:this.getTransformBox(rt),separatorLayout:O,tickLabelLayout:u}}update(){if(!this.computedLayout)return;const{tickScale:t,gridLine:e,gridLength:i}=this,{separatorLayout:s}=this.computedLayout,n=t.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).map((r,o)=>({...s[o],tick:r,tickId:Kt(r,o),tickLabel:r.filter(Boolean).join(" - "),translationY:Math.round(t.convert(r))}));this.gridLineGroupSelection.update(e.enabled&&i?n:[]),this.tickLineGroupSelection.update(this.tick.enabled?n:[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:t,tickLabelLayout:e,bbox:i}=this.computeLayout();return this.computedLayout={separatorLayout:t,tickLabelLayout:e},{bbox:i,primaryTickCount:void 0,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:t}=this,e=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(t));this.dataDomain={domain:fs(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>Qo(he(n)&&"value"in n?n.value:n));this.tickTreeLayout=AI(i);const s=[];for(const n of this.tickTreeLayout.nodes)n.leafCount||n.refId==null||s.push(this.dataDomain.domain[n.refId]);return this.scale.domain=gx(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]]),{animatable:!0}}updateGridLines(){if(!this.gridLength)return;const{width:t,style:e}=this.gridLine,i=this.gridLength*-this.label.getSideFlag();this.gridLineGroupSelection.each((s,n,r)=>{const{stroke:o,lineDash:a}=e[r%e.length],l=n.translationY;s.visible=this.inRange(l),s.x1=0,s.x2=i,s.y=l,s.stroke=o,s.strokeWidth=t,s.lineDash=a})}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=Ct(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}};ur.className="GroupedCategoryAxis",ur.type="grouped-category",g([x(vc)],ur.prototype,"depthOptions",2);var vm=Mt(t=>ni(t)&&t!==0,"a non-zero number"),xn=class extends Bs{constructor(t){super(t,new zh),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=Fh(t,e,i);return s[0]<0&&s[1]>0||t[0]<0&&t[1]>0?(k.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):s[0]===0||s[1]===0||t[0]===0||t[1]===0?(k.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:s,clipped:n}}set base(t){this.scale.base=t}get base(){return this.scale.base}defaultDatumFormatter(t,e){return String(t)}defaultLabelFormatter(t,e){return String(t)}};xn.className="LogAxis",xn.type="log",g([x(zi(Un,vm,Ur("max"))),Rs(NaN)],xn.prototype,"min",2),g([x(zi(Un,vm,Yr("min"))),Rs(NaN)],xn.prototype,"max",2);var yo=(t,{x0:e,y0:i,x1:s,y1:n,cx:r,cy:o},a,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-o,e-r),h=Math.atan2(n-o,s-r);t.arc(r,o,a,c,h)}else t.lineTo(e,i)},Sm=1e-6,pl=(t,e,i,s,n)=>{let r=!1,o=!1,a=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return a>t?(r=!0,a=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):ae?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):h{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(a+h,l+c),d=Math.max(a+l,h+c);if(u<=0&&d<=0){o==null?t.rect(e,i,s,n):t.rect(o.x,o.y,o.width,o.height);return}else if(o==null&&a===l&&a===c&&a===h){t.roundRect(e,i,s,n,a);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(o==null)o=new F(e,i,s,n);else{const A=Math.max(e,o.x),D=Math.min(e+s,o.x+o.width),C=Math.max(i,o.y),N=Math.min(i+n,o.y+o.height);o=new F(A,C,D-A,N-C)}const p=Math.max(u/n,d/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let f=!0,y=!0,b=!0,m=!0,M,S,v,I;if(f){const A=pl(o.height,o.width,Math.max(e+a-o.x,0),Math.max(i+a-o.y,0),a);A.leadingClipped&&(m=!1),A.trailingClipped&&(y=!1);const D=Math.max(o.x+A.leading1,o.x),C=Math.max(o.y+A.leading0,o.y),N=Math.max(o.x+A.trailing1,o.x),w=Math.max(o.y+A.trailing0,o.y),O=e+a,B=i+a;M={x0:D,y0:C,x1:N,y1:w,cx:O,cy:B}}if(y){const A=pl(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+s-l),0),l);A.leadingClipped&&(f=!1),A.trailingClipped&&(b=!1);const D=Math.min(o.x+o.width-A.leading0,o.x+o.width),C=Math.max(o.y+A.leading1,o.y),N=Math.min(o.x+o.width-A.trailing0,o.x+o.width),w=Math.max(o.y+A.trailing1,o.y),O=e+s-l,B=i+l;S={x0:D,y0:C,x1:N,y1:w,cx:O,cy:B}}if(b){const A=pl(o.height,o.width,Math.max(o.x+o.width-(e+s-c),0),Math.max(o.y+o.height-(i+n-c),0),c);A.leadingClipped&&(y=!1),A.trailingClipped&&(m=!1);const D=Math.min(o.x+o.width-A.leading1,o.x+o.width),C=Math.min(o.y+o.height-A.leading0,o.y+o.height),N=Math.min(o.x+o.width-A.trailing1,o.x+o.width),w=Math.min(o.y+o.height-A.trailing0,o.y+o.height),O=e+s-c,B=i+n-c;v={x0:D,y0:C,x1:N,y1:w,cx:O,cy:B}}if(m){const A=pl(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(e+h-o.x,0),h);A.leadingClipped&&(b=!1),A.trailingClipped&&(f=!1);const D=Math.max(o.x+A.leading0,o.x),C=Math.min(o.y+o.height-A.leading1,o.y+o.height),N=Math.max(o.x+A.trailing0,o.x),w=Math.min(o.y+o.height-A.trailing1,o.y+o.height),O=e+h,B=i+n-h;I={x0:D,y0:C,x1:N,y1:w,cx:O,cy:B}}let L=!1;f&&M!=null&&(yo(t,M,a,!L),L||(L=!0)),y&&S!=null&&(yo(t,S,l,!L),L||(L=!0)),b&&v!=null&&(yo(t,v,c,!L),L||(L=!0)),m&&I!=null&&yo(t,I,h,!L),t.closePath()},Se=class extends we{constructor(){super(...arguments),this.borderPath=new lo,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=ci.defaultStyles.strokeWidth,this.effectiveStrokeWidth=ci.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:o}=this;let{x:a,y:l,width:c,height:h,strokeWidth:u,clipBBox:d}=this;const f=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(t.clear(!0),e.clear(!0),i&&(c<=f&&(y*=c/f),h<=f&&(y*=h/f),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),d=d!=null?new F(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(c0?s-u:0,topRight:n>0?n-u:0,bottomRight:r>0?r-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,c>0&&h>0&&(m==null||m?.width>0&&m?.height>0)&&(gl(t,a,l,c,h,M,m),gl(e,a,l,c,h,M,m))}else this.borderClipPath=this.borderClipPath??new lo,this.borderClipPath.clear(!0),this.borderClipPath.rect(a,l,c,h),e.rect(a,l,c,h);else{const b={topLeft:s,topRight:n,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,gl(t,a,l,c,h,b,d)}if([s,n,r,o].every(b=>b===0)){const b=this.getBBox();this.hittester=b.containsPoint.bind(b),this.distanceSquared=(m,M)=>this.getBBox().distanceSquared(m,M)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=y}computeBBox(){const{x:t,y:e,width:i,height:s,clipBBox:n}=this;return n?.clone()??new F(t,e,i,s)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAlpha(t){const{fillOpacity:e,microPixelEffectOpacity:i,opacity:s}=this;t.globalAlpha*=s*e*i}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:s}=t,{strokeOpacity:n,lineDash:r,lineDashOffset:o,lineCap:a,lineJoin:l,borderPath:c,borderClipPath:h,opacity:u,microPixelEffectOpacity:d}=this;h&&t.clip(h.getPath2D()),this.applyStroke(t),t.globalAlpha*=u*n*d,t.lineWidth=i,r&&t.setLineDash(r),o&&(t.lineDashOffset=o),a&&(t.lineCap=a),l&&(t.lineJoin=l),t.stroke(c.getPath2D()),t.globalAlpha=s}}};Se.className="Rect",g([tt()],Se.prototype,"x",2),g([tt()],Se.prototype,"y",2),g([tt()],Se.prototype,"width",2),g([tt()],Se.prototype,"height",2),g([tt()],Se.prototype,"topLeftCornerRadius",2),g([tt()],Se.prototype,"topRightCornerRadius",2),g([tt()],Se.prototype,"bottomRightCornerRadius",2),g([tt()],Se.prototype,"bottomLeftCornerRadius",2),g([tt()],Se.prototype,"clipBBox",2),g([tt()],Se.prototype,"crisp",2);var dr=class extends za{constructor(t){super(),this.ctx=t,this.rectNode=new Se,this.textNode=new re,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(t.scene.attachNode(this.node),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new Q({name:"background",zIndex:0})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};g([x(H),pe("node","visible")],dr.prototype,"visible",2),g([x(gt,{optional:!0}),pe("rectNode","fill")],dr.prototype,"fill",2),g([x(P,{optional:!0})],dr.prototype,"image",2),g([x(T,{optional:!0}),pe("textNode")],dr.prototype,"text",2);var Im={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new dr(t)};function CI({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:r=0,forceResult:o=!1}){const a=t==="horizontal",l={max:a?s:i,fn:a?d=>d.width:d=>d.height,padding:a?r:n},c={max:a?i:s,fn:a?d=>d.height:d=>d.width,padding:a?n:r};let h=0;const u=[];for(;h=1;){const l=TI(t,e,a,i,s,n);if(l==null&&a<=1)return;if(l==null){a--;continue}if(typeof l=="number"){if(l<=1)return;a=l1?l:a,a--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function TI(t,e,i,s,n,r){const o=[];let a=0,l=0,c=[];const h=[];for(let u=0;u0&&o.push(c),c=[]);const p=s.fn(t[u])+s.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,n.fn(t[u])+n.padding);const f=a+l,y=!r||o.length>0;if(f>n.max&&y){c=[];break}if(h.reduce((m,M)=>m+M,0)>s.max&&!r)return h.length0&&o.push(c),o.length>0?o:void 0}function kI(t,e,i,s,n){let r=0,o=0;return{pages:t.map(l=>{e==="horizontal"&&(l=wI(l));let c=0;const h=l.map(p=>{const f=p.map(m=>(c=Math.max(m,c),i[m]));let y=0,b=0;return f.forEach(m=>{y+=m.height+s,b=Math.max(b,m.width+n)}),{indices:p,bboxes:f,columnHeight:Math.ceil(y),columnWidth:Math.ceil(b)}});let u=0,d=0;return h.forEach(p=>{u+=p.columnWidth,d=Math.max(d,p.columnHeight)}),r=Math.max(u,r),o=Math.max(d,o),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:r,maxPageHeight:o}}function wI(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((i,s)=>{i.forEach((n,r)=>{e[r][s]=n})}),e}function EI(t,e){const i=t.length;let s=0;for(let n=0;ne.max)return i/n<2?Math.ceil(i/2):n;return i}var pr=class extends et{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([x(gt)],pr.prototype,"color",2),g([x(ss,{optional:!0})],pr.prototype,"fontStyle",2),g([x(ns,{optional:!0})],pr.prototype,"fontWeight",2),g([x(R)],pr.prototype,"fontSize",2),g([x(T)],pr.prototype,"fontFamily",2);var bs=class extends et{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};g([x(R)],bs.prototype,"size",2),g([x(gt,{optional:!0})],bs.prototype,"fill",2),g([x(xt,{optional:!0})],bs.prototype,"fillOpacity",2),g([x(gt,{optional:!0})],bs.prototype,"stroke",2),g([x(R)],bs.prototype,"strokeWidth",2),g([x(xt)],bs.prototype,"strokeOpacity",2);var fl=class extends et{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};g([Ve({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],fl.prototype,"shape",2),g([x(R)],fl.prototype,"size",2),g([x(R)],fl.prototype,"padding",2);var bn=class extends et{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=oi(this),this.marker=new fl(this),this.activeStyle=new bs,this.inactiveStyle=new bs,this.highlightStyle=new bs,this.label=new pr,this.group=new ke({name:"pagination"}),this.labelNode=new re,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 le,this.previousButton=new le,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(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(t){switch(this._orientation=t,t){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateNextButtonPosition(){const t=this.labelNode.getBBox();this.nextButton.translationX=t.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:r,fontSize:o,fontFamily:a}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=r,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:r,highlightStyle:o,highlightActive:a}=this,l=(c,h)=>h?r:c===a?o:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){const{shape:i,size:s}=this.marker;t.shape=i,t.size=s,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,s=t===e-1,n=t===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=it(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback(6)}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(6)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=Ft.toCanvas(this.previousButton),e=Ft.toCanvas(this.nextButton);return{prev:t,next:e}}};bn.className="Pagination",g([x(P)],bn.prototype,"marker",2),g([x(P)],bn.prototype,"activeStyle",2),g([x(P)],bn.prototype,"inactiveStyle",2),g([x(P)],bn.prototype,"highlightStyle",2),g([x(P)],bn.prototype,"label",2);var $h=class extends et{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}},OI=new Set(["circle","cross","diamond","heart","pin","plus","square","star","triangle"]);function RI(t){return typeof t=="string"&&OI.has(t)}var Zh=Mt(t=>RI(t)||typeof t=="function","a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Ie=class extends $h{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};g([x(H),j()],Ie.prototype,"enabled",2),g([x(Zh),j()],Ie.prototype,"shape",2),g([x(R),j()],Ie.prototype,"size",2),g([x(gt,{optional:!0}),j()],Ie.prototype,"fill",2),g([x(xt),j()],Ie.prototype,"fillOpacity",2),g([x(gt,{optional:!0}),j()],Ie.prototype,"stroke",2),g([x(R),j()],Ie.prototype,"strokeWidth",2),g([x(xt),j()],Ie.prototype,"strokeOpacity",2),g([x(Fi)],Ie.prototype,"lineDash",2),g([x(R)],Ie.prototype,"lineDashOffset",2),g([x(Ne,{optional:!0}),j()],Ie.prototype,"itemStyler",2);function xo(t,e,i){t.fill=i?.fill??e.fill,t.fillOpacity=i?.fillOpacity??e.fillOpacity??1,t.stroke=i?.stroke??e.stroke,t.strokeOpacity=i?.strokeOpacity??e.strokeOpacity??1,t.strokeWidth=i?.strokeWidth??e.strokeWidth??0,t.lineDash=i?.lineDash??e.lineDash,t.lineDashOffset=i?.lineDashOffset??e.lineDashOffset??0}var PI=class{constructor(t,e){this.idPrefix=e,this.dirty=!0,this.destroyFns=new Rg,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=lt("p"),this.itemDescription.style.display="none",this.itemDescription.id=`${e}-ariaDescription`,this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:s,itemListener:n}=t,r=e.localeManager,o=i.length;i.each((a,l,c)=>{a.proxyButton?.destroy(),a.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(r,s.getItemLabel(l),c,o),ariaChecked:!!a.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=a.proxyButton;h.addListener("click",u=>n.onClick(u.sourceEvent,a.datum,h)),h.addListener("dblclick",u=>n.onDoubleClick(u.sourceEvent,a.datum)),h.addListener("mouseenter",u=>n.onHover(u.sourceEvent,a)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",u=>n.onContextClick(u.sourceEvent,a)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",u=>n.onHover(u.sourceEvent,a)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:s}){const n=Ft.toCanvas(e);this.itemList.setBounds(n);const r=Math.max(...t.nodes().map(o=>o.getBBox().height));t.each((o,a)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=Ft.toCanvas(o),p=(r-u)/2,f={x:c-n.x,y:h-p-n.y,height:r,width:d};o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(s&&l),o.proxyButton.setBounds(f)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{ctx:r,oldPages:o,newPages:a}=t,l=(o?.length??a.length)>1,c=a.length>1;l!==c&&(c?(this.prevButton=r.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-prev-page`,textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",h=>this.onPageButton(t,h,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=r.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-next-page`,textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",h=>this.onPageButton(t,h,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:n}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(n),this.prevButton?.setEnabled(i.currentPage!==0),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,s,n)=>{const[r,o]=[e[s],t[s]];return r.id!==o.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},r,o)=>{const a=n?.getElement();if(a!=null){const l=i.getItemLabel(r);a.textContent=this.getItemAriaText(t,l,o,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,s){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:s})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}};function Dm(t,e,i,s){const n={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var di=class extends ln(Q){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Q({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new re),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new le({zIndex:1})),this.line=this.symbolsGroup.appendChild(new ti({zIndex:0}));const{label:t,line:e,symbolsGroup:i}=this;e.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,r=0;if(t.visible){const{size:o}=t,a=le.anchor(t.shape);n=(a.x-.5)*o+i/2,r=(a.y-.5)*o,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=r):(t.x=n,t.y=r,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e}=this;this.label.x=t+e}computeBBox(){return this.layout(),super.computeBBox()}};di.className="MarkerLabel",g([pe("label")],di.prototype,"text",2),g([pe("label")],di.prototype,"fontStyle",2),g([pe("label")],di.prototype,"fontWeight",2),g([pe("label")],di.prototype,"fontSize",2),g([pe("label")],di.prototype,"fontFamily",2),g([pe("label","fill")],di.prototype,"color",2),g([Os(t=>t.layoutLabel())],di.prototype,"spacing",2),g([Os(t=>t.layoutLabel())],di.prototype,"length",2),g([j()],di.prototype,"isCustomMarker",2);var Vs=class extends et{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([x(R,{optional:!0})],Vs.prototype,"maxLength",2),g([x(gt)],Vs.prototype,"color",2),g([x(ss,{optional:!0})],Vs.prototype,"fontStyle",2),g([x(ns,{optional:!0})],Vs.prototype,"fontWeight",2),g([x(R)],Vs.prototype,"fontSize",2),g([x(T)],Vs.prototype,"fontFamily",2),g([x(Ne,{optional:!0})],Vs.prototype,"formatter",2);var gr=class extends et{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};g([x(Zh,{optional:!0})],gr.prototype,"shape",2),g([x(R)],gr.prototype,"size",2),g([x(R)],gr.prototype,"padding",2),g([x(R,{optional:!0})],gr.prototype,"strokeWidth",2),g([x(H)],gr.prototype,"enabled",2);var Xh=class extends et{};g([x(R,{optional:!0})],Xh.prototype,"strokeWidth",2),g([x(R,{optional:!0})],Xh.prototype,"length",2);var Us=class extends et{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new gr,this.label=new Vs,this.line=new Xh}};g([x(R,{optional:!0})],Us.prototype,"maxWidth",2),g([x(R)],Us.prototype,"paddingX",2),g([x(R)],Us.prototype,"paddingY",2),g([x(H)],Us.prototype,"showSeriesStroke",2),g([x(P)],Us.prototype,"marker",2),g([x(P)],Us.prototype,"label",2),g([x(P)],Us.prototype,"line",2);var Qh=class extends et{};g([x(Ne,{optional:!0})],Qh.prototype,"legendItemClick",2),g([x(Ne,{optional:!0})],Qh.prototype,"legendItemDoubleClick",2);var bo="legend-visibility",qh="legend-other-series",He=class extends et{constructor(t){super(),this.ctx=t,this.id=oi(this),this.group=new ke({name:"legend",zIndex:14}),this.itemSelection=Wt.select(this.group,di),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 Us,this.listeners=new Qh,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new bn(e=>t.updateService.update(e),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group),this.destroyFns.push(t.contextMenuRegistry.registerDefaultAction({id:bo,type:"legend",label:"contextMenuToggleSeriesVisibility",action:e=>this.contextToggleVisibility(e)}),t.contextMenuRegistry.registerDefaultAction({id:qh,type:"legend",label:"contextMenuToggleOtherSeries",action:e=>this.contextToggleOtherSeries(e)}),t.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(t.layoutManager.registerElement(1,e=>this.positionLegend(e)),t.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new PI(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){rn(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.enabled&&(this.data=t.filter(e=>!e.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(t=>t()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){if(this.orientation!==void 0)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{ctx:{callbackCache:e}}=this,{formatter:i}=this.item.label;if(i){const s=t.datum;return e.call(i,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...s&&{datum:s}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:r,label:{maxLength:o=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,u=[...this.data];this.reverseOrder&&u.reverse(),this.itemSelection.update(u);const d=[],p=Rt.toFontString(n),y=r??t*.8,b=this.calculateMarkerWidth();if(this.itemSelection.each((C,N)=>{C.fontStyle=a,C.fontWeight=l,C.fontSize=c,C.fontFamily=h;const w=this.updateMarkerLabel(C,N,b),O=N.itemId??N.id,rt=(this.getItemLabel(N)??"").replace(/\r?\n/g," ");C.text=this.truncate(rt,o,y,w,p,O),d.push(C.getBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return{};const m=this.size,M=this.oldSize;m[0]=t,m[1]=e,(m[0]!==M[0]||m[1]!==M[1])&&(M[0]=m[0],M[1]=m[1]);const{pages:S,maxPageHeight:v,maxPageWidth:I}=this.updatePagination(d,t,e),L=this.pages;this.pages=S,this.maxPageSize=[I-i,v-s];const A=this.pagination.currentPage,D=this.pages[A];return this.pages.length<1||!D?(this.visible=!1,{oldPages:L}):(this.visible=!0,this.updatePositions(A),this.update(),{oldPages:L})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0),n=!!(t.line&&e),r=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:r}}calcSymbolsLengths(t){const{marker:e,line:i}=this.item,{markerEnabled:s,lineEnabled:n}=this.calcSymbolsEnabled(t),{strokeWidth:r}=this.getMarkerStyles(t),{strokeWidth:o}=n?this.getLineStyles(t):{strokeWidth:0};let a;const{shape:l}=t.marker;if(this.isCustomMarker(s,l)){const u=new le;u.shape=l,u.updatePath();const d=u.getBBox();a=Math.max(d.width,d.height)}const c=s?e.size:0,h=n?i.length??25:0;return{markerLength:c,markerStrokeWidth:r,lineLength:h,lineStrokeWidth:o,customMarkerSize:a}}calculateMarkerWidth(){let t=0;return this.itemSelection.each((e,i)=>{const{symbol:s}=i,{markerLength:n,lineLength:r,customMarkerSize:o=-1/0}=this.calcSymbolsLengths(s);t=Math.max(t,r,o,n)}),t}updateMarkerLabel(t,e,i){const{marker:s,paddingX:n}=this.item,{symbol:r}=e;let o=n;const{markerEnabled:a,lineEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(r),h=s.padding;(a||l)&&(o+=h+i);const{marker:u,line:d}=t;return u.visible=a,u.visible&&(u.shape=s.shape??r.marker.shape??"square",u.size=s.size,xo(u,this.getMarkerStyles(r))),d.visible=l,d.visible&&xo(d,this.getLineStyles(r)),t.length=i,t.spacing=h,t.isCustomMarker=c,o}truncate(t,e,i,s,n,r){let o=!1;t.length>e&&(t=t.substring(0,e),o=!0);const a=os.getMeasurer({font:n}),l=Fc.truncateLine(t,a,i-s,o);return l.endsWith(Rt.EllipsisChar)?this.truncatedItems.add(r):this.truncatedItems.delete(r),l}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:r,maxPageHeight:o,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(t,e,i),h=r.findIndex(S=>S.endIndex>=n);this.pagination.currentPage=it(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,f=a-u,y=o-d;let b=0,m=-l.y-this.item.marker.size/2;c?m+=y+p:(b+=-l.x+f+p,m+=(y-l.height)/2),this.pagination.translationX=b,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let M=0;return this.itemSelection.each((S,v,I)=>{I>(r[M]?.endIndex??1/0)&&M++,S.pageIndex=M}),{maxPageHeight:o,maxPageWidth:a,pages:r}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,r=this.getOrientation(),o=["left","right"].includes(this.position);let a=this.pagination.getBBox(),l=new F(0,0,0,0),c=[],h=0,u=0,d=0;const p=y=>y.width===a.width&&y.height===a.height,f=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(d++>10){k.warn("unable to find stable legend layout.");break}a=l;const y=e-(o?0:a.width),b=i-(o?a.height:0),m=CI({orientation:r,bboxes:t,maxHeight:b,maxWidth:y,itemPaddingY:n,itemPaddingX:s,forceResult:f});c=m?.pages??[],h=m?.maxPageWidth??0,u=m?.maxPageHeight??0;const M=c.length;if(this.pagination.visible=M>1,this.pagination.totalPages=M,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:h,maxPageHeight:u,pages:c,paginationBBox:l,paginationVertical:o}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:r,endIndex:o}=s[t];let a=0,l=0;const c=n.length,h=n[0].indices.length,u=this.getOrientation()==="horizontal",d=n[0].bboxes[0].height+e,p=[];i.each((f,y,b)=>{if(bo){f.visible=!1;return}const m=b-r;let M,S;u?(M=m%c,S=Math.floor(m/c)):(M=Math.floor(m/h),S=m%h),f.visible=!0;const v=n[M];v&&(l=Math.floor(d*S),a=Math.floor(p[S]??0),p[S]=(p[S]??0)+v.columnWidth,f.translationX=a,f.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n,toggleSeries:r}=this,{startIndex:o,endIndex:a}=n[t];o===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((o+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:r}),this.ctx.updateService.update(6)}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const{toggleSeries:t,ctx:{contextMenuRegistry:e}}=this;t?(e.hideAction(bo),e.hideAction(qh)):(e.showAction(bo),e.showAction(qh))}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},r=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??r,lineDash:n}}getMarkerStyles(t){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:r,lineDash:o,lineDashOffset:a}=t.marker,l=Math.min(2,r??1);return{fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a}}computePagedBBox(){const t=Q.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[e,i]=this.maxPageSize;t.height=Math.max(i,t.height),t.width=Math.max(e,t.width)}return t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i)}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum)}onContextClick(t,e){const i=e.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.disableAction(bo):this.ctx.contextMenuRegistry.enableAction(bo);const{offsetX:s,offsetY:n}=t,{x:r,y:o}=Ft.toCanvasPoint(e,s,n);this.ctx.contextMenuRegistry.dispatchContext("legend",{sourceEvent:t,canvasX:r,canvasY:o},{legendItem:i})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:r},preventHidingAll:o,toggleSeries:a}=this;if(!e)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:u}=e,d=n.series.find(y=>y.id===c);if(!d)return!1;let p=u;const f=Dm("click",h,d.id,t);return s?.(f.apiEvent),f.defaultPrevented||(a&&(p=!u,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,d,h,p,e.legendItemName)),p?r.updateHighlight(this.id,{series:d,itemId:h,datum:void 0,datumIndex:void 0}):r.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(s.mode==="integrated"||!e)return!1;const{legendType:r,id:o,itemId:a,seriesId:l}=e,c=s.series.find(u=>u.id===o);if(!c)return!1;const h=Dm("dblclick",a,c.id,t);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(f=>f.getLegendData("category")),d=u.filter(f=>f.enabled).length,p=u.find(f=>f.itemId===a&&f.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(r,c,a,p?.enabled??!1,d,p?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;if(t instanceof FocusEvent){const{x:r,y:o}=Ft.toCanvas(e).computeCenter();i={type:"keyboard",canvasX:r,canvasY:o}}else{t.preventDefault();const{x:r,y:o}=Ft.toCanvasPoint(e,t.offsetX,t.offsetY);i={type:"pointermove",canvasX:r,canvasY:o}}const{canvasX:s,canvasY:n}=i;return{canvasX:s,canvasY:n,lastPointerEvent:i,showArrow:!1}}onHover(t,e){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,n,{type:"structured",title:this.getItemLabel(i)})}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(t){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,t):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=t,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{layoutBox:e}=t,{x:i,y:s,width:n,height:r}=e,[o,a]=this.calculateLegendDimensions(e),{oldPages:l}=this.calcLayout(o,a),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return r-c.height;case"right":default:return n-c.width}};if(this.visible){const u=this.spacing;let d,p;switch(this.position){case"top":case"bottom":d=(n-c.width)/2,p=h(),e.shrink(c.height+u,this.position);break;case"left":case"right":default:d=h(),p=(r-c.height)/2,e.shrink(c.width+u,this.position)}this.group.translationX=Math.floor(i+d-c.x),this.group.translationY=Math.floor(s+p-c.y)}return l}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:s,pages:n,toggleSeries:r,group:o,listeners:{legendItemClick:a,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=r||l!=null||a!=null;this.domProxy.update({visible:c,interactive:h,ctx:e,itemSelection:i,group:o,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/i,n=.5,r=.2,o=.25;let a,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(n,r*(1/s)):r;a=this.maxWidth?Math.min(this.maxWidth,e):e,l=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*c);break}case"left":case"right":default:{const c=s>1?Math.min(n,o*s):o;a=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[a,l]}};He.className="Legend",g([x(H)],He.prototype,"toggleSeries",2),g([x(P)],He.prototype,"pagination",2),g([x(P)],He.prototype,"item",2),g([x(P)],He.prototype,"listeners",2),g([Os((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),x(H)],He.prototype,"enabled",2),g([x(Sc)],He.prototype,"position",2),g([x(R,{optional:!0})],He.prototype,"maxWidth",2),g([x(R,{optional:!0})],He.prototype,"maxHeight",2),g([x(H,{optional:!0})],He.prototype,"reverseOrder",2),g([x(It(["horizontal","vertical"],"an orientation"),{optional:!0})],He.prototype,"orientation",2),g([x(H,{optional:!0})],He.prototype,"preventHidingAll",2),g([x(R)],He.prototype,"spacing",2);var jI={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new He(t),packageType:"community",removable:"standalone-only"},Am={};si(Am,{CARTESIAN_AXIS_TYPE:()=>Nm,CARTESIAN_POSITION:()=>Cm,FONT_SIZE:()=>Lm,FONT_SIZE_RATIO:()=>Jh,POLAR_AXIS_SHAPE:()=>km,POLAR_AXIS_TYPE:()=>Tm});var Lm=(t=>(t[t.SMALLEST=8]="SMALLEST",t[t.SMALLER=10]="SMALLER",t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=14]="LARGE",t[t.LARGEST=17]="LARGEST",t))(Lm||{}),Jh=(t=>(t[t.SMALLEST=.6666666666666666]="SMALLEST",t[t.SMALLER=.8333333333333334]="SMALLER",t[t.SMALL=1]="SMALL",t[t.MEDIUM=1.0833333333333333]="MEDIUM",t[t.LARGE=1.1666666666666667]="LARGE",t[t.LARGEST=1.4166666666666667]="LARGEST",t))(Jh||{}),Cm=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(Cm||{}),Nm=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(Nm||{}),Tm=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(Tm||{}),km=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(km||{}),tu={};si(tu,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Ao,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>No,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>To,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ko,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>wo,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Lo,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Co,DEFAULT_BACKGROUND_COLOUR:()=>ml,DEFAULT_CAPTION_ALIGNMENT:()=>Hs,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Ws,DEFAULT_COLOR_RANGE:()=>Sl,DEFAULT_DIVERGING_SERIES_COLOR_RANGE:()=>Ke,DEFAULT_FIBONACCI_STROKES:()=>Io,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>ee,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>_t,DEFAULT_FUNNEL_SERIES_COLOR_RANGE:()=>Yi,DEFAULT_GAUGE_SERIES_COLOR_RANGE:()=>pi,DEFAULT_GRIDLINE_ENABLED:()=>Wi,DEFAULT_HIERARCHY_FILLS:()=>Dl,DEFAULT_HIERARCHY_STROKES:()=>Al,DEFAULT_POLAR_SERIES_STROKE:()=>vl,DEFAULT_SEPARATION_LINES_COLOUR:()=>Mo,DEFAULT_SHADOW_COLOUR:()=>Ys,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Il,DEFAULT_TEXTBOX_COLOR:()=>Ro,DEFAULT_TEXTBOX_FILL:()=>Eo,DEFAULT_TEXTBOX_STROKE:()=>Oo,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Do,DEFAULT_TOOLBAR_POSITION:()=>Po,IS_COMMUNITY:()=>eu,IS_DARK_THEME:()=>fr,IS_ENTERPRISE:()=>iu,PALETTE_ALT_DOWN_FILL:()=>ou,PALETTE_ALT_DOWN_STROKE:()=>nu,PALETTE_ALT_NEUTRAL_FILL:()=>au,PALETTE_ALT_NEUTRAL_STROKE:()=>Ml,PALETTE_ALT_UP_FILL:()=>ru,PALETTE_ALT_UP_STROKE:()=>su,PALETTE_DOWN_FILL:()=>So,PALETTE_DOWN_STROKE:()=>xl,PALETTE_NEUTRAL_FILL:()=>bl,PALETTE_NEUTRAL_STROKE:()=>mr,PALETTE_UP_FILL:()=>vo,PALETTE_UP_STROKE:()=>yl});var fr=Symbol("is-dark-theme"),eu=Symbol("is-community"),iu=Symbol("is-enterprise"),Mo=Symbol("default-separation-lines-colour"),ml=Symbol("default-background-colour"),Ys=Symbol("default-shadow-colour"),Ws=Symbol("default-caption-layout-style"),Hs=Symbol("default-caption-alignment"),yl=Symbol("palette-up-stroke"),xl=Symbol("palette-down-stroke"),vo=Symbol("palette-up-fill"),So=Symbol("palette-down-fill"),mr=Symbol("palette-neutral-stroke"),bl=Symbol("palette-neutral-fill"),su=Symbol("palette-alt-up-stroke"),nu=Symbol("palette-alt-down-stroke"),ru=Symbol("palette-alt-up-fill"),ou=Symbol("palette-alt-down-fill"),au=Symbol("palette-gray-fill"),Ml=Symbol("palette-gray-stroke"),vl=Symbol("default-polar-series-stroke"),Ke=Symbol("default-diverging-series-colour-range"),Sl=Symbol("default-colour-range"),Il=Symbol("default-sparkline-crosshair-stroke"),pi=Symbol("default-gauge-series-colour-range"),Yi=Symbol("default-funnel-series-colour-range"),Dl=Symbol("default-hierarchy-fills"),Al=Symbol("default-hierarchy-strokes"),_t=Symbol("default-financial-charts-annotation-stroke"),Io=Symbol("default-hierarchy-strokes"),Do=Symbol("default-text-annotation-color"),ee=Symbol("default-financial-charts-annotation-background-fill"),Ao=Symbol("default-annotation-handle-fill"),Lo=Symbol("default-annotation-statistics-fill"),Co=Symbol("default-annotation-statistics-stroke"),No=Symbol("default-annotation-statistics-color"),To=Symbol("default-annotation-statistics-divider-stroke"),ko=Symbol("default-annotation-statistics-fill"),wo=Symbol("default-annotation-statistics-stroke"),Eo=Symbol("default-textbox-fill"),Oo=Symbol("default-textbox-stroke"),Ro=Symbol("default-textbox-color"),Po=Symbol("default-toolbar-position"),Wi=Symbol("default-gridline-enabled");function wm(t,e){return i=>e(i)?[{...t[0],position:t[1].position},{...t[1],position:t[0].position}]:t}function jo({takeColors:t}){const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}}function lu(t){return{marker:jo(t)}}function Ll(t,e,i,s,n){const{addPhaseFn:r,updatePhaseFn:o,removePhaseFn:a}=n,l=(c,h,u)=>{i.animate({id:`${t}_${e}_${h.id}_${c}`,groupId:t,from:0,to:1,ease:Rr,collapsable:!1,onUpdate(d,p){p&&c!=="removed"||(h.path.clear(!0),u(d,h),h.checkPathDirty())},onStop(){c==="added"&&(h.path.clear(!0),u(1,h),h.checkPathDirty())},phase:Si[c]})};for(const c of s)i.isSkipped()||(l("removed",c,a),l("updated",c,o)),l("added",c,r)}function ft({id:t},e,i,...s){ts(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Ks({id:t},e,i,...s){ts(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Ms(t){return{opacity:1}}var Ei=class extends $h{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};g([x(H),j()],Ei.prototype,"enabled",2),g([x(gt),j()],Ei.prototype,"color",2),g([x(ut),j()],Ei.prototype,"xOffset",2),g([x(ut),j()],Ei.prototype,"yOffset",2),g([x(R),j()],Ei.prototype,"blur",2);var Em=class extends et{constructor(){super(...arguments),this.enabled=!1}};g([x(H)],Em.prototype,"enabled",2);var De=class extends et{constructor(){super(...arguments),this.enabled=!0,this.interaction=new Em,this.position=new lr,this.range=void 0,this.class=void 0}formatTooltip(t,e){const i=this.renderer?.(e);return typeof i=="string"?{type:"raw",rawHtmlString:i}:i!=null?{type:"structured",...t,...i}:{type:"structured",...t}}};g([x(H)],De.prototype,"enabled",2),g([x(H,{optional:!0})],De.prototype,"showArrow",2),g([x(Ne,{optional:!0})],De.prototype,"renderer",2),g([x(P)],De.prototype,"interaction",2),g([x(P)],De.prototype,"position",2),g([x(La,{optional:!0})],De.prototype,"range",2),g([x(T,{optional:!0})],De.prototype,"class",2);var Om=It(["linear","smooth","step"],"a line style"),Rm=It(["start","middle","end"]),yr=class extends et{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};g([x(Om)],yr.prototype,"type",2),g([x(xt)],yr.prototype,"tension",2),g([x(Rm)],yr.prototype,"position",2);var $t=class extends ys{constructor(){super(...arguments),this.xName=void 0,this.defaultColorRange=[],this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new yr,this.shadow=new Ei,this.marker=new Ie,this.label=new oe,this.tooltip=new De,this.connectMissingData=!1}};g([x(T)],$t.prototype,"xKey",2),g([x(T,{optional:!0})],$t.prototype,"xName",2),g([x(T)],$t.prototype,"yKey",2),g([x(T,{optional:!0})],$t.prototype,"yName",2),g([x(T,{optional:!0})],$t.prototype,"yFilterKey",2),g([x(R,{optional:!0})],$t.prototype,"normalizedTo",2),g([x(qe)],$t.prototype,"defaultColorRange",2),g([x(Ts(hp,gt))],$t.prototype,"fill",2),g([x(xt)],$t.prototype,"fillOpacity",2),g([x(gt)],$t.prototype,"stroke",2),g([x(R)],$t.prototype,"strokeWidth",2),g([x(xt)],$t.prototype,"strokeOpacity",2),g([x(Fi)],$t.prototype,"lineDash",2),g([x(R)],$t.prototype,"lineDashOffset",2),g([x(P)],$t.prototype,"interpolation",2),g([x(P)],$t.prototype,"shadow",2),g([x(P)],$t.prototype,"marker",2),g([x(P)],$t.prototype,"label",2),g([x(P)],$t.prototype,"tooltip",2),g([x(H)],$t.prototype,"connectMissingData",2);function Hi(t){switch(t.type){case"linear":case"step":return[{x:t.x0,y:t.y0},{x:t.x1,y:t.y1}];case"cubic":return[{x:t.cp0x,y:t.cp0y},{x:t.cp3x,y:t.cp3y}]}}function zI(t){const e=Hi(t);return e[0].x>e[1].x&&e.reverse(),e}function FI(t,e){const{x:i,y:s}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function zo(t,e,i){const[s,n]=Hi(t),r=n.x!==s.x?(i.x-e.x)/(n.x-s.x):0,o=n.y!==s.y?(i.y-e.y)/(n.y-s.y):0;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:e.x,cp0y:e.y,cp1x:i.x-(t.cp2x-s.x)*r,cp1y:i.y-(t.cp2y-s.y)*o,cp2x:i.x-(t.cp1x-s.x)*r,cp2y:i.y-(t.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-s.x)*r}}}function Pm(t,e,i){const{moveTo:s}=t,[n,r]=zI(t),{x:o,y:a}=n,{x:l,y:c}=r;if(il)return zo(t,r,r);switch(t.type){case"linear":{const h=a===c?void 0:(c-a)/(l-o),u=h==null?a:h*(e-o)+a,d=h==null?a:h*(i-o)+a;return{type:"linear",moveTo:s,x0:e,y0:u,x1:i,y1:d}}case"step":if(i<=t.stepX){const h=t.y0;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:i}}else if(e>=t.stepX){const h=t.y1;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:e}}else{const{y0:h,y1:u,stepX:d}=t;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=el(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[u,d]=il(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const p=el(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=il(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:s,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}}}}function BI(t){const e=[];let i=0,s=NaN,n=NaN;for(const{x:r,y:o}of t){if(i>0){const a=i===1;e.push({type:"linear",moveTo:a,x0:s,y0:n,x1:r,y1:o})}i+=1,s=r,n=o}return e}var _I={start:0,middle:.5,end:1};function GI(t,e){const i=[];let s=0,n=NaN,r=NaN;const o=typeof e=="number"?e:_I[e];for(const{x:a,y:l}of t){if(s>0){const c=s===1,h=n+(a-n)*o;i.push({type:"step",moveTo:c,x0:n,y0:r,x1:a,y1:l,stepX:h})}s+=1,n=a,r=l}return i}var Cl=.05;function VI(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const s=i.map((r,o)=>{const a=o===0?r:i[o-1],l=o===i.length-1?r:i[o+1],c=o===0||o===i.length-1;if(Math.sign(a.y-r.y)===Math.sign(l.y-r.y))return 0;if(!c){const h=Math.abs(a.y-l.y),u=Math.abs(r.y-a.y)/h,d=Math.abs(r.y-l.y)/h;if(u<=Cl||1-u<=Cl||d<=Cl||1-d<=Cl)return 0}return(l.y-a.y)/(l.x-a.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let r=1;rMath.abs(u)&&(d*=Math.abs(u/p),p=Math.sign(p)*Math.abs(u)),a===0&&Math.abs(y)>Math.abs(u)&&(f*=Math.abs(u/y),y=Math.sign(y)*Math.abs(u)),n.push({type:"cubic",moveTo:r===1,cp0x:o.x,cp0y:o.y,cp1x:o.x+d,cp1y:o.y+p,cp2x:l.x-f,cp2y:l.y-y,cp3x:l.x,cp3y:l.y})}return n}function ie(t,e,i){return(e-t)*i+t}function UI(t,e){const{x0:i,y0:s,x1:n,y1:r}=t,a=(r-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:a,stepX:e,stepY0:a,stepY1:a,rightCp1x:e,rightCp1y:a,rightCp2x:n,rightCp2y:r}}function YI(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=t,h=el(i,n,o,l,e),[u,d]=il(i,s,n,r,o,a,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:e,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function WI(t){const{x0:e,y0:i,x1:s,y1:n,stepX:r}=t;return{leftCp1x:(e+r)/2,leftCp1y:i,leftCp2x:(e+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:n,rightCp1x:(r+s)/2,rightCp1y:n,rightCp2x:(r+s)/2,rightCp2y:n}}function jm(t,e){return t.type==="linear"?UI(t,e):t.type==="cubic"?YI(t,e):WI(t)}function zm(t,e,i,s,n,r,o){switch(e){case 0:o?t.moveTo(n,r):t.moveTo(i,s);break;case 1:o?t.lineTo(n,r):t.lineTo(i,s);break}}function Fm(t,e,i,s,n,r){r?t.lineTo(e,i):t.lineTo(s,n)}function Bm(t,e,i,s,n,r,o,a,l,c){c?t.cubicCurveTo(r,o,s,n,e,i):t.cubicCurveTo(s,n,r,o,a,l)}function _m(t,e,i,s,n,r,o){o?(t.lineTo(r,n),t.lineTo(r,i),t.lineTo(e,i)):(t.lineTo(r,i),t.lineTo(r,n),t.lineTo(s,n))}function cu(t,e,i,s){const[n,r]=Hi(e);switch(zm(t,i,n.x,n.y,r.x,r.y,s),e.type){case"linear":Fm(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":Bm(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":_m(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break}}function Gm(t,e,i){const[s,n]=Hi(t),[r,o]=Hi(e),a=ie(s.x,r.x,i),l=ie(s.y,r.y,i),c=ie(n.x,o.x,i),h=ie(n.y,o.y,i);return[{x:a,y:l},{x:c,y:h}]}function hu(t,e,i,s,n,r){const[{x:o,y:a},{x:l,y:c}]=Gm(e,i,s);if(zm(t,n,o,a,l,c,r),e.type==="cubic"&&i.type==="cubic"){const h=ie(e.cp1x,i.cp1x,s),u=ie(e.cp1y,i.cp1y,s),d=ie(e.cp2x,i.cp2x,s),p=ie(e.cp2y,i.cp2y,s);Bm(t,o,a,h,u,d,p,l,c,r)}else if(e.type==="step"&&i.type==="step"){const h=ie(e.stepX,i.stepX,s);_m(t,o,a,l,c,h,r)}else if(e.type==="linear"&&i.type==="linear")Fm(t,o,a,l,c,r);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const u=jm(e,h),d=jm(i,h),p=ie(u.leftCp1x,d.leftCp1x,s),f=ie(u.leftCp1y,d.leftCp1y,s),y=ie(u.leftCp2x,d.leftCp2x,s),b=ie(u.leftCp2y,d.leftCp2y,s),m=ie(u.stepX,d.stepX,s),M=ie(u.stepY0,d.stepY0,s),S=ie(u.stepY1,d.stepY1,s),v=ie(u.rightCp1x,d.rightCp1x,s),I=ie(u.rightCp1y,d.rightCp1y,s),L=ie(u.rightCp2x,d.rightCp2x,s),A=ie(u.rightCp2y,d.rightCp2y,s);r?(t.cubicCurveTo(L,A,v,I,m,S),t.lineTo(m,M),t.cubicCurveTo(y,b,p,f,o,a)):(t.cubicCurveTo(p,f,y,b,m,M),t.lineTo(m,S),t.cubicCurveTo(v,I,L,A,l,c))}}var Vm=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(Vm||{});function HI(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function Ae(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return NaN;const i=e.domain.findIndex(n=>n===t);return i>=0||e.domain.findIndex(n=>HI(t,n))>=0?e.inset+e.step*i:NaN}function gi(t){return Wc(t).valueOf()}function Um({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(gi(i.xValue0)),xValue1Index:e.indexOf(gi(i.xValue1)),datumIndex:s}))}function KI(t,e){const i=e.scales.x,s=t.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const r of i.domain){const o=Ae(r,s);if(Number.isFinite(o)){if(o({axisValue:h,value:u}));s.sort((h,u)=>Ae(h.value,t.scales.x)-Ae(u.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:u}of e.data){const d=gi(h),p=gi(u);i.has(d)||(i.set(d,h),n.push({axisValue:d,value:h})),i.has(p)||(i.set(p,u),n.push({axisValue:p,value:u}))}n.sort((h,u)=>Ae(h.value,e.scales.x)-Ae(u.value,e.scales.x));const r=s;let o=0;for(const h of n){for(let u=r.length-1;u>o;u-=1){const d=Ae(h.value,e.scales.x),p=Ae(r[u].value,e.scales.x);if(d>p){o=u+1;break}}r.splice(o,0,h),o+=1}if(!$I(r,e))return;const a=r.map(h=>h.axisValue),l=Um(e,a),c=Um(t,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function Ym(t,e,i){if(i.xValue1Index===i.xValue0Index+1)return t;const s=Hi(t),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),r=s[0].x+(e-i.xValue0Index)*n,o=r+n;return Pm(t,r,o)}function Wm(t,e){const[i,s]=Hi(t),n=Ae(0,e.scales.y);return zo(t,{x:i.x,y:n},{x:s.x,y:n})}function Hm(t){const[e,i]=Hi(t);return FI(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function Km(t,e,i,s,n,r){let o,a;if(n.xValue0Index>=r.xValue1Index){const u=s.findLast(p=>p.xValue1Index<=r.xValue1Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue1,a=d?.yValue1}else if(n.xValue0Index<=r.xValue0Index){const u=s.find(p=>p.xValue0Index>=r.xValue0Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue0,a=d?.yValue0}if(o==null||a==null)switch(e){case 0:return Wm(t,i);case 1:return Hm(t)}const l=Ae(o,i.scales.x),c=Ae(a,i.scales.y),h={x:l,y:c};return zo(t,h,h)}function uu(t,e){if(e==null)return;const i=gi(t.xValue0),s=gi(t.xValue1);return e.find(n=>gi(n.xValue0)===i&&gi(n.xValue1)===s)?.span}function $m(t,e,i,s,n,r,o){const a=t.data[s.datumIndex],l=a.span,c=uu(a,n);if(c!=null)o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l});else{const h=Km(l,e,t,i,s,r);o.added.push({from:h,to:l})}}function Zm(t,e,i,s,n,r,o){const a=t.data[s.datumIndex],l=a.span,c=uu(a,n);if(c!=null)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c});else{const h=Km(l,e,t,i,s,r);o.removed.push({from:l,to:h})}}function Xm(t,e,i,s,n){const r=e[n.xValue0Index],o=i.data.find(b=>gi(b.xValue0)===r),a=e[n.xValue1Index],l=i.data.find(b=>gi(b.xValue1)===a);if(o==null||l==null)return;const[{x:c},{x:h}]=Hi(t),u=Ae(o.xValue0,i.scales.x),d=Ae(o.yValue0,i.scales.y),p=Ae(l.xValue1,i.scales.x),f=Ae(l.yValue1,i.scales.y);let y=s.data[n.datumIndex].span;return y=zo(y,{x:u,y:d},{x:p,y:f}),y=Pm(y,c,h),y}function XI(t,e,i,s,n,r,o,a,l){const c=n+1,h=o.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),u=r.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),d=e.zeroData,p=t.zeroData;if(h==null&&u!=null){$m(t,i,r,u,d,a,l);return}else if(h!=null&&u==null){Zm(e,i,o,h,p,a,l);return}else if(h==null||u==null)return;let f;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?f=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?f=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?f=1:f=0;const y=e.data[h.datumIndex],b=Ym(y.span,n,h),m=t.data[u.datumIndex],M=Ym(m.span,n,u);if(f===1){const S=Xm(b,s,e,t,u);S!=null?(l.removed.push({from:b,to:S}),l.moved.push({from:S,to:M}),l.added.push({from:M,to:M})):Zm(e,i,o,h,p,a,l)}else if(f===-1){const S=Xm(M,s,t,e,h);S!=null?(l.removed.push({from:b,to:b}),l.moved.push({from:b,to:S}),l.added.push({from:S,to:M})):$m(t,i,r,u,d,a,l)}else l.removed.push({from:b,to:b}),l.moved.push({from:b,to:M}),l.added.push({from:M,to:M})}function QI(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:o,newDataAxisIndices:a}=t,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let c=0;ce!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}function Nl(t,e){let i;const s=t.map(n=>n.point);switch(e.type){case"linear":i=BI(s);break;case"smooth":i=VI(s,e.tension);break;case"step":i=GI(s,e.position);break}return i.map((n,r)=>({span:n,xValue0:t[r].xDatum,yValue0:t[r].yDatum,xValue1:t[r+1].xDatum,yValue1:t[r+1].yDatum}))}function ty(t,e,i=.001){return Math.abs(t.x-e.x)Tl(a,l,e.removed),n=(a,l)=>Tl(a,l,e.moved),r=(a,l)=>Tl(a,l,e.added),o=gu(t,i);return{status:t,path:{addPhaseFn:r,updatePhaseFn:n,removePhaseFn:s},pathProperties:o}}function gu(t,e){const i=e==="none"?"updated":t,s={fromFn:n=>{let r;return t==="removed"?r={finish:{visible:!1}}:t==="added"?r={start:{visible:!0}}:r={},{phase:Si[i],...r}},toFn:n=>({phase:Si[i]})};return e==="fade"?{fromFn:n=>({opacity:t==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:t==="removed"?0:1,...s.toFn(n)})}:s}function ey(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!Bo(t.scales.x)||!Bo(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let r="updated";e.visible&&!t.visible?r="removed":!e.visible&&t.visible&&(r="added");const o=Fo({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(o==null)return;const a=pu(r,o,"fade"),l=(i?.changed??!0)||!xr(t.scales.x,e.scales.x)||!xr(t.scales.y,e.scales.y)||r!=="updated";return{status:r,stroke:a,hasMotion:l}}function iy({path:t},{spans:e,phantomSpans:i}){for(let s=0;skl(l,c,e.removed,i.removed),r=(l,c)=>kl(l,c,e.moved,i.moved),o=(l,c)=>kl(l,c,e.added,i.added),a=gu(t,s);return{status:t,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:n},pathProperties:a}}function ny(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!Bo(t.scales.x)||!Bo(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const r=Fo({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(r==null)return;const o=Fo({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(o==null)return;const a=Fo({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(a==null)return;const l="none",c=sy(n,r,o,l),h=pu(n,a,l);return{status:n,fill:c,stroke:h}}function _o({id:t},e,i,...s){const n={phase:i?Si[i]:"trailing"};ts(t,"markers",e,s,{opacity:0},{opacity:1},n),s.forEach(r=>r.cleanup())}function fu({id:t},e,...i){ts(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function mu({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;zt(t,"markers",i,s,{fromFn:(a,l)=>{const c=l.midPoint?.x??n;let h=it(0,Wd(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:fa,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Go(t){return{opacity:1,scalingX:1,scalingY:1}}function Vo(t,e){return{translationX:e.point?.x??NaN,translationY:e.point?.y??NaN}}function Uo(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const s=i[e],{point:n}=s;if(s==null||n==null)return;const r=4+(n.focusSize??t.getFormattedMarkerStyle(s).size),o=r/2,a=s.point.x-o,l=s.point.y-o;return Ft.toCanvas(t.contentGroup,new F(a,l,r,r))}function yu({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:r,seriesRectHeight:o}=i;ts(t,"path_properties",s,n,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:e},finish:{clip:!1,visible:e}})}function wl({id:t},e,i,s="add",...n){ts(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function xu(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function El({nodeDataDependencies:t},e){const i=s=>isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var JI=.125,tD=.25,bu=class extends _s{constructor(t){super({moduleCtx:t,directionKeys:fn,directionNames:mn,pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:xu({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Ms,marker:(e,i)=>({...Go(e),...Vo(e,i)})}}),this.properties=new $t,this.connectsToYAxis=!0,this.backgroundGroup=new Q({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>ol||this.contextNodeData.strokeData.spans.length>ol)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){this.backgroundGroup.removeChild(t),this.contentGroup.removeChild(e)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(t){const e=this.isStacked();return!super.setSeriesIndex(t)&&this._isStacked===e?!1:(this._isStacked=e,e?(this.backgroundGroup.zIndex=[0,t],this.contentGroup.zIndex=[1,t,0]):(this.backgroundGroup.zIndex=[1,t,0,0],this.contentGroup.zIndex=[1,t,0,1]),!0)}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:r,yKey:o,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),y={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},b=[];qo(c)&&b.push(hl(Object.values(y),c)),h&&b.push(cr());const m={invalidValue:null};(qo(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(t,e,{props:[wi(r,p,{id:"xValue"}),at(o,f,{id:"yValueRaw",...m}),...a!=null?[at(a,f,{id:"yFilterRaw"})]:[],...hm(o,f,{id:"yValueStack",...m,groupId:y.stack}),at(o,f,{id:"yValue",...m,groupId:y.value}),...Gs(o,"window","current",{id:"yValueEnd",...m,groupId:y.values},f),...Gs(o,"normal","current",{id:"yValueCumulative",...m,groupId:y.marker},f),...b],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{processedData:e,dataModel:i,axes:s}=this;if(!e||!i)return[];const n=s.y;if(t==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",e);return o?.def.type==="key"&&o.def.valueType==="category"?a:Ye(fs(a))}const r=this.domainForClippedRange("y",["yValueEnd"],"xValue",!0);if(n instanceof xn||n instanceof gn)return Ye(r);{const o=Number.isFinite(r[1]-r[0])?[r[0]>0?0:r[0],r[1]<0?0:r[1]]:[];return Ye(o)}}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange("y",["yValueEnd"],"xValue",e,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValueEnd"],t,e,i)}createNodeData(){const{axes:t,data:e,processedData:i,dataModel:s}=this,n=t.x,r=t.y;if(!n||!r||!e||!s||i?.type!=="grouped"||!this.properties.isValid())return;const{yKey:o,xKey:a,yFilterKey:l,marker:c,label:h,fill:u,stroke:d,connectMissingData:p,interpolation:f}=this.properties,{scale:y}=n,{scale:b}=r,{isContinuousY:m}=this.getScaleInformation({xScale:y,yScale:b}),M=(y.bandwidth??0)/2,S=s.resolveKeysById(this,"xValue",i),v=s.resolveColumnById(this,"yValueEnd",i),I=s.resolveColumnById(this,"yValueRaw",i),L=s.resolveColumnById(this,"yValueCumulative",i),A=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,D=s.resolveColumnById(this,"yValueStack",i),C=(V,W,E)=>{let _;return(qo(this.properties.normalizedTo)?m&&wa(E):!isNaN(E))&&(_=W),{x:y.convert(V)+M,y:b.convert(_),size:c.size}},N=[],w=[],{visibleSameStackCount:O}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let B=!1;const{dataSources:rt}=i,Y=rt.get(this.id)??[];for(const{datumIndex:V}of s.forEachGroupDatum(this,i)){const W=S[V];if(W==null)return;const E=Y[V],_=I[V],U=L[V],ht=v[V],dt=Number.isFinite(_),bt=C(W,+U,_),Lt=A!=null?A[V]===_:void 0;if(Lt===!1&&(B=!0),dt&&c&&w.push({series:this,itemId:o,datum:E,datumIndex:V,midPoint:{x:bt.x,y:bt.y},cumulativeValue:ht,yValue:_,xValue:W,yKey:o,xKey:a,point:bt,fill:c.fill??u,stroke:c.stroke??d,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:Lt}),dt&&h){const Vt=this.getLabelText(h,{value:_,datum:E,xKey:a,yKey:o,xName:this.properties.xName,yName:this.properties.yName});N.push({series:this,itemId:o,datum:E,datumIndex:V,x:bt.x,y:bt.y,labelText:Vt})}}const X=V=>V.flatMap(W=>Array.isArray(W)?Nl(W,f):new Array(W.skip).fill(null)),J=(V,W)=>({point:{x:y.convert(V)+M,y:b.convert(W)},xDatum:V,yDatum:W}),st=V=>{const W=[];for(const{datumIndexes:[E,_,U]}of s.forEachGroupDatumTuple(this,i)){const ht=S[_],dt=D[_],bt=dt[V],Lt=Number.isFinite(bt);if(p&&!Lt)continue;const Vt=E!=null?D[E]:void 0,Ut=U!=null?D[U]:void 0;let Yt=0,Be=0;for(let Pt=0;Pt<=V;Pt+=1){const _e=dt[Pt];if(Number.isFinite(_e)){const Ze=Vt==null||Number.isFinite(Vt[Pt]),Jl=Ut==null||Number.isFinite(Ut[Pt]);Ze&&(Yt+=_e),Jl&&(Be+=_e)}}const qt=W[W.length-1];if(!p&&(Yt!==Be||!Lt))if(!Lt&&Array.isArray(qt)&&qt.length===1)W[W.length-1]={skip:1};else{const Pt=J(ht,Yt),_e=J(ht,Be);Array.isArray(qt)?qt.push(Pt):qt!=null&&(qt.skip+=1),W.push(Lt?[_e]:{skip:0})}else{const Pt=Math.max(Yt,Be),_e=J(ht,Pt);Array.isArray(qt)?qt.push(_e):qt!=null?(qt.skip+=1,W.push([_e])):W.push([_e])}}return X(W)},K=this.seriesGrouping?.stackIndex??0,z=()=>{const V=Array.from(s.forEachGroupDatum(this,i),({datumIndex:W})=>{const E=S[W],U=D[W][K];if(!(p&&!Number.isFinite(U)))return J(E,0)}).filter(W=>W!=null);return Nl(V,f)},G=st(K),$=G.map(()=>null);for(let V=K-1;V>=-1;V-=1){let W;for(let E=0;E<$.length;E+=1)$[E]==null&&(W??(W=V!==-1?st(V):z()),$[E]=W[E])}const Z=G.map((V,W)=>V??$[W]),q=G.filter(V=>V!=null);return{itemId:o,fillData:{itemId:o,spans:Z,phantomSpans:$},strokeData:{itemId:o,spans:q},labelData:N,nodeData:w,scales:this.calculateScaling(),visible:this.visible,stackVisible:O>0,crossFiltering:B}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,r]=t.paths,o=this.contextNodeData?.crossFiltering===!0,a=this.getStrokeWidth(this.properties.strokeWidth);r.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity*(o?tD:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const{fill:l}=this.properties;if(Cp(l)){const c=this.getGradientFillOptions(l,this.properties.defaultColorRange);n.gradientFillOptions=c}n.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity*(o?JI:1),fillShadow:this.properties.shadow,opacity:e,visible:i||s}),El(this,r),El(this,n)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty()}updateFillPath(t,e){const[i]=t;i.path.clear(),iy(i,e.fillData),i.markDirty()}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),du(s,i),s.markDirty()}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?e:[])}getMarkerItemBaseStyle(t){const{marker:e}=this.properties,i=t?this.properties.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??e.strokeWidth,strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getMarkerItemStyleOverrides(t,e,i,s,n,r){const{marker:o}=this.properties,{itemStyler:a}=o;if(a==null)return;const{id:l,properties:c}=this,{xKey:h,yKey:u}=c,{xDomain:d,yDomain:p}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return this.cachedDatumCallback(Kt(t,r?"highlight":"node"),()=>a({seriesId:l,...zs(e,h,u,d,p),xValue:i,yValue:s,highlighted:r,...n}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:r,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:u}=this.properties,d=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),f=ot(i&&u.item,r.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h});e.each((y,b)=>{this.updateMarkerStyle(y,r,{...zs(b,s,n,d,p),highlighted:i},f,{selected:b.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{enabled:i,fontStyle:s,fontWeight:n,fontSize:r,fontFamily:o,color:a}=this.properties.label;e.each((l,c)=>{const{x:h,y:u,labelText:d}=c;d&&i&&this.visible?(l.fontStyle=s,l.fontWeight=n,l.fontSize=r,l.fontFamily=o,l.textAlign="center",l.textBaseline="bottom",l.text=d,l.x=h,l.y=u-10,l.fill=a,l.visible=!0):l.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h}=r,u=n.x,d=n.y;if(!i||!s||!u||!d)return;const{datumIndex:p}=t,f=s.dataSources.get(this.id)?.[p],y=i.resolveKeysById(this,"xValue",s)[p],b=i.resolveColumnById(this,"yValueRaw",s)[p];if(y==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(p),f,y,b,m,!1)),h.formatTooltip({heading:u.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(b)}]},{seriesId:e,datum:f,title:c,xKey:o,xName:a,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:r,marker:o}=this.properties,a=!o.enabled||o.fill===void 0;return{marker:{shape:o.shape,fill:a?t:o.fill,fillOpacity:a?i:o.fillOpacity,stroke:o.stroke??e,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset,enabled:o.enabled||n<=0},line:{stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:r}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:t,id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??r??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:r}=this.ctx;this.updateAreaPaths(n,s),yu(this,r,...n),de([e],Vo),mu(this,r,e),ft(this,"labels",r,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:r,previousContextData:o}=t,[a,l]=r;if(a==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(r,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||o==null){c(),_o(this,e,"added",i),wl(this,"fill_path_properties",e,"add",a),wl(this,"stroke_path_properties",e,"add",l),ft(this,"labels",e,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const u=ny(n,o);if(u===void 0){h();return}else if(u.status==="no-op")return;_o(this,e,void 0,i),zt(this.id,"fill_path_properties",e,[a],u.fill.pathProperties),Ll(this.id,"fill_path_update",e,[a],u.fill.path),zt(this.id,"stroke_path_properties",e,[l],u.stroke.pathProperties),Ll(this.id,"stroke_path_update",e,[l],u.stroke.path),ft(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(r,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Q}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,{...zs(t,e,i,s,n),highlighted:!0})}computeFocusBounds(t){return Uo(this,t)}};bu.className="AreaSeries",bu.type="area";var eD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:t=>new bu(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Ys,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear",tension:1,position:"end"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:t=>{const{marker:e}=lu(t),i=t.themeTemplateParameters.get(Sl);return{fill:e.fill,stroke:e.stroke,marker:e,defaultColorRange:i}}};function Mu(t,e){for(const i of e){const s=i.datum;s===void 0?k.error("undefined datum"):t.addValue(i,s)}}function vu(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:r}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(r)}}var Su=class extends ys{constructor(){super(...arguments),this.direction="vertical"}};g([x(pp)],Su.prototype,"direction",2);var ry=class extends _s{constructor(){super(...arguments),this.groupScale=new _r,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=pt(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=fs(t)??[NaN,NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),Ye(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getBandwidth(t){return yt.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval):t.scale.bandwidth}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e)??0,n=yt.is(i)?s*-.5:0,r=i.convert(t)+n;return[r,r+s]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,s=t.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(t){const e=[],{groupScale:i}=this,s=this.getBandwidth(t),{index:n,visibleGroupCount:r}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let a=0;a=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(t){return this.getBarDirection()==="x"?t==="x"?"y":"x":t}initQuadTree(t){Mu(t,this.datumNodesIter())}pickNodeClosestDatum(t){return vu(this,t)}},Iu=class extends oe{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};g([x(It(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],Iu.prototype,"placement",2),g([x(ut)],Iu.prototype,"padding",2);var Gt=class extends Su{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 Ei,this.label=new Iu,this.tooltip=new De,this.sparklineMode=!1,this.fastDataProcessing=!1}};g([x(T)],Gt.prototype,"xKey",2),g([x(T,{optional:!0})],Gt.prototype,"xName",2),g([x(T)],Gt.prototype,"yKey",2),g([x(T,{optional:!0})],Gt.prototype,"yName",2),g([x(T,{optional:!0})],Gt.prototype,"yFilterKey",2),g([x(T,{optional:!0})],Gt.prototype,"stackGroup",2),g([x(ut,{optional:!0})],Gt.prototype,"normalizedTo",2),g([x(gt)],Gt.prototype,"fill",2),g([x(xt)],Gt.prototype,"fillOpacity",2),g([x(gt)],Gt.prototype,"stroke",2),g([x(R)],Gt.prototype,"strokeWidth",2),g([x(xt)],Gt.prototype,"strokeOpacity",2),g([x(Fi)],Gt.prototype,"lineDash",2),g([x(R)],Gt.prototype,"lineDashOffset",2),g([x(R)],Gt.prototype,"cornerRadius",2),g([x(H,{optional:!0})],Gt.prototype,"crisp",2),g([x(Ne,{optional:!0})],Gt.prototype,"itemStyler",2),g([x(P,{optional:!0})],Gt.prototype,"shadow",2),g([x(P)],Gt.prototype,"label",2),g([x(P)],Gt.prototype,"tooltip",2),g([x(H)],Gt.prototype,"sparklineMode",2),g([x(H)],Gt.prototype,"fastDataProcessing",2);function oy(t,e,i,s){if(e!=null){const[n,r]=e;if(n!==0||r!==1)return!1}if(yt.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}var Du=t=>aa(t.yValue??0);function Yo(t,e,i){const{startingX:s,startingY:n}=sD(t,e);return{isVertical:t,calculate:(o,a)=>{let l=t?o.x:s,c=t?n:o.y,h=t?o.width:0,u=t?0:o.height;const{opacity:d=1}=o;a&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=a,h=t?a.width:0,u=t?0:a.height,t&&!Du(a)?c+=a.height:!t&&Du(a)&&(l+=a.width));let p;return o.clipBBox==null?p=void 0:Du(o)?p=t?new F(l,c-u,h,u):new F(l-h,c,h,u):p=new F(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:p,opacity:d}},mode:i}}function iD(t,e){return{isVertical:t,calculate:i=>({x:t?i.x:i.x+i.width/2,y:t?i.y+i.height/2:i.y,width:t?i.width:0,height:t?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:e}}function Wo(t){const e=r=>r==null||isNaN(r.x)||isNaN(r.y);return{toFn:(r,o,a)=>a==="removed"&&r.datum==null&&t.mode==="fade"?{...Ho(r,o),opacity:0}:a==="removed"||e(o)?t.calculate(o,r.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(r,o,a)=>{a==="updated"&&e(o)?a="removed":a==="updated"&&e(r.previousDatum)&&(a="added");let l;a==="added"&&r.previousDatum==null&&t.mode==="fade"?l={...Ho(r,o),opacity:0}:a==="unknown"||a==="added"?l=t.calculate(o,r.previousDatum):l={x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1};const c=Si[a];return{...l,phase:c}},applyFn:(r,o,a)=>{r.setProperties(o),r.crisp=a==="end"&&(r.datum?.crisp??!1)}}}function sD(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(yt.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(yt.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function Ho(t,{x:e,y:i,width:s,height:n,clipBBox:r,opacity:o=1}){return{x:e,y:i,width:s,height:n,clipBBox:r,opacity:o,crisp:t.datum?.crisp??!1}}function Au(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:r}=e;return Ft.toCanvas(t.contentGroup,new F(i,s,n,r))}function ay(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:r,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=e;t.setProperties({visible:!0,x:s,y:n,text:r,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:a})}else t.visible=!1}var nD={"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 ly({isUpward:t,isVertical:e,placement:i,padding:s=0,rect:n}){let r=n.x+n.width/2,o=n.y+n.height/2,a="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:u}=nD[i],d=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,f=n.height*c;o=p+f*d+s*u*c,l=u===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,f=n.width*c;r=p+f*d+s*u*c,a=u===c?"left":"right"}}return{x:r,y:o,textAlign:a,textBaseline:l}}var rD=0,oD=1,aD=2,lD=3,cD=4,Ol=class extends ry{constructor(t){super({moduleCtx:t,directionKeys:fn,directionNames:mn,pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Ho,label:Ms}}),this.properties=new Gt,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(t){if(!this.properties.isValid()||!this.data)return;const{xKey:e,yKey:i,yFilterKey:s,normalizedTo:n,fastDataProcessing:r}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:a}=this,l=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,u=!r||l>1||h,d=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,f=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:b,yScaleType:m}=this.getScaleInformation({xScale:p,yScale:f}),M=`bar-stack-${o}-yValues`,S=`${M}-trailing`,v=this.visible?{}:{forceValue:0},I=[wi(e,b,{id:"xValue"}),at(i,m,{id:"yValue-raw",invalidValue:null,...v})];this.crossFilteringEnabled()&&I.push(at(s,m,{id:"yFilterValue",invalidValue:null,...v})),h&&I.push(...Gs(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:M,separateNegative:!0,...v},m),...Gs(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:S,separateNegative:!0,...v},m)),y&&I.push(um,dm),pt(n)&&I.push(hl([M,S],Math.abs(n))),d&&this.processedData&&I.push(hr(this.id,this.processedData)),(d||!u)&&I.push(cr());const{dataModel:L,processedData:A}=await this.requestDataModel(t,a,{props:I,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(L,A),this.smallestDataInterval=A.reduced?.smallestKeyInterval,this.largestDataInterval=A.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return[];if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",e);return o?.def.type==="key"&&o.def.valueType==="category"?a:this.padBandExtent(a)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange("y",[s],"xValue",!0);const r=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e):void 0;if(r!=null&&(n=[Math.min(n[0],r[0]),Math.max(n[1],r[1])]),this.getValueAxis()instanceof xn)return Ye(n);{const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return Ye(o)}}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",e,!0);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!t||!e||!n||!r||!this.properties.isValid())return;const o=e.dataSources?.get(this.id);if(o==null)return;const a=n.scale,l=r.scale,{xKey:c,yKey:h,xName:u,yName:d,legendItemName:p,label:f}=this.properties,y=r.isReversed(),{barWidth:b,groupIndex:m}=this.updateGroupScale(n),M=i.convert(String(m)),S=yt.is(a)?b*-.5:0,v=t.resolveKeysById(this,"xValue",e),I=t.resolveColumnById(this,"yValue-raw",e),L=this.crossFilteringEnabled()?t.resolveColumnById(this,"yFilterValue",e):void 0,A=!this.ctx.animationManager.isSkipped(),D=z=>a.convert(v[z])+M+S,C=this.properties.crisp??oy(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),N=l.convert(0),w=({datum:z,datumIndex:G,valueIndex:$,xValue:Z,yValue:q,cumulativeValue:nt,phantom:V,currY:W,prevY:E,x:_,width:U,isPositive:ht,yRange:dt,labelText:bt,opacity:Lt,crossScale:Vt=1})=>{const Ut=ht!==y,Yt=l.convert(W),Be=l.convert(E),qt=l.convert(dt),Pt=this.getBarDirection()==="x",_e=U*.5*(1-Vt),Ze={x:Pt?Math.min(Yt,Be):_+_e,y:Pt?_+_e:Math.min(Yt,Be),width:Pt?Math.abs(Be-Yt):U*Vt,height:Pt?U*Vt:Math.abs(Be-Yt)},Jl=new F(Ze.x,Ze.y,Ze.width,Ze.height),Xo={x:Pt?Math.min(N,qt):_+_e,y:Pt?_+_e:Math.min(N,qt),width:Pt?Math.abs(N-qt):U*Vt,height:Pt?U*Vt:Math.abs(N-qt)},Md=this.shouldFlipXY()?Ze.height:Ze.width;return{series:this,itemId:V?Kt(h,V):h,datum:z,datumIndex:G,valueIndex:$,cumulativeValue:nt,phantom:V,xValue:Z,yValue:q,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:Md,lengthMax:Md},x:Xo.x,y:Xo.y,width:Xo.width,height:Xo.height,midPoint:{x:Ze.x+Ze.width/2,y:Ze.y+Ze.height/2},opacity:Lt,topLeftCornerRadius:Pt!==Ut,topRightCornerRadius:Ut,bottomRightCornerRadius:Pt===Ut,bottomLeftCornerRadius:!Ut,clipBBox:Jl,crisp:C,label:bt!=null?{text:bt,...ly({isUpward:Ut,isVertical:!Pt,placement:f.placement,padding:f.padding,rect:Ze})}:void 0,missing:q==null,focusable:!V}},O=[],B=[],rt=[],Y=(z,G,$,Z,q,nt,V,W)=>{const E=v[z];if(E==null)return;const _=I[z],U=L!=null?Number(L[z]):void 0,ht=_>=0&&!Object.is(_,-0);if(!Number.isFinite(nt)||U!=null&&!Number.isFinite(U))return;const dt=_!=null?this.getLabelText(this.properties.label,{datum:o[z],value:U??_,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,bt=U!=null&&U>_,Lt=w({datum:o[z],datumIndex:z,valueIndex:G,xValue:E,yValue:U??_,cumulativeValue:U??nt,phantom:!1,currY:U!=null?q+U:nt,prevY:q,x:$,width:Z,isPositive:ht,yRange:Math.max(q+(U??-1/0),V),labelText:dt,opacity:W,crossScale:bt?.6:void 0});if(B.push(Lt),rt.push(Lt),U!=null){const Vt=w({datum:o[z],datumIndex:z,valueIndex:G,xValue:E,yValue:U,cumulativeValue:U,phantom:!0,currY:nt,prevY:q,x:$,width:Z,isPositive:ht,yRange:V,labelText:void 0,opacity:W,crossScale:void 0});O.push(Vt)}},[X,J]=a.range,st=J-X,K=s?.find(z=>z.maxRange>st);if(e.type==="grouped"){const z=b,G=t.hasColumnById(this,"yValue-start"),$=G?t.resolveColumnById(this,"yValue-start",e):void 0,Z=G?t.resolveColumnById(this,"yValue-end",e):void 0,q=G?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:nt,valueIndex:V,group:{aggregation:W}}of t.forEachGroupDatum(this,e)){const E=D(nt),_=I[nt],U=_>=0&&!Object.is(_,-0),ht=G?Number($?.[nt]):0,dt=G?Number(Z?.[nt]):_;let bt=dt;G&&(bt=W[q][U?1:0]),Y(nt,V,E,z,ht,dt,bt,1)}}else if(K==null){const z=b;let[G,$]=this.visibleRange("xValue",n.range);e.input.count<1e3&&(G=0,$=e.input.count);for(let Z=G;Z<$;Z+=1){const q=D(Z),nt=Number(I[Z]);Y(Z,0,q,z,0,nt,nt,1)}}else{const{indexData:z,indices:G}=K,[$,Z]=this.visibleRange("xValue",n.range,G);for(let q=$;q0){const Lt=bt>=0?bt/dt:1;Y(_,0,U,ht,0,dt,dt,Lt)}if(bt<0){const Lt=dt<=0?dt/bt:1;Y(E,1,U,ht,0,bt,bt,Lt)}}}return{itemId:h,nodeData:O.length>0?[...O,...B]:B,labelData:rt,scales:this.calculateScaling(),visible:this.visible||A,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new Se}getHighlightData(t,e){const i=t.find(s=>s.datum===e.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>this.getDatumId(e))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??e.fill,fillOpacity:s?.fillOpacity??e.fillOpacity,stroke:s?.stroke??e.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:s?.strokeOpacity??e.strokeOpacity,lineDash:s?.lineDash??e.lineDash??[],lineDashOffset:s?.lineDashOffset??e.lineDashOffset,cornerRadius:i}}getItemStyleOverrides(t,e,i,s,n,r){const{id:o,properties:a}=this,{xKey:l,yKey:c,itemStyler:h}=a;if(h==null)return;const{xDomain:u,yDomain:d}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return this.cachedDatumCallback(Kt(t,r?"highlight":"node"),()=>h({seriesId:o,...zs(e,l,c,u,d),xValue:i,yValue:s,highlighted:r,...n}))}updateDatumNodes(t){if(!this.properties.isValid())return;const{shadow:e}=this.properties,i=this.getCategoryDirection()==="x",s=this.getItemBaseStyle(t.isHighlight);t.datumSelection.each((n,r)=>{const o=this.getItemStyleOverrides(String(r.datumIndex),r.datum,r.xValue,r.yValue,s,t.isHighlight);n.opacity=r.opacity??0,xo(n,s,o);const a=o?.cornerRadius??s.cornerRadius;n.topLeftCornerRadius=r.topLeftCornerRadius?a:0,n.topRightCornerRadius=r.topRightCornerRadius?a:0,n.bottomRightCornerRadius=r.bottomRightCornerRadius?a:0,n.bottomLeftCornerRadius=r.bottomLeftCornerRadius?a:0,n.visible=i?(r.clipBBox?.width??r.width)>0:(r.clipBBox?.height??r.height)>0,n.crisp=r.crisp,n.fillShadow=e})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{ay(e,this.properties.label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=n,d=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!d||!p)return;const{datumIndex:f}=t,y=s.dataSources.get(this.id)?.[f],b=i.resolveKeysById(this,"xValue",s)[f],m=i.resolveColumnById(this,"yValue-raw",s)[f];if(b==null)return;const M=this.getItemBaseStyle(!1);return Object.assign(M,this.getItemStyleOverrides(String(f),y,b,m,M,!1)),u.formatTooltip({heading:d.formatDatum(b),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:p.formatDatum(m)}]},{seriesId:e,datum:y,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:r,lineDashOffset:o}=this.properties;return{marker:{fill:t,fillOpacity:s,stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:r,lineDashOffset:o}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category"||!this.properties.isValid())return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:r,yName:o,legendItemName:a}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:r}),label:{text:a??o??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!e}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=Wo(Yo(this.isVertical(),this.axes,"normal"));zt(this.id,"nodes",this.ctx.animationManager,[t],s),ft(this,"labels",this.ctx.animationManager,e),ft(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,previousContextData:n}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);let r=this.processedData?.reduced?.diff?.[this.id];r==null&&this.processedData?.reduced?.diff!=null&&(r={changed:!0,added:new Set(Array.from(e,({datum:h})=>this.getDatumId(h))),updated:new Set,removed:new Set,moved:new Set});const o=n==null?"fade":"normal",a=Wo(Yo(this.isVertical(),this.axes,o));zt(this.id,"nodes",this.ctx.animationManager,[e],a,(h,u)=>this.getDatumId(u),r);const l=n!=null&&(!xr(t.contextData.scales.x,n.scales.x)||!xr(t.contextData.scales.y,n.scales.y)||!xr(t.contextData.groupScale,t.previousContextData.groupScale));((r?.changed??!1)||l)&&(ft(this,"labels",this.ctx.animationManager,i),ft(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return Kt(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return Au(this,e)}};Ol.className="BarSeries",Ol.type="bar";var cy={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new Ol(t),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:wm([{type:"number",position:"left"},{type:"category",position:"bottom"}],t=>t?.direction==="horizontal"),themeTemplate:{series:{direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{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:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Ys,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:jo},Lu=class extends Ie{constructor(){super(...arguments),this.maxSize=30}};g([x(R),j()],Lu.prototype,"maxSize",2),g([x(Da,{optional:!0}),j()],Lu.prototype,"domain",2);var hy=class extends oe{constructor(){super(...arguments),this.placement="top"}};g([x(Ic)],hy.prototype,"placement",2);var vt=class extends ys{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.label=new hy,this.tooltip=new De,this.marker=new Lu}};g([x(T)],vt.prototype,"xKey",2),g([x(T)],vt.prototype,"yKey",2),g([x(T)],vt.prototype,"sizeKey",2),g([x(T,{optional:!0})],vt.prototype,"labelKey",2),g([x(T,{optional:!0})],vt.prototype,"colorKey",2),g([x(T,{optional:!0})],vt.prototype,"xFilterKey",2),g([x(T,{optional:!0})],vt.prototype,"yFilterKey",2),g([x(T,{optional:!0})],vt.prototype,"sizeFilterKey",2),g([x(T,{optional:!0})],vt.prototype,"xName",2),g([x(T,{optional:!0})],vt.prototype,"yName",2),g([x(T,{optional:!0})],vt.prototype,"sizeName",2),g([x(T,{optional:!0})],vt.prototype,"labelName",2),g([x(T,{optional:!0})],vt.prototype,"colorName",2),g([x(Da,{optional:!0})],vt.prototype,"colorDomain",2),g([x(qe)],vt.prototype,"colorRange",2),g([x(T,{optional:!0})],vt.prototype,"title",2),g([wt("marker.shape")],vt.prototype,"shape",2),g([wt("marker.size")],vt.prototype,"size",2),g([wt("marker.maxSize")],vt.prototype,"maxSize",2),g([wt("marker.domain",{optional:!0})],vt.prototype,"domain",2),g([wt("marker.fill",{optional:!0})],vt.prototype,"fill",2),g([wt("marker.fillOpacity")],vt.prototype,"fillOpacity",2),g([wt("marker.stroke",{optional:!0})],vt.prototype,"stroke",2),g([wt("marker.strokeWidth")],vt.prototype,"strokeWidth",2),g([wt("marker.strokeOpacity")],vt.prototype,"strokeOpacity",2),g([wt("marker.lineDash")],vt.prototype,"lineDash",2),g([wt("marker.lineDashOffset")],vt.prototype,"lineDashOffset",2),g([wt("marker.itemStyler",{optional:!0})],vt.prototype,"itemStyler",2),g([x(P)],vt.prototype,"label",2),g([x(P)],vt.prototype,"tooltip",2);var hD=class extends Gh{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},Cu=class extends _s{constructor(t){super({moduleCtx:t,directionKeys:fn,directionNames:mn,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Ms,marker:Go},usesPlacedLabels:!0}),this.NodeEvent=hD,this.clipFocusBox=!1,this.properties=new vt,this.sizeScale=new ki,this.colorScale=new ks}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),r=this.colorScale.type,o=this.sizeScale.type,{xKey:a,yKey:l,sizeKey:c,xFilterKey:h,yFilterKey:u,sizeFilterKey:d,labelKey:p,colorDomain:f,colorRange:y,colorKey:b,marker:m}=this.properties,{dataModel:M,processedData:S}=await this.requestDataModel(t,this.data,{props:[at(a,s,{id:"xValue"}),at(l,n,{id:"yValue"}),...h!=null?[at(h,s,{id:"xFilterValue"})]:[],...u!=null?[at(u,n,{id:"yFilterValue"})]:[],...d!=null?[at(d,o,{id:"sizeFilterValue"})]:[],at(c,o,{id:"sizeValue"}),...b?[at(b,r,{id:"colorValue"})]:[],...p?[at(p,"band",{id:"labelValue"})]:[]]}),v=M.resolveProcessedDataIndexById(this,"sizeValue"),I=S.domain.values[v]??[];if(this.sizeScale.domain=m.domain?m.domain:I,b){const L=M.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=f??S.domain.values[L]??[],this.colorScale.range=y,this.colorScale.update()}this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.x.scale.convert(t),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*e;return[a-h,a+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.y.scale.convert(t[0]),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*e;return[a-h,a+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],r=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return Ye(fs(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,processedData:i,colorScale:s,sizeScale:n,visible:r}=this,{xKey:o,yKey:a,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:u,labelKey:d,xName:p,yName:f,sizeName:y,labelName:b,label:m,colorKey:M,marker:S}=this.properties,{placement:v}=m,I=le.anchor(S.shape),L=t.x,A=t.y;if(!(e&&i&&r&&L&&A))return;const D=e.resolveColumnById(this,"xValue",i),C=e.resolveColumnById(this,"yValue",i),N=l!=null?e.resolveColumnById(this,"sizeValue",i):void 0,w=M!=null?e.resolveColumnById(this,"colorValue",i):void 0,O=d!=null?e.resolveColumnById(this,"labelValue",i):void 0,B=c!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,rt=h!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,Y=u!=null?e.resolveColumnById(this,"sizeFilterValue",i):void 0,X=L.scale,J=A.scale,st=(X.bandwidth??0)/2,K=(J.bandwidth??0)/2,z=[];n.range=[S.size,S.maxSize];const G=m.getFont(),$=os.getMeasurer({font:G});return i.dataSources.get(this.id)?.forEach((Z,q)=>{const nt=D[q],V=C[q],W=N?.[q],E=X.convert(nt)+st,_=J.convert(V)+K;let U;B!=null&&rt!=null&&(U=B[q]===nt&&rt[q]===V,Y!=null&&U&&(U=Y[q]===W));const ht=this.getLabelText(m,{value:O!=null?O[q]:V,datum:Z,xKey:o,yKey:a,sizeKey:l,labelKey:d,xName:p,yName:f,sizeName:y,labelName:b}),dt=$.measureText(String(ht)),bt=W!=null?n.convert(W):S.size,Lt=w!=null?s.convert(w[q]):void 0;z.push({series:this,itemId:a,yKey:a,xKey:o,datum:Z,datumIndex:q,xValue:nt,yValue:V,sizeValue:W,point:{x:E,y:_,size:bt},midPoint:{x:E,y:_},fill:Lt,label:{text:ht,...dt},anchor:I,placement:v,selected:U})}),{itemId:a,nodeData:z,labelData:z,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?e:[];return i.update(s,void 0,n=>Kt([n.xValue,n.yValue,n.label.text]))}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:r}=this,{xKey:o,yKey:a,sizeKey:l,labelKey:c,marker:h}=r,{itemStyler:u}=h;if(u!=null)return this.cachedDatumCallback(Kt(t,s?"highlight":"node"),()=>u({seriesId:n,datum:e,xKey:o,yKey:a,sizeKey:l,labelKey:c,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:r,labelKey:o,marker:a}=this.properties,{size:l,shape:c,fill:h,fillOpacity:u,stroke:d,strokeWidth:p,strokeOpacity:f,lineDash:y,lineDashOffset:b}=ot(i&&this.properties.highlightStyle.item,a.getStyle()),m={size:l,shape:c,fill:h,fillOpacity:u,stroke:d,strokeWidth:p,strokeOpacity:f,lineDash:y,lineDashOffset:b};this.sizeScale.range=[a.size,a.maxSize],e.each((M,S)=>{this.updateMarkerStyle(M,a,{datum:S,highlighted:i,xKey:s,yKey:n,sizeKey:r,labelKey:o},m,{selected:S.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,title:f,tooltip:y}=r,b=n.x,m=n.y;if(!i||!s||!b||!m)return;const{datumIndex:M}=t,S=s.dataSources.get(this.id)?.[M],v=i.resolveColumnById(this,"xValue",s)[M],I=i.resolveColumnById(this,"yValue",s)[M];if(v==null)return;const L=[{label:a,fallbackLabel:o,value:b.formatDatum(v)},{label:c,fallbackLabel:l,value:m.formatDatum(I)}];if(h!=null){const D=i.resolveColumnById(this,"sizeValue",s)[M];L.push({label:u,fallbackLabel:h,value:String(D)})}const A=this.getMarkerItemBaseStyle(!1);return Object.assign(A,this.getMarkerItemStyleOverrides(String(M),S,A,!1)),y.formatTooltip({title:f,symbol:this.legendItemSymbol(),data:L},{seriesId:e,datum:S,title:l,xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,...A,...this.getModuleTooltipParams()})}legendItemSymbol(){const{marker:t}=this.properties,{shape:e,fill:i,stroke:s,fillOpacity:n,strokeOpacity:r,strokeWidth:o,lineDash:a,lineDashOffset:l}=t;return{marker:{shape:e,fill:i??"rgba(0, 0, 0, 0)",stroke:s??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:r,strokeWidth:o,lineDash:a,lineDashOffset:l}}}getLegendData(){if(!this.properties.isValid())return[];const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,title:r}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:r??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){fu(this,this.ctx.animationManager,t),ft(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Q}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,sizeKey:s,labelKey:n,highlighted:!1})}computeFocusBounds(t){return Uo(this,t)}};Cu.className="BubbleSeries",Cu.type="bubble";var uD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:t=>new Cu(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fillOpacity:.8,tooltip:{position:{type:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:jo},se=class extends ys{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 Ei,this.label=new oe,this.tooltip=new De}};g([x(T)],se.prototype,"xKey",2),g([x(T,{optional:!0})],se.prototype,"yKey",2),g([x(T,{optional:!0})],se.prototype,"xName",2),g([x(T,{optional:!0})],se.prototype,"yName",2),g([x(gt,{optional:!0})],se.prototype,"fill",2),g([x(xt)],se.prototype,"fillOpacity",2),g([x(gt,{optional:!0})],se.prototype,"stroke",2),g([x(R)],se.prototype,"strokeWidth",2),g([x(xt)],se.prototype,"strokeOpacity",2),g([x(Fi)],se.prototype,"lineDash",2),g([x(R)],se.prototype,"lineDashOffset",2),g([x(R)],se.prototype,"cornerRadius",2),g([x(H)],se.prototype,"areaPlot",2),g([x(Vr,{optional:!0})],se.prototype,"bins",2),g([x(It(["count","sum","mean"],"a histogram aggregation"))],se.prototype,"aggregation",2),g([x(R,{optional:!0})],se.prototype,"binCount",2),g([x(P)],se.prototype,"shadow",2),g([x(P)],se.prototype,"label",2),g([x(P)],se.prototype,"tooltip",2);var uy=10,Nu=class extends _s{constructor(t){super({moduleCtx:t,directionKeys:fn,directionNames:mn,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Ho,label:Ms}}),this.properties=new se,this.calculatedBins=[]}deriveBins(t){const e=Uc(t[0],t[1],uy),i=qr(t[0],t[1],uy),[s]=e,n=r=>[r,r+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:r,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(r,s,o,n)}getBins(t,e,i,s){const n=[],r=this.calculatePrecision(i);for(let o=0;o0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return{start:Math.floor(t/r)*r,binSize:s}}async processData(t){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:e,yKey:i,areaPlot:s,aggregation:n}=this.properties,r=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({yScale:o,xScale:r}),c=[wi(e,a),pm];if(i){let u=Uh("groupAgg");n==="count"||(n==="sum"?u=im("groupAgg"):n==="mean"&&(u=sm("groupAgg"))),s&&(u=Yh("groupAgg",u)),c.push(at(i,l,{invalidValue:void 0}),u)}else{c.push(cm("count"));let u=Uh("groupAgg");s&&(u=Yh("groupAgg",u)),c.push(u)}const h=u=>{const d=Ye(u.domain.keys[0]);if(d.length===0)return u.domain.groups=[],()=>[];const p=ni(this.properties.binCount)?this.calculateNiceBins(d,this.properties.binCount):this.properties.bins??this.deriveBins(d),f=p.length;return this.calculatedBins=[...p],y=>{let b=y[0];if(On(b)&&(b=b.getTime()),!ni(b))return[];for(let m=0;m=M[0]&&b{const[[h,u]=[0,0]]=c,[d,p]=l,[f,y]=ue([r.convert(d),r.convert(p)]);if(y>=e&&f<=i){const b=h+u;a=Math.max(a,b)}}),o>a?[NaN,NaN]:[o,a]}createNodeData(){const{id:t,axes:e,processedData:i,dataModel:s}=this,n=e.x,r=e.y;if(!n||!r||!s)return;const{scale:o}=n,{scale:a}=r,{xKey:l,yKey:c,xName:h,yName:u}=this.properties,d=this.properties.label.formatter??(y=>String(y.value)),p=[],f={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((y,b)=>{const{keys:m,datumIndices:M,aggregation:S}=y,[[v,I]=[0,0]]=S,L=M.length,A=m,[D,C]=A,N=[...s.forEachDatum(this,i,y)],w=o.convert(D),O=o.convert(C),B=v+I,rt=a.convert(0),Y=a.convert(B),X=Math.abs(O-w),J=Math.abs(Y-rt),st=Math.min(w,O),K=Math.min(rt,Y);let z;B!==0&&(z={x:st+X/2,y:K+J/2,text:this.cachedDatumCallback(Kt(b,"label"),()=>d({value:B,datum:N,seriesId:t,xKey:l,yKey:c,xName:h,yName:u}))??String(B)});const G={x:st+X/2,y:K+J/2},$=r.isReversed();p.push({series:this,datumIndex:b,datum:N,aggregatedValue:B,frequency:L,domain:A,yKey:c,xKey:l,x:st,y:K,xValue:w,yValue:Y,width:X,height:J,midPoint:G,topLeftCornerRadius:!$,topRightCornerRadius:!$,bottomRightCornerRadius:$,bottomLeftCornerRadius:$,label:z,crisp:!0})}),p.sort((y,b)=>y.x-b.x)),f}nodeFactory(){return new Se}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return i.update(e,void 0,s=>s.domain.join("_"))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius}}updateDatumNodes(t){const{isHighlight:e}=t,{shadow:i}=this.properties,s=this.getItemBaseStyle(e);t.datumSelection.each((n,r)=>{const{cornerRadius:o}=s,{topLeftCornerRadius:a,topRightCornerRadius:l,bottomRightCornerRadius:c,bottomLeftCornerRadius:h}=r;xo(n,s),n.topLeftCornerRadius=a?o:0,n.topRightCornerRadius=l?o:0,n.bottomRightCornerRadius=c?o:0,n.bottomLeftCornerRadius=h?o:0,n.crisp=r.crisp,n.fillShadow=i,n.visible=r.height>0})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(t){const{fontStyle:e,fontWeight:i,fontFamily:s,fontSize:n,color:r}=this.properties.label,o=this.isLabelEnabled();t.labelSelection.each((a,l)=>{o&&l?.label?(a.text=l.label.text,a.x=l.label.x,a.y=l.label.y,a.fontStyle=e,a.fontWeight=i,a.fontFamily=s,a.fontSize=n,a.fill=r,a.visible=!0):a.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e&&Mu(t,e.children())}pickNodeClosestDatum(t){return vu(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u}=r,d=n.x,p=n.y;if(!i||s?.type!=="grouped"||!d||!p)return;const f=t.datumIndex,y=s.groups[f],{aggregation:b,datumIndices:m,keys:M}=y,[[S,v]=[0,0]]=b,I=m.length,L=M,[A,D]=L,C=S+v,N={data:[...i.forEachDatum(this,s,y)],aggregatedValue:C,frequency:I,domain:L},w=[{label:l,fallbackLabel:a,value:`${d.formatDatum(A)} - ${d.formatDatum(D)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(I)}];if(c!=null){let O;switch(r.aggregation){case"sum":O=o.t("seriesHistogramTooltipSum",{yName:h});break;case"mean":O=o.t("seriesHistogramTooltipMean",{yName:h});break;case"count":O=o.t("seriesHistogramTooltipCount",{yName:h});break}w.push({label:O,value:p.formatDatum(C)})}return u.formatTooltip({symbol:this.legendItemSymbol(),data:w},{seriesId:e,datum:N,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[A,D],frequency:I,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o}=this.properties;return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Wo(Yo(!0,this.axes,"normal"));zt(this.id,"datums",this.ctx.animationManager,[t],i),ft(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=this.processedData?.reduced?.diff?.[this.id],i=Wo(Yo(!0,this.axes,"normal"));zt(this.id,"datums",this.ctx.animationManager,[t.datumSelection],i,(s,n)=>Kt(n.domain),e),ft(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Au(this,this.contextNodeData?.nodeData[t])}};Nu.className="HistogramSeries",Nu.type="histogram";var dD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:t=>new Nu(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:Ys,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}}},ne=class extends ys{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new yr,this.marker=new Ie,this.label=new oe,this.tooltip=new De,this.connectMissingData=!1,this.sparklineMode=!1}};g([x(T)],ne.prototype,"xKey",2),g([x(T)],ne.prototype,"yKey",2),g([x(T,{optional:!0})],ne.prototype,"xName",2),g([x(T,{optional:!0})],ne.prototype,"yName",2),g([x(T,{optional:!0})],ne.prototype,"yFilterKey",2),g([x(T,{optional:!0})],ne.prototype,"stackGroup",2),g([x(R,{optional:!0})],ne.prototype,"normalizedTo",2),g([x(T,{optional:!0})],ne.prototype,"title",2),g([x(gt)],ne.prototype,"stroke",2),g([x(R)],ne.prototype,"strokeWidth",2),g([x(xt)],ne.prototype,"strokeOpacity",2),g([x(Fi)],ne.prototype,"lineDash",2),g([x(R)],ne.prototype,"lineDashOffset",2),g([x(P)],ne.prototype,"interpolation",2),g([x(P)],ne.prototype,"marker",2),g([x(P)],ne.prototype,"label",2),g([x(P)],ne.prototype,"tooltip",2),g([x(H)],ne.prototype,"connectMissingData",2),g([x(H)],ne.prototype,"sparklineMode",2);var pD=.25,Rl=class extends _s{constructor(t){super({moduleCtx:t,directionKeys:fn,directionNames:mn,hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:xu({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Ms,marker:(e,i)=>({...Go(e),...Vo(e,i)})}}),this.clipFocusBox=!1,this.properties=new ne,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:r,yKey:o,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:p,xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:d}),b=n>=1||c!=null,m={invalidValue:null};l&&b&&(m.invalidValue=0),b&&!i&&(m.forceValue=0);const M=[];if((!p||b)&&M.push(wi(r,f,{id:"xKey"})),M.push(at(r,f,{id:"xValue"}),at(o,y,{id:"yValueRaw",...m,invalidValue:void 0})),a!=null&&M.push(at(a,y,{id:"yFilterRaw"})),b){const I=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];M.push(...Gs(o,"window","current",{id:"yValueEnd",...m,groupId:I[0]},y),...Gs(o,"window-trailing","current",{id:"yValueStart",...m,groupId:I[1]},y),...Gs(o,"normal","current",{id:"yValueCumulative",...m,groupId:I[2]},y)),qo(c)&&M.push(hl([I[0],I[1],I[2]],c))}h&&(M.push(cr(p?["xValue"]:void 0)),this.processedData&&M.push(hr(this.id,this.processedData)));const{dataModel:S,processedData:v}=await this.requestDataModel(t,e,{props:M,groupByKeys:b,groupByData:!b});this.dataAggregationFilters=this.aggregateData(S,v),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return[];if(t==="x"){const r=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","value",i);return r?.def.type==="value"&&r.def.valueType==="category"?o:Ye(fs(o))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue",!0);return Ye(n)}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",e,!0)}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,axes:i,dataAggregationFilters:s}=this,n=i.x,r=i.y;if(!t||!e||!n||!r)return;const{xKey:o,yKey:a,yFilterKey:l,xName:c,yName:h,marker:u,label:d,connectMissingData:p,interpolation:f,legendItemName:y}=this.properties,b=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,M=r.scale,S=(m.bandwidth??0)/2,v=(M.bandwidth??0)/2,I=u.enabled?u.size:0,L=e.dataSources.get(this.id)??[],A=t.resolveColumnById(this,"xValue",e),D=t.resolveColumnById(this,"yValueRaw",e),C=b?t.resolveColumnById(this,"yValueEnd",e):void 0,N=b?t.resolveColumnById(this,"yValueCumulative",e):D,w=l!=null?t.resolveColumnById(this,"yFilterRaw",e):void 0,O=E=>m.convert(A[E])+S,B=E=>M.convert(N[E])+v,rt={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},Y=[];let X;const J=E=>{const _=L[E],U=A[E],ht=D[E],dt=C?.[E],bt=w?.[E],Lt=O(E),Vt=B(E);if(!Number.isFinite(Lt))return;if(ht!=null){const Yt=d.enabled?this.getLabelText(d,{value:ht,datum:_,xKey:o,yKey:a,xName:c,yName:h,legendItemName:y}):void 0;Y.push({series:this,datum:_,datumIndex:E,yKey:a,xKey:o,point:{x:Lt,y:Vt,size:I},midPoint:{x:Lt,y:Vt},cumulativeValue:dt,yValue:ht,xValue:U,capDefaults:rt,labelText:Yt,selected:bt})}if(X==null)return;const Ut=X[X.length-1];if(ht!=null){const Yt={point:{x:Lt,y:Vt},xDatum:U,yDatum:ht};Array.isArray(Ut)?Ut.push(Yt):Ut!=null?(Ut.skip+=1,X.push([Yt])):X.push([Yt])}else p||(Array.isArray(Ut)||Ut==null?X.push({skip:0}):Ut.skip+=1)},[st,K]=m.range,z=K-st,$=s?.find(E=>E.maxRange>z)?.indices;let[Z,q]=this.visibleRange("xValue",n.range,$);Z=Math.max(Z-1,0),q=Math.min(q+1,$?.length??A.length),e.input.count<1e3&&(Z=0,q=e.input.count),$==null&&(X=[]);for(let E=Z;EArray.isArray(E)?Nl(E,f):[]),V=nt!=null?{itemId:a,spans:nt}:void 0,W=w?.some((E,_)=>E===D[_])??!1;return{itemId:a,nodeData:Y,labelData:Y,strokeData:V,scales:this.calculateScaling(),visible:this.visible,crossFiltering:W}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t,r=this.contextNodeData?.crossFiltering===!0;e.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(r?pD:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),El(this,e)}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{size:i.size,shape:i.shape,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:r}=this,{xKey:o,yKey:a,marker:l}=r,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Kt(t,s?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y");return c({seriesId:n,...zs(e,o,a,h,u),highlighted:s,...i})})}updateMarkerSelection(t){let{nodeData:e}=t;const{markerSelection:i}=t;return e=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,n=>Kt(n.xValue))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:r,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y"),d=ot(i&&c.item,l.getStyle(),{stroke:r,strokeWidth:o,strokeOpacity:a}),p=this.ctx.animationManager.isSkipped();e.each((f,y)=>{this.updateMarkerStyle(f,l,{...zs(y,s,n,h,u),highlighted:i},d,{applyTranslation:p,selected:y.selected})}),i||l.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{enabled:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:r,color:o}=this.properties.label;t.labelSelection.each((a,l)=>{e&&l?.labelText?(a.fontStyle=i,a.fontWeight=s,a.fontSize=n,a.fontFamily=r,a.textAlign="center",a.textBaseline="bottom",a.text=l.labelText,a.x=l.point.x,a.y=l.point.y-10,a.fill=o,a.visible=!0):a.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h}=r,u=n.x,d=n.y;if(!i||!s||!u||!d)return;const{datumIndex:p}=t,f=s.dataSources.get(this.id)?.[p],y=i.resolveColumnById(this,"xValue",s)[p],b=i.resolveColumnById(this,"yValueRaw",s)[p];if(y==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(p),f,m,!1)),h.formatTooltip({heading:u.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(b)}]},{seriesId:e,datum:f,title:c,xKey:o,xName:a,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:r}=this.properties;return{marker:{shape:r.shape,fill:r.fill??t,stroke:r.stroke??e??t,fillOpacity:r.fillOpacity,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset,enabled:r.enabled},line:{stroke:e??t,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(t){if(!(this.properties.isValid()&&t==="category"))return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,title:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:n,legendItemName:a,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??o??r??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}plotNodeDataPoints(t,e){if(e.length===0)return;const i=e[0].point;t.moveTo(i.x,i.y);for(let s=1;s{this.resetPathAnimation(t),this.updateLinePaths(o,r)},h=()=>{e.skipCurrentBatch(),c()};if(r==null||a==null){c(),_o(this,e,"added",i),wl(this,"path_properties",e,"add",l),ft(this,"labels",e,s),ft(this,"annotations",e,...n);return}if(r.crossFiltering!==a.crossFiltering){h();return}const u=ey(r,a,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;zt(this.id,"path_properties",e,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(o,r):u.status==="removed"?this.updateLinePaths(o,a):Ll(this.id,"path_update",e,[l],u.stroke.path),u.hasMotion&&(_o(this,e,void 0,i),ft(this,"labels",e,s),ft(this,"annotations",e,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Q}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,{...zs(t,e,i,s,n),highlighted:!0})}computeFocusBounds(t){return Uo(this,t)}};Rl.className="LineSeries",Rl.type="line";var dy={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new Rl(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear",tension:1,position:"end"},marker:{shape:"circle",size:7,strokeWidth:0},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}},paletteFactory:t=>{const{marker:e}=lu(t);return{stroke:e.fill,marker:e}}},py=class extends oe{constructor(){super(...arguments),this.placement="top"}};g([x(Ic)],py.prototype,"placement",2);var Et=class extends ys{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.label=new py,this.tooltip=new De,this.marker=new Ie}};g([x(T)],Et.prototype,"xKey",2),g([x(T)],Et.prototype,"yKey",2),g([x(T,{optional:!0})],Et.prototype,"labelKey",2),g([x(T,{optional:!0})],Et.prototype,"colorKey",2),g([x(T,{optional:!0})],Et.prototype,"xFilterKey",2),g([x(T,{optional:!0})],Et.prototype,"yFilterKey",2),g([x(T,{optional:!0})],Et.prototype,"xName",2),g([x(T,{optional:!0})],Et.prototype,"yName",2),g([x(T,{optional:!0})],Et.prototype,"labelName",2),g([x(T,{optional:!0})],Et.prototype,"colorName",2),g([x(Da,{optional:!0})],Et.prototype,"colorDomain",2),g([x(qe)],Et.prototype,"colorRange",2),g([x(T,{optional:!0})],Et.prototype,"title",2),g([wt("marker.shape")],Et.prototype,"shape",2),g([wt("marker.size")],Et.prototype,"size",2),g([wt("marker.fill")],Et.prototype,"fill",2),g([wt("marker.fillOpacity")],Et.prototype,"fillOpacity",2),g([wt("marker.stroke")],Et.prototype,"stroke",2),g([wt("marker.strokeWidth")],Et.prototype,"strokeWidth",2),g([wt("marker.strokeOpacity")],Et.prototype,"strokeOpacity",2),g([wt("marker.lineDash")],Et.prototype,"lineDash",2),g([wt("marker.lineDashOffset")],Et.prototype,"lineDashOffset",2),g([wt("marker.itemStyler",{optional:!0})],Et.prototype,"itemStyler",2),g([x(P)],Et.prototype,"label",2),g([x(P)],Et.prototype,"tooltip",2);var Tu=class extends _s{constructor(t){super({moduleCtx:t,directionKeys:fn,directionNames:mn,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Go,label:Ms},usesPlacedLabels:!0}),this.clipFocusBox=!1,this.properties=new Et,this.colorScale=new ks}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),r=this.colorScale.type,{xKey:o,yKey:a,xFilterKey:l,yFilterKey:c,labelKey:h,colorKey:u,colorDomain:d,colorRange:p}=this.properties,{dataModel:f,processedData:y}=await this.requestDataModel(t,this.data,{props:[at(o,s,{id:"xValue"}),at(a,n,{id:"yValue"}),...l!=null?[at(l,s,{id:"xFilterValue"})]:[],...c!=null?[at(c,n,{id:"yFilterValue"})]:[],...u?[at(u,r,{id:"colorValue"})]:[],...h?[at(h,"band",{id:"labelValue"})]:[]]});if(u){const b=f.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=d??y.domain.values[b]??[],this.colorScale.range=p,this.colorScale.update()}this.animationState.transition("updateData")}xCoordinateRange(t,e){const i=this.axes.x.scale.convert(t),s=.5*this.properties.size*e;return[i-s,i+s]}yCoordinateRange(t,e){const i=this.axes.y.scale.convert(t[0]),s=.5*this.properties.size*e;return[i-s,i+s]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],r=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return Ye(fs(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,processedData:i,colorScale:s,visible:n}=this,{xKey:r,yKey:o,xFilterKey:a,yFilterKey:l,labelKey:c,colorKey:h,xName:u,yName:d,labelName:p,marker:f,label:y}=this.properties,{placement:b}=y,m=le.anchor(f.shape),M=t.x,S=t.y;if(!(e&&i&&n&&M&&S))return;const v=e.resolveColumnById(this,"xValue",i),I=e.resolveColumnById(this,"yValue",i),L=h!=null?e.resolveColumnById(this,"colorValue",i):void 0,A=c!=null?e.resolveColumnById(this,"labelValue",i):void 0,D=a!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,C=l!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,N=M.scale,w=S.scale,O=(N.bandwidth??0)/2,B=(w.bandwidth??0)/2,rt=[],Y=y.getFont(),X=os.getMeasurer({font:Y});return(i.dataSources.get(this.id)??[]).forEach((st,K)=>{const z=v[K],G=I[K],$=N.convert(z)+O,Z=w.convert(G)+B,q=D!=null&&C!=null?D[K]===z&&C[K]===G:void 0,nt=this.getLabelText(y,{value:A!=null?A?.[K]:G,datum:st,xKey:r,yKey:o,labelKey:c,xName:u,yName:d,labelName:p}),V=X.measureText(nt),W=L!=null?s.convert(L[K]):void 0;rt.push({series:this,itemId:o,yKey:o,xKey:r,datum:st,datumIndex:K,xValue:z,yValue:G,capDefaults:{lengthRatioMultiplier:f.getDiameter(),lengthMax:1/0},point:{x:$,y:Z,size:f.size},midPoint:{x:$,y:Z},fill:W,label:{text:nt,...V},anchor:m,placement:b,selected:q})}),{itemId:o,nodeData:rt,labelData:rt,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:r}=this,{xKey:o,yKey:a,labelKey:l,marker:c}=r,{itemStyler:h}=c;if(h!=null)return this.cachedDatumCallback(Kt(t,s?"highlight":"node"),()=>h({seriesId:n,datum:e,xKey:o,yKey:a,labelKey:l,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:r,marker:o,highlightStyle:a}=this.properties,l=ot(i&&a.item,o.getStyle());e.each((c,h)=>{this.updateMarkerStyle(c,o,{datum:h,highlighted:i,xKey:s,yKey:n,labelKey:r},l,{selected:h.selected})}),i||o.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,title:d,tooltip:p}=r,f=n.x,y=n.y;if(!i||!s||!f||!y)return;const{datumIndex:b}=t,m=s.dataSources.get(this.id)?.[b],M=i.resolveColumnById(this,"xValue",s)[b],S=i.resolveColumnById(this,"yValue",s)[b];if(M==null)return;const v=this.getMarkerItemBaseStyle(!1);return Object.assign(v,this.getMarkerItemStyleOverrides(String(b),m,v,!1)),p.formatTooltip({symbol:this.legendItemSymbol(),title:d,data:[{label:a,fallbackLabel:o,value:f.formatDatum(M)},{label:c,fallbackLabel:l,value:y.formatDatum(S)}]},{seriesId:e,datum:m,title:c,xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,...v,...this.getModuleTooltipParams()})}legendItemSymbol(){const{shape:t,fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties.marker;return{marker:{shape:t,fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{yKey:e,yName:i,title:s,showInLegend:n}=this.properties,{id:r,ctx:{legendManager:o},visible:a}=this;return[{legendType:"category",id:r,itemId:e,seriesId:r,enabled:a&&o.getItemEnabled({seriesId:r,itemId:e}),label:{text:s??i??e},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;fu(this,this.ctx.animationManager,e),ft(this,"labels",this.ctx.animationManager,i),ft(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Q}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,labelKey:s,highlighted:!0})}computeFocusBounds(t){return Uo(this,t)}};Tu.className="ScatterSeries",Tu.type="scatter";var gD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:t=>new Tu(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fillOpacity:.8,tooltip:{position:{type:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}},paletteFactory:jo},gy=class md{constructor(e,i,s,n){this.startAngle=e,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new md(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[na](e,i){return new md(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}};function fy({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,r=1/0,o=-1/0,a=-1/0;const l=(c,h)=>{n=Math.min(c,n),r=Math.min(h,r),o=Math.max(c,o),a=Math.max(h,a)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),ws(0,t,e)&&l(s,0),ws(Math.PI*.5,t,e)&&l(0,s),ws(Math.PI,t,e)&&l(-s,0),ws(Math.PI*1.5,t,e)&&l(0,-s),new F(n,r,o-n,a-r)}function Pl(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:r}=i;if(i.startAngle===i.endAngle||sMath.max(n,r))return!1;const o=Kr(i.startAngle),a=Kr(i.endAngle),l=Math.atan2(e,t);return o=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function my(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=e,o={x:r*Math.cos(i),y:r*Math.sin(i)},a={x:r*Math.cos(s),y:r*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return or(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||or(t.start.x,t.start.y,t.end.x,t.end.y,a.x,a.y,c.x,c.y)||Gf(0,0,r,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function yy(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},r={x:t.x+t.width,y:t.y+t.height};return my({start:i,end:s},e)||my({start:n,end:r},e)}function xy(t,e,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*s)/(t+1*s))-e<0)return 1;let r=0,o=1;for(let a=0;a<8;a+=1){const l=(r+o)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?r=l:o=l}return r}var fD=1e-6;function $s(t,e){return Na(t,e)=2*Math.PI?2*Math.PI:Tt(e-t);return t=$s(t,i),e=t+n,{startAngle:t,endAngle:e}}function zl(t,e,i,s,n,r){const o=Math.sin(r),a=Math.cos(r),l=t**2+e**2-i**2;let c,h,u,d;if(a>.5){const S=o/a,v=1+S**2,I=-2*(t+e*S),L=I**2-4*v*l;if(L<0)return;const A=(-I+Math.sqrt(L))/(2*v),D=(-I-Math.sqrt(L))/(2*v);c=A,h=A*S,u=D,d=D*S}else{const S=a/o,v=1+S**2,I=-2*(e+t*S),L=I**2-4*v*l;if(L<0)return;const A=(-I+Math.sqrt(L))/(2*v),D=(-I-Math.sqrt(L))/(2*v);c=A*S,h=A,u=D*S,d=D}const p=a,f=o,y=c*p+h*f,b=u*p+d*f,m=y>0?$s(Math.atan2(h-e,c-t),s):NaN,M=b>0?$s(Math.atan2(d-e,u-t),s):NaN;if(m>=s&&m<=n)return m;if(M>=s&&M<=n)return M}function Fl(t,e,i,s,n,r){const o=Math.hypot(t,e),a=(o**2-i**2+r**2)/(2*o),l=o-a,c=Math.atan2(e,t),h=Math.acos(-l/i),u=$s(c+h,s),d=$s(c-h,s);if(u>=s&&u<=n)return u;if(d>=s&&d<=n)return d}var ku=class{constructor(t,e,i,s,n){this.cx=t,this.cy=e,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},ge=class extends we{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return fy(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=jl(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),r=jl(t.startAngle,t.endAngle,e);return new gy(Math.max(e,r.startAngle),Math.min(i,r.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,r,o,a){if(t<=0)return;const{startAngle:l,endAngle:c}=jl(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const p=a?this.getAngleOffset(h+t):this.getAngleOffset(u-t),f=o?l+p+e:c-p-e,y=a?h+t:u-t,b=y*Math.cos(f),m=y*Math.sin(f);if(d!=null&&(!o&&!(f>=l-1e-6&&f<=d.endAngle-1e-6)||o&&!(f>=d.startAngle+1e-6&&f<=c-1e-6)||a&&yd.outerRadius+1e-6))return;const M=new ku(b,m,t,i,s);if(d!=null){a?(M.clipStart(zl(b,m,t,i,s,d.endAngle)),M.clipEnd(zl(b,m,t,i,s,d.startAngle))):(M.clipStart(zl(b,m,t,i,s,d.startAngle)),M.clipEnd(zl(b,m,t,i,s,d.endAngle)));let A,D;if(o?(A=Fl(b,m,t,i,s,d.innerRadius),D=Fl(b,m,t,i,s,d.outerRadius)):(A=Fl(b,m,t,i,s,d.outerRadius),D=Fl(b,m,t,i,s,d.innerRadius)),M.clipStart(A),M.clipEnd(D),A!=null){const{x:C,y:N}=M.pointAt(A),w=$s(Math.atan2(N,C),l);o?r?.clipStart(w):n.clipEnd(w)}if(D!=null){const{x:C,y:N}=M.pointAt(D),w=$s(Math.atan2(N,C),l);o?n.clipStart(w):r?.clipEnd(w)}}if(d!=null){const{x:A,y:D}=M.pointAt((M.a0+M.a1)/2);if(!Pl(A,D,d))return}const{x:S,y:v}=M.pointAt(o===a?M.a0:M.a1),I=$s(Math.atan2(v,S),l),L=a?r:n;return o?L?.clipStart(I):L?.clipEnd(I),M}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:r}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:a,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=jl(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),f=this.normalizedClipSector(),y=u-h,b=y>=2*Math.PI-1e-6;if(e.clear(),d===0&&p===0||d>p)return;if((f?.startAngle??h)===(f?.endAngle??u))return;if(b&&this.clipSector==null&&o===0&&a===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,u),d>n&&(e.moveTo(i+d*Math.cos(u),s+d*Math.sin(u)),e.arc(i,s,d,u,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(d-p)<1e-6){e.arc(i,s,p,h,u,!1),e.arc(i,s,p,u,h,!0),e.closePath();return}const m=this.getAngleOffset(d),M=this.getAngleOffset(p);if(y<2*M)return;const v=(f?.innerRadius??d)>n,I=d0?Math.min(L/A,1):1;o*=D,a*=D,l*=D,c*=D;const C=xy(p,y-2*M,-o,-a);if(o*=C,a*=C,!I&&v){const E=xy(d,y-2*m,l,c);l*=E,c*=E}else l=0,c=0;const N=Math.max(o+l,a+c),w=N>0?Math.min(L/N,1):1;o*=w,a*=w,l*=w,c*=w;let O=0,B=0;const rt=o/(p-o),Y=a/(p-a);if(rt>=0&&rt<1-1e-6)O=Math.asin(rt);else{O=y/2;const E=p/(1/Math.sin(O)+1);o=Math.min(E,o)}if(Y>=0&&Y<1-1e-6)B=Math.asin(Y);else{B=y/2;const E=p/(1/Math.sin(B)+1);a=Math.min(E,a)}const X=Math.asin(l/(d+l)),J=Math.asin(c/(d+c)),st=f?.outerRadius??p,K=this.getAngleOffset(st),z=new ku(0,0,st,h+K,u-K),G=f?.innerRadius??d,$=this.getAngleOffset(G),Z=v?new ku(0,0,G,h+$,u-$):void 0;f!=null&&(z.clipStart(f.startAngle),z.clipEnd(f.endAngle),Z?.clipStart(f.startAngle),Z?.clipEnd(f.endAngle));const q=this.arc(o,O,h-Math.PI*.5,h+O,z,Z,!0,!1),nt=this.arc(a,B,u-B,u+Math.PI*.5,z,Z,!1,!1),V=this.arc(c,J,u+Math.PI*.5,u+Math.PI-J,z,Z,!1,!0),W=this.arc(l,X,h+Math.PI+X,h+Math.PI*1.5,z,Z,!0,!0);if(I){const E=y0&&E({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*f}),c=({radius:f})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*f});return{nodes:{toFn:(f,y,b,{prevLive:m})=>{let{startAngle:M,endAngle:S,innerRadius:v,outerRadius:I}=y;const{stroke:L,fill:A}=y.sectorFormat;if(b==="removed"&&m?(M=m.datum?.endAngle,S=m.datum?.endAngle):b==="removed"&&!m&&(M=o,S=o),b==="removed"){const D=l(y);v=D.innerRadius,I=D.outerRadius}return{startAngle:M,endAngle:S,outerRadius:I,innerRadius:v,stroke:L,fill:A}},fromFn:(f,y,b,{prevFromProps:m})=>{let{startAngle:M,endAngle:S,innerRadius:v,outerRadius:I}=f,{fill:L,stroke:A}=y.sectorFormat;if(b==="unknown"||b==="added"&&!m?(M=o,S=o,v=y.innerRadius,I=y.outerRadius):b==="added"&&m&&(M=m.endAngle??o,S=m.endAngle??o,v=m.innerRadius??y.innerRadius,I=m.outerRadius??y.outerRadius),b==="added"&&!t){const D=c(y);v=D.innerRadius,I=D.outerRadius}return b==="updated"&&(L=f.fill??L,A=(typeof f.stroke=="string"?f.stroke:void 0)??A),{startAngle:M,endAngle:S,innerRadius:v,outerRadius:I,fill:L,stroke:A,phase:a}}},innerCircle:{fromFn:(f,y)=>({size:f.previousDatum?.radius??f.size??0,phase:a}),toFn:(f,y)=>({size:y.radius??0})}}}function Ru(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,fill:e.sectorFormat.fill,stroke:e.sectorFormat.stroke}}function Pu(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),r=t.getItemNodes();for(const o of r)if(o.datum.missing!==!0&&ws(n,o.startAngle,o.endAngle)){const a=Math.sqrt(s*s+i*i);let l=0;return ao.outerRadius&&(l=a-o.outerRadius),{datum:o.datum,distance:l}}}var My=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(My||{}),_l=class extends Bh{constructor({useLabelLayer:t=!1,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,useLabelLayer:t,pickModes:e,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:i}),this.itemGroup=this.contentGroup.appendChild(new Q),this.nodeData=[],this.itemSelection=Wt.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Wt.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=Wt.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=Wt.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new Xr("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())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[t,1],this.highlightGroup.zIndex=[t,2],this.labelGroup.zIndex=[t,3],!0):!1}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new re;return t.pointerEvents=1,t}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&de([this.itemSelection,this.highlightSelection],t),e&&de([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&de([this.highlightSelection],e),i&&de([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof we&&i.datum===e)[0]}getSeriesRange(t,e){return[NaN,NaN]}},mD=class extends ao{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},ju=class extends _l{constructor(t){super({moduleCtx:t,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:Ru,label:Ms}}),this.properties=new ct,this.phantomNodeData=void 0,this.backgroundGroup=new ke({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new ki,this.radiusScale=new ki,this.phantomGroup=this.backgroundGroup.appendChild(new Q({name:"phantom"})),this.phantomSelection=Wt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Q({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Wt(this.calloutLabelGroup,Q),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Q({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new le({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new le({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Q({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Q({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=Wt.select(this.innerLabelsGroup,re),this.innerCircleSelection=Wt.select(this.innerCircleGroup,()=>new le({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=mD,this.angleScale=new ki,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){return new ge}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i}=this,{angleKey:s,angleFilterKey:n,radiusKey:r,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:l}=this.properties,c=(y,b,m)=>e&&this.ctx.legendManager.getItemEnabled({seriesId:i,itemId:m}),h=!this.ctx.animationManager.isSkipped(),u=[],d=[];l?u.push(wi(l,"band",{id:"legendItemKey"})):o?u.push(wi(o,"band",{id:"calloutLabelKey"})):a&&u.push(wi(a,"band",{id:"sectorLabelKey"}));const p=this.radiusScale.type,f=this.angleScale.type;r&&d.push(Wh(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax}),at(r,p,{id:"radiusRaw"}),yn("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&d.push(at(o,"band",{id:"calloutLabelValue"})),a&&d.push(at(a,"band",{id:"sectorLabelValue"})),l&&d.push(at(l,"band",{id:"legendItemValue"})),n&&d.push(fo(n,f,{id:"angleFilterValue",onlyPositive:!0,validation:c,invalidValue:0}),at(n,f,{id:"angleFilterRaw"}),yn("angleFilterValue",[0,1],0,0)),h&&this.processedData&&u.length>0&&d.push(hr(this.id,this.processedData)),d.push(cr()),await this.requestDataModel(t,this.data,{props:[...u,fo(s,f,{id:"angleValue",onlyPositive:!0,validation:c,invalidValue:0}),at(s,f,{id:"angleRaw"}),yn("angleValue",[0,1],0,0),...d]});for(const y of this.processedData?.defs?.values??[]){const{id:b,missing:m,property:M}=y,S=Ih(this,m);b!=="angleRaw"&&S>0&&k.warnOnce(`no value was found for the key '${String(M)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,r=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:t,nodeData:[],labelData:[]};if(!i||e?.type!=="ungrouped")return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:u,radiusValues:d,radiusRawValues:p,calloutLabelValues:f,sectorLabelValues:y,legendItemValues:b}=this.getProcessedDataValues(i,e),m=u?.some((D,C)=>D>c[C])??!1;let M=0,S=0;const v=[],I=u!=null?[]:void 0,L=e.dataSources.get(this.id)??[],A=e.invalidData?.get(this.id);return L.forEach((D,C)=>{if(A?.[C]===!0)return;const N=m?h[C]:l[C],w=u!=null&&!m?Math.sqrt(u[C]/c[C]):1,O=s.convert(M)+Jt(o);M=N,S+=N;const B=s.convert(M)+Jt(o),rt=Math.abs(B-O),Y=O+rt/2,X=c[C],st=(d?.[C]??1)*w,K=p?.[C],z=b?.[C],G=this.getLabels(D,Y,rt,!0,f?.[C],y?.[C],z),$=this.getSectorFormat(D,C,!1),Z={itemId:C,series:this,datum:D,datumIndex:C,angleValue:X,midAngle:Y,midCos:Math.cos(Y),midSin:Math.sin(Y),startAngle:O,endAngle:B,radius:st,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(st),0),sectorFormat:$,radiusValue:K,legendItemValue:z,enabled:r&&n.getItemEnabled({seriesId:t,itemId:C}),focusable:!0,...G};v.push(Z),I?.push({...Z,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=S===0,this.zerosumInnerRing.visible=S===0&&a!=null&&a!==1&&a>0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:I}}getLabels(t,e,i,s,n,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={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},p={};return h&&i>=Jt(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(a,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Kr(t),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=oc(r,e.length);return e[o]}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,itemStyler:h}=this.properties,u=c[e%c.length],{fill:d,fillOpacity:p,stroke:f,strokeWidth:y,strokeOpacity:b,lineDash:m,lineDashOffset:M,cornerRadius:S}=ot(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:u,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties);let v;return h&&(v=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>h({datum:t,angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:d,fillOpacity:p,stroke:f,strokeWidth:y,strokeOpacity:b,lineDash:m,lineDashOffset:M,cornerRadius:S,highlighted:i,seriesId:this.id}))),{fill:v?.fill??d,fillOpacity:v?.fillOpacity??p,stroke:v?.stroke??f,strokeWidth:v?.strokeWidth??y,strokeOpacity:v?.strokeOpacity??b,lineDash:v?.lineDash??m,lineDashOffset:v?.lineDashOffset??M,cornerRadius:v?.cornerRadius??S}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,s=t*e+i;return s===t||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=cs(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const r=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(r)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:r,innerLabelsSelection:o}=this,a=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,h)=>{c.update(h,void 0,u=>this.getDatumId(u.datum,u.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(t,this.nodeData),l(e,a),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new ti;h.tag=0,h.pointerEvents=1,c.appendChild(h);const u=new re;u.tag=1,u.pointerEvents=1,c.appendChild(u)}),r.update(this.nodeData),s.update(a),o.update(this.properties.innerLabels,c=>{c.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),r=1;e=Math.ceil(n*2+r)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((r,{radius:o})=>{r.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:o})});const s=this.ctx.animationManager.isSkipped(),n=(r,o,a,l)=>{const c=this.getSectorFormat(o.datum,o.itemId,l);o.sectorFormat.fill=c.fill,o.sectorFormat.stroke=c.stroke,s&&(r.startAngle=o.startAngle,r.endAngle=o.endAngle,r.innerRadius=o.innerRadius,r.outerRadius=o.outerRadius),(l||s)&&(r.fill=c.fill,r.stroke=c.stroke),r.strokeWidth=c.strokeWidth,r.fillOpacity=c.fillOpacity,r.strokeOpacity=c.strokeOpacity,r.lineDash=c.lineDash,r.lineDashOffset=c.lineDashOffset,r.cornerRadius=c.cornerRadius,r.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(c.stroke!=null?c.strokeWidth:0))/2,0);r.inset=h,r.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((r,o,a)=>n(r,o,a,!1)),this.highlightSelection.each((r,o,a)=>{n(r,o,a,!0),r.visible=o.itemId===e?.itemId}),this.phantomSelection.each((r,o,a)=>n(r,o,a,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:t}=this.properties,e=t.length,i=t.strokeWidth,s=t.colors??this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((r,o)=>{const a=r.datum,{calloutLabel:l,outerRadius:c}=a;if(l?.text&&!l.hidden&&c!==0){r.visible=!0,r.strokeWidth=i,r.stroke=s[o%s.length],r.fill=void 0;const h=a.midCos*c,u=a.midSin*c;let d=a.midCos*(c+e),p=a.midSin*(c+e);if((l.collisionTextAlign??l.collisionOffsetY!==0)&&l.box!=null){const y=l.box;let b=d,m=p;dy.x+y.width&&(b=y.x+y.width),py.y+y.height&&(m=y.y+y.height);const M=b-d,S=m-p,v=Math.sqrt(Math.pow(M,2)+Math.pow(S,2)),I=v-n;I>0&&(d=d+M*I/v,p=p+S*I/v)}r.x1=h,r.y1=u,r.x2=d,r.y2=p}else r.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;e.x+an&&(l=(n-e.x)/e.width);const c=e.y+ao,h=l===1?t.length:Math.floor(t.length*l)-1,u=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,r=t.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!o(m));if(l.forEach(m=>{const M=m.calloutLabel;M!=null&&(M.hidden=!1,M.collisionTextAlign=void 0,M.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,M)=>m.midSin-M.midSin),h=l.filter(m=>m.midCos>=0).sort((m,M)=>m.midSin-M.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,M)=>m.midCos-M.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,M)=>m.midCos-M.midCos),p=m=>{const M=m.calloutLabel;if(M==null)return F.zero.clone();const S=m.outerRadius+i.length+s,v=m.midCos*S,I=m.midSin*S+M.collisionOffsetY,L=M.collisionTextAlign??M.textAlign,A=M.textBaseline;return re.computeBBox(M.text,v,I,{font:this.properties.calloutLabel,textAlign:L,textBaseline:A})},f=(m,M,S)=>{const v=p(m).grow(n/2),I=p(M).grow(n/2);v.xI.x&&(S==="to-top"?v.yI.y)&&(M.calloutLabel.collisionOffsetY=S==="to-top"?v.y-I.y-I.height:v.y+v.height-I.y)},y=m=>{const M=m.slice().sort((v,I)=>Math.abs(v.midSin)-Math.abs(I.midSin))[0],S=m.indexOf(M);for(let v=S-1;v>=0;v--){const I=m[v+1],L=m[v];f(I,L,"to-top")}for(let v=S+1;v{const M=l.some(D=>D.calloutLabel.collisionOffsetY!==0),S=m.map(D=>p(D)),v=S.map(D=>D.clone().grow(n/2));let I=!1;for(let D=0;D{const{startAngle:C,endAngle:N,outerRadius:w}=D;return{startAngle:C,endAngle:N,innerRadius:r,outerRadius:w}}),A=S.some(D=>L.some(C=>yy(D,C)));!I&&!M&&!A||m.filter(D=>D.calloutLabel.textAlign==="center").forEach(D=>{const C=D.calloutLabel;D.midCos<0?C.collisionTextAlign="right":D.midCos>0?C.collisionTextAlign="left":C.collisionTextAlign="center"})};y(c),y(h),b(u),b(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new re;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const{datum:c}=l,h=c.calloutLabel,u=e.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,f=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,b={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=f,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(b);const m=a.getBBox();let M=h.text,S=!0;if(i.avoidCollisions){const{textLength:v,hasVerticalOverflow:I}=this.getLabelOverflow(h.text,m,t);M=h.text.length===v?h.text:`${h.text.substring(0,v)}\u2026`,S=!I}l.text=M,l.x=f,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(b),l.fill=o,l.visible=S})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new re;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const f=d.outerRadius+n+r,y=d.midCos*f,b=d.midSin*f+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=b,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const M=-this.centerY,S=new F(h.x-a,M,h.width+2*a,h.y+h.height+a-M);if(m.collidesBBox(S)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:M,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:v}=this.getLabelOverflow(p.text,m,e),I=p.text.length>2&&M<2;if(S||I||v){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:F.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=(h,u)=>{const{sectorLabel:d,outerRadius:p}=u;let f=!1;if(d&&p!==0){const y=e*(1-a)+p*a+o;h.fill=l,h.fontStyle=s,h.fontWeight=n,h.fontSize=i,h.fontFamily=r,h.text=d.text,h.x=u.midCos*y,h.y=u.midSin*y,h.textAlign="center",h.textBaseline="middle";const b=h.getBBox(),m=[[b.x,b.y],[b.x+b.width,b.y],[b.x+b.width,b.y+b.height],[b.x,b.y+b.height]],{startAngle:M,endAngle:S}=u,v={startAngle:M,endAngle:S,innerRadius:e,outerRadius:p};m.every(([I,L])=>Pl(I,L,v))&&(f=!0)}h.visible=f};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:f,fontFamily:y,color:b}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=f,h.fontFamily=y,h.text=u.text,h.x=0,h.y=0,h.fill=b,h.textAlign="center",h.textBaseline="alphabetic",t.push(h.getBBox()),e.push(u.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,u,d)=>h+u.height+i(d)+s(d),0),r=Math.max(...t.map(h=>h.width)),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(r/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,u=-n/2;h{h.y=c[d],h.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return Pu(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:f}=n,y=this.properties.title.text;if(!i||!s)return;const{datumIndex:b}=t,m=s.dataSources.get(this.id)?.[b],{angleRawValues:M,legendItemValues:S,calloutLabelValues:v,sectorLabelValues:I}=this.getProcessedDataValues(i,s),L=M[b],A=S?.[b]??(o===h?void 0:v?.[b])??(l===h?void 0:I?.[b])??u;return f.formatTooltip({title:y,symbol:this.legendItemSymbol(b),data:[{label:A,fallbackLabel:h,value:as(L,3)}]},{seriesId:e,datum:m,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(m,b,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1);return{marker:{fill:i.fill,stroke:i.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:r}}=this;if(!s||!i||!this.properties.isValid()||t!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const{angleRawValues:u,calloutLabelValues:d,sectorLabelValues:p,legendItemValues:f}=this.getProcessedDataValues(s,i),y=this.properties.title?.showInLegend&&this.properties.title.text,b=[],m=this.properties.hideZeroValueSectorsInLegend,M=i.dataSources.get(this.id),S=i.invalidData?.get(this.id);for(let v=0;vi.toggleItem({enabled:n,seriesId:e,itemId:r})),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Mn(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);zt(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),zt(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),ft(this,"callout",e,this.calloutLabelSelection),ft(this,"sector",e,this.labelSelection),ft(this,"highlight",e,this.highlightLabelSelection),ft(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(p=>p.enabled),d=Mn(!1,this.properties.rotation,n,r);zt(this.id,"nodes",o,[t,e,i],d.nodes,(p,f)=>this.getDatumId(f.datum,f.datumIndex),a),zt(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),ft(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ft(this,"sector",this.ctx.animationManager,this.labelSelection),ft(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,ft(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=Mn(!1,this.properties.rotation,s,n);zt(this.id,"nodes",r,[t,e,i],o.nodes,(a,l)=>this.getDatumId(l.datum,l.datumIndex)),zt(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),Ks(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ks(this,"sector",this.ctx.animationManager,this.labelSelection),Ks(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),Ks(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?Kt(t[n]):i?Kt(t[i]):s?Kt(t[s]):`${e}`:`${e}`}};ju.className="DonutSeries",ju.type="donut";var yD={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Ys,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}},xD={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Ys,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},vy=({takeColors:t,colorsCount:e})=>{const{fills:i,strokes:s}=t(e);return{fills:i,strokes:s,calloutLine:{colors:s}}},bD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:t=>new ju(t),tooltipDefaults:{range:"exact"},themeTemplate:yD,paletteFactory:vy},Sy=class extends At{constructor(){super(...arguments),this.showInLegend=!1}};g([x(H)],Sy.prototype,"showInLegend",2);var Mr=class extends oe{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([x(R)],Mr.prototype,"offset",2),g([x(ut.restrict({min:0,max:360}))],Mr.prototype,"minAngle",2),g([x(R)],Mr.prototype,"minSpacing",2),g([x(R)],Mr.prototype,"maxCollisionOffset",2),g([x(H)],Mr.prototype,"avoidCollisions",2);var zu=class extends oe{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([x(ut)],zu.prototype,"positionOffset",2),g([x(xt)],zu.prototype,"positionRatio",2);var Gl=class extends et{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([x(qe,{optional:!0})],Gl.prototype,"colors",2),g([x(R)],Gl.prototype,"length",2),g([x(R)],Gl.prototype,"strokeWidth",2);var mt=class extends ei{constructor(){super(...arguments),this.fills=Object.values(Zt),this.strokes=Object.values(Ki),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.title=new Sy,this.shadow=new Ei,this.calloutLabel=new Mr,this.sectorLabel=new zu,this.calloutLine=new Gl,this.tooltip=new De}};g([x(T)],mt.prototype,"angleKey",2),g([x(T,{optional:!0})],mt.prototype,"angleName",2),g([x(T,{optional:!0})],mt.prototype,"angleFilterKey",2),g([x(T,{optional:!0})],mt.prototype,"radiusKey",2),g([x(T,{optional:!0})],mt.prototype,"radiusName",2),g([x(R,{optional:!0})],mt.prototype,"radiusMin",2),g([x(R,{optional:!0})],mt.prototype,"radiusMax",2),g([x(T,{optional:!0})],mt.prototype,"calloutLabelKey",2),g([x(T,{optional:!0})],mt.prototype,"calloutLabelName",2),g([x(T,{optional:!0})],mt.prototype,"sectorLabelKey",2),g([x(T,{optional:!0})],mt.prototype,"sectorLabelName",2),g([x(T,{optional:!0})],mt.prototype,"legendItemKey",2),g([x(qe)],mt.prototype,"fills",2),g([x(qe)],mt.prototype,"strokes",2),g([x(xt)],mt.prototype,"fillOpacity",2),g([x(xt)],mt.prototype,"strokeOpacity",2),g([x(Fi)],mt.prototype,"lineDash",2),g([x(R)],mt.prototype,"lineDashOffset",2),g([x(R)],mt.prototype,"cornerRadius",2),g([x(Ne,{optional:!0})],mt.prototype,"itemStyler",2),g([x(ut)],mt.prototype,"rotation",2),g([x(ut)],mt.prototype,"outerRadiusOffset",2),g([x(xt)],mt.prototype,"outerRadiusRatio",2),g([x(R)],mt.prototype,"strokeWidth",2),g([x(ut)],mt.prototype,"sectorSpacing",2),g([x(H)],mt.prototype,"hideZeroValueSectorsInLegend",2),g([x(P)],mt.prototype,"title",2),g([x(P)],mt.prototype,"shadow",2),g([x(P)],mt.prototype,"calloutLabel",2),g([x(P)],mt.prototype,"sectorLabel",2),g([x(P)],mt.prototype,"calloutLine",2),g([x(P)],mt.prototype,"tooltip",2);var MD=class extends ao{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Fu=class extends _l{constructor(t){super({moduleCtx:t,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:Ru,label:Ms}}),this.properties=new mt,this.phantomNodeData=void 0,this.backgroundGroup=new ke({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new ki,this.radiusScale=new ki,this.phantomGroup=this.backgroundGroup.appendChild(new Q({name:"phantom"})),this.phantomSelection=Wt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Q({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Wt(this.calloutLabelGroup,Q),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Q({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new le({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=MD,this.angleScale=new ki,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){const t=new ge;return t.miterLimit=1e9,t}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=(b,m,M)=>e&&s.getItemEnabled({seriesId:i,itemId:M}),u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(wi(c,"band",{id:"legendItemKey"})):a?d.push(wi(a,"band",{id:"calloutLabelKey"})):l&&d.push(wi(l,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,y=this.angleScale.type;o&&p.push(Wh(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax}),at(o,f,{id:"radiusRaw"}),yn("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(at(a,"band",{id:"calloutLabelValue"})),l&&p.push(at(l,"band",{id:"sectorLabelValue"})),c&&p.push(at(c,"band",{id:"legendItemValue"})),r&&p.push(fo(r,y,{id:"angleFilterValue",onlyPositive:!0,validation:h,invalidValue:0}),at(r,y,{id:"angleFilterRaw"}),yn("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&d.length>0&&p.push(hr(this.id,this.processedData)),p.push(cr()),await this.requestDataModel(t,this.data,{props:[...d,fo(n,y,{id:"angleValue",onlyPositive:!0,validation:h,invalidValue:0}),at(n,y,{id:"angleRaw"}),yn("angleValue",[0,1],0,0),...p]});for(const b of this.processedData?.defs?.values??[]){const{id:m,missing:M,property:S}=b,v=Ih(this,M);m!=="angleRaw"&&v>0&&k.warnOnce(`no value was found for the key '${String(S)}' on ${v} data element${v>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,r=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o}=this.properties;if(!i||e?.type!=="ungrouped")return;const{angleValues:a,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:u,radiusRawValues:d,calloutLabelValues:p,sectorLabelValues:f,legendItemValues:y}=this.getProcessedDataValues(i,e),b=h?.some((A,D)=>A>l[D])??!1;let m=0,M=0;const S=[],v=h!=null?[]:void 0,I=e.dataSources.get(this.id)??[],L=e.invalidData?.get(this.id);return I.forEach((A,D)=>{if(L?.[D]===!0)return;const C=b?c[D]:a[D],N=h!=null&&!b?Math.sqrt(h[D]/l[D]):1,w=s.convert(m)+Jt(o);m=C,M+=C;const O=s.convert(m)+Jt(o),B=Math.abs(O-w),rt=w+B/2,Y=l[D],J=(u?.[D]??1)*N,st=d?.[D],K=y?.[D],z=this.getLabels(A,rt,B,!0,p?.[D],f?.[D],K),G=this.getSectorFormat(A,D,!1),$={itemId:D,series:this,datum:A,datumIndex:D,angleValue:Y,midAngle:rt,midCos:Math.cos(rt),midSin:Math.sin(rt),startAngle:w,endAngle:O,radius:J,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(J),0),sectorFormat:G,radiusValue:st,legendItemValue:K,enabled:r&&n.getItemEnabled({seriesId:t,itemId:D}),...z};S.push($),v?.push({...$,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=M===0,{itemId:t,nodeData:S,labelData:S,phantomNodeData:v}}getLabels(t,e,i,s,n,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={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},p={};return h&&i>=Jt(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(a,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Kr(t),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=oc(r,e.length);return e[o]}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,itemStyler:h}=this.properties,u=c[e%c.length],{fill:d,fillOpacity:p,stroke:f,strokeWidth:y,strokeOpacity:b,lineDash:m,lineDashOffset:M,cornerRadius:S}=ot(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:u,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties);let v;return h&&(v=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>h({datum:t,angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:d,strokeOpacity:b,stroke:f,strokeWidth:y,fillOpacity:p,lineDash:m,lineDashOffset:M,cornerRadius:S,highlighted:i,seriesId:this.id}))),{fill:v?.fill??d,fillOpacity:v?.fillOpacity??p,stroke:v?.stroke??f,strokeWidth:v?.strokeWidth??y,strokeOpacity:v?.strokeOpacity??b,lineDash:v?.lineDash??m,lineDashOffset:v?.lineDashOffset??M,cornerRadius:v?.cornerRadius??S}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(t){const e=[0,this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=cs(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const r=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(r)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:r}=this,o=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),a=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datum,h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};a(t,this.nodeData),a(e,o),a(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new ti;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new re;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),r.update(this.nodeData),s.update(o)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.ctx.animationManager.isSkipped(),n=(r,o,a,l)=>{const c=this.getSectorFormat(o.datum,o.itemId,l);o.sectorFormat.fill=c.fill,o.sectorFormat.stroke=c.stroke,s&&(r.startAngle=o.startAngle,r.endAngle=o.endAngle,r.innerRadius=o.innerRadius,r.outerRadius=o.outerRadius),(l||s)&&(r.fill=c.fill,r.stroke=c.stroke),r.strokeWidth=c.strokeWidth,r.fillOpacity=c.fillOpacity,r.strokeOpacity=c.strokeOpacity,r.lineDash=c.lineDash,r.lineDashOffset=c.lineDashOffset,r.cornerRadius=c.cornerRadius,r.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(c.stroke!=null?c.strokeWidth:0))/2,0);r.inset=h,r.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((r,o,a)=>n(r,o,a,!1)),this.highlightSelection.each((r,o,a)=>{n(r,o,a,!0),r.visible=o.itemId===e?.itemId}),this.phantomSelection.each((r,o,a)=>n(r,o,a,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:t}=this.properties,e=t.length,i=t.strokeWidth,s=t.colors??this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((r,o)=>{const a=r.datum,{calloutLabel:l,outerRadius:c}=a;if(l?.text&&!l.hidden&&c!==0){r.visible=!0,r.strokeWidth=i,r.stroke=s[o%s.length],r.fill=void 0;const h=a.midCos*c,u=a.midSin*c;let d=a.midCos*(c+e),p=a.midSin*(c+e);if((l.collisionTextAlign??l.collisionOffsetY!==0)&&l.box!=null){const y=l.box;let b=d,m=p;dy.x+y.width&&(b=y.x+y.width),py.y+y.height&&(m=y.y+y.height);const M=b-d,S=m-p,v=Math.sqrt(Math.pow(M,2)+Math.pow(S,2)),I=v-n;I>0&&(d=d+M*I/v,p=p+S*I/v)}r.x1=h,r.y1=u,r.x2=d,r.y2=p}else r.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;e.x+an&&(l=(n-e.x)/e.width);const c=e.y+ao,h=l===1?t.length:Math.floor(t.length*l)-1,u=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,r=t.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!o(m));if(l.forEach(m=>{const M=m.calloutLabel;M!=null&&(M.hidden=!1,M.collisionTextAlign=void 0,M.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,M)=>m.midSin-M.midSin),h=l.filter(m=>m.midCos>=0).sort((m,M)=>m.midSin-M.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,M)=>m.midCos-M.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,M)=>m.midCos-M.midCos),p=m=>{const M=m.calloutLabel;if(M==null)return F.zero.clone();const S=m.outerRadius+i.length+s,v=m.midCos*S,I=m.midSin*S+M.collisionOffsetY,L=M.collisionTextAlign??M.textAlign,A=M.textBaseline;return re.computeBBox(M.text,v,I,{font:this.properties.calloutLabel,textAlign:L,textBaseline:A})},f=(m,M,S)=>{const v=p(m).grow(n/2),I=p(M).grow(n/2);v.xI.x&&(S==="to-top"?v.yI.y)&&(M.calloutLabel.collisionOffsetY=S==="to-top"?v.y-I.y-I.height:v.y+v.height-I.y)},y=m=>{const M=m.slice().sort((v,I)=>Math.abs(v.midSin)-Math.abs(I.midSin))[0],S=m.indexOf(M);for(let v=S-1;v>=0;v--){const I=m[v+1],L=m[v];f(I,L,"to-top")}for(let v=S+1;v{const M=l.some(D=>D.calloutLabel.collisionOffsetY!==0),S=m.map(D=>p(D)),v=S.map(D=>D.clone().grow(n/2));let I=!1;for(let D=0;D{const{startAngle:C,endAngle:N,outerRadius:w}=D;return{startAngle:C,endAngle:N,innerRadius:r,outerRadius:w}}),A=S.some(D=>L.some(C=>yy(D,C)));!I&&!M&&!A||m.filter(D=>D.calloutLabel.textAlign==="center").forEach(D=>{const C=D.calloutLabel;D.midCos<0?C.collisionTextAlign="right":D.midCos>0?C.collisionTextAlign="left":C.collisionTextAlign="center"})};y(c),y(h),b(u),b(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new re;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const{datum:c}=l,h=c.calloutLabel,u=e.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,f=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,b={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=f,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(b);const m=a.getBBox();let M=h.text,S=!0;if(i.avoidCollisions){const{textLength:v,hasVerticalOverflow:I}=this.getLabelOverflow(h.text,m,t);M=h.text.length===v?h.text:`${h.text.substring(0,v)}\u2026`,S=!I}l.text=M,l.x=f,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(b),l.fill=o,l.visible=S})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new re;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const f=d.outerRadius+n+r,y=d.midCos*f,b=d.midSin*f+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=b,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const M=-this.centerY,S=new F(h.x-a,M,h.width+2*a,h.y+h.height+a-M);if(m.collidesBBox(S)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:M,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:v}=this.getLabelOverflow(p.text,m,e),I=p.text.length>2&&M<2;if(S||I||v){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:F.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=e>0,h=this.ctx.legendManager.getData(this.id)?.filter(d=>d.enabled).length===1,u=(d,p)=>{const{sectorLabel:f,outerRadius:y,startAngle:b,endAngle:m}=p;let M=!1;if(f&&y!==0){const S=e*(1-a)+y*a+o;d.fill=l,d.fontStyle=s,d.fontWeight=n,d.fontSize=i,d.fontFamily=r,d.text=f.text,!c&&h?(d.x=0,d.y=0):(d.x=p.midCos*S,d.y=p.midSin*S),d.textAlign="center",d.textBaseline="middle";const I=d.getBBox(),L=[[I.x,I.y],[I.x+I.width,I.y],[I.x+I.width,I.y+I.height],[I.x,I.y+I.height]],A={startAngle:b,endAngle:m,innerRadius:e,outerRadius:y};L.every(([D,C])=>Pl(D,C,A))&&(M=!0)}d.visible=M};this.labelSelection.each(u),this.highlightLabelSelection.each(u)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(t){return Pu(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:f}=n,y=this.properties.title.text;if(!i||!s)return;const{datumIndex:b}=t,m=s.dataSources.get(this.id)?.[b],{angleRawValues:M,legendItemValues:S,calloutLabelValues:v,sectorLabelValues:I}=this.getProcessedDataValues(i,s),L=M[b],A=S?.[b]??(o===h?void 0:v?.[b])??(l===h?void 0:I?.[b])??u;return f.formatTooltip({title:y,symbol:this.legendItemSymbol(b),data:[{label:A,fallbackLabel:h,value:as(L,3)}]},{seriesId:e,datum:m,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(m,b,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1);return{marker:{fill:i.fill,stroke:i.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}}}getLegendData(t){const{id:e,visible:i,processedData:s,dataModel:n,ctx:{legendManager:r}}=this;if(!n||!s||t!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const{calloutLabelValues:u,sectorLabelValues:d,legendItemValues:p,angleRawValues:f}=this.getProcessedDataValues(n,s),y=this.properties.title?.showInLegend&&this.properties.title.text,b=[],m=this.properties.hideZeroValueSectorsInLegend,M=s.dataSources.get(this.id),S=s.invalidData?.get(this.id);for(let v=0;vi.toggleItem({enabled:n,seriesId:e,itemId:r})),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Mn(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);zt(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),ft(this,"callout",e,this.calloutLabelSelection),ft(this,"sector",e,this.labelSelection),ft(this,"highlight",e,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=Mn(!1,this.properties.rotation,n,r);zt(this.id,"nodes",o,[t,e,i],u.nodes,(d,p)=>this.getDatumId(p.datum,p.datumIndex),a),ft(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ft(this,"sector",this.ctx.animationManager,this.labelSelection),ft(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=Mn(!1,this.properties.rotation,s,n);zt(this.id,"nodes",r,[t,e,i],o.nodes,(a,l)=>this.getDatumId(l.datum,l.datumIndex)),Ks(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ks(this,"sector",this.ctx.animationManager,this.labelSelection),Ks(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?Kt(t[n]):i?Kt(t[i]):s?Kt(t[s]):`${e}`:`${e}`}};Fu.className="PieSeries",Fu.type="pie";var vD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:t=>new Fu(t),tooltipDefaults:{range:"exact"},themeTemplate:xD,paletteFactory:vy};function Bu(){_i.register(Im,jI,oI,eD,cy,uD,dy,gD,bD,vD,dD);for(const t of[Bs,Zn,gn,ur,xn])ps.register(t.type,{moduleFactory:e=>new t(e)})}function SD(){for(const t of _i.modules){if(t.packageType==="enterprise"&&!qv(t)&&k.errorOnce("Unexpected enterprise module registered: "+t.identifier),t.type==="root"&&t.themeTemplate)for(const e of t.chartTypes)Lh.set(e,t.themeTemplate);if(t.type==="series"){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);We.register(t.identifier,t)}if(t.type==="series-option"&&t.themeTemplate)for(const e of t.seriesTypes)We.setThemeTemplate(e,t.themeTemplate);if(t.type==="axis-option"&&t.themeTemplate)for(const e of t.axisTypes){const i=ps.getThemeTemplate(e),s=ot(t.themeTemplate,i);ps.setThemeTemplate(e,s)}t.type==="axis"&&ps.register(t.identifier,t),t.type==="legend"&&Ah.register(t.identifier,t)}if(_i.hasEnterpriseModules()){const t=Jv();t.length>0&&k.errorOnce("Enterprise modules expected but not registered: ",t)}}var vr=class extends Qc{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}updatePosition(){super.updatePosition();const t=Pa(this),e=Zc(t);this.axisGroup.setProperties(this.getAxisTransform()),this.gridLineGroupSelection.each(e),this.tickLineGroupSelection.each(e),this.tickLabelGroupSelection.each(Xc())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};g([x(It(["polygon","circle"],"a polar axis shape"))],vr.prototype,"shape",2),g([x(xt)],vr.prototype,"innerRadiusRatio",2);var _u=class extends nl{constructor(t,e){super(t,e),this.padding=new Ps(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(t){const{layoutBox:e}=t;e.shrink(this.seriesArea.padding.toJson());const i=e.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(t,e,i,s){const n=this.axes.find(l=>l.direction==="x"),r=this.axes.find(l=>l.direction==="y");if(!(n instanceof vr)||!(r instanceof vr))return;const o=n.scale,a=r.innerRadiusRatio;n.innerRadiusRatio=a,n.computeRange(),n.gridLength=s,r.gridAngles=o.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>o.convert(l)),r.gridRange=n.range,r.range=[s,s*a],[n,r].forEach(l=>{l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()})}async computeCircle(t){const e=this.series.filter(ID),i=this.axes.filter(DD),s=(c,h,u)=>{this.updateAxes(t,c,h,u),e.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=u});const d=e.filter(p=>p.type==="donut"||p.type==="pie");if(d.length>1){const p=d.map(f=>{const y=f.getInnerRadius();return{series:f,innerRadius:y}}).sort((f,y)=>f.innerRadius-y.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let f=0;f{const h=[];for(const p of tn(i,e)){const f=await p.computeLabelsBBox({hideWhenNecessary:c},t);f&&h.push(f)}if(h.length===0){s(n,r,o);return}const u=F.merge(h),d=this.refineCircle(u,a,t);s(d.centerX,d.centerY,d.radius),a=d.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of tn(i,e))await c.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:a,centerX:n,centerY:r}}refineCircle(t,e,i){const n=-e,r=-e,o=e,a=e;let l=Math.max(0,n-t.x),c=Math.max(0,r-t.y),h=Math.max(0,t.x+t.width-o),u=Math.max(0,t.y+t.height-a);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,p=i.height-c-u;let f=Math.min(d,p)/2;const y=.5*i.width/2,b=.5*i.height/2,m=Math.min(y,b);if(fi.height){const L=i.height-2*f;Math.min(c,u)*2>L?(c=L/2,u=L/2):c>u?c=L-u:u=L-c}if(2*f+v>i.width){const L=i.width-2*f;Math.min(l,h)*2>L?(l=L/2,h=L/2):l>h?l=L-h:h=L-l}}const M=l+2*f+h,S=c+2*f+u;return{centerX:(i.width-M)/2+l+f,centerY:(i.height-S)/2+c+f,radius:f}}};_u.className="PolarChart",_u.type="polar";function ID(t){return t instanceof _l}function DD(t){return t instanceof vr}var AD={type:"chart",name:"polar",detect:Of,create(t,e){return new _u(t,e)}},vs={isEnterprise:!1},LD=["bar","line","scatter"],CD=void 0,ND=void 0;ND=CD;var TD=void 0,kD=void 0;kD=TD;var Gu=(t=>(t.POINTER="pointer",t.NODE="node",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_LEFT="top-left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t))(Gu||{}),wD=void 0,ED=void 0;ED=wD;var OD=void 0,RD=void 0;RD=OD;var fi=Symbol("IGNORED_PROP");function ii(t,e){const i={};for(const[s,n]of Object.entries(e))n!==fi&&Object.hasOwn(t,s)&&(i[s]=n);return i}function Iy(t){if(t===void 0)return;const{enabled:e,showArrow:i,range:s,position:n,delay:r,wrapping:o}=t;return Object.fromEntries(Object.entries({enabled:e,showArrow:i,range:s,position:n,delay:r,wrapping:o}).filter(([l,c])=>c!==void 0))}function PD(t){return t.type==="radial-gauge"}function jD(t){return t.type==="linear-gauge"}function zD(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,width:b,type:m,cursor:M,nodeClickRange:S,tooltip:v,value:I,scale:L={},startAngle:A,endAngle:D,highlightStyle:C,segmentation:N,bar:w,needle:O,targets:B,outerRadius:rt,innerRadius:Y,outerRadiusRatio:X,innerRadiusRatio:J,cornerRadius:st,cornerMode:K,label:z,secondaryLabel:G,spacing:$,...Z}=t,{fills:q,fillMode:nt,fill:V,fillOpacity:W,stroke:E,strokeWidth:_,strokeOpacity:U,lineDash:ht,lineDashOffset:dt,min:bt=0,max:Lt=1,interval:Vt={},label:Ut={}}=L,Yt=ii(t,{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,tooltip:Iy(v),width:b}),Be=ii(L,{fills:q,fillMode:nt,fill:V,fillOpacity:W,stroke:E,strokeWidth:_,strokeOpacity:U,lineDash:ht,lineDashOffset:dt}),qt=ii(t,{startAngle:fi,endAngle:fi,needle:O!=null?{enabled:!0,...O}:fi,scale:Be,type:m,cursor:M,nodeClickRange:S,listeners:a,tooltip:v,value:I,highlightStyle:C,segmentation:N,bar:w,targets:B,outerRadius:rt,innerRadius:Y,outerRadiusRatio:X,innerRadiusRatio:J,cornerRadius:st,cornerMode:K,label:z,secondaryLabel:G,spacing:$,...Z});return{...Yt,series:[qt],axes:[{type:"angle-number",min:bt,max:Lt,startAngle:A,endAngle:D,interval:Vt??{},label:Ut??{}},{type:"radius-number"}]}}function FD(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,width:b,type:m,cursor:M,nodeClickRange:S,tooltip:v,value:I,scale:L={},direction:A="vertical",thickness:D,highlightStyle:C,segmentation:N,bar:w,targets:O,cornerRadius:B,cornerMode:rt,label:Y,...X}=t,{fills:J,fillMode:st,fill:K,fillOpacity:z,stroke:G,strokeWidth:$,strokeOpacity:Z,lineDash:q,lineDashOffset:nt,min:V=0,max:W=1,interval:E={},label:_={}}=L,U=ii(t,{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,tooltip:Iy(v),width:b}),ht=ii(L,{fills:J,fillMode:st,fill:K,fillOpacity:z,stroke:G,strokeWidth:$,strokeOpacity:Z,lineDash:q,lineDashOffset:nt}),dt=ii(t,{scale:ht,type:m,cursor:M,nodeClickRange:S,listeners:a,tooltip:v,value:I,direction:A,thickness:D,highlightStyle:C,segmentation:N,bar:w,targets:O,cornerRadius:B,cornerMode:rt,label:Y,...X}),{placement:bt,...Lt}=_;let Vt,Ut;const Yt=A==="horizontal";Yt?(Vt=bt==="before"?"top":"bottom",Ut="left"):(Vt=bt==="after"?"right":"left",Ut="bottom");const Be={type:"number",position:Vt,min:V,max:W,reverse:!Yt,interval:E,label:Lt,nice:!1},qt={type:"number",position:Ut,min:0,max:1,label:{enabled:!1}};return{...U,series:[dt],axes:Yt?[Be,qt]:[qt,Be]}}function Dy(t,e){if(e==null)return t;const{targets:i,...s}=e;return t=ot(t,s),t.targets!=null&&i!=null&&(t.targets=ga(t.targets,i)),t}function BD(t,e){if(PD(t)){const M=Dy(t,e);return zD(M)}else if(jD(t)){const M=Dy(t,e);return FD(M)}const{animation:i,background:s,container:n,contextMenu:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,padding:d,subtitle:p,theme:f,title:y,tooltip:b,width:m}=t;return ii(t,{animation:i,background:s,container:n,contextMenu:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,padding:d,subtitle:p,theme:f,title:y,tooltip:b,width:m})}var mi={stroke:_t},ye={fill:Ao},Ay={color:"white",fill:_t},Ss={color:_t},Vl={color:Do,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Ul={...Vl,textAlign:"left"},Vu={...Vl,fontSize:{$ref:"fontSize"},color:No,fill:Lo,stroke:Co,strokeWidth:1,divider:{stroke:To,strokeWidth:1,strokeOpacity:.5}},Uu={...mi,background:{fill:ee,fillOpacity:.2},handle:{...ye},text:{...Ss},statistics:{...Vu}},_D={line:{...mi,handle:{...ye},text:{...Ss}},"horizontal-line":{...mi,handle:{...ye},axisLabel:{...Ay},text:{...Ss}},"vertical-line":{...mi,handle:{...ye},axisLabel:{...Ay},text:{...Ss}},"disjoint-channel":{...mi,background:{fill:ee,fillOpacity:.2},handle:{...ye},text:{...Ss}},"parallel-channel":{...mi,background:{fill:ee,fillOpacity:.2},handle:{...ye},text:{...Ss}},"fibonacci-retracement":{...mi,strokes:Io,rangeStroke:_t,handle:{...ye},text:{...Ss,position:"center"},label:{...Vl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...mi,strokes:Io,rangeStroke:_t,handle:{...ye},text:{...Ss,position:"center"},label:{...Vl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...mi,...Ul,color:{$ref:"textColor"},handle:{...ye},fill:ee,fillOpacity:.2},comment:{...Ul,color:"white",fontWeight:700,handle:{...ye},fill:_t},note:{...Ul,color:Ro,fill:_t,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ye},background:{fill:Eo,stroke:Oo,strokeWidth:1}},text:{...Ul,handle:{...ye}},arrow:{...mi,handle:{...ye},text:{...Ss}},"arrow-up":{fill:vo,handle:{...ye,stroke:_t}},"arrow-down":{fill:So,handle:{...ye,stroke:_t}},"date-range":{...Uu},"price-range":{...Uu},"date-price-range":{...Uu},"quick-date-price-range":{up:{...mi,fill:ee,fillOpacity:.2,handle:{...ye},statistics:{...Vu,color:"#fff",fill:ee,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...mi,stroke:wo,fill:ko,fillOpacity:.2,handle:{...ye,stroke:wo},statistics:{...Vu,color:"#fff",fill:ko,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}}};function ce(t,e){if(he(t))return e(t)}var GD=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],VD=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function UD(t,e,i){const{dateKey:s="date",highKey:n="high",openKey:r="open",lowKey:o="low",closeKey:a="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:u=!0,rangeButtons:d=!0,statusBar:p=!0,toolbar:f=!0,zoom:y=!0,theme:b,data:m,...M}=t,S=WD(b,c,s,n,o,r,a),v=YD(b,i,r,a,u,l),L={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},A=typeof b=="string"?!0:b?.overrides?.common?.annotations?.axesButtons?.enabled??!0,D={annotations:{enabled:f,optionsToolbar:{enabled:f},snap:!0,axesButtons:{enabled:A},toolbar:{enabled:f,buttons:VD,padding:0},data:m,xKey:s,volumeKey:u?l:void 0}},C=p?{statusBar:{enabled:!0,data:m,highKey:n,openKey:r,lowKey:o,closeKey:a,volumeKey:u?l:void 0}}:null,N={zoom:{enabled:y,autoScaling:{enabled:!0},enableIndependentAxes:!0}},w={ranges:{enabled:d}},O=u?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percentage",align:"end"}}]:[];return{theme:{baseTheme:typeof b=="string"?b:"ag-financial",...ot(typeof b=="object"?b:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:f},annotations:{..._D}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...v,...S],axes:[{type:"number",position:"right",keys:[r,a,n,o],interval:{maxSpacing:ce(b,B=>B.overrides?.common?.axes?.number?.interval?.maxSpacing)??45},label:{format:ce(b,B=>B.overrides?.common?.axes?.number?.label?.format)??".2f"},crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percentage",align:"start"}},...O,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:m,...D,...L,...C,...N,...w,...M}}function YD(t,e,i,s,n,r){if(!n)return[];const o=ce(t,l=>l.overrides?.bar?.series?.fill),a=o?{fill:o}:{itemStyler({datum:l}){const{up:c,down:h}=e().palette;return{fill:l[i]l.overrides?.bar?.series?.fillOpacity)??.5,...a,focusPriority:1,fastDataProcessing:!0}]}var Yu="range-area";function WD(t,e,i,s,n,r,o){const a={xKey:i,openKey:r,closeKey:o,highKey:s,lowKey:n},l={xKey:i,yKey:o},c={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return HD(c,a);case"line":return KD(c,t,l);case"step-line":return $D(c,t,l);case"hlc":return ZD(c,t,l,a);case"high-low":return XD(c,t,a);case"candlestick":return Ly(c,a);case"hollow-candlestick":return QD(c,t,a);default:return k.warnOnce(`unknown chart type: ${e}; expected one of: ${GD.join(", ")}`),Ly(c,a)}}function HD(t,e){return[{type:"ohlc",focusPriority:0,...t,...e}]}function KD(t,e,i){return[{type:"line",focusPriority:0,...t,...i,stroke:ce(e,s=>s.overrides?.line?.series?.stroke)??mr,marker:ce(e,s=>s.overrides?.line?.series?.marker)??{enabled:!1}}]}function $D(t,e,i){return[{type:"line",focusPriority:0,...t,...i,stroke:ce(e,s=>s.overrides?.line?.series?.stroke)??mr,interpolation:ce(e,s=>s.overrides?.line?.series?.interpolation)??{type:"step"},marker:ce(e,s=>s.overrides?.line?.series?.marker)??{enabled:!1}}]}function ZD(t,e,i,{xKey:s,highKey:n,closeKey:r,lowKey:o}){const a=Cy(Yu,e);return[{type:Yu,focusPriority:0,...t,xKey:s,yHighKey:n,yLowKey:r,fill:a.fill??vo,stroke:a.stroke??yl,fillOpacity:ce(e,l=>l.overrides?.["range-area"]?.series?.fillOpacity)??.3,strokeWidth:ce(e,l=>l.overrides?.["range-area"]?.series?.strokeWidth)??2},{type:Yu,focusPriority:0,...t,xKey:s,yHighKey:r,yLowKey:o,fill:a.fill??So,stroke:a.stroke??xl,fillOpacity:ce(e,l=>l.overrides?.["range-area"]?.series?.fillOpacity)??.3,strokeWidth:ce(e,l=>l.overrides?.["range-area"]?.series?.strokeWidth)??2},{type:"line",...t,...i,stroke:ce(e,l=>l.overrides?.line?.series?.stroke)??Ml,strokeWidth:ce(e,l=>l.overrides?.line?.series?.strokeWidth)??2,marker:ce(e,l=>l.overrides?.line?.series?.marker)??{enabled:!1}}]}function XD(t,e,{xKey:i,highKey:s,lowKey:n}){const r=Cy("range-bar",e);return[{type:"range-bar",...t,xKey:i,yHighKey:s,yLowKey:n,fill:r.fill??bl,stroke:r.stroke??mr,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function Ly(t,e){return[{type:"candlestick",focusPriority:0,...t,...e}]}function QD(t,e,i){const s=ce(e,n=>n.overrides?.candlestick?.series?.item);return[{type:"candlestick",focusPriority:0,...t,...i,item:{up:{fill:s?.up?.fill??"transparent"}}}]}function Cy(t,e){const i=ce(e,n=>n.overrides?.[t]?.series?.fill),s=ce(e,n=>n.overrides?.[t]?.series?.stroke);return{fill:i,stroke:s}}var Ny={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Il,lineDash:[0],label:{enabled:!1}}},Wu={...Ny,nice:!1},Hu={position:{type:"sparkline"}},Ku={style:[{stroke:{$ref:"gridLineColor"}}],width:2},qD={number:{gridLine:Ku},time:{gridLine:Ku},category:{gridLine:Ku}},JD={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Wu,interval:{values:[0]}},log:{...Wu},time:{...Wu},category:{...Ny}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Hu,range:"nearest"},axes:qD},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3},tooltip:Hu}},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4,tooltip:Hu}}}},Ty=Ee(tA);function tA(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:Ty(t.baseTheme,e)}:e}function ky(t){if(Array.isArray(t)&&t.length!==0){const e=t[0];if(typeof e=="number")return{data:t.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(s=>({x:s[0],y:s[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:t}}function eA(t,e){switch(t?.type){case"number":{const{type:i,min:s,max:n,reverse:r}=t;return ii(t,{type:i,reverse:r,min:s,max:n})}case"time":{const{type:i,min:s,max:n,reverse:r}=t;return ii(t,{type:i,reverse:r,min:s,max:n})}case"category":{const{type:i,paddingInner:s,paddingOuter:n,reverse:r}=t;return ii(t,{type:i,reverse:r,paddingInner:s,paddingOuter:n})}}return{type:e}}function iA(t,e,i){const s={};return t?.stroke!=null&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),t?.strokeWidth!=null&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),t?.visible!=null&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}var sA=Ee((t,e,i)=>s=>{const n=s.datum[s.xKey],r=s.datum[s.yKey],o=i!=null?s.datum[i]:s.datum,a=e?.renderer?.({context:t,datum:o,xValue:n,yValue:r});if(typeof a=="string")return a;const l=a?.title,c=a?.content;return l!=null&&c!=null?{heading:l,title:void 0,data:[{label:void 0,value:c}]}:{heading:l??c??r.toFixed(2),title:void 0,data:[]}});function nA(t){const{background:e,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,theme:u,data:d,crosshair:p,axis:f,min:y,max:b,tooltip:m,context:M,...S}=t,v=ii(t,{background:e,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,tooltip:fi,context:fi,data:fi,crosshair:fi,axis:fi,min:fi,max:fi,theme:fi}),{data:I,series:[L]=[],datumKey:A}=ky(d),D=S;L!=null&&Object.assign(D,L),D.tooltip={...m,renderer:sA(M,m,A)},v.theme=Ty(u,JD),v.data=I,v.series=[D];const C=D.type!=="bar"||D.direction!=="horizontal",[N,w]=C?["bottom","left"]:["left","bottom"],O={...eA(f,"category"),position:N,...ii(t,{crosshair:p})},B={type:"number",gridLine:iA(f,!1,t),position:w,...ii(t,{min:y,max:b})};return v.axes=C?[B,O]:[O,B],v}var rA={"price-volume":UD,gauge:BD,sparkline:nA},oA={sparkline:ky};function wy(t,e){let i=[];const s=Pf(t),n=gs(t),r=n?Ot.get(n):"unknown";for(const o of nr)if(!(r!=="unknown"&&!o.chartTypes.includes(r))){if(o.type==="root"||o.type==="legend"){const a=t[o.optionsKey];if(a==null)continue;o.optionsInnerKey?a[o.optionsInnerKey]&&(i.push(`${o.optionsKey}.${o.optionsInnerKey}`),delete a[o.optionsInnerKey]):(i.push(o.optionsKey),delete t[o.optionsKey])}else if(o.type==="axis"){if(!("axes"in t)||!t.axes?.some(a=>a.type===o.identifier))continue;i.push(`axis[type=${o.identifier}]`),t.axes=t.axes.filter(a=>a.type!==o.identifier)}else if(o.type==="axis-option"){if(!("axes"in t)||!t.axes?.some(a=>a[o.optionsKey]))continue;i.push(`axis.${o.optionsKey}`),t.axes.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}else if(o.type==="series"){if(o.community||!t.series?.some(a=>a.type===o.identifier))continue;i.push(`series[type=${o.identifier}]`),t.series=t.series.filter(a=>a.type!==o.identifier)}else if(o.type==="series-option"){if(!t.series?.some(a=>a[o.optionsKey]))continue;i.push(`series.${o.optionsKey}`),t.series.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}}if(i.length&&!e){s&&(i=["AgCharts.createGauge"]);let o="ag-charts-enterprise",a="https://www.ag-grid.com/charts/javascript/installation/";t.mode==="integrated"&&(o="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",a="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),k.warnOnce([`unable to use these enterprise features as '${o}' has not been loaded:`,"",...i,"",`See: ${a}`].join(` `))}}function aA(t){const e="mode"in t&&t.mode==="integrated";for(const i of _i.byType("root","legend")){const s=t[i.optionsKey],n=s!=null&&s.enabled===!1,r=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!e;n&&r&&delete t[i.optionsKey]}}function $u(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var Yl="white",Zu={get cartesian(){return{seriesTypes:Ot.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Ot.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Ot.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Ot.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Ot.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Ot.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Ot.gaugeTypes,commonOptions:[]}}},lA={"radial-gauge":!0,"linear-gauge":!0};function Ey(t){return lA[t]===!0}var cA=Object.values(Zu).reduce((t,{commonOptions:e})=>t.concat(e),[]),yi=class yd{static getAxisDefaults(e){return ot(e,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!1,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}},crosshair:{enabled:!0}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Ws,textAlign:Hs},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Ws,textAlign:Hs},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Ws,textAlign:Hs},legend:{position:"bottom",spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},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"}}}},tooltip:{enabled:!0,darkTheme:fr,delay:0},overlays:{darkTheme:fr},listeners:{}}}constructor(e={}){const{overrides:i,palette:s}=te(e),n=this.createChartConfigPerChartType(this.getDefaults()),r={};i&&this.mergeOverrides(n,r,i);const{fills:o,strokes:a,...l}=this.getDefaultColors();this.palette=Or(ot(s,{fills:Object.values(o),strokes:Object.values(a),...l})),this.paletteType=$u(s),this.config=Or(this.templateTheme(n)),this.presets=Or(r)}mergeOverrides(e,i,s){for(const{seriesTypes:n,commonOptions:r}of Object.values(Zu)){const o={...s.common};for(const a of cA)r.includes(a)||delete o[a];if(o)for(const a of n){const l=a;Ey(l)||(e[l]=ot(o,e[l]))}}Ot.seriesTypes.forEach(n=>{const r=n,o=s[r];Ey(r)?i[r]=o:e[r]=ot(o,e[r])})}createChartConfigPerChartType(e){for(const[i,{seriesTypes:s}]of Object.entries(Zu)){const n=Lh.get(i);for(const r of s)e[r]??(e[r]=te(n))}return e}getDefaults(){const e=(i,s)=>{const n={},r={axes:{},...Ah.getThemeTemplates(),...this.getChartDefaults(),...Lh.get(i)};for(const o of s){n[o]=ot(We.getThemeTemplate(o),n[o]??te(r));const{axes:a}=n[o];for(const l of ps.keys())a[l]=ot(a[l],ps.getThemeTemplate(l),yd.cartesianAxisDefault[l])}return n};return ot(e("cartesian",Ot.cartesianTypes),e("polar",Ot.polarTypes),e("hierarchy",Ot.hierarchyTypes),e("topology",Ot.topologyTypes),e("flow-proportion",Ot.flowProportionTypes),e("standalone",Ot.standaloneTypes),e("gauge",Ot.gaugeTypes))}static applyTemplateTheme(e,i,s){if(Ct(e))for(let n=0;nnew Is),MA=Ee(()=>new Sr),Xu={"ag-default-dark":MA,"ag-sheets-dark":Ee(()=>new mA),"ag-polychroma-dark":Ee(()=>new gA),"ag-vivid-dark":Ee(()=>new xA),"ag-material-dark":Ee(()=>new dA),"ag-financial-dark":Ee(()=>new hA),null:Ir,undefined:Ir,"ag-default":Ir,"ag-sheets":Ee(()=>new yA),"ag-polychroma":Ee(()=>new fA),"ag-vivid":Ee(()=>new bA),"ag-material":Ee(()=>new pA),"ag-financial":Ee(()=>new uA)},Hl=Ee(vA);function vA(t){if(t instanceof Is)return t;if(t==null||typeof t=="string"){const i=Xu[t];return i?i():(k.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),Ir())}const{errors:e}=Jo(t,IA,"theme");if(!e.length){const i=SA(t),s=i.baseTheme?Hl(i.baseTheme):Ir();return new s.constructor(i)}for(const{message:i}of e)k.warnOnce(i);return Ir()}function SA(t){let e=t,i,s;const n=[];for(;typeof e=="object";)i??(i=e.palette),s??(s=e.params),e.overrides&&n.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:ot(...n),params:s,palette:i}}var IA={baseTheme:sn(Xe,ic),overrides:ic,params:ic,palette:{fills:sc(Xe),strokes:sc(Xe),up:{fill:Xe,stroke:Xe},down:{fill:Xe,stroke:Xe},neutral:{fill:Xe,stroke:Xe}}},DA=new Set(["map-shape-background","map-line-background"]),Qu=class Xi{constructor(e,i,s,n,r,o=!1){this.themeParameters={},this.debug=Dt.create(!0,"opts"),this.optionMetadata=n??{},this.processedOverrides=i??{};let a=null;if(e instanceof Xi){if(a=e,this.specialOverrides=a.specialOverrides,!r)throw new Error("AG Charts - internal error: deltaOptions must be supplied.");this.userOptions=ot(r,te(a.userOptions,Xi.OPTIONS_CLONE_OPTS))}else this.userOptions=e,this.specialOverrides=this.specialOverridesDefaults({...s});o&&this.removeLeftoverSymbols(this.userOptions);let l,c,h,u,d;!o&&r!=null&&Xi.isFastPathDelta(r)&&a!=null?{activeTheme:l,processedOptions:c,defaultAxes:h,fastDelta:u}=this.fastSetup(r,a):{activeTheme:l,processedOptions:c,defaultAxes:h,themeParameters:d}=this.slowSetup(i,r,o),this.activeTheme=l,this.processedOptions=c,this.defaultAxes=h,this.fastDelta=u,this.themeParameters=d??{}}static isFastPathDelta(e){for(const i of Object.keys(e))if(!this.FAST_PATH_OPTIONS.has(i))return!1;return!0}fastSetup(e,i){const{activeTheme:s,defaultAxes:n,processedOptions:r}=i,{presetType:o}=this.optionMetadata,a=o?oA[o]:void 0;if(o!=null&&e.data!=null&&a!=null){const{series:c,data:h}=a(e.data);e=ot({series:c,data:h},e)}this.fastSeriesSetup(e,r);const l=ot(e,r);return{activeTheme:s,defaultAxes:n,processedOptions:l,fastDelta:e}}fastSeriesSetup(e,i){e.series&&(e.series?.every((s,n)=>Sg(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>ot(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=te(this.userOptions,Xi.OPTIONS_CLONE_OPTS);i&&(n=ot(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:r}=this.optionMetadata;if(r!=null){const m=rA[r],M=this.userOptions,S=this.userOptions.type,v=S!=null?Hl(this.userOptions.theme).presets[S]:void 0;this.debug(">>> AgCharts.createOrUpdate() - applying preset",M),n=m?.(M,v,()=>this.activeTheme)??n}vs.isEnterprise||wy(n);const o=Hl(n.theme);this.sanityCheck(n),this.removeDisabledOptions(n);const a=this.optionsType(n),{axes:l={},annotations:c={},series:h,...u}=this.getSeriesThemeConfig(a,o),[d,p]=this.splitAnnotationsOptions(c);this.annotationThemes=te(p);const f=this.getDefaultAxes(n,h);let y=ot(e,n,d,u,f);this.processAxesOptions(y,l),this.processSeriesOptions(y,o),this.processMiniChartSeriesOptions(y,o),y=te(y,Xi.OPTIONS_CLONE_OPTS);const b=this.getThemeParameters(o,y);return this.resolveThemeOperations(b,b),this.resolveThemeOperations(b,y),this.resolveThemeOperations(b,this.annotationThemes),(Th(y)||Rf(y)||uS(y))&&y.legend?.enabled==null&&(y.legend??(y.legend={}),y.legend.enabled=y.series.length>1),this.enableConfiguredOptions(y,this.userOptions),o.templateTheme(y,!1),this.removeDisabledOptions(n),aA(y),vs.isEnterprise||wy(y,!0),this.debug("AgCharts.createOrUpdate() - processed options",y),{activeTheme:o,processedOptions:y,defaultAxes:f,themeParameters:b}}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??cs(e.processedOptions,this.processedOptions)}getSeriesThemeConfig(e,i){return i?.config[e]??{}}getDefaultAxes(e,i){const s=this.optionsType(e);let n=e.series?.find(r=>(r.type??"line")===s)??{};return We.isDerivedDefaultAxes(s)&&(n=ot(n,i)),We.cloneDefaultAxes(s,n)}optionsType(e){return e.series?.[0]?.type??"line"}sanityCheck(e){this.axesTypeIntegrity(e),this.seriesTypeIntegrity(e),this.soloSeriesIntegrity(e)}splitAnnotationsOptions(e){const{axesButtons:i=null,enabled:s=null,optionsToolbar:n=null,toolbar:r=null,...o}=e;return i==null&&s==null&&n==null&&r==null?[{},o]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:n,toolbar:r}},o]}processAxesOptions(e,i){"axes"in e&&(e.axes=e.axes?.map(s=>{const{crossLines:n,...r}=ot(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=ga(s.crossLines,n));const o=r.gridLine?.style;s.gridLine?.style&&o?.length&&(s.gridLine.style=s.gridLine.style.map((d,p)=>d.stroke!=null||d.lineDash!=null?ot(d,o.at(p%o.length)):d));const{top:a,right:l,bottom:c,left:h,...u}=ot(s,r);return u}))}processSeriesOptions(e,i){const s=this.getTooltipPositionDefaults(e),n=he(e.theme)?$u(e.theme?.palette):"inbuilt",r={colourIndex:0,userPalette:n},o=e.series?.map(a=>{a.type??(a.type=this.getDefaultSeriesType(e));const{innerLabels:l,...c}=this.getSeriesThemeConfig(a.type,i).series??{},h=DA.has(a.type)?{colourIndex:0,userPalette:n}:r,u=this.getSeriesPalette(a.type,h,i),d=this.getTooltipRangeDefaults(e,a.type),p=ot(this.getSeriesGroupingOptions(a),a,s,d,c,u,{visible:!0});return p.innerLabels&&(p.innerLabels=ga(p.innerLabels,l)),p});e.series=this.setSeriesGroupingOptions(o??[])}processMiniChartSeriesOptions(e,i){let s=e.navigator?.miniChart?.series;if(s==null)return;const n={colourIndex:0,userPalette:he(e.theme)?$u(e.theme.palette):"inbuilt"};s=s.map(r=>{r.type??(r.type="line");const{innerLabels:o,...a}=this.getSeriesThemeConfig(r.type,i).series??{};return ot(this.getSeriesGroupingOptions(r),r,a,this.getSeriesPalette(r.type,n,i))}),e.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}getThemeParameters(e,i){const s=e.getPublicParameters();if(!xe(i.theme)||!i.theme.params)return s;const n=be(l=>Ge(l)&&jt.validColorString(l),"a color"),r={accentColor:n,axisColor:n,backgroundColor:n,borderColor:n,foregroundColor:n,fontFamily:Xe,fontSize:Qi,fontWeight:sn(Xe,Qi),gridLineColor:n,padding:Qi,subtleTextColor:n,textColor:n,chromeBackgroundColor:n,chromeFontFamily:Xe,chromeFontSize:Qi,chromeFontWeight:sn(Xe,Qi),chromeSubtleTextColor:n,chromeTextColor:n,inputBackgroundColor:n,inputTextColor:n,crosshairLabelBackgroundColor:n,crosshairLabelTextColor:n},{valid:o,errors:a}=Jo(i.theme.params,r);for(const{message:l}of a)k.warnOnce(l);return ot(o,s)}resolveThemeOperations(e,i){const s=Ig(i,e,new Set(["palette","data"]));this.debug("resolveTheme()",s)}getSeriesPalette(e,i,s){const n=We.getPaletteFactory(e),{colourIndex:r,userPalette:o}=i,{fills:a=[],strokes:l=[]}=s.palette;return n?.({userPalette:o,colorsCount:Math.max(a.length,l.length),themeTemplateParameters:s.getTemplateParameters(),palette:s.palette,takeColors(c){return i.colourIndex+=c,{fills:Dd(a,c,r),strokes:Dd(l,c,r)}}})}getSeriesGroupingOptions(e){const i=We.isGroupable(e.type),s=We.isStackable(e.type),n=We.isStackedByDefault(e.type);e.grouped&&!i&&k.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&k.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:o}=e;return o??(o=(n||e.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:s&&o,grouped:i&&r&&!(s&&o)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);this.debug("setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((r,o)=>{var a;return o.groupType==="default"||(r[a=o.seriesType]??(r[a]=0),r[o.seriesType]+=o.groupType==="stack"?1:o.series.length),r},{});return i.flatMap(r=>{var o;switch(s[o=r.seriesType]??(s[o]=0),r.groupType){case"stack":{const a=s[r.seriesType]++;return r.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:r.groupId,groupIndex:a,groupCount:n[r.seriesType],stackIndex:c,stackCount:r.series.length}}))}case"group":return r.series.map(a=>Object.assign(a,{seriesGrouping:{groupId:r.groupId,groupIndex:s[r.seriesType]++,groupCount:n[r.seriesType],stackIndex:0,stackCount:0}}))}return r.series}).map(({stacked:r,grouped:o,...a})=>a)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((s,n)=>{const r=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:r,series:[n],groupId:"__default__"});else{const o=this.getSeriesGroupId(n);if(!i.has(o)){const l={groupType:n.stacked?"stack":"group",seriesType:r,series:[],groupId:o};i.set(o,l),s.push(l)}i.get(o).series.push(n)}return s},[])}getDefaultSeriesType(e){switch(Js.detectChartDefinition(e).name){case"cartesian":return"line";case"polar":return"pie";case"hierarchy":return"treemap";case"topology":return"map-shape";case"flow-proportion":return"sankey";case"standalone":return"pyramid";case"gauge":return"radial-gauge";default:throw new Error("Invalid chart options type detected.")}}getTooltipPositionDefaults(e){const i=e.tooltip?.position;if(!xe(i))return;const{type:s,xOffset:n,yOffset:r}=i,o={};return Ge(s)&&Sx(Gu,s)&&(o.type=s),pt(n)&&(o.xOffset=n),pt(r)&&(o.yOffset=r),{tooltip:{position:o}}}getTooltipRangeDefaults(e,i){return{tooltip:{range:e.tooltip?.range??We.getTooltipDefauls(i)?.range}}}axesTypeIntegrity(e){if("axes"in e&&e.axes){const i=e.axes;for(const{type:s}of i)if(!pS(s)){delete e.axes;const n=[...ps.keys()].join(", ");k.warnOnce(`unknown axis type: ${s}; expected one of: ${n}`)}}}seriesTypeIntegrity(e){e.series=e.series?.filter(({type:i})=>{if(i==null||dS(i)||Uv(i))return!0;k.warnOnce(`unknown series type: ${JSON.stringify(i)}; expected one of: ${wf.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(e){const i=e.series;if(i&&i.length>1&&i.some(s=>We.isSolo(s.type))){const s=this.optionsType(e);if(We.isSolo(s))k.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=i.slice(0,1);else{const{solo:n,nonSolo:r}=ec(i,a=>We.isSolo(a.type)?"solo":"nonSolo"),o=px(n.map(a=>a.type)).join(", ");k.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=r}}}static enableConfiguredJsonOptions(e,i){typeof i=="object"&&"enabled"in i&&!i._enabledFromTheme&&e.enabled==null&&(i.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(e){e._enabledFromTheme!=null&&delete e._enabledFromTheme}enableConfiguredOptions(e,i){hs(i,Xi.enableConfiguredJsonOptions,new Set(["data","theme"]),e),hs(e,Xi.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static removeDisabledOptionJson(e){"enabled"in e&&e.enabled===!1&&Object.keys(e).forEach(i=>{i!=="enabled"&&delete e[i]})}removeDisabledOptions(e){hs(e,Xi.removeDisabledOptionJson,new Set(["data","theme"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!he(e)))for(const[i,s]of Object.entries(e))Ix(s)&&delete e[i]}removeLeftoverSymbols(e){hs(e,Xi.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window!=null?Rd(e.window):typeof window<"u"?e.window=window:typeof global<"u"&&(e.window=global.window),e.document!=null?Od(e.document):typeof document<"u"?e.document=document:typeof global<"u"&&(e.document=global.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};Qu.OPTIONS_CLONE_OPTS=new Set(["data","container"]),Qu.FAST_PATH_OPTIONS=new Set(["data","width","height"]);var Oy=Qu,AA=100,qu=class En{constructor(e,i,s,n,r,o=AA){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=r,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,r){return this.pools.has(e)||this.pools.set(e,new En(e,i,s,n,r)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}obtain(e){if(this.freePool.length===0&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),En.debug(`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i)):En.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)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");En.debug(`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),En.debug(`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e),this.cleanPoolTimer&&clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=setTimeout(()=>{this.cleanPool()},this.cleanupTimeMs)}cleanPool(){const e=this.freePool.splice(0);for(const i of e)this.destroyItem(i);En.debug(`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`)}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};qu.pools=new Map,qu.debug=Dt.create(!0,"pool");var LA=qu;Js.registerMany([rI,AD]);var As=Dt.create(!0,"opts"),Xs=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=vs.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return vs.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return Ry.getInstance(t)}static create(t,e){return As.group("AgCharts.create()",()=>{this.licenseCheck(t);const i=Ry.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&vs.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(t){return As.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return As.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge"}))}static __createSparkline(t){return As.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0})})}};Xs.licenseChecked=!1;var $i=class qs{static getInstance(e){const i=nl.getInstance(e);return i?tm.chartInstances.get(i):void 0}static initialiseModules(){qs.initialised||(Bu(),SD(),qs.initialised=!0)}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:s,licenseManager:n,processedOverrides:r=i?.chart.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart.chartOptions.specialOverrides??{},optionsMetadata:a=i?.chart.chartOptions.optionMetadata??{},deltaOptions:l,stripSymbols:c=!1}=e,h=vs.styles!=null?[["ag-charts-enterprise",vs.styles]]:[],{presetType:u}=a;qs.initialiseModules(),As(()=>[">>> AgCharts.createOrUpdate() user options",te(s)]);let d=s;Xs.optionsMutationFn&&d&&(d=Xs.optionsMutationFn(te(d),u),As(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",te(d)]));const{document:p,window:f,styleContainer:y,...b}=d??{},m=(l?i?.chart.getChartOptions():b)??b,M=new Oy(m,r,{...o,document:p,window:f,styleContainer:y},a,l,c);let S=!1,v=i?.chart,I;return(v==null||Js.detectChartDefinition(M.processedOptions)!==Js.detectChartDefinition(v.chartOptions.processedOptions))&&(I=this.getPool(M)?.obtain(M),I?v=I.item:(S=!0,v=qs.createChartInstance(M,v)),h.forEach(([L,A])=>{v?.ctx.domManager.addStyles(L,A)})),i==null?(i=new tm(v,qs.callbackApi,n),i.releaseChart=I?.release):(I||S)&&(i.releaseChart?.(),i.chart=v,i.releaseChart=I?.release),As.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[v.id]=v),v.queuedUserOptions.push(M.userOptions),v.queuedChartOptions.push(M),v.requestFactoryUpdate(L=>{As.group(">>>> Chart.applyOptions()",()=>{L.applyOptions(M);const A=L.queuedUserOptions.indexOf(M.userOptions)+1;L.queuedUserOptions.splice(0,A),L.queuedChartOptions.splice(0,A)})}),i}static markRemovedProperties(e,i,s=!1){if(typeof e!="object")return s;for(const[n,r]of Object.entries(e))typeof r>"u"&&(Object.assign(e,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(e,i){i=te(i,new Set(["data"]));const s=hs(i,qs.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);As(()=>[">>> AgCharts.updateUserDelta() user delta",te(i)]),qs.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0});return Js.detectChartDefinition(e.processedOptions).create(e,s)}static getPool(e){if(e.optionMetadata.pool===!0)return LA.getPool(e.optionMetadata.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};$i.caretaker=new jg(Qn),$i.initialised=!1,$i.callbackApi={caretaker:$i.caretaker,create(t,e,i,s){return $i.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s})},update(t,e){return $i.createOrUpdate({userOptions:t,proxy:e})},updateUserDelta(t,e){return $i.updateUserDelta(t,e)}},$i.detachAndClear=t=>t.detachAndClear(),$i.destroy=t=>t.destroy();var Ry=$i,Ju={};si(Ju,{Arc:()=>Zi,BBox:()=>F,Caption:()=>At,CategoryScale:()=>_r,Group:()=>Q,Line:()=>ti,LinearScale:()=>ki,Marker:()=>le,Path:()=>we,RadialColumnShape:()=>Mi,Rect:()=>Se,Scene:()=>Ka,Sector:()=>ge,Shape:()=>ci,TranslatableGroup:()=>ke,getRadialColumnWidth:()=>Py,toRadians:()=>Jt});var Zi=class extends we{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return vi(Tt(this.startAngle),Tt(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new F(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};Zi.className="Arc",g([tt()],Zi.prototype,"centerX",2),g([tt()],Zi.prototype,"centerY",2),g([tt()],Zi.prototype,"radius",2),g([tt()],Zi.prototype,"startAngle",2),g([tt()],Zi.prototype,"endAngle",2),g([tt()],Zi.prototype,"counterClockwise",2),g([tt()],Zi.prototype,"type",2);function td(t,e,i){const s=Math.sqrt(t**2+e**2),r=Math.atan2(e,t)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}var Mi=class extends we{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,this.isRadiusAxisReversed=!1}set cornerRadius(t){}computeBBox(){const{innerRadius:t,outerRadius:e,columnWidth:i}=this,s=this.getRotation(),n=-i/2,r=i/2,o=-e,a=-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:f}=td(d%2===0?n:r,d<2?o:a,s);l=Math.min(p,l),c=Math.min(f,c),h=Math.max(p,h),u=Math.max(f,u)}return new F(l,c,h-l,u-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=Na(t,e);return Tt(t+i/2+Math.PI/2)}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,innerRadius:e,outerRadius:i,path:s}=this,n=-t/2,r=t/2,o=-i,a=-e,l=this.getRotation(),c=[[n,a],[n,o],[r,o],[r,a]].map(([h,u])=>td(h,u,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:t,path:e,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:r,isRadiusAxisReversed:o}=this,a=vi(s,n),l=Math.asin(t/2/s),c=this.getRotation(),h=(D,C)=>td(D,C,c),u=(D,C)=>Math.sqrt(D**2+C**2),d=(D,C)=>C>D?0:Math.sqrt(D**2-C**2),p=(D,C,N)=>N?DC,f=a&&!isNaN(l)&&l=2*Math.PI){const p=t+r/2;t=p-Math.PI,e=p+Math.PI}const a=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),u=Math.floor(Math.sqrt((a-c)**2+(l-h)**2)),d=2*i*n;return Math.max(1,Math.min(d,u))}var ed={};si(ed,{ChartTheme:()=>Is,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Ao,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>No,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>To,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ko,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>wo,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Lo,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Co,DEFAULT_BACKGROUND_COLOUR:()=>ml,DEFAULT_CAPTION_ALIGNMENT:()=>Hs,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Ws,DEFAULT_COLOR_RANGE:()=>Sl,DEFAULT_DIVERGING_SERIES_COLOR_RANGE:()=>Ke,DEFAULT_FIBONACCI_STROKES:()=>Io,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>ee,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>_t,DEFAULT_FUNNEL_SERIES_COLOR_RANGE:()=>Yi,DEFAULT_GAUGE_SERIES_COLOR_RANGE:()=>pi,DEFAULT_GRIDLINE_ENABLED:()=>Wi,DEFAULT_HIERARCHY_FILLS:()=>Dl,DEFAULT_HIERARCHY_STROKES:()=>Al,DEFAULT_POLAR_SERIES_STROKE:()=>vl,DEFAULT_SEPARATION_LINES_COLOUR:()=>Mo,DEFAULT_SHADOW_COLOUR:()=>Ys,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Il,DEFAULT_TEXTBOX_COLOR:()=>Ro,DEFAULT_TEXTBOX_FILL:()=>Eo,DEFAULT_TEXTBOX_STROKE:()=>Oo,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Do,DEFAULT_TOOLBAR_POSITION:()=>Po,IS_COMMUNITY:()=>eu,IS_DARK_THEME:()=>fr,IS_ENTERPRISE:()=>iu,PALETTE_ALT_DOWN_FILL:()=>ou,PALETTE_ALT_DOWN_STROKE:()=>nu,PALETTE_ALT_NEUTRAL_FILL:()=>au,PALETTE_ALT_NEUTRAL_STROKE:()=>Ml,PALETTE_ALT_UP_FILL:()=>ru,PALETTE_ALT_UP_STROKE:()=>su,PALETTE_DOWN_FILL:()=>So,PALETTE_DOWN_STROKE:()=>xl,PALETTE_NEUTRAL_FILL:()=>bl,PALETTE_NEUTRAL_STROKE:()=>mr,PALETTE_UP_FILL:()=>vo,PALETTE_UP_STROKE:()=>yl,getChartTheme:()=>Hl,themeNames:()=>CA,themeSymbols:()=>tu,themes:()=>Xu});var CA=Object.keys(Xu),id={};si(id,{Color:()=>jt,interpolateColor:()=>_d});var jy={};si(jy,{AND:()=>zi,ARRAY:()=>Vr,ARRAY_OF:()=>is,AbstractBarSeries:()=>ry,AbstractBarSeriesProperties:()=>Su,ActionOnSet:()=>Ve,AnchoredPopover:()=>Gy,Animation:()=>Kd,AnimationManager:()=>rf,Arc:()=>Zi,Axis:()=>Qc,AxisGroupZIndexMap:()=>mg,AxisInterval:()=>cn,AxisLabel:()=>ae,AxisTick:()=>Kn,AxisTickGenerator:()=>xg,AxisTicks:()=>QA,BBox:()=>F,BBoxValues:()=>sa,BOOLEAN:()=>H,BOOLEAN_ARRAY:()=>Ub,Background:()=>dr,BackgroundModule:()=>Im,BandScale:()=>Br,BarSeries:()=>Ol,BarSeriesModule:()=>cy,BaseModuleInstance:()=>za,BaseProperties:()=>et,BaseToolbar:()=>gd,ButtonWidget:()=>ro,COLOR_GRADIENT:()=>hp,COLOR_STRING:()=>gt,COLOR_STRING_ARRAY:()=>qe,CachedTextMeasurer:()=>Op,CachedTextMeasurerPool:()=>os,Caption:()=>At,CartesianAxis:()=>so,CartesianSeries:()=>_s,CartesianSeriesNodeEvent:()=>Gh,CartesianSeriesProperties:()=>ys,CategoryAxis:()=>Zn,CategoryScale:()=>_r,ChangeDetectableProperties:()=>$h,Chart:()=>nl,ChartAxisDirection:()=>Bc,ChartEventManager:()=>of,ChartOptions:()=>Oy,ChartUpdateType:()=>oo,CollapseMode:()=>Vm,Color:()=>jt,ColorScale:()=>ks,ConicGradient:()=>iL,ContextMenuRegistry:()=>af,ContinuousScale:()=>yt,DATE:()=>bc,DATE_ARRAY:()=>Yb,DATE_OR_DATETIME_MS:()=>Mc,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>fn,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>mn,DEFAULT_TOOLTIP_CLASS:()=>ve,DEFAULT_TOOLTIP_DARK_CLASS:()=>Kf,DIRECTION:()=>pp,DOMManager:()=>Hg,DataController:()=>Tf,DataModel:()=>Cf,DataModelSeries:()=>Bh,DataService:()=>$a,Debug:()=>Dt,Default:()=>Rs,Deprecated:()=>NA,DeprecatedAndRenamedTo:()=>TA,DragInterpreter:()=>gf,DraggablePopover:()=>Vy,DropShadow:()=>Ei,ExtendedPath2D:()=>lo,FONT_SIZE_RATIO:()=>Jh,FONT_STYLE:()=>ss,FONT_WEIGHT:()=>ns,FUNCTION:()=>Ne,FloatingToolbar:()=>oL,GREATER_THAN:()=>Yr,Gradient:()=>Ca,Group:()=>Q,GroupedCategoryAxis:()=>ur,HdpiCanvas:()=>yh,HierarchyNode:()=>KA,HierarchySeries:()=>$A,HierarchySeriesProperties:()=>Qs,HighlightManager:()=>lf,HighlightProperties:()=>_h,HighlightStyle:()=>uo,INTERACTION_RANGE:()=>La,INTERPOLATION_STEP_POSITION:()=>Rm,INTERPOLATION_TYPE:()=>Om,Image:()=>Ar,InteractionManager:()=>sf,InteractionState:()=>ef,InterpolationProperties:()=>yr,Invalidating:()=>Vn,LABEL_PLACEMENT:()=>Ic,LARGEST_KEY_INTERVAL:()=>dm,LESS_THAN:()=>Ur,LINE_CAP:()=>Wb,LINE_DASH:()=>Fi,LINE_JOIN:()=>Hb,LINE_STYLE:()=>Kb,Label:()=>oe,LayoutElement:()=>hh,LayoutManager:()=>Og,LegendMarkerLabel:()=>di,Line:()=>ti,LineSeries:()=>Rl,LineSeriesModule:()=>dy,LinearGradient:()=>Lc,LinearScale:()=>ki,Listeners:()=>ds,LogScale:()=>zh,LonLatBBox:()=>ZA,MARKER_SHAPE:()=>Zh,MATCHING_CROSSLINE_TYPE:()=>Hc,MAX_SPACING:()=>fp,MIN_SPACING:()=>gp,Marker:()=>le,Menu:()=>sL,MercatorScale:()=>XA,ModuleRegistry:()=>Js,Motion:()=>fc,NAN:()=>Sa,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Si,NUMBER:()=>ut,NUMBER_ARRAY:()=>Da,NUMBER_OR_NAN:()=>Un,NativeWidget:()=>tr,NiceMode:()=>dg,Node:()=>Cs,NumberAxis:()=>Bs,OBJECT:()=>P,OBJECT_ARRAY:()=>vc,OR:()=>Ts,OVERFLOW_STRATEGY:()=>Zb,ObserveChanges:()=>Os,OrdinalTimeScale:()=>Bi,PHASE_METADATA:()=>Pr,PHASE_ORDER:()=>jn,PLACEMENT:()=>Xb,PLAIN_OBJECT:()=>ap,POSITION:()=>Sc,POSITION_TOP_COORDINATES:()=>Ea,POSITIVE_NUMBER:()=>R,PREV_NEXT_KEYS:()=>qn,Padding:()=>Ps,ParallelStateMachine:()=>pM,Path:()=>we,PointerEvents:()=>Fd,PolarAxis:()=>vr,PolarSeries:()=>_l,PolarZIndexMap:()=>My,Popover:()=>pd,PropertiesArray:()=>Gr,ProxyInteractionService:()=>Zg,ProxyOnWrite:()=>gM,ProxyProperty:()=>wt,ProxyPropertyOnWrite:()=>pe,QUICK_TRANSITION:()=>fa,RATIO:()=>xt,REAL_NUMBER:()=>lp,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>ol,RadialColumnShape:()=>Mi,Range:()=>Di,Rect:()=>Se,RepeatType:()=>Hd,Rotatable:()=>Yn,RotatableGroup:()=>hM,RotatableText:()=>Rp,SKIP_JS_BUILTINS:()=>dc,SMALLEST_KEY_INTERVAL:()=>um,SORT_DOMAIN_GROUPS:()=>pm,STRING:()=>T,STRING_ARRAY:()=>up,Scalable:()=>Tc,ScalableGroup:()=>cM,Scene:()=>Ka,SceneChangeDetection:()=>j,ScenePathChangeDetection:()=>tt,Sector:()=>ge,SectorBox:()=>gy,Selection:()=>Wt,Series:()=>Ja,SeriesContentZIndexMap:()=>Ff,SeriesGroupingChangedEvent:()=>wh,SeriesItemHighlightStyle:()=>ms,SeriesMarker:()=>Ie,SeriesNodeEvent:()=>ao,SeriesNodePickMode:()=>Bf,SeriesProperties:()=>ei,SeriesTooltip:()=>De,SeriesZIndexMap:()=>zf,Shape:()=>ci,SimpleTextMeasurer:()=>Oc,SliderWidget:()=>fh,StateMachine:()=>Xr,StateMachineProperty:()=>dM,StopProperties:()=>Cc,SvgPath:()=>dd,TEXT_ALIGN:()=>dp,TEXT_WRAP:()=>Aa,TICK_INTERVAL:()=>ug,Text:()=>re,TextUtils:()=>Rt,TextWrapper:()=>Fc,ThemeConstants:()=>Am,ThemeSymbols:()=>tu,TimeScale:()=>$p,Toolbar:()=>nL,ToolbarButtonProperties:()=>Ko,ToolbarButtonWidget:()=>Uy,ToolbarWidget:()=>Wa,Tooltip:()=>Ui,TooltipManager:()=>Za,TooltipPosition:()=>lr,Transformable:()=>Ft,TransformableText:()=>Wn,Translatable:()=>ln,TranslatableGroup:()=>ke,TranslatableLine:()=>ja,UNION:()=>It,UpdateService:()=>vf,VERTICAL_ALIGN:()=>$b,Validate:()=>x,Vec2:()=>Dr,Vec4:()=>Sh,WIDGET_HTML_EVENTS:()=>oh,Widget:()=>Gi,WidgetEventUtil:()=>us,ZIndexMap:()=>hg,ZoomManager:()=>Mf,accumulateGroup:()=>fm,accumulateStack:()=>mm,accumulatedValue:()=>nm,accumulativeValueProperty:()=>fo,addHitTestersToQuadtree:()=>Mu,adjustLabelPlacement:()=>ly,angleBetween:()=>Na,animationValidation:()=>cr,applyShapeStyle:()=>xo,areScalingEqual:()=>xr,area:()=>Yh,buildFormatter:()=>Fr,buildResetPathFn:()=>xu,calculateDefaultTimeTickFormat:()=>np,calculateDerivativeExtrema:()=>Eh,calculateDerivativeExtremaXY:()=>Vf,calculateLabelChartPadding:()=>eg,calculateLabelTranslation:()=>Kc,calculatePlacement:()=>Oh,checkCrisp:()=>oy,clamp:()=>it,clampArray:()=>rc,clippedRoundRect:()=>gl,collapsedStartingBarPosition:()=>Yo,compareDates:()=>jp,computeBarFocusBounds:()=>Au,computeMarkerFocusBounds:()=>Uo,countExpandingSearch:()=>uf,countFractionDigits:()=>la,createButton:()=>qA,createCheckbox:()=>JA,createDatumId:()=>Kt,createDeprecationWarning:()=>sd,createElement:()=>lt,createElementId:()=>r0,createIcon:()=>Fy,createId:()=>oi,createSelect:()=>tL,createSvgElement:()=>ri,createTextArea:()=>eL,dateToNumber:()=>Me,datesSortOrder:()=>Vc,datumKeys:()=>qa,datumStylerProperties:()=>zs,deconstructSelectionsOrNodes:()=>ma,deepClone:()=>te,deepFreeze:()=>Or,defaultTimeTickFormat:()=>xc,diff:()=>hr,downloadUrl:()=>Pd,drawCorner:()=>yo,drawMarkerUnitPolygon:()=>co,easing:()=>fc,enterpriseModule:()=>vs,evaluateBezier:()=>tl,extent:()=>fs,extractDecoratedProperties:()=>Ud,findMinMax:()=>ue,findQuadtreeMatch:()=>vu,findRangeExtent:()=>Rn,fixNumericExtent:()=>Ye,focusCursorAtEnd:()=>s0,formatNumber:()=>Qp,formatPercent:()=>Xp,formatValue:()=>as,fromToMotion:()=>zt,generateUUID:()=>Tx,getAngleRatioRadians:()=>Dp,getColorStops:()=>Lp,getDateTicksForInterval:()=>Yc,getDatumRefPoint:()=>bh,getDocument:()=>qi,getElementBBox:()=>Mg,getIconClassNames:()=>Ba,getLastFocus:()=>ph,getMissCount:()=>Ih,getPath:()=>uc,getPathComponents:()=>Lf,getRadialColumnWidth:()=>Py,getWindow:()=>Nt,groupAccumulativeValueProperty:()=>Gs,groupAverage:()=>sm,groupCount:()=>Uh,groupStackValueProperty:()=>hm,groupSum:()=>im,hasNoModifiers:()=>Ya,inRange:()=>jd,initMenuKeyNav:()=>Gg,initRovingTabIndex:()=>_g,interpolatePoints:()=>Nl,isAgFlowProportionChartOptions:()=>hS,isAgGaugeChartOptions:()=>Pf,isAgHierarchyChartOptions:()=>lS,isAgStandaloneChartOptions:()=>Rf,isAgTopologyChartOptions:()=>cS,isBetweenAngles:()=>ws,isButtonClickEvent:()=>dh,isContinuous:()=>wa,isDecoratedObject:()=>pa,isDenseInterval:()=>to,isInputPending:()=>vg,isInteger:()=>zd,isNegative:()=>aa,isNumberEqual:()=>vi,isProperties:()=>ji,isScaleValid:()=>Bo,jsonApply:()=>no,jsonDiff:()=>cs,jsonPropertyCompare:()=>Sg,jsonResolveOperations:()=>Ig,jsonWalk:()=>hs,keyProperty:()=>wi,labelDirectionHandling:()=>cg,legendSymbolSvg:()=>Uf,lineDistanceSquared:()=>io,listDecoratedProperties:()=>nn,makeAccessibleClickListener:()=>j0,mapValues:()=>Wx,markerFadeInAnimation:()=>_o,markerPaletteFactory:()=>lu,markerScaleInAnimation:()=>fu,markerSwipeScaleInAnimation:()=>mu,mergeArrayDefaults:()=>ga,mergeDefaults:()=>ot,midpointStartingBarPosition:()=>iD,mod:()=>oc,moduleRegistry:()=>_i,motion:()=>lL,nearestSquared:()=>oa,nearestSquaredInContainer:()=>Rx,normaliseGroupTo:()=>hl,normalisePropertyTo:()=>yn,normalisedExtentWithMetadata:()=>Fh,normalizeAngle180:()=>Kr,normalizeAngle360:()=>Tt,normalizeAngle360Inclusive:()=>nM,objectsEqual:()=>rn,objectsEqualWith:()=>cc,pairUpSpans:()=>Fo,partialAssign:()=>gc,pathFadeInAnimation:()=>wl,pathMotion:()=>Ll,pathSwipeInAnimation:()=>yu,pickByMatchingAngle:()=>Pu,plotAreaPathFill:()=>iy,plotInterpolatedAreaSeriesFillSpans:()=>kl,plotInterpolatedLinePathStroke:()=>Tl,plotLinePathStroke:()=>du,predicateWithMessage:()=>Mt,prepareAreaFillAnimationFns:()=>sy,prepareAreaPathAnimation:()=>ny,prepareAxisAnimationContext:()=>Pa,prepareAxisAnimationFunctions:()=>pg,prepareBarAnimationFunctions:()=>Wo,prepareLinePathAnimation:()=>ey,prepareLinePathPropertyAnimation:()=>gu,prepareLinePathStrokeAnimationFns:()=>pu,preparePieSeriesAnimationFunctions:()=>Mn,range:()=>Jr,rangedValueProperty:()=>Wh,resetAxisGroupFn:()=>gg,resetAxisLabelSelectionFn:()=>Xc,resetAxisLineSelectionFn:()=>fg,resetAxisSelectionFn:()=>Zc,resetBarSelectionsFn:()=>Ho,resetIds:()=>Nx,resetLabelFn:()=>Ms,resetMarkerFn:()=>Go,resetMarkerPositionFn:()=>Vo,resetMotion:()=>de,resetPieSelectionsFn:()=>Ru,round:()=>Px,rowCountProperty:()=>cm,sanitizeHtml:()=>ar,scale:()=>Ae,sectorBox:()=>fy,seriesLabelFadeInAnimation:()=>ft,seriesLabelFadeOutAnimation:()=>Ks,setAttribute:()=>St,setAttributes:()=>un,setDocument:()=>Od,setElementBBox:()=>Fa,setElementStyle:()=>Ci,setPath:()=>pc,setWindow:()=>Rd,shallowClone:()=>ih,singleSeriesPaletteFactory:()=>jo,solveBezier:()=>el,sortAndUniqueDates:()=>Gc,splitBezier:()=>il,staticFromToMotion:()=>ts,stopPageScrolling:()=>Vg,sum:()=>aI,sumValues:()=>cl,swapAxisCondition:()=>wm,toDegrees:()=>rM,toRadians:()=>Jt,tooltipContentAriaLabel:()=>$f,trailingAccumulatedValue:()=>rm,trailingAccumulatedValueProperty:()=>hI,updateClipPath:()=>El,updateLabelNode:()=>ay,validateCrossLineValues:()=>tg,valueProperty:()=>at,visibleRangeIndices:()=>hf,without:()=>hc});function sd(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");k.warnOnce(i)}}function NA(t,e){const i=sd(),s=e?.default;return Ji((n,r,o)=>(o!==s&&i(r.toString(),t),o))}function TA(t,e){const i=sd();return Ji((s,n,r)=>(r!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),pc(s,t,e?e(r):r)),da),(s,n)=>(i(n.toString(),`Use [${t}] instead.`),uc(s,t)))}var Dr={add:kA,angle:jA,apply:WA,equal:UA,distance:OA,distanceSquared:RA,from:YA,gradient:FA,intercept:BA,intersectAtX:GA,intersectAtY:_A,length:rd,lengthSquared:EA,multiply:wA,normalized:PA,origin:od,required:HA,rotate:zA,round:VA,sub:nd};function kA(t,e){return typeof e=="number"?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}}function nd(t,e){return typeof e=="number"?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function wA(t,e){return typeof e=="number"?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}}function rd(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function EA(t){return t.x*t.x+t.y*t.y}function OA(t,e){const i=nd(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)}function RA(t,e){const i=nd(t,e);return i.x*i.x+i.y*i.y}function PA(t){const e=rd(t);return{x:t.x/e,y:t.y/e}}function jA(t,e=od()){return Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function zA(t,e,i=od()){const s=rd(t);return{x:i.x+s*Math.cos(e),y:i.y+s*Math.sin(e)}}function FA(t,e,i){const s=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/s}function BA(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function _A(t,e,i=0,s){return{x:t===1/0?1/0:(i-e)/t,y:s==null?i:s-i}}function GA(t,e,i=0,s){const n=t===1/0?1/0:t*i+e;return{x:i,y:s==null?n:s-n}}function VA(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function UA(t,e){return t.x===e.x&&t.y===e.y}function YA(t,e){if(typeof t=="number")return{x:t,y:e};if("currentX"in t)return{x:t.currentX,y:t.currentY};if("offsetWidth"in t)return{x:t.offsetWidth,y:t.offsetHeight};if("width"in t)return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y+t.height}];if("x1"in t)return[{x:t.x1,y:t.y1},{x:t.x2,y:t.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(t)}] [${e}]`)}function WA(t,e){return t.x=e.x,t.y=e.y,t}function HA(t){return{x:t?.x??0,y:t?.y??0}}function od(){return{x:0,y:0}}var zy=class ql{constructor(e,i,s,n,r,o,a,l,c){this.series=e,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=r,this.sumSize=o,this.depth=a,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=ql.Walk.PreOrder){i===ql.Walk.PreOrder&&e(this),this.children.forEach(s=>{s.walk(e,i)}),i===ql.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};zy.Walk={PreOrder:0,PostOrder:1};var KA=zy,$A=class extends Ja{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new ks,this.animationState=new Xr("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let r=0,o=1/0,a=-1/0;const l=(d,p,f)=>{const y=f.depth!=null?f.depth+1:0,b=e!=null?d[e]:void 0,m=b==null||b.length===0;let M=i!=null?d[i]:void 0;Number.isFinite(M)?M=Math.max(M,0):M=m?1:0;const S=M;r=Math.max(r,y);const v=s!=null?d[s]:void 0;return typeof v=="number"&&(o=Math.min(o,v),a=Math.max(a,v)),c(new t(this,p,d,M,v,S,y,f,[]),b)},c=(d,p)=>{const{datumIndex:f}=d;return p?.forEach((y,b)=>{const m=l(y,f.concat(b),d);d.children.push(m),d.sumSize+=m.sumSize}),d},h=c(new t(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),u=[o,a];this.colorScale.domain=ol.children[c],this.rootNode);if(s>0&&r.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=r.parent.children.length-1;n=n.slice(),n[n.length-1]=it(0,n[n.length-1]+i,l)}const o=n.reduce((l,c)=>l.children[c],this.rootNode),a=this.computeFocusBounds(this.datumSelection.at(e+1));if(a!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:o.depth,bounds:a,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){k.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}},Qs=class extends ei{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Zt),this.strokes=Object.values(Ki)}};g([x(T)],Qs.prototype,"childrenKey",2),g([x(T,{optional:!0})],Qs.prototype,"sizeKey",2),g([x(T,{optional:!0})],Qs.prototype,"colorKey",2),g([x(T,{optional:!0})],Qs.prototype,"colorName",2),g([x(qe)],Qs.prototype,"fills",2),g([x(qe)],Qs.prototype,"strokes",2),g([x(qe,{optional:!0})],Qs.prototype,"colorRange",2);var ZA=class{constructor(t,e,i,s){this.lon0=t,this.lat0=e,this.lon1=i,this.lat1=s}merge(t){this.lon0=Math.min(this.lon0,t.lon0),this.lat0=Math.min(this.lat0,t.lat0),this.lon1=Math.max(this.lon1,t.lon1),this.lat1=Math.max(this.lat1,t.lat1)}},Kl=Math.PI/180,ad=t=>t*Kl,ld=t=>-Math.log(Math.tan(Math.PI*.25+t*Kl*.5)),cd=t=>t/Kl,hd=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(Kl*.5),XA=class xd extends ya{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.bounds=xd.bounds(e)}static bounds(e){const[[i,s],[n,r]]=e,o=ad(i),a=ld(s),l=ad(n),c=ld(r);return new F(Math.min(o,l),Math.min(a,c),Math.abs(l-o),Math.abs(c-a))}static fixedScale(){return new xd([[cd(0),hd(0)],[cd(1),hd(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,r=1/0;for(const o of e)for(const[a,l]of o)i=Math.min(a,i),s=Math.max(a,s),n=Math.min(l,n),r=Math.max(l,r);return{domain:[[i,n],[s,r]],animatable:!0}}convert([e,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[(ad(e)-this.bounds.x)*a+s,(ld(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[cd((e-s)/a+this.bounds.x),hd((i-n)/l+this.bounds.y)]}},ud=class bd{constructor(){this.id=oi(this),this.axisGroup=new ke({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=Wt.select(this.axisGroup,re),this.interval=new cn,this.label=new ae,this.scale=new ki,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const e=[],i=this.generateTicks(),{translationX:s,translationY:n}=this;return this.labelSelection.update(i.ticks.map(r=>this.createLabelDatum(r)),void 0,r=>r.tickId),this.labelSelection.each((r,o)=>{r.setProperties(o),o.visible&&e.push(r.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:n}),F.merge(e)}getLabelParams(e){const{padding:i}=this,{translate:s}=e;switch(this.position){case"top":case"bottom":return{x:s,y:i,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:i,y:s,textAlign:"start",textBaseline:"middle"}}}inRange(e,i=.001){const[s,n]=ue(this.scale.range);return e>=s-i&&e<=n+i}createLabelDatum(e){const{x:i,y:s,textBaseline:n,textAlign:r}=this.getLabelParams(e);return{visible:!!e.tickLabel,tickId:e.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:e.tickLabel,textAlign:r,textBaseline:n,x:i,y:s}}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:r}=Kp(Rn(this.scale.range),1,e,i,bd.DefaultTickCount,bd.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:r,minTickCount:n,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const a=os.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let u=-1/0*h;o.ticks=o.ticks.filter(d=>Math.sign(d.translate-u)!==h?!1:(u=d.translate+a.textWidth(d.tickLabel,!0)*h,!0))}return o}getTicksData(e){const i=[],s=e.nice?this.scale.niceDomain(e):this.scale.domain,n=this.scale.ticks(e,s),r=n.reduce((l,c)=>Math.max(l,la(c)),0),o=qc(),a=this.label.format?this.scale.tickFormatter({domain:s,ticks:n,fractionDigits:r,specifier:this.label.format}):l=>as(l,r);for(let l=0;lt.onChange(i.checked,s)),i.addEventListener("keydown",s=>{dh(s)&&(s.preventDefault(),i.click())}),un(i,e),i}function tL(t,e){const i=lt("select",$l("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(s=>{const n=lt("option");return n.value=s.value,n.textContent=s.label,n})),St(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",s=>t.onChange(i.value,s)),un(i,e),i}function eL(t,e){const i=lt("textarea",$l("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",s=>t.onChange(i.value,s)),un(i,e),St(i,"data-preventdefault",!1),i}function Fy(t){const e=lt("span",`ag-charts-icon ag-charts-icon-${t}`);return St(e,"aria-hidden",!0),e}function $l(t,e){return e==null?t:`${t} ${e.class}`}var iL=class extends Ca{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e){const{angle:s}=this,n=Tt(Jt(s+90)),r=e.x+e.width*.5,o=e.y+e.height*.5;return t.createConicGradient(n,r,o)}},dd=class extends we{constructor(t=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=t}get d(){return this._d}set d(t){if(t!==this._d){this._d=t,this.commands.length=0;for(const[e,i,s]of t.matchAll(/([A-Z])([0-9. ]*)/g)){const n=s.split(/\s+/g).map(Number);this.commands.push([i,n])}this.checkPathDirty()}}updatePath(){const{path:t,x:e,y:i}=this;t.clear();let s=e,n=i;for(const[r,o]of this.commands)switch(r){case"M":t.moveTo(e+o[0],i+o[1]),s=e+o[0];break;case"C":t.cubicCurveTo(e+o[0],i+o[1],e+o[2],i+o[3],e+o[4],i+o[5]),s=e+o[4],n=i+o[5];break;case"H":t.lineTo(e+o[0],n),s=i+o[0];break;case"L":t.lineTo(e+o[0],i+o[1]),s=e+o[0],n=i+o[1];break;case"V":t.lineTo(s,i+o[0]),n=i+o[0];break;case"Z":t.closePath();break;default:throw new Error(`Could not translate command '${r}' with '${o.join(" ")}'`)}t.closePath()}};g([tt()],dd.prototype,"x",2),g([tt()],dd.prototype,"y",2);var Ar=class extends Cs{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};g([j()],Ar.prototype,"x",2),g([j()],Ar.prototype,"y",2),g([j()],Ar.prototype,"width",2),g([j()],Ar.prototype,"height",2),g([j()],Ar.prototype,"opacity",2);var By={};si(By,{ButtonWidget:()=>ro,NativeWidget:()=>tr,SliderWidget:()=>fh,ToolbarWidget:()=>Wa,WIDGET_HTML_EVENTS:()=>oh,Widget:()=>Gi,WidgetEventUtil:()=>us});var _y="canvas-overlay",pd=class extends za{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.moduleId=`popover-${e}`,i?.detached?this.element=lt("div"):this.element=t.domManager.addChild(_y,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>t.domManager.removeChild(_y,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),e?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=lt("div","ag-charts-popover");if(e.ariaLabel!=null&&i.setAttribute("aria-label",e.ariaLabel),e.class!=null&&i.classList.add(e.class),i.replaceChildren(...t),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const s=ph(e.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${Math.floor(t.x)}px`),t.y!=null&&e.style.setProperty("top",`${Math.floor(t.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},Gy=class extends pd{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}showWithChildren(t,e){const i=e.anchor??this.anchor,s=e.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(t,e);return i&&this.setAnchor(i,s),Nt().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=e.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:o}=s;let a=it(0,t.x,n.width-r),l=it(0,t.y,n.height-o);a!==t.x&&i?.x!=null&&(a=it(0,i.x-r,n.width-r)),l!==t.y&&i?.y!=null&&(l=it(0,i.y-o,n.height-o)),this.updatePosition({x:a,y:l})}},sL=class extends Gy{show(t){const e=t.items.map(s=>this.createRow(t,s)),i=this.showWithChildren(e,t);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=Gg({orientation:"vertical",menu:i,buttons:e,sourceEvent:t.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(t,e){const{menuItemRole:i="menuitem"}=t,s=e.value===t.value,n=lt("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(t.value===e.value).toString()),typeof e.value=="string"&&(n.dataset.popoverId=e.value),n.classList.toggle("ag-charts-menu__row--active",s),e.icon!=null){const l=lt("span",`ag-charts-menu__icon ${Ba(e.icon)}`);n.appendChild(l)}const r=e.strokeWidth!=null;if(r&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",r),n.style.setProperty("--strokeWidth",r?`${e.strokeWidth}px`:null)),e.label!=null){const l=lt("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(e.label),n.appendChild(l)}"altText"in e&&(n.ariaLabel=this.ctx.localeManager.t(e.altText));const o=()=>{t.onPress?.(e)},a=l=>{dh(l)&&(o(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",a),n.addEventListener("click",a),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},Vy=class extends pd{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Dr.from(t.clientX,t.clientY),position:Dr.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const s=Dr.sub(Dr.from(t.clientX,t.clientY),e.client),n=Dr.add(e.position,s),r=this.ctx.domManager.getBoundingClientRect(),o={};n.x>=r.x&&n.x+i.offsetWidth<=r.width&&(o.x=n.x),n.y>=r.y&&n.y+i.offsetHeight<=r.height&&(o.y=n.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},Ko=class extends et{};g([x(T,{optional:!0})],Ko.prototype,"icon",2),g([x(T,{optional:!0})],Ko.prototype,"label",2),g([x(T,{optional:!0})],Ko.prototype,"ariaLabel",2),g([x(T,{optional:!0})],Ko.prototype,"tooltip",2);var Uy=class extends ro{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;t.tooltip&&(this.elem.title=e.t(t.tooltip));let i="";if(t.icon!=null&&(i=``),t.label!=null){const s=e.t(t.label);i=`${i}${s}`}this.elem.innerHTML=i}setChecked(t){St(this.elem,"aria-checked",t)}},Yy="ag-charts-toolbar__button--active",gd=class extends Wa{constructor(t,e="horizontal"){super(e),this.localeManager=t,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new ds,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",e==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",e==="vertical")}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,s]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=t.length;ithis.getButtonWidgetBounds(t))}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds();return new F(i.x+e.x,i.y+e.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[r,o]of t.entries())i=!e&&r===0||n!=o.section,s=r===t.length-1||o.section!=t.at(r+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",r>0&&i),n=o.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof et?e.toJson():e},r=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:r})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:t}})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},nL=class extends gd{createButtonWidget(){return new Uy(this.localeManager)}},rL=class extends Vy{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new F(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:r,offsetHeight:o}=s;let a=t.y-o-i,l=t.x-r/2;n==="below"?a=t.y+i:n==="right"?(a=t.y-o/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(it(0,t.x,i.width-e.width)),t.y=Math.floor(it(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},oL=class extends gd{constructor(t,e){super(t.localeManager),this.hasPrefix=!0,this.popover=new rL(t,e,this.onPopoverMoved.bind(this)),this.dragHandle=new aL(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),s=this.dragHandle.getBounds();return new F(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},aL=class extends tr{constructor(t){super(lt("div","ag-charts-floating-toolbar__drag-handle"));const e=new tr(lt("span",`${Ba("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},lL={...Ed,...mp},cL={VERSION:Qn,_Scene:Ju,_Theme:ed,_Util:id,create:Xs.create.bind(Xs),createSparkline:Xs.__createSparkline.bind(Xs),setup:Bu,isEnterprise:!1};export{Xg as AG_CHARTS_LOCALE_EN_US,Xs as AgCharts,cL as AgChartsCommunityModule,LD as AgErrorBarSupportedSeriesTypes,Gu as AgTooltipPositionType,Qn as VERSION,jy as _ModuleSupport,Ju as _Scene,ed as _Theme,id as _Util,By as _Widget,Bu as setupCommunityModules,Zd as time};